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
be2cde9a479f2ef4843b760d79d3790c2a2e0c53
.travis.yml
.travis.yml
language: go go: - 1.4 - tip
language: go go: - 1.15 - tip arch: - amd64 - ppc64le
Add go 1.15 and Power Support ppc64le
Add go 1.15 and Power Support ppc64le
YAML
mit
cenkalti/rpc2
yaml
## Code Before: language: go go: - 1.4 - tip ## Instruction: Add go 1.15 and Power Support ppc64le ## Code After: language: go go: - 1.15 - tip arch: - amd64 - ppc64le
language: go + go: - - 1.4 ? ^ + - 1.15 ? ^^ - tip + + arch: + - amd64 + - ppc64le
7
1.75
6
1
e51e6c96093146c03b5fd7ffabb250f46c1d9f8f
Libs/Testing/CMakeLists.txt
Libs/Testing/CMakeLists.txt
project(CTKTesting) # CMake Macros include(CMake/ctkMacroGenerateMocs.cmake)
project(CTKTesting) # CMake Macros include(CMake/ctkMacroGenerateMocs.cmake) install(FILES ctkTest.h DESTINATION ${CTK_INSTALL_INCLUDE_DIR} COMPONENT Development )
Copy ctkTest.h in installed files
Copy ctkTest.h in installed files Closes #162
Text
apache-2.0
ddao/CTK,151706061/CTK,CJGoch/CTK,rkhlebnikov/CTK,pieper/CTK,laurennlam/CTK,finetjul/CTK,ddao/CTK,pieper/CTK,sankhesh/CTK,laurennlam/CTK,SINTEFMedtek/CTK,vovythevov/CTK,jcfr/CTK,sankhesh/CTK,danielknorr/CTK,espakm/CTK,Sardge/CTK,naucoin/CTK,rkhlebnikov/CTK,danielknorr/CTK,mehrtash/CTK,naucoin/CTK,sankhesh/CTK,commontk/CTK,sankhesh/CTK,danielknorr/CTK,ddao/CTK,vovythevov/CTK,msmolens/CTK,jcfr/CTK,Sardge/CTK,lassoan/CTK,lassoan/CTK,commontk/CTK,espakm/CTK,151706061/CTK,AndreasFetzer/CTK,jcfr/CTK,rkhlebnikov/CTK,finetjul/CTK,fedorov/CTK,SINTEFMedtek/CTK,danielknorr/CTK,naucoin/CTK,finetjul/CTK,151706061/CTK,pieper/CTK,CJGoch/CTK,vovythevov/CTK,Sardge/CTK,laurennlam/CTK,AndreasFetzer/CTK,SINTEFMedtek/CTK,fedorov/CTK,SINTEFMedtek/CTK,Sardge/CTK,lassoan/CTK,mehrtash/CTK,CJGoch/CTK,AndreasFetzer/CTK,msmolens/CTK,Heather/CTK,espakm/CTK,SINTEFMedtek/CTK,mehrtash/CTK,jcfr/CTK,AndreasFetzer/CTK,151706061/CTK,Heather/CTK,lassoan/CTK,CJGoch/CTK,151706061/CTK,commontk/CTK,fedorov/CTK,rkhlebnikov/CTK,naucoin/CTK,finetjul/CTK,espakm/CTK,fedorov/CTK,commontk/CTK,msmolens/CTK,laurennlam/CTK,pieper/CTK,vovythevov/CTK,msmolens/CTK,Heather/CTK,jcfr/CTK,ddao/CTK,mehrtash/CTK,Heather/CTK,CJGoch/CTK
text
## Code Before: project(CTKTesting) # CMake Macros include(CMake/ctkMacroGenerateMocs.cmake) ## Instruction: Copy ctkTest.h in installed files Closes #162 ## Code After: project(CTKTesting) # CMake Macros include(CMake/ctkMacroGenerateMocs.cmake) install(FILES ctkTest.h DESTINATION ${CTK_INSTALL_INCLUDE_DIR} COMPONENT Development )
project(CTKTesting) # CMake Macros include(CMake/ctkMacroGenerateMocs.cmake) + install(FILES + ctkTest.h + DESTINATION ${CTK_INSTALL_INCLUDE_DIR} COMPONENT Development + )
4
0.8
4
0
b5df165f184fda7c59a177688e2981033a6cf5d7
web_game_maker.js
web_game_maker.js
var WebGameMaker = {}; WebGameMaker.init = function() { var plugins = WebGameMaker.PluginManager.getPlugins(); for (p in plugins) { WebGameMaker.UI.addPluginButton(plugins[p]); } } window.addEventListener('load', function() { WebGameMaker.init(); }, false);
var WebGameMaker = {}; WebGameMaker.init = function() { var plugins = WebGameMaker.PluginManager.getPlugins(); for (p in plugins) { WebGameMaker.UI.addPluginButton(plugins[p]); } WebGameMaker.Game = new Game(); WebGameMaker.update(); } WebGameMaker.update = function() { draw_info = { 'canvas_context': document.getElementById('canvas').getContext('2d'), } WebGameMaker.Game.redraw(draw_info); window.requestAnimationFrame(WebGameMaker.update); } window.addEventListener('load', function() { WebGameMaker.init(); }, false);
Add update method to WebGameMaker
Add update method to WebGameMaker The update method should update all subsystems that might need to be updated, since this is the application main loop.
JavaScript
mit
sirjeppe/WebGameMaker,sirjeppe/WebGameMaker,sirjeppe/WebGameMaker
javascript
## Code Before: var WebGameMaker = {}; WebGameMaker.init = function() { var plugins = WebGameMaker.PluginManager.getPlugins(); for (p in plugins) { WebGameMaker.UI.addPluginButton(plugins[p]); } } window.addEventListener('load', function() { WebGameMaker.init(); }, false); ## Instruction: Add update method to WebGameMaker The update method should update all subsystems that might need to be updated, since this is the application main loop. ## Code After: var WebGameMaker = {}; WebGameMaker.init = function() { var plugins = WebGameMaker.PluginManager.getPlugins(); for (p in plugins) { WebGameMaker.UI.addPluginButton(plugins[p]); } WebGameMaker.Game = new Game(); WebGameMaker.update(); } WebGameMaker.update = function() { draw_info = { 'canvas_context': document.getElementById('canvas').getContext('2d'), } WebGameMaker.Game.redraw(draw_info); window.requestAnimationFrame(WebGameMaker.update); } window.addEventListener('load', function() { WebGameMaker.init(); }, false);
var WebGameMaker = {}; WebGameMaker.init = function() { var plugins = WebGameMaker.PluginManager.getPlugins(); for (p in plugins) { WebGameMaker.UI.addPluginButton(plugins[p]); } + WebGameMaker.Game = new Game(); + WebGameMaker.update(); + } + + WebGameMaker.update = function() { + draw_info = { + 'canvas_context': document.getElementById('canvas').getContext('2d'), + } + + WebGameMaker.Game.redraw(draw_info); + window.requestAnimationFrame(WebGameMaker.update); } window.addEventListener('load', function() { WebGameMaker.init(); }, false);
11
0.785714
11
0
580868c63f61bb7f6576dc7b0029aa137e274a51
qnd/__init__.py
qnd/__init__.py
"""Quick and Distributed TensorFlow command framework""" from .flag import * from .run import def_run
"""Quick and Distributed TensorFlow command framework""" from .flag import * from .run import def_run __all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
Add __all__ variable to top level package
Add __all__ variable to top level package
Python
unlicense
raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd
python
## Code Before: """Quick and Distributed TensorFlow command framework""" from .flag import * from .run import def_run ## Instruction: Add __all__ variable to top level package ## Code After: """Quick and Distributed TensorFlow command framework""" from .flag import * from .run import def_run __all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
"""Quick and Distributed TensorFlow command framework""" from .flag import * from .run import def_run + + __all__ = ["add_flag", "add_required_flag", "FlagAdder", "def_run"]
2
0.5
2
0
72eefc9a6cba25a9191b878924acf95e4edf849f
README.md
README.md
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)). ## But how? Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable. How could you test this and ensure parity with your previous implementation, under load, with production data? Run it in production! ```python import laboratory experiment = laboratory.Experiment() with experiment.control() as c: c.record(get_objects_from_database()) with experiment.candidate() as c: c.record(get_objects_from_cache()) objects = experiment.run() ``` Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability. Laboratory will always return the result of the control block.
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)). ## Why? See Github's blog post - http://githubengineering.com/scientist/ ## But how? Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable. How could you test this and ensure parity with your previous implementation, under load, with production data? Run it in production! ```python import laboratory experiment = laboratory.Experiment() with experiment.control() as c: c.record(get_objects_from_database()) with experiment.candidate() as c: c.record(get_objects_from_cache()) objects = experiment.run() ``` Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability. Laboratory will always return the result of the control block.
Add link to Github's blog post
Add link to Github's blog post
Markdown
mit
joealcorn/laboratory,shaunvxc/laboratory
markdown
## Code Before: A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)). ## But how? Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable. How could you test this and ensure parity with your previous implementation, under load, with production data? Run it in production! ```python import laboratory experiment = laboratory.Experiment() with experiment.control() as c: c.record(get_objects_from_database()) with experiment.candidate() as c: c.record(get_objects_from_cache()) objects = experiment.run() ``` Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability. Laboratory will always return the result of the control block. ## Instruction: Add link to Github's blog post ## Code After: A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)). ## Why? See Github's blog post - http://githubengineering.com/scientist/ ## But how? Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable. How could you test this and ensure parity with your previous implementation, under load, with production data? Run it in production! ```python import laboratory experiment = laboratory.Experiment() with experiment.control() as c: c.record(get_objects_from_database()) with experiment.candidate() as c: c.record(get_objects_from_cache()) objects = experiment.run() ``` Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability. Laboratory will always return the result of the control block.
A Python library for carefully refactoring critical paths (and a port of [Github's Scientist](https://github.com/github/scientist)). + + + ## Why? + + See Github's blog post - http://githubengineering.com/scientist/ ## But how? Imagine you've implemented a complex caching strategy for some objects in your database and a stale cache is simply not acceptable. How could you test this and ensure parity with your previous implementation, under load, with production data? Run it in production! ```python import laboratory experiment = laboratory.Experiment() with experiment.control() as c: c.record(get_objects_from_database()) with experiment.candidate() as c: c.record(get_objects_from_cache()) objects = experiment.run() ``` Mark the original code as the control and any other implementations as candidates. Timing information is recorded about all control and candidate blocks, and any exceptions from the candidates will be swallowed so they don't affect availability. Laboratory will always return the result of the control block.
5
0.192308
5
0
6a6590fbdfd0266f2d5b90552de3279b4b57b24f
ReactCommon/fabric/components/text/text/TextShadowNode.h
ReactCommon/fabric/components/text/text/TextShadowNode.h
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <limits> #include <react/components/text/BaseTextShadowNode.h> #include <react/components/text/TextProps.h> #include <react/components/view/ViewEventEmitter.h> #include <react/core/ConcreteShadowNode.h> namespace facebook { namespace react { extern const char TextComponentName[]; using TextEventEmitter = TouchEventEmitter; class TextShadowNode : public ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>, public BaseTextShadowNode { public: static ShadowNodeTraits BaseTraits() { auto traits = ConcreteShadowNode::BaseTraits(); #ifdef ANDROID traits.set(ShadowNodeTraits::Trait::FormsView); traits.set(ShadowNodeTraits::Trait::FormsStackingContext); #endif return traits; } using ConcreteShadowNode::ConcreteShadowNode; #ifdef ANDROID using BaseShadowNode = ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>; TextShadowNode( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family, ShadowNodeTraits traits) : BaseShadowNode(fragment, family, traits), BaseTextShadowNode() { orderIndex_ = std::numeric_limits<decltype(orderIndex_)>::max(); } #endif }; } // namespace react } // namespace facebook
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <limits> #include <react/components/text/BaseTextShadowNode.h> #include <react/components/text/TextProps.h> #include <react/components/view/ViewEventEmitter.h> #include <react/core/ConcreteShadowNode.h> namespace facebook { namespace react { extern const char TextComponentName[]; using TextEventEmitter = TouchEventEmitter; class TextShadowNode : public ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>, public BaseTextShadowNode { public: static ShadowNodeTraits BaseTraits() { auto traits = ConcreteShadowNode::BaseTraits(); #ifdef ANDROID traits.set(ShadowNodeTraits::Trait::FormsView); #endif return traits; } using ConcreteShadowNode::ConcreteShadowNode; #ifdef ANDROID using BaseShadowNode = ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>; TextShadowNode( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family, ShadowNodeTraits traits) : BaseShadowNode(fragment, family, traits), BaseTextShadowNode() { orderIndex_ = std::numeric_limits<decltype(orderIndex_)>::max(); } #endif }; } // namespace react } // namespace facebook
Fix bug in TextInlineViews when using a deep nested hierarchy of Text and Images
Fix bug in TextInlineViews when using a deep nested hierarchy of Text and Images Summary: This fixes a bug in Android TextInlineViews that was reproducible in ActivityLog screen, see T63438920 Since Text are virtual nodes it is not necessary for these kind of views to stack views during diffing. changelog: [internal] Reviewed By: shergin Differential Revision: D20448085 fbshipit-source-id: 2d852975493bf6bcc7840c80c5de5cb5f7890303
C
mit
pandiaraj44/react-native,facebook/react-native,javache/react-native,exponentjs/react-native,javache/react-native,javache/react-native,janicduplessis/react-native,hoangpham95/react-native,janicduplessis/react-native,hammerandchisel/react-native,hoangpham95/react-native,exponentjs/react-native,janicduplessis/react-native,hammerandchisel/react-native,janicduplessis/react-native,exponent/react-native,pandiaraj44/react-native,hammerandchisel/react-native,hoangpham95/react-native,myntra/react-native,janicduplessis/react-native,facebook/react-native,pandiaraj44/react-native,myntra/react-native,myntra/react-native,exponent/react-native,exponentjs/react-native,janicduplessis/react-native,facebook/react-native,myntra/react-native,exponent/react-native,facebook/react-native,myntra/react-native,exponent/react-native,exponent/react-native,exponent/react-native,arthuralee/react-native,pandiaraj44/react-native,facebook/react-native,hoangpham95/react-native,hammerandchisel/react-native,myntra/react-native,exponent/react-native,javache/react-native,myntra/react-native,arthuralee/react-native,pandiaraj44/react-native,javache/react-native,janicduplessis/react-native,exponentjs/react-native,hoangpham95/react-native,exponent/react-native,hoangpham95/react-native,hammerandchisel/react-native,hammerandchisel/react-native,myntra/react-native,arthuralee/react-native,janicduplessis/react-native,arthuralee/react-native,exponentjs/react-native,exponentjs/react-native,javache/react-native,pandiaraj44/react-native,hammerandchisel/react-native,hoangpham95/react-native,exponentjs/react-native,javache/react-native,hoangpham95/react-native,facebook/react-native,facebook/react-native,pandiaraj44/react-native,facebook/react-native,pandiaraj44/react-native,javache/react-native,myntra/react-native,arthuralee/react-native,hammerandchisel/react-native,exponentjs/react-native,facebook/react-native,javache/react-native
c
## Code Before: /* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <limits> #include <react/components/text/BaseTextShadowNode.h> #include <react/components/text/TextProps.h> #include <react/components/view/ViewEventEmitter.h> #include <react/core/ConcreteShadowNode.h> namespace facebook { namespace react { extern const char TextComponentName[]; using TextEventEmitter = TouchEventEmitter; class TextShadowNode : public ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>, public BaseTextShadowNode { public: static ShadowNodeTraits BaseTraits() { auto traits = ConcreteShadowNode::BaseTraits(); #ifdef ANDROID traits.set(ShadowNodeTraits::Trait::FormsView); traits.set(ShadowNodeTraits::Trait::FormsStackingContext); #endif return traits; } using ConcreteShadowNode::ConcreteShadowNode; #ifdef ANDROID using BaseShadowNode = ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>; TextShadowNode( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family, ShadowNodeTraits traits) : BaseShadowNode(fragment, family, traits), BaseTextShadowNode() { orderIndex_ = std::numeric_limits<decltype(orderIndex_)>::max(); } #endif }; } // namespace react } // namespace facebook ## Instruction: Fix bug in TextInlineViews when using a deep nested hierarchy of Text and Images Summary: This fixes a bug in Android TextInlineViews that was reproducible in ActivityLog screen, see T63438920 Since Text are virtual nodes it is not necessary for these kind of views to stack views during diffing. changelog: [internal] Reviewed By: shergin Differential Revision: D20448085 fbshipit-source-id: 2d852975493bf6bcc7840c80c5de5cb5f7890303 ## Code After: /* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <limits> #include <react/components/text/BaseTextShadowNode.h> #include <react/components/text/TextProps.h> #include <react/components/view/ViewEventEmitter.h> #include <react/core/ConcreteShadowNode.h> namespace facebook { namespace react { extern const char TextComponentName[]; using TextEventEmitter = TouchEventEmitter; class TextShadowNode : public ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>, public BaseTextShadowNode { public: static ShadowNodeTraits BaseTraits() { auto traits = ConcreteShadowNode::BaseTraits(); #ifdef ANDROID traits.set(ShadowNodeTraits::Trait::FormsView); #endif return traits; } using ConcreteShadowNode::ConcreteShadowNode; #ifdef ANDROID using BaseShadowNode = ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>; TextShadowNode( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family, ShadowNodeTraits traits) : BaseShadowNode(fragment, family, traits), BaseTextShadowNode() { orderIndex_ = std::numeric_limits<decltype(orderIndex_)>::max(); } #endif }; } // namespace react } // namespace facebook
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <limits> #include <react/components/text/BaseTextShadowNode.h> #include <react/components/text/TextProps.h> #include <react/components/view/ViewEventEmitter.h> #include <react/core/ConcreteShadowNode.h> namespace facebook { namespace react { extern const char TextComponentName[]; using TextEventEmitter = TouchEventEmitter; class TextShadowNode : public ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>, public BaseTextShadowNode { public: static ShadowNodeTraits BaseTraits() { auto traits = ConcreteShadowNode::BaseTraits(); #ifdef ANDROID traits.set(ShadowNodeTraits::Trait::FormsView); - traits.set(ShadowNodeTraits::Trait::FormsStackingContext); #endif return traits; } using ConcreteShadowNode::ConcreteShadowNode; #ifdef ANDROID using BaseShadowNode = ConcreteShadowNode< TextComponentName, ShadowNode, TextProps, TextEventEmitter>; TextShadowNode( ShadowNodeFragment const &fragment, ShadowNodeFamily::Shared const &family, ShadowNodeTraits traits) : BaseShadowNode(fragment, family, traits), BaseTextShadowNode() { orderIndex_ = std::numeric_limits<decltype(orderIndex_)>::max(); } #endif }; } // namespace react } // namespace facebook
1
0.016129
0
1
76536d7c12f922124dda12a879b3a2014cb8d5fa
lib/hg/prompt.rb
lib/hg/prompt.rb
module Hg class Prompt extend Forwardable # @api private attr_reader :output def_delegators :@output, :print def self.messages { range?: 'Value %{value} must be within the range %{in}', valid?: 'Your answer is invalid (must match %{valid})', required?: 'Value must be provided' } end # @api public def initialize(options = {}) @output = options.fetch(:output) end # Invoke a question type of prompt. # # @example # prompt = TTY::Prompt.new # prompt.invoke_question(Question, "Your name? ") # # @return [String] # # @api public def invoke_question(object, message, *args, &block) options = Utils.extract_options!(args) options[:messages] = self.class.messages question = object.new(self, options) question.(message, &block) end # Ask a question. # # @example # propmt = TTY::Prompt.new # prompt.ask("What is your name?") # # @param [String] message # The question to be asked. # # @yieldparam [TTY::Prompt::Question] question # Further configure the question. # # @yield [question] # # @return [TTY::Prompt::Question] # # @api public def ask(message, *args, &block) invoke_question(Hg::Prompt::Question, message, *args, &block) end end end
module Hg class Prompt extend Forwardable # @api private attr_reader :output def_delegators :@output, :print def self.messages { range?: 'Value %{value} must be within the range %{in}', valid?: 'Your answer is invalid (must match %{valid})', required?: 'Value must be provided' } end # @api public def initialize(options = {}) @output = options.fetch(:output) end # Invoke a question type of prompt. # # @example # prompt = Hg::Prompt.new # prompt.invoke_question(Question, "Your name? ") # # @return [String] # # @api public def invoke_question(object, message, *args, &block) options = Utils.extract_options!(args) options[:messages] = self.class.messages question = object.new(self, options) question.(message, &block) end # Ask a question. # # @example # propmt = Hg::Prompt.new # prompt.ask("What is your name?") # # @param [String] message # The question to be asked. # # @yieldparam [Hg::Prompt::Question] question # Further configure the question. # # @yield [question] # # @return [Hg::Prompt::Question] # # @api public def ask(message, *args, &block) invoke_question(Hg::Prompt::Question, message, *args, &block) end end end
Update comments to refer to correct classes
Update comments to refer to correct classes
Ruby
mit
voxable-labs/hg,voxable-labs/hg,voxable-labs/hg,voxable-labs/hg
ruby
## Code Before: module Hg class Prompt extend Forwardable # @api private attr_reader :output def_delegators :@output, :print def self.messages { range?: 'Value %{value} must be within the range %{in}', valid?: 'Your answer is invalid (must match %{valid})', required?: 'Value must be provided' } end # @api public def initialize(options = {}) @output = options.fetch(:output) end # Invoke a question type of prompt. # # @example # prompt = TTY::Prompt.new # prompt.invoke_question(Question, "Your name? ") # # @return [String] # # @api public def invoke_question(object, message, *args, &block) options = Utils.extract_options!(args) options[:messages] = self.class.messages question = object.new(self, options) question.(message, &block) end # Ask a question. # # @example # propmt = TTY::Prompt.new # prompt.ask("What is your name?") # # @param [String] message # The question to be asked. # # @yieldparam [TTY::Prompt::Question] question # Further configure the question. # # @yield [question] # # @return [TTY::Prompt::Question] # # @api public def ask(message, *args, &block) invoke_question(Hg::Prompt::Question, message, *args, &block) end end end ## Instruction: Update comments to refer to correct classes ## Code After: module Hg class Prompt extend Forwardable # @api private attr_reader :output def_delegators :@output, :print def self.messages { range?: 'Value %{value} must be within the range %{in}', valid?: 'Your answer is invalid (must match %{valid})', required?: 'Value must be provided' } end # @api public def initialize(options = {}) @output = options.fetch(:output) end # Invoke a question type of prompt. # # @example # prompt = Hg::Prompt.new # prompt.invoke_question(Question, "Your name? ") # # @return [String] # # @api public def invoke_question(object, message, *args, &block) options = Utils.extract_options!(args) options[:messages] = self.class.messages question = object.new(self, options) question.(message, &block) end # Ask a question. # # @example # propmt = Hg::Prompt.new # prompt.ask("What is your name?") # # @param [String] message # The question to be asked. # # @yieldparam [Hg::Prompt::Question] question # Further configure the question. # # @yield [question] # # @return [Hg::Prompt::Question] # # @api public def ask(message, *args, &block) invoke_question(Hg::Prompt::Question, message, *args, &block) end end end
module Hg class Prompt extend Forwardable # @api private attr_reader :output def_delegators :@output, :print def self.messages { range?: 'Value %{value} must be within the range %{in}', valid?: 'Your answer is invalid (must match %{valid})', required?: 'Value must be provided' } end # @api public def initialize(options = {}) @output = options.fetch(:output) end # Invoke a question type of prompt. # # @example - # prompt = TTY::Prompt.new ? ^^^ + # prompt = Hg::Prompt.new ? ^^ # prompt.invoke_question(Question, "Your name? ") # # @return [String] # # @api public def invoke_question(object, message, *args, &block) options = Utils.extract_options!(args) options[:messages] = self.class.messages question = object.new(self, options) question.(message, &block) end # Ask a question. # # @example - # propmt = TTY::Prompt.new ? ^^^ + # propmt = Hg::Prompt.new ? ^^ # prompt.ask("What is your name?") # # @param [String] message # The question to be asked. # - # @yieldparam [TTY::Prompt::Question] question ? ^^^ + # @yieldparam [Hg::Prompt::Question] question ? ^^ # Further configure the question. # # @yield [question] # - # @return [TTY::Prompt::Question] ? ^^^ + # @return [Hg::Prompt::Question] ? ^^ # # @api public def ask(message, *args, &block) invoke_question(Hg::Prompt::Question, message, *args, &block) end end end
8
0.133333
4
4
565edde418e59cee1c7d35a3382fae20146bcde4
client/app.js
client/app.js
var myApp = angular.module('myApp',['ngRoute']); myApp.config(function ($routeProvider) { $routeProvider.when('/',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women/details/:id',{ controller: 'WomenController', templateUrl: 'views/woman_details.html' }) .when('/women/add',{ controller: 'WomenController', templateUrl: 'views/add_woman.html' }) .when('/women/edit/:id',{ controller: 'WomenController', templateUrl: 'views/edit_woman.html' }) .otherwise({ redirectTo: '/' }); });
var myApp = angular.module('myApp',['ngRoute']); myApp.config(function ($routeProvider) { $routeProvider.when('/',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women/details/:id',{ controller: 'WomenController', templateUrl: 'views/woman_details.html' }) .when('/women/add',{ controller: 'WomenController', templateUrl: 'views/add_woman.html' }) .when('/women/edit/:id',{ controller: 'WomenController', templateUrl: 'views/edit_woman.html' }) .when('/test',{ controller: 'WomenController', templateUrl: 'views/template.html' }) .otherwise({ redirectTo: '/' }); });
Add controller for route /test. Template displaying.
Add controller for route /test. Template displaying.
JavaScript
mit
MartaL0b0/mqsc_web,MartaL0b0/mqsc_web
javascript
## Code Before: var myApp = angular.module('myApp',['ngRoute']); myApp.config(function ($routeProvider) { $routeProvider.when('/',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women/details/:id',{ controller: 'WomenController', templateUrl: 'views/woman_details.html' }) .when('/women/add',{ controller: 'WomenController', templateUrl: 'views/add_woman.html' }) .when('/women/edit/:id',{ controller: 'WomenController', templateUrl: 'views/edit_woman.html' }) .otherwise({ redirectTo: '/' }); }); ## Instruction: Add controller for route /test. Template displaying. ## Code After: var myApp = angular.module('myApp',['ngRoute']); myApp.config(function ($routeProvider) { $routeProvider.when('/',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women/details/:id',{ controller: 'WomenController', templateUrl: 'views/woman_details.html' }) .when('/women/add',{ controller: 'WomenController', templateUrl: 'views/add_woman.html' }) .when('/women/edit/:id',{ controller: 'WomenController', templateUrl: 'views/edit_woman.html' }) .when('/test',{ controller: 'WomenController', templateUrl: 'views/template.html' }) .otherwise({ redirectTo: '/' }); });
var myApp = angular.module('myApp',['ngRoute']); myApp.config(function ($routeProvider) { $routeProvider.when('/',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women',{ controller: 'WomenController', templateUrl: 'views/women.html' }) .when('/women/details/:id',{ controller: 'WomenController', templateUrl: 'views/woman_details.html' }) .when('/women/add',{ controller: 'WomenController', templateUrl: 'views/add_woman.html' }) .when('/women/edit/:id',{ controller: 'WomenController', templateUrl: 'views/edit_woman.html' }) + .when('/test',{ + controller: 'WomenController', + templateUrl: 'views/template.html' + }) + .otherwise({ redirectTo: '/' }); });
5
0.151515
5
0
e9440ac7349e649bb12039a66c52290865e8c50c
cookbooks/geoevents/templates/default/geoevents.ini.erb
cookbooks/geoevents/templates/default/geoevents.ini.erb
[uwsgi] virtualenv = <%= node['geoevents']['virtualenv']['location'] %> logto = <%= File.join(node['geoevents']['logging']['location'] , 'geoevents.log') %> log-maxsize = 20971520 #uid = www-data #gid = www-data # master master = true #master-as-root = true # maximum number of processes processes = 10 # the socket (use the full path to be safe) socket = /tmp/uwsgi.sock # with appropriate permissions - *may* be needed #chmod-socket = 644 chown-socket = www-data # the base directory chdir = <%= node['geoevents']['location'] %> # Django's wsgi file module = geoevents.wsgi # the virtualenv home = <%= node['geoevents']['virtualenv']['location'] %> # clear environment on exit vacuum = true
[uwsgi] virtualenv = <%= node['geoevents']['virtualenv']['location'] %> logto = <%= File.join(node['geoevents']['logging']['location'] , 'geoevents.log') %> log-maxsize = 20971520 buffer-size=32768 #uid = www-data #gid = www-data # master master = true #master-as-root = true # maximum number of processes processes = 10 # the socket (use the full path to be safe) socket = /tmp/uwsgi.sock # with appropriate permissions - *may* be needed #chmod-socket = 644 chown-socket = www-data # the base directory chdir = <%= node['geoevents']['location'] %> # Django's wsgi file module = geoevents.wsgi # the virtualenv home = <%= node['geoevents']['virtualenv']['location'] %> # clear environment on exit vacuum = true
Update to add more memory to nginx process
Update to add more memory to nginx process
HTML+ERB
mit
ngageoint/geoevents-chef-installer,ngageoint/geoevents-chef-installer
html+erb
## Code Before: [uwsgi] virtualenv = <%= node['geoevents']['virtualenv']['location'] %> logto = <%= File.join(node['geoevents']['logging']['location'] , 'geoevents.log') %> log-maxsize = 20971520 #uid = www-data #gid = www-data # master master = true #master-as-root = true # maximum number of processes processes = 10 # the socket (use the full path to be safe) socket = /tmp/uwsgi.sock # with appropriate permissions - *may* be needed #chmod-socket = 644 chown-socket = www-data # the base directory chdir = <%= node['geoevents']['location'] %> # Django's wsgi file module = geoevents.wsgi # the virtualenv home = <%= node['geoevents']['virtualenv']['location'] %> # clear environment on exit vacuum = true ## Instruction: Update to add more memory to nginx process ## Code After: [uwsgi] virtualenv = <%= node['geoevents']['virtualenv']['location'] %> logto = <%= File.join(node['geoevents']['logging']['location'] , 'geoevents.log') %> log-maxsize = 20971520 buffer-size=32768 #uid = www-data #gid = www-data # master master = true #master-as-root = true # maximum number of processes processes = 10 # the socket (use the full path to be safe) socket = /tmp/uwsgi.sock # with appropriate permissions - *may* be needed #chmod-socket = 644 chown-socket = www-data # the base directory chdir = <%= node['geoevents']['location'] %> # Django's wsgi file module = geoevents.wsgi # the virtualenv home = <%= node['geoevents']['virtualenv']['location'] %> # clear environment on exit vacuum = true
[uwsgi] virtualenv = <%= node['geoevents']['virtualenv']['location'] %> logto = <%= File.join(node['geoevents']['logging']['location'] , 'geoevents.log') %> log-maxsize = 20971520 + + buffer-size=32768 #uid = www-data #gid = www-data # master master = true #master-as-root = true # maximum number of processes processes = 10 # the socket (use the full path to be safe) socket = /tmp/uwsgi.sock # with appropriate permissions - *may* be needed #chmod-socket = 644 chown-socket = www-data # the base directory chdir = <%= node['geoevents']['location'] %> # Django's wsgi file module = geoevents.wsgi # the virtualenv home = <%= node['geoevents']['virtualenv']['location'] %> # clear environment on exit vacuum = true
2
0.055556
2
0
83ceca04758c6546c41d5bc7f96583d838f25e11
src/mmw/apps/user/backends.py
src/mmw/apps/user/backends.py
from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end for Single Sign On providers. Before we can call django.contrib.auth.login on an SSO user, we must first authenticate them. This must be done using a custom authentication back- end, which sets the backend attribute on the user model. This class should be instantiated with an SSO provider user model, such as ItsiUser or ConcordUser, before it can be used. """ def __init__(self, model, field): self.SSOUserModel = model self.SSOField = field def authenticate(self, sso_id=None): if sso_id is not None: try: query = {self.SSOField: sso_id} user = self.SSOUserModel.objects.get(**query).user return user except ObjectDoesNotExist: return None return None def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExist: return None class ItsiAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ItsiAuthenticationBackend, self).__init__( ItsiUser, 'itsi_id') class ConcordAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ConcordAuthenticationBackend, self).__init__( ConcordUser, 'concord_id')
from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end for Single Sign On providers. Before we can call django.contrib.auth.login on an SSO user, we must first authenticate them. This must be done using a custom authentication back- end, which sets the backend attribute on the user model. This class should be instantiated with an SSO provider user model, such as ItsiUser or ConcordUser, before it can be used. """ def __init__(self, model, field): self.SSOUserModel = model self.SSOField = field def authenticate(self, request=None, sso_id=None): if sso_id is not None: try: query = {self.SSOField: sso_id} user = self.SSOUserModel.objects.get(**query).user return user except ObjectDoesNotExist: return None return None def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExist: return None class ItsiAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ItsiAuthenticationBackend, self).__init__( ItsiUser, 'itsi_id') class ConcordAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ConcordAuthenticationBackend, self).__init__( ConcordUser, 'concord_id')
Add request parameter to backend.authenticate
Add request parameter to backend.authenticate Without this, the signature of our custom backend does not match that of the function call. This signature is tested in django.contrib.auth.authenticate here: https://github.com/django/django/blob/fdf209eab8949ddc345aa0212b349c79fc6fdebb/django/contrib/auth/__init__.py#L69 and `request` was added to that signature in Django 1.11 in https://github.com/django/django/commit/4b9330ccc04575f9e5126529ec355a450d12e77c. With this, the Concord users are authenticated correctly.
Python
apache-2.0
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
python
## Code Before: from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end for Single Sign On providers. Before we can call django.contrib.auth.login on an SSO user, we must first authenticate them. This must be done using a custom authentication back- end, which sets the backend attribute on the user model. This class should be instantiated with an SSO provider user model, such as ItsiUser or ConcordUser, before it can be used. """ def __init__(self, model, field): self.SSOUserModel = model self.SSOField = field def authenticate(self, sso_id=None): if sso_id is not None: try: query = {self.SSOField: sso_id} user = self.SSOUserModel.objects.get(**query).user return user except ObjectDoesNotExist: return None return None def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExist: return None class ItsiAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ItsiAuthenticationBackend, self).__init__( ItsiUser, 'itsi_id') class ConcordAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ConcordAuthenticationBackend, self).__init__( ConcordUser, 'concord_id') ## Instruction: Add request parameter to backend.authenticate Without this, the signature of our custom backend does not match that of the function call. This signature is tested in django.contrib.auth.authenticate here: https://github.com/django/django/blob/fdf209eab8949ddc345aa0212b349c79fc6fdebb/django/contrib/auth/__init__.py#L69 and `request` was added to that signature in Django 1.11 in https://github.com/django/django/commit/4b9330ccc04575f9e5126529ec355a450d12e77c. With this, the Concord users are authenticated correctly. ## Code After: from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end for Single Sign On providers. Before we can call django.contrib.auth.login on an SSO user, we must first authenticate them. This must be done using a custom authentication back- end, which sets the backend attribute on the user model. This class should be instantiated with an SSO provider user model, such as ItsiUser or ConcordUser, before it can be used. """ def __init__(self, model, field): self.SSOUserModel = model self.SSOField = field def authenticate(self, request=None, sso_id=None): if sso_id is not None: try: query = {self.SSOField: sso_id} user = self.SSOUserModel.objects.get(**query).user return user except ObjectDoesNotExist: return None return None def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExist: return None class ItsiAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ItsiAuthenticationBackend, self).__init__( ItsiUser, 'itsi_id') class ConcordAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ConcordAuthenticationBackend, self).__init__( ConcordUser, 'concord_id')
from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.backends import BaseBackend from django.contrib.auth.models import User from apps.user.models import ItsiUser, ConcordUser class SSOAuthenticationBackend(BaseBackend): """ A custom authentication back-end for Single Sign On providers. Before we can call django.contrib.auth.login on an SSO user, we must first authenticate them. This must be done using a custom authentication back- end, which sets the backend attribute on the user model. This class should be instantiated with an SSO provider user model, such as ItsiUser or ConcordUser, before it can be used. """ def __init__(self, model, field): self.SSOUserModel = model self.SSOField = field - def authenticate(self, sso_id=None): + def authenticate(self, request=None, sso_id=None): ? ++++++++++++++ if sso_id is not None: try: query = {self.SSOField: sso_id} user = self.SSOUserModel.objects.get(**query).user return user except ObjectDoesNotExist: return None return None def get_user(self, user_id): try: return User.objects.get(pk=user_id) except User.DoesNotExist: return None class ItsiAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ItsiAuthenticationBackend, self).__init__( ItsiUser, 'itsi_id') class ConcordAuthenticationBackend(SSOAuthenticationBackend): def __init__(self): super(ConcordAuthenticationBackend, self).__init__( ConcordUser, 'concord_id')
2
0.040816
1
1
db1a85cd360a55632d78df9c5e3aad4ec765eeb5
text_test.go
text_test.go
package main import ( "testing" log "github.com/Sirupsen/logrus" ) func TestLineBreaking(t *testing.T) { log.SetLevel(log.DebugLevel) var tests = []struct { text string result string }{ { `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, }, { `"Money %s\\\\G I got!"`, `"Money %s\\\\G I got!"`, }, } for _, pair := range tests { r := breakLines(pair.text) if r != pair.result { t.Errorf("For\n%q\nexpected\n%q\ngot\n%q\n", pair.text, pair.result, r) } } }
package main import "testing" func TestLineBreaking(t *testing.T) { var tests = []struct { text string result string }{ { `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, }, { `"Money %s\\\\G I got!"`, `"Money %s\\\\G I got!"`, }, } for _, pair := range tests { r := breakLines(pair.text) if r != pair.result { t.Errorf("For\n%q\nexpected\n%q\ngot\n%q\n", pair.text, pair.result, r) } } }
Remove debug output from test
Remove debug output from test
Go
mit
softashell/rpgmaker-patch-translator
go
## Code Before: package main import ( "testing" log "github.com/Sirupsen/logrus" ) func TestLineBreaking(t *testing.T) { log.SetLevel(log.DebugLevel) var tests = []struct { text string result string }{ { `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, }, { `"Money %s\\\\G I got!"`, `"Money %s\\\\G I got!"`, }, } for _, pair := range tests { r := breakLines(pair.text) if r != pair.result { t.Errorf("For\n%q\nexpected\n%q\ngot\n%q\n", pair.text, pair.result, r) } } } ## Instruction: Remove debug output from test ## Code After: package main import "testing" func TestLineBreaking(t *testing.T) { var tests = []struct { text string result string }{ { `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, }, { `"Money %s\\\\G I got!"`, `"Money %s\\\\G I got!"`, }, } for _, pair := range tests { r := breakLines(pair.text) if r != pair.result { t.Errorf("For\n%q\nexpected\n%q\ngot\n%q\n", pair.text, pair.result, r) } } }
package main + import "testing" - import ( - "testing" - - log "github.com/Sirupsen/logrus" - ) func TestLineBreaking(t *testing.T) { - log.SetLevel(log.DebugLevel) - var tests = []struct { text string result string }{ { `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, `\\name[Domestic scent](…Properly……I want to take a bath……  today…Let's go home.……)`, }, { `"Money %s\\\\G I got!"`, `"Money %s\\\\G I got!"`, }, } for _, pair := range tests { r := breakLines(pair.text) if r != pair.result { t.Errorf("For\n%q\nexpected\n%q\ngot\n%q\n", pair.text, pair.result, r) } } }
8
0.228571
1
7
c5371bd9d2939bbfb2059c349eb671175b4ba03c
zkfacade/src/main/java/com/yahoo/vespa/curator/api/VespaCurator.java
zkfacade/src/main/java/com/yahoo/vespa/curator/api/VespaCurator.java
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.curator.api; import com.yahoo.path.Path; import java.time.Duration; /** * A client for a ZooKeeper cluster running inside Vespa. Applications that want to use ZooKeeper can inject this in * their code. * * @author mpolden */ public interface VespaCurator { /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */ AutoCloseable lock(Path path, Duration timeout); }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.curator.api; import com.yahoo.concurrent.UncheckedTimeoutException; import com.yahoo.path.Path; import java.time.Duration; /** * A client for a ZooKeeper cluster running inside Vespa. Applications that want to use ZooKeeper can inject this in * their code. * * @author mpolden */ public interface VespaCurator { /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */ AutoCloseable lock(Path path, Duration timeout) throws UncheckedTimeoutException; }
Document timeout exception may be thrown
Document timeout exception may be thrown
Java
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
java
## Code Before: // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.curator.api; import com.yahoo.path.Path; import java.time.Duration; /** * A client for a ZooKeeper cluster running inside Vespa. Applications that want to use ZooKeeper can inject this in * their code. * * @author mpolden */ public interface VespaCurator { /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */ AutoCloseable lock(Path path, Duration timeout); } ## Instruction: Document timeout exception may be thrown ## Code After: // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.curator.api; import com.yahoo.concurrent.UncheckedTimeoutException; import com.yahoo.path.Path; import java.time.Duration; /** * A client for a ZooKeeper cluster running inside Vespa. Applications that want to use ZooKeeper can inject this in * their code. * * @author mpolden */ public interface VespaCurator { /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */ AutoCloseable lock(Path path, Duration timeout) throws UncheckedTimeoutException; }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.curator.api; + import com.yahoo.concurrent.UncheckedTimeoutException; import com.yahoo.path.Path; import java.time.Duration; /** * A client for a ZooKeeper cluster running inside Vespa. Applications that want to use ZooKeeper can inject this in * their code. * * @author mpolden */ public interface VespaCurator { /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */ - AutoCloseable lock(Path path, Duration timeout); + AutoCloseable lock(Path path, Duration timeout) throws UncheckedTimeoutException; ? +++++++++++++++++++++++++++++++++ }
3
0.157895
2
1
d3367ffe1f426b18b88aa0abe11aefbb7131278d
gulpfile.js
gulpfile.js
var gulp = require('gulp'); var elixir = require('laravel-elixir'); var argv = require('yargs').argv; var bin = require('./tasks/bin'); elixir.config.assetsPath = 'source/_assets'; elixir.config.publicPath = 'source'; elixir.config.sourcemaps = false; elixir(function(mix) { var env = argv.e || argv.env || 'local'; var port = argv.p || argv.port || 3000; mix.sass('main.scss') .sass('reset.scss') .exec(bin.path() + ' build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*']) .browserSync({ port: port, server: { baseDir: 'build_' + env }, proxy: null, files: [ 'build_' + env + '/**/*' ] }); });
process.env.DISABLE_NOTIFIER = true; var gulp = require('gulp'); var elixir = require('laravel-elixir'); var argv = require('yargs').argv; var bin = require('./tasks/bin'); elixir.config.assetsPath = 'source/_assets'; elixir.config.publicPath = 'source'; elixir.config.sourcemaps = false; elixir(function(mix) { var env = argv.e || argv.env || 'local'; var port = argv.p || argv.port || 3000; mix.sass('main.scss') .sass('reset.scss') .exec(bin.path() + ' build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*']) .browserSync({ port: port, server: { baseDir: 'build_' + env }, proxy: null, files: [ 'build_' + env + '/**/*' ], notify: false, open: false, }); });
Disable Elixir and BrowserSync notifications
Disable Elixir and BrowserSync notifications
JavaScript
agpl-3.0
art-institute-of-chicago/gauguin-microsite,art-institute-of-chicago/gauguin-microsite,art-institute-of-chicago/gauguin-microsite
javascript
## Code Before: var gulp = require('gulp'); var elixir = require('laravel-elixir'); var argv = require('yargs').argv; var bin = require('./tasks/bin'); elixir.config.assetsPath = 'source/_assets'; elixir.config.publicPath = 'source'; elixir.config.sourcemaps = false; elixir(function(mix) { var env = argv.e || argv.env || 'local'; var port = argv.p || argv.port || 3000; mix.sass('main.scss') .sass('reset.scss') .exec(bin.path() + ' build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*']) .browserSync({ port: port, server: { baseDir: 'build_' + env }, proxy: null, files: [ 'build_' + env + '/**/*' ] }); }); ## Instruction: Disable Elixir and BrowserSync notifications ## Code After: process.env.DISABLE_NOTIFIER = true; var gulp = require('gulp'); var elixir = require('laravel-elixir'); var argv = require('yargs').argv; var bin = require('./tasks/bin'); elixir.config.assetsPath = 'source/_assets'; elixir.config.publicPath = 'source'; elixir.config.sourcemaps = false; elixir(function(mix) { var env = argv.e || argv.env || 'local'; var port = argv.p || argv.port || 3000; mix.sass('main.scss') .sass('reset.scss') .exec(bin.path() + ' build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*']) .browserSync({ port: port, server: { baseDir: 'build_' + env }, proxy: null, files: [ 'build_' + env + '/**/*' ], notify: false, open: false, }); });
+ process.env.DISABLE_NOTIFIER = true; + var gulp = require('gulp'); var elixir = require('laravel-elixir'); var argv = require('yargs').argv; var bin = require('./tasks/bin'); elixir.config.assetsPath = 'source/_assets'; elixir.config.publicPath = 'source'; elixir.config.sourcemaps = false; elixir(function(mix) { var env = argv.e || argv.env || 'local'; var port = argv.p || argv.port || 3000; mix.sass('main.scss') .sass('reset.scss') .exec(bin.path() + ' build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*']) .browserSync({ port: port, server: { baseDir: 'build_' + env }, proxy: null, - files: [ 'build_' + env + '/**/*' ] + files: [ 'build_' + env + '/**/*' ], ? + + notify: false, + open: false, }); });
6
0.25
5
1
d2b4e85fd0b3c44a460bc843eb480dd82f216f6e
setup.py
setup.py
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='3.0.12', description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', 'dist/*/*.js', 'dist/*/*.css', 'dist/*/*.gif', 'dist/*/*.png', 'dist/*/*.ico', 'dist/*/*.ttf', ], } )
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='3.0.12a', description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', 'dist/*.css', 'dist/*.png' ], } )
Fix file inclusion and make new release.
Fix file inclusion and make new release.
Python
mit
sveint/flask-swagger-ui,sveint/flask-swagger-ui,sveint/flask-swagger-ui
python
## Code Before: from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='3.0.12', description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', 'dist/*/*.js', 'dist/*/*.css', 'dist/*/*.gif', 'dist/*/*.png', 'dist/*/*.ico', 'dist/*/*.ttf', ], } ) ## Instruction: Fix file inclusion and make new release. ## Code After: from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', version='3.0.12a', description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', 'dist/*.css', 'dist/*.png' ], } )
from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'flask_swagger_ui/README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='flask-swagger-ui', - version='3.0.12', + version='3.0.12a', ? + description='Swagger UI blueprint for Flask', long_description=long_description, url='https://github.com/sveint/flask-swagger-ui', author='Svein Tore Koksrud Seljebotn', author_email='sveint@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='flask swagger', packages=['flask_swagger_ui'], package_data={ 'flask_swagger_ui': [ 'README.md', 'templates/*.html', 'dist/VERSION', 'dist/LICENSE', 'dist/README.md', 'dist/*.html', 'dist/*.js', - 'dist/*/*.js', - 'dist/*/*.css', ? -- + 'dist/*.css', - 'dist/*/*.gif', - 'dist/*/*.png', ? -- - + 'dist/*.png' - 'dist/*/*.ico', - 'dist/*/*.ttf', ], } )
10
0.181818
3
7
187d276724a9b8fd2027a28782a64854722f6924
config.ru
config.ru
unless defined? Gallerist $LOAD_PATH << File.join(__dir__, 'lib') require 'gallerist' end warmup do |app| error = [] Gallerist::App.enable :show_exceptions Rack::MockRequest.new(app).get '/', 'rack.errors' => $stderr, 'rack.warmup' => true, 'rack.warmup.error' => error Gallerist::App.disable :show_exceptions unless Gallerist::App.development? raise error.first unless error.empty? end map '/assets' do run Gallerist::App.sprockets end run Gallerist::App
unless defined? Gallerist $LOAD_PATH << File.join(__dir__, 'lib') require 'gallerist' end warmup do |app| error = [] Gallerist::App.enable :show_exceptions Rack::MockRequest.new(app).get '/', 'rack.errors' => $stderr, 'rack.warmup' => true, 'rack.warmup.error' => error Gallerist::App.disable :show_exceptions unless Gallerist::App.development? raise error.first unless error.empty? Rack::MockRequest.new(app).get '/assets/main.css' Rack::MockRequest.new(app).get '/assets/main.js' end map '/assets' do run Gallerist::App.sprockets end run Gallerist::App
Use warmup to precompile assets
Use warmup to precompile assets
Ruby
bsd-3-clause
koraktor/gallerist,koraktor/gallerist,koraktor/gallerist
ruby
## Code Before: unless defined? Gallerist $LOAD_PATH << File.join(__dir__, 'lib') require 'gallerist' end warmup do |app| error = [] Gallerist::App.enable :show_exceptions Rack::MockRequest.new(app).get '/', 'rack.errors' => $stderr, 'rack.warmup' => true, 'rack.warmup.error' => error Gallerist::App.disable :show_exceptions unless Gallerist::App.development? raise error.first unless error.empty? end map '/assets' do run Gallerist::App.sprockets end run Gallerist::App ## Instruction: Use warmup to precompile assets ## Code After: unless defined? Gallerist $LOAD_PATH << File.join(__dir__, 'lib') require 'gallerist' end warmup do |app| error = [] Gallerist::App.enable :show_exceptions Rack::MockRequest.new(app).get '/', 'rack.errors' => $stderr, 'rack.warmup' => true, 'rack.warmup.error' => error Gallerist::App.disable :show_exceptions unless Gallerist::App.development? raise error.first unless error.empty? Rack::MockRequest.new(app).get '/assets/main.css' Rack::MockRequest.new(app).get '/assets/main.js' end map '/assets' do run Gallerist::App.sprockets end run Gallerist::App
unless defined? Gallerist $LOAD_PATH << File.join(__dir__, 'lib') require 'gallerist' end warmup do |app| error = [] Gallerist::App.enable :show_exceptions Rack::MockRequest.new(app).get '/', 'rack.errors' => $stderr, 'rack.warmup' => true, 'rack.warmup.error' => error Gallerist::App.disable :show_exceptions unless Gallerist::App.development? raise error.first unless error.empty? + + Rack::MockRequest.new(app).get '/assets/main.css' + Rack::MockRequest.new(app).get '/assets/main.js' end map '/assets' do run Gallerist::App.sprockets end run Gallerist::App
3
0.136364
3
0
9457fd36f2f8feef7a80fee66b5d9acb1176cdbb
app/models/aws_accessor.rb
app/models/aws_accessor.rb
class AwsAccessor def initialize(access_key_id, secret_access_key) @access_key_id = access_key_id @secret_access_key = secret_access_key end def ecs @ecs ||= Aws::ECS::Client.new(credentials: credentials) end def s3 @s3 ||= Aws::S3::Client.new(credentials: credentials) end def ec2 @ec2 ||= Aws::EC2::Client.new(credentials: credentials) end def elb @elb ||= Aws::ElasticLoadBalancing::Client.new(credentials: credentials) end def route53 @route53 ||= Aws::Route53::Client.new(credentials: credentials) end private def credentials Aws::Credentials.new(@access_key_id, @secret_access_key) end end
class AwsAccessor def initialize(access_key_id, secret_access_key) @access_key_id = access_key_id @secret_access_key = secret_access_key end def ecs @ecs ||= Aws::ECS::Client.new(credentials: credentials) end def s3 @s3 ||= Aws::S3::Client.new(credentials: credentials) end def ec2 @ec2 ||= Aws::EC2::Client.new(credentials: credentials) end def elb @elb ||= Aws::ElasticLoadBalancing::Client.new(credentials: credentials) end def route53 @route53 ||= Aws::Route53::Client.new(credentials: credentials) end private def credentials Aws::Credentials.new( @access_key_id || ENV['AWS_ACCESS_KEY_ID'], @secret_access_key || ENV['AWS_SECRET_ACCESS_KEY'] ) end end
Use environment variables by default
Use environment variables by default
Ruby
mit
degica/barcelona,degica/barcelona,degica/barcelona,degica/barcelona,degica/barcelona,degica/barcelona
ruby
## Code Before: class AwsAccessor def initialize(access_key_id, secret_access_key) @access_key_id = access_key_id @secret_access_key = secret_access_key end def ecs @ecs ||= Aws::ECS::Client.new(credentials: credentials) end def s3 @s3 ||= Aws::S3::Client.new(credentials: credentials) end def ec2 @ec2 ||= Aws::EC2::Client.new(credentials: credentials) end def elb @elb ||= Aws::ElasticLoadBalancing::Client.new(credentials: credentials) end def route53 @route53 ||= Aws::Route53::Client.new(credentials: credentials) end private def credentials Aws::Credentials.new(@access_key_id, @secret_access_key) end end ## Instruction: Use environment variables by default ## Code After: class AwsAccessor def initialize(access_key_id, secret_access_key) @access_key_id = access_key_id @secret_access_key = secret_access_key end def ecs @ecs ||= Aws::ECS::Client.new(credentials: credentials) end def s3 @s3 ||= Aws::S3::Client.new(credentials: credentials) end def ec2 @ec2 ||= Aws::EC2::Client.new(credentials: credentials) end def elb @elb ||= Aws::ElasticLoadBalancing::Client.new(credentials: credentials) end def route53 @route53 ||= Aws::Route53::Client.new(credentials: credentials) end private def credentials Aws::Credentials.new( @access_key_id || ENV['AWS_ACCESS_KEY_ID'], @secret_access_key || ENV['AWS_SECRET_ACCESS_KEY'] ) end end
class AwsAccessor def initialize(access_key_id, secret_access_key) @access_key_id = access_key_id @secret_access_key = secret_access_key end def ecs @ecs ||= Aws::ECS::Client.new(credentials: credentials) end def s3 @s3 ||= Aws::S3::Client.new(credentials: credentials) end def ec2 @ec2 ||= Aws::EC2::Client.new(credentials: credentials) end def elb @elb ||= Aws::ElasticLoadBalancing::Client.new(credentials: credentials) end def route53 @route53 ||= Aws::Route53::Client.new(credentials: credentials) end private def credentials - Aws::Credentials.new(@access_key_id, @secret_access_key) + Aws::Credentials.new( + @access_key_id || ENV['AWS_ACCESS_KEY_ID'], + @secret_access_key || ENV['AWS_SECRET_ACCESS_KEY'] + ) end end
5
0.15625
4
1
2f46d5468b7eaabfb23081669e6c1c2760a1bc16
tests.py
tests.py
from __future__ import unicode_literals from tqdm import format_interval def test_format_interval(): assert format_interval(60) == '01:00' assert format_interval(6160) == '1:42:40' assert format_interval(238113) == '66:08:33'
from __future__ import unicode_literals from tqdm import format_interval, format_meter def test_format_interval(): assert format_interval(60) == '01:00' assert format_interval(6160) == '1:42:40' assert format_interval(238113) == '66:08:33' def test_format_meter(): assert format_meter(231, 1000, 392) == \ "|##--------| 231/1000 23% [elapsed: " \ "06:32 left: 12:49, 0.00 iters/sec]"
Test of format_meter (failed on py32)
Test of format_meter (failed on py32)
Python
mit
lrq3000/tqdm,kmike/tqdm
python
## Code Before: from __future__ import unicode_literals from tqdm import format_interval def test_format_interval(): assert format_interval(60) == '01:00' assert format_interval(6160) == '1:42:40' assert format_interval(238113) == '66:08:33' ## Instruction: Test of format_meter (failed on py32) ## Code After: from __future__ import unicode_literals from tqdm import format_interval, format_meter def test_format_interval(): assert format_interval(60) == '01:00' assert format_interval(6160) == '1:42:40' assert format_interval(238113) == '66:08:33' def test_format_meter(): assert format_meter(231, 1000, 392) == \ "|##--------| 231/1000 23% [elapsed: " \ "06:32 left: 12:49, 0.00 iters/sec]"
from __future__ import unicode_literals - from tqdm import format_interval + from tqdm import format_interval, format_meter ? ++++++++++++++ def test_format_interval(): assert format_interval(60) == '01:00' assert format_interval(6160) == '1:42:40' assert format_interval(238113) == '66:08:33' + + def test_format_meter(): + assert format_meter(231, 1000, 392) == \ + "|##--------| 231/1000 23% [elapsed: " \ + "06:32 left: 12:49, 0.00 iters/sec]" +
8
0.888889
7
1
ec678cda5b24593a53e697088500335b962fe366
lib/wolfram.rb
lib/wolfram.rb
require 'ostruct' require 'open-uri' require 'active_support/core_ext/hash' require "wolfram/version" module Wolfram def self.ask(query) response = OpenStruct.new hash = Hash.new url = "http://api.wolframalpha.com/v2/query?appid=XR5V85-RTLWAEKWEQ&input=#{URI::encode(query).gsub('=','%3D').gsub('+','%2B').gsub(',','%2C')}&format=image" raw_response = Hash.from_xml(open(url).read) raw_response["queryresult"]["pod"].each do |pod| hash[pod["title"].downcase.tr(' ', '_')] = pod["subpod"]["img"]["src"] end response = OpenStruct.new(hash) end end
require 'ostruct' require 'open-uri' require 'active_support/core_ext/hash' require "wolfram/version" module Wolfram def self.ask(query) response = OpenStruct.new hash = Hash.new url = "http://api.wolframalpha.com/v2/query?appid=XR5V85-RTLWAEKWEQ&input=#{URI::encode(query).gsub('=','%3D').gsub('+','%2B').gsub(',','%2C')}&format=image" raw_response = Hash.from_xml(open(url).read) raw_response["queryresult"]["pod"].each do |pod| if pod["subpod"].count > 2 images = [] pod["subpod"].each do |subpod| images.push(subpod["img"]["src"]) end hash[pod["title"].downcase.tr(' ', '_')] = images images = [] else hash[pod["title"].downcase.tr(' ', '_')] = pod["subpod"]["img"]["src"] end end response = OpenStruct.new(hash) end end
Fix error when respond has more than 1 subpod
Fix error when respond has more than 1 subpod
Ruby
mit
Educatea/wolfram,Educatea/wolfram
ruby
## Code Before: require 'ostruct' require 'open-uri' require 'active_support/core_ext/hash' require "wolfram/version" module Wolfram def self.ask(query) response = OpenStruct.new hash = Hash.new url = "http://api.wolframalpha.com/v2/query?appid=XR5V85-RTLWAEKWEQ&input=#{URI::encode(query).gsub('=','%3D').gsub('+','%2B').gsub(',','%2C')}&format=image" raw_response = Hash.from_xml(open(url).read) raw_response["queryresult"]["pod"].each do |pod| hash[pod["title"].downcase.tr(' ', '_')] = pod["subpod"]["img"]["src"] end response = OpenStruct.new(hash) end end ## Instruction: Fix error when respond has more than 1 subpod ## Code After: require 'ostruct' require 'open-uri' require 'active_support/core_ext/hash' require "wolfram/version" module Wolfram def self.ask(query) response = OpenStruct.new hash = Hash.new url = "http://api.wolframalpha.com/v2/query?appid=XR5V85-RTLWAEKWEQ&input=#{URI::encode(query).gsub('=','%3D').gsub('+','%2B').gsub(',','%2C')}&format=image" raw_response = Hash.from_xml(open(url).read) raw_response["queryresult"]["pod"].each do |pod| if pod["subpod"].count > 2 images = [] pod["subpod"].each do |subpod| images.push(subpod["img"]["src"]) end hash[pod["title"].downcase.tr(' ', '_')] = images images = [] else hash[pod["title"].downcase.tr(' ', '_')] = pod["subpod"]["img"]["src"] end end response = OpenStruct.new(hash) end end
require 'ostruct' require 'open-uri' require 'active_support/core_ext/hash' require "wolfram/version" module Wolfram def self.ask(query) response = OpenStruct.new hash = Hash.new url = "http://api.wolframalpha.com/v2/query?appid=XR5V85-RTLWAEKWEQ&input=#{URI::encode(query).gsub('=','%3D').gsub('+','%2B').gsub(',','%2C')}&format=image" raw_response = Hash.from_xml(open(url).read) raw_response["queryresult"]["pod"].each do |pod| + if pod["subpod"].count > 2 + images = [] + pod["subpod"].each do |subpod| + images.push(subpod["img"]["src"]) + end + hash[pod["title"].downcase.tr(' ', '_')] = images + images = [] + else - hash[pod["title"].downcase.tr(' ', '_')] = pod["subpod"]["img"]["src"] + hash[pod["title"].downcase.tr(' ', '_')] = pod["subpod"]["img"]["src"] ? + + end end response = OpenStruct.new(hash) end end
11
0.647059
10
1
f1beb030141e24cbd503d3169fd900e639a895a4
src/app/units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.coffee
src/app/units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.coffee
angular.module('doubtfire.units.modals.unit-student-enrolment-modal', []) # # Modal to enrol a student in the given tutorial # .factory('UnitStudentEnrolmentModal', ($modal) -> UnitStudentEnrolmentModal = {} # Must provide unit UnitStudentEnrolmentModal.show = (unit) -> $modal.open controller: 'UnitStudentEnrolmentModalCtrl' templateUrl: 'units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.tpl.html' resolve: { unit: -> unit } UnitStudentEnrolmentModal ) .controller('UnitStudentEnrolmentModalCtrl', ($scope, $modalInstance, Project, unit, alertService) -> $scope.unit = unit $scope.projects = unit.students $scope.enrolStudent = (student_id, tutorial) -> # get tutorial_id from tutorial_name Project.create {unit_id: unit.id, student_num: student_id, tutorial_id: if tutorial then tutorial.id else null }, (project) -> if not unit.studentEnrolled project.project_id unit.addStudent project alertService.add("success", "Student enrolled", 2000) $modalInstance.close() else alertService.add("danger", "Student is already enrolled", 2000) $modalInstance.close() , (response) -> alertService.add("danger", "Unable to find student. Please check the student ID, and ensure the student has logged in at least once already to ensure they have an account.", 6000) )
angular.module('doubtfire.units.modals.unit-student-enrolment-modal', []) # # Modal to enrol a student in the given tutorial # .factory('UnitStudentEnrolmentModal', ($modal) -> UnitStudentEnrolmentModal = {} # Must provide unit UnitStudentEnrolmentModal.show = (unit) -> $modal.open controller: 'UnitStudentEnrolmentModalCtrl' templateUrl: 'units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.tpl.html' resolve: { unit: -> unit } UnitStudentEnrolmentModal ) .controller('UnitStudentEnrolmentModalCtrl', ($scope, $modalInstance, Project, unit, alertService) -> $scope.unit = unit $scope.projects = unit.students $scope.enrolStudent = (student_id, tutorial) -> # get tutorial_id from tutorial_name Project.create {unit_id: unit.id, student_num: student_id, tutorial_id: if tutorial then tutorial.id else null }, (project) -> if ! unit.studentEnrolled project.project_id unit.addStudent project alertService.add("success", "Student enrolled", 2000) $modalInstance.close() else alertService.add("danger", "Student is already enrolled", 2000) $modalInstance.close() , (response) -> alertService.add("danger", "Error enrolling student: #{response.data.error}", 6000) )
Correct error message on failed enrol student
FIX: Correct error message on failed enrol student
CoffeeScript
agpl-3.0
doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web
coffeescript
## Code Before: angular.module('doubtfire.units.modals.unit-student-enrolment-modal', []) # # Modal to enrol a student in the given tutorial # .factory('UnitStudentEnrolmentModal', ($modal) -> UnitStudentEnrolmentModal = {} # Must provide unit UnitStudentEnrolmentModal.show = (unit) -> $modal.open controller: 'UnitStudentEnrolmentModalCtrl' templateUrl: 'units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.tpl.html' resolve: { unit: -> unit } UnitStudentEnrolmentModal ) .controller('UnitStudentEnrolmentModalCtrl', ($scope, $modalInstance, Project, unit, alertService) -> $scope.unit = unit $scope.projects = unit.students $scope.enrolStudent = (student_id, tutorial) -> # get tutorial_id from tutorial_name Project.create {unit_id: unit.id, student_num: student_id, tutorial_id: if tutorial then tutorial.id else null }, (project) -> if not unit.studentEnrolled project.project_id unit.addStudent project alertService.add("success", "Student enrolled", 2000) $modalInstance.close() else alertService.add("danger", "Student is already enrolled", 2000) $modalInstance.close() , (response) -> alertService.add("danger", "Unable to find student. Please check the student ID, and ensure the student has logged in at least once already to ensure they have an account.", 6000) ) ## Instruction: FIX: Correct error message on failed enrol student ## Code After: angular.module('doubtfire.units.modals.unit-student-enrolment-modal', []) # # Modal to enrol a student in the given tutorial # .factory('UnitStudentEnrolmentModal', ($modal) -> UnitStudentEnrolmentModal = {} # Must provide unit UnitStudentEnrolmentModal.show = (unit) -> $modal.open controller: 'UnitStudentEnrolmentModalCtrl' templateUrl: 'units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.tpl.html' resolve: { unit: -> unit } UnitStudentEnrolmentModal ) .controller('UnitStudentEnrolmentModalCtrl', ($scope, $modalInstance, Project, unit, alertService) -> $scope.unit = unit $scope.projects = unit.students $scope.enrolStudent = (student_id, tutorial) -> # get tutorial_id from tutorial_name Project.create {unit_id: unit.id, student_num: student_id, tutorial_id: if tutorial then tutorial.id else null }, (project) -> if ! unit.studentEnrolled project.project_id unit.addStudent project alertService.add("success", "Student enrolled", 2000) $modalInstance.close() else alertService.add("danger", "Student is already enrolled", 2000) $modalInstance.close() , (response) -> alertService.add("danger", "Error enrolling student: #{response.data.error}", 6000) )
angular.module('doubtfire.units.modals.unit-student-enrolment-modal', []) # # Modal to enrol a student in the given tutorial # .factory('UnitStudentEnrolmentModal', ($modal) -> UnitStudentEnrolmentModal = {} # Must provide unit UnitStudentEnrolmentModal.show = (unit) -> $modal.open controller: 'UnitStudentEnrolmentModalCtrl' templateUrl: 'units/modals/unit-student-enrolment-modal/unit-student-enrolment-modal.tpl.html' resolve: { unit: -> unit } UnitStudentEnrolmentModal ) .controller('UnitStudentEnrolmentModalCtrl', ($scope, $modalInstance, Project, unit, alertService) -> $scope.unit = unit $scope.projects = unit.students $scope.enrolStudent = (student_id, tutorial) -> # get tutorial_id from tutorial_name Project.create {unit_id: unit.id, student_num: student_id, tutorial_id: if tutorial then tutorial.id else null }, (project) -> - if not unit.studentEnrolled project.project_id ? ^^^ + if ! unit.studentEnrolled project.project_id ? ^ unit.addStudent project alertService.add("success", "Student enrolled", 2000) $modalInstance.close() else alertService.add("danger", "Student is already enrolled", 2000) $modalInstance.close() - , (response) -> - alertService.add("danger", "Unable to find student. Please check the student ID, and ensure the student has logged in at least once already to ensure they have an account.", 6000) + alertService.add("danger", "Error enrolling student: #{response.data.error}", 6000) )
5
0.135135
2
3
4dd427840dbb51e4e1e2125913c2c505a9f9effb
Node.js/ZombiePuppetMaster.js
Node.js/ZombiePuppetMaster.js
var mongodb = require('mongodb'); var server = new mongodb.Server("127.0.0.1", 27017, {}); var Db = new mongodb.Db('zombiedb', server, {w:0}); function walkingDead() { Db.open( function (error, client) { if (error) throw error; var zombieCollection = new mongodb.Collection(client, 'zombies'); var listOfZombies = zombieCollection.find(); console.log('------------------'); listOfZombies.each( function(err, zombie ) { if( zombie == null) { Db.close() } else { console.log(zombie._id, " strength: ", zombie.strength, " location: ", zombie.location ); var randomlat = Math.floor((Math.random()*2)-1); var randomlon = Math.floor((Math.random()*2)-1); var latitude = randomlat + zombie.location[0]; var longitude = randomlon + zombie.location[1]; zombieCollection.update( { _id : zombie._id }, { $set : { location : [ latitude, longitude ] } } ); } }); }); } var timeInterval = 1500; // milliseconds interval = setInterval(walkingDead, timeInterval);
var mongodb = require('mongodb'); var server = new mongodb.Server("127.0.0.1", 27017, {}); var Db = new mongodb.Db('zombiedb', server, {w:0}); function walkingDead() { Db.open( function (error, client) { if (error) throw error; var zombieCollection = new mongodb.Collection(client, 'zombies'); var listOfZombies = zombieCollection.find(); console.log('------------------'); listOfZombies.each( function(err, zombie ) { if( zombie == null) { Db.close() } else { console.log(zombie._id, " strength: ", zombie.strength, " location: ", zombie.location ); var randomlat = ( Math.random() * 2.0 ) - 1.0; var randomlon = ( Math.random() * 2.0 ) - 1.0; var latitude = randomlat + zombie.location[0]; var longitude = randomlon + zombie.location[1]; zombieCollection.update( { _id : zombie._id }, { $set : { location : [ latitude, longitude ] } } ); } }); }); } var timeInterval = 1500; // milliseconds interval = setInterval(walkingDead, timeInterval);
Remove bias from random walk
Remove bias from random walk
JavaScript
apache-2.0
luisibanez/ZombieDB
javascript
## Code Before: var mongodb = require('mongodb'); var server = new mongodb.Server("127.0.0.1", 27017, {}); var Db = new mongodb.Db('zombiedb', server, {w:0}); function walkingDead() { Db.open( function (error, client) { if (error) throw error; var zombieCollection = new mongodb.Collection(client, 'zombies'); var listOfZombies = zombieCollection.find(); console.log('------------------'); listOfZombies.each( function(err, zombie ) { if( zombie == null) { Db.close() } else { console.log(zombie._id, " strength: ", zombie.strength, " location: ", zombie.location ); var randomlat = Math.floor((Math.random()*2)-1); var randomlon = Math.floor((Math.random()*2)-1); var latitude = randomlat + zombie.location[0]; var longitude = randomlon + zombie.location[1]; zombieCollection.update( { _id : zombie._id }, { $set : { location : [ latitude, longitude ] } } ); } }); }); } var timeInterval = 1500; // milliseconds interval = setInterval(walkingDead, timeInterval); ## Instruction: Remove bias from random walk ## Code After: var mongodb = require('mongodb'); var server = new mongodb.Server("127.0.0.1", 27017, {}); var Db = new mongodb.Db('zombiedb', server, {w:0}); function walkingDead() { Db.open( function (error, client) { if (error) throw error; var zombieCollection = new mongodb.Collection(client, 'zombies'); var listOfZombies = zombieCollection.find(); console.log('------------------'); listOfZombies.each( function(err, zombie ) { if( zombie == null) { Db.close() } else { console.log(zombie._id, " strength: ", zombie.strength, " location: ", zombie.location ); var randomlat = ( Math.random() * 2.0 ) - 1.0; var randomlon = ( Math.random() * 2.0 ) - 1.0; var latitude = randomlat + zombie.location[0]; var longitude = randomlon + zombie.location[1]; zombieCollection.update( { _id : zombie._id }, { $set : { location : [ latitude, longitude ] } } ); } }); }); } var timeInterval = 1500; // milliseconds interval = setInterval(walkingDead, timeInterval);
var mongodb = require('mongodb'); var server = new mongodb.Server("127.0.0.1", 27017, {}); var Db = new mongodb.Db('zombiedb', server, {w:0}); function walkingDead() { Db.open( function (error, client) { if (error) throw error; var zombieCollection = new mongodb.Collection(client, 'zombies'); var listOfZombies = zombieCollection.find(); console.log('------------------'); listOfZombies.each( function(err, zombie ) { if( zombie == null) { Db.close() } else { console.log(zombie._id, " strength: ", zombie.strength, " location: ", zombie.location ); - var randomlat = Math.floor((Math.random()*2)-1); ? ---------- ^ ^ + var randomlat = ( Math.random() * 2.0 ) - 1.0; ? ^ + + +++ + + ^^ - var randomlon = Math.floor((Math.random()*2)-1); ? ---------- ^ ^ + var randomlon = ( Math.random() * 2.0 ) - 1.0; ? ^ + + +++ + + ^^ var latitude = randomlat + zombie.location[0]; var longitude = randomlon + zombie.location[1]; zombieCollection.update( { _id : zombie._id }, { $set : { location : [ latitude, longitude ] } } ); } }); }); } var timeInterval = 1500; // milliseconds interval = setInterval(walkingDead, timeInterval);
4
0.090909
2
2
15802fe540fa1af282b1f24ac30a64053bc26bf8
lib/money/bank/open_exchange_rates_loader.rb
lib/money/bank/open_exchange_rates_loader.rb
require 'money' require 'date' require 'yajl' require 'open-uri' class Money module Bank module OpenExchangeRatesLoader HIST_URL = 'https://raw.github.com/currencybot/open-exchange-rates/master/historical/' OER_URL = 'http://openexchangerates.org/latest.php' # Tries to load data from OpenExchangeRates for the given rate. # Won't do anything if there's no data available for that date # in OpenExchangeRates (short) history. def load_data(date) rates_source = if date == Date.today OER_URL else # Should we use strftime, does to_s have better performance ? Or is it localized accross systems ? HIST_URL + date.to_s + '.json' end doc = Yajl::Parser.parse(open(rates_source).read) base_currency = doc['base'] || 'USD' doc['rates'].each do |currency, rate| # Don't use set_rate here, since this method can only be called from # get_rate, which already aquired a mutex. internal_set_rate(date, base_currency, currency, rate) end end end end end
require 'money' require 'date' require 'yajl' require 'open-uri' class Money module Bank module OpenExchangeRatesLoader HIST_URL = 'https://raw.github.com/currencybot/open-exchange-rates/master/historical/' OER_URL = 'https://github.com/currencybot/open-exchange-rates/blob/master/latest.json' # Tries to load data from OpenExchangeRates for the given rate. # Won't do anything if there's no data available for that date # in OpenExchangeRates (short) history. def load_data(date) rates_source = if date == Date.today OER_URL else # Should we use strftime, does to_s have better performance ? Or is it localized accross systems ? HIST_URL + date.to_s + '.json' end doc = Yajl::Parser.parse(open(rates_source).read) base_currency = doc['base'] || 'USD' doc['rates'].each do |currency, rate| # Don't use set_rate here, since this method can only be called from # get_rate, which already aquired a mutex. internal_set_rate(date, base_currency, currency, rate) end end end end end
Use github for latest data.
Use github for latest data.
Ruby
mit
MarianoSalerno/money-historical-bank,MarianoSalerno/money-historical-bank,jetthoughts/money-historical-bank,MarianoSalerno/money-historical-bank,atwam/money-historical-bank
ruby
## Code Before: require 'money' require 'date' require 'yajl' require 'open-uri' class Money module Bank module OpenExchangeRatesLoader HIST_URL = 'https://raw.github.com/currencybot/open-exchange-rates/master/historical/' OER_URL = 'http://openexchangerates.org/latest.php' # Tries to load data from OpenExchangeRates for the given rate. # Won't do anything if there's no data available for that date # in OpenExchangeRates (short) history. def load_data(date) rates_source = if date == Date.today OER_URL else # Should we use strftime, does to_s have better performance ? Or is it localized accross systems ? HIST_URL + date.to_s + '.json' end doc = Yajl::Parser.parse(open(rates_source).read) base_currency = doc['base'] || 'USD' doc['rates'].each do |currency, rate| # Don't use set_rate here, since this method can only be called from # get_rate, which already aquired a mutex. internal_set_rate(date, base_currency, currency, rate) end end end end end ## Instruction: Use github for latest data. ## Code After: require 'money' require 'date' require 'yajl' require 'open-uri' class Money module Bank module OpenExchangeRatesLoader HIST_URL = 'https://raw.github.com/currencybot/open-exchange-rates/master/historical/' OER_URL = 'https://github.com/currencybot/open-exchange-rates/blob/master/latest.json' # Tries to load data from OpenExchangeRates for the given rate. # Won't do anything if there's no data available for that date # in OpenExchangeRates (short) history. def load_data(date) rates_source = if date == Date.today OER_URL else # Should we use strftime, does to_s have better performance ? Or is it localized accross systems ? HIST_URL + date.to_s + '.json' end doc = Yajl::Parser.parse(open(rates_source).read) base_currency = doc['base'] || 'USD' doc['rates'].each do |currency, rate| # Don't use set_rate here, since this method can only be called from # get_rate, which already aquired a mutex. internal_set_rate(date, base_currency, currency, rate) end end end end end
require 'money' require 'date' require 'yajl' require 'open-uri' class Money module Bank module OpenExchangeRatesLoader HIST_URL = 'https://raw.github.com/currencybot/open-exchange-rates/master/historical/' - OER_URL = 'http://openexchangerates.org/latest.php' + OER_URL = 'https://github.com/currencybot/open-exchange-rates/blob/master/latest.json' # Tries to load data from OpenExchangeRates for the given rate. # Won't do anything if there's no data available for that date # in OpenExchangeRates (short) history. def load_data(date) rates_source = if date == Date.today OER_URL else # Should we use strftime, does to_s have better performance ? Or is it localized accross systems ? HIST_URL + date.to_s + '.json' end doc = Yajl::Parser.parse(open(rates_source).read) base_currency = doc['base'] || 'USD' doc['rates'].each do |currency, rate| # Don't use set_rate here, since this method can only be called from # get_rate, which already aquired a mutex. internal_set_rate(date, base_currency, currency, rate) end end end end end
2
0.058824
1
1
53cae8a7d95832a0f95a537468552254028a0668
tests/system/test_auth.py
tests/system/test_auth.py
import pytest from inbox.models.session import session_scope from client import InboxTestClient from conftest import (timeout_loop, credentials, create_account, API_BASE) @timeout_loop('sync_start') def wait_for_sync_start(client): return True if client.messages.first() else False @timeout_loop('auth') def wait_for_auth(client): namespaces = client.namespaces.all() if len(namespaces): client.email_address = namespaces[0]['email_address'] client.provider = namespaces[0]['provider'] return True return False @pytest.mark.parametrize("account_credentials", credentials) def test_account_auth(account_credentials): email, password = account_credentials with session_scope() as db_session: create_account(db_session, email, password) client = InboxTestClient(email, API_BASE) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client)
import pytest from inbox.models.session import session_scope from client import InboxTestClient from conftest import (timeout_loop, credentials, create_account, API_BASE) from accounts import broken_credentials @timeout_loop('sync_start') def wait_for_sync_start(client): return True if client.messages.first() else False @timeout_loop('auth') def wait_for_auth(client): namespaces = client.namespaces.all() if len(namespaces): client.email_address = namespaces[0]['email_address'] client.provider = namespaces[0]['provider'] return True return False @pytest.mark.parametrize("account_credentials", credentials) def test_account_auth(account_credentials): email, password = account_credentials with session_scope() as db_session: create_account(db_session, email, password) client = InboxTestClient(email, API_BASE) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client) errors = __import__('inbox.basicauth', fromlist=['basicauth']) def test_account_create_should_fail(): """Test that creation fails with appropriate errors, as defined in the broken_credentials list. Credentials have the format: ({email, password}, error_type) e.g. ({'user': 'foo@foo.com', 'password': 'pass'}, 'ConfigError') """ credentials = [((c['user'], c['password']), e) for (c, e) in broken_credentials] for ((email, password), error) in credentials: error_obj = getattr(errors, error) with session_scope() as db_session: with pytest.raises(error_obj): create_account(db_session, email, password)
Add a system test to check for expected broken accounts
Add a system test to check for expected broken accounts Summary: This is the system test for D765 and finishes up the sync engine side of T495 - checking for All Mail folder and failing gracefully if it's absent. This test specifically adds another check in `test_auth` based on a new list of live, bad credentials in accounts.py. It's purposefully general, so other known bad credentials could be added if we want to test for more error cases. There are two changes required in Jenkins to make this run: * Add another string parameter broken_accounts to identify broken test accounts. * In the build script, after the line: `echo "credentials = $test_accounts" > tests/system/accounts.py` add: `echo "broken_credentials = $broken_accounts" >> tests/system/accounts.py` It looks like I can make the changes myself but I'd appreciate input from folks more familiar with the jenkins setup. Test Plan: If you want to test locally, ping me for some broken credentials you can use. Reviewers: emfree Reviewed By: emfree Subscribers: spang Differential Revision: https://review.inboxapp.com/D773
Python
agpl-3.0
gale320/sync-engine,Eagles2F/sync-engine,wakermahmud/sync-engine,nylas/sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,jobscore/sync-engine,jobscore/sync-engine,Eagles2F/sync-engine,wakermahmud/sync-engine,closeio/nylas,nylas/sync-engine,EthanBlackburn/sync-engine,wakermahmud/sync-engine,ErinCall/sync-engine,EthanBlackburn/sync-engine,PriviPK/privipk-sync-engine,EthanBlackburn/sync-engine,nylas/sync-engine,PriviPK/privipk-sync-engine,gale320/sync-engine,Eagles2F/sync-engine,closeio/nylas,ErinCall/sync-engine,jobscore/sync-engine,gale320/sync-engine,PriviPK/privipk-sync-engine,closeio/nylas,nylas/sync-engine,PriviPK/privipk-sync-engine,Eagles2F/sync-engine,ErinCall/sync-engine,Eagles2F/sync-engine,PriviPK/privipk-sync-engine,gale320/sync-engine,ErinCall/sync-engine,wakermahmud/sync-engine,jobscore/sync-engine,gale320/sync-engine,EthanBlackburn/sync-engine
python
## Code Before: import pytest from inbox.models.session import session_scope from client import InboxTestClient from conftest import (timeout_loop, credentials, create_account, API_BASE) @timeout_loop('sync_start') def wait_for_sync_start(client): return True if client.messages.first() else False @timeout_loop('auth') def wait_for_auth(client): namespaces = client.namespaces.all() if len(namespaces): client.email_address = namespaces[0]['email_address'] client.provider = namespaces[0]['provider'] return True return False @pytest.mark.parametrize("account_credentials", credentials) def test_account_auth(account_credentials): email, password = account_credentials with session_scope() as db_session: create_account(db_session, email, password) client = InboxTestClient(email, API_BASE) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client) ## Instruction: Add a system test to check for expected broken accounts Summary: This is the system test for D765 and finishes up the sync engine side of T495 - checking for All Mail folder and failing gracefully if it's absent. This test specifically adds another check in `test_auth` based on a new list of live, bad credentials in accounts.py. It's purposefully general, so other known bad credentials could be added if we want to test for more error cases. There are two changes required in Jenkins to make this run: * Add another string parameter broken_accounts to identify broken test accounts. * In the build script, after the line: `echo "credentials = $test_accounts" > tests/system/accounts.py` add: `echo "broken_credentials = $broken_accounts" >> tests/system/accounts.py` It looks like I can make the changes myself but I'd appreciate input from folks more familiar with the jenkins setup. Test Plan: If you want to test locally, ping me for some broken credentials you can use. Reviewers: emfree Reviewed By: emfree Subscribers: spang Differential Revision: https://review.inboxapp.com/D773 ## Code After: import pytest from inbox.models.session import session_scope from client import InboxTestClient from conftest import (timeout_loop, credentials, create_account, API_BASE) from accounts import broken_credentials @timeout_loop('sync_start') def wait_for_sync_start(client): return True if client.messages.first() else False @timeout_loop('auth') def wait_for_auth(client): namespaces = client.namespaces.all() if len(namespaces): client.email_address = namespaces[0]['email_address'] client.provider = namespaces[0]['provider'] return True return False @pytest.mark.parametrize("account_credentials", credentials) def test_account_auth(account_credentials): email, password = account_credentials with session_scope() as db_session: create_account(db_session, email, password) client = InboxTestClient(email, API_BASE) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client) errors = __import__('inbox.basicauth', fromlist=['basicauth']) def test_account_create_should_fail(): """Test that creation fails with appropriate errors, as defined in the broken_credentials list. Credentials have the format: ({email, password}, error_type) e.g. ({'user': 'foo@foo.com', 'password': 'pass'}, 'ConfigError') """ credentials = [((c['user'], c['password']), e) for (c, e) in broken_credentials] for ((email, password), error) in credentials: error_obj = getattr(errors, error) with session_scope() as db_session: with pytest.raises(error_obj): create_account(db_session, email, password)
import pytest from inbox.models.session import session_scope from client import InboxTestClient from conftest import (timeout_loop, credentials, create_account, API_BASE) + from accounts import broken_credentials @timeout_loop('sync_start') def wait_for_sync_start(client): return True if client.messages.first() else False @timeout_loop('auth') def wait_for_auth(client): namespaces = client.namespaces.all() if len(namespaces): client.email_address = namespaces[0]['email_address'] client.provider = namespaces[0]['provider'] return True return False @pytest.mark.parametrize("account_credentials", credentials) def test_account_auth(account_credentials): email, password = account_credentials with session_scope() as db_session: create_account(db_session, email, password) client = InboxTestClient(email, API_BASE) wait_for_auth(client) # wait for sync to start. tests rely on things setup at beginning # of sync (e.g. folder hierarchy) wait_for_sync_start(client) + + + errors = __import__('inbox.basicauth', fromlist=['basicauth']) + + + def test_account_create_should_fail(): + """Test that creation fails with appropriate errors, as defined in + the broken_credentials list. + Credentials have the format: + ({email, password}, error_type) + e.g. + ({'user': 'foo@foo.com', 'password': 'pass'}, 'ConfigError') + """ + credentials = [((c['user'], c['password']), e) + for (c, e) in broken_credentials] + + for ((email, password), error) in credentials: + error_obj = getattr(errors, error) + with session_scope() as db_session: + with pytest.raises(error_obj): + create_account(db_session, email, password)
22
0.628571
22
0
a38be80a86bb07db2ffd68e9e3c33f6242291d5b
Objective-J/Browser/Objective-J.js
Objective-J/Browser/Objective-J.js
var ObjectiveJ = { }; (function (global, exports, namespace) { #include "Includes.js" })((function(){return this;}).call(null), ObjectiveJ);
var global = { }, ObjectiveJ = { }; (function (global, exports, namespace) { var GLOBAL_NAMESPACE = namespace; #include "Includes.js" })(global, ObjectiveJ, window); var hasOwnProperty = Object.prototype.hasOwnProperty; // If we can't trust the host object, don't treat it as global // and fall back to inferred global through eval. In IE this // make a difference. if (window.window !== window) { for (key in global) if (hasOwnProperty.call(global, key)) eval(key + " = global[\"" + key + "\"];"); } else { for (key in global) if (hasOwnProperty.call(global, key)) window[key] = global[key]; }
Revert "A better fix for the IE bug. Rather than introduce the secondary global and the eval, just refer to the actual global object (works in any javascript env)."
Revert "A better fix for the IE bug. Rather than introduce the secondary global and the eval, just refer to the actual global object (works in any javascript env)." This reverts commit d40619aca072134fe41369b161add2d12b1e0a02.
JavaScript
lgpl-2.1
enquora/cappuccino,tolmasky/cappuccino,mrcarlberg/cappuccino,tolmasky/cappuccino,koamac/Cappuccino,krodelin/cappuccino,mrcarlberg/cappuccino,FrankReh/cappuccino,kidaa/cappuccino,cappuccino/cappuccino,wangshijin/cappuccino,Rosch/cappuccino,280north/cappuccino,tolmasky/cappuccino,enquora/cappuccino,eventualbuddha/cappuccino,tancred/cappuccino,rgv151/cappuccino,dgvivero/CappCoreData,kidaa/cappuccino,dgvivero/CappCoreData,primalmotion/cappuccino,tancred/cappuccino,eventualbuddha/cappuccino,wangshijin/cappuccino,cacaodev/cappuccino,cacaodev/cappuccino,zittix/cappuccino,zittix/cappuccino,krodelin/cappuccino,deltaprojects/cappuccino,FrankReh/cappuccino,krodelin/cappuccino,cappuccino/cappuccino,Rosch/cappuccino,enquora/cappuccino,dgvivero/CappCoreData,eventualbuddha/cappuccino,koamac/Cappuccino,mrcarlberg/cappuccino,kidaa/cappuccino,Rosch/cappuccino,zittix/cappuccino,rgv151/cappuccino,rgv151/cappuccino,FrankReh/cappuccino,krodelin/cappuccino,daboe01/cappuccino,AlexanderMazaletskiy/cappuccino,dgvivero/CappCoreData,Dogild/cappuccino,koamac/Cappuccino,daboe01/cappuccino,AlexanderMazaletskiy/cappuccino,zittix/cappuccino,daboe01/cappuccino,tolmasky/cappuccino,cacaodev/cappuccino,cappuccino/cappuccino,FrankReh/cappuccino,zittix/cappuccino,mrcarlberg/cappuccino,tancred/cappuccino,zittix/cappuccino,tancred/cappuccino,cappuccino/cappuccino,deltaprojects/cappuccino,krodelin/cappuccino,mrcarlberg/cappuccino,FrankReh/cappuccino,wangshijin/cappuccino,kidaa/cappuccino,Dogild/cappuccino,krodelin/cappuccino,daboe01/cappuccino,AlexanderMazaletskiy/cappuccino,Dogild/cappuccino,daboe01/cappuccino,rgv151/cappuccino,primalmotion/cappuccino,Rosch/cappuccino,enquora/cappuccino,primalmotion/cappuccino,Dogild/cappuccino,Rosch/cappuccino,enquora/cappuccino,deltaprojects/cappuccino,deltaprojects/cappuccino,FrankReh/cappuccino,enquora/cappuccino,mrcarlberg/cappuccino,cappuccino/cappuccino,cacaodev/cappuccino,primalmotion/cappuccino,wangshijin/cappuccino,daboe01/cappuccino,Rosch/cappuccino,rgv151/cappuccino,cacaodev/cappuccino,Dogild/cappuccino,kidaa/cappuccino,akshell/cappuccino,koamac/Cappuccino,FrankReh/cappuccino,akshell/cappuccino,wangshijin/cappuccino,akshell/cappuccino,Rosch/cappuccino,AlexanderMazaletskiy/cappuccino,tancred/cappuccino,deltaprojects/cappuccino,AlexanderMazaletskiy/cappuccino,cappuccino/cappuccino,280north/cappuccino,koamac/Cappuccino,280north/cappuccino,krodelin/cappuccino,rgv151/cappuccino,deltaprojects/cappuccino,mrcarlberg/cappuccino,280north/cappuccino,tancred/cappuccino,tolmasky/cappuccino,akshell/cappuccino,dgvivero/CappCoreData,cacaodev/cappuccino,AlexanderMazaletskiy/cappuccino,Dogild/cappuccino,koamac/Cappuccino,daboe01/cappuccino,enquora/cappuccino,primalmotion/cappuccino,rgv151/cappuccino,eventualbuddha/cappuccino,280north/cappuccino,mrcarlberg/cappuccino,deltaprojects/cappuccino,primalmotion/cappuccino,primalmotion/cappuccino,Dogild/cappuccino,cacaodev/cappuccino,wangshijin/cappuccino,FrankReh/cappuccino,kidaa/cappuccino,zittix/cappuccino,cappuccino/cappuccino
javascript
## Code Before: var ObjectiveJ = { }; (function (global, exports, namespace) { #include "Includes.js" })((function(){return this;}).call(null), ObjectiveJ); ## Instruction: Revert "A better fix for the IE bug. Rather than introduce the secondary global and the eval, just refer to the actual global object (works in any javascript env)." This reverts commit d40619aca072134fe41369b161add2d12b1e0a02. ## Code After: var global = { }, ObjectiveJ = { }; (function (global, exports, namespace) { var GLOBAL_NAMESPACE = namespace; #include "Includes.js" })(global, ObjectiveJ, window); var hasOwnProperty = Object.prototype.hasOwnProperty; // If we can't trust the host object, don't treat it as global // and fall back to inferred global through eval. In IE this // make a difference. if (window.window !== window) { for (key in global) if (hasOwnProperty.call(global, key)) eval(key + " = global[\"" + key + "\"];"); } else { for (key in global) if (hasOwnProperty.call(global, key)) window[key] = global[key]; }
+ var global = { }, - var ObjectiveJ = { }; ? ^^^ + ObjectiveJ = { }; ? ^^^ (function (global, exports, namespace) { + var GLOBAL_NAMESPACE = namespace; #include "Includes.js" - })((function(){return this;}).call(null), ObjectiveJ); + })(global, ObjectiveJ, window); + var hasOwnProperty = Object.prototype.hasOwnProperty; + + // If we can't trust the host object, don't treat it as global + // and fall back to inferred global through eval. In IE this + // make a difference. + if (window.window !== window) + { + for (key in global) + if (hasOwnProperty.call(global, key)) + eval(key + " = global[\"" + key + "\"];"); + } + else + { + for (key in global) + if (hasOwnProperty.call(global, key)) + window[key] = global[key]; + }
23
2.875
21
2
1199d0c219f3e272e0eb8ec5182d3db20ee7c615
README.md
README.md
Personal Vim configuration ## Instructions: * run **deployConfigs** to apply configs. * Install **Node.js** with **standard** and **eslint**. * Install extra plugins to enable **eslint** with **standard** ```npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node``` * Add ```.eslintrc``` as needed.
Personal Vim configuration ## Instructions: * run **deployConfigs** to apply configs. * install **Node.js** with **standard**, **eslint**, **htmlhint**. * install extra plugins to enable **eslint** with **standard** ```npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node``` * Add ```.eslintrc``` as needed.
Add htmlhint linter for HTML5
Add htmlhint linter for HTML5
Markdown
mit
Gosin/Vim4Gosin
markdown
## Code Before: Personal Vim configuration ## Instructions: * run **deployConfigs** to apply configs. * Install **Node.js** with **standard** and **eslint**. * Install extra plugins to enable **eslint** with **standard** ```npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node``` * Add ```.eslintrc``` as needed. ## Instruction: Add htmlhint linter for HTML5 ## Code After: Personal Vim configuration ## Instructions: * run **deployConfigs** to apply configs. * install **Node.js** with **standard**, **eslint**, **htmlhint**. * install extra plugins to enable **eslint** with **standard** ```npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node``` * Add ```.eslintrc``` as needed.
Personal Vim configuration ## Instructions: * run **deployConfigs** to apply configs. - * Install **Node.js** with **standard** and **eslint**. ? ^ ^^^^ + * install **Node.js** with **standard**, **eslint**, **htmlhint**. ? ^ ^ ++++++++++++++ ++ - * Install extra plugins to enable **eslint** with **standard** ? ^ + * install extra plugins to enable **eslint** with **standard** ? ^ ```npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node``` * Add ```.eslintrc``` as needed.
4
0.444444
2
2
e30433d5bf7e1a52ade500ff60eb01e2d13cc790
config/templates/api_umbrella_router/etc/logrotate.d/api-umbrella.erb
config/templates/api_umbrella_router/etc/logrotate.d/api-umbrella.erb
/var/log/api-umbrella/*.log /var/log/api-umbrella/**/*.log { daily rotate 90 create 644 api-umbrella api-umbrella missingok compress delaycompress notifempty sharedscripts postrotate api-umbrella reopen-logs endscript }
/opt/api-umbrella/var/log/*.log { daily rotate 90 create 644 api-umbrella api-umbrella missingok compress delaycompress notifempty sharedscripts postrotate api-umbrella reopen-logs endscript }
Fix log rotation woes (I hope).
Fix log rotation woes (I hope). The deep wildcard was leading to logrotate rotating the same files twice, which effectively messed things up by truncating the old file that was being rotated. Since we've gotten rid of our nested log paths, we shouldn't actually need the deep wildcard anyway.
HTML+ERB
mit
NREL/omnibus-api-umbrella,NREL/omnibus-api-umbrella,NREL/omnibus-api-umbrella
html+erb
## Code Before: /var/log/api-umbrella/*.log /var/log/api-umbrella/**/*.log { daily rotate 90 create 644 api-umbrella api-umbrella missingok compress delaycompress notifempty sharedscripts postrotate api-umbrella reopen-logs endscript } ## Instruction: Fix log rotation woes (I hope). The deep wildcard was leading to logrotate rotating the same files twice, which effectively messed things up by truncating the old file that was being rotated. Since we've gotten rid of our nested log paths, we shouldn't actually need the deep wildcard anyway. ## Code After: /opt/api-umbrella/var/log/*.log { daily rotate 90 create 644 api-umbrella api-umbrella missingok compress delaycompress notifempty sharedscripts postrotate api-umbrella reopen-logs endscript }
- /var/log/api-umbrella/*.log /var/log/api-umbrella/**/*.log { + /opt/api-umbrella/var/log/*.log { daily rotate 90 create 644 api-umbrella api-umbrella missingok compress delaycompress notifempty sharedscripts postrotate api-umbrella reopen-logs endscript }
2
0.153846
1
1
28a1ffde5bcdc91a4afb4544eed589275c869c9e
.travis.yml
.travis.yml
sudo: required dist: trusty language: node_js node_js: - '4.2' before_script: - npm install script: npm test
sudo: required dist: trusty language: node_js node_js: - '4.2' before_install: if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi install: - npm install before_script: script: npm test
Install npm v3 if needed
Install npm v3 if needed
YAML
mit
DavidLevayer/countable,DavidLevayer/countable,DavidLevayer/countable
yaml
## Code Before: sudo: required dist: trusty language: node_js node_js: - '4.2' before_script: - npm install script: npm test ## Instruction: Install npm v3 if needed ## Code After: sudo: required dist: trusty language: node_js node_js: - '4.2' before_install: if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi install: - npm install before_script: script: npm test
sudo: required dist: trusty language: node_js node_js: - '4.2' - before_script: + before_install: if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi + + install: - npm install + before_script: + script: npm test
6
0.6
5
1
e29e630fd6efd5eebba97b3b1ec8b9125f50da1d
client/app/components/_expandablePanel/expandablePanel.controller.js
client/app/components/_expandablePanel/expandablePanel.controller.js
import markdown from "markdown-it"; const md = markdown({ xhtmlOut: true, breaks: true }); export default class ExpandablePanelController { constructor($timeout, $sce) { "ngInject"; Object.assign(this, { expandable: false, expanded: false, parsed: "" }); $timeout( () => { // more then 10 lines? if (this.content.match(/\n/mg).length > 9) { this.expandable = true; } if (this.markdown) { this.parsed = $sce.trustAsHtml(md.render(this.content)); } }); } toggle() { this.expanded = !this.expanded; } }
import markdown from "markdown-it"; const md = markdown({ xhtmlOut: true, breaks: true }); export default class ExpandablePanelController { constructor($sce) { "ngInject"; Object.assign(this, { $sce, expandable: false, expanded: false, parsed: "" }); } $onChanges(changes) { if (changes.content && changes.content.currentValue) { let content = changes.content.currentValue; // more then 10 lines? if (content.match(/\n/mg).length > 9) { this.expandable = true; } if (this.markdown) { this.parsed = this.$sce.trustAsHtml(md.render(content)); } } } toggle() { this.expanded = !this.expanded; } }
Use $onChanges to react to updated content
Use $onChanges to react to updated content
JavaScript
mit
yunity/karrot-frontend,yunity/karrot-frontend,yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend
javascript
## Code Before: import markdown from "markdown-it"; const md = markdown({ xhtmlOut: true, breaks: true }); export default class ExpandablePanelController { constructor($timeout, $sce) { "ngInject"; Object.assign(this, { expandable: false, expanded: false, parsed: "" }); $timeout( () => { // more then 10 lines? if (this.content.match(/\n/mg).length > 9) { this.expandable = true; } if (this.markdown) { this.parsed = $sce.trustAsHtml(md.render(this.content)); } }); } toggle() { this.expanded = !this.expanded; } } ## Instruction: Use $onChanges to react to updated content ## Code After: import markdown from "markdown-it"; const md = markdown({ xhtmlOut: true, breaks: true }); export default class ExpandablePanelController { constructor($sce) { "ngInject"; Object.assign(this, { $sce, expandable: false, expanded: false, parsed: "" }); } $onChanges(changes) { if (changes.content && changes.content.currentValue) { let content = changes.content.currentValue; // more then 10 lines? if (content.match(/\n/mg).length > 9) { this.expandable = true; } if (this.markdown) { this.parsed = this.$sce.trustAsHtml(md.render(content)); } } } toggle() { this.expanded = !this.expanded; } }
import markdown from "markdown-it"; const md = markdown({ xhtmlOut: true, breaks: true }); export default class ExpandablePanelController { - constructor($timeout, $sce) { ? ---------- + constructor($sce) { "ngInject"; Object.assign(this, { + $sce, expandable: false, expanded: false, parsed: "" }); - $timeout( () => { - + } + $onChanges(changes) { + if (changes.content && changes.content.currentValue) { + let content = changes.content.currentValue; // more then 10 lines? - if (this.content.match(/\n/mg).length > 9) { ? ----- + if (content.match(/\n/mg).length > 9) { this.expandable = true; } if (this.markdown) { - this.parsed = $sce.trustAsHtml(md.render(this.content)); ? ----- + this.parsed = this.$sce.trustAsHtml(md.render(content)); ? +++++ } - - }); ? -- + } } toggle() { this.expanded = !this.expanded; } }
16
0.516129
9
7
5d9505254444603d10402be10ee39390488f3e49
git_from_source.sh
git_from_source.sh
set -e # exit on any error sudo apt-get --assume-yes build-dep git sudo apt-get --assume-yes install libssl-dev xmlto latest_git_version=$(git ls-remote --tags git://git.kernel.org/pub/scm/git/git.git | tail -n 1 | sed 's@.*refs/tags/\(.*\)\^{}@\1@') && echo ${latest_git_version} cd /tmp wget -O git-${latest_git_version}.tar.gz https://github.com/git/git/tarball/v${latest_git_version} tar xzf git-${latest_git_version}.tar.gz cd git-git-* sudo make prefix=/usr/local install install-doc
set -e # exit on any error sudo apt-get --assume-yes build-dep git sudo apt-get --assume-yes install libssl-dev xmlto latest_git_version=$(curl -s http://git-scm.com/ | grep "class='version'" | perl -pe 's/.*?([0-9\.]+)<.*/$1/') && echo ${latest_git_version} cd /tmp wget -O git-${latest_git_version}.tar.gz https://github.com/git/git/tarball/v${latest_git_version} tar xzf git-${latest_git_version}.tar.gz cd git-git-* sudo make prefix=/usr/local install install-doc
Revert "use Jefromi's way to get latest_git_version"
Revert "use Jefromi's way to get latest_git_version" This reverts commit 630faa3de1c399f7b5c5825a20c9775239749d3c.
Shell
mit
felixhummel/x
shell
## Code Before: set -e # exit on any error sudo apt-get --assume-yes build-dep git sudo apt-get --assume-yes install libssl-dev xmlto latest_git_version=$(git ls-remote --tags git://git.kernel.org/pub/scm/git/git.git | tail -n 1 | sed 's@.*refs/tags/\(.*\)\^{}@\1@') && echo ${latest_git_version} cd /tmp wget -O git-${latest_git_version}.tar.gz https://github.com/git/git/tarball/v${latest_git_version} tar xzf git-${latest_git_version}.tar.gz cd git-git-* sudo make prefix=/usr/local install install-doc ## Instruction: Revert "use Jefromi's way to get latest_git_version" This reverts commit 630faa3de1c399f7b5c5825a20c9775239749d3c. ## Code After: set -e # exit on any error sudo apt-get --assume-yes build-dep git sudo apt-get --assume-yes install libssl-dev xmlto latest_git_version=$(curl -s http://git-scm.com/ | grep "class='version'" | perl -pe 's/.*?([0-9\.]+)<.*/$1/') && echo ${latest_git_version} cd /tmp wget -O git-${latest_git_version}.tar.gz https://github.com/git/git/tarball/v${latest_git_version} tar xzf git-${latest_git_version}.tar.gz cd git-git-* sudo make prefix=/usr/local install install-doc
set -e # exit on any error sudo apt-get --assume-yes build-dep git sudo apt-get --assume-yes install libssl-dev xmlto - latest_git_version=$(git ls-remote --tags git://git.kernel.org/pub/scm/git/git.git | tail -n 1 | sed 's@.*refs/tags/\(.*\)\^{}@\1@') && echo ${latest_git_version} + latest_git_version=$(curl -s http://git-scm.com/ | grep "class='version'" | perl -pe 's/.*?([0-9\.]+)<.*/$1/') && echo ${latest_git_version} cd /tmp wget -O git-${latest_git_version}.tar.gz https://github.com/git/git/tarball/v${latest_git_version} tar xzf git-${latest_git_version}.tar.gz cd git-git-* sudo make prefix=/usr/local install install-doc
2
0.2
1
1
a7babe125786ebb5479b99eb9c15987e02798217
README.txt
README.txt
Profiler plugin for the SA:MP server. Copyright (c) 2011 Zeex. See LICENSE.txt for license details. You can configure profiler via server.cfg, by changing the following options: * profile_gamemode <0/1> If set to 1, profiler will profile currently running game mode. Default value is 0. * profile_filterscripts <fs1> <fs2> ... A list of filter scripts to be profiled. * profiler_substract_children <0/1> If set to 1, callee's time is substracted from the total time of its caller(s). Default value is 1. * profiler_output_format <format> Set output format. Currently supported formats: html, text. Default is html. Note; for html format it is possible to sort stats by clicking on column name. * profiler_sort_output_by <what> Set output sort mode. Supported values are: calls, time, time_per_call. By default output sorted by time.
************************************ Profiler plugin for the SA:MP server ************************************ Copyright (c) 2011 Zeex. See LICENSE.txt for license details. Source code can be obtained here: https://github.com/Zeex/profiler Latest binaries can be downloaded from: https://github.com/Zeex/profiler/downloads -------------------- Plugin configuration -------------------- You can configure profiler via server.cfg, by changing the following options: * profile_gamemode <0/1> If set to 1, profiler will profile currently running game mode. Default value is 0. * profile_filterscripts <fs1> <fs2> ... A list of filter scripts to be profiled. * profiler_substract_children <0/1> If set to 1, callee's time is substracted from the total time of its caller(s). Default value is 1. * profiler_output_format <format> Set output format. Currently supported formats: html, text. Default is html. Note; for html format it is possible to sort stats by clicking on column name. * profiler_sort_output_by <what> Set output sort mode. Supported values are: calls, time, time_per_call. By default output sorted by time.
Add a few links and improve formatting
Add a few links and improve formatting
Text
bsd-2-clause
Zeex/samp-plugin-profiler,Zeex/samp-plugin-profiler
text
## Code Before: Profiler plugin for the SA:MP server. Copyright (c) 2011 Zeex. See LICENSE.txt for license details. You can configure profiler via server.cfg, by changing the following options: * profile_gamemode <0/1> If set to 1, profiler will profile currently running game mode. Default value is 0. * profile_filterscripts <fs1> <fs2> ... A list of filter scripts to be profiled. * profiler_substract_children <0/1> If set to 1, callee's time is substracted from the total time of its caller(s). Default value is 1. * profiler_output_format <format> Set output format. Currently supported formats: html, text. Default is html. Note; for html format it is possible to sort stats by clicking on column name. * profiler_sort_output_by <what> Set output sort mode. Supported values are: calls, time, time_per_call. By default output sorted by time. ## Instruction: Add a few links and improve formatting ## Code After: ************************************ Profiler plugin for the SA:MP server ************************************ Copyright (c) 2011 Zeex. See LICENSE.txt for license details. Source code can be obtained here: https://github.com/Zeex/profiler Latest binaries can be downloaded from: https://github.com/Zeex/profiler/downloads -------------------- Plugin configuration -------------------- You can configure profiler via server.cfg, by changing the following options: * profile_gamemode <0/1> If set to 1, profiler will profile currently running game mode. Default value is 0. * profile_filterscripts <fs1> <fs2> ... A list of filter scripts to be profiled. * profiler_substract_children <0/1> If set to 1, callee's time is substracted from the total time of its caller(s). Default value is 1. * profiler_output_format <format> Set output format. Currently supported formats: html, text. Default is html. Note; for html format it is possible to sort stats by clicking on column name. * profiler_sort_output_by <what> Set output sort mode. Supported values are: calls, time, time_per_call. By default output sorted by time.
+ ************************************ - Profiler plugin for the SA:MP server. ? - + Profiler plugin for the SA:MP server + ************************************ Copyright (c) 2011 Zeex. See LICENSE.txt for license details. + + Source code can be obtained here: + https://github.com/Zeex/profiler + + Latest binaries can be downloaded from: + https://github.com/Zeex/profiler/downloads + + -------------------- + Plugin configuration + -------------------- You can configure profiler via server.cfg, by changing the following options: * profile_gamemode <0/1> If set to 1, profiler will profile currently running game mode. Default value is 0. * profile_filterscripts <fs1> <fs2> ... A list of filter scripts to be profiled. * profiler_substract_children <0/1> If set to 1, callee's time is substracted from the total time of its caller(s). Default value is 1. * profiler_output_format <format> Set output format. Currently supported formats: html, text. Default is html. Note; for html format it is possible to sort stats by clicking on column name. * profiler_sort_output_by <what> Set output sort mode. Supported values are: calls, time, time_per_call. By default output sorted by time.
14
0.4375
13
1
aa05b1827dee119da573b2245b1f9fc7e39c7782
README.md
README.md
SOLUTIONS to the 2016 Advent of code in Perl6
SOLUTIONS to the 2016 Advent of code (http://adventofcode.com/) in Perl6
Add advent of code link to readme
Add advent of code link to readme
Markdown
mit
duelafn/advent-of-code-2016-in-perl6,duelafn/advent-of-code-2016-in-perl6
markdown
## Code Before: SOLUTIONS to the 2016 Advent of code in Perl6 ## Instruction: Add advent of code link to readme ## Code After: SOLUTIONS to the 2016 Advent of code (http://adventofcode.com/) in Perl6
+ - SOLUTIONS to the 2016 Advent of code in Perl6 + SOLUTIONS to the 2016 Advent of code (http://adventofcode.com/) in Perl6 ? +++++++++++++++++++++++++++
3
3
2
1
b5daaf7c7369564b885e900dab278edd091db791
keymaps/git.cson
keymaps/git.cson
'.workspace': 'ctrl-shift-9': 'github:toggle-git-panel' 'ctrl-9': 'github:toggle-git-panel-focus' '.github-StagingView': 'left': 'github:focus-diff-view' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'github:focus-git-panel' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel'
'.workspace': 'ctrl-9': 'github:toggle-git-panel' 'ctrl-shift-9': 'github:toggle-git-panel-focus' '.github-StagingView': 'left': 'github:focus-diff-view' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'github:focus-git-panel' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel'
Swap ctrl-9 and ctrl-shift-9 <_< >_>
Swap ctrl-9 and ctrl-shift-9 <_< >_>
CoffeeScript
mit
atom/github,atom/github,atom/github
coffeescript
## Code Before: '.workspace': 'ctrl-shift-9': 'github:toggle-git-panel' 'ctrl-9': 'github:toggle-git-panel-focus' '.github-StagingView': 'left': 'github:focus-diff-view' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'github:focus-git-panel' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel' ## Instruction: Swap ctrl-9 and ctrl-shift-9 <_< >_> ## Code After: '.workspace': 'ctrl-9': 'github:toggle-git-panel' 'ctrl-shift-9': 'github:toggle-git-panel-focus' '.github-StagingView': 'left': 'github:focus-diff-view' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'github:focus-git-panel' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel'
'.workspace': + 'ctrl-9': 'github:toggle-git-panel' - 'ctrl-shift-9': 'github:toggle-git-panel' + 'ctrl-shift-9': 'github:toggle-git-panel-focus' ? ++++++ - 'ctrl-9': 'github:toggle-git-panel-focus' '.github-StagingView': 'left': 'github:focus-diff-view' '.github-CommitView-editor atom-text-editor:not([mini])': 'cmd-enter': 'github:commit' 'ctrl-enter': 'github:commit' '.github-FilePatchView': '/': 'github:toggle-patch-selection-mode' 'tab': 'github:select-next-hunk' 'shift-tab': 'github:select-previous-hunk' 'right': 'github:focus-git-panel' '.github-Prompt-input': 'enter': 'core:confirm' 'esc': 'core:cancel'
4
0.2
2
2
f3dc9df96f4bf3f22ba5b87411d02c19d8bc7749
.travis.yml
.travis.yml
language: java sudo: false script: mvn clean test site -P run-conqat
language: java sudo: false before_install: - sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml script: mvn clean test site -P run-conqat
Work around missing codehaus repository
Work around missing codehaus repository
YAML
apache-2.0
AludraTest/cloud-manager-api
yaml
## Code Before: language: java sudo: false script: mvn clean test site -P run-conqat ## Instruction: Work around missing codehaus repository ## Code After: language: java sudo: false before_install: - sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml script: mvn clean test site -P run-conqat
language: java sudo: false + before_install: + - sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml + script: mvn clean test site -P run-conqat
3
0.6
3
0
0cda40909ab4e3160462bc80119d3fdceccfb355
.travis.yml
.travis.yml
language: python python: - "3.3" - "2.7" before_install: - sudo locale-gen fr_FR.UTF-8 - sudo mkdir -p /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo chown postgres:postgres /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo apt-get update -qq - sudo apt-get install -qq postgresql-plperl before_script: - psql -Upostgres -c "CREATE TABLESPACE ts1 LOCATION '/extra/pg/9.1/ts1'" - psql -Upostgres -c "CREATE TABLESPACE ts2 LOCATION '/extra/pg/9.1/ts2'" script: - python setup.py test
language: python python: - "3.3" - "2.7" before_install: - sudo locale-gen fr_FR.UTF-8 - sudo mkdir -p /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo chown postgres:postgres /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo apt-get update -qq - sudo apt-get install -qq postgresql-plperl before_script: - psql -Upostgres -c "CREATE TABLESPACE ts1 LOCATION '/extra/pg/9.1/ts1'" - psql -Upostgres -c "CREATE TABLESPACE ts2 LOCATION '/extra/pg/9.1/ts2'" - psql -Upostgres -c "CREATE LANGUAGE plpythonu" - psql -c "DO $$import subprocess; plpy.info(subprocess.check_output(['localedef', '--list-archive']))$$ LANGUAGE plpythonu;" script: - python setup.py test
Verify the fr_FR.utf8 locale is available on Travis-CI.
Verify the fr_FR.utf8 locale is available on Travis-CI.
YAML
bsd-3-clause
reedstrm/Pyrseas,dvarrazzo/Pyrseas,perseas/Pyrseas
yaml
## Code Before: language: python python: - "3.3" - "2.7" before_install: - sudo locale-gen fr_FR.UTF-8 - sudo mkdir -p /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo chown postgres:postgres /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo apt-get update -qq - sudo apt-get install -qq postgresql-plperl before_script: - psql -Upostgres -c "CREATE TABLESPACE ts1 LOCATION '/extra/pg/9.1/ts1'" - psql -Upostgres -c "CREATE TABLESPACE ts2 LOCATION '/extra/pg/9.1/ts2'" script: - python setup.py test ## Instruction: Verify the fr_FR.utf8 locale is available on Travis-CI. ## Code After: language: python python: - "3.3" - "2.7" before_install: - sudo locale-gen fr_FR.UTF-8 - sudo mkdir -p /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo chown postgres:postgres /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo apt-get update -qq - sudo apt-get install -qq postgresql-plperl before_script: - psql -Upostgres -c "CREATE TABLESPACE ts1 LOCATION '/extra/pg/9.1/ts1'" - psql -Upostgres -c "CREATE TABLESPACE ts2 LOCATION '/extra/pg/9.1/ts2'" - psql -Upostgres -c "CREATE LANGUAGE plpythonu" - psql -c "DO $$import subprocess; plpy.info(subprocess.check_output(['localedef', '--list-archive']))$$ LANGUAGE plpythonu;" script: - python setup.py test
language: python python: - "3.3" - "2.7" before_install: - sudo locale-gen fr_FR.UTF-8 - sudo mkdir -p /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo chown postgres:postgres /extra/pg/9.1/ts1 /extra/pg/9.1/ts2 - sudo apt-get update -qq - sudo apt-get install -qq postgresql-plperl before_script: - psql -Upostgres -c "CREATE TABLESPACE ts1 LOCATION '/extra/pg/9.1/ts1'" - psql -Upostgres -c "CREATE TABLESPACE ts2 LOCATION '/extra/pg/9.1/ts2'" + - psql -Upostgres -c "CREATE LANGUAGE plpythonu" + - psql -c "DO $$import subprocess; plpy.info(subprocess.check_output(['localedef', '--list-archive']))$$ LANGUAGE plpythonu;" script: - python setup.py test
2
0.133333
2
0
d7ccb529eb0440de3f31e4a5810851b48a7a8a6c
README.md
README.md
<table> <tr> <th>Master</th> <th>Dev</th> </tr> <tr> <td>[![Build Status](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap.svg?branch=master)](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap)</td> <td>[![Build Status](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap.svg?branch=dev)](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap)</td> </tr> </table> Прототип проекта "карта уровня игры". Пока что есть только лабиринт и поиск короткого пути. Нужно ещё сделать игру. ## Параметры Если мы хотим найти путь на картинке `maze.png` от координат 1 и 2 до 100 и 150 мы пишем: ```sh $ ./PreLevelMap maze.png 1 2 100 150 ``` ## Как помочь проекту 1. Нажать на кнопку `Fork` ![](https://upload.wikimedia.org/wikipedia/commons/3/38/GitHub_Fork_Button.png) 2. Вас отправит на ваш репозиторий в котром вы можете изменять исходники. 3. Отправте Pull Request. ![](https://guides.github.com/activities/hello-world/pr-tab.gif) ## Пример вывода ![](screenshot/screen1.png)
Прототип проекта "карта уровня игры". Пока что есть только лабиринт и поиск короткого пути. Нужно ещё сделать игру. ## Параметры Если мы хотим найти путь на картинке `maze.png` от координат 1 и 2 до 100 и 150 мы пишем: ```sh $ ./PreLevelMap maze.png 1 2 100 150 ``` ## Как помочь проекту 1. Нажать на кнопку `Fork` ![](https://upload.wikimedia.org/wikipedia/commons/3/38/GitHub_Fork_Button.png) 2. Вас отправит на ваш репозиторий в котром вы можете изменять исходники. 3. Отправте Pull Request. ![](https://guides.github.com/activities/hello-world/pr-tab.gif) ## Пример вывода ![](screenshot/screen1.png)
Revert "Added a Travis badge."
Revert "Added a Travis badge." This reverts commit 9d823e98c8c9cee06300e1c6eccd9c2c4b7e48ff.
Markdown
mit
NeverMine17/astar-sfml
markdown
## Code Before: <table> <tr> <th>Master</th> <th>Dev</th> </tr> <tr> <td>[![Build Status](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap.svg?branch=master)](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap)</td> <td>[![Build Status](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap.svg?branch=dev)](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap)</td> </tr> </table> Прототип проекта "карта уровня игры". Пока что есть только лабиринт и поиск короткого пути. Нужно ещё сделать игру. ## Параметры Если мы хотим найти путь на картинке `maze.png` от координат 1 и 2 до 100 и 150 мы пишем: ```sh $ ./PreLevelMap maze.png 1 2 100 150 ``` ## Как помочь проекту 1. Нажать на кнопку `Fork` ![](https://upload.wikimedia.org/wikipedia/commons/3/38/GitHub_Fork_Button.png) 2. Вас отправит на ваш репозиторий в котром вы можете изменять исходники. 3. Отправте Pull Request. ![](https://guides.github.com/activities/hello-world/pr-tab.gif) ## Пример вывода ![](screenshot/screen1.png) ## Instruction: Revert "Added a Travis badge." This reverts commit 9d823e98c8c9cee06300e1c6eccd9c2c4b7e48ff. ## Code After: Прототип проекта "карта уровня игры". Пока что есть только лабиринт и поиск короткого пути. Нужно ещё сделать игру. ## Параметры Если мы хотим найти путь на картинке `maze.png` от координат 1 и 2 до 100 и 150 мы пишем: ```sh $ ./PreLevelMap maze.png 1 2 100 150 ``` ## Как помочь проекту 1. Нажать на кнопку `Fork` ![](https://upload.wikimedia.org/wikipedia/commons/3/38/GitHub_Fork_Button.png) 2. Вас отправит на ваш репозиторий в котром вы можете изменять исходники. 3. Отправте Pull Request. ![](https://guides.github.com/activities/hello-world/pr-tab.gif) ## Пример вывода ![](screenshot/screen1.png)
- - <table> - <tr> - <th>Master</th> - <th>Dev</th> - </tr> - <tr> - <td>[![Build Status](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap.svg?branch=master)](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap)</td> - <td>[![Build Status](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap.svg?branch=dev)](https://travis-ci.org/IngenerkaTeamNewYork/PreLevelMap)</td> - </tr> - </table> - Прототип проекта "карта уровня игры". Пока что есть только лабиринт и поиск короткого пути. Нужно ещё сделать игру. ## Параметры Если мы хотим найти путь на картинке `maze.png` от координат 1 и 2 до 100 и 150 мы пишем: ```sh $ ./PreLevelMap maze.png 1 2 100 150 ``` ## Как помочь проекту 1. Нажать на кнопку `Fork` ![](https://upload.wikimedia.org/wikipedia/commons/3/38/GitHub_Fork_Button.png) 2. Вас отправит на ваш репозиторий в котром вы можете изменять исходники. 3. Отправте Pull Request. ![](https://guides.github.com/activities/hello-world/pr-tab.gif) ## Пример вывода ![](screenshot/screen1.png)
12
0.375
0
12
06de0a2ff6e29747127ad11b871e984fba21c23a
index.html
index.html
<!DOCTYPE html> <html> <head> <script src="js/modernizr.custom.20910.js"></script> <script src="js/jquery.js"></script> <link href="css/slide-to-captcha.css" rel="stylesheet"> </head> <body> <form> <div class="captcha"> <div class="handle"></div> </div> <input type="submit">submit</input> </form> </body> <script src="js/slide-to-captcha.js" type="text/javascript"></script> <script> $('.captcha').slideToCAPTCHA(); </script> </html>
<!DOCTYPE html> <html> <head> <script src="js/modernizr.custom.20910.js"></script> <script src="js/jquery.js"></script> <link href="css/slide-to-captcha.css" rel="stylesheet"> </head> <body> <form> <div class="captcha"> <div class="handle"></div> </div> <input type="submit" value="Submit This"></input> </form> </body> <script src="js/slide-to-captcha.js" type="text/javascript"></script> <script> $('.captcha').slideToCAPTCHA(); </script> </html>
Fix HTML error on submit button
Fix HTML error on submit button
HTML
mit
joshbroton/slide-to-captcha,joshbroton/slide-to-captcha
html
## Code Before: <!DOCTYPE html> <html> <head> <script src="js/modernizr.custom.20910.js"></script> <script src="js/jquery.js"></script> <link href="css/slide-to-captcha.css" rel="stylesheet"> </head> <body> <form> <div class="captcha"> <div class="handle"></div> </div> <input type="submit">submit</input> </form> </body> <script src="js/slide-to-captcha.js" type="text/javascript"></script> <script> $('.captcha').slideToCAPTCHA(); </script> </html> ## Instruction: Fix HTML error on submit button ## Code After: <!DOCTYPE html> <html> <head> <script src="js/modernizr.custom.20910.js"></script> <script src="js/jquery.js"></script> <link href="css/slide-to-captcha.css" rel="stylesheet"> </head> <body> <form> <div class="captcha"> <div class="handle"></div> </div> <input type="submit" value="Submit This"></input> </form> </body> <script src="js/slide-to-captcha.js" type="text/javascript"></script> <script> $('.captcha').slideToCAPTCHA(); </script> </html>
<!DOCTYPE html> <html> <head> <script src="js/modernizr.custom.20910.js"></script> <script src="js/jquery.js"></script> <link href="css/slide-to-captcha.css" rel="stylesheet"> </head> <body> <form> <div class="captcha"> <div class="handle"></div> </div> - <input type="submit">submit</input> ? ^^ + <input type="submit" value="Submit This"></input> ? ^^^^^^^^^ +++++++ </form> </body> <script src="js/slide-to-captcha.js" type="text/javascript"></script> <script> $('.captcha').slideToCAPTCHA(); </script> </html>
2
0.086957
1
1
71cbc6c9602234f00279e7ff4eb6a8bb282d23b1
lib/util/getSession.js
lib/util/getSession.js
// Args exports.required = ['jar']; // Define exports.func = function (args) { var cookies = args.jar.getCookies('https://www.roblox.com'); for (var key in cookies) { if (cookies.hasOwnProperty(key) && cookies[key].key === '.ROBLOSECURITY') { return cookies[key].value; } } };
// Includes var settings = require('../../settings.json'); // Args exports.required = ['jar']; // Define exports.func = function (args) { var jar = args.jar; if (settings.session_only) { return jar.session; } else { var cookies = jar.getCookies('https://www.roblox.com'); for (var key in cookies) { if (cookies.hasOwnProperty(key) && cookies[key].key === '.ROBLOSECURITY') { return cookies[key].value; } } } };
Add support for session only cookies
Add support for session only cookies
JavaScript
mit
OnlyTwentyCharacters/roblox-js,sentanos/roblox-js,FroastJ/roblox-js
javascript
## Code Before: // Args exports.required = ['jar']; // Define exports.func = function (args) { var cookies = args.jar.getCookies('https://www.roblox.com'); for (var key in cookies) { if (cookies.hasOwnProperty(key) && cookies[key].key === '.ROBLOSECURITY') { return cookies[key].value; } } }; ## Instruction: Add support for session only cookies ## Code After: // Includes var settings = require('../../settings.json'); // Args exports.required = ['jar']; // Define exports.func = function (args) { var jar = args.jar; if (settings.session_only) { return jar.session; } else { var cookies = jar.getCookies('https://www.roblox.com'); for (var key in cookies) { if (cookies.hasOwnProperty(key) && cookies[key].key === '.ROBLOSECURITY') { return cookies[key].value; } } } };
+ // Includes + var settings = require('../../settings.json'); + // Args exports.required = ['jar']; // Define exports.func = function (args) { + var jar = args.jar; + if (settings.session_only) { + return jar.session; + } else { - var cookies = args.jar.getCookies('https://www.roblox.com'); ? ----- + var cookies = jar.getCookies('https://www.roblox.com'); ? ++ - for (var key in cookies) { + for (var key in cookies) { ? ++ - if (cookies.hasOwnProperty(key) && cookies[key].key === '.ROBLOSECURITY') { + if (cookies.hasOwnProperty(key) && cookies[key].key === '.ROBLOSECURITY') { ? ++ - return cookies[key].value; + return cookies[key].value; ? ++ + } } } };
16
1.333333
12
4
69a1ac6f09fef4f7954677a005ebfe32235ed5cd
index.js
index.js
import React from 'react'; import Match from 'react-router/Match'; import Miss from 'react-router/Miss'; import Users from './Users'; class UsersRouting extends React.Component { NoMatch() { return <div> <h2>Uh-oh!</h2> <p>How did you get to <tt>{this.props.location.pathname}</tt>?</p> </div> } render() { var pathname = this.props.pathname; var connect = this.props.connect; console.log("matching location:", this.props.location.pathname); return <div> <h1>Users module</h1> <Match exactly pattern={`${pathname}`} component={connect(Users)}/> <Match exactly pattern={`${pathname}/:query`} component={connect(Users)}/> <Match pattern={`${pathname}/:query?/view/:userid`} component={connect(Users)}/> <Miss component={this.NoMatch.bind(this)}/> </div> } } export default UsersRouting;
import React from 'react'; import Match from 'react-router/Match'; import Miss from 'react-router/Miss'; import Users from './Users'; class UsersRouting extends React.Component { constructor(props){ super(props); this.connectedUsers = props.connect(Users); } NoMatch() { return <div> <h2>Uh-oh!</h2> <p>How did you get to <tt>{this.props.location.pathname}</tt>?</p> </div> } render() { var pathname = this.props.pathname; var connect = this.props.connect; console.log("matching location:", this.props.location.pathname); return <div> <h1>Users module</h1> <Match exactly pattern={`${pathname}`} component={this.connectedUsers}/> <Match exactly pattern={`${pathname}/:query`} component={this.connectedUsers}/> <Match pattern={`${pathname}/:query?/view/:userid`} component={this.connectedUsers}/> <Miss component={this.NoMatch.bind(this)}/> </div> } } export default UsersRouting;
Call connect() on the Users component only once, and cache the result. This seems to fix STRIPES-97 at last!
Call connect() on the Users component only once, and cache the result. This seems to fix STRIPES-97 at last!
JavaScript
apache-2.0
folio-org/ui-users,folio-org/ui-users
javascript
## Code Before: import React from 'react'; import Match from 'react-router/Match'; import Miss from 'react-router/Miss'; import Users from './Users'; class UsersRouting extends React.Component { NoMatch() { return <div> <h2>Uh-oh!</h2> <p>How did you get to <tt>{this.props.location.pathname}</tt>?</p> </div> } render() { var pathname = this.props.pathname; var connect = this.props.connect; console.log("matching location:", this.props.location.pathname); return <div> <h1>Users module</h1> <Match exactly pattern={`${pathname}`} component={connect(Users)}/> <Match exactly pattern={`${pathname}/:query`} component={connect(Users)}/> <Match pattern={`${pathname}/:query?/view/:userid`} component={connect(Users)}/> <Miss component={this.NoMatch.bind(this)}/> </div> } } export default UsersRouting; ## Instruction: Call connect() on the Users component only once, and cache the result. This seems to fix STRIPES-97 at last! ## Code After: import React from 'react'; import Match from 'react-router/Match'; import Miss from 'react-router/Miss'; import Users from './Users'; class UsersRouting extends React.Component { constructor(props){ super(props); this.connectedUsers = props.connect(Users); } NoMatch() { return <div> <h2>Uh-oh!</h2> <p>How did you get to <tt>{this.props.location.pathname}</tt>?</p> </div> } render() { var pathname = this.props.pathname; var connect = this.props.connect; console.log("matching location:", this.props.location.pathname); return <div> <h1>Users module</h1> <Match exactly pattern={`${pathname}`} component={this.connectedUsers}/> <Match exactly pattern={`${pathname}/:query`} component={this.connectedUsers}/> <Match pattern={`${pathname}/:query?/view/:userid`} component={this.connectedUsers}/> <Miss component={this.NoMatch.bind(this)}/> </div> } } export default UsersRouting;
import React from 'react'; import Match from 'react-router/Match'; import Miss from 'react-router/Miss'; import Users from './Users'; class UsersRouting extends React.Component { + constructor(props){ + super(props); + this.connectedUsers = props.connect(Users); + } + NoMatch() { return <div> <h2>Uh-oh!</h2> <p>How did you get to <tt>{this.props.location.pathname}</tt>?</p> </div> } render() { var pathname = this.props.pathname; var connect = this.props.connect; console.log("matching location:", this.props.location.pathname); return <div> <h1>Users module</h1> - <Match exactly pattern={`${pathname}`} component={connect(Users)}/> ? ^ - + <Match exactly pattern={`${pathname}`} component={this.connectedUsers}/> ? +++++ ^^ - <Match exactly pattern={`${pathname}/:query`} component={connect(Users)}/> ? ^ - + <Match exactly pattern={`${pathname}/:query`} component={this.connectedUsers}/> ? +++++ ^^ - <Match pattern={`${pathname}/:query?/view/:userid`} component={connect(Users)}/> ? ^ - + <Match pattern={`${pathname}/:query?/view/:userid`} component={this.connectedUsers}/> ? +++++ ^^ <Miss component={this.NoMatch.bind(this)}/> </div> } } export default UsersRouting;
11
0.37931
8
3
4702258a125cb7b07c74900e59c53c1575df9a9e
src/In2pire/Memcached/Cli/Application.php
src/In2pire/Memcached/Cli/Application.php
<?php /** * @file * * @package In2pire * @subpackage MemcachedCli * @author Nhat Tran <nhat.tran@inspire.vn> */ namespace In2pire\Memcached\Cli; class Application extends \In2pire\Cli\CliApplication { /** * @inheritdoc */ public function boot() { if ($this->booted) { // Already booted. return $this; } // Boot parent. parent::boot(); // Check memcached extension. if (!extension_loaded('memcached')) { $this->response->writeln('<error>Could not found memcached extension<error>'); return false; } return $this; } }
<?php /** * @file * * @package In2pire * @subpackage MemcachedCli * @author Nhat Tran <nhat.tran@inspire.vn> */ namespace In2pire\Memcached\Cli; class Application extends \In2pire\Cli\CliApplication { /** * @inheritdoc */ public function boot() { if ($this->booted) { // Already booted. return $this; } // Boot parent. parent::boot(); // Check memcached extension. if (!extension_loaded('memcached')) { $this->response->writeln('<error>Could not found memcached extension<error>'); return false; } $description = $this->runner->getDescription(); if (!empty($description)) { $description .= "\n\n"; } $description .= '<comment>igbinary support</comment> ' . (\Memcached::HAVE_IGBINARY ? 'yes' : 'no') . "\n"; $description .= '<comment>json support</comment> ' . (\Memcached::HAVE_JSON ? 'yes' : 'no'); $this->runner->setDescription($description); return $this; } }
Add more information to application description
Add more information to application description
PHP
mit
in2pire/memcached-cli
php
## Code Before: <?php /** * @file * * @package In2pire * @subpackage MemcachedCli * @author Nhat Tran <nhat.tran@inspire.vn> */ namespace In2pire\Memcached\Cli; class Application extends \In2pire\Cli\CliApplication { /** * @inheritdoc */ public function boot() { if ($this->booted) { // Already booted. return $this; } // Boot parent. parent::boot(); // Check memcached extension. if (!extension_loaded('memcached')) { $this->response->writeln('<error>Could not found memcached extension<error>'); return false; } return $this; } } ## Instruction: Add more information to application description ## Code After: <?php /** * @file * * @package In2pire * @subpackage MemcachedCli * @author Nhat Tran <nhat.tran@inspire.vn> */ namespace In2pire\Memcached\Cli; class Application extends \In2pire\Cli\CliApplication { /** * @inheritdoc */ public function boot() { if ($this->booted) { // Already booted. return $this; } // Boot parent. parent::boot(); // Check memcached extension. if (!extension_loaded('memcached')) { $this->response->writeln('<error>Could not found memcached extension<error>'); return false; } $description = $this->runner->getDescription(); if (!empty($description)) { $description .= "\n\n"; } $description .= '<comment>igbinary support</comment> ' . (\Memcached::HAVE_IGBINARY ? 'yes' : 'no') . "\n"; $description .= '<comment>json support</comment> ' . (\Memcached::HAVE_JSON ? 'yes' : 'no'); $this->runner->setDescription($description); return $this; } }
<?php /** * @file * * @package In2pire * @subpackage MemcachedCli * @author Nhat Tran <nhat.tran@inspire.vn> */ namespace In2pire\Memcached\Cli; class Application extends \In2pire\Cli\CliApplication { /** * @inheritdoc */ public function boot() { if ($this->booted) { // Already booted. return $this; } // Boot parent. parent::boot(); // Check memcached extension. if (!extension_loaded('memcached')) { $this->response->writeln('<error>Could not found memcached extension<error>'); return false; } + $description = $this->runner->getDescription(); + + if (!empty($description)) { + $description .= "\n\n"; + } + + $description .= '<comment>igbinary support</comment> ' . (\Memcached::HAVE_IGBINARY ? 'yes' : 'no') . "\n"; + $description .= '<comment>json support</comment> ' . (\Memcached::HAVE_JSON ? 'yes' : 'no'); + + $this->runner->setDescription($description); + return $this; } }
11
0.305556
11
0
8e0d365fb96db9b8bfe2845303034366c707cb8a
org.oasis.pdf/cfg/fo/attrs/oasis-cn-pr-domain-attr.xsl
org.oasis.pdf/cfg/fo/attrs/oasis-cn-pr-domain-attr.xsl
<?xml version="1.0"?> <!-- ===================== CHANGE LOG ================================ --> <!-- --> <!-- 25 May 2017 KJE: Initial version. --> <!-- 07 Mar 2019 KJE: Changed font-size to a variable --> <!-- --> <!-- ================================================================= --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:attribute-set name="codeblock" use-attribute-sets="pre"> <xsl:attribute name="font-size"> <xsl:value-of select="$default-codeblock-font-size"/> </xsl:attribute> </xsl:attribute-set> </xsl:stylesheet>
<?xml version="1.0"?> <!-- ===================== CHANGE LOG ================================ --> <!-- --> <!-- 25 May 2017 KJE: Initial version. --> <!-- 07 Mar 2019 KJE: Changed font-size to a variable --> <!-- 15 May 2019 KJE: Added attribute set for codeph --> <!-- --> <!-- ================================================================= --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:attribute-set name="codeblock" use-attribute-sets="pre"> <xsl:attribute name="font-size"> <xsl:value-of select="$default-codeblock-font-size"/> </xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="codeph" use-attribute-sets="monospace-in-titles"/> </xsl:stylesheet>
Correct rendering for codeph in title or dt
Correct rendering for codeph in title or dt
XSLT
apache-2.0
keberlein/dita-stylesheets
xslt
## Code Before: <?xml version="1.0"?> <!-- ===================== CHANGE LOG ================================ --> <!-- --> <!-- 25 May 2017 KJE: Initial version. --> <!-- 07 Mar 2019 KJE: Changed font-size to a variable --> <!-- --> <!-- ================================================================= --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:attribute-set name="codeblock" use-attribute-sets="pre"> <xsl:attribute name="font-size"> <xsl:value-of select="$default-codeblock-font-size"/> </xsl:attribute> </xsl:attribute-set> </xsl:stylesheet> ## Instruction: Correct rendering for codeph in title or dt ## Code After: <?xml version="1.0"?> <!-- ===================== CHANGE LOG ================================ --> <!-- --> <!-- 25 May 2017 KJE: Initial version. --> <!-- 07 Mar 2019 KJE: Changed font-size to a variable --> <!-- 15 May 2019 KJE: Added attribute set for codeph --> <!-- --> <!-- ================================================================= --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:attribute-set name="codeblock" use-attribute-sets="pre"> <xsl:attribute name="font-size"> <xsl:value-of select="$default-codeblock-font-size"/> </xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="codeph" use-attribute-sets="monospace-in-titles"/> </xsl:stylesheet>
<?xml version="1.0"?> <!-- ===================== CHANGE LOG ================================ --> <!-- --> <!-- 25 May 2017 KJE: Initial version. --> <!-- 07 Mar 2019 KJE: Changed font-size to a variable --> + <!-- 15 May 2019 KJE: Added attribute set for codeph --> <!-- --> <!-- ================================================================= --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:attribute-set name="codeblock" use-attribute-sets="pre"> <xsl:attribute name="font-size"> <xsl:value-of select="$default-codeblock-font-size"/> </xsl:attribute> </xsl:attribute-set> + + <xsl:attribute-set name="codeph" use-attribute-sets="monospace-in-titles"/> </xsl:stylesheet>
3
0.157895
3
0
dc046402e1b83d632decbbb4bcbbf016464b55fd
lib/app/exercises.rb
lib/app/exercises.rb
class ExercismApp < Sinatra::Base get '/user/:language/:slug' do |language, slug| if current_user.guest? redirect login_url("/user/#{language}/#{slug}") end redirect "/#{current_user.username}/#{language}/#{slug}" end get '/:username/:language/:slug' do |username, language, slug| if current_user.guest? redirect login_url("/#{username}/#{language}/#{slug}") end exercise = Exercise.new(language, slug) unless current_user.is?(username) || current_user.may_nitpick?(exercise) flash[:error] = "You can't go there yet. Sorry." redirect '/' end user = current_user if current_user.is?(username) user ||= User.where(username: username).first unless user flash[:error] = "We don't know anything about #{username}." redirect '/' end submissions = user.submissions_on(exercise) locals = { exercise: exercise, user: user, before: submissions.last, after: submissions.first, iterations: submissions } erb :summary, locals: locals end end
class ExercismApp < Sinatra::Base get '/user/:language/:slug' do |language, slug| if current_user.guest? redirect login_url("/user/#{language}/#{slug}") end redirect "/#{current_user.username}/#{language}/#{slug}" end get '/:username/:language/:slug' do |username, language, slug| if current_user.guest? redirect login_url("/#{username}/#{language}/#{slug}") end exercise = Exercise.new(language, slug) unless current_user.is?(username) || current_user.may_nitpick?(exercise) flash[:error] = "You can't go there yet. Sorry." redirect '/' end user = current_user if current_user.is?(username) user ||= User.where(username: username).first unless user flash[:error] = "We don't know anything about #{username}." redirect '/' end submissions = user.submissions_on(exercise).reverse locals = { exercise: exercise, user: user, before: submissions.first, after: submissions.last, iterations: submissions } erb :summary, locals: locals end end
Fix iteration order on summary page
Fix iteration order on summary page The iterations were being listed in reverse order ("Iteration 1" being the last submission and "Iteration 7" being the first).
Ruby
agpl-3.0
kangkyu/exercism.io,mhelmetag/exercism.io,nathanbwright/exercism.io,exercistas/exercism.io,alexclarkofficial/exercism.io,Tonkpils/exercism.io,RaptorRCX/exercism.io,RaptorRCX/exercism.io,jtigger/exercism.io,mscoutermarsh/exercism_coveralls,praveenpuglia/exercism.io,chastell/exercism.io,hanumakanthvvn/exercism.io,IanDCarroll/exercism.io,kizerxl/exercism.io,treiff/exercism.io,jtigger/exercism.io,chastell/exercism.io,kizerxl/exercism.io,hanumakanthvvn/exercism.io,k4rtik/exercism.io,RaptorRCX/exercism.io,bmulvihill/exercism.io,kangkyu/exercism.io,hanumakanthvvn/exercism.io,beni55/exercism.io,chinaowl/exercism.io,alexclarkofficial/exercism.io,colinrubbert/exercism.io,emilyforst/exercism.io,beni55/exercism.io,copiousfreetime/exercism.io,bmulvihill/exercism.io,nathanbwright/exercism.io,nathanbwright/exercism.io,Tonkpils/exercism.io,chastell/exercism.io,mscoutermarsh/exercism_coveralls,emilyforst/exercism.io,k4rtik/exercism.io,exercistas/exercism.io,mhelmetag/exercism.io,sheekap/exercism.io,praveenpuglia/exercism.io,MBGeoff/Exercism.io-mbgeoff,tejasbubane/exercism.io,hanumakanthvvn/exercism.io,sheekap/exercism.io,mscoutermarsh/exercism_coveralls,IanDCarroll/exercism.io,Tonkpils/exercism.io,MBGeoff/Exercism.io-mbgeoff,amar47shah/exercism.io,treiff/exercism.io,mscoutermarsh/exercism_coveralls,IanDCarroll/exercism.io,amar47shah/exercism.io,mhelmetag/exercism.io,Tonkpils/exercism.io,chinaowl/exercism.io,mscoutermarsh/exercism_coveralls,MBGeoff/Exercism.io-mbgeoff,IanDCarroll/exercism.io,treiff/exercism.io,sheekap/exercism.io,mscoutermarsh/exercism_coveralls,beni55/exercism.io,emilyforst/exercism.io,copiousfreetime/exercism.io,copiousfreetime/exercism.io,praveenpuglia/exercism.io,mscoutermarsh/exercism_coveralls,kizerxl/exercism.io,nathanbwright/exercism.io,bmulvihill/exercism.io,kangkyu/exercism.io,alexclarkofficial/exercism.io,jtigger/exercism.io,chinaowl/exercism.io,treiff/exercism.io,mscoutermarsh/exercism_coveralls,mhelmetag/exercism.io,sheekap/exercism.io,colinrubbert/exercism.io,mscoutermarsh/exercism_coveralls,colinrubbert/exercism.io,bmulvihill/exercism.io,k4rtik/exercism.io,mscoutermarsh/exercism_coveralls,RaptorRCX/exercism.io,jtigger/exercism.io,amar47shah/exercism.io,tejasbubane/exercism.io,exercistas/exercism.io,tejasbubane/exercism.io,tejasbubane/exercism.io,copiousfreetime/exercism.io,praveenpuglia/exercism.io
ruby
## Code Before: class ExercismApp < Sinatra::Base get '/user/:language/:slug' do |language, slug| if current_user.guest? redirect login_url("/user/#{language}/#{slug}") end redirect "/#{current_user.username}/#{language}/#{slug}" end get '/:username/:language/:slug' do |username, language, slug| if current_user.guest? redirect login_url("/#{username}/#{language}/#{slug}") end exercise = Exercise.new(language, slug) unless current_user.is?(username) || current_user.may_nitpick?(exercise) flash[:error] = "You can't go there yet. Sorry." redirect '/' end user = current_user if current_user.is?(username) user ||= User.where(username: username).first unless user flash[:error] = "We don't know anything about #{username}." redirect '/' end submissions = user.submissions_on(exercise) locals = { exercise: exercise, user: user, before: submissions.last, after: submissions.first, iterations: submissions } erb :summary, locals: locals end end ## Instruction: Fix iteration order on summary page The iterations were being listed in reverse order ("Iteration 1" being the last submission and "Iteration 7" being the first). ## Code After: class ExercismApp < Sinatra::Base get '/user/:language/:slug' do |language, slug| if current_user.guest? redirect login_url("/user/#{language}/#{slug}") end redirect "/#{current_user.username}/#{language}/#{slug}" end get '/:username/:language/:slug' do |username, language, slug| if current_user.guest? redirect login_url("/#{username}/#{language}/#{slug}") end exercise = Exercise.new(language, slug) unless current_user.is?(username) || current_user.may_nitpick?(exercise) flash[:error] = "You can't go there yet. Sorry." redirect '/' end user = current_user if current_user.is?(username) user ||= User.where(username: username).first unless user flash[:error] = "We don't know anything about #{username}." redirect '/' end submissions = user.submissions_on(exercise).reverse locals = { exercise: exercise, user: user, before: submissions.first, after: submissions.last, iterations: submissions } erb :summary, locals: locals end end
class ExercismApp < Sinatra::Base get '/user/:language/:slug' do |language, slug| if current_user.guest? redirect login_url("/user/#{language}/#{slug}") end redirect "/#{current_user.username}/#{language}/#{slug}" end get '/:username/:language/:slug' do |username, language, slug| if current_user.guest? redirect login_url("/#{username}/#{language}/#{slug}") end exercise = Exercise.new(language, slug) unless current_user.is?(username) || current_user.may_nitpick?(exercise) flash[:error] = "You can't go there yet. Sorry." redirect '/' end user = current_user if current_user.is?(username) user ||= User.where(username: username).first unless user flash[:error] = "We don't know anything about #{username}." redirect '/' end - submissions = user.submissions_on(exercise) + submissions = user.submissions_on(exercise).reverse ? ++++++++ locals = { exercise: exercise, user: user, - before: submissions.last, ? ^^ + before: submissions.first, ? ^^^ - after: submissions.first, ? ^^^ + after: submissions.last, ? ^^ iterations: submissions } erb :summary, locals: locals end end
6
0.142857
3
3
0136ec48c987e813c747977fe92f0331293b7df7
config.clj
config.clj
{:wrap-reload false :db-host "localhost" :db-user nil :db-pwd nil :host "smtp.googlemail.com" :user "team@4clojure.com" :problem-submission false :advanced-user-count 50 :pass ""}
{:wrap-reload false :db-host "localhost" :db-user nil :db-pwd nil :host "smtp.googlemail.com" :user "team@4clojure.com" :problem-submission false :advanced-user-count 50 :pass "" :golfing-active true}
Enable golf leagues for everyone
Enable golf leagues for everyone
Clojure
epl-1.0
amcnamara/4clojure,amcnamara/4clojure,gfredericks/4clojure,grnhse/4clojure,tclamb/4clojure,grnhse/4clojure,4clojure/4clojure,gfredericks/4clojure,rowhit/4clojure,devn/4clojure,rowhit/4clojure,tclamb/4clojure,4clojure/4clojure,devn/4clojure
clojure
## Code Before: {:wrap-reload false :db-host "localhost" :db-user nil :db-pwd nil :host "smtp.googlemail.com" :user "team@4clojure.com" :problem-submission false :advanced-user-count 50 :pass ""} ## Instruction: Enable golf leagues for everyone ## Code After: {:wrap-reload false :db-host "localhost" :db-user nil :db-pwd nil :host "smtp.googlemail.com" :user "team@4clojure.com" :problem-submission false :advanced-user-count 50 :pass "" :golfing-active true}
{:wrap-reload false :db-host "localhost" :db-user nil :db-pwd nil :host "smtp.googlemail.com" :user "team@4clojure.com" :problem-submission false :advanced-user-count 50 - :pass ""} ? - + :pass "" + :golfing-active true}
3
0.333333
2
1
5232091bbc3b617f737db18bbd3bad97914f73fd
src/BrainTree.h
src/BrainTree.h
// CompositeS #include "Composites/MemSelector.hpp" #include "Composites/MemSequence.hpp" #include "Composites/ParallelSequence.hpp" #include "Composites/Selector.hpp" #include "Composites/Sequence.hpp" // Decorators #include "Decorators/Failer.hpp" #include "Decorators/Inverter.hpp" #include "Decorators/Repeater.hpp" #include "Decorators/Succeeder.hpp" #include "Decorators/UntilFail.hpp" #include "Decorators/UntilSuccess.hpp"
// Composites #include "composites/MemSelector.h" #include "composites/MemSequence.h" #include "composites/ParallelSequence.h" #include "composites/Selector.h" #include "composites/Sequence.h" // Decorators #include "decorators/Failer.h" #include "decorators/Inverter.h" #include "decorators/Repeater.h" #include "decorators/Succeeder.h" #include "decorators/UntilFail.h" #include "decorators/UntilSuccess.h" // Builders #include "builders/LeafBuilder.h"
Change headers from *.hpp to *.h, and add LeafBuilder.
Change headers from *.hpp to *.h, and add LeafBuilder.
C
mit
arvidsson/bt
c
## Code Before: // CompositeS #include "Composites/MemSelector.hpp" #include "Composites/MemSequence.hpp" #include "Composites/ParallelSequence.hpp" #include "Composites/Selector.hpp" #include "Composites/Sequence.hpp" // Decorators #include "Decorators/Failer.hpp" #include "Decorators/Inverter.hpp" #include "Decorators/Repeater.hpp" #include "Decorators/Succeeder.hpp" #include "Decorators/UntilFail.hpp" #include "Decorators/UntilSuccess.hpp" ## Instruction: Change headers from *.hpp to *.h, and add LeafBuilder. ## Code After: // Composites #include "composites/MemSelector.h" #include "composites/MemSequence.h" #include "composites/ParallelSequence.h" #include "composites/Selector.h" #include "composites/Sequence.h" // Decorators #include "decorators/Failer.h" #include "decorators/Inverter.h" #include "decorators/Repeater.h" #include "decorators/Succeeder.h" #include "decorators/UntilFail.h" #include "decorators/UntilSuccess.h" // Builders #include "builders/LeafBuilder.h"
- // CompositeS ? ^ + // Composites ? ^ - #include "Composites/MemSelector.hpp" ? ^ -- + #include "composites/MemSelector.h" ? ^ - #include "Composites/MemSequence.hpp" ? ^ -- + #include "composites/MemSequence.h" ? ^ - #include "Composites/ParallelSequence.hpp" ? ^ -- + #include "composites/ParallelSequence.h" ? ^ - #include "Composites/Selector.hpp" ? ^ -- + #include "composites/Selector.h" ? ^ - #include "Composites/Sequence.hpp" ? ^ -- + #include "composites/Sequence.h" ? ^ // Decorators - #include "Decorators/Failer.hpp" ? ^ -- + #include "decorators/Failer.h" ? ^ - #include "Decorators/Inverter.hpp" ? ^ -- + #include "decorators/Inverter.h" ? ^ - #include "Decorators/Repeater.hpp" ? ^ -- + #include "decorators/Repeater.h" ? ^ - #include "Decorators/Succeeder.hpp" ? ^ -- + #include "decorators/Succeeder.h" ? ^ - #include "Decorators/UntilFail.hpp" ? ^ -- + #include "decorators/UntilFail.h" ? ^ - #include "Decorators/UntilSuccess.hpp" ? ^ -- + #include "decorators/UntilSuccess.h" ? ^ + + // Builders + #include "builders/LeafBuilder.h"
27
1.8
15
12
d61eb53db9b86c9762a894e4f2a41f7ae8cc4384
README.md
README.md
Quickly display a list of files in your solution for opening. Supports searching by filename or path. Functions just like `Shift`+`Alt`+`O` in Visual Assist. ![Quick Open File](openfileinsolution.png?raw=true "Quick Open File") This extension will parse the projects in your solution and look for files. Once it has built a list of these files, it allows you to search through them for the file you want to open and open it quickly. It supports searching for pieces of the filename in any order and can easily highlight multiple files with just the keyboard to open all at once. ## Usage - Use the "Open File In Solution" entry at the top of the Tools menu. - Set a key binding for Tools.OpenFileInSolution ## Installation [Download](https://marketplace.visualstudio.com/items?itemName=PerniciousGames.OpenFileInSolution) this extension from the Visual Studio Marketplace. ## Future improvements: - Need to cache the list of files in the solution so it doesn't have to re-parse them every time. This means updating the cached list when new files/projects are added or loaded. - More options for controlling how files are listed and searched, such as the ability to only search through open files.
Quickly display a list of files in your solution for opening. Supports searching by filename or path. Functions just like `Shift`+`Alt`+`O` in Visual Assist. ![Quick Open File](SharedContent/openfileinsolution.png?raw=true "Quick Open File") This extension will parse the projects in your solution and look for files. Once it has built a list of these files, it allows you to search through them for the file you want to open and open it quickly. It supports searching for pieces of the filename in any order and can easily highlight multiple files with just the keyboard to open all at once. ## Usage - Use the "Open File In Solution" entry at the top of the Tools menu. - Set a key binding for Tools.OpenFileInSolution ## Installation [Download](https://marketplace.visualstudio.com/items?itemName=PerniciousGames.OpenFileInSolution) this extension from the Visual Studio Marketplace. ## Future improvements: - Need to cache the list of files in the solution so it doesn't have to re-parse them every time. This means updating the cached list when new files/projects are added or loaded. - More options for controlling how files are listed and searched, such as the ability to only search through open files.
Update readme with new image location
Update readme with new image location
Markdown
mit
parnic/VSQuickOpenFile
markdown
## Code Before: Quickly display a list of files in your solution for opening. Supports searching by filename or path. Functions just like `Shift`+`Alt`+`O` in Visual Assist. ![Quick Open File](openfileinsolution.png?raw=true "Quick Open File") This extension will parse the projects in your solution and look for files. Once it has built a list of these files, it allows you to search through them for the file you want to open and open it quickly. It supports searching for pieces of the filename in any order and can easily highlight multiple files with just the keyboard to open all at once. ## Usage - Use the "Open File In Solution" entry at the top of the Tools menu. - Set a key binding for Tools.OpenFileInSolution ## Installation [Download](https://marketplace.visualstudio.com/items?itemName=PerniciousGames.OpenFileInSolution) this extension from the Visual Studio Marketplace. ## Future improvements: - Need to cache the list of files in the solution so it doesn't have to re-parse them every time. This means updating the cached list when new files/projects are added or loaded. - More options for controlling how files are listed and searched, such as the ability to only search through open files. ## Instruction: Update readme with new image location ## Code After: Quickly display a list of files in your solution for opening. Supports searching by filename or path. Functions just like `Shift`+`Alt`+`O` in Visual Assist. ![Quick Open File](SharedContent/openfileinsolution.png?raw=true "Quick Open File") This extension will parse the projects in your solution and look for files. Once it has built a list of these files, it allows you to search through them for the file you want to open and open it quickly. It supports searching for pieces of the filename in any order and can easily highlight multiple files with just the keyboard to open all at once. ## Usage - Use the "Open File In Solution" entry at the top of the Tools menu. - Set a key binding for Tools.OpenFileInSolution ## Installation [Download](https://marketplace.visualstudio.com/items?itemName=PerniciousGames.OpenFileInSolution) this extension from the Visual Studio Marketplace. ## Future improvements: - Need to cache the list of files in the solution so it doesn't have to re-parse them every time. This means updating the cached list when new files/projects are added or loaded. - More options for controlling how files are listed and searched, such as the ability to only search through open files.
Quickly display a list of files in your solution for opening. Supports searching by filename or path. Functions just like `Shift`+`Alt`+`O` in Visual Assist. - ![Quick Open File](openfileinsolution.png?raw=true "Quick Open File") + ![Quick Open File](SharedContent/openfileinsolution.png?raw=true "Quick Open File") ? ++++++++++++++ This extension will parse the projects in your solution and look for files. Once it has built a list of these files, it allows you to search through them for the file you want to open and open it quickly. It supports searching for pieces of the filename in any order and can easily highlight multiple files with just the keyboard to open all at once. ## Usage - Use the "Open File In Solution" entry at the top of the Tools menu. - Set a key binding for Tools.OpenFileInSolution ## Installation [Download](https://marketplace.visualstudio.com/items?itemName=PerniciousGames.OpenFileInSolution) this extension from the Visual Studio Marketplace. ## Future improvements: - Need to cache the list of files in the solution so it doesn't have to re-parse them every time. This means updating the cached list when new files/projects are added or loaded. - More options for controlling how files are listed and searched, such as the ability to only search through open files.
2
0.111111
1
1
f23ff7fc541991ceb63b73ddbf67dc3d04a2cb38
packages/components/components/modalTwo/useModalState.ts
packages/components/components/modalTwo/useModalState.ts
import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const handleClose = () => { setOpen(false); onClose?.(); }; const handleExit = () => { setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, setOpen] as const; }; export default useModalState;
import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const [render, setRender] = useState(open); const handleSetOpen = (newValue: boolean) => { if (newValue) { setOpen(true); setRender(true); } else { setOpen(false); } }; const handleClose = () => { handleSetOpen(false); onClose?.(); }; const handleExit = () => { setRender(false); setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, handleSetOpen, render] as const; }; export default useModalState;
Add mechanism to conditionally render modal
Add mechanism to conditionally render modal
TypeScript
mit
ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient
typescript
## Code Before: import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const handleClose = () => { setOpen(false); onClose?.(); }; const handleExit = () => { setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, setOpen] as const; }; export default useModalState; ## Instruction: Add mechanism to conditionally render modal ## Code After: import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const [render, setRender] = useState(open); const handleSetOpen = (newValue: boolean) => { if (newValue) { setOpen(true); setRender(true); } else { setOpen(false); } }; const handleClose = () => { handleSetOpen(false); onClose?.(); }; const handleExit = () => { setRender(false); setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, handleSetOpen, render] as const; }; export default useModalState;
import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); + const [open, setOpen] = useControlled(controlledOpen); + const [render, setRender] = useState(open); - const [open, setOpen] = useControlled(controlledOpen); + const handleSetOpen = (newValue: boolean) => { + if (newValue) { + setOpen(true); + setRender(true); + } else { + setOpen(false); + } + }; const handleClose = () => { - setOpen(false); ? ^ + handleSetOpen(false); ? ^^^^^^^ onClose?.(); }; const handleExit = () => { + setRender(false); setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; - return [modalProps, setOpen] as const; ? ^ + return [modalProps, handleSetOpen, render] as const; ? ^^^^^^^ ++++++++ }; export default useModalState;
16
0.484848
13
3
30398bd6d9918938057d646f46d741ce8631c7a1
client/index.html
client/index.html
<html> <head> <title>Tinsel</title> <script src="bower_components/codemirror/lib/codemirror.js"></script> <link rel="stylesheet" href="bower_components/codemirror/lib/codemirror.css"> <link rel="stylesheet" href="bower_components/codemirror/theme/solarized.css"> <script src="bower_components/codemirror/mode/javascript/javascript.js"></script> </head> <body> Write the code, change the world! <script> var myCodeMirror = CodeMirror(document.body, { theme: "solarized" }); console.log(document.body, myCodeMirror); </script> </body> </html>
<html> <head> <title>Tinsel</title> <script src="bower_components/jquery/dist/jquery.min.js"></script> <script src="bower_components/uri.js/src/URI.min.js"></script> <script src="bower_components/codemirror/lib/codemirror.js"></script> <link rel="stylesheet" href="bower_components/codemirror/lib/codemirror.css"> <link rel="stylesheet" href="bower_components/codemirror/theme/solarized.css"> <script src="bower_components/codemirror/mode/javascript/javascript.js"></script> <style> textarea, .CodeMirror { height: 95%; } </style> </head> <body> Write the code, change the world! <script> window.codeMirror = CodeMirror(document.body, { theme: "solarized" }); var query = URI(window.location).query(true) $.get("/lazerwalker/" + query.story + "/raw.js") .done(function(json) { console.log(json); codeMirror.getDoc().setValue(json); }) </script> </body> </html>
Load data into client based on query param
Load data into client based on query param
HTML
mit
lazerwalker/tinsel,lazerwalker/tinsel
html
## Code Before: <html> <head> <title>Tinsel</title> <script src="bower_components/codemirror/lib/codemirror.js"></script> <link rel="stylesheet" href="bower_components/codemirror/lib/codemirror.css"> <link rel="stylesheet" href="bower_components/codemirror/theme/solarized.css"> <script src="bower_components/codemirror/mode/javascript/javascript.js"></script> </head> <body> Write the code, change the world! <script> var myCodeMirror = CodeMirror(document.body, { theme: "solarized" }); console.log(document.body, myCodeMirror); </script> </body> </html> ## Instruction: Load data into client based on query param ## Code After: <html> <head> <title>Tinsel</title> <script src="bower_components/jquery/dist/jquery.min.js"></script> <script src="bower_components/uri.js/src/URI.min.js"></script> <script src="bower_components/codemirror/lib/codemirror.js"></script> <link rel="stylesheet" href="bower_components/codemirror/lib/codemirror.css"> <link rel="stylesheet" href="bower_components/codemirror/theme/solarized.css"> <script src="bower_components/codemirror/mode/javascript/javascript.js"></script> <style> textarea, .CodeMirror { height: 95%; } </style> </head> <body> Write the code, change the world! <script> window.codeMirror = CodeMirror(document.body, { theme: "solarized" }); var query = URI(window.location).query(true) $.get("/lazerwalker/" + query.story + "/raw.js") .done(function(json) { console.log(json); codeMirror.getDoc().setValue(json); }) </script> </body> </html>
<html> <head> <title>Tinsel</title> + <script src="bower_components/jquery/dist/jquery.min.js"></script> + <script src="bower_components/uri.js/src/URI.min.js"></script> <script src="bower_components/codemirror/lib/codemirror.js"></script> <link rel="stylesheet" href="bower_components/codemirror/lib/codemirror.css"> <link rel="stylesheet" href="bower_components/codemirror/theme/solarized.css"> <script src="bower_components/codemirror/mode/javascript/javascript.js"></script> + + <style> + textarea, .CodeMirror { + height: 95%; + } + </style> </head> <body> Write the code, change the world! <script> - var myCodeMirror = CodeMirror(document.body, { ? ^^^^^^^ + window.codeMirror = CodeMirror(document.body, { ? ^^^^^^^^ theme: "solarized" }); - console.log(document.body, myCodeMirror); + + var query = URI(window.location).query(true) + $.get("/lazerwalker/" + query.story + "/raw.js") + .done(function(json) { + console.log(json); + codeMirror.getDoc().setValue(json); + }) </script> </body> </html>
18
0.947368
16
2
bb273759bbb9f9edb716fa6596477fa019057fec
index.js
index.js
/* jshint node: true */ 'use strict'; var fs = require('fs'); module.exports = { name: 'uncharted-describe-models', config: function(env, config) { if (env === 'test') { return; } if (!fs.existsSync('app/schema.json')) { throw new Error('You must include a schema.json in the root of app/'); } var schema = JSON.parse(fs.readFileSync('app/schema.json', 'utf8')); config['model-schema'] = schema; return config; }, includedCommands: function() { return { 'update-models': require('./lib/commands/update-models') }; } };
/* jshint node: true */ 'use strict'; var fs = require('fs'); module.exports = { name: 'uncharted-describe-models', config: function(env, config) { if (!fs.existsSync('app/schema.json')) { throw new Error('You must include a schema.json in the root of app/'); } var schema = JSON.parse(fs.readFileSync('app/schema.json', 'utf8')); config['model-schema'] = schema; return config; }, includedCommands: function() { return { 'update-models': require('./lib/commands/update-models') }; } };
Make sure we always load the schema, even within a test
Make sure we always load the schema, even within a test
JavaScript
mit
unchartedcode/describe-models,unchartedcode/describe-models
javascript
## Code Before: /* jshint node: true */ 'use strict'; var fs = require('fs'); module.exports = { name: 'uncharted-describe-models', config: function(env, config) { if (env === 'test') { return; } if (!fs.existsSync('app/schema.json')) { throw new Error('You must include a schema.json in the root of app/'); } var schema = JSON.parse(fs.readFileSync('app/schema.json', 'utf8')); config['model-schema'] = schema; return config; }, includedCommands: function() { return { 'update-models': require('./lib/commands/update-models') }; } }; ## Instruction: Make sure we always load the schema, even within a test ## Code After: /* jshint node: true */ 'use strict'; var fs = require('fs'); module.exports = { name: 'uncharted-describe-models', config: function(env, config) { if (!fs.existsSync('app/schema.json')) { throw new Error('You must include a schema.json in the root of app/'); } var schema = JSON.parse(fs.readFileSync('app/schema.json', 'utf8')); config['model-schema'] = schema; return config; }, includedCommands: function() { return { 'update-models': require('./lib/commands/update-models') }; } };
/* jshint node: true */ 'use strict'; var fs = require('fs'); module.exports = { name: 'uncharted-describe-models', config: function(env, config) { - if (env === 'test') { - return; - } - if (!fs.existsSync('app/schema.json')) { throw new Error('You must include a schema.json in the root of app/'); } var schema = JSON.parse(fs.readFileSync('app/schema.json', 'utf8')); config['model-schema'] = schema; return config; }, includedCommands: function() { return { 'update-models': require('./lib/commands/update-models') }; } };
4
0.142857
0
4
db804b5dcece367cb4abd4b9cade13483efb8184
.zsh/40_completion.zsh
.zsh/40_completion.zsh
autoload -Uz compinit compinit -u # Set LS_COLORS variable if [[ -z "${LS_COLORS}" ]]; then if type dircolors &>/dev/null; then eval "$(dircolors)" elif type gdircolors &>/dev/null; then eval "$(gdircolors)" fi fi zstyle ':completion:*:default' menu select=1 if [[ -n "${LS_COLORS}" ]]; then zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} fi zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' zstyle ':completion:*' menu select=long zstyle ':completion:*' use-cache true
if ! (type compinit &>/dev/null) ; then autoload -Uz compinit compinit -u fi # Set LS_COLORS variable if [[ -z "${LS_COLORS}" ]]; then if type dircolors &>/dev/null; then eval "$(dircolors)" elif type gdircolors &>/dev/null; then eval "$(gdircolors)" fi fi zstyle ':completion:*:default' menu select=1 if [[ -n "${LS_COLORS}" ]]; then zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} fi zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' zstyle ':completion:*' menu select=long zstyle ':completion:*' use-cache true
Decrease compinit call if called already in zplug
Decrease compinit call if called already in zplug
Shell
mit
pinelibg/dotfiles
shell
## Code Before: autoload -Uz compinit compinit -u # Set LS_COLORS variable if [[ -z "${LS_COLORS}" ]]; then if type dircolors &>/dev/null; then eval "$(dircolors)" elif type gdircolors &>/dev/null; then eval "$(gdircolors)" fi fi zstyle ':completion:*:default' menu select=1 if [[ -n "${LS_COLORS}" ]]; then zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} fi zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' zstyle ':completion:*' menu select=long zstyle ':completion:*' use-cache true ## Instruction: Decrease compinit call if called already in zplug ## Code After: if ! (type compinit &>/dev/null) ; then autoload -Uz compinit compinit -u fi # Set LS_COLORS variable if [[ -z "${LS_COLORS}" ]]; then if type dircolors &>/dev/null; then eval "$(dircolors)" elif type gdircolors &>/dev/null; then eval "$(gdircolors)" fi fi zstyle ':completion:*:default' menu select=1 if [[ -n "${LS_COLORS}" ]]; then zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} fi zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' zstyle ':completion:*' menu select=long zstyle ':completion:*' use-cache true
+ if ! (type compinit &>/dev/null) ; then - autoload -Uz compinit + autoload -Uz compinit ? + - compinit -u + compinit -u ? + + fi # Set LS_COLORS variable if [[ -z "${LS_COLORS}" ]]; then if type dircolors &>/dev/null; then eval "$(dircolors)" elif type gdircolors &>/dev/null; then eval "$(gdircolors)" fi fi zstyle ':completion:*:default' menu select=1 if [[ -n "${LS_COLORS}" ]]; then zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} fi zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' zstyle ':completion:*' menu select=long zstyle ':completion:*' use-cache true
6
0.272727
4
2
1666883e2ec43251bb71eecc2c127b899c661e0a
src/path.rs
src/path.rs
use std::fmt::{self, Display}; /// Path to the current value in the input, like `dependencies.serde.typo1`. #[derive(Copy, Clone)] pub enum Path<'a> { Root, Seq { parent: &'a Path<'a>, index: usize }, Map { parent: &'a Path<'a>, key: &'a str }, Some { parent: &'a Path<'a> }, NewtypeStruct { parent: &'a Path<'a> }, NewtypeVariant { parent: &'a Path<'a> }, Alias { parent: &'a Path<'a> }, Unknown { parent: &'a Path<'a> }, } impl<'a> Display for Path<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { struct Parent<'a>(&'a Path<'a>); impl<'a> Display for Parent<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self.0 { Path::Root => Ok(()), ref path => write!(formatter, "{}.", path), } } } match *self { Path::Root => formatter.write_str("."), Path::Seq { parent, index } => write!(formatter, "{}[{}]", parent, index), Path::Map { parent, key } => write!(formatter, "{}{}", Parent(parent), key), Path::Some { parent } | Path::NewtypeStruct { parent } | Path::Alias { parent } => { write!(formatter, "{}", parent) } Path::NewtypeVariant { parent } | Path::Unknown { parent } => { write!(formatter, "{}?", Parent(parent)) } } } }
use std::fmt::{self, Display}; /// Path to the current value in the input, like `dependencies.serde.typo1`. #[derive(Copy, Clone)] pub enum Path<'a> { Root, Seq { parent: &'a Path<'a>, index: usize }, Map { parent: &'a Path<'a>, key: &'a str }, Alias { parent: &'a Path<'a> }, Unknown { parent: &'a Path<'a> }, } impl<'a> Display for Path<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { struct Parent<'a>(&'a Path<'a>); impl<'a> Display for Parent<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self.0 { Path::Root => Ok(()), ref path => write!(formatter, "{}.", path), } } } match *self { Path::Root => formatter.write_str("."), Path::Seq { parent, index } => write!(formatter, "{}[{}]", parent, index), Path::Map { parent, key } => write!(formatter, "{}{}", Parent(parent), key), Path::Alias { parent } => { write!(formatter, "{}", parent) } Path::Unknown { parent } => { write!(formatter, "{}?", Parent(parent)) } } } }
Remove Path variants that were never constructed
Remove Path variants that were never constructed
Rust
apache-2.0
dtolnay/serde-yaml
rust
## Code Before: use std::fmt::{self, Display}; /// Path to the current value in the input, like `dependencies.serde.typo1`. #[derive(Copy, Clone)] pub enum Path<'a> { Root, Seq { parent: &'a Path<'a>, index: usize }, Map { parent: &'a Path<'a>, key: &'a str }, Some { parent: &'a Path<'a> }, NewtypeStruct { parent: &'a Path<'a> }, NewtypeVariant { parent: &'a Path<'a> }, Alias { parent: &'a Path<'a> }, Unknown { parent: &'a Path<'a> }, } impl<'a> Display for Path<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { struct Parent<'a>(&'a Path<'a>); impl<'a> Display for Parent<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self.0 { Path::Root => Ok(()), ref path => write!(formatter, "{}.", path), } } } match *self { Path::Root => formatter.write_str("."), Path::Seq { parent, index } => write!(formatter, "{}[{}]", parent, index), Path::Map { parent, key } => write!(formatter, "{}{}", Parent(parent), key), Path::Some { parent } | Path::NewtypeStruct { parent } | Path::Alias { parent } => { write!(formatter, "{}", parent) } Path::NewtypeVariant { parent } | Path::Unknown { parent } => { write!(formatter, "{}?", Parent(parent)) } } } } ## Instruction: Remove Path variants that were never constructed ## Code After: use std::fmt::{self, Display}; /// Path to the current value in the input, like `dependencies.serde.typo1`. #[derive(Copy, Clone)] pub enum Path<'a> { Root, Seq { parent: &'a Path<'a>, index: usize }, Map { parent: &'a Path<'a>, key: &'a str }, Alias { parent: &'a Path<'a> }, Unknown { parent: &'a Path<'a> }, } impl<'a> Display for Path<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { struct Parent<'a>(&'a Path<'a>); impl<'a> Display for Parent<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self.0 { Path::Root => Ok(()), ref path => write!(formatter, "{}.", path), } } } match *self { Path::Root => formatter.write_str("."), Path::Seq { parent, index } => write!(formatter, "{}[{}]", parent, index), Path::Map { parent, key } => write!(formatter, "{}{}", Parent(parent), key), Path::Alias { parent } => { write!(formatter, "{}", parent) } Path::Unknown { parent } => { write!(formatter, "{}?", Parent(parent)) } } } }
use std::fmt::{self, Display}; /// Path to the current value in the input, like `dependencies.serde.typo1`. #[derive(Copy, Clone)] pub enum Path<'a> { Root, Seq { parent: &'a Path<'a>, index: usize }, Map { parent: &'a Path<'a>, key: &'a str }, - Some { parent: &'a Path<'a> }, - NewtypeStruct { parent: &'a Path<'a> }, - NewtypeVariant { parent: &'a Path<'a> }, Alias { parent: &'a Path<'a> }, Unknown { parent: &'a Path<'a> }, } impl<'a> Display for Path<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { struct Parent<'a>(&'a Path<'a>); impl<'a> Display for Parent<'a> { fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self.0 { Path::Root => Ok(()), ref path => write!(formatter, "{}.", path), } } } match *self { Path::Root => formatter.write_str("."), Path::Seq { parent, index } => write!(formatter, "{}[{}]", parent, index), Path::Map { parent, key } => write!(formatter, "{}{}", Parent(parent), key), - Path::Some { parent } | Path::NewtypeStruct { parent } | Path::Alias { parent } => { + Path::Alias { parent } => { write!(formatter, "{}", parent) } - Path::NewtypeVariant { parent } | Path::Unknown { parent } => { + Path::Unknown { parent } => { write!(formatter, "{}?", Parent(parent)) } } } }
7
0.170732
2
5
85d1b882b5967977e7aa7518f35283527f4b366b
.eslintrc.yml
.eslintrc.yml
extends: - modular/best-practices - modular/style - modular/es6 - modular/node
root: true extends: - modular/best-practices - modular/style - modular/es6 - modular/node
Mark the ESLint config as the root one for the project
Mark the ESLint config as the root one for the project
YAML
mit
BigstickCarpet/sourcemapify
yaml
## Code Before: extends: - modular/best-practices - modular/style - modular/es6 - modular/node ## Instruction: Mark the ESLint config as the root one for the project ## Code After: root: true extends: - modular/best-practices - modular/style - modular/es6 - modular/node
+ + root: true extends: - modular/best-practices - modular/style - modular/es6 - modular/node
2
0.333333
2
0
3cae325ad53e2d56f20717bcd57ae1c1861f3f5a
tox.ini
tox.ini
[tox] envlist = py27, docs skipsdist = True [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/workbench deps = # git+https://github.com/newbrough/coverage.git git+https://github.com/nedbat/coveragepy.git # coverage pytest pytest-cov pyjack install = pip install -e . commands = py.test test/test_server_spinup.py workbench/workers workbench/clients coverage combine [pytest] addopts= -v --doctest-modules --cov=workbench --cov-report term-missing python_files=*.py python_functions=test norecursedirs=.tox .git timeout_corner [testenv:docs] changedir=docs/ deps = pytest sphinx mozilla_sphinx_theme install = pip install -e . commands = sphinx-apidoc -o . ../workbench # sphinx-build -b linkcheck ./ _build/html sphinx-build -b html ./ _build/html
[tox] envlist = py27, docs [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/workbench deps = # git+https://github.com/newbrough/coverage.git git+https://github.com/nedbat/coveragepy.git # coverage pytest pytest-cov pyjack install = pip install -e . commands = py.test test/test_server_spinup.py workbench/workers workbench/clients coverage combine [pytest] addopts= -v --doctest-modules --cov=workbench --cov-report term-missing python_files=*.py python_functions=test norecursedirs=.tox .git timeout_corner [testenv:docs] changedir=docs/ deps = pytest sphinx mozilla_sphinx_theme install = pip install -e . commands = sphinx-apidoc -o . ../workbench # sphinx-build -b linkcheck ./ _build/html sphinx-build -b html ./ _build/html
Revert "setting skipsdist = True"
Revert "setting skipsdist = True" This reverts commit c36daea1f29e08c6448ac595b23ace58d8873c21.
INI
mit
SuperCowPowers/workbench,djtotten/workbench,djtotten/workbench,SuperCowPowers/workbench,SuperCowPowers/workbench,djtotten/workbench
ini
## Code Before: [tox] envlist = py27, docs skipsdist = True [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/workbench deps = # git+https://github.com/newbrough/coverage.git git+https://github.com/nedbat/coveragepy.git # coverage pytest pytest-cov pyjack install = pip install -e . commands = py.test test/test_server_spinup.py workbench/workers workbench/clients coverage combine [pytest] addopts= -v --doctest-modules --cov=workbench --cov-report term-missing python_files=*.py python_functions=test norecursedirs=.tox .git timeout_corner [testenv:docs] changedir=docs/ deps = pytest sphinx mozilla_sphinx_theme install = pip install -e . commands = sphinx-apidoc -o . ../workbench # sphinx-build -b linkcheck ./ _build/html sphinx-build -b html ./ _build/html ## Instruction: Revert "setting skipsdist = True" This reverts commit c36daea1f29e08c6448ac595b23ace58d8873c21. ## Code After: [tox] envlist = py27, docs [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/workbench deps = # git+https://github.com/newbrough/coverage.git git+https://github.com/nedbat/coveragepy.git # coverage pytest pytest-cov pyjack install = pip install -e . commands = py.test test/test_server_spinup.py workbench/workers workbench/clients coverage combine [pytest] addopts= -v --doctest-modules --cov=workbench --cov-report term-missing python_files=*.py python_functions=test norecursedirs=.tox .git timeout_corner [testenv:docs] changedir=docs/ deps = pytest sphinx mozilla_sphinx_theme install = pip install -e . commands = sphinx-apidoc -o . ../workbench # sphinx-build -b linkcheck ./ _build/html sphinx-build -b html ./ _build/html
[tox] envlist = py27, docs - skipsdist = True [testenv] setenv = PYTHONPATH = {toxinidir}:{toxinidir}/workbench deps = # git+https://github.com/newbrough/coverage.git git+https://github.com/nedbat/coveragepy.git # coverage pytest pytest-cov pyjack install = pip install -e . commands = py.test test/test_server_spinup.py workbench/workers workbench/clients coverage combine [pytest] addopts= -v --doctest-modules --cov=workbench --cov-report term-missing python_files=*.py python_functions=test norecursedirs=.tox .git timeout_corner [testenv:docs] changedir=docs/ deps = pytest sphinx mozilla_sphinx_theme install = pip install -e . commands = sphinx-apidoc -o . ../workbench # sphinx-build -b linkcheck ./ _build/html sphinx-build -b html ./ _build/html
1
0.026316
0
1
85fd3bc6872a71a1cd16f66cd72ca87c97437e60
documentation/docs/content/DockerImages/dockerfiles/include/image-tag-php.rst
documentation/docs/content/DockerImages/dockerfiles/include/image-tag-php.rst
====================== ========================== =============== Tag Distribution name PHP Version ====================== ========================== =============== ``alpine`` *link to alpine-php7* PHP 7.x ``alpine-php7`` PHP 7.x ``alpine-php5`` PHP 5.6 ``alpine-3`` *deprecated* PHP 5.6 ``alpine-3-php7`` *deprecated* PHP 7.x ``ubuntu-12.04`` precise PHP 5.3 ``ubuntu-14.04`` trusty (LTS) PHP 5.5 ``ubuntu-15.04`` vivid PHP 5.6 ``ubuntu-15.10`` wily PHP 5.6 ``ubuntu-16.04`` xenial (LTS) PHP 7.0 ``debian-7`` wheezy PHP 5.4 ``debian-8`` jessie PHP 5.6 ``debian-8-php7`` jessie with dotdeb PHP 7.x (via sury) ``debian-9`` stretch PHP 7.0 ``centos-7`` PHP 5.4 ``centos-7-php56`` PHP 5.6 ====================== ========================== ===============
====================== =================================== =============== Tag Distribution name PHP Version ====================== =================================== =============== ``5.6`` *customized official php image* PHP 5.6 ``7.0`` *customized official php image* PHP 7.0 ``7.1`` *customized official php image* PHP 7.1 ``alpine`` *link to alpine-php7* PHP 7.x ``alpine-php7`` PHP 7.x ``alpine-php5`` PHP 5.6 ``alpine-3`` *deprecated* PHP 5.6 ``alpine-3-php7`` *deprecated* PHP 7.x ``ubuntu-12.04`` precise PHP 5.3 ``ubuntu-14.04`` trusty (LTS) PHP 5.5 ``ubuntu-15.04`` vivid PHP 5.6 ``ubuntu-15.10`` wily PHP 5.6 ``ubuntu-16.04`` xenial (LTS) PHP 7.0 ``debian-7`` wheezy PHP 5.4 ``debian-8`` jessie PHP 5.6 ``debian-8-php7`` jessie with dotdeb PHP 7.x (via sury) ``debian-9`` stretch PHP 7.0 ``centos-7`` PHP 5.4 ``centos-7-php56`` PHP 5.6 ====================== =================================== ===============
Add official php images to tag list
Add official php images to tag list
reStructuredText
mit
webdevops/Dockerfile,webdevops/Dockerfile,webdevops/Dockerfile,webdevops/Dockerfile,webdevops/Dockerfile,webdevops/Dockerfile
restructuredtext
## Code Before: ====================== ========================== =============== Tag Distribution name PHP Version ====================== ========================== =============== ``alpine`` *link to alpine-php7* PHP 7.x ``alpine-php7`` PHP 7.x ``alpine-php5`` PHP 5.6 ``alpine-3`` *deprecated* PHP 5.6 ``alpine-3-php7`` *deprecated* PHP 7.x ``ubuntu-12.04`` precise PHP 5.3 ``ubuntu-14.04`` trusty (LTS) PHP 5.5 ``ubuntu-15.04`` vivid PHP 5.6 ``ubuntu-15.10`` wily PHP 5.6 ``ubuntu-16.04`` xenial (LTS) PHP 7.0 ``debian-7`` wheezy PHP 5.4 ``debian-8`` jessie PHP 5.6 ``debian-8-php7`` jessie with dotdeb PHP 7.x (via sury) ``debian-9`` stretch PHP 7.0 ``centos-7`` PHP 5.4 ``centos-7-php56`` PHP 5.6 ====================== ========================== =============== ## Instruction: Add official php images to tag list ## Code After: ====================== =================================== =============== Tag Distribution name PHP Version ====================== =================================== =============== ``5.6`` *customized official php image* PHP 5.6 ``7.0`` *customized official php image* PHP 7.0 ``7.1`` *customized official php image* PHP 7.1 ``alpine`` *link to alpine-php7* PHP 7.x ``alpine-php7`` PHP 7.x ``alpine-php5`` PHP 5.6 ``alpine-3`` *deprecated* PHP 5.6 ``alpine-3-php7`` *deprecated* PHP 7.x ``ubuntu-12.04`` precise PHP 5.3 ``ubuntu-14.04`` trusty (LTS) PHP 5.5 ``ubuntu-15.04`` vivid PHP 5.6 ``ubuntu-15.10`` wily PHP 5.6 ``ubuntu-16.04`` xenial (LTS) PHP 7.0 ``debian-7`` wheezy PHP 5.4 ``debian-8`` jessie PHP 5.6 ``debian-8-php7`` jessie with dotdeb PHP 7.x (via sury) ``debian-9`` stretch PHP 7.0 ``centos-7`` PHP 5.4 ``centos-7-php56`` PHP 5.6 ====================== =================================== ===============
- ====================== ========================== =============== + ====================== =================================== =============== ? +++++++++ - Tag Distribution name PHP Version + Tag Distribution name PHP Version ? +++++++++ - ====================== ========================== =============== + ====================== =================================== =============== ? +++++++++ + ``5.6`` *customized official php image* PHP 5.6 + ``7.0`` *customized official php image* PHP 7.0 + ``7.1`` *customized official php image* PHP 7.1 - ``alpine`` *link to alpine-php7* PHP 7.x + ``alpine`` *link to alpine-php7* PHP 7.x ? +++++++++ - ``alpine-php7`` PHP 7.x + ``alpine-php7`` PHP 7.x ? +++++++++ - ``alpine-php5`` PHP 5.6 + ``alpine-php5`` PHP 5.6 ? +++++++++ - ``alpine-3`` *deprecated* PHP 5.6 + ``alpine-3`` *deprecated* PHP 5.6 ? +++++++++ - ``alpine-3-php7`` *deprecated* PHP 7.x + ``alpine-3-php7`` *deprecated* PHP 7.x ? +++++++++ - ``ubuntu-12.04`` precise PHP 5.3 + ``ubuntu-12.04`` precise PHP 5.3 ? +++++++++ - ``ubuntu-14.04`` trusty (LTS) PHP 5.5 + ``ubuntu-14.04`` trusty (LTS) PHP 5.5 ? +++++++++ - ``ubuntu-15.04`` vivid PHP 5.6 + ``ubuntu-15.04`` vivid PHP 5.6 ? +++++++++ - ``ubuntu-15.10`` wily PHP 5.6 + ``ubuntu-15.10`` wily PHP 5.6 ? +++++++++ - ``ubuntu-16.04`` xenial (LTS) PHP 7.0 + ``ubuntu-16.04`` xenial (LTS) PHP 7.0 ? +++++++++ - ``debian-7`` wheezy PHP 5.4 + ``debian-7`` wheezy PHP 5.4 ? +++++++++ - ``debian-8`` jessie PHP 5.6 + ``debian-8`` jessie PHP 5.6 ? +++++++++ - ``debian-8-php7`` jessie with dotdeb PHP 7.x (via sury) + ``debian-8-php7`` jessie with dotdeb PHP 7.x (via sury) ? +++++++++ - ``debian-9`` stretch PHP 7.0 + ``debian-9`` stretch PHP 7.0 ? +++++++++ - ``centos-7`` PHP 5.4 + ``centos-7`` PHP 5.4 ? +++++++++ - ``centos-7-php56`` PHP 5.6 + ``centos-7-php56`` PHP 5.6 ? +++++++++ - ====================== ========================== =============== + ====================== =================================== =============== ? +++++++++
43
2.15
23
20
c7e1e89ff635404a5da021185be0a043f48b69da
snippets/base/static/templates/snippetDataWidget.html
snippets/base/static/templates/snippetDataWidget.html
<table> <tr> <th>Name</th> <th>Value</th> </tr> {% for variable in variables %} <tr class="variable" data-variable="{{ variable.name }}" data-type="{{ variable.type }}"> <td class="variable-name">{{ variable.name }}</td> <td> {% if variable.type == types.text or variable.type == types.body %} <textarea>{{ originalData[variable.name] }}</textarea> {% elif variable.type == types.image %} <img src="{{ originalData[variable.name] }}" {% if originalData[variable.name] == "" %} style="display:none;" {% endif %}> <input type="file" class="image-input"> <a href="#" class="image-input-remove" style="padding-left: 5px">Remove image</a> <div class='fileSize'></div> {% elif variable.type == types.smalltext %} <input class="smalltext" value="{{ originalData[variable.name] }}"> {% elif variable.type == types.checkbox %} <input type="checkbox" {{ 'checked' if originalData[variable.name] else '' }}> {% endif %} {% if variable.description %} <small>{{ variable.description }}</small> {% endif %} </td> </tr> {% endfor %} </table>
<table> <tr> <th>Name</th> <th>Value</th> </tr> {% for variable in variables %} <tr class="variable" data-variable="{{ variable.name }}" data-type="{{ variable.type }}"> <td class="variable-name">{{ variable.name }}</td> <td> {% if variable.type == types.text or variable.type == types.body %} <textarea>{{ originalData[variable.name] }}</textarea> {% elif variable.type == types.image %} <img src="{{ originalData[variable.name] }}" {% if originalData[variable.name] == "" %} style="display:none;" {% endif %}> <input type="file" class="image-input"> <a href="#" class="image-input-remove" style="padding-left: 5px">Remove image</a> <div class='fileSize'></div> {% elif variable.type == types.smalltext %} <input class="smalltext" value="{{ originalData[variable.name] }}"> {% elif variable.type == types.checkbox %} <input type="checkbox" {{ 'checked' if originalData[variable.name] else '' }}> {% endif %} {% if variable.description %} <small style="background-color: rgb(245, 245, 245); padding: 2px 5px;">{{ variable.description }}</small> {% endif %} </td> </tr> {% endfor %} </table>
Add padding and background color to field description.
[admin] Add padding and background color to field description.
HTML
mpl-2.0
schalkneethling/snippets-service,akatsoulas/snippets-service,mozmar/snippets-service,schalkneethling/snippets-service,mozmar/snippets-service,schalkneethling/snippets-service,mozilla/snippets-service,glogiotatidis/snippets-service,akatsoulas/snippets-service,mozmar/snippets-service,glogiotatidis/snippets-service,mozilla/snippets-service,mozmar/snippets-service,mozilla/snippets-service,schalkneethling/snippets-service,glogiotatidis/snippets-service,glogiotatidis/snippets-service,mozilla/snippets-service,akatsoulas/snippets-service,akatsoulas/snippets-service
html
## Code Before: <table> <tr> <th>Name</th> <th>Value</th> </tr> {% for variable in variables %} <tr class="variable" data-variable="{{ variable.name }}" data-type="{{ variable.type }}"> <td class="variable-name">{{ variable.name }}</td> <td> {% if variable.type == types.text or variable.type == types.body %} <textarea>{{ originalData[variable.name] }}</textarea> {% elif variable.type == types.image %} <img src="{{ originalData[variable.name] }}" {% if originalData[variable.name] == "" %} style="display:none;" {% endif %}> <input type="file" class="image-input"> <a href="#" class="image-input-remove" style="padding-left: 5px">Remove image</a> <div class='fileSize'></div> {% elif variable.type == types.smalltext %} <input class="smalltext" value="{{ originalData[variable.name] }}"> {% elif variable.type == types.checkbox %} <input type="checkbox" {{ 'checked' if originalData[variable.name] else '' }}> {% endif %} {% if variable.description %} <small>{{ variable.description }}</small> {% endif %} </td> </tr> {% endfor %} </table> ## Instruction: [admin] Add padding and background color to field description. ## Code After: <table> <tr> <th>Name</th> <th>Value</th> </tr> {% for variable in variables %} <tr class="variable" data-variable="{{ variable.name }}" data-type="{{ variable.type }}"> <td class="variable-name">{{ variable.name }}</td> <td> {% if variable.type == types.text or variable.type == types.body %} <textarea>{{ originalData[variable.name] }}</textarea> {% elif variable.type == types.image %} <img src="{{ originalData[variable.name] }}" {% if originalData[variable.name] == "" %} style="display:none;" {% endif %}> <input type="file" class="image-input"> <a href="#" class="image-input-remove" style="padding-left: 5px">Remove image</a> <div class='fileSize'></div> {% elif variable.type == types.smalltext %} <input class="smalltext" value="{{ originalData[variable.name] }}"> {% elif variable.type == types.checkbox %} <input type="checkbox" {{ 'checked' if originalData[variable.name] else '' }}> {% endif %} {% if variable.description %} <small style="background-color: rgb(245, 245, 245); padding: 2px 5px;">{{ variable.description }}</small> {% endif %} </td> </tr> {% endfor %} </table>
<table> <tr> <th>Name</th> <th>Value</th> </tr> {% for variable in variables %} <tr class="variable" data-variable="{{ variable.name }}" data-type="{{ variable.type }}"> <td class="variable-name">{{ variable.name }}</td> <td> {% if variable.type == types.text or variable.type == types.body %} <textarea>{{ originalData[variable.name] }}</textarea> {% elif variable.type == types.image %} <img src="{{ originalData[variable.name] }}" {% if originalData[variable.name] == "" %} style="display:none;" {% endif %}> <input type="file" class="image-input"> <a href="#" class="image-input-remove" style="padding-left: 5px">Remove image</a> <div class='fileSize'></div> {% elif variable.type == types.smalltext %} <input class="smalltext" value="{{ originalData[variable.name] }}"> {% elif variable.type == types.checkbox %} <input type="checkbox" {{ 'checked' if originalData[variable.name] else '' }}> {% endif %} {% if variable.description %} - <small>{{ variable.description }}</small> + <small style="background-color: rgb(245, 245, 245); padding: 2px 5px;">{{ variable.description }}</small> {% endif %} </td> </tr> {% endfor %} </table>
2
0.068966
1
1
b74666c77502cad6e2e7977913891b166e44f2f2
opps/contrib/admin/templates/admin/base_site.html
opps/contrib/admin/templates/admin/base_site.html
{% extends "admin/base.html" %} {% load i18n grp_tags admin_shortcuts_tags admin_static %} {% block title %}{{ title }} | {% trans 'Opps site admin' %}{% endblock %} {% block branding %} <h1 id="site-name">{% trans 'Opps administration' %}</h1> {% endblock %} {% block pretitle %} {% if not is_popup %} <div class="admin_shortcuts {%if request.path != '/admin/'%} grp-collapse collapse grp-closed {%else%}grp-collapse collapse grp-open{%endif%}"> {% admin_shortcuts %} </div> {% endif %} {{ block.super }} {% endblock %} {% block extrastyle %} <style type="text/css"> {% admin_shortcuts_css %} </style> {{ block.super }} <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> {% endblock %} {% block extrahead %}{{ block.super }}{% admin_shortcuts_js %}{% endblock %}
{% extends "admin/base.html" %} {% load i18n grp_tags admin_shortcuts_tags admin_static %} {% block title %}{{ title }} | {% trans 'Opps site admin' %}{% endblock %} {% block branding %} <h1 id="site-name">{% trans 'Opps administration' %}</h1> {% endblock %} {% block pretitle %} {% if not is_popup and not 'pop' in request.GET and not '_popup' in request.GET %} <div class="admin_shortcuts {%if request.path != '/admin/'%} grp-collapse collapse grp-closed {%else%}grp-collapse collapse grp-open{%endif%}"> {% admin_shortcuts %} </div> {% endif %} {{ block.super }} {% endblock %} {% block extrastyle %} <style type="text/css"> {% admin_shortcuts_css %} </style> {{ block.super }} <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> {% endblock %} {% block extrahead %}{{ block.super }}{% admin_shortcuts_js %}{% endblock %}
Fix shoortcuts showing in add popups
Fix shoortcuts showing in add popups
HTML
mit
opps/opps,jeanmask/opps,jeanmask/opps,williamroot/opps,opps/opps,williamroot/opps,williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps
html
## Code Before: {% extends "admin/base.html" %} {% load i18n grp_tags admin_shortcuts_tags admin_static %} {% block title %}{{ title }} | {% trans 'Opps site admin' %}{% endblock %} {% block branding %} <h1 id="site-name">{% trans 'Opps administration' %}</h1> {% endblock %} {% block pretitle %} {% if not is_popup %} <div class="admin_shortcuts {%if request.path != '/admin/'%} grp-collapse collapse grp-closed {%else%}grp-collapse collapse grp-open{%endif%}"> {% admin_shortcuts %} </div> {% endif %} {{ block.super }} {% endblock %} {% block extrastyle %} <style type="text/css"> {% admin_shortcuts_css %} </style> {{ block.super }} <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> {% endblock %} {% block extrahead %}{{ block.super }}{% admin_shortcuts_js %}{% endblock %} ## Instruction: Fix shoortcuts showing in add popups ## Code After: {% extends "admin/base.html" %} {% load i18n grp_tags admin_shortcuts_tags admin_static %} {% block title %}{{ title }} | {% trans 'Opps site admin' %}{% endblock %} {% block branding %} <h1 id="site-name">{% trans 'Opps administration' %}</h1> {% endblock %} {% block pretitle %} {% if not is_popup and not 'pop' in request.GET and not '_popup' in request.GET %} <div class="admin_shortcuts {%if request.path != '/admin/'%} grp-collapse collapse grp-closed {%else%}grp-collapse collapse grp-open{%endif%}"> {% admin_shortcuts %} </div> {% endif %} {{ block.super }} {% endblock %} {% block extrastyle %} <style type="text/css"> {% admin_shortcuts_css %} </style> {{ block.super }} <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> {% endblock %} {% block extrahead %}{{ block.super }}{% admin_shortcuts_js %}{% endblock %}
{% extends "admin/base.html" %} {% load i18n grp_tags admin_shortcuts_tags admin_static %} {% block title %}{{ title }} | {% trans 'Opps site admin' %}{% endblock %} {% block branding %} <h1 id="site-name">{% trans 'Opps administration' %}</h1> {% endblock %} {% block pretitle %} - {% if not is_popup %} + {% if not is_popup and not 'pop' in request.GET and not '_popup' in request.GET %} <div class="admin_shortcuts {%if request.path != '/admin/'%} grp-collapse collapse grp-closed {%else%}grp-collapse collapse grp-open{%endif%}"> {% admin_shortcuts %} </div> {% endif %} {{ block.super }} {% endblock %} {% block extrastyle %} <style type="text/css"> {% admin_shortcuts_css %} </style> {{ block.super }} <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> {% endblock %} {% block extrahead %}{{ block.super }}{% admin_shortcuts_js %}{% endblock %}
2
0.0625
1
1
aca1b138350434c9afb08f31164269cd58de1d2d
YouKnowShit/CheckFile.py
YouKnowShit/CheckFile.py
import os import sys (dir, filename) = os.path.split(os.path.abspath(sys.argv[0])) print(dir) filenames = os.listdir(dir) for file in filenames: print(file) print('*****************************************************') updir = os.path.abspath('..') print(updir) filenames = os.listdir(updir) for file in filenames: print(file) print('*****************************************************') os.chdir(updir) upupdir = os.path.abspath('..') print(upupdir) filenames = os.listdir(upupdir) for file in filenames: print(file) print('*****************************************************') os.chdir(upupdir) upupupdir = os.path.abspath('..') print(upupupdir) filenames = os.listdir(upupupdir) for file in filenames: print(file)
import os import sys (dir, filename) = os.path.split(os.path.abspath(sys.argv[0])) print(dir) filenames = os.listdir(dir) for file in filenames: print(file) print() print() print() print('*****************************************************') updir = os.path.abspath('..') print(updir) filenames = os.listdir(updir) for file in filenames: print(file) print() print() print() print('*****************************************************') os.chdir(updir) upupdir = os.path.abspath('..') print(upupdir) filenames = os.listdir(upupdir) for file in filenames: print(file) print() print() print() print('*****************************************************') os.chdir(upupdir) upupupdir = os.path.abspath('..') print(upupupdir) filenames = os.listdir(upupupdir) for file in filenames: print(file) print() print() print() print('*****************************************************') os.chdir(upupupdir) upupupupdir = os.path.abspath('..') print(upupupupdir) filenames = os.listdir(upupupupdir) for file in filenames: print(file)
Add a level of uper directory
Add a level of uper directory
Python
mit
jiangtianyu2009/PiSoftCake
python
## Code Before: import os import sys (dir, filename) = os.path.split(os.path.abspath(sys.argv[0])) print(dir) filenames = os.listdir(dir) for file in filenames: print(file) print('*****************************************************') updir = os.path.abspath('..') print(updir) filenames = os.listdir(updir) for file in filenames: print(file) print('*****************************************************') os.chdir(updir) upupdir = os.path.abspath('..') print(upupdir) filenames = os.listdir(upupdir) for file in filenames: print(file) print('*****************************************************') os.chdir(upupdir) upupupdir = os.path.abspath('..') print(upupupdir) filenames = os.listdir(upupupdir) for file in filenames: print(file) ## Instruction: Add a level of uper directory ## Code After: import os import sys (dir, filename) = os.path.split(os.path.abspath(sys.argv[0])) print(dir) filenames = os.listdir(dir) for file in filenames: print(file) print() print() print() print('*****************************************************') updir = os.path.abspath('..') print(updir) filenames = os.listdir(updir) for file in filenames: print(file) print() print() print() print('*****************************************************') os.chdir(updir) upupdir = os.path.abspath('..') print(upupdir) filenames = os.listdir(upupdir) for file in filenames: print(file) print() print() print() print('*****************************************************') os.chdir(upupdir) upupupdir = os.path.abspath('..') print(upupupdir) filenames = os.listdir(upupupdir) for file in filenames: print(file) print() print() print() print('*****************************************************') os.chdir(upupupdir) upupupupdir = os.path.abspath('..') print(upupupupdir) filenames = os.listdir(upupupupdir) for file in filenames: print(file)
import os import sys (dir, filename) = os.path.split(os.path.abspath(sys.argv[0])) print(dir) filenames = os.listdir(dir) for file in filenames: print(file) + print() + print() + print() print('*****************************************************') updir = os.path.abspath('..') print(updir) filenames = os.listdir(updir) for file in filenames: print(file) + print() + print() + print() print('*****************************************************') os.chdir(updir) upupdir = os.path.abspath('..') print(upupdir) filenames = os.listdir(upupdir) for file in filenames: print(file) + print() + print() + print() print('*****************************************************') os.chdir(upupdir) upupupdir = os.path.abspath('..') print(upupupdir) filenames = os.listdir(upupupdir) for file in filenames: print(file) + + print() + print() + print() + print('*****************************************************') + os.chdir(upupupdir) + upupupupdir = os.path.abspath('..') + print(upupupupdir) + filenames = os.listdir(upupupupdir) + for file in filenames: + print(file)
20
0.645161
20
0
29603bf5accf6f0a7772fb0b0226858c02cac6a4
app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
Turbolinks.HttpRequest.prototype.requestLoaded = -> @endRequest => if 200 <= @xhr.status < 300 or @xhr.status == 401 @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location")) else @failed = true @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText)
if Turbolinks? Turbolinks.HttpRequest.prototype.requestLoaded = -> @endRequest => if 200 <= @xhr.status < 300 or @xhr.status == 401 @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location")) else @failed = true @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText)
Make sure Turbolinks is defined before patching.
Make sure Turbolinks is defined before patching.
CoffeeScript
apache-2.0
samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax
coffeescript
## Code Before: Turbolinks.HttpRequest.prototype.requestLoaded = -> @endRequest => if 200 <= @xhr.status < 300 or @xhr.status == 401 @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location")) else @failed = true @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText) ## Instruction: Make sure Turbolinks is defined before patching. ## Code After: if Turbolinks? Turbolinks.HttpRequest.prototype.requestLoaded = -> @endRequest => if 200 <= @xhr.status < 300 or @xhr.status == 401 @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location")) else @failed = true @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText)
+ if Turbolinks? - Turbolinks.HttpRequest.prototype.requestLoaded = -> + Turbolinks.HttpRequest.prototype.requestLoaded = -> ? ++ - @endRequest => + @endRequest => ? ++ - if 200 <= @xhr.status < 300 or @xhr.status == 401 + if 200 <= @xhr.status < 300 or @xhr.status == 401 ? ++ - @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location")) + @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location")) ? ++ - else + else ? ++ - @failed = true + @failed = true ? ++ - @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText) + @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText) ? ++
15
2.142857
8
7
d6c8e1027a184ad4ad0d78768404fe8c65e0ea61
index.js
index.js
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-flatpickr', included: function(app) { this._super.included(app); app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.css', {prepend: true}); app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.js', {prepend: true}); } };
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-flatpickr', included: function(app) { this._super.included(app); if (!process.env.EMBER_CLI_FASTBOOT) { // This will only be included in the browser build app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.css', {prepend: true}); app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.js', {prepend: true}); } } };
Add support for Ember FastBoot
Add support for Ember FastBoot As per http://www.ember-fastboot.com/docs/addon-author-guide
JavaScript
mit
shipshapecode/ember-flatpickr,shipshapecode/ember-flatpickr,shipshapecode/ember-flatpickr
javascript
## Code Before: /* jshint node: true */ 'use strict'; module.exports = { name: 'ember-flatpickr', included: function(app) { this._super.included(app); app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.css', {prepend: true}); app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.js', {prepend: true}); } }; ## Instruction: Add support for Ember FastBoot As per http://www.ember-fastboot.com/docs/addon-author-guide ## Code After: /* jshint node: true */ 'use strict'; module.exports = { name: 'ember-flatpickr', included: function(app) { this._super.included(app); if (!process.env.EMBER_CLI_FASTBOOT) { // This will only be included in the browser build app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.css', {prepend: true}); app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.js', {prepend: true}); } } };
/* jshint node: true */ 'use strict'; module.exports = { name: 'ember-flatpickr', included: function(app) { this._super.included(app); + if (!process.env.EMBER_CLI_FASTBOOT) { + // This will only be included in the browser build - app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.css', {prepend: true}); + app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.css', {prepend: true}); ? ++ - app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.js', {prepend: true}); + app.import(app.bowerDirectory + '/flatpickr/dist/flatpickr.min.js', {prepend: true}); ? ++ + } } };
7
0.636364
5
2
8eec17b84a8621d725db81c24a697216b323fa78
README.md
README.md
My userscripts for Chrome, Greasemonkey etc. http://www.eclectide.com #### NirvanaHQ Hotkeys Popup Adds a button to NirvanaHQ, which opens a window with all available hotkeys and tags.
My userscripts for Chrome, Greasemonkey etc. http://www.eclectide.com #### NirvanaHQ Hotkeys Popup Adds a button to NirvanaHQ, which opens a window with all available hotkeys and tags. * [Install](https://github.com/darekkay/userscripts/raw/master/nirvanahq-hotkeys.user.js)
Install userscripts from the front page
Install userscripts from the front page
Markdown
mit
o-o00o-o/userscripts
markdown
## Code Before: My userscripts for Chrome, Greasemonkey etc. http://www.eclectide.com #### NirvanaHQ Hotkeys Popup Adds a button to NirvanaHQ, which opens a window with all available hotkeys and tags. ## Instruction: Install userscripts from the front page ## Code After: My userscripts for Chrome, Greasemonkey etc. http://www.eclectide.com #### NirvanaHQ Hotkeys Popup Adds a button to NirvanaHQ, which opens a window with all available hotkeys and tags. * [Install](https://github.com/darekkay/userscripts/raw/master/nirvanahq-hotkeys.user.js)
My userscripts for Chrome, Greasemonkey etc. http://www.eclectide.com #### NirvanaHQ Hotkeys Popup Adds a button to NirvanaHQ, which opens a window with all available hotkeys and tags. + + * [Install](https://github.com/darekkay/userscripts/raw/master/nirvanahq-hotkeys.user.js)
2
0.25
2
0
954d519af7db13aec733db1bb5265f5f71b4f6e0
pkgs/tools/networking/minidlna/default.nix
pkgs/tools/networking/minidlna/default.nix
{stdenv, fetchurl, libav, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: stdenv.mkDerivation rec { name = "minidlna-1.0.24"; src = fetchurl { url = mirror://sourceforge/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz; sha256 = "0hmrrrq7d8940rckwj93bcdpdxxy3qfkjl17j5k31mi37hqc42l4"; }; preConfigure = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libav}/include/libavutil -I${libav}/include/libavcodec -I${libav}/include/libavformat" export makeFlags="INSTALLPREFIX=$out" ''; buildInputs = [ libav flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; patches = [ ./config.patch ]; meta = { description = "MiniDLNA Media Server"; longDescription = '' MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients. ''; homepage = http://sourceforge.net/projects/minidlna/; license = stdenv.lib.licenses.gpl2; platforms = stdenv.lib.platforms.all; }; }
{ stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: let version = "1.0.25"; in stdenv.mkDerivation rec { name = "minidlna-${version}"; src = fetchurl { url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna_${version}_src.tar.gz"; sha256 = "0l987x3bx2apnlihnjbhywgk5b2g9ysiapwclz5vphj2w3xn018p"; }; patches = [ ./config.patch ]; preConfigure = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ffmpeg}/include/libavutil -I${ffmpeg}/include/libavcodec -I${ffmpeg}/include/libavformat" export makeFlags="INSTALLPREFIX=$out" ''; buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; meta = { description = "MiniDLNA Media Server"; longDescription = '' MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients. ''; homepage = http://sourceforge.net/projects/minidlna/; license = stdenv.lib.licenses.gpl2; platforms = stdenv.lib.platforms.linux; }; }
Update to 1.0.25 and use ffmpeg instead of libav
minidlna: Update to 1.0.25 and use ffmpeg instead of libav
Nix
mit
SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs
nix
## Code Before: {stdenv, fetchurl, libav, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: stdenv.mkDerivation rec { name = "minidlna-1.0.24"; src = fetchurl { url = mirror://sourceforge/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz; sha256 = "0hmrrrq7d8940rckwj93bcdpdxxy3qfkjl17j5k31mi37hqc42l4"; }; preConfigure = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libav}/include/libavutil -I${libav}/include/libavcodec -I${libav}/include/libavformat" export makeFlags="INSTALLPREFIX=$out" ''; buildInputs = [ libav flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; patches = [ ./config.patch ]; meta = { description = "MiniDLNA Media Server"; longDescription = '' MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients. ''; homepage = http://sourceforge.net/projects/minidlna/; license = stdenv.lib.licenses.gpl2; platforms = stdenv.lib.platforms.all; }; } ## Instruction: minidlna: Update to 1.0.25 and use ffmpeg instead of libav ## Code After: { stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: let version = "1.0.25"; in stdenv.mkDerivation rec { name = "minidlna-${version}"; src = fetchurl { url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna_${version}_src.tar.gz"; sha256 = "0l987x3bx2apnlihnjbhywgk5b2g9ysiapwclz5vphj2w3xn018p"; }; patches = [ ./config.patch ]; preConfigure = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ffmpeg}/include/libavutil -I${ffmpeg}/include/libavcodec -I${ffmpeg}/include/libavformat" export makeFlags="INSTALLPREFIX=$out" ''; buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; meta = { description = "MiniDLNA Media Server"; longDescription = '' MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients. ''; homepage = http://sourceforge.net/projects/minidlna/; license = stdenv.lib.licenses.gpl2; platforms = stdenv.lib.platforms.linux; }; }
- {stdenv, fetchurl, libav, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: ? ^^^^^ + { stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }: ? + ^^^^^^ + + let version = "1.0.25"; in + stdenv.mkDerivation rec { - name = "minidlna-1.0.24"; + name = "minidlna-${version}"; + src = fetchurl { - url = mirror://sourceforge/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz; ? ^^^^^^ ^^^^^^ + url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna_${version}_src.tar.gz"; ? + ^^^^^^^^^^ ^^^^^^^^^^ + - sha256 = "0hmrrrq7d8940rckwj93bcdpdxxy3qfkjl17j5k31mi37hqc42l4"; + sha256 = "0l987x3bx2apnlihnjbhywgk5b2g9ysiapwclz5vphj2w3xn018p"; }; + patches = [ ./config.patch ]; + preConfigure = '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libav}/include/libavutil -I${libav}/include/libavcodec -I${libav}/include/libavformat" ? ^^^^^ ^^^^^ ^^^^^ + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ffmpeg}/include/libavutil -I${ffmpeg}/include/libavcodec -I${ffmpeg}/include/libavformat" ? ^^^^^^ ^^^^^^ ^^^^^^ export makeFlags="INSTALLPREFIX=$out" ''; - buildInputs = [ libav flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; ? ^^^^^ + buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite ]; ? ^^^^^^ - patches = [ ./config.patch ]; meta = { description = "MiniDLNA Media Server"; longDescription = '' - MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully ? - + MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully - compliant with DLNA/UPnP-AV clients. ? - + compliant with DLNA/UPnP-AV clients. ''; homepage = http://sourceforge.net/projects/minidlna/; license = stdenv.lib.licenses.gpl2; - - platforms = stdenv.lib.platforms.all; ? - ^ + platforms = stdenv.lib.platforms.linux; ? ^^^^ }; }
26
0.928571
15
11
9eb46b7bafd509569a55c4d31e602ab5d2e33d3f
bots/images/scripts/lib/build-deps.sh
bots/images/scripts/lib/build-deps.sh
set -eu # Download cockpit.spec, replace `npm-version` macro and then query all build requires curl -s https://raw.githubusercontent.com/cockpit-project/cockpit/master/tools/cockpit.spec | sed 's/%{npm-version:.*}/0/' | sed '/Recommends:/d' | rpmspec -D "$1" --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' '
set -eu # Download cockpit.spec, replace `npm-version` macro and then query all build requires curl -s https://raw.githubusercontent.com/cockpit-project/cockpit/master/tools/cockpit.spec | sed 's/%{npm-version:.*}/0/' | sed '/Recommends:/d' | rpmspec -D "$1" --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' ' # support for backbranches if [ "$1" = "rhel 7" ] || [ "$1" = "centos 7" ]; then echo "golang-bin golang-src" fi
Put back golang into rhel/centos-7 images
bots: Put back golang into rhel/centos-7 images We still need these for running builds/tests for the stable rhel-7.x branches. Closes #12351
Shell
lgpl-2.1
moraleslazaro/cockpit,cockpituous/cockpit,cockpituous/cockpit,deryni/cockpit,garrett/cockpit,moraleslazaro/cockpit,garrett/cockpit,cockpit-project/cockpit,garrett/cockpit,martinpitt/cockpit,martinpitt/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,martinpitt/cockpit,deryni/cockpit,moraleslazaro/cockpit,deryni/cockpit,cockpituous/cockpit,mvollmer/cockpit,cockpit-project/cockpit,moraleslazaro/cockpit,cockpituous/cockpit,deryni/cockpit,mvollmer/cockpit,garrett/cockpit,deryni/cockpit,cockpituous/cockpit,deryni/cockpit,deryni/cockpit,martinpitt/cockpit,garrett/cockpit,cockpit-project/cockpit,cockpituous/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,martinpitt/cockpit,moraleslazaro/cockpit,mvollmer/cockpit,mvollmer/cockpit,mvollmer/cockpit
shell
## Code Before: set -eu # Download cockpit.spec, replace `npm-version` macro and then query all build requires curl -s https://raw.githubusercontent.com/cockpit-project/cockpit/master/tools/cockpit.spec | sed 's/%{npm-version:.*}/0/' | sed '/Recommends:/d' | rpmspec -D "$1" --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' ' ## Instruction: bots: Put back golang into rhel/centos-7 images We still need these for running builds/tests for the stable rhel-7.x branches. Closes #12351 ## Code After: set -eu # Download cockpit.spec, replace `npm-version` macro and then query all build requires curl -s https://raw.githubusercontent.com/cockpit-project/cockpit/master/tools/cockpit.spec | sed 's/%{npm-version:.*}/0/' | sed '/Recommends:/d' | rpmspec -D "$1" --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' ' # support for backbranches if [ "$1" = "rhel 7" ] || [ "$1" = "centos 7" ]; then echo "golang-bin golang-src" fi
set -eu # Download cockpit.spec, replace `npm-version` macro and then query all build requires curl -s https://raw.githubusercontent.com/cockpit-project/cockpit/master/tools/cockpit.spec | sed 's/%{npm-version:.*}/0/' | sed '/Recommends:/d' | rpmspec -D "$1" --buildrequires --query /dev/stdin | sed 's/.*/"&"/' | tr '\n' ' ' + + # support for backbranches + if [ "$1" = "rhel 7" ] || [ "$1" = "centos 7" ]; then + echo "golang-bin golang-src" + fi
5
0.5
5
0
07a1b77405e06c9f26f4d0a9785627449b5e2c28
module/Directorzone/src/Directorzone/Service/CompanyService.php
module/Directorzone/src/Directorzone/Service/CompanyService.php
<?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; $query = $this->getConnection()->prepare($sql); $query->execute( array( ':number' => $companyNumber, ) ); return ($query->rowCount() == 1); } public function count() { $sql = "SELECT count(*) as c " . "FROM company"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { return $row['c']; } else { return null; } } public function getMaxAlphabeticalCompanyName() { $sql = "SELECT name " . "FROM company " . "WHERE name NOT LIKE 'THE %' " . "AND name NOT LIKE 'THE-%' " . "ORDER BY name DESC " . "LIMIT 1"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { $name = preg_replace('/^THE[ -]/', '', $row['name']); return $name; } else { return null; } } }
<?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; $query = $this->getConnection()->prepare($sql); $query->execute( array( ':number' => $companyNumber, ) ); return ($query->rowCount() == 1); } public function count() { $sql = "SELECT count(*) as c " . "FROM company"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { return $row['c']; } else { return null; } } public function getMaxAlphabeticalCompanyName() { $sql = "SELECT name " . "FROM company " . "WHERE name NOT LIKE 'THE %' " . "AND name NOT LIKE 'THE-%' " . "AND name NOT LIKE '\\%' " . "ORDER BY name DESC " . "LIMIT 1"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { $name = preg_replace('/^THE[ -]/', '', $row['name']); return $name; } else { return null; } } }
Exclude \ from company name
Exclude \ from company name Change-Id: Ife5a34a09f476e196aae6178886109750bcbe934
PHP
bsd-3-clause
Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone
php
## Code Before: <?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; $query = $this->getConnection()->prepare($sql); $query->execute( array( ':number' => $companyNumber, ) ); return ($query->rowCount() == 1); } public function count() { $sql = "SELECT count(*) as c " . "FROM company"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { return $row['c']; } else { return null; } } public function getMaxAlphabeticalCompanyName() { $sql = "SELECT name " . "FROM company " . "WHERE name NOT LIKE 'THE %' " . "AND name NOT LIKE 'THE-%' " . "ORDER BY name DESC " . "LIMIT 1"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { $name = preg_replace('/^THE[ -]/', '', $row['name']); return $name; } else { return null; } } } ## Instruction: Exclude \ from company name Change-Id: Ife5a34a09f476e196aae6178886109750bcbe934 ## Code After: <?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; $query = $this->getConnection()->prepare($sql); $query->execute( array( ':number' => $companyNumber, ) ); return ($query->rowCount() == 1); } public function count() { $sql = "SELECT count(*) as c " . "FROM company"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { return $row['c']; } else { return null; } } public function getMaxAlphabeticalCompanyName() { $sql = "SELECT name " . "FROM company " . "WHERE name NOT LIKE 'THE %' " . "AND name NOT LIKE 'THE-%' " . "AND name NOT LIKE '\\%' " . "ORDER BY name DESC " . "LIMIT 1"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { $name = preg_replace('/^THE[ -]/', '', $row['name']); return $name; } else { return null; } } }
<?php namespace Directorzone\Service; use Netsensia\Service\NetsensiaService; class CompanyService extends NetsensiaService { public function isCompanyNumberTaken($companyNumber) { $sql = "SELECT companyid " . "FROM company " . "WHERE number = :number"; $query = $this->getConnection()->prepare($sql); $query->execute( array( ':number' => $companyNumber, ) ); return ($query->rowCount() == 1); } public function count() { $sql = "SELECT count(*) as c " . "FROM company"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { return $row['c']; } else { return null; } } public function getMaxAlphabeticalCompanyName() { $sql = "SELECT name " . "FROM company " . "WHERE name NOT LIKE 'THE %' " . "AND name NOT LIKE 'THE-%' " . + "AND name NOT LIKE '\\%' " . "ORDER BY name DESC " . "LIMIT 1"; $query = $this->getConnection()->prepare($sql); $query->execute(); if ($row = $query->fetch()) { $name = preg_replace('/^THE[ -]/', '', $row['name']); return $name; } else { return null; } } }
1
0.015385
1
0
07c00c8982257010437f45f8f80caad885210132
tests/spec.js
tests/spec.js
describe('Valencia-Tech Repair Database website', function() { beforeEach(function () { browser.get('http://localhost:3000'); }); /*---------------------------------------------*/ it('should have a title', function(){ expect(browser.getTitle()).toEqual('Valencia Tech Repair'); }); })// End main test funcction
describe('Valencia-Tech Repair Database website', function() { /*---------------------------------------------*/ it('should have a title', function(){ browser.get('http://localhost:3000'); expect(browser.getTitle()).toEqual('Valencia Tech Repair'); }); })// End main test funcction
Rework of test file due to Protractor error
Rework of test file due to Protractor error
JavaScript
mit
jrbenny35/VC-Tech-Repair,jrbenny35/VC-Tech-Repair
javascript
## Code Before: describe('Valencia-Tech Repair Database website', function() { beforeEach(function () { browser.get('http://localhost:3000'); }); /*---------------------------------------------*/ it('should have a title', function(){ expect(browser.getTitle()).toEqual('Valencia Tech Repair'); }); })// End main test funcction ## Instruction: Rework of test file due to Protractor error ## Code After: describe('Valencia-Tech Repair Database website', function() { /*---------------------------------------------*/ it('should have a title', function(){ browser.get('http://localhost:3000'); expect(browser.getTitle()).toEqual('Valencia Tech Repair'); }); })// End main test funcction
describe('Valencia-Tech Repair Database website', function() { - - beforeEach(function () { - browser.get('http://localhost:3000'); - }); /*---------------------------------------------*/ it('should have a title', function(){ + browser.get('http://localhost:3000'); expect(browser.getTitle()).toEqual('Valencia Tech Repair'); }); })// End main test funcction
5
0.357143
1
4
933ac37317dea33f1363d377711966fdbec1dd19
.travis.yml
.travis.yml
language: generic sudo: required services: - docker before_install: - docker info - docker build -t android-28 android-28/ script: - docker run -it --rm --volume=$(pwd)/android-28:/opt/workspace --entrypoint /opt/workspace/version-check.sh android-28
language: generic sudo: required services: - docker before_install: - docker info - docker build -t android-28 android-28/ script: - docker run -it --rm --privileged --volume /dev/kvm:/dev/kvm --volume=$(pwd)/android-28:/opt/workspace --entrypoint /opt/workspace/version-check.sh android-28
Enable priviledged mode to pass nested kvm
Enable priviledged mode to pass nested kvm
YAML
mit
plastiv/peta-androidsdk
yaml
## Code Before: language: generic sudo: required services: - docker before_install: - docker info - docker build -t android-28 android-28/ script: - docker run -it --rm --volume=$(pwd)/android-28:/opt/workspace --entrypoint /opt/workspace/version-check.sh android-28 ## Instruction: Enable priviledged mode to pass nested kvm ## Code After: language: generic sudo: required services: - docker before_install: - docker info - docker build -t android-28 android-28/ script: - docker run -it --rm --privileged --volume /dev/kvm:/dev/kvm --volume=$(pwd)/android-28:/opt/workspace --entrypoint /opt/workspace/version-check.sh android-28
language: generic sudo: required services: - docker before_install: - docker info - docker build -t android-28 android-28/ script: - - docker run -it --rm --volume=$(pwd)/android-28:/opt/workspace --entrypoint /opt/workspace/version-check.sh android-28 + - docker run -it --rm --privileged --volume /dev/kvm:/dev/kvm --volume=$(pwd)/android-28:/opt/workspace --entrypoint /opt/workspace/version-check.sh android-28 ? ++++++++++++++++++++++++++++++++++++++++
2
0.153846
1
1
136a2f0099cc4497ebc399bc04af516139183db7
node/aliases.zsh
node/aliases.zsh
alias npr="npm -s run" alias ntr="npm -s run test --" alias ntw="npm -s run test -- --watch" alias lnm="find . -name "node_modules" -type d -prune" alias nnm="find . -name "node_modules" -type d -prune -exec rm -rf '{}' +" alias nnmi="nnm && npm i" alias npv="node -p \"require('./package.json').version\"" alias babel-nodemon="nodemon --exec babel-node -- "
alias npr="npm -s run" alias ntr="npm -s run test --" alias ntw="npm -s run test -- --watch" alias lnm="find . -name "node_modules" -type d -prune" alias nnm="find . -name "node_modules" -type d -prune -exec rm -rf '{}' +" alias nnmi="nnm && npm i" alias npv="node -p \"require('./package.json').version\"" alias babel-nodemon="nodemon --exec babel-node -- " alias npmiglobals='npm i -g nodemon bunyan jira-cl git-branch-select git-commits-since'
Add alias to install common node globals
Add alias to install common node globals
Shell
mit
randallagordon/dotfiles,randallagordon/dotfiles,randallagordon/dotfiles,randallagordon/dotfiles
shell
## Code Before: alias npr="npm -s run" alias ntr="npm -s run test --" alias ntw="npm -s run test -- --watch" alias lnm="find . -name "node_modules" -type d -prune" alias nnm="find . -name "node_modules" -type d -prune -exec rm -rf '{}' +" alias nnmi="nnm && npm i" alias npv="node -p \"require('./package.json').version\"" alias babel-nodemon="nodemon --exec babel-node -- " ## Instruction: Add alias to install common node globals ## Code After: alias npr="npm -s run" alias ntr="npm -s run test --" alias ntw="npm -s run test -- --watch" alias lnm="find . -name "node_modules" -type d -prune" alias nnm="find . -name "node_modules" -type d -prune -exec rm -rf '{}' +" alias nnmi="nnm && npm i" alias npv="node -p \"require('./package.json').version\"" alias babel-nodemon="nodemon --exec babel-node -- " alias npmiglobals='npm i -g nodemon bunyan jira-cl git-branch-select git-commits-since'
alias npr="npm -s run" alias ntr="npm -s run test --" alias ntw="npm -s run test -- --watch" alias lnm="find . -name "node_modules" -type d -prune" alias nnm="find . -name "node_modules" -type d -prune -exec rm -rf '{}' +" alias nnmi="nnm && npm i" alias npv="node -p \"require('./package.json').version\"" alias babel-nodemon="nodemon --exec babel-node -- " + alias npmiglobals='npm i -g nodemon bunyan jira-cl git-branch-select git-commits-since'
1
0.125
1
0
93e164d97317bb4ca56bc734d95764777c838e68
docker/nova-compute/nova-libvirt/start.sh
docker/nova-compute/nova-libvirt/start.sh
chmod 660 /dev/kvm chown root:kvm /dev/kvm echo "Starting libvirtd." exec /usr/sbin/libvirtd
if [[ -c /dev/kvm ]]; then chmod 660 /dev/kvm chown root:kvm /dev/kvm fi echo "Starting libvirtd." exec /usr/sbin/libvirtd
Test for presence of /dev/kvm before setting permissions
Test for presence of /dev/kvm before setting permissions In a native QEMU environment there is no /dev/kvm. Change-Id: I4d0eb32fd6fad3a4c9c15c7c2b12430b2e4db154
Shell
apache-2.0
rajalokan/kolla,nihilifer/kolla,LoHChina/kolla,limamauricio/mykolla,chenzhiwei/kolla,mandre/kolla,mrangana/kolla,mandre/kolla,openstack/kolla,openstack/kolla,dardelean/kolla-ansible,stackforge/kolla,stackforge/kolla,HackToday/kolla,toby82/kolla,chenzhiwei/kolla,chenzhiwei/kolla,tonyli71/kolla,brk3/kolla,LoHChina/kolla,jakedahn/kolla,meticulo3366/kolla,mandre/kolla,fdumpling/kolla,invenfantasy/kolla,LoHChina/kolla,dardelean/kolla-ansible,fdumpling/kolla,stackforge/kolla,coolsvap/kolla,bdastur/kolla,negronjl/kolla,nihilifer/kolla,GalenMa/kolla,brk3/kolla,negronjl/kolla,mrangana/kolla,jakedahn/kolla,intel-onp/kolla,jakedahn/kolla,HackToday/kolla,meticulo3366/kolla,coolsvap/kolla,tonyli71/kolla,fdumpling/kolla,intel-onp/kolla,dardelean/kolla-ansible,toby82/kolla,toby82/kolla,HackToday/kolla,invenfantasy/kolla,coolsvap/kolla,invenfantasy/kolla,bdastur/kolla,limamauricio/mykolla,rajalokan/kolla,limamauricio/mykolla,GalenMa/kolla,rahulunair/kolla,negronjl/kolla,rahulunair/kolla,rajalokan/kolla
shell
## Code Before: chmod 660 /dev/kvm chown root:kvm /dev/kvm echo "Starting libvirtd." exec /usr/sbin/libvirtd ## Instruction: Test for presence of /dev/kvm before setting permissions In a native QEMU environment there is no /dev/kvm. Change-Id: I4d0eb32fd6fad3a4c9c15c7c2b12430b2e4db154 ## Code After: if [[ -c /dev/kvm ]]; then chmod 660 /dev/kvm chown root:kvm /dev/kvm fi echo "Starting libvirtd." exec /usr/sbin/libvirtd
+ if [[ -c /dev/kvm ]]; then - chmod 660 /dev/kvm + chmod 660 /dev/kvm ? ++++ - chown root:kvm /dev/kvm + chown root:kvm /dev/kvm ? ++++ + fi echo "Starting libvirtd." exec /usr/sbin/libvirtd
6
1.2
4
2
ba930c8a2627dd01d45e7b6e83b6fc23338067fd
app/images/image-view.html
app/images/image-view.html
<div class="row"> <div *ngIf="doc" class="col-md-9"> <img src="mediastore/{{doc.resource['filename']}}"> </div> <div *ngIf="doc" class="col-md-3"> <!--<document-view [document]="doc"></document-view>--> </div> </div>
<div class="row"> <div *ngIf="doc" class="col-md-9"> <img src="mediastore/{{doc.resource['filename']}}"> </div> <div *ngIf="doc" class="col-md-3"> Placeholder for metadata view <!--<document-view [document]="doc"></document-view>--> </div> </div>
Add placeholder for metadata view.
Add placeholder for metadata view.
HTML
apache-2.0
codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client
html
## Code Before: <div class="row"> <div *ngIf="doc" class="col-md-9"> <img src="mediastore/{{doc.resource['filename']}}"> </div> <div *ngIf="doc" class="col-md-3"> <!--<document-view [document]="doc"></document-view>--> </div> </div> ## Instruction: Add placeholder for metadata view. ## Code After: <div class="row"> <div *ngIf="doc" class="col-md-9"> <img src="mediastore/{{doc.resource['filename']}}"> </div> <div *ngIf="doc" class="col-md-3"> Placeholder for metadata view <!--<document-view [document]="doc"></document-view>--> </div> </div>
<div class="row"> <div *ngIf="doc" class="col-md-9"> <img src="mediastore/{{doc.resource['filename']}}"> </div> <div *ngIf="doc" class="col-md-3"> + Placeholder for metadata view <!--<document-view [document]="doc"></document-view>--> </div> </div>
1
0.083333
1
0
a903c82a11e58c09fd99e54ae4e68df799faa13d
src/main/webapp/WEB-INF/jsp/doBizTextOverview.jsp
src/main/webapp/WEB-INF/jsp/doBizTextOverview.jsp
<%@ include file="/WEB-INF/jsp/includes/siteTags.jsp"%> <section id="home-slider"> <div class="container"> <div class="main-slider"> <div class="slide-text"> <h1>We supply boxes for your precious jewels</h1> </div> <img src="<c:url value='/resources/images/sky_building1.jpeg'/>" class="img-responsive slider-house'/>" alt="slider image"> </div> </div> </section> <!--/#home-slider--> <section id="action" class="responsive"> <div class="vertical-center"> <div class="container"> <div class="row"> <div class="action take-tour"> <div class="col-sm-7"> <h1 class="title">We have happy clients</h1> <p>A business flourishes only through happy clients. Take a look at our clients across the states</p> <div class="tour-button"> <a href="#" class="btn btn-common">See our Clients</a> </div> </div> </div> </div> </div> </div> </section> <!--/#action-->
<%@ include file="/WEB-INF/jsp/includes/siteTags.jsp"%> <section id="home-slider"> <div class="container"> <div class="main-slider"> <div class="slide-text"> <h1>We supply boxes for your precious jewels</h1> </div> <img src="<c:url value='/resources/images/sky_building1.jpeg'/>" class="img-responsive slider-house'/>" alt="slider image"> </div> </div> </section> <!--/#home-slider--> <section id="action" class="responsive"> <div class="vertical-center"> <div class="container"> <div class="row"> <div class="action take-tour"> <div class="col-sm-7"> <h1 class="title">We have happy customers</h1> <p>A business flourishes only through happy customers. Take a look at our clients across the states</p> <div class="tour-button"> <a href="#" class="btn btn-common">See our customers</a> </div> </div> </div> </div> </div> </div> </section> <!--/#action-->
Update on the index page
Update on the index page
Java Server Pages
apache-2.0
abuabdul/doBizText,abuabdul/doBizText,abuabdul/doBizText
java-server-pages
## Code Before: <%@ include file="/WEB-INF/jsp/includes/siteTags.jsp"%> <section id="home-slider"> <div class="container"> <div class="main-slider"> <div class="slide-text"> <h1>We supply boxes for your precious jewels</h1> </div> <img src="<c:url value='/resources/images/sky_building1.jpeg'/>" class="img-responsive slider-house'/>" alt="slider image"> </div> </div> </section> <!--/#home-slider--> <section id="action" class="responsive"> <div class="vertical-center"> <div class="container"> <div class="row"> <div class="action take-tour"> <div class="col-sm-7"> <h1 class="title">We have happy clients</h1> <p>A business flourishes only through happy clients. Take a look at our clients across the states</p> <div class="tour-button"> <a href="#" class="btn btn-common">See our Clients</a> </div> </div> </div> </div> </div> </div> </section> <!--/#action--> ## Instruction: Update on the index page ## Code After: <%@ include file="/WEB-INF/jsp/includes/siteTags.jsp"%> <section id="home-slider"> <div class="container"> <div class="main-slider"> <div class="slide-text"> <h1>We supply boxes for your precious jewels</h1> </div> <img src="<c:url value='/resources/images/sky_building1.jpeg'/>" class="img-responsive slider-house'/>" alt="slider image"> </div> </div> </section> <!--/#home-slider--> <section id="action" class="responsive"> <div class="vertical-center"> <div class="container"> <div class="row"> <div class="action take-tour"> <div class="col-sm-7"> <h1 class="title">We have happy customers</h1> <p>A business flourishes only through happy customers. Take a look at our clients across the states</p> <div class="tour-button"> <a href="#" class="btn btn-common">See our customers</a> </div> </div> </div> </div> </div> </div> </section> <!--/#action-->
<%@ include file="/WEB-INF/jsp/includes/siteTags.jsp"%> <section id="home-slider"> <div class="container"> <div class="main-slider"> <div class="slide-text"> <h1>We supply boxes for your precious jewels</h1> </div> <img src="<c:url value='/resources/images/sky_building1.jpeg'/>" class="img-responsive slider-house'/>" alt="slider image"> </div> </div> </section> <!--/#home-slider--> <section id="action" class="responsive"> <div class="vertical-center"> <div class="container"> <div class="row"> <div class="action take-tour"> <div class="col-sm-7"> - <h1 class="title">We have happy clients</h1> ? ^^ ^^ + <h1 class="title">We have happy customers</h1> ? ^^^^^ ^ - <p>A business flourishes only through happy clients. Take a look at our clients across the states</p> ? ^^ ^^ + <p>A business flourishes only through happy customers. Take a look at our clients across the states</p> ? ^^^^^ ^ <div class="tour-button"> - <a href="#" class="btn btn-common">See our Clients</a> ? ^^^ ^^ + <a href="#" class="btn btn-common">See our customers</a> ? ^^^^^^ ^ </div> </div> </div> </div> </div> </div> </section> <!--/#action-->
6
0.193548
3
3
fc036a2cc7bd3200d98ed833343e116f4ce32bf1
kitchen/text/exceptions.py
kitchen/text/exceptions.py
from kitchen import exceptions class XmlEncodeError(exceptions.KitchenException): '''Exception thrown by error conditions when encoding an xml string. ''' pass
from kitchen import exceptions class XmlEncodeError(exceptions.KitchenException): '''Exception thrown by error conditions when encoding an xml string. ''' pass class ControlCharError(exceptions.KitchenException): '''Exception thrown when an ascii control character is encountered. ''' pass
Add ControlCharError for process_control_chars function
Add ControlCharError for process_control_chars function
Python
lgpl-2.1
fedora-infra/kitchen,fedora-infra/kitchen
python
## Code Before: from kitchen import exceptions class XmlEncodeError(exceptions.KitchenException): '''Exception thrown by error conditions when encoding an xml string. ''' pass ## Instruction: Add ControlCharError for process_control_chars function ## Code After: from kitchen import exceptions class XmlEncodeError(exceptions.KitchenException): '''Exception thrown by error conditions when encoding an xml string. ''' pass class ControlCharError(exceptions.KitchenException): '''Exception thrown when an ascii control character is encountered. ''' pass
from kitchen import exceptions class XmlEncodeError(exceptions.KitchenException): '''Exception thrown by error conditions when encoding an xml string. ''' pass + + class ControlCharError(exceptions.KitchenException): + '''Exception thrown when an ascii control character is encountered. + ''' + pass
5
0.833333
5
0
5222074107ef1edf5f346ad0913514ff94cfa431
formatter/slow_hand_cuke.rb
formatter/slow_hand_cuke.rb
require 'cucumber/formatter/pretty' module Formatter class SlowHandCuke < Cucumber::Formatter::Pretty def before_step( step ) print_ansi_code 's' # save cursor position @io.printf "... #{step.name}" @io.flush end def before_step_result( *args ) print_ansi_code '1K' # clear current line print_ansi_code 'u' # move cursor back to start of line super end private def print_ansi_code(code) @io.printf "\033[#{code}" end end end
require 'cucumber/formatter/pretty' module Formatter class SlowHandCuke < Cucumber::Formatter::Pretty def before_step( step ) @io.printf "... #{step.name}" @io.flush end def before_step_result( *args ) @io.printf "\r" super end end end
Replace fancy-pants ansi codes with simple carriage-return (doh!)
Replace fancy-pants ansi codes with simple carriage-return (doh!)
Ruby
apache-2.0
irfanah/SlowHandCuke,moredip/SlowHandCuke
ruby
## Code Before: require 'cucumber/formatter/pretty' module Formatter class SlowHandCuke < Cucumber::Formatter::Pretty def before_step( step ) print_ansi_code 's' # save cursor position @io.printf "... #{step.name}" @io.flush end def before_step_result( *args ) print_ansi_code '1K' # clear current line print_ansi_code 'u' # move cursor back to start of line super end private def print_ansi_code(code) @io.printf "\033[#{code}" end end end ## Instruction: Replace fancy-pants ansi codes with simple carriage-return (doh!) ## Code After: require 'cucumber/formatter/pretty' module Formatter class SlowHandCuke < Cucumber::Formatter::Pretty def before_step( step ) @io.printf "... #{step.name}" @io.flush end def before_step_result( *args ) @io.printf "\r" super end end end
require 'cucumber/formatter/pretty' module Formatter class SlowHandCuke < Cucumber::Formatter::Pretty def before_step( step ) - print_ansi_code 's' # save cursor position @io.printf "... #{step.name}" @io.flush end def before_step_result( *args ) + @io.printf "\r" - print_ansi_code '1K' # clear current line - print_ansi_code 'u' # move cursor back to start of line super - end - - private - - def print_ansi_code(code) - @io.printf "\033[#{code}" end end end
10
0.454545
1
9
ac42a959aac8ac63f1290f44f0756afbdb8d1d95
lib/gym/xcodebuild_fixes/watchkit2_fix.rb
lib/gym/xcodebuild_fixes/watchkit2_fix.rb
module Gym class XcodebuildFixes class << self # Determine whether this app has WatchKit2 support and manually package up the WatchKit2 framework def watchkit2_fix return unless watchkit2? UI.verbose "Adding WatchKit2 support" Dir.mktmpdir do |tmpdir| # Make watchkit support directory watchkit_support = File.join(tmpdir, "WatchKitSupport2") Dir.mkdir(watchkit_support) # Copy WK from Xcode into WatchKitSupport2 FileUtils.copy_file("#{Xcode.xcode_path}/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK")) # Add "WatchKitSupport2" to the .ipa archive Dir.chdir(tmpdir) do abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null) end UI.verbose "Successfully added WatchKit2 support" end end # Does this application have a WatchKit target def watchkit2? Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path| `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.strip == 'watchos2.0' end end end end end
module Gym class XcodebuildFixes class << self # Determine whether this app has WatchKit2 support and manually package up the WatchKit2 framework def watchkit2_fix return unless watchkit2? UI.verbose "Adding WatchKit2 support" Dir.mktmpdir do |tmpdir| # Make watchkit support directory watchkit_support = File.join(tmpdir, "WatchKitSupport2") Dir.mkdir(watchkit_support) # Copy WK from Xcode into WatchKitSupport2 FileUtils.copy_file("#{Xcode.xcode_path}/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK")) # Add "WatchKitSupport2" to the .ipa archive Dir.chdir(tmpdir) do abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null) end UI.verbose "Successfully added WatchKit2 support" end end # Does this application have a WatchKit target def watchkit2? Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path| `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.match(/^\s*watchos2\.\d+\s*$/) end end end end end
Update `Gym::XcodebuildFixes::watchkit2?` to match watchos2.1
Update `Gym::XcodebuildFixes::watchkit2?` to match watchos2.1
Ruby
mit
hjanuschka/fastlane,ssmiech/fastlane,cpunion/fastlane,lacostej/fastlane,bassrock/fastlane,iMokhles/fastlane,manuyavuz/fastlane,brbulic/fastlane,milch/fastlane,rimarsh/fastlane,kndl/fastlane,cbowns/fastlane,hjanuschka/fastlane,ExtremeMan/fastlane,Liquidsoul/fastlane,luongm/fastlane,futuretap/fastlane,adellibovi/fastlane,ExtremeMan/fastlane,marcelofabri/fastlane,ssmiech/fastlane,ashfurrow/fastlane,soxjke/fastlane,icecrystal23/fastlane,SemenovAlexander/fastlane,iMokhles/fastlane,sylvek/fastlane,enozero/fastlane,mandrizzle/fastlane,Acorld/fastlane,allewun/fastlane,busce/fastlane,tommeier/fastlane,tcurdt/fastlane,marcelofabri/fastlane,neonichu/fastlane,KrauseFx/fastlane,dowjones/fastlane,orta/fastlane,mathiasAichinger/fastlane,matthewellis/fastlane,daveanderson/fastlane,fabiomassimo/fastlane,manuyavuz/fastlane,bgannin/fastlane,Acorld/fastlane,farkasseb/fastlane,danielbowden/fastlane,tommeier/fastlane,allewun/fastlane,manuyavuz/fastlane,fcy/fastlane,Fanagame/fastlane,Fanagame/fastlane,ashfurrow/fastlane,brbulic/fastlane,jorgeazevedo/fastlane,sinoru/fastlane,Econa77/fastlane,fastlane/fastlane,iMokhles/fastlane,bgannin/fastlane,rimarsh/fastlane,adamcohenrose/fastlane,dowjones/fastlane,danielbowden/fastlane,Liquidsoul/fastlane,fabiomassimo/fastlane,ffittschen/fastlane,NicholasFFox/fastlane,icecrystal23/fastlane,farkasseb/fastlane,tommeier/fastlane,KrauseFx/fastlane,sinoru/fastlane,fabiomassimo/fastlane,lyndsey-ferguson/fastlane,vronin/fastlane,SandyChapman/fastlane,dowjones/fastlane,Fanagame/fastlane,SiarheiFedartsou/fastlane,hjanuschka/fastlane,thelvis4/fastlane,luongm/fastlane,mgamer/fastlane,milch/fastlane,powtac/fastlane,cpunion/fastlane,neonichu/fastlane,jzallas/fastlane,cpk1/fastlane,smallmiro/fastlane,KrauseFx/fastlane,mathiasAichinger/fastlane,Econa77/fastlane,lyndsey-ferguson/fastlane,SiarheiFedartsou/fastlane,cpunion/fastlane,sschlein/fastlane,adamcohenrose/fastlane,ExtremeMan/fastlane,sinoru/fastlane,SiarheiFedartsou/fastlane,futuretap/fastlane,phatblat/fastlane,Liquidsoul/fastlane,iCell/fastlane,lmirosevic/fastlane,daveanderson/fastlane,bgerstle/fastlane,NicholasFFox/fastlane,adamcohenrose/fastlane,joshdholtz/fastlane,sschlein/fastlane,mgrebenets/fastlane,NicholasFFox/fastlane,jorgeazevedo/fastlane,thelvis4/fastlane,busce/fastlane,mbogh/fastlane,NicholasFFox/fastlane,orta/fastlane,farkasseb/fastlane,revile/fastlane,lyndsey-ferguson/fastlane,KrauseFx/fastlane,ssmiech/fastlane,mgrebenets/fastlane,ExtremeMan/fastlane,vronin/fastlane,milch/fastlane,carlosefonseca/fastlane,oronbz/fastlane,dowjones/fastlane,tommeier/fastlane,ssmiech/fastlane,adellibovi/fastlane,Acorld/fastlane,NicholasFFox/fastlane,mandrizzle/fastlane,enozero/fastlane,dral3x/fastlane,fulldecent/fastlane,mandrizzle/fastlane,st3fan/fastlane,rimarsh/fastlane,thasegaw/fastlane,iCell/fastlane,SandyChapman/fastlane,matthewellis/fastlane,milch/fastlane,tpalmer/fastlane,SemenovAlexander/fastlane,jaleksynas/fastlane,adellibovi/fastlane,nafu/fastlane,joshdholtz/fastlane,mathiasAichinger/fastlane,soxjke/fastlane,fcy/fastlane,bgannin/fastlane,revile/fastlane,phatblat/fastlane,dral3x/fastlane,fulldecent/fastlane,jeeftor/fastlane,luongm/fastlane,jzallas/fastlane,Liquidsoul/fastlane,taquitos/fastlane,smallmiro/fastlane,adellibovi/fastlane,joshrlesch/fastlane,marcelofabri/fastlane,ashfurrow/fastlane,tpalmer/fastlane,fabiomassimo/fastlane,dral3x/fastlane,carlosefonseca/fastlane,mathiasAichinger/fastlane,tcurdt/fastlane,enozero/fastlane,sschlein/fastlane,tcurdt/fastlane,jaleksynas/fastlane,tpalmer/fastlane,KrauseFx/fastlane,olegoid/fastlane,kndl/fastlane,tcurdt/fastlane,fcy/fastlane,revile/fastlane,nafu/fastlane,lyndsey-ferguson/fastlane,sylvek/fastlane,sylvek/fastlane,jaleksynas/fastlane,cpk1/fastlane,manuyavuz/fastlane,farkasseb/fastlane,tcurdt/fastlane,Sajjon/fastlane,sylvek/fastlane,futuretap/fastlane,carlosefonseca/fastlane,matthewellis/fastlane,ssmiech/fastlane,fastlane/fastlane,tpalmer/fastlane,jzallas/fastlane,jaleksynas/fastlane,Fanagame/fastlane,tmtrademarked/fastlane,farkasseb/fastlane,revile/fastlane,SiarheiFedartsou/fastlane,mbogh/fastlane,brbulic/fastlane,Sajjon/fastlane,ExtremeMan/fastlane,mgrebenets/fastlane,allewun/fastlane,oronbz/fastlane,keatongreve/fastlane,SemenovAlexander/fastlane,st3fan/fastlane,jfresen/fastlane,daveanderson/fastlane,icecrystal23/fastlane,farkasseb/fastlane,iCell/fastlane,adellibovi/fastlane,thelvis4/fastlane,cbowns/fastlane,rimarsh/fastlane,lmirosevic/fastlane,nafu/fastlane,sschlein/fastlane,hjanuschka/fastlane,joshdholtz/fastlane,fulldecent/fastlane,SiarheiFedartsou/fastlane,st3fan/fastlane,bassrock/fastlane,bolom/fastlane,dowjones/fastlane,thasegaw/fastlane,joshdholtz/fastlane,Fanagame/fastlane,powtac/fastlane,bassrock/fastlane,oronbz/fastlane,taquitos/fastlane,lacostej/fastlane,neonichu/fastlane,bassrock/fastlane,mgrebenets/fastlane,jeeftor/fastlane,fulldecent/fastlane,lacostej/fastlane,bgannin/fastlane,jfresen/fastlane,bolom/fastlane,phatblat/fastlane,cbowns/fastlane,bolom/fastlane,sschlein/fastlane,mgrebenets/fastlane,bolom/fastlane,bgannin/fastlane,joshrlesch/fastlane,carlosefonseca/fastlane,revile/fastlane,cpk1/fastlane,kazuhidet/fastlane,mgamer/fastlane,lmirosevic/fastlane,Sajjon/fastlane,olegoid/fastlane,lmirosevic/fastlane,ashfurrow/fastlane,jfresen/fastlane,fulldecent/fastlane,oysta/fastlane,kndl/fastlane,NicholasFFox/fastlane,enozero/fastlane,RishabhTayal/fastlane,adellibovi/fastlane,olegoid/fastlane,rimarsh/fastlane,taquitos/fastlane,fcy/fastlane,smallmiro/fastlane,carlosefonseca/fastlane,fcy/fastlane,manuyavuz/fastlane,smallmiro/fastlane,powtac/fastlane,mgamer/fastlane,jfresen/fastlane,oysta/fastlane,fabiomassimo/fastlane,mbogh/fastlane,mgrebenets/fastlane,kohtenko/fastlane,jzallas/fastlane,neonichu/fastlane,oysta/fastlane,tmtrademarked/fastlane,enozero/fastlane,danielbowden/fastlane,olegoid/fastlane,ssmiech/fastlane,farkasseb/fastlane,adamcohenrose/fastlane,revile/fastlane,taquitos/fastlane,st3fan/fastlane,matthewellis/fastlane,RishabhTayal/fastlane,jfresen/fastlane,cpk1/fastlane,phatblat/fastlane,futuretap/fastlane,Acorld/fastlane,iMokhles/fastlane,Fanagame/fastlane,iMokhles/fastlane,phatblat/fastlane,KrauseFx/fastlane,Liquidsoul/fastlane,tcurdt/fastlane,oysta/fastlane,lmirosevic/fastlane,fabiomassimo/fastlane,iCell/fastlane,fulldecent/fastlane,mbogh/fastlane,ashfurrow/fastlane,kazuhidet/fastlane,RishabhTayal/fastlane,SiarheiFedartsou/fastlane,jorgeazevedo/fastlane,lmirosevic/fastlane,taquitos/fastlane,soxjke/fastlane,luongm/fastlane,allewun/fastlane,thelvis4/fastlane,tpalmer/fastlane,fabiomassimo/fastlane,manuyavuz/fastlane,luongm/fastlane,lyndsey-ferguson/fastlane,marcelofabri/fastlane,jorgeazevedo/fastlane,daveanderson/fastlane,mbogh/fastlane,sylvek/fastlane,SandyChapman/fastlane,icecrystal23/fastlane,oronbz/fastlane,javibm/fastlane,ffittschen/fastlane,icecrystal23/fastlane,bolom/fastlane,iCell/fastlane,ffittschen/fastlane,vronin/fastlane,mathiasAichinger/fastlane,SiarheiFedartsou/fastlane,cpunion/fastlane,kazuhidet/fastlane,javibm/fastlane,oronbz/fastlane,daveanderson/fastlane,adamcohenrose/fastlane,jaleksynas/fastlane,matthewellis/fastlane,st3fan/fastlane,revile/fastlane,tmtrademarked/fastlane,oysta/fastlane,SemenovAlexander/fastlane,tcurdt/fastlane,allewun/fastlane,milch/fastlane,busce/fastlane,enozero/fastlane,nafu/fastlane,mbogh/fastlane,nafu/fastlane,joshdholtz/fastlane,javibm/fastlane,vronin/fastlane,lacostej/fastlane,bolom/fastlane,Econa77/fastlane,keatongreve/fastlane,keatongreve/fastlane,kazuhidet/fastlane,smallmiro/fastlane,bgerstle/fastlane,st3fan/fastlane,cpunion/fastlane,cpk1/fastlane,phatblat/fastlane,powtac/fastlane,nafu/fastlane,ashfurrow/fastlane,cpk1/fastlane,mandrizzle/fastlane,SemenovAlexander/fastlane,keatongreve/fastlane,sinoru/fastlane,lyndsey-ferguson/fastlane,rimarsh/fastlane,dral3x/fastlane,jeeftor/fastlane,powtac/fastlane,icecrystal23/fastlane,kndl/fastlane,brbulic/fastlane,dral3x/fastlane,sschlein/fastlane,futuretap/fastlane,SandyChapman/fastlane,tmtrademarked/fastlane,ffittschen/fastlane,soxjke/fastlane,sinoru/fastlane,javibm/fastlane,thasegaw/fastlane,neonichu/fastlane,vronin/fastlane,Liquidsoul/fastlane,kndl/fastlane,bolom/fastlane,mgamer/fastlane,soxjke/fastlane,fastlane/fastlane,KrauseFx/fastlane,luongm/fastlane,smallmiro/fastlane,ashfurrow/fastlane,Econa77/fastlane,tommeier/fastlane,taquitos/fastlane,fastlane/fastlane,allewun/fastlane,Fanagame/fastlane,joshdholtz/fastlane,busce/fastlane,ffittschen/fastlane,mgamer/fastlane,RishabhTayal/fastlane,adellibovi/fastlane,oronbz/fastlane,kazuhidet/fastlane,jfresen/fastlane,jaleksynas/fastlane,powtac/fastlane,carlosefonseca/fastlane,cpk1/fastlane,ExtremeMan/fastlane,neonichu/fastlane,RishabhTayal/fastlane,Econa77/fastlane,thelvis4/fastlane,phatblat/fastlane,jorgeazevedo/fastlane,allewun/fastlane,ssmiech/fastlane,fastlane/fastlane,brbulic/fastlane,futuretap/fastlane,jzallas/fastlane,Acorld/fastlane,thelvis4/fastlane,cpunion/fastlane,thasegaw/fastlane,keatongreve/fastlane,sinoru/fastlane,danielbowden/fastlane,iCell/fastlane,bassrock/fastlane,Liquidsoul/fastlane,enozero/fastlane,mgamer/fastlane,javibm/fastlane,sylvek/fastlane,neonichu/fastlane,marcelofabri/fastlane,mathiasAichinger/fastlane,kndl/fastlane,fulldecent/fastlane,fcy/fastlane,marcelofabri/fastlane,Econa77/fastlane,fastlane/fastlane,SandyChapman/fastlane,bgannin/fastlane,mathiasAichinger/fastlane,danielbowden/fastlane,mandrizzle/fastlane,lmirosevic/fastlane,fcy/fastlane,bassrock/fastlane,jorgeazevedo/fastlane,joshrlesch/fastlane,jeeftor/fastlane,tmtrademarked/fastlane,tmtrademarked/fastlane,keatongreve/fastlane,joshrlesch/fastlane,hjanuschka/fastlane,futuretap/fastlane,kohtenko/fastlane,rimarsh/fastlane,SemenovAlexander/fastlane,bgannin/fastlane,mgamer/fastlane,olegoid/fastlane,brbulic/fastlane,RishabhTayal/fastlane,daveanderson/fastlane,daveanderson/fastlane,Sajjon/fastlane,adamcohenrose/fastlane,mbogh/fastlane,iMokhles/fastlane,sschlein/fastlane,jfresen/fastlane,mandrizzle/fastlane,powtac/fastlane,dowjones/fastlane,tommeier/fastlane,SandyChapman/fastlane,dral3x/fastlane,SandyChapman/fastlane,oysta/fastlane,luongm/fastlane,thasegaw/fastlane,busce/fastlane,matthewellis/fastlane,Sajjon/fastlane,oronbz/fastlane,thasegaw/fastlane,ffittschen/fastlane,lyndsey-ferguson/fastlane,tmtrademarked/fastlane,kndl/fastlane,nafu/fastlane,jeeftor/fastlane,danielbowden/fastlane,hjanuschka/fastlane,RishabhTayal/fastlane,mgrebenets/fastlane,vronin/fastlane,milch/fastlane,jorgeazevedo/fastlane,mandrizzle/fastlane,joshrlesch/fastlane,NicholasFFox/fastlane,kazuhidet/fastlane,sylvek/fastlane,jaleksynas/fastlane,brbulic/fastlane,SemenovAlexander/fastlane,ExtremeMan/fastlane,tommeier/fastlane,st3fan/fastlane,busce/fastlane,joshrlesch/fastlane,javibm/fastlane,keatongreve/fastlane,cbowns/fastlane,Sajjon/fastlane,kazuhidet/fastlane,milch/fastlane,jzallas/fastlane,cbowns/fastlane,thelvis4/fastlane,sinoru/fastlane,vronin/fastlane,thasegaw/fastlane,jzallas/fastlane,cpunion/fastlane,marcelofabri/fastlane,Econa77/fastlane,carlosefonseca/fastlane,iMokhles/fastlane,matthewellis/fastlane,dral3x/fastlane,javibm/fastlane,adamcohenrose/fastlane,joshrlesch/fastlane,jeeftor/fastlane,tpalmer/fastlane,busce/fastlane,soxjke/fastlane,Acorld/fastlane,jeeftor/fastlane,lacostej/fastlane,hjanuschka/fastlane,Acorld/fastlane,cbowns/fastlane,iCell/fastlane,taquitos/fastlane,joshdholtz/fastlane,cbowns/fastlane,manuyavuz/fastlane,ffittschen/fastlane,tpalmer/fastlane,lacostej/fastlane,smallmiro/fastlane,soxjke/fastlane,danielbowden/fastlane,dowjones/fastlane,Sajjon/fastlane,olegoid/fastlane,olegoid/fastlane,oysta/fastlane
ruby
## Code Before: module Gym class XcodebuildFixes class << self # Determine whether this app has WatchKit2 support and manually package up the WatchKit2 framework def watchkit2_fix return unless watchkit2? UI.verbose "Adding WatchKit2 support" Dir.mktmpdir do |tmpdir| # Make watchkit support directory watchkit_support = File.join(tmpdir, "WatchKitSupport2") Dir.mkdir(watchkit_support) # Copy WK from Xcode into WatchKitSupport2 FileUtils.copy_file("#{Xcode.xcode_path}/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK")) # Add "WatchKitSupport2" to the .ipa archive Dir.chdir(tmpdir) do abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null) end UI.verbose "Successfully added WatchKit2 support" end end # Does this application have a WatchKit target def watchkit2? Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path| `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.strip == 'watchos2.0' end end end end end ## Instruction: Update `Gym::XcodebuildFixes::watchkit2?` to match watchos2.1 ## Code After: module Gym class XcodebuildFixes class << self # Determine whether this app has WatchKit2 support and manually package up the WatchKit2 framework def watchkit2_fix return unless watchkit2? UI.verbose "Adding WatchKit2 support" Dir.mktmpdir do |tmpdir| # Make watchkit support directory watchkit_support = File.join(tmpdir, "WatchKitSupport2") Dir.mkdir(watchkit_support) # Copy WK from Xcode into WatchKitSupport2 FileUtils.copy_file("#{Xcode.xcode_path}/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK")) # Add "WatchKitSupport2" to the .ipa archive Dir.chdir(tmpdir) do abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null) end UI.verbose "Successfully added WatchKit2 support" end end # Does this application have a WatchKit target def watchkit2? Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path| `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.match(/^\s*watchos2\.\d+\s*$/) end end end end end
module Gym class XcodebuildFixes class << self # Determine whether this app has WatchKit2 support and manually package up the WatchKit2 framework def watchkit2_fix return unless watchkit2? UI.verbose "Adding WatchKit2 support" Dir.mktmpdir do |tmpdir| # Make watchkit support directory watchkit_support = File.join(tmpdir, "WatchKitSupport2") Dir.mkdir(watchkit_support) # Copy WK from Xcode into WatchKitSupport2 FileUtils.copy_file("#{Xcode.xcode_path}/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK")) # Add "WatchKitSupport2" to the .ipa archive Dir.chdir(tmpdir) do abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null) end UI.verbose "Successfully added WatchKit2 support" end end # Does this application have a WatchKit target def watchkit2? Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path| - `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.strip == 'watchos2.0' ? ^^^^^^^^^ ^^ + `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.match(/^\s*watchos2\.\d+\s*$/) ? +++++++++ ^ + ^^^^^^^^^ end end end end end
2
0.057143
1
1
44db4d8ea4d28b68b6bbdf1e8edaaf40fad3cc9c
portaudio_sys/build.rs
portaudio_sys/build.rs
extern crate pkg_config; fn main() { match pkg_config::find_library("portaudio-2.0") { Ok(..) => {}, Err(e) => println!("Cloud not find pkg-config ({})", e), } }
extern crate pkg_config; fn main() { match pkg_config::find_library("portaudio-2.0") { Ok(..) => {}, Err(e) => panic!("{}", e), } }
Revert "Do not require pkgconfig to succeed"
Revert "Do not require pkgconfig to succeed" This reverts commit 221e7419ea09f8bbf7922e1860dcff625f899f44.
Rust
mit
mvdnes/portaudio-rs
rust
## Code Before: extern crate pkg_config; fn main() { match pkg_config::find_library("portaudio-2.0") { Ok(..) => {}, Err(e) => println!("Cloud not find pkg-config ({})", e), } } ## Instruction: Revert "Do not require pkgconfig to succeed" This reverts commit 221e7419ea09f8bbf7922e1860dcff625f899f44. ## Code After: extern crate pkg_config; fn main() { match pkg_config::find_library("portaudio-2.0") { Ok(..) => {}, Err(e) => panic!("{}", e), } }
extern crate pkg_config; fn main() { match pkg_config::find_library("portaudio-2.0") { Ok(..) => {}, - Err(e) => println!("Cloud not find pkg-config ({})", e), + Err(e) => panic!("{}", e), } }
2
0.2
1
1
7f691212fd0bc59bf4c70766e2602d199e12ee7a
README.md
README.md
EHRP is simple middleware for express - it allow you to send a nice page for http error (404, 500, ...)
EHRP is simple middleware for express, it allow you to send a nice page for http error (404, 500, ...) To do so, EHRP give you two way of working. ## Todo Like you can see, this package is work in progress. In a recent futur, i will : * Add a more complete list of http-error * Add a way to customize the rendered page * Add a language support ## Basic usage You can pass EHRP method as **routes** definition ``` const app = require('express')() const ehrp = require('express-http-response-pages') app.get('/', (req, res) => { ... }) // Return the Not Found page on unused routes app.use('*', ehrp.notFound) app.listen(3000) ``` ## Advanced usage You can also use the EHRP as a **middleware**. This allow you to trigger the render of an http-error page. ``` app.use(ehrp.middleware) app.get('/', (req, res) => { doSomething() .then( data => { res.render('home') }) .catch(e => { res.internalError() }) }) ``` ### Disclaimer English is not my first language, if you see a typo or any mistake, do a **PR**. If you see something bad in my code, just contact me! I love improving my **javascript** Don't hesitate to contribute as well if you have a great idea for this package.
Add a bit of documentation
Add a bit of documentation
Markdown
mit
dimitri-gigot/express-http-response-pages
markdown
## Code Before: EHRP is simple middleware for express - it allow you to send a nice page for http error (404, 500, ...) ## Instruction: Add a bit of documentation ## Code After: EHRP is simple middleware for express, it allow you to send a nice page for http error (404, 500, ...) To do so, EHRP give you two way of working. ## Todo Like you can see, this package is work in progress. In a recent futur, i will : * Add a more complete list of http-error * Add a way to customize the rendered page * Add a language support ## Basic usage You can pass EHRP method as **routes** definition ``` const app = require('express')() const ehrp = require('express-http-response-pages') app.get('/', (req, res) => { ... }) // Return the Not Found page on unused routes app.use('*', ehrp.notFound) app.listen(3000) ``` ## Advanced usage You can also use the EHRP as a **middleware**. This allow you to trigger the render of an http-error page. ``` app.use(ehrp.middleware) app.get('/', (req, res) => { doSomething() .then( data => { res.render('home') }) .catch(e => { res.internalError() }) }) ``` ### Disclaimer English is not my first language, if you see a typo or any mistake, do a **PR**. If you see something bad in my code, just contact me! I love improving my **javascript** Don't hesitate to contribute as well if you have a great idea for this package.
- EHRP is simple middleware for express - it allow you to send a nice page for http error (404, 500, ...) ? ^^ + EHRP is simple middleware for express, it allow you to send a nice page for http error (404, 500, ...) ? ^ + + + To do so, EHRP give you two way of working. + + ## Todo + Like you can see, this package is work in progress. + In a recent futur, i will : + + * Add a more complete list of http-error + * Add a way to customize the rendered page + * Add a language support + + + ## Basic usage + You can pass EHRP method as **routes** definition + + ``` + const app = require('express')() + const ehrp = require('express-http-response-pages') + + app.get('/', (req, res) => { ... }) + + // Return the Not Found page on unused routes + app.use('*', ehrp.notFound) + + app.listen(3000) + ``` + + ## Advanced usage + You can also use the EHRP as a **middleware**. + + This allow you to trigger the render of an http-error page. + + ``` + app.use(ehrp.middleware) + + app.get('/', (req, res) => { + doSomething() + .then( data => { + res.render('home') + }) + .catch(e => { + res.internalError() + }) + }) + ``` + + + ### Disclaimer + English is not my first language, if you see a typo or any mistake, do a **PR**. + + If you see something bad in my code, just contact me! I love improving my **javascript** + + Don't hesitate to contribute as well if you have a great idea for this package. +
57
57
56
1
6d6bc5794affb243894bb608f8216b0808a03e6c
README.md
README.md
A neuroimaging module for dynamic functional connectivity. Solely built on [NumPy](http://www.numpy.org/), [SciPy](http://www.scipy.org/), [matplotlib](http://matplotlib.org/) and [networkx](https://networkx.github.io/) [![Build Status](https://travis-ci.org/makism/dyfunconn.svg?branch=master)](https://travis-ci.org/makism/dyfunconn) [![Coverage Status](https://coveralls.io/repos/github/makism/dyfunconn/badge.svg?branch=)](https://coveralls.io/github/makism/dyfunconn?branch=) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/70dff7603f5849f79e703f852d1b5ae3)](https://www.codacy.com/app/makism/dyfunconn?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=makism/dyfunconn&amp;utm_campaign=Badge_Grade) [![Documentation Status](https://readthedocs.org/projects/dyfunconn/badge/?version=latest)](http://dyfunconn.readthedocs.io/en/latest/?badge=latest) [![Licence](https://img.shields.io/badge/Licence-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
A neuroimaging module for dynamic functional connectivity. Solely built on [NumPy](http://www.numpy.org/), [SciPy](http://www.scipy.org/), [matplotlib](http://matplotlib.org/) and [networkx](https://networkx.github.io/) * [![poster presented @ 13th International Conference for Cognitive Neuroscience in Amsterdam (ICON2017)](https://f1000research.com/posters/6-1638)](https://f1000research.com/posters/6-1638) [![Build Status](https://travis-ci.org/makism/dyfunconn.svg?branch=master)](https://travis-ci.org/makism/dyfunconn) [![Coverage Status](https://coveralls.io/repos/github/makism/dyfunconn/badge.svg?branch=)](https://coveralls.io/github/makism/dyfunconn?branch=) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/70dff7603f5849f79e703f852d1b5ae3)](https://www.codacy.com/app/makism/dyfunconn?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=makism/dyfunconn&amp;utm_campaign=Badge_Grade) [![Documentation Status](https://readthedocs.org/projects/dyfunconn/badge/?version=latest)](http://dyfunconn.readthedocs.io/en/latest/?badge=latest) [![Licence](https://img.shields.io/badge/Licence-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
Add poster link to f1000research.com
Add poster link to f1000research.com
Markdown
bsd-3-clause
makism/dyfunconn
markdown
## Code Before: A neuroimaging module for dynamic functional connectivity. Solely built on [NumPy](http://www.numpy.org/), [SciPy](http://www.scipy.org/), [matplotlib](http://matplotlib.org/) and [networkx](https://networkx.github.io/) [![Build Status](https://travis-ci.org/makism/dyfunconn.svg?branch=master)](https://travis-ci.org/makism/dyfunconn) [![Coverage Status](https://coveralls.io/repos/github/makism/dyfunconn/badge.svg?branch=)](https://coveralls.io/github/makism/dyfunconn?branch=) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/70dff7603f5849f79e703f852d1b5ae3)](https://www.codacy.com/app/makism/dyfunconn?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=makism/dyfunconn&amp;utm_campaign=Badge_Grade) [![Documentation Status](https://readthedocs.org/projects/dyfunconn/badge/?version=latest)](http://dyfunconn.readthedocs.io/en/latest/?badge=latest) [![Licence](https://img.shields.io/badge/Licence-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) ## Instruction: Add poster link to f1000research.com ## Code After: A neuroimaging module for dynamic functional connectivity. Solely built on [NumPy](http://www.numpy.org/), [SciPy](http://www.scipy.org/), [matplotlib](http://matplotlib.org/) and [networkx](https://networkx.github.io/) * [![poster presented @ 13th International Conference for Cognitive Neuroscience in Amsterdam (ICON2017)](https://f1000research.com/posters/6-1638)](https://f1000research.com/posters/6-1638) [![Build Status](https://travis-ci.org/makism/dyfunconn.svg?branch=master)](https://travis-ci.org/makism/dyfunconn) [![Coverage Status](https://coveralls.io/repos/github/makism/dyfunconn/badge.svg?branch=)](https://coveralls.io/github/makism/dyfunconn?branch=) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/70dff7603f5849f79e703f852d1b5ae3)](https://www.codacy.com/app/makism/dyfunconn?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=makism/dyfunconn&amp;utm_campaign=Badge_Grade) [![Documentation Status](https://readthedocs.org/projects/dyfunconn/badge/?version=latest)](http://dyfunconn.readthedocs.io/en/latest/?badge=latest) [![Licence](https://img.shields.io/badge/Licence-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
A neuroimaging module for dynamic functional connectivity. Solely built on [NumPy](http://www.numpy.org/), [SciPy](http://www.scipy.org/), [matplotlib](http://matplotlib.org/) and [networkx](https://networkx.github.io/) + * [![poster presented @ 13th International Conference for Cognitive Neuroscience in Amsterdam (ICON2017)](https://f1000research.com/posters/6-1638)](https://f1000research.com/posters/6-1638) + [![Build Status](https://travis-ci.org/makism/dyfunconn.svg?branch=master)](https://travis-ci.org/makism/dyfunconn) [![Coverage Status](https://coveralls.io/repos/github/makism/dyfunconn/badge.svg?branch=)](https://coveralls.io/github/makism/dyfunconn?branch=) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/70dff7603f5849f79e703f852d1b5ae3)](https://www.codacy.com/app/makism/dyfunconn?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=makism/dyfunconn&amp;utm_campaign=Badge_Grade) [![Documentation Status](https://readthedocs.org/projects/dyfunconn/badge/?version=latest)](http://dyfunconn.readthedocs.io/en/latest/?badge=latest) [![Licence](https://img.shields.io/badge/Licence-BSD-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
2
0.4
2
0
cfdfe21f8c8778ab3d02f0172758a17d16a0adc8
src/renderer/components/confim-modal.jsx
src/renderer/components/confim-modal.jsx
import React, { Component, PropTypes } from 'react'; export default class ServerModalForm extends Component { static propTypes = { onCancelClick: PropTypes.func.isRequired, onRemoveClick: PropTypes.func.isRequired, title: PropTypes.string.isRequired, message: PropTypes.string.isRequired, context: PropTypes.string.isRequired, } componentDidMount() { $(this.refs.confirmModal).modal({ closable: false, detachable: false, allowMultiple: true, context: this.props.context, onDeny: () => { this.props.onCancelClick(); return true; }, onApprove: () => { this.props.onRemoveClick(); return false; }, }).modal('show'); } componentWillReceiveProps(nextProps) { this.setState({ error: nextProps.error }); } componentWillUnmount() { $(this.refs.confirmModal).modal('hide'); } render() { const { title, message } = this.props; return ( <div className="ui modal" ref="confirmModal"> <div className="header"> {title} </div> <div className="content"> {message} </div> <div className="actions"> <div className="small ui black deny right labeled icon button" tabIndex="0"> No <i className="ban icon"></i> </div> <div className="small ui positive right labeled icon button" tabIndex="0"> Yes <i className="checkmark icon"></i> </div> </div> </div> ); } }
import React, { Component, PropTypes } from 'react'; export default class ServerModalForm extends Component { static propTypes = { onCancelClick: PropTypes.func.isRequired, onRemoveClick: PropTypes.func.isRequired, title: PropTypes.string.isRequired, message: PropTypes.string.isRequired, context: PropTypes.string.isRequired, } componentDidMount() { $(this.refs.confirmModal).modal({ closable: false, detachable: false, allowMultiple: true, context: this.props.context, onDeny: () => { this.props.onCancelClick(); return true; }, onApprove: () => { this.props.onRemoveClick(); return false; }, }).modal('show'); } componentWillReceiveProps(nextProps) { this.setState({ error: nextProps.error }); } componentWillUnmount() { $(this.refs.confirmModal).modal('hide'); } render() { const { title, message } = this.props; return ( <div className="ui modal" ref="confirmModal" style={{position: 'absolute'}}> <div className="header"> {title} </div> <div className="content"> {message} </div> <div className="actions"> <div className="small ui black deny right labeled icon button" tabIndex="0"> No <i className="ban icon"></i> </div> <div className="small ui positive right labeled icon button" tabIndex="0"> Yes <i className="checkmark icon"></i> </div> </div> </div> ); } }
Add CSS hack for confirm modal stay at the top of the parent modal
Add CSS hack for confirm modal stay at the top of the parent modal
JSX
mit
sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui
jsx
## Code Before: import React, { Component, PropTypes } from 'react'; export default class ServerModalForm extends Component { static propTypes = { onCancelClick: PropTypes.func.isRequired, onRemoveClick: PropTypes.func.isRequired, title: PropTypes.string.isRequired, message: PropTypes.string.isRequired, context: PropTypes.string.isRequired, } componentDidMount() { $(this.refs.confirmModal).modal({ closable: false, detachable: false, allowMultiple: true, context: this.props.context, onDeny: () => { this.props.onCancelClick(); return true; }, onApprove: () => { this.props.onRemoveClick(); return false; }, }).modal('show'); } componentWillReceiveProps(nextProps) { this.setState({ error: nextProps.error }); } componentWillUnmount() { $(this.refs.confirmModal).modal('hide'); } render() { const { title, message } = this.props; return ( <div className="ui modal" ref="confirmModal"> <div className="header"> {title} </div> <div className="content"> {message} </div> <div className="actions"> <div className="small ui black deny right labeled icon button" tabIndex="0"> No <i className="ban icon"></i> </div> <div className="small ui positive right labeled icon button" tabIndex="0"> Yes <i className="checkmark icon"></i> </div> </div> </div> ); } } ## Instruction: Add CSS hack for confirm modal stay at the top of the parent modal ## Code After: import React, { Component, PropTypes } from 'react'; export default class ServerModalForm extends Component { static propTypes = { onCancelClick: PropTypes.func.isRequired, onRemoveClick: PropTypes.func.isRequired, title: PropTypes.string.isRequired, message: PropTypes.string.isRequired, context: PropTypes.string.isRequired, } componentDidMount() { $(this.refs.confirmModal).modal({ closable: false, detachable: false, allowMultiple: true, context: this.props.context, onDeny: () => { this.props.onCancelClick(); return true; }, onApprove: () => { this.props.onRemoveClick(); return false; }, }).modal('show'); } componentWillReceiveProps(nextProps) { this.setState({ error: nextProps.error }); } componentWillUnmount() { $(this.refs.confirmModal).modal('hide'); } render() { const { title, message } = this.props; return ( <div className="ui modal" ref="confirmModal" style={{position: 'absolute'}}> <div className="header"> {title} </div> <div className="content"> {message} </div> <div className="actions"> <div className="small ui black deny right labeled icon button" tabIndex="0"> No <i className="ban icon"></i> </div> <div className="small ui positive right labeled icon button" tabIndex="0"> Yes <i className="checkmark icon"></i> </div> </div> </div> ); } }
import React, { Component, PropTypes } from 'react'; export default class ServerModalForm extends Component { static propTypes = { onCancelClick: PropTypes.func.isRequired, onRemoveClick: PropTypes.func.isRequired, title: PropTypes.string.isRequired, message: PropTypes.string.isRequired, context: PropTypes.string.isRequired, } componentDidMount() { $(this.refs.confirmModal).modal({ closable: false, detachable: false, allowMultiple: true, context: this.props.context, onDeny: () => { this.props.onCancelClick(); return true; }, onApprove: () => { this.props.onRemoveClick(); return false; }, }).modal('show'); } componentWillReceiveProps(nextProps) { this.setState({ error: nextProps.error }); } componentWillUnmount() { $(this.refs.confirmModal).modal('hide'); } render() { const { title, message } = this.props; return ( - <div className="ui modal" ref="confirmModal"> + <div className="ui modal" ref="confirmModal" style={{position: 'absolute'}}> ? +++++++++++++++++++++++++++++++ <div className="header"> {title} </div> <div className="content"> {message} </div> <div className="actions"> <div className="small ui black deny right labeled icon button" tabIndex="0"> No <i className="ban icon"></i> </div> <div className="small ui positive right labeled icon button" tabIndex="0"> Yes <i className="checkmark icon"></i> </div> </div> </div> ); } }
2
0.032258
1
1
6dcc00ea35ad12a2947e404857f19a936174032f
gulp/bundle.js
gulp/bundle.js
const gulp = require('gulp'); const del = require('del'); const paths = require('vinyl-paths'); const rev = require('gulp-rev'); const through = require('through2'); const concat = require('gulp-concat-util'); const concatCss = require('gulp-concat-css'); const rename = require('gulp-rename'); const cleanCSS = require('gulp-clean-css'); const { addToManifest } = require('./revision'); gulp.task('clean-bundle', () => gulp.src('./www/js/bundle*').pipe(paths(del))); gulp.task('bundle-js', () => gulp .src([ './node_modules/blockly/blockly_compressed.js', './node_modules/blockly/blocks_compressed.js', './node_modules/blockly/javascript_compressed.js', './node_modules/blockly/msg/messages.js', ]) .pipe(concat('bundle.js')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/js/')) ); gulp.task('bundle-css', () => gulp .src(['node_modules/{bootstrap/dist/css/bootstrap.min,jquery-ui-css/jquery-ui.min}.css']) .pipe(concatCss('bundle.css')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/css')) );
const gulp = require('gulp'); const del = require('del'); const paths = require('vinyl-paths'); const rev = require('gulp-rev'); const through = require('through2'); const concat = require('gulp-concat-util'); const concatCss = require('gulp-concat-css'); const rename = require('gulp-rename'); const cleanCSS = require('gulp-clean-css'); const { addToManifest } = require('./revision'); gulp.task('clean-bundle', () => gulp.src('./www/js/bundle*').pipe(paths(del))); gulp.task('bundle-js', () => gulp .src([ './node_modules/blockly/blockly_compressed.js', './node_modules/blockly/blocks_compressed.js', './node_modules/blockly/javascript_compressed.js', './node_modules/blockly/msg/messages.js', ]) .pipe(concat('bundle.js')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/js/')) ); gulp.task('bundle-css', () => gulp .src(['node_modules/jquery-ui-css/jquery-ui.min.css']) .pipe(concatCss('bundle.css')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/css')) );
Remove bootstrap css from bundling
Remove bootstrap css from bundling
JavaScript
mit
binary-com/binary-bot,aminmarashi/binary-bot,aminmarashi/binary-bot,binary-com/binary-bot
javascript
## Code Before: const gulp = require('gulp'); const del = require('del'); const paths = require('vinyl-paths'); const rev = require('gulp-rev'); const through = require('through2'); const concat = require('gulp-concat-util'); const concatCss = require('gulp-concat-css'); const rename = require('gulp-rename'); const cleanCSS = require('gulp-clean-css'); const { addToManifest } = require('./revision'); gulp.task('clean-bundle', () => gulp.src('./www/js/bundle*').pipe(paths(del))); gulp.task('bundle-js', () => gulp .src([ './node_modules/blockly/blockly_compressed.js', './node_modules/blockly/blocks_compressed.js', './node_modules/blockly/javascript_compressed.js', './node_modules/blockly/msg/messages.js', ]) .pipe(concat('bundle.js')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/js/')) ); gulp.task('bundle-css', () => gulp .src(['node_modules/{bootstrap/dist/css/bootstrap.min,jquery-ui-css/jquery-ui.min}.css']) .pipe(concatCss('bundle.css')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/css')) ); ## Instruction: Remove bootstrap css from bundling ## Code After: const gulp = require('gulp'); const del = require('del'); const paths = require('vinyl-paths'); const rev = require('gulp-rev'); const through = require('through2'); const concat = require('gulp-concat-util'); const concatCss = require('gulp-concat-css'); const rename = require('gulp-rename'); const cleanCSS = require('gulp-clean-css'); const { addToManifest } = require('./revision'); gulp.task('clean-bundle', () => gulp.src('./www/js/bundle*').pipe(paths(del))); gulp.task('bundle-js', () => gulp .src([ './node_modules/blockly/blockly_compressed.js', './node_modules/blockly/blocks_compressed.js', './node_modules/blockly/javascript_compressed.js', './node_modules/blockly/msg/messages.js', ]) .pipe(concat('bundle.js')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/js/')) ); gulp.task('bundle-css', () => gulp .src(['node_modules/jquery-ui-css/jquery-ui.min.css']) .pipe(concatCss('bundle.css')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/css')) );
const gulp = require('gulp'); const del = require('del'); const paths = require('vinyl-paths'); const rev = require('gulp-rev'); const through = require('through2'); const concat = require('gulp-concat-util'); const concatCss = require('gulp-concat-css'); const rename = require('gulp-rename'); const cleanCSS = require('gulp-clean-css'); const { addToManifest } = require('./revision'); gulp.task('clean-bundle', () => gulp.src('./www/js/bundle*').pipe(paths(del))); gulp.task('bundle-js', () => gulp .src([ './node_modules/blockly/blockly_compressed.js', './node_modules/blockly/blocks_compressed.js', './node_modules/blockly/javascript_compressed.js', './node_modules/blockly/msg/messages.js', ]) .pipe(concat('bundle.js')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/js/')) ); gulp.task('bundle-css', () => gulp - .src(['node_modules/{bootstrap/dist/css/bootstrap.min,jquery-ui-css/jquery-ui.min}.css']) ? ---------------------------------- - + .src(['node_modules/jquery-ui-css/jquery-ui.min.css']) .pipe(concatCss('bundle.css')) .pipe(rev()) .pipe(through.obj(addToManifest)) .pipe(gulp.dest('www/css')) );
2
0.057143
1
1
c1e5c98995898148396d5a3d19cd6f390aa681de
is_irred.py
is_irred.py
import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
Add rational root test stub
Add rational root test stub
Python
mit
richardmillson/galois
python
## Code Before: import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly)))) ## Instruction: Add rational root test stub ## Code After: from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
+ from fractions import Fraction import numpy + + + def is_prime(num): + """ + return True if num is a prime + :param num: int + :return: Bool + """ + return True + + + def rational_root(poly): + """ + rational root test + :param poly: numpy.polynomial.polynomial + :return: Bool + """ + return True def eisenstein(poly, p): """ - returns true if poly is irreducible by Eisenstein's sufficient condition: ? ^ + returns True if poly is irreducible by Eisenstein's sufficient condition: ? ^ p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term - note that if Eisenstein's condition is not met, ie returns false, ? ^ + note that if Eisenstein's condition is not met, ie returns False, ? ^ this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ - return all(poly[0] % p != 0, + return all(is_prime(p), + poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
26
1.3
23
3
b5d2ba98098aa5e1fa9512cff3f6b4b13974fd91
README.rdoc
README.rdoc
= MaskableAttribute This project rocks and uses MIT-LICENSE.
= MaskableAttribute This project rocks^H^H^H^H sucks and uses MIT-LICENSE. Steps to test: 1. <tt>cd test/dummy</tt> 2. <tt>rake db:migrate</tt> 3. <tt>rake db:test:clone</tt> 4. <tt>cd -</tt> 5. <tt>rake test</tt>
Add Setup Instructions for Testing
Add Setup Instructions for Testing
RDoc
mit
billy-ran-away/maskable_attribute,billy-ran-away/maskable_attribute
rdoc
## Code Before: = MaskableAttribute This project rocks and uses MIT-LICENSE. ## Instruction: Add Setup Instructions for Testing ## Code After: = MaskableAttribute This project rocks^H^H^H^H sucks and uses MIT-LICENSE. Steps to test: 1. <tt>cd test/dummy</tt> 2. <tt>rake db:migrate</tt> 3. <tt>rake db:test:clone</tt> 4. <tt>cd -</tt> 5. <tt>rake test</tt>
= MaskableAttribute - This project rocks and uses MIT-LICENSE. + This project rocks^H^H^H^H sucks and uses MIT-LICENSE. ? ++++++++++++++ + + Steps to test: + 1. <tt>cd test/dummy</tt> + 2. <tt>rake db:migrate</tt> + 3. <tt>rake db:test:clone</tt> + 4. <tt>cd -</tt> + 5. <tt>rake test</tt>
9
3
8
1
1f1c2bb2622883fa9bc1653611380742bf72e694
helpers/parseosxdefaults.sh
helpers/parseosxdefaults.sh
print_defaultswrite_for() { while read line; do if [[ $line == "{" || $line == "}" ]]; then continue fi # the construction below may be kind-a vague but it does the following: # 1. tr '=' ' ' <<< $line replaces each '=' to a space in $line # 2. This is wrapped in $(), which outputs the outcome of tr ran in a subshell # 3. This is wrapped in (), which turns it into an array, items separated by space KEYVAL=($(tr '=' ' ' <<< $line)) KEY=${KEYVAL[0]} VAL=${KEYVAL[1]//;} if [[ $2 == "override" ]]; then echo "\"$KEY\" = $VAL;" else echo "defaults write $DOMAIN \"$KEY\" '$VAL'" fi done <<< "$1" } print_line() { echo "=========================================================================" } if [ -z "$1" ]; then echo "Provide default to read" 1>&2 exit 1; fi DOMAIN=$1 READ="$(defaults read $1)" if [ -z "$2" ]; then echo "Printing write commands in no-override mode:" print_line print_defaultswrite_for "${READ}" print_line exit 0; fi # override mode echo "Printing write commands in no-override mode:" print_line echo "defaults write $DOMAIN '{ " print_defaultswrite_for "${READ}" "override" echo " }'" print_line
if [ -z "$1" ]; then echo "Provide default to read" 1>&2 exit 1; fi DOMAIN=$1 READ="$(defaults read $DOMAIN)" function print_defaultswrite_for() { while read line; do if [[ $line == "{" || $line == "}" ]]; then continue fi # the construction below may be kind-a vague but it does the following: # 1. tr '=' ' ' <<< $line replaces each '=' to a space in $line # 2. This is wrapped in $(), which outputs the outcome of tr ran in a subshell # 3. This is wrapped in (), which turns it into an array, items separated by space KEYVAL=($(tr '=' ' ' <<< $line)) KEY=${KEYVAL[0]} VAL=${KEYVAL[1]//;} if [[ $2 == "override" ]]; then echo "\"$KEY\" = $VAL;" else echo "defaults write $DOMAIN \"$KEY\" '$VAL'" fi done <<< "$1" } function print_line() { echo "=========================================================================" } if [ -z "$2" ]; then echo "Printing write commands in no-override mode:" print_line print_defaultswrite_for "${READ}" print_line exit 0; else echo "Printing write commands in override mode:" print_line echo "defaults write $DOMAIN '{ " print_defaultswrite_for "${READ}" "override" echo " }'" print_line fi
Change parseOSXDefaults structure to make it more readable
Change parseOSXDefaults structure to make it more readable
Shell
mit
thabemmz/dotfiles
shell
## Code Before: print_defaultswrite_for() { while read line; do if [[ $line == "{" || $line == "}" ]]; then continue fi # the construction below may be kind-a vague but it does the following: # 1. tr '=' ' ' <<< $line replaces each '=' to a space in $line # 2. This is wrapped in $(), which outputs the outcome of tr ran in a subshell # 3. This is wrapped in (), which turns it into an array, items separated by space KEYVAL=($(tr '=' ' ' <<< $line)) KEY=${KEYVAL[0]} VAL=${KEYVAL[1]//;} if [[ $2 == "override" ]]; then echo "\"$KEY\" = $VAL;" else echo "defaults write $DOMAIN \"$KEY\" '$VAL'" fi done <<< "$1" } print_line() { echo "=========================================================================" } if [ -z "$1" ]; then echo "Provide default to read" 1>&2 exit 1; fi DOMAIN=$1 READ="$(defaults read $1)" if [ -z "$2" ]; then echo "Printing write commands in no-override mode:" print_line print_defaultswrite_for "${READ}" print_line exit 0; fi # override mode echo "Printing write commands in no-override mode:" print_line echo "defaults write $DOMAIN '{ " print_defaultswrite_for "${READ}" "override" echo " }'" print_line ## Instruction: Change parseOSXDefaults structure to make it more readable ## Code After: if [ -z "$1" ]; then echo "Provide default to read" 1>&2 exit 1; fi DOMAIN=$1 READ="$(defaults read $DOMAIN)" function print_defaultswrite_for() { while read line; do if [[ $line == "{" || $line == "}" ]]; then continue fi # the construction below may be kind-a vague but it does the following: # 1. tr '=' ' ' <<< $line replaces each '=' to a space in $line # 2. This is wrapped in $(), which outputs the outcome of tr ran in a subshell # 3. This is wrapped in (), which turns it into an array, items separated by space KEYVAL=($(tr '=' ' ' <<< $line)) KEY=${KEYVAL[0]} VAL=${KEYVAL[1]//;} if [[ $2 == "override" ]]; then echo "\"$KEY\" = $VAL;" else echo "defaults write $DOMAIN \"$KEY\" '$VAL'" fi done <<< "$1" } function print_line() { echo "=========================================================================" } if [ -z "$2" ]; then echo "Printing write commands in no-override mode:" print_line print_defaultswrite_for "${READ}" print_line exit 0; else echo "Printing write commands in override mode:" print_line echo "defaults write $DOMAIN '{ " print_defaultswrite_for "${READ}" "override" echo " }'" print_line fi
+ if [ -z "$1" ]; then + echo "Provide default to read" 1>&2 + exit 1; + fi + + DOMAIN=$1 + READ="$(defaults read $DOMAIN)" + - print_defaultswrite_for() { + function print_defaultswrite_for() { ? +++++++++ while read line; do if [[ $line == "{" || $line == "}" ]]; then continue fi # the construction below may be kind-a vague but it does the following: # 1. tr '=' ' ' <<< $line replaces each '=' to a space in $line # 2. This is wrapped in $(), which outputs the outcome of tr ran in a subshell # 3. This is wrapped in (), which turns it into an array, items separated by space KEYVAL=($(tr '=' ' ' <<< $line)) KEY=${KEYVAL[0]} VAL=${KEYVAL[1]//;} if [[ $2 == "override" ]]; then echo "\"$KEY\" = $VAL;" else echo "defaults write $DOMAIN \"$KEY\" '$VAL'" fi done <<< "$1" } - print_line() { + function print_line() { ? +++++++++ echo "=========================================================================" } - - if [ -z "$1" ]; then - echo "Provide default to read" 1>&2 - exit 1; - fi - - DOMAIN=$1 - READ="$(defaults read $1)" if [ -z "$2" ]; then echo "Printing write commands in no-override mode:" print_line print_defaultswrite_for "${READ}" print_line exit 0; + else + echo "Printing write commands in override mode:" + print_line + echo "defaults write $DOMAIN '{ " + print_defaultswrite_for "${READ}" "override" + echo " }'" + print_line fi - - # override mode - echo "Printing write commands in no-override mode:" - print_line - echo "defaults write $DOMAIN '{ " - print_defaultswrite_for "${READ}" "override" - echo " }'" - print_line
35
0.744681
17
18
62190cb7cd513a03ac8ce5b366624ba7ece86516
package.json
package.json
{ "name": "onsenui-v2-vue-navigation", "version": "2.4.0+20170901.1", "description": "", "dependencies": { "onsenui": "2.4.x", "vue": "2.3.x", "vue-onsenui": "2.0.0", "vue-template-compiler": "2.3.x", "vue-loader": "11.0.0" } }
{ "name": "onsenui-v2-vue-navigation", "version": "2.4.0+20171205.1", "description": "", "dependencies": { "css-loader": "*", "onsenui": "~2.7.0", "vue": "~2.5.0", "vue-onsenui": "~2.3.0", "vue-template-compiler": "~2.5.0", "vue-loader": "11.0.0" } }
Update dependencies and bump version to `2.4.0+20171205.1`.
Update dependencies and bump version to `2.4.0+20171205.1`.
JSON
mit
monaca-templates/onsenui-v2-vue-navigation,monaca-templates/onsenui-v2-vue-navigation
json
## Code Before: { "name": "onsenui-v2-vue-navigation", "version": "2.4.0+20170901.1", "description": "", "dependencies": { "onsenui": "2.4.x", "vue": "2.3.x", "vue-onsenui": "2.0.0", "vue-template-compiler": "2.3.x", "vue-loader": "11.0.0" } } ## Instruction: Update dependencies and bump version to `2.4.0+20171205.1`. ## Code After: { "name": "onsenui-v2-vue-navigation", "version": "2.4.0+20171205.1", "description": "", "dependencies": { "css-loader": "*", "onsenui": "~2.7.0", "vue": "~2.5.0", "vue-onsenui": "~2.3.0", "vue-template-compiler": "~2.5.0", "vue-loader": "11.0.0" } }
{ "name": "onsenui-v2-vue-navigation", - "version": "2.4.0+20170901.1", ? ^^^ + "version": "2.4.0+20171205.1", ? ++ ^ "description": "", "dependencies": { + "css-loader": "*", - "onsenui": "2.4.x", ? ^ ^ + "onsenui": "~2.7.0", ? + ^ ^ - "vue": "2.3.x", ? ^ ^ + "vue": "~2.5.0", ? + ^ ^ - "vue-onsenui": "2.0.0", ? ^ + "vue-onsenui": "~2.3.0", ? + ^ - "vue-template-compiler": "2.3.x", ? ^ ^ + "vue-template-compiler": "~2.5.0", ? + ^ ^ "vue-loader": "11.0.0" } }
11
0.916667
6
5
3a2285177c3727384f655d0f978315f1a50207a6
src/main/java/com/probossgamers/turtlemod/items/ItemModFood.java
src/main/java/com/probossgamers/turtlemod/items/ItemModFood.java
package com.probossgamers.turtlemod.items; import com.probossgamers.turtlemod.TurtleMain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemModFood extends ItemFood { private PotionEffect[] effects; public ItemModFood(String unlocalizedName, int amount, float saturation, boolean isWolfFood, PotionEffect... effects) { super(amount, saturation, isWolfFood); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(TurtleMain.tabCustom); this.effects = effects; } @Override protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { super.onFoodEaten(stack, world, player); for (int i = 0; i < effects.length; i ++) { effects[i].getPotion(); if (!world.isRemote && effects[i] != null && Potion.getIdFromPotion(effects[i].getPotion()) > 0) player.addPotionEffect(new PotionEffect(this.effects[i])); } } }
package com.probossgamers.turtlemod.items; import com.probossgamers.turtlemod.TurtleMain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemModFood extends ItemFood { private PotionEffect[] effects; public ItemModFood(String unlocalizedName, int amount, float saturation, boolean isWolfFood, PotionEffect... effects) { super(amount, saturation, isWolfFood); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(TurtleMain.tabCustom); this.effects = effects; } @Override protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { super.onFoodEaten(stack, world, player); if(!(effects == null)) { for (int i = 0; i < effects.length; i++) { effects[i].getPotion(); if (!world.isRemote && effects[i] != null && Potion.getIdFromPotion(effects[i].getPotion()) > 0) { player.addPotionEffect(new PotionEffect(this.effects[i])); } } } } }
Check for null potion effects.
Check for null potion effects.
Java
mit
Rydog101/TurtleMod
java
## Code Before: package com.probossgamers.turtlemod.items; import com.probossgamers.turtlemod.TurtleMain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemModFood extends ItemFood { private PotionEffect[] effects; public ItemModFood(String unlocalizedName, int amount, float saturation, boolean isWolfFood, PotionEffect... effects) { super(amount, saturation, isWolfFood); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(TurtleMain.tabCustom); this.effects = effects; } @Override protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { super.onFoodEaten(stack, world, player); for (int i = 0; i < effects.length; i ++) { effects[i].getPotion(); if (!world.isRemote && effects[i] != null && Potion.getIdFromPotion(effects[i].getPotion()) > 0) player.addPotionEffect(new PotionEffect(this.effects[i])); } } } ## Instruction: Check for null potion effects. ## Code After: package com.probossgamers.turtlemod.items; import com.probossgamers.turtlemod.TurtleMain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemModFood extends ItemFood { private PotionEffect[] effects; public ItemModFood(String unlocalizedName, int amount, float saturation, boolean isWolfFood, PotionEffect... effects) { super(amount, saturation, isWolfFood); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(TurtleMain.tabCustom); this.effects = effects; } @Override protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { super.onFoodEaten(stack, world, player); if(!(effects == null)) { for (int i = 0; i < effects.length; i++) { effects[i].getPotion(); if (!world.isRemote && effects[i] != null && Potion.getIdFromPotion(effects[i].getPotion()) > 0) { player.addPotionEffect(new PotionEffect(this.effects[i])); } } } } }
package com.probossgamers.turtlemod.items; import com.probossgamers.turtlemod.TurtleMain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemModFood extends ItemFood { private PotionEffect[] effects; public ItemModFood(String unlocalizedName, int amount, float saturation, boolean isWolfFood, PotionEffect... effects) { super(amount, saturation, isWolfFood); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(TurtleMain.tabCustom); this.effects = effects; } @Override protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { super.onFoodEaten(stack, world, player); - + if(!(effects == null)) + { - for (int i = 0; i < effects.length; i ++) { ? ^^^^ - -- + for (int i = 0; i < effects.length; i++) ? ^^ + { - effects[i].getPotion(); ? ^^^^^^^^ + effects[i].getPotion(); ? ^^^ - if (!world.isRemote && effects[i] != null && Potion.getIdFromPotion(effects[i].getPotion()) > 0) + if (!world.isRemote && effects[i] != null && Potion.getIdFromPotion(effects[i].getPotion()) > 0) ? ++ + { - player.addPotionEffect(new PotionEffect(this.effects[i])); ? ^^^^^^^^^^^^ + player.addPotionEffect(new PotionEffect(this.effects[i])); ? ^^^^ - } + } + } + } } }
17
0.459459
11
6
06e74f67923c38c03eb38dd819258d4d41040651
src/engine/core/include/halley/core/api/platform_api.h
src/engine/core/include/halley/core/api/platform_api.h
namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; }
namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; virtual void setHeader(const String& headerName, const String& headerValue) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; }
Add setHeader to HTTPRequest API
Add setHeader to HTTPRequest API
C
apache-2.0
amzeratul/halley,amzeratul/halley,amzeratul/halley
c
## Code Before: namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; } ## Instruction: Add setHeader to HTTPRequest API ## Code After: namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; virtual void setHeader(const String& headerName, const String& headerValue) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; }
namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; + virtual void setHeader(const String& headerName, const String& headerValue) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; }
1
0.023256
1
0
deddaa6c0df9a78a42b2d7993b114e07a66cd396
pkgs/development/libraries/libavc1394/default.nix
pkgs/development/libraries/libavc1394/default.nix
{ stdenv, fetchurl, pkgconfig, libraw1394 }: stdenv.mkDerivation rec { name = "libavc1394-0.5.4"; src = fetchurl { url = "mirror://sourceforge/libavc1394/${name}.tar.gz"; sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"; }; buildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libraw1394 ]; meta = { description = "Programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"; homepage = http://sourceforge.net/projects/libavc1394/; license = [ "GPL" "LGPL" ]; }; }
{ stdenv, fetchurl, pkgconfig, libraw1394 }: stdenv.mkDerivation rec { name = "libavc1394-0.5.4"; src = fetchurl { url = "mirror://sourceforge/libavc1394/${name}.tar.gz"; sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"; }; buildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libraw1394 ]; meta = { description = "Programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"; homepage = http://sourceforge.net/projects/libavc1394/; license = stdenv.lib.licenses.lgpl21Plus; platforms = stdenv.lib.platforms.linux; }; }
Add platforms and update license
libavc1394: Add platforms and update license
Nix
mit
NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,triton/triton,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton
nix
## Code Before: { stdenv, fetchurl, pkgconfig, libraw1394 }: stdenv.mkDerivation rec { name = "libavc1394-0.5.4"; src = fetchurl { url = "mirror://sourceforge/libavc1394/${name}.tar.gz"; sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"; }; buildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libraw1394 ]; meta = { description = "Programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"; homepage = http://sourceforge.net/projects/libavc1394/; license = [ "GPL" "LGPL" ]; }; } ## Instruction: libavc1394: Add platforms and update license ## Code After: { stdenv, fetchurl, pkgconfig, libraw1394 }: stdenv.mkDerivation rec { name = "libavc1394-0.5.4"; src = fetchurl { url = "mirror://sourceforge/libavc1394/${name}.tar.gz"; sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"; }; buildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libraw1394 ]; meta = { description = "Programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"; homepage = http://sourceforge.net/projects/libavc1394/; license = stdenv.lib.licenses.lgpl21Plus; platforms = stdenv.lib.platforms.linux; }; }
{ stdenv, fetchurl, pkgconfig, libraw1394 }: stdenv.mkDerivation rec { name = "libavc1394-0.5.4"; src = fetchurl { url = "mirror://sourceforge/libavc1394/${name}.tar.gz"; sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"; }; buildInputs = [ pkgconfig ]; propagatedBuildInputs = [ libraw1394 ]; meta = { description = "Programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set"; homepage = http://sourceforge.net/projects/libavc1394/; - license = [ "GPL" "LGPL" ]; + license = stdenv.lib.licenses.lgpl21Plus; + platforms = stdenv.lib.platforms.linux; }; }
3
0.157895
2
1
607f5fef74d8c8d4cf8567a8474afdc1a89790e3
lib/raceresult/decoder.rb
lib/raceresult/decoder.rb
require 'socket' module RaceResult class Decoder attr_accessor :host, :port STATUS_KEYS = [:date, :time, :has_power, :antennas, :timing_mode, :file_no, :gps_fix, :location, :rfid_ok] def initialize(host, port = 3601) self.host = host self.port = port connect end def has_power? get_status[:has_power] == "1" end private def connect @socket = TCPSocket.new(host, port) end def get_status @socket.puts 'GETSTATUS' status = @socket.gets.chomp.split(';') Hash[STATUS_KEYS.zip(status[1..-1])] end end end
require 'socket' module RaceResult class Decoder attr_accessor :host, :port STATUS_KEYS = [:date, :time, :has_power, :antennas, :timing_mode, :file_no, :gps_fix, :location, :rfid_ok] def initialize(host, port = 3601) self.host = host self.port = port connect end def has_power? get_status[:has_power] == "1" end def antennas get_status[:antennas] end def datetime if get_status[:date].start_with?('0') date=Date.today.to_s else date=get_status[:date] end datetime=DateTime.parse(date+' '+get_status[:time]) end private def connect @socket = TCPSocket.new(host, port) end def get_status @socket.puts 'GETSTATUS' status = @socket.gets.chomp.split(';') Hash[STATUS_KEYS.zip(status[1..-1])] end end end
Add methods antennas and datetime to Decoder
Add methods antennas and datetime to Decoder
Ruby
mit
WhyEee/raceresult,WhyEee/raceresult
ruby
## Code Before: require 'socket' module RaceResult class Decoder attr_accessor :host, :port STATUS_KEYS = [:date, :time, :has_power, :antennas, :timing_mode, :file_no, :gps_fix, :location, :rfid_ok] def initialize(host, port = 3601) self.host = host self.port = port connect end def has_power? get_status[:has_power] == "1" end private def connect @socket = TCPSocket.new(host, port) end def get_status @socket.puts 'GETSTATUS' status = @socket.gets.chomp.split(';') Hash[STATUS_KEYS.zip(status[1..-1])] end end end ## Instruction: Add methods antennas and datetime to Decoder ## Code After: require 'socket' module RaceResult class Decoder attr_accessor :host, :port STATUS_KEYS = [:date, :time, :has_power, :antennas, :timing_mode, :file_no, :gps_fix, :location, :rfid_ok] def initialize(host, port = 3601) self.host = host self.port = port connect end def has_power? get_status[:has_power] == "1" end def antennas get_status[:antennas] end def datetime if get_status[:date].start_with?('0') date=Date.today.to_s else date=get_status[:date] end datetime=DateTime.parse(date+' '+get_status[:time]) end private def connect @socket = TCPSocket.new(host, port) end def get_status @socket.puts 'GETSTATUS' status = @socket.gets.chomp.split(';') Hash[STATUS_KEYS.zip(status[1..-1])] end end end
require 'socket' module RaceResult class Decoder attr_accessor :host, :port STATUS_KEYS = [:date, :time, :has_power, :antennas, :timing_mode, :file_no, :gps_fix, :location, :rfid_ok] def initialize(host, port = 3601) self.host = host self.port = port connect end def has_power? get_status[:has_power] == "1" end + def antennas + get_status[:antennas] + end + + def datetime + if get_status[:date].start_with?('0') + date=Date.today.to_s + else + date=get_status[:date] + end + datetime=DateTime.parse(date+' '+get_status[:time]) + end + private def connect @socket = TCPSocket.new(host, port) end def get_status @socket.puts 'GETSTATUS' status = @socket.gets.chomp.split(';') Hash[STATUS_KEYS.zip(status[1..-1])] end end end
13
0.393939
13
0
cc059f0a4e8eda918a429ec8226bd11600ea751c
app/assets/stylesheets/resolve.css.scss
app/assets/stylesheets/resolve.css.scss
@import "compass"; @import "icons/*.png"; @include all-icons-sprites; @import "nyulibraries/variables"; @import "resolve/variables"; @import "nyulibraries/header"; @import "nyulibraries/login"; @import "nyulibraries/mixins"; @import "nyulibraries/responsive"; @import "umlaut"; @import "nyulibraries/misc"; @import "resolve/common"; @import "resolve/permalink"; .help-text-icon { display: none; } .header, nav { background-color: #57068c; // background-color: #a4121f; h1, .login, .logout { color: white; } }
@import "compass"; @import "icons/*.png"; @include all-icons-sprites; @import "nyulibraries/variables"; @import "resolve/variables"; @import "nyulibraries/header"; @import "nyulibraries/login"; @import "nyulibraries/nav"; @import "nyulibraries/mixins"; @import "nyulibraries/responsive"; @import "umlaut"; @import "nyulibraries/misc"; @import "resolve/common"; @import "resolve/permalink"; .help-text-icon { display: none; } .header, nav { background-color: #57068c; // background-color: #a4121f; h1, .login, .logout { color: white; } }
Add the common NYU Libraries nav stylesheet to the resolution screen to get the styles for the login class
Add the common NYU Libraries nav stylesheet to the resolution screen to get the styles for the login class
SCSS
mit
NYULibraries/getit,NYULibraries/getit,NYULibraries/getit,NYULibraries/getit
scss
## Code Before: @import "compass"; @import "icons/*.png"; @include all-icons-sprites; @import "nyulibraries/variables"; @import "resolve/variables"; @import "nyulibraries/header"; @import "nyulibraries/login"; @import "nyulibraries/mixins"; @import "nyulibraries/responsive"; @import "umlaut"; @import "nyulibraries/misc"; @import "resolve/common"; @import "resolve/permalink"; .help-text-icon { display: none; } .header, nav { background-color: #57068c; // background-color: #a4121f; h1, .login, .logout { color: white; } } ## Instruction: Add the common NYU Libraries nav stylesheet to the resolution screen to get the styles for the login class ## Code After: @import "compass"; @import "icons/*.png"; @include all-icons-sprites; @import "nyulibraries/variables"; @import "resolve/variables"; @import "nyulibraries/header"; @import "nyulibraries/login"; @import "nyulibraries/nav"; @import "nyulibraries/mixins"; @import "nyulibraries/responsive"; @import "umlaut"; @import "nyulibraries/misc"; @import "resolve/common"; @import "resolve/permalink"; .help-text-icon { display: none; } .header, nav { background-color: #57068c; // background-color: #a4121f; h1, .login, .logout { color: white; } }
@import "compass"; @import "icons/*.png"; @include all-icons-sprites; @import "nyulibraries/variables"; @import "resolve/variables"; @import "nyulibraries/header"; @import "nyulibraries/login"; + @import "nyulibraries/nav"; @import "nyulibraries/mixins"; @import "nyulibraries/responsive"; @import "umlaut"; @import "nyulibraries/misc"; @import "resolve/common"; @import "resolve/permalink"; .help-text-icon { display: none; } .header, nav { background-color: #57068c; // background-color: #a4121f; h1, .login, .logout { color: white; } }
1
0.038462
1
0
fb3f1023faedda37e5ca16b87d2b9ddc38a2196c
deployer/tasks/util.py
deployer/tasks/util.py
from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionException): raise result.result else: raise TaskExecutionException(result.result, result.traceback) def _check_error(result): if not result or not isinstance(result, AsyncResult): return check_or_raise_task_exception(result) _check_error(result.parent) def simple_result(result): # DO not remove line below # Explanation: https://github.com/celery/celery/issues/2315 deployer.celery.app.set_current() if isinstance(result, GroupResult): return simple_result(result.results) elif hasattr(result, '__iter__') and not isinstance(result, dict): return [simple_result(each_result) for each_result in result] elif isinstance(result, ResultBase): _check_error(result) if result.ready(): check_or_raise_task_exception(result) return simple_result(result.result) else: raise TaskNotReadyException() return result class TaskNotReadyException(Exception): pass
import socket from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException from deployer.util import retry __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionException): raise result.result else: raise TaskExecutionException(result.result, result.traceback) def _check_error(result): if not result or not isinstance(result, AsyncResult): return check_or_raise_task_exception(result) _check_error(result.parent) @retry(10, delay=5, backoff=1, except_on=(IOError, socket.error)) def simple_result(result): # DO not remove line below # Explanation: https://github.com/celery/celery/issues/2315 deployer.celery.app.set_current() if isinstance(result, GroupResult): return simple_result(result.results) elif hasattr(result, '__iter__') and not isinstance(result, dict): return [simple_result(each_result) for each_result in result] elif isinstance(result, ResultBase): _check_error(result) if result.ready(): check_or_raise_task_exception(result) return simple_result(result.result) else: raise TaskNotReadyException() return result class TaskNotReadyException(Exception): pass
Add retry for socket error
Add retry for socket error
Python
mit
totem/cluster-deployer,totem/cluster-deployer,totem/cluster-deployer
python
## Code Before: from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionException): raise result.result else: raise TaskExecutionException(result.result, result.traceback) def _check_error(result): if not result or not isinstance(result, AsyncResult): return check_or_raise_task_exception(result) _check_error(result.parent) def simple_result(result): # DO not remove line below # Explanation: https://github.com/celery/celery/issues/2315 deployer.celery.app.set_current() if isinstance(result, GroupResult): return simple_result(result.results) elif hasattr(result, '__iter__') and not isinstance(result, dict): return [simple_result(each_result) for each_result in result] elif isinstance(result, ResultBase): _check_error(result) if result.ready(): check_or_raise_task_exception(result) return simple_result(result.result) else: raise TaskNotReadyException() return result class TaskNotReadyException(Exception): pass ## Instruction: Add retry for socket error ## Code After: import socket from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException from deployer.util import retry __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionException): raise result.result else: raise TaskExecutionException(result.result, result.traceback) def _check_error(result): if not result or not isinstance(result, AsyncResult): return check_or_raise_task_exception(result) _check_error(result.parent) @retry(10, delay=5, backoff=1, except_on=(IOError, socket.error)) def simple_result(result): # DO not remove line below # Explanation: https://github.com/celery/celery/issues/2315 deployer.celery.app.set_current() if isinstance(result, GroupResult): return simple_result(result.results) elif hasattr(result, '__iter__') and not isinstance(result, dict): return [simple_result(each_result) for each_result in result] elif isinstance(result, ResultBase): _check_error(result) if result.ready(): check_or_raise_task_exception(result) return simple_result(result.result) else: raise TaskNotReadyException() return result class TaskNotReadyException(Exception): pass
+ import socket from celery.result import ResultBase, AsyncResult, GroupResult import deployer from deployer.tasks.exceptions import TaskExecutionException + from deployer.util import retry __author__ = 'sukrit' def check_or_raise_task_exception(result): if isinstance(result, AsyncResult) and result.failed(): if isinstance(result.result, TaskExecutionException): raise result.result else: raise TaskExecutionException(result.result, result.traceback) def _check_error(result): if not result or not isinstance(result, AsyncResult): return check_or_raise_task_exception(result) _check_error(result.parent) + @retry(10, delay=5, backoff=1, except_on=(IOError, socket.error)) def simple_result(result): # DO not remove line below # Explanation: https://github.com/celery/celery/issues/2315 deployer.celery.app.set_current() if isinstance(result, GroupResult): return simple_result(result.results) elif hasattr(result, '__iter__') and not isinstance(result, dict): return [simple_result(each_result) for each_result in result] elif isinstance(result, ResultBase): _check_error(result) if result.ready(): check_or_raise_task_exception(result) return simple_result(result.result) else: raise TaskNotReadyException() return result class TaskNotReadyException(Exception): pass
3
0.068182
3
0
92f509a0f63103fb3cfa96d1a429940cea0c6cb6
app/controllers/application_controller.rb
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base protect_from_forgery end
class ApplicationController < ActionController::Base protect_from_forgery # given a metric string, return the backend instance # return generic if no string. def backend m=nil return Backend::GenericBackend.new if m.nil? type = m.split(":").first settings = Settings.backends.map{|h| h.to_hash}.select{|a| (a[:alias] || a[:type]).casecmp(type) == 0}.first return "Backend::#{settings[:type].titleize}".constantize.new settings[:settings] end end
Create a backend instance creator for applicationhelper
Create a backend instance creator for applicationhelper
Ruby
bsd-3-clause
machiavellian/machiavelli,glasnt/machiavelli,glasnt/machiavelli,glasnt/machiavelli,glasnt/machiavelli,machiavellian/machiavelli,machiavellian/machiavelli,machiavellian/machiavelli
ruby
## Code Before: class ApplicationController < ActionController::Base protect_from_forgery end ## Instruction: Create a backend instance creator for applicationhelper ## Code After: class ApplicationController < ActionController::Base protect_from_forgery # given a metric string, return the backend instance # return generic if no string. def backend m=nil return Backend::GenericBackend.new if m.nil? type = m.split(":").first settings = Settings.backends.map{|h| h.to_hash}.select{|a| (a[:alias] || a[:type]).casecmp(type) == 0}.first return "Backend::#{settings[:type].titleize}".constantize.new settings[:settings] end end
class ApplicationController < ActionController::Base protect_from_forgery + + # given a metric string, return the backend instance + # return generic if no string. + def backend m=nil + + return Backend::GenericBackend.new if m.nil? + + type = m.split(":").first + settings = Settings.backends.map{|h| h.to_hash}.select{|a| (a[:alias] || a[:type]).casecmp(type) == 0}.first + return "Backend::#{settings[:type].titleize}".constantize.new settings[:settings] + end end
11
2.75
11
0
04ff19fca9ffa556bed81950430b9f2257b13841
front-end/src/components/shared/Footer.js
front-end/src/components/shared/Footer.js
import React, { Component } from 'react' import '../../css/style.css' import FA from 'react-fontawesome' class Footer extends Component { render(){ return( <div className="Footer" > <br /> <FA name="linkedin" border={true} size="2x" /> <FA name="facebook" border={true} size="2x" /> <br /> <p>Designed with ❤️ by .this</p> </div> ) } } export default Footer
import React, { Component } from 'react' import '../../css/style.css' import FA from 'react-fontawesome' class Footer extends Component { render(){ return( <div className="Footer" > <br /> <FA name="linkedin" border={true} size="2x" /> <FA name="facebook" border={true} size="2x" /> <br /> <p>Beautifully designed with ❤️ by .this</p> </div> ) } } export default Footer
Update for github commit settings
Update for github commit settings
JavaScript
mit
iankhor/medrefr,iankhor/medrefr
javascript
## Code Before: import React, { Component } from 'react' import '../../css/style.css' import FA from 'react-fontawesome' class Footer extends Component { render(){ return( <div className="Footer" > <br /> <FA name="linkedin" border={true} size="2x" /> <FA name="facebook" border={true} size="2x" /> <br /> <p>Designed with ❤️ by .this</p> </div> ) } } export default Footer ## Instruction: Update for github commit settings ## Code After: import React, { Component } from 'react' import '../../css/style.css' import FA from 'react-fontawesome' class Footer extends Component { render(){ return( <div className="Footer" > <br /> <FA name="linkedin" border={true} size="2x" /> <FA name="facebook" border={true} size="2x" /> <br /> <p>Beautifully designed with ❤️ by .this</p> </div> ) } } export default Footer
import React, { Component } from 'react' import '../../css/style.css' import FA from 'react-fontawesome' class Footer extends Component { render(){ return( <div className="Footer" > <br /> <FA name="linkedin" border={true} size="2x" /> <FA name="facebook" border={true} size="2x" /> <br /> - <p>Designed with ❤️ by .this</p> ? ^ + <p>Beautifully designed with ❤️ by .this</p> ? ^^^^^^^^^^^^^ </div> ) } } export default Footer
2
0.064516
1
1
488a025b263dbdbc65690b91d98bcf4d6cd7998e
README.md
README.md
A simple multi-protocol robot written in Go.
A simple multi-protocol robot written in Go. It's based on _go-chat-bot's_ [project](https://github.com/go-chat-bot) that supports [Slack](https://slack.com), [IRC](https://en.wikipedia.org/wiki/Internet_Relay_Chat) and [Telegram](https://telegram.org/) protocols.
Add a line of explanation about project.
Add a line of explanation about project.
Markdown
mit
bmeneguele/go-bot,SmartgreenSA/go-bot
markdown
## Code Before: A simple multi-protocol robot written in Go. ## Instruction: Add a line of explanation about project. ## Code After: A simple multi-protocol robot written in Go. It's based on _go-chat-bot's_ [project](https://github.com/go-chat-bot) that supports [Slack](https://slack.com), [IRC](https://en.wikipedia.org/wiki/Internet_Relay_Chat) and [Telegram](https://telegram.org/) protocols.
- A simple multi-protocol robot written in Go. + A simple multi-protocol robot written in Go. It's based on _go-chat-bot's_ [project](https://github.com/go-chat-bot) that supports [Slack](https://slack.com), [IRC](https://en.wikipedia.org/wiki/Internet_Relay_Chat) and [Telegram](https://telegram.org/) protocols.
2
2
1
1
464efa2c9aa9dba9b550300be1004931c77ed7a5
src/Entities/Factory.php
src/Entities/Factory.php
<?php namespace Longman\TelegramBot\Entities; abstract class Factory { abstract public static function make(array $data, string $bot_username): Entity; public static function resolveEntityClass(string $class, mixed $property, string $bot_username = ''): Entity { if (is_a($property, $class)) { return $property; } elseif (is_subclass_of($class, Factory::class)) { return $class::make($property, $bot_username); } return new $class($property, $bot_username); } }
<?php namespace Longman\TelegramBot\Entities; abstract class Factory { abstract public static function make(array $data, string $bot_username): Entity; public static function resolveEntityClass(string $class, mixed $property, string $bot_username = ''): Entity { if (is_a($property, $class)) { return $property; } if (is_subclass_of($class, Factory::class)) { return $class::make($property, $bot_username); } return new $class($property, $bot_username); } }
Make use of early returns
Make use of early returns Co-authored-by: Armando Lüscher <26943035120015382c5c160fee1d053cebeae5a6@noplanman.ch>
PHP
mit
php-telegram-bot/core
php
## Code Before: <?php namespace Longman\TelegramBot\Entities; abstract class Factory { abstract public static function make(array $data, string $bot_username): Entity; public static function resolveEntityClass(string $class, mixed $property, string $bot_username = ''): Entity { if (is_a($property, $class)) { return $property; } elseif (is_subclass_of($class, Factory::class)) { return $class::make($property, $bot_username); } return new $class($property, $bot_username); } } ## Instruction: Make use of early returns Co-authored-by: Armando Lüscher <26943035120015382c5c160fee1d053cebeae5a6@noplanman.ch> ## Code After: <?php namespace Longman\TelegramBot\Entities; abstract class Factory { abstract public static function make(array $data, string $bot_username): Entity; public static function resolveEntityClass(string $class, mixed $property, string $bot_username = ''): Entity { if (is_a($property, $class)) { return $property; } if (is_subclass_of($class, Factory::class)) { return $class::make($property, $bot_username); } return new $class($property, $bot_username); } }
<?php namespace Longman\TelegramBot\Entities; abstract class Factory { abstract public static function make(array $data, string $bot_username): Entity; public static function resolveEntityClass(string $class, mixed $property, string $bot_username = ''): Entity { if (is_a($property, $class)) { return $property; + } + - } elseif (is_subclass_of($class, Factory::class)) { ? ------ + if (is_subclass_of($class, Factory::class)) { return $class::make($property, $bot_username); } return new $class($property, $bot_username); } }
4
0.210526
3
1
6cd9fd6a7429f8edd47564e4ab17a1b90a7474cb
components/compositions/dialogs/overwrite-dialog.component.ts
components/compositions/dialogs/overwrite-dialog.component.ts
import {Component, ViewRef} from '@angular/core'; import {HsCompositionsService} from '../compositions.service'; import {HsDialogComponent} from '../../layout/dialogs/dialog-component.interface'; import {HsDialogContainerService} from '../../layout/dialogs/dialog-container.service'; @Component({ selector: 'hs.compositions-overwrite-dialog', template: require('./dialog_overwriteconfirm.html'), }) export class HsCompositionsOverwriteDialogComponent implements HsDialogComponent { viewRef: ViewRef; data: any; constructor( private HsDialogContainerService: HsDialogContainerService, private HsCompositionsService: HsCompositionsService ) {} close(): void { this.HsDialogContainerService.destroy(this); } /** * @ngdoc method * @public * @description Load new composition without saving old composition */ overwrite() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, true ); this.close(); } /** * @ngdoc method * @public * @description Load new composition (with service_parser Load function) and merge it with old composition */ add() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, false ); this.close(); } }
import {Component, ViewRef} from '@angular/core'; import {HsCompositionsService} from '../compositions.service'; import {HsDialogComponent} from '../../layout/dialogs/dialog-component.interface'; import {HsDialogContainerService} from '../../layout/dialogs/dialog-container.service'; import {HsSaveMapManagerService} from '../../save-map/save-map-manager.service'; @Component({ selector: 'hs.compositions-overwrite-dialog', template: require('./dialog_overwriteconfirm.html'), }) export class HsCompositionsOverwriteDialogComponent implements HsDialogComponent { viewRef: ViewRef; data: any; constructor( private HsDialogContainerService: HsDialogContainerService, private HsCompositionsService: HsCompositionsService, private HsSaveMapManagerService: HsSaveMapManagerService ) {} close(): void { this.HsDialogContainerService.destroy(this); } /** * @ngdoc method * @public * @description Load new composition without saving old composition */ overwrite() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, true ); this.close(); } /** * @ngdoc method * @public * @description Save currently loaded composition first */ save() { this.HsSaveMapManagerService.openPanel(null); this.close(); } /** * @ngdoc method * @public * @description Load new composition (with service_parser Load function) and merge it with old composition */ add() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, false ); this.close(); } }
Add save function in compositions overwrite dialog
Add save function in compositions overwrite dialog
TypeScript
mit
hslayers/hslayers-ng,hslayers/hslayers-ng,hslayers/hslayers-ng,hslayers/hslayers-ng
typescript
## Code Before: import {Component, ViewRef} from '@angular/core'; import {HsCompositionsService} from '../compositions.service'; import {HsDialogComponent} from '../../layout/dialogs/dialog-component.interface'; import {HsDialogContainerService} from '../../layout/dialogs/dialog-container.service'; @Component({ selector: 'hs.compositions-overwrite-dialog', template: require('./dialog_overwriteconfirm.html'), }) export class HsCompositionsOverwriteDialogComponent implements HsDialogComponent { viewRef: ViewRef; data: any; constructor( private HsDialogContainerService: HsDialogContainerService, private HsCompositionsService: HsCompositionsService ) {} close(): void { this.HsDialogContainerService.destroy(this); } /** * @ngdoc method * @public * @description Load new composition without saving old composition */ overwrite() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, true ); this.close(); } /** * @ngdoc method * @public * @description Load new composition (with service_parser Load function) and merge it with old composition */ add() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, false ); this.close(); } } ## Instruction: Add save function in compositions overwrite dialog ## Code After: import {Component, ViewRef} from '@angular/core'; import {HsCompositionsService} from '../compositions.service'; import {HsDialogComponent} from '../../layout/dialogs/dialog-component.interface'; import {HsDialogContainerService} from '../../layout/dialogs/dialog-container.service'; import {HsSaveMapManagerService} from '../../save-map/save-map-manager.service'; @Component({ selector: 'hs.compositions-overwrite-dialog', template: require('./dialog_overwriteconfirm.html'), }) export class HsCompositionsOverwriteDialogComponent implements HsDialogComponent { viewRef: ViewRef; data: any; constructor( private HsDialogContainerService: HsDialogContainerService, private HsCompositionsService: HsCompositionsService, private HsSaveMapManagerService: HsSaveMapManagerService ) {} close(): void { this.HsDialogContainerService.destroy(this); } /** * @ngdoc method * @public * @description Load new composition without saving old composition */ overwrite() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, true ); this.close(); } /** * @ngdoc method * @public * @description Save currently loaded composition first */ save() { this.HsSaveMapManagerService.openPanel(null); this.close(); } /** * @ngdoc method * @public * @description Load new composition (with service_parser Load function) and merge it with old composition */ add() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, false ); this.close(); } }
import {Component, ViewRef} from '@angular/core'; import {HsCompositionsService} from '../compositions.service'; import {HsDialogComponent} from '../../layout/dialogs/dialog-component.interface'; import {HsDialogContainerService} from '../../layout/dialogs/dialog-container.service'; + import {HsSaveMapManagerService} from '../../save-map/save-map-manager.service'; @Component({ selector: 'hs.compositions-overwrite-dialog', template: require('./dialog_overwriteconfirm.html'), }) export class HsCompositionsOverwriteDialogComponent implements HsDialogComponent { viewRef: ViewRef; data: any; constructor( private HsDialogContainerService: HsDialogContainerService, - private HsCompositionsService: HsCompositionsService + private HsCompositionsService: HsCompositionsService, ? + + private HsSaveMapManagerService: HsSaveMapManagerService ) {} close(): void { this.HsDialogContainerService.destroy(this); } /** * @ngdoc method * @public * @description Load new composition without saving old composition */ overwrite() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, true ); this.close(); } /** * @ngdoc method * @public + * @description Save currently loaded composition first + */ + save() { + this.HsSaveMapManagerService.openPanel(null); + this.close(); + } + + /** + * @ngdoc method + * @public * @description Load new composition (with service_parser Load function) and merge it with old composition */ add() { this.HsCompositionsService.loadComposition( this.HsCompositionsService.compositionToLoad.url, false ); this.close(); } }
14
0.291667
13
1
5931c4cf53c88304aec696b9b5b5ed4f22c8d2c5
.kitchen.appveyor.yml
.kitchen.appveyor.yml
--- driver: name: proxy host: localhost reset_command: "exit 0" port: <%= ENV["machine_port"] %> username: <%= ENV["machine_user"] %> password: <%= ENV["machine_pass"] %> provisioner: name: chef_zero require_chef_omnibus: 12 platforms: - name: windows-2012R2 init: # Configure Git on Windows to properly handle line endings - git config --global core.autocrlf true suites: - name: default run_list: - flywaydb_test::default - flywaydb_test::default attributes: flywaydb_test: parameters: password: Password12! placeholders.test_password: test flyway_conf: user: notset url: jdbc:mysql://notset/mysql schemas: flywaydb_test locations: filesystem:/tmp/db cleanDisabled: true placeholders.test_user: test alt_conf: user: root url: jdbc:mysql://localhost/mysql mysql_driver: true sensitive: false password: 84aXPZugs8xR7xTz # required by windows flywaydb: group: Administrators
--- driver: name: proxy host: localhost reset_command: "exit 0" port: <%= ENV["machine_port"] %> username: <%= ENV["machine_user"] %> password: <%= ENV["machine_pass"] %> provisioner: name: chef_zero require_chef_omnibus: 12 platforms: - name: windows-2012R2 suites: - name: default run_list: - flywaydb_test::default - flywaydb_test::default attributes: flywaydb_test: parameters: password: Password12! placeholders.test_password: test flyway_conf: user: notset url: jdbc:mysql://notset/mysql schemas: flywaydb_test locations: filesystem:/tmp/db cleanDisabled: true placeholders.test_user: test alt_conf: user: root url: jdbc:mysql://localhost/mysql mysql_driver: true sensitive: false password: 84aXPZugs8xR7xTz # required by windows flywaydb: group: Administrators
Configure Git on Windows to properly handle line endings
Configure Git on Windows to properly handle line endings
YAML
mit
dhoer/chef-flywaydb,dhoer/chef-flywaydb
yaml
## Code Before: --- driver: name: proxy host: localhost reset_command: "exit 0" port: <%= ENV["machine_port"] %> username: <%= ENV["machine_user"] %> password: <%= ENV["machine_pass"] %> provisioner: name: chef_zero require_chef_omnibus: 12 platforms: - name: windows-2012R2 init: # Configure Git on Windows to properly handle line endings - git config --global core.autocrlf true suites: - name: default run_list: - flywaydb_test::default - flywaydb_test::default attributes: flywaydb_test: parameters: password: Password12! placeholders.test_password: test flyway_conf: user: notset url: jdbc:mysql://notset/mysql schemas: flywaydb_test locations: filesystem:/tmp/db cleanDisabled: true placeholders.test_user: test alt_conf: user: root url: jdbc:mysql://localhost/mysql mysql_driver: true sensitive: false password: 84aXPZugs8xR7xTz # required by windows flywaydb: group: Administrators ## Instruction: Configure Git on Windows to properly handle line endings ## Code After: --- driver: name: proxy host: localhost reset_command: "exit 0" port: <%= ENV["machine_port"] %> username: <%= ENV["machine_user"] %> password: <%= ENV["machine_pass"] %> provisioner: name: chef_zero require_chef_omnibus: 12 platforms: - name: windows-2012R2 suites: - name: default run_list: - flywaydb_test::default - flywaydb_test::default attributes: flywaydb_test: parameters: password: Password12! placeholders.test_password: test flyway_conf: user: notset url: jdbc:mysql://notset/mysql schemas: flywaydb_test locations: filesystem:/tmp/db cleanDisabled: true placeholders.test_user: test alt_conf: user: root url: jdbc:mysql://localhost/mysql mysql_driver: true sensitive: false password: 84aXPZugs8xR7xTz # required by windows flywaydb: group: Administrators
--- driver: name: proxy host: localhost reset_command: "exit 0" port: <%= ENV["machine_port"] %> username: <%= ENV["machine_user"] %> password: <%= ENV["machine_pass"] %> provisioner: name: chef_zero require_chef_omnibus: 12 platforms: - name: windows-2012R2 - - init: - # Configure Git on Windows to properly handle line endings - - git config --global core.autocrlf true suites: - name: default run_list: - flywaydb_test::default - flywaydb_test::default attributes: flywaydb_test: parameters: password: Password12! placeholders.test_password: test flyway_conf: user: notset url: jdbc:mysql://notset/mysql schemas: flywaydb_test locations: filesystem:/tmp/db cleanDisabled: true placeholders.test_user: test alt_conf: user: root url: jdbc:mysql://localhost/mysql mysql_driver: true sensitive: false password: 84aXPZugs8xR7xTz # required by windows flywaydb: group: Administrators
4
0.088889
0
4
a5c3f3b22cbbe6a55e9fed72f32fdd39ce6ca8a2
lib/method_found/interceptor.rb
lib/method_found/interceptor.rb
module MethodFound class Interceptor < Module attr_reader :regex def initialize(regex = nil, &intercept_block) define_method_missing(regex, &intercept_block) unless regex.nil? end def define_method_missing(regex, &intercept_block) @regex = regex intercept_method = assign_intercept_method(&intercept_block) method_cacher = method(:cache_method) define_method :method_missing do |method_name, *arguments, &method_block| if matches = regex.match(method_name) method_cacher.(method_name, matches) send(method_name, *arguments, &method_block) else super(method_name, *arguments, &method_block) end end define_method :respond_to_missing? do |method_name, include_private = false| (method_name =~ regex) || super(method_name, include_private) end end def inspect klass = self.class name = klass.name || klass.inspect "#<#{name}: #{regex.inspect}>" end private def cache_method(method_name, matches) intercept_method = @intercept_method define_method method_name do |*arguments, &block| send(intercept_method, method_name, matches, *arguments, &block) end end def assign_intercept_method(&intercept_block) @intercept_method ||= "__intercept_#{SecureRandom.hex}".freeze.tap do |method_name| define_method method_name, &intercept_block end end end end
module MethodFound class Interceptor < Module attr_reader :matcher def initialize(regex = nil, &intercept_block) define_method_missing(regex, &intercept_block) unless regex.nil? end def define_method_missing(matcher, &intercept_block) @matcher = matcher intercept_method = assign_intercept_method(&intercept_block) method_cacher = method(:cache_method) define_method :method_missing do |method_name, *arguments, &method_block| if matches = matcher.match(method_name) method_cacher.(method_name, matches) send(method_name, *arguments, &method_block) else super(method_name, *arguments, &method_block) end end define_method :respond_to_missing? do |method_name, include_private = false| matcher.match(method_name) || super(method_name, include_private) end end def inspect klass = self.class name = klass.name || klass.inspect "#<#{name}: #{matcher.inspect}>" end private def cache_method(method_name, matches) intercept_method = @intercept_method define_method method_name do |*arguments, &block| send(intercept_method, method_name, matches, *arguments, &block) end end def assign_intercept_method(&intercept_block) @intercept_method ||= "__intercept_#{SecureRandom.hex}".freeze.tap do |method_name| define_method method_name, &intercept_block end end end end
Use abstract matcher rather than regex
Use abstract matcher rather than regex
Ruby
mit
shioyama/method_found,shioyama/method_found
ruby
## Code Before: module MethodFound class Interceptor < Module attr_reader :regex def initialize(regex = nil, &intercept_block) define_method_missing(regex, &intercept_block) unless regex.nil? end def define_method_missing(regex, &intercept_block) @regex = regex intercept_method = assign_intercept_method(&intercept_block) method_cacher = method(:cache_method) define_method :method_missing do |method_name, *arguments, &method_block| if matches = regex.match(method_name) method_cacher.(method_name, matches) send(method_name, *arguments, &method_block) else super(method_name, *arguments, &method_block) end end define_method :respond_to_missing? do |method_name, include_private = false| (method_name =~ regex) || super(method_name, include_private) end end def inspect klass = self.class name = klass.name || klass.inspect "#<#{name}: #{regex.inspect}>" end private def cache_method(method_name, matches) intercept_method = @intercept_method define_method method_name do |*arguments, &block| send(intercept_method, method_name, matches, *arguments, &block) end end def assign_intercept_method(&intercept_block) @intercept_method ||= "__intercept_#{SecureRandom.hex}".freeze.tap do |method_name| define_method method_name, &intercept_block end end end end ## Instruction: Use abstract matcher rather than regex ## Code After: module MethodFound class Interceptor < Module attr_reader :matcher def initialize(regex = nil, &intercept_block) define_method_missing(regex, &intercept_block) unless regex.nil? end def define_method_missing(matcher, &intercept_block) @matcher = matcher intercept_method = assign_intercept_method(&intercept_block) method_cacher = method(:cache_method) define_method :method_missing do |method_name, *arguments, &method_block| if matches = matcher.match(method_name) method_cacher.(method_name, matches) send(method_name, *arguments, &method_block) else super(method_name, *arguments, &method_block) end end define_method :respond_to_missing? do |method_name, include_private = false| matcher.match(method_name) || super(method_name, include_private) end end def inspect klass = self.class name = klass.name || klass.inspect "#<#{name}: #{matcher.inspect}>" end private def cache_method(method_name, matches) intercept_method = @intercept_method define_method method_name do |*arguments, &block| send(intercept_method, method_name, matches, *arguments, &block) end end def assign_intercept_method(&intercept_block) @intercept_method ||= "__intercept_#{SecureRandom.hex}".freeze.tap do |method_name| define_method method_name, &intercept_block end end end end
module MethodFound class Interceptor < Module - attr_reader :regex ? ---- + attr_reader :matcher ? ++++++ def initialize(regex = nil, &intercept_block) define_method_missing(regex, &intercept_block) unless regex.nil? end - def define_method_missing(regex, &intercept_block) ? ---- + def define_method_missing(matcher, &intercept_block) ? ++++++ - @regex = regex + @matcher = matcher intercept_method = assign_intercept_method(&intercept_block) method_cacher = method(:cache_method) define_method :method_missing do |method_name, *arguments, &method_block| - if matches = regex.match(method_name) ? ---- + if matches = matcher.match(method_name) ? ++++++ method_cacher.(method_name, matches) send(method_name, *arguments, &method_block) else super(method_name, *arguments, &method_block) end end define_method :respond_to_missing? do |method_name, include_private = false| - (method_name =~ regex) || super(method_name, include_private) ? --------- + matcher.match(method_name) || super(method_name, include_private) ? +++++++++++++ end end def inspect klass = self.class name = klass.name || klass.inspect - "#<#{name}: #{regex.inspect}>" ? ---- + "#<#{name}: #{matcher.inspect}>" ? ++++++ end private def cache_method(method_name, matches) intercept_method = @intercept_method define_method method_name do |*arguments, &block| send(intercept_method, method_name, matches, *arguments, &block) end end def assign_intercept_method(&intercept_block) @intercept_method ||= "__intercept_#{SecureRandom.hex}".freeze.tap do |method_name| define_method method_name, &intercept_block end end end end
12
0.244898
6
6
4d5485b52cf465f4a23e20e9ed35f453b5c3beff
lib/rack/auth/abstract/handler.rb
lib/rack/auth/abstract/handler.rb
module Rack module Auth # Rack::Auth::AbstractHandler implements common authentication functionality. # # +realm+ should be set for all handlers. class AbstractHandler attr_accessor :realm def initialize(app, &authenticator) @app, @authenticator = app, authenticator end private def unauthorized(www_authenticate = challenge) return [ 401, { 'WWW-Authenticate' => www_authenticate.to_s }, [] ] end def bad_request [ 400, {}, [] ] end end end end
module Rack module Auth # Rack::Auth::AbstractHandler implements common authentication functionality. # # +realm+ should be set for all handlers. class AbstractHandler attr_accessor :realm def initialize(app, &authenticator) @app, @authenticator = app, authenticator end private def unauthorized(www_authenticate = challenge) return [ 401, { 'Content-Type' => 'text/plain', 'Content-Length' => '0', 'WWW-Authenticate' => www_authenticate.to_s }, [] ] end def bad_request return [ 400, { 'Content-Type' => 'text/plain', 'Content-Length' => '0' }, [] ] end end end end
Fix of Auth::Abstract::Handler to return headers within spec. 401 and 400 responses must have Content-Type and Content-Length defined.
Fix of Auth::Abstract::Handler to return headers within spec. 401 and 400 responses must have Content-Type and Content-Length defined.
Ruby
mit
Comcast/rack,keepcosmos/rack,tylergannon/rack,sigmavirus24/rack,jeremyf/rack,ganmacs/rack,tylergannon/rack,jeremyf/rack,akihiro17/rack,liamseanbrady/rack,fabianrbz/rack,chneukirchen/rack,zjsxwc/rack,Codeman655/rack,trexnix/rack,ktheory/rack,gfvcastro/rack,evanphx/rack,ganmacs/rack,getaroom/rack,chneukirchen/rack,getaroom/rack,zjsxwc/rack,eins78/rack,davydovanton/rack,supzann3/rack,ngpestelos/rack,eavgerinos/rack,ngpestelos/rack,imtayadeway/rack,akihiro17/rack,jackxxu/rack,arronmabrey/rack,nmk/rack,tylergannon/rack,rwz/rack,wjordan/rack,davydovanton/rack,paulrogers/rack,Codeman655/rack,shaneog/rack,akihiro17/rack,laplaceliu/rack,fabianrbz/rack,arronmabrey/rack,keithduncan/rack,eins78/rack,Comcast/rack,maclover7/rack,wildjcrt/rack,lgierth/rack,nmk/rack,davidcelis/rack,gfvcastro/rack,gfvcastro/rack,trexnix/rack,rkh/rack,evanphx/rack,stepri/rack,laplaceliu/rack,deepj/rack,keithduncan/rack,joevandyk/rack,Eric-Guo/rack,AMekss/rack,maclover7/rack,rwz/rack,zjsxwc/rack,eavgerinos/rack,evanphx/rack,wildjcrt/rack,liamseanbrady/rack,wjordan/rack,shaneog/rack,maclover7/rack,arronmabrey/rack,trexnix/rack,Codeman655/rack,deepj/rack,wildjcrt/rack,deepj/rack,eavgerinos/rack,supzann3/rack,supzann3/rack,keepcosmos/rack,Comcast/rack,tricknotes/rack,jackxxu/rack,laplaceliu/rack,nmk/rack,imtayadeway/rack,tricknotes/rack,jeremyf/rack,liamseanbrady/rack,wjordan/rack,ngpestelos/rack,fabianrbz/rack,keepcosmos/rack,davidcelis/rack,keithduncan/rack,gioele/rack,rkh/rack,stepri/rack,stepri/rack,jackxxu/rack,chneukirchen/rack,AMekss/rack,davydovanton/rack,shaneog/rack,wycats/rack,AMekss/rack,sigmavirus24/rack,travis-repos/rack,x-team/rack-cgmasters,ktheory/rack,getaroom/rack,Eric-Guo/rack,krainboltgreene/lack,Eric-Guo/rack,ganmacs/rack,gioele/rack,eins78/rack,jhodder/rack,davidcelis/rack,imtayadeway/rack,sigmavirus24/rack,gioele/rack,rwz/rack
ruby
## Code Before: module Rack module Auth # Rack::Auth::AbstractHandler implements common authentication functionality. # # +realm+ should be set for all handlers. class AbstractHandler attr_accessor :realm def initialize(app, &authenticator) @app, @authenticator = app, authenticator end private def unauthorized(www_authenticate = challenge) return [ 401, { 'WWW-Authenticate' => www_authenticate.to_s }, [] ] end def bad_request [ 400, {}, [] ] end end end end ## Instruction: Fix of Auth::Abstract::Handler to return headers within spec. 401 and 400 responses must have Content-Type and Content-Length defined. ## Code After: module Rack module Auth # Rack::Auth::AbstractHandler implements common authentication functionality. # # +realm+ should be set for all handlers. class AbstractHandler attr_accessor :realm def initialize(app, &authenticator) @app, @authenticator = app, authenticator end private def unauthorized(www_authenticate = challenge) return [ 401, { 'Content-Type' => 'text/plain', 'Content-Length' => '0', 'WWW-Authenticate' => www_authenticate.to_s }, [] ] end def bad_request return [ 400, { 'Content-Type' => 'text/plain', 'Content-Length' => '0' }, [] ] end end end end
module Rack module Auth # Rack::Auth::AbstractHandler implements common authentication functionality. # # +realm+ should be set for all handlers. class AbstractHandler attr_accessor :realm def initialize(app, &authenticator) @app, @authenticator = app, authenticator end private def unauthorized(www_authenticate = challenge) + return [ 401, + { 'Content-Type' => 'text/plain', + 'Content-Length' => '0', - return [ 401, { 'WWW-Authenticate' => www_authenticate.to_s }, [] ] ? ------ - ---- - ----- + 'WWW-Authenticate' => www_authenticate.to_s }, + [] + ] end def bad_request - [ 400, {}, [] ] + return [ 400, + { 'Content-Type' => 'text/plain', + 'Content-Length' => '0' }, + [] + ] end end end end
13
0.464286
11
2
282e0c5177e4bcf16e8594d9d97d97b2d63dd94c
ImpetusSound.as
ImpetusSound.as
package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; public class ImpetusSound { private var url:String; private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { this.url = url; this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; } } }
package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest; public class ImpetusSound { private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; this.sound.load(new URLRequest(url)); } } }
Load sound directly on constructor
Load sound directly on constructor
ActionScript
mit
Julow/Impetus
actionscript
## Code Before: package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; public class ImpetusSound { private var url:String; private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { this.url = url; this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; } } } ## Instruction: Load sound directly on constructor ## Code After: package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest; public class ImpetusSound { private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; this.sound.load(new URLRequest(url)); } } }
package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; + import flash.net.URLRequest; public class ImpetusSound { - private var url:String; private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { - this.url = url; this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; + + this.sound.load(new URLRequest(url)); } } }
5
0.238095
3
2
e5992a82349d3c46234bdf01d4fc703d1dca0864
autosync.sh
autosync.sh
basedir=$(dirname "$0") local_user=$(whoami) date="/usr/bin/date -R" load_config () { # Load configuration from file if [ ! -f "$basedir/sync.conf" ]; then echo "[`$date`] Config file not found: $basedir/sync.conf" echo "Please copy the sample config file and edit it accordingly" return 1 fi source $basedir/sync.conf } ############################################################################### # Main starts here ############################################################################### # Load configuration if ! load_config; then exit 1 fi $basedir/sync.sh while true do inotifywait -qqr $events /home/$local_user/$directory sleep $auto_wait $basedir/sync.sh done exit 0
basedir=$(dirname "$0") local_user=$(whoami) date="/usr/bin/date -R" load_config () { # Load configuration from file if [ ! -f "$basedir/sync.conf" ]; then echo "[`$date`] Config file not found: $basedir/sync.conf" echo "Please copy the sample config file and edit it accordingly" return 1 fi source $basedir/sync.conf } ############################################################################### # Main starts here ############################################################################### # Load configuration if ! load_config; then exit 1 fi su $local_user sh -c $basedir/sync.sh while true do inotifywait -qqr $events /home/$local_user/$directory sleep $auto_wait su $local_user sh -c $basedir/sync.sh done exit 0
Switch to local_user upon running sync.sh
Switch to local_user upon running sync.sh
Shell
mit
acch/tinysync
shell
## Code Before: basedir=$(dirname "$0") local_user=$(whoami) date="/usr/bin/date -R" load_config () { # Load configuration from file if [ ! -f "$basedir/sync.conf" ]; then echo "[`$date`] Config file not found: $basedir/sync.conf" echo "Please copy the sample config file and edit it accordingly" return 1 fi source $basedir/sync.conf } ############################################################################### # Main starts here ############################################################################### # Load configuration if ! load_config; then exit 1 fi $basedir/sync.sh while true do inotifywait -qqr $events /home/$local_user/$directory sleep $auto_wait $basedir/sync.sh done exit 0 ## Instruction: Switch to local_user upon running sync.sh ## Code After: basedir=$(dirname "$0") local_user=$(whoami) date="/usr/bin/date -R" load_config () { # Load configuration from file if [ ! -f "$basedir/sync.conf" ]; then echo "[`$date`] Config file not found: $basedir/sync.conf" echo "Please copy the sample config file and edit it accordingly" return 1 fi source $basedir/sync.conf } ############################################################################### # Main starts here ############################################################################### # Load configuration if ! load_config; then exit 1 fi su $local_user sh -c $basedir/sync.sh while true do inotifywait -qqr $events /home/$local_user/$directory sleep $auto_wait su $local_user sh -c $basedir/sync.sh done exit 0
basedir=$(dirname "$0") local_user=$(whoami) date="/usr/bin/date -R" load_config () { # Load configuration from file if [ ! -f "$basedir/sync.conf" ]; then echo "[`$date`] Config file not found: $basedir/sync.conf" echo "Please copy the sample config file and edit it accordingly" return 1 fi source $basedir/sync.conf } ############################################################################### # Main starts here ############################################################################### # Load configuration if ! load_config; then exit 1 fi - $basedir/sync.sh + su $local_user sh -c $basedir/sync.sh while true do inotifywait -qqr $events /home/$local_user/$directory sleep $auto_wait - $basedir/sync.sh + su $local_user sh -c $basedir/sync.sh done exit 0
4
0.105263
2
2
f329bbb942b26e44bf16f47fe0c98577aed739ed
pyproject.toml
pyproject.toml
[build-system] requires = ["flit"] build-backend = "flit.buildapi" [tool.flit.metadata] module = "backcall" author = "Thomas Kluyver" author-email = "thomas@kluyver.me.uk" home-page = "https://github.com/takluyver/backcall" description-file = "README.rst" classifiers = [ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ]
[build-system] requires = ["flit_core >=2,<4"] build-backend = "flit_core.buildapi" [tool.flit.metadata] module = "backcall" author = "Thomas Kluyver" author-email = "thomas@kluyver.me.uk" home-page = "https://github.com/takluyver/backcall" description-file = "README.rst" classifiers = [ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ]
Use flit_core as build backend
Use flit_core as build backend
TOML
bsd-3-clause
takluyver/backcall
toml
## Code Before: [build-system] requires = ["flit"] build-backend = "flit.buildapi" [tool.flit.metadata] module = "backcall" author = "Thomas Kluyver" author-email = "thomas@kluyver.me.uk" home-page = "https://github.com/takluyver/backcall" description-file = "README.rst" classifiers = [ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ] ## Instruction: Use flit_core as build backend ## Code After: [build-system] requires = ["flit_core >=2,<4"] build-backend = "flit_core.buildapi" [tool.flit.metadata] module = "backcall" author = "Thomas Kluyver" author-email = "thomas@kluyver.me.uk" home-page = "https://github.com/takluyver/backcall" description-file = "README.rst" classifiers = [ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ]
[build-system] - requires = ["flit"] + requires = ["flit_core >=2,<4"] ? ++++++++++++ - build-backend = "flit.buildapi" + build-backend = "flit_core.buildapi" ? +++++ [tool.flit.metadata] module = "backcall" author = "Thomas Kluyver" author-email = "thomas@kluyver.me.uk" home-page = "https://github.com/takluyver/backcall" description-file = "README.rst" classifiers = [ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', ]
4
0.25
2
2
d16d43def61b06779e9ce1d674a49ece880d11a9
Testing/Unit/Python/CMakeLists.txt
Testing/Unit/Python/CMakeLists.txt
sitk_add_python_test( Test.ImageTests "${CMAKE_CURRENT_SOURCE_DIR}/sitkImageTests.py" ) sitk_add_python_test( Test.ImageIndexing "${CMAKE_CURRENT_SOURCE_DIR}/ImageIndexingTest.py" ) sitk_add_python_test( Test.IOTest "${CMAKE_CURRENT_SOURCE_DIR}/IOTest.py" "${SimpleITK_TEST_OUTPUT_DIR}") # Numpy test. sitk_add_python_test( Test.Numpy "${CMAKE_CURRENT_SOURCE_DIR}/sitkNumpyArrayConversionTest.py" ) sitk_add_python_test( Test.ProcessObject "${CMAKE_CURRENT_SOURCE_DIR}/sitkProcessObjectTest.py" ) sitk_add_python_test( Test.ConcurrentImageRead "${CMAKE_CURRENT_SOURCE_DIR}/ConcurrentImageRead.py" ) sitk_add_python_test( Test.ArrayView "${CMAKE_CURRENT_SOURCE_DIR}/sitkGetArrayViewFromImageTest.py" )
sitk_add_python_test( Test.ImageTests "${CMAKE_CURRENT_SOURCE_DIR}/sitkImageTests.py" ) sitk_add_python_test( Test.ImageIndexing "${CMAKE_CURRENT_SOURCE_DIR}/ImageIndexingTest.py" ) sitk_add_python_test( Test.IOTest "${CMAKE_CURRENT_SOURCE_DIR}/IOTest.py" "${SimpleITK_TEST_OUTPUT_DIR}") # Numpy test. sitk_add_python_test( Test.Numpy "${CMAKE_CURRENT_SOURCE_DIR}/sitkNumpyArrayConversionTest.py" ) sitk_add_python_test( Test.ProcessObject "${CMAKE_CURRENT_SOURCE_DIR}/sitkProcessObjectTest.py" ) sitk_add_python_test( Test.ConcurrentImageRead "${CMAKE_CURRENT_SOURCE_DIR}/ConcurrentImageRead.py" ) set_tests_properties( Python.Test.ConcurrentImageRead PROPERTIES LABEL "UNSTABLE" ) sitk_add_python_test( Test.ArrayView "${CMAKE_CURRENT_SOURCE_DIR}/sitkGetArrayViewFromImageTest.py" )
Mark Python.Test.ConcurrentImageRead test with UNSTABLE label
Mark Python.Test.ConcurrentImageRead test with UNSTABLE label This test is failing on OX systems and the manylinux distribution system. We are introducing the "UNSTABLE" ctest label so that test that may fail can be excluded when test need to pass for distributions or what not.
Text
apache-2.0
SimpleITK/SimpleITK,blowekamp/SimpleITK,richardbeare/SimpleITK,kaspermarstal/SimpleElastix,InsightSoftwareConsortium/SimpleITK,InsightSoftwareConsortium/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,kaspermarstal/SimpleElastix,richardbeare/SimpleITK,kaspermarstal/SimpleElastix,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,blowekamp/SimpleITK,kaspermarstal/SimpleElastix,blowekamp/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,kaspermarstal/SimpleElastix,kaspermarstal/SimpleElastix,SimpleITK/SimpleITK,SimpleITK/SimpleITK,SimpleITK/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,richardbeare/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,kaspermarstal/SimpleElastix,richardbeare/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK
text
## Code Before: sitk_add_python_test( Test.ImageTests "${CMAKE_CURRENT_SOURCE_DIR}/sitkImageTests.py" ) sitk_add_python_test( Test.ImageIndexing "${CMAKE_CURRENT_SOURCE_DIR}/ImageIndexingTest.py" ) sitk_add_python_test( Test.IOTest "${CMAKE_CURRENT_SOURCE_DIR}/IOTest.py" "${SimpleITK_TEST_OUTPUT_DIR}") # Numpy test. sitk_add_python_test( Test.Numpy "${CMAKE_CURRENT_SOURCE_DIR}/sitkNumpyArrayConversionTest.py" ) sitk_add_python_test( Test.ProcessObject "${CMAKE_CURRENT_SOURCE_DIR}/sitkProcessObjectTest.py" ) sitk_add_python_test( Test.ConcurrentImageRead "${CMAKE_CURRENT_SOURCE_DIR}/ConcurrentImageRead.py" ) sitk_add_python_test( Test.ArrayView "${CMAKE_CURRENT_SOURCE_DIR}/sitkGetArrayViewFromImageTest.py" ) ## Instruction: Mark Python.Test.ConcurrentImageRead test with UNSTABLE label This test is failing on OX systems and the manylinux distribution system. We are introducing the "UNSTABLE" ctest label so that test that may fail can be excluded when test need to pass for distributions or what not. ## Code After: sitk_add_python_test( Test.ImageTests "${CMAKE_CURRENT_SOURCE_DIR}/sitkImageTests.py" ) sitk_add_python_test( Test.ImageIndexing "${CMAKE_CURRENT_SOURCE_DIR}/ImageIndexingTest.py" ) sitk_add_python_test( Test.IOTest "${CMAKE_CURRENT_SOURCE_DIR}/IOTest.py" "${SimpleITK_TEST_OUTPUT_DIR}") # Numpy test. sitk_add_python_test( Test.Numpy "${CMAKE_CURRENT_SOURCE_DIR}/sitkNumpyArrayConversionTest.py" ) sitk_add_python_test( Test.ProcessObject "${CMAKE_CURRENT_SOURCE_DIR}/sitkProcessObjectTest.py" ) sitk_add_python_test( Test.ConcurrentImageRead "${CMAKE_CURRENT_SOURCE_DIR}/ConcurrentImageRead.py" ) set_tests_properties( Python.Test.ConcurrentImageRead PROPERTIES LABEL "UNSTABLE" ) sitk_add_python_test( Test.ArrayView "${CMAKE_CURRENT_SOURCE_DIR}/sitkGetArrayViewFromImageTest.py" )
sitk_add_python_test( Test.ImageTests "${CMAKE_CURRENT_SOURCE_DIR}/sitkImageTests.py" ) sitk_add_python_test( Test.ImageIndexing "${CMAKE_CURRENT_SOURCE_DIR}/ImageIndexingTest.py" ) sitk_add_python_test( Test.IOTest "${CMAKE_CURRENT_SOURCE_DIR}/IOTest.py" "${SimpleITK_TEST_OUTPUT_DIR}") # Numpy test. sitk_add_python_test( Test.Numpy "${CMAKE_CURRENT_SOURCE_DIR}/sitkNumpyArrayConversionTest.py" ) sitk_add_python_test( Test.ProcessObject "${CMAKE_CURRENT_SOURCE_DIR}/sitkProcessObjectTest.py" ) sitk_add_python_test( Test.ConcurrentImageRead "${CMAKE_CURRENT_SOURCE_DIR}/ConcurrentImageRead.py" ) + set_tests_properties( Python.Test.ConcurrentImageRead PROPERTIES LABEL "UNSTABLE" ) sitk_add_python_test( Test.ArrayView "${CMAKE_CURRENT_SOURCE_DIR}/sitkGetArrayViewFromImageTest.py" )
1
0.037037
1
0
a2cfcefc4d292a24347cbbd3152bbe9aea255b61
CMakeLists.txt
CMakeLists.txt
cmake_minimum_required(VERSION 2.8) project(nosecone CXX) set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic") set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_subdirectory(3rdparty) find_library(LIB_ARCHIVE NAMES archive PATHS ${3RDPARTY_USR}/lib) find_library(LIB_CURL NAMES curl PATHS ${3RDPARTY_USR}/lib) include_directories(src) file(GLOB NSCN_SOURCES src/nosecone/*.cpp) add_executable(nscn ${NSCN_SOURCES}) target_link_libraries(nscn ${LIB_ARCHIVE} ${LIB_CURL})
cmake_minimum_required(VERSION 2.8) project(nosecone CXX) set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic") set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_subdirectory(3rdparty) find_library(LIB_ARCHIVE NAMES archive PATHS ${3RDPARTY_USR}/lib) find_library(LIB_CURL NAMES curl PATHS ${3RDPARTY_USR}/lib) include_directories(src) include_directories(${3RDPARTY_USR}/include) file(GLOB NSCN_SOURCES src/nosecone/*.cpp) add_executable(nscn ${NSCN_SOURCES}) target_link_libraries(nscn ${LIB_ARCHIVE} ${LIB_CURL})
Fix for not including 3rdparty includes in path.
build: Fix for not including 3rdparty includes in path.
Text
apache-2.0
cdaylward/nosecone,cdaylward/nosecone
text
## Code Before: cmake_minimum_required(VERSION 2.8) project(nosecone CXX) set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic") set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_subdirectory(3rdparty) find_library(LIB_ARCHIVE NAMES archive PATHS ${3RDPARTY_USR}/lib) find_library(LIB_CURL NAMES curl PATHS ${3RDPARTY_USR}/lib) include_directories(src) file(GLOB NSCN_SOURCES src/nosecone/*.cpp) add_executable(nscn ${NSCN_SOURCES}) target_link_libraries(nscn ${LIB_ARCHIVE} ${LIB_CURL}) ## Instruction: build: Fix for not including 3rdparty includes in path. ## Code After: cmake_minimum_required(VERSION 2.8) project(nosecone CXX) set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic") set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_subdirectory(3rdparty) find_library(LIB_ARCHIVE NAMES archive PATHS ${3RDPARTY_USR}/lib) find_library(LIB_CURL NAMES curl PATHS ${3RDPARTY_USR}/lib) include_directories(src) include_directories(${3RDPARTY_USR}/include) file(GLOB NSCN_SOURCES src/nosecone/*.cpp) add_executable(nscn ${NSCN_SOURCES}) target_link_libraries(nscn ${LIB_ARCHIVE} ${LIB_CURL})
cmake_minimum_required(VERSION 2.8) project(nosecone CXX) set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -pedantic") set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) add_subdirectory(3rdparty) find_library(LIB_ARCHIVE NAMES archive PATHS ${3RDPARTY_USR}/lib) find_library(LIB_CURL NAMES curl PATHS ${3RDPARTY_USR}/lib) include_directories(src) + include_directories(${3RDPARTY_USR}/include) file(GLOB NSCN_SOURCES src/nosecone/*.cpp) add_executable(nscn ${NSCN_SOURCES}) target_link_libraries(nscn ${LIB_ARCHIVE} ${LIB_CURL})
1
0.052632
1
0
7182dd2a0e15dcb9870ed268d56c798d7068066d
server/config/routes.js
server/config/routes.js
var studentsController = require('../controllers/students'); var teachersController = require('../controllers/teachers'); var authenticationController = require('../controllers/authenticate'); module.exports = function(app, express, io) { app.get('/login', authenticationController.login); app.get('/signup', authenticationController.signup); //app.get('/teachers/poll', teachersController.pollClass); //app.get('/teachers/thumbs', teachersController.thumbsCheck); app.get('/teachers/thumbs', teachersController.thumbsCheck.bind(this, io)); // app.post('/teachers/poll', teachersController.pollClass); app.get('/teachers/lessons/:classId', teachersController.getLessons); app.get('/teachers/polls/:lessonId', teachersController.getPolls); app.post('/teachers/polls', teachersController.newPoll); //app.get('/classDismissed', teachersController.endClass); app.get('/students/ready', studentsController.readyStage.bind(this, io)); };
var studentsController = require('../controllers/students'); var teachersController = require('../controllers/teachers'); var authenticationController = require('../controllers/authenticate'); module.exports = function(app, io) { app.get('/login', authenticationController.login); app.get('/signup', authenticationController.signup); //app.get('/teachers/poll', teachersController.pollClass); //app.get('/teachers/thumbs', teachersController.thumbsCheck); app.get('/teachers/thumbs', teachersController.thumbsCheck(io)); // app.post('/teachers/poll', teachersController.pollClass); app.get('/teachers/lessons/:classId', teachersController.getLessons); app.get('/teachers/polls/:lessonId', teachersController.getPolls); app.post('/teachers/polls', teachersController.newPoll); //app.get('/classDismissed', teachersController.endClass); app.get('/students/ready', studentsController.readyStage(io)); };
Remove express reference, send only app object
Remove express reference, send only app object
JavaScript
mit
absurdSquid/thumbroll,shanemcgraw/thumbroll,shanemcgraw/thumbroll,Jakeyrob/thumbroll,Jakeyrob/thumbroll,Jakeyrob/thumbroll,shanemcgraw/thumbroll,absurdSquid/thumbroll
javascript
## Code Before: var studentsController = require('../controllers/students'); var teachersController = require('../controllers/teachers'); var authenticationController = require('../controllers/authenticate'); module.exports = function(app, express, io) { app.get('/login', authenticationController.login); app.get('/signup', authenticationController.signup); //app.get('/teachers/poll', teachersController.pollClass); //app.get('/teachers/thumbs', teachersController.thumbsCheck); app.get('/teachers/thumbs', teachersController.thumbsCheck.bind(this, io)); // app.post('/teachers/poll', teachersController.pollClass); app.get('/teachers/lessons/:classId', teachersController.getLessons); app.get('/teachers/polls/:lessonId', teachersController.getPolls); app.post('/teachers/polls', teachersController.newPoll); //app.get('/classDismissed', teachersController.endClass); app.get('/students/ready', studentsController.readyStage.bind(this, io)); }; ## Instruction: Remove express reference, send only app object ## Code After: var studentsController = require('../controllers/students'); var teachersController = require('../controllers/teachers'); var authenticationController = require('../controllers/authenticate'); module.exports = function(app, io) { app.get('/login', authenticationController.login); app.get('/signup', authenticationController.signup); //app.get('/teachers/poll', teachersController.pollClass); //app.get('/teachers/thumbs', teachersController.thumbsCheck); app.get('/teachers/thumbs', teachersController.thumbsCheck(io)); // app.post('/teachers/poll', teachersController.pollClass); app.get('/teachers/lessons/:classId', teachersController.getLessons); app.get('/teachers/polls/:lessonId', teachersController.getPolls); app.post('/teachers/polls', teachersController.newPoll); //app.get('/classDismissed', teachersController.endClass); app.get('/students/ready', studentsController.readyStage(io)); };
var studentsController = require('../controllers/students'); var teachersController = require('../controllers/teachers'); var authenticationController = require('../controllers/authenticate'); - module.exports = function(app, express, io) { ? --------- + module.exports = function(app, io) { app.get('/login', authenticationController.login); app.get('/signup', authenticationController.signup); //app.get('/teachers/poll', teachersController.pollClass); //app.get('/teachers/thumbs', teachersController.thumbsCheck); - app.get('/teachers/thumbs', teachersController.thumbsCheck.bind(this, io)); ? ----- ------ + app.get('/teachers/thumbs', teachersController.thumbsCheck(io)); // app.post('/teachers/poll', teachersController.pollClass); app.get('/teachers/lessons/:classId', teachersController.getLessons); app.get('/teachers/polls/:lessonId', teachersController.getPolls); app.post('/teachers/polls', teachersController.newPoll); //app.get('/classDismissed', teachersController.endClass); - app.get('/students/ready', studentsController.readyStage.bind(this, io)); ? ----- ------ + app.get('/students/ready', studentsController.readyStage(io)); };
6
0.24
3
3
bedada90c92ffdc96ede6069e69c1c1c1d3c5332
src/Infrastructure/Security/Auth/CryptedPasswordHandler.php
src/Infrastructure/Security/Auth/CryptedPasswordHandler.php
<?php namespace Honeybee\Infrastructure\Security\Auth; class CryptedPasswordHandler implements PasswordHandlerInterface { public function hash($password) { $options = [ 'cost' => 11, 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM) ]; return password_hash($password, PASSWORD_BCRYPT, $options); } public function verify($password, $challenge) { return password_verify($password, $challenge); } }
<?php namespace Honeybee\Infrastructure\Security\Auth; class CryptedPasswordHandler implements PasswordHandlerInterface { public function hash($password) { $options = [ 'cost' => 11 ]; return password_hash($password, PASSWORD_BCRYPT, $options); } public function verify($password, $challenge) { return password_verify($password, $challenge); } }
Fix PHP 7.0.* warning for password_hash deprecated option
Fix PHP 7.0.* warning for password_hash deprecated option From php.net: - The salt option has been deprecated as of PHP 7.0.0. It is now preferred to simply use the salt that is generated by default closes #80
PHP
mpl-2.0
honeybee/honeybee
php
## Code Before: <?php namespace Honeybee\Infrastructure\Security\Auth; class CryptedPasswordHandler implements PasswordHandlerInterface { public function hash($password) { $options = [ 'cost' => 11, 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM) ]; return password_hash($password, PASSWORD_BCRYPT, $options); } public function verify($password, $challenge) { return password_verify($password, $challenge); } } ## Instruction: Fix PHP 7.0.* warning for password_hash deprecated option From php.net: - The salt option has been deprecated as of PHP 7.0.0. It is now preferred to simply use the salt that is generated by default closes #80 ## Code After: <?php namespace Honeybee\Infrastructure\Security\Auth; class CryptedPasswordHandler implements PasswordHandlerInterface { public function hash($password) { $options = [ 'cost' => 11 ]; return password_hash($password, PASSWORD_BCRYPT, $options); } public function verify($password, $challenge) { return password_verify($password, $challenge); } }
<?php namespace Honeybee\Infrastructure\Security\Auth; class CryptedPasswordHandler implements PasswordHandlerInterface { public function hash($password) { $options = [ - 'cost' => 11, ? - + 'cost' => 11 - 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM) ]; return password_hash($password, PASSWORD_BCRYPT, $options); } public function verify($password, $challenge) { return password_verify($password, $challenge); } }
3
0.142857
1
2
9ffa26a9fd7be49251fa7b0a3fa39f586b323186
README.md
README.md
Router5 website
Router5 website # Building Install dependencies via `npm install`. Make your changes to the `_` prefixed directories, e.g., `_guides/middleware.md`. Then to build the site run `npm run build`.
Add build instructions to readme
Add build instructions to readme
Markdown
mit
router5/router5.github.io
markdown
## Code Before: Router5 website ## Instruction: Add build instructions to readme ## Code After: Router5 website # Building Install dependencies via `npm install`. Make your changes to the `_` prefixed directories, e.g., `_guides/middleware.md`. Then to build the site run `npm run build`.
Router5 website + + # Building + Install dependencies via `npm install`. + + Make your changes to the `_` prefixed directories, e.g., `_guides/middleware.md`. + + Then to build the site run `npm run build`.
7
7
7
0