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
7bc6a92d3b170b22790a4bfb0f628040d9fea725
scss/_forms.scss
scss/_forms.scss
.btn { font-family: $font-family-serif; text-transform: uppercase; letter-spacing: 1px; }
.btn { font-family: $font-family-serif; text-transform: uppercase; letter-spacing: 1px; } form { // We are overriding Bootstrap here, to remove the margin on top .help-block { margin-top: 0; } .text-danger { margin-top: 5px; } .text-danger { margin-bottom: 0; } #location_id + .text-danger { margin-top: -10px; margin-bottom: 15px; } .help-block { margin-bottom: $line-height-computed / 2; } }
Improve styling of form errors
Improve styling of form errors
SCSS
agpl-3.0
takkaria/echojs,takkaria/echojs,takkaria/echojs
scss
## Code Before: .btn { font-family: $font-family-serif; text-transform: uppercase; letter-spacing: 1px; } ## Instruction: Improve styling of form errors ## Code After: .btn { font-family: $font-family-serif; text-transform: uppercase; letter-spacing: 1px; } form { // We are overriding Bootstrap here, to remove the margin on top .help-block { margin-top: 0; } .text-danger { margin-top: 5px; } .text-danger { margin-bottom: 0; } #location_id + .text-danger { margin-top: -10px; margin-bottom: 15px; } .help-block { margin-bottom: $line-height-computed / 2; } }
.btn { font-family: $font-family-serif; text-transform: uppercase; letter-spacing: 1px; } + + form { + // We are overriding Bootstrap here, to remove the margin on top + .help-block { + margin-top: 0; + } + + .text-danger { + margin-top: 5px; + } + + .text-danger { + margin-bottom: 0; + } + + #location_id + .text-danger { + margin-top: -10px; + margin-bottom: 15px; + } + + .help-block { + margin-bottom: $line-height-computed / 2; + } + }
24
4
24
0
9e1a71da1572f226997219af205ad470a8bb51a3
README.md
README.md
This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items with the [circuit node SDK](https://circuitsandbox.net/sdk/) ## Recommended ## * [node 6.x LTS](http://nodejs.org/download/) * [circuit module](https://circuitsandbox.net/sdk/) ## Getting Started ## ```bash git clone https://github.com/circuit-sandbox/xlator-bot.git cd xlator-bot cp config.json.template config.json ``` Edit config.json * Change "client_id" and "client_secret" to the circuit account you'll use for the Xlator Bot. you can request client credentials for bots here https://circuit.github.io/oauth.html. * Change the apiKey to a google "Key for server applications" with access to the "Translate API". ```bash "client_id" : "your circuit client id", "client_secret" : "your circuit secret", "domain" : "circuitsandbox.net", "apiKey" : "google translation API key", ``` Run the sample application with ```bash npm install curl "https://circuitsandbox.net/circuit.tgz" -o "circuit.tgz" npm install circuit.tgz node index.js ``` Add the Xlator Bot user to one of your circuit conversations. The Xlator Bot will translate posts and reply with a comment. By default translation is done to English. The Xlator Bot will attempt to translate to another language if the first word of a post matches one of the languages in lang.json.
This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items with the [circuit node SDK](https://circuitsandbox.net/sdk/) ## Recommended ## * [node 6.x LTS](http://nodejs.org/download/) * [circuit module](https://circuitsandbox.net/sdk/) ## Getting Started ## ```bash git clone https://github.com/circuit-sandbox/xlator-bot.git cd xlator-bot cp config.json.template config.json ``` Edit config.json * Change "client_id" and "client_secret" to the circuit account you'll use for the Xlator Bot. you can request client credentials for bots here https://circuit.github.io/oauth.html. * Change the apiKey to a google "Key for server applications" with access to the "Translate API". ```bash "client_id" : "your circuit client id", "client_secret" : "your circuit secret", "domain" : "circuitsandbox.net", "apiKey" : "google translation API key", ``` Run the sample application with ```bash npm install node index.js ``` Add the Xlator Bot user to one of your circuit conversations. The Xlator Bot will translate posts and reply with a comment. By default translation is done to English. The Xlator Bot will attempt to translate to another language if the first word of a post matches one of the languages in lang.json.
Update to use circuit-node-sdk instead of circuit
Update to use circuit-node-sdk instead of circuit
Markdown
mit
yourcircuit/xlator-bot
markdown
## Code Before: This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items with the [circuit node SDK](https://circuitsandbox.net/sdk/) ## Recommended ## * [node 6.x LTS](http://nodejs.org/download/) * [circuit module](https://circuitsandbox.net/sdk/) ## Getting Started ## ```bash git clone https://github.com/circuit-sandbox/xlator-bot.git cd xlator-bot cp config.json.template config.json ``` Edit config.json * Change "client_id" and "client_secret" to the circuit account you'll use for the Xlator Bot. you can request client credentials for bots here https://circuit.github.io/oauth.html. * Change the apiKey to a google "Key for server applications" with access to the "Translate API". ```bash "client_id" : "your circuit client id", "client_secret" : "your circuit secret", "domain" : "circuitsandbox.net", "apiKey" : "google translation API key", ``` Run the sample application with ```bash npm install curl "https://circuitsandbox.net/circuit.tgz" -o "circuit.tgz" npm install circuit.tgz node index.js ``` Add the Xlator Bot user to one of your circuit conversations. The Xlator Bot will translate posts and reply with a comment. By default translation is done to English. The Xlator Bot will attempt to translate to another language if the first word of a post matches one of the languages in lang.json. ## Instruction: Update to use circuit-node-sdk instead of circuit ## Code After: This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items with the [circuit node SDK](https://circuitsandbox.net/sdk/) ## Recommended ## * [node 6.x LTS](http://nodejs.org/download/) * [circuit module](https://circuitsandbox.net/sdk/) ## Getting Started ## ```bash git clone https://github.com/circuit-sandbox/xlator-bot.git cd xlator-bot cp config.json.template config.json ``` Edit config.json * Change "client_id" and "client_secret" to the circuit account you'll use for the Xlator Bot. you can request client credentials for bots here https://circuit.github.io/oauth.html. * Change the apiKey to a google "Key for server applications" with access to the "Translate API". ```bash "client_id" : "your circuit client id", "client_secret" : "your circuit secret", "domain" : "circuitsandbox.net", "apiKey" : "google translation API key", ``` Run the sample application with ```bash npm install node index.js ``` Add the Xlator Bot user to one of your circuit conversations. The Xlator Bot will translate posts and reply with a comment. By default translation is done to English. The Xlator Bot will attempt to translate to another language if the first word of a post matches one of the languages in lang.json.
This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items with the [circuit node SDK](https://circuitsandbox.net/sdk/) ## Recommended ## * [node 6.x LTS](http://nodejs.org/download/) * [circuit module](https://circuitsandbox.net/sdk/) ## Getting Started ## ```bash git clone https://github.com/circuit-sandbox/xlator-bot.git cd xlator-bot cp config.json.template config.json ``` Edit config.json * Change "client_id" and "client_secret" to the circuit account you'll use for the Xlator Bot. you can request client credentials for bots here https://circuit.github.io/oauth.html. * Change the apiKey to a google "Key for server applications" with access to the "Translate API". ```bash "client_id" : "your circuit client id", "client_secret" : "your circuit secret", "domain" : "circuitsandbox.net", "apiKey" : "google translation API key", - ``` ? - + ``` - Run the sample application with ? - + Run the sample application with ```bash npm install - curl "https://circuitsandbox.net/circuit.tgz" -o "circuit.tgz" - npm install circuit.tgz node index.js - ``` ? - + ``` Add the Xlator Bot user to one of your circuit conversations. The Xlator Bot will translate posts and reply with a comment. By default translation is done to English. The Xlator Bot will attempt to translate to another language if the first word of a post matches one of the languages in lang.json.
8
0.222222
3
5
737ab9ee2417ffa9005d020e15cd0037818c92ff
invoicing/lib/invoicing.rb
invoicing/lib/invoicing.rb
require 'activerecord' require 'invoicing/class_info' # load first because other modules depend on this Dir.glob(File.join(File.dirname(__FILE__), 'invoicing/**/*.rb')).sort.each {|f| require f } # Mix all modules Invoicing::*::ActMethods into ActiveRecord::Base as class methods Invoicing.constants.map{|c| Invoicing.const_get(c) }.select{|m| m.is_a?(Module) && m.const_defined?('ActMethods') }.each{ |m| ActiveRecord::Base.send(:extend, m.const_get('ActMethods')) }
$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) require 'activerecord' require 'invoicing/class_info' # load first because other modules depend on this Dir.glob(File.join(File.dirname(__FILE__), 'invoicing/**/*.rb')).sort.each {|f| require f } # Mix all modules Invoicing::*::ActMethods into ActiveRecord::Base as class methods Invoicing.constants.map{|c| Invoicing.const_get(c) }.select{|m| m.is_a?(Module) && m.const_defined?('ActMethods') }.each{ |m| ActiveRecord::Base.send(:extend, m.const_get('ActMethods')) }
Undo commit 0616e068 - needed for unit testing
Undo commit 0616e068 - needed for unit testing
Ruby
mit
herosky/invoicing,ept/invoicing,code-mancers/invoicing,ept/invoicing,code-mancers/invoicing,herosky/invoicing,ept/invoicing_generator,code-mancers/invoicing,herosky/invoicing,ept/invoicing
ruby
## Code Before: require 'activerecord' require 'invoicing/class_info' # load first because other modules depend on this Dir.glob(File.join(File.dirname(__FILE__), 'invoicing/**/*.rb')).sort.each {|f| require f } # Mix all modules Invoicing::*::ActMethods into ActiveRecord::Base as class methods Invoicing.constants.map{|c| Invoicing.const_get(c) }.select{|m| m.is_a?(Module) && m.const_defined?('ActMethods') }.each{ |m| ActiveRecord::Base.send(:extend, m.const_get('ActMethods')) } ## Instruction: Undo commit 0616e068 - needed for unit testing ## Code After: $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) require 'activerecord' require 'invoicing/class_info' # load first because other modules depend on this Dir.glob(File.join(File.dirname(__FILE__), 'invoicing/**/*.rb')).sort.each {|f| require f } # Mix all modules Invoicing::*::ActMethods into ActiveRecord::Base as class methods Invoicing.constants.map{|c| Invoicing.const_get(c) }.select{|m| m.is_a?(Module) && m.const_defined?('ActMethods') }.each{ |m| ActiveRecord::Base.send(:extend, m.const_get('ActMethods')) }
+ $:.unshift(File.dirname(__FILE__)) unless + $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) + require 'activerecord' require 'invoicing/class_info' # load first because other modules depend on this Dir.glob(File.join(File.dirname(__FILE__), 'invoicing/**/*.rb')).sort.each {|f| require f } # Mix all modules Invoicing::*::ActMethods into ActiveRecord::Base as class methods Invoicing.constants.map{|c| Invoicing.const_get(c) }.select{|m| m.is_a?(Module) && m.const_defined?('ActMethods') }.each{ |m| ActiveRecord::Base.send(:extend, m.const_get('ActMethods')) }
3
0.333333
3
0
97d4f6f7d43b9b1facf570b5f5a199e99823af71
client/src/components/viewscreens/ShipLogo.scss
client/src/components/viewscreens/ShipLogo.scss
.ShipLogo { height: 100%; display: flex; justify-content: center; align-items: center; .shadow { width: 50%; height: 5px; border-radius: 75%; margin: 0 auto; margin-bottom: 20px; box-shadow: 0 25px 20px 5px rgba(0, 0, 0, 1); } h1 { font-size: 50px; } .logo { animation: spin 4s linear infinite; max-height: 70%; width: 100%; } } @keyframes spin { 0% { transform: perspective(100vh) rotateY(-90deg); } 100% { transform: perspective(100vh) rotateY(90deg); } }
.ShipLogo { height: 100%; display: flex; justify-content: center; align-items: center; .shadow { width: 50%; height: 5px; border-radius: 75%; margin: 0 auto; margin-bottom: 20px; box-shadow: 0 25px 20px 5px rgba(0, 0, 0, 1); } h1 { font-size: 50px; } .logo { animation: spin 4s linear infinite; max-height: 70%; width: 100%; object-fit: contain; } } @keyframes spin { 0% { transform: perspective(100vh) rotateY(-90deg); } 100% { transform: perspective(100vh) rotateY(90deg); } }
Fix stretching on the ship logo
Fix stretching on the ship logo
SCSS
apache-2.0
Thorium-Sim/thorium,Thorium-Sim/thorium,Thorium-Sim/thorium,Thorium-Sim/thorium
scss
## Code Before: .ShipLogo { height: 100%; display: flex; justify-content: center; align-items: center; .shadow { width: 50%; height: 5px; border-radius: 75%; margin: 0 auto; margin-bottom: 20px; box-shadow: 0 25px 20px 5px rgba(0, 0, 0, 1); } h1 { font-size: 50px; } .logo { animation: spin 4s linear infinite; max-height: 70%; width: 100%; } } @keyframes spin { 0% { transform: perspective(100vh) rotateY(-90deg); } 100% { transform: perspective(100vh) rotateY(90deg); } } ## Instruction: Fix stretching on the ship logo ## Code After: .ShipLogo { height: 100%; display: flex; justify-content: center; align-items: center; .shadow { width: 50%; height: 5px; border-radius: 75%; margin: 0 auto; margin-bottom: 20px; box-shadow: 0 25px 20px 5px rgba(0, 0, 0, 1); } h1 { font-size: 50px; } .logo { animation: spin 4s linear infinite; max-height: 70%; width: 100%; object-fit: contain; } } @keyframes spin { 0% { transform: perspective(100vh) rotateY(-90deg); } 100% { transform: perspective(100vh) rotateY(90deg); } }
.ShipLogo { height: 100%; display: flex; justify-content: center; align-items: center; .shadow { width: 50%; height: 5px; border-radius: 75%; margin: 0 auto; margin-bottom: 20px; box-shadow: 0 25px 20px 5px rgba(0, 0, 0, 1); } h1 { font-size: 50px; } .logo { animation: spin 4s linear infinite; max-height: 70%; width: 100%; + object-fit: contain; } } @keyframes spin { 0% { transform: perspective(100vh) rotateY(-90deg); } 100% { transform: perspective(100vh) rotateY(90deg); } }
1
0.033333
1
0
e58c78fea4b604905333b490a22e640477d5e2d5
django_pytest/test_runner.py
django_pytest/test_runner.py
def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]): import sys from pkg_resources import load_entry_point sys.argv[1:] = sys.argv[2:] # Remove stop word (--) from argument list again. This separates Django # command options from py.test ones. try: del sys.argv[sys.argv.index('--')] except ValueError: pass try: entry_point = load_entry_point('py>=1.0.0', 'console_scripts', 'py.test') except ImportError: entry_point = load_entry_point('pytest>=2.0', 'console_scripts', 'py.test') sys.exit(entry_point())
class TestRunner(object): def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs): self.verbosity = verbosity self.interactive = interactive self.failfast = failfast def run_tests(self, test_labels): import pytest import sys if test_labels is None: print ('Not yet implemented: py.test is still not able to ' 'discover the tests in all the INSTALLED_APPS as Django ' 'requires.') exit(1) pytest_args = [] if self.failfast: pytest_args.append('--exitfirst') if self.verbosity == 0: pytest_args.append('--quiet') elif self.verbosity > 1: pytest_args.append('--verbose') # Remove arguments before (--). This separates Django command options # from py.test ones. try: pytest_args_index = sys.argv.index('--') + 1 pytest_args.extend(sys.argv[pytest_args_index:]) except ValueError: pass sys.exit(pytest.main(pytest_args)) # Keep the old name to be backwards-compatible def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]): runner = TestRunner(verbosity, interactive, failfast=False) runner.run_tests(test_labels)
Add a new TestRunner class to remove Django deprecation warnings
Add a new TestRunner class to remove Django deprecation warnings
Python
bsd-3-clause
buchuki/django-pytest,0101/django-pytest
python
## Code Before: def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]): import sys from pkg_resources import load_entry_point sys.argv[1:] = sys.argv[2:] # Remove stop word (--) from argument list again. This separates Django # command options from py.test ones. try: del sys.argv[sys.argv.index('--')] except ValueError: pass try: entry_point = load_entry_point('py>=1.0.0', 'console_scripts', 'py.test') except ImportError: entry_point = load_entry_point('pytest>=2.0', 'console_scripts', 'py.test') sys.exit(entry_point()) ## Instruction: Add a new TestRunner class to remove Django deprecation warnings ## Code After: class TestRunner(object): def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs): self.verbosity = verbosity self.interactive = interactive self.failfast = failfast def run_tests(self, test_labels): import pytest import sys if test_labels is None: print ('Not yet implemented: py.test is still not able to ' 'discover the tests in all the INSTALLED_APPS as Django ' 'requires.') exit(1) pytest_args = [] if self.failfast: pytest_args.append('--exitfirst') if self.verbosity == 0: pytest_args.append('--quiet') elif self.verbosity > 1: pytest_args.append('--verbose') # Remove arguments before (--). This separates Django command options # from py.test ones. try: pytest_args_index = sys.argv.index('--') + 1 pytest_args.extend(sys.argv[pytest_args_index:]) except ValueError: pass sys.exit(pytest.main(pytest_args)) # Keep the old name to be backwards-compatible def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]): runner = TestRunner(verbosity, interactive, failfast=False) runner.run_tests(test_labels)
+ class TestRunner(object): + def __init__(self, verbosity=1, interactive=True, failfast=True, **kwargs): + self.verbosity = verbosity + self.interactive = interactive + self.failfast = failfast + + def run_tests(self, test_labels): + import pytest + import sys + + if test_labels is None: + print ('Not yet implemented: py.test is still not able to ' + 'discover the tests in all the INSTALLED_APPS as Django ' + 'requires.') + exit(1) + + pytest_args = [] + if self.failfast: + pytest_args.append('--exitfirst') + if self.verbosity == 0: + pytest_args.append('--quiet') + elif self.verbosity > 1: + pytest_args.append('--verbose') + + # Remove arguments before (--). This separates Django command options + # from py.test ones. + try: + pytest_args_index = sys.argv.index('--') + 1 + pytest_args.extend(sys.argv[pytest_args_index:]) + except ValueError: + pass + + sys.exit(pytest.main(pytest_args)) + + + # Keep the old name to be backwards-compatible def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]): + runner = TestRunner(verbosity, interactive, failfast=False) + runner.run_tests(test_labels) - import sys - from pkg_resources import load_entry_point - sys.argv[1:] = sys.argv[2:] - - # Remove stop word (--) from argument list again. This separates Django - # command options from py.test ones. - try: - del sys.argv[sys.argv.index('--')] - except ValueError: - pass - - try: - entry_point = load_entry_point('py>=1.0.0', 'console_scripts', 'py.test') - except ImportError: - entry_point = load_entry_point('pytest>=2.0', 'console_scripts', 'py.test') - - sys.exit(entry_point())
55
3.055556
38
17
1ecd2dad94d7fab386ff02deb3577bf87ae0c9df
doc/source/dev/states.rst
doc/source/dev/states.rst
.. _states: ====================== Ironic's State Machine ====================== The diagram below shows the states that an Ironic node goes through during the lifetime of a node. The diagram also depicts the events that transition the node to different states. .. figure:: ../images/states.png :width: 660px :align: left :alt: Ironic state transitions .. note:: For more information about the states, see the specification located at `ironic-state-machine`_. .. _ironic-state-machine: http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html
.. _states: ====================== Ironic's State Machine ====================== State Machine Diagram ===================== The diagram below shows the provisioning states that an Ironic node goes through during the lifetime of a node. The diagram also depicts the events that transition the node to different states. .. figure:: ../images/states.png :width: 660px :align: left :alt: Ironic state transitions .. note:: For more information about the states, see the specification located at `ironic-state-machine`_. .. _ironic-state-machine: http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html
Add section header to state machines page
Add section header to state machines page This adds a section header so that a "Table of Contents" is displayed on the rendered page. This makes the page consistent with the rest of our developer documentation, since the others all have a Table Of Contents. I also added the word 'provisioning' to qualify what kind of states were being depicted here. (As opposed to power states.) Change-Id: If71679d9a5ee795c6c3a9d912f371ea04cea2753
reStructuredText
apache-2.0
dims/ironic,hpproliant/ironic,naototty/vagrant-lxc-ironic,ionutbalutoiu/ironic,NaohiroTamura/ironic,naototty/vagrant-lxc-ironic,Tan0/ironic,bacaldwell/ironic,openstack/ironic,SauloAislan/ironic,bacaldwell/ironic,NaohiroTamura/ironic,ionutbalutoiu/ironic,pshchelo/ironic,redhat-openstack/ironic,openstack/ironic,SauloAislan/ironic,pshchelo/ironic,devananda/ironic,naterh/ironic,dims/ironic
restructuredtext
## Code Before: .. _states: ====================== Ironic's State Machine ====================== The diagram below shows the states that an Ironic node goes through during the lifetime of a node. The diagram also depicts the events that transition the node to different states. .. figure:: ../images/states.png :width: 660px :align: left :alt: Ironic state transitions .. note:: For more information about the states, see the specification located at `ironic-state-machine`_. .. _ironic-state-machine: http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html ## Instruction: Add section header to state machines page This adds a section header so that a "Table of Contents" is displayed on the rendered page. This makes the page consistent with the rest of our developer documentation, since the others all have a Table Of Contents. I also added the word 'provisioning' to qualify what kind of states were being depicted here. (As opposed to power states.) Change-Id: If71679d9a5ee795c6c3a9d912f371ea04cea2753 ## Code After: .. _states: ====================== Ironic's State Machine ====================== State Machine Diagram ===================== The diagram below shows the provisioning states that an Ironic node goes through during the lifetime of a node. The diagram also depicts the events that transition the node to different states. .. figure:: ../images/states.png :width: 660px :align: left :alt: Ironic state transitions .. note:: For more information about the states, see the specification located at `ironic-state-machine`_. .. _ironic-state-machine: http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html
.. _states: ====================== Ironic's State Machine ====================== + State Machine Diagram + ===================== + - The diagram below shows the states that an Ironic node goes through during the ? ------------------- + The diagram below shows the provisioning states that an Ironic node goes ? +++++++++++++ - lifetime of a node. The diagram also depicts the events that transition ? ---------------- + through during the lifetime of a node. The diagram also depicts the events ? +++++++++++++++++++ - the node to different states. + that transition the node to different states. ? ++++++++++++++++ .. figure:: ../images/states.png :width: 660px :align: left :alt: Ironic state transitions .. note:: For more information about the states, see the specification located at `ironic-state-machine`_. .. _ironic-state-machine: http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html
9
0.428571
6
3
dc7375b5fe24b9aef0cdf2489de43750364feb76
README.rst
README.rst
gostorages ========== An unified interface to manipulate storage engine for Go. gostorages is used in `picfit <https://github.com/thoas/picfit>`_ to allow us switching over storage engine. Currently, it supports the following storages: * Amazon S3 * File system Installation ============ Just run: :: $ go get github.com/thoas/gostorages Usage ===== File system ----------- .. code-block:: go package main import ( "fmt" "github.com/thoas/gostorages" "os" ) func main() { tmp := os.TempDir() storage := gostorages.NewFileSystemStorage(tmp, "http://img.example.com") // Saving a file named test storage.Save("test", gostorages.ContentFile([]byte("(╯°□°)╯︵ ┻━┻"))) storage.URL("test") // => http://img.example.com/test // Deleting the new file on the storage storage.Delete("test") } Roadmap ======= see `issues <https://github.com/thoas/gostorages/issues>`_ Don't hesitate to send patch or improvements.
gostorages ========== An unified interface to manipulate storage engine for Go. gostorages is used in `picfit <https://github.com/thoas/picfit>`_ to allow us switching over storage engine. Currently, it supports the following storages: * Amazon S3 * File system Installation ============ Just run: :: $ go get github.com/thoas/gostorages Usage ===== It offers you a single API to manipulate your files on multiple storages. If you are migrating from a File system storage to an Amazon S3, you don't need to migrate all your methods anymore! Be lazy again! File system ----------- .. code-block:: go package main import ( "fmt" "github.com/thoas/gostorages" "os" ) func main() { tmp := os.TempDir() storage := gostorages.NewFileSystemStorage(tmp, "http://img.example.com") // Saving a file named test storage.Save("test", gostorages.ContentFile([]byte("(╯°□°)╯︵ ┻━┻"))) storage.URL("test") // => http://img.example.com/test // Deleting the new file on the storage storage.Delete("test") } Roadmap ======= see `issues <https://github.com/thoas/gostorages/issues>`_ Don't hesitate to send patch or improvements.
Add quick introduction to usage
Add quick introduction to usage
reStructuredText
mit
thoas/gostorages
restructuredtext
## Code Before: gostorages ========== An unified interface to manipulate storage engine for Go. gostorages is used in `picfit <https://github.com/thoas/picfit>`_ to allow us switching over storage engine. Currently, it supports the following storages: * Amazon S3 * File system Installation ============ Just run: :: $ go get github.com/thoas/gostorages Usage ===== File system ----------- .. code-block:: go package main import ( "fmt" "github.com/thoas/gostorages" "os" ) func main() { tmp := os.TempDir() storage := gostorages.NewFileSystemStorage(tmp, "http://img.example.com") // Saving a file named test storage.Save("test", gostorages.ContentFile([]byte("(╯°□°)╯︵ ┻━┻"))) storage.URL("test") // => http://img.example.com/test // Deleting the new file on the storage storage.Delete("test") } Roadmap ======= see `issues <https://github.com/thoas/gostorages/issues>`_ Don't hesitate to send patch or improvements. ## Instruction: Add quick introduction to usage ## Code After: gostorages ========== An unified interface to manipulate storage engine for Go. gostorages is used in `picfit <https://github.com/thoas/picfit>`_ to allow us switching over storage engine. Currently, it supports the following storages: * Amazon S3 * File system Installation ============ Just run: :: $ go get github.com/thoas/gostorages Usage ===== It offers you a single API to manipulate your files on multiple storages. If you are migrating from a File system storage to an Amazon S3, you don't need to migrate all your methods anymore! Be lazy again! File system ----------- .. code-block:: go package main import ( "fmt" "github.com/thoas/gostorages" "os" ) func main() { tmp := os.TempDir() storage := gostorages.NewFileSystemStorage(tmp, "http://img.example.com") // Saving a file named test storage.Save("test", gostorages.ContentFile([]byte("(╯°□°)╯︵ ┻━┻"))) storage.URL("test") // => http://img.example.com/test // Deleting the new file on the storage storage.Delete("test") } Roadmap ======= see `issues <https://github.com/thoas/gostorages/issues>`_ Don't hesitate to send patch or improvements.
gostorages ========== An unified interface to manipulate storage engine for Go. gostorages is used in `picfit <https://github.com/thoas/picfit>`_ to allow us switching over storage engine. Currently, it supports the following storages: * Amazon S3 * File system Installation ============ Just run: :: $ go get github.com/thoas/gostorages Usage ===== + + It offers you a single API to manipulate your files on multiple storages. + + If you are migrating from a File system storage to an Amazon S3, you don't need + to migrate all your methods anymore! + + Be lazy again! File system ----------- .. code-block:: go package main import ( "fmt" "github.com/thoas/gostorages" "os" ) func main() { tmp := os.TempDir() storage := gostorages.NewFileSystemStorage(tmp, "http://img.example.com") // Saving a file named test storage.Save("test", gostorages.ContentFile([]byte("(╯°□°)╯︵ ┻━┻"))) storage.URL("test") // => http://img.example.com/test // Deleting the new file on the storage storage.Delete("test") } Roadmap ======= see `issues <https://github.com/thoas/gostorages/issues>`_ Don't hesitate to send patch or improvements.
7
0.12069
7
0
9b75451bcfbe522661f95f0e369c2fb71e1404fe
services/irc.rb
services/irc.rb
service :irc do |data, payload| repository = payload['repository']['name'] branch = payload['ref'].split('/').last room = data['room'] room = "##{room}" unless data['room'][0].chr == '#' irc = TCPSocket.open(data['server'], data['port']) irc.puts "USER blah blah blah :blah blah" irc.puts "NICK hubbub" irc.puts "JOIN #{room}" payload['commits'].each do |sha1, commit| irc.puts "PRIVMSG #{room} :\002\00311#{repository}\002 \0037#{branch}\0030 SHA1-#{sha1[0..6]} \0033#{commit['author']['name']}" irc.puts "PRIVMSG #{room} :#{commit['message']}" irc.puts "PRIVMSG #{room} :#{commit['url']}" end irc.puts "QUIT" end
service :irc do |data, payload| repository = payload['repository']['name'] branch = payload['ref'].split('/').last rooms = data['room'].gsub(",", " ").split(" ").map{|room| room[0].chr == '#' ? room : "##{room}"} irc = TCPSocket.open(data['server'], data['port']) irc.puts "USER blah blah blah :blah blah" irc.puts "NICK hubbub" rooms.each do |room| irc.puts "JOIN #{room}" payload['commits'].each do |sha1, commit| irc.puts "PRIVMSG #{room} :\002\00311#{repository}\002 \0037#{branch}\0030 SHA1-#{sha1[0..6]} \0033#{commit['author']['name']}" irc.puts "PRIVMSG #{room} :#{commit['message']}" irc.puts "PRIVMSG #{room} :#{commit['url']}" end irc.puts "PART #{room}" end irc.puts "QUIT" end
Allow user to specify multiple rooms * Rooms should be comma- and/or space-separated
Allow user to specify multiple rooms * Rooms should be comma- and/or space-separated
Ruby
mit
Seldaek/github-services,supriyantomaftuh/github-services,brntbeer/github-services,illan/github-services,github/github-services,1234-/github-services,apiaryio/github-services,espace/github-services,travis-repos/github-services,travis-ci/github-services,wassemgtk/github-services,billiob/github-services,YOTOV-LIMITED/github-services,Jdesk/github-services,timabbott/github-services,adrianschroeter/github-services,galeksandrp/github-services,pkdevbox/github-services,progrium/github-services,elordahl/github-services,Mumakil/github-services,parshap/github-services,marko-asplund/github-services,myget/github-services,Seldaek/github-services,solanolabs/github-services,Zarthus/github-services,myget/github-services,netlify/github-services,projectkudu/github-services,timabbott/github-services,supriyantomaftuh/github-services,leah/github-services,projectkudu/github-services,1234-/github-services,headius/github-services,dataRonin/github-services,VladRassokhin/github-services,schacon/github-services,guardian/github-services,pkdevbox/github-services,netlify/github-services,stof/github-services,wassemgtk/github-services,dataRonin/github-services,headius/github-services,parshap/github-services,dustin/github-services,adrianschroeter/github-services,github/github-services,DataDog/github-services,stof/github-services,rkh/github-services,YOTOV-LIMITED/github-services,KamranMackey/github-services,galeksandrp/github-services,VladRassokhin/github-services,elordahl/github-services,brntbeer/github-services,Zarthus/github-services,apiaryio/github-services,DataDog/github-services,Mumakil/github-services,KamranMackey/github-services,troy/txlogic-services,espace/github-services,guardian/github-services,Jdesk/github-services,travis-ci/github-services,solanolabs/github-services,illan/github-services
ruby
## Code Before: service :irc do |data, payload| repository = payload['repository']['name'] branch = payload['ref'].split('/').last room = data['room'] room = "##{room}" unless data['room'][0].chr == '#' irc = TCPSocket.open(data['server'], data['port']) irc.puts "USER blah blah blah :blah blah" irc.puts "NICK hubbub" irc.puts "JOIN #{room}" payload['commits'].each do |sha1, commit| irc.puts "PRIVMSG #{room} :\002\00311#{repository}\002 \0037#{branch}\0030 SHA1-#{sha1[0..6]} \0033#{commit['author']['name']}" irc.puts "PRIVMSG #{room} :#{commit['message']}" irc.puts "PRIVMSG #{room} :#{commit['url']}" end irc.puts "QUIT" end ## Instruction: Allow user to specify multiple rooms * Rooms should be comma- and/or space-separated ## Code After: service :irc do |data, payload| repository = payload['repository']['name'] branch = payload['ref'].split('/').last rooms = data['room'].gsub(",", " ").split(" ").map{|room| room[0].chr == '#' ? room : "##{room}"} irc = TCPSocket.open(data['server'], data['port']) irc.puts "USER blah blah blah :blah blah" irc.puts "NICK hubbub" rooms.each do |room| irc.puts "JOIN #{room}" payload['commits'].each do |sha1, commit| irc.puts "PRIVMSG #{room} :\002\00311#{repository}\002 \0037#{branch}\0030 SHA1-#{sha1[0..6]} \0033#{commit['author']['name']}" irc.puts "PRIVMSG #{room} :#{commit['message']}" irc.puts "PRIVMSG #{room} :#{commit['url']}" end irc.puts "PART #{room}" end irc.puts "QUIT" end
service :irc do |data, payload| repository = payload['repository']['name'] branch = payload['ref'].split('/').last + rooms = data['room'].gsub(",", " ").split(" ").map{|room| room[0].chr == '#' ? room : "##{room}"} - room = data['room'] - room = "##{room}" unless data['room'][0].chr == '#' irc = TCPSocket.open(data['server'], data['port']) irc.puts "USER blah blah blah :blah blah" irc.puts "NICK hubbub" + rooms.each do |room| - irc.puts "JOIN #{room}" + irc.puts "JOIN #{room}" ? ++ - payload['commits'].each do |sha1, commit| + payload['commits'].each do |sha1, commit| ? ++ - irc.puts "PRIVMSG #{room} :\002\00311#{repository}\002 \0037#{branch}\0030 SHA1-#{sha1[0..6]} \0033#{commit['author']['name']}" + irc.puts "PRIVMSG #{room} :\002\00311#{repository}\002 \0037#{branch}\0030 SHA1-#{sha1[0..6]} \0033#{commit['author']['name']}" ? ++ - irc.puts "PRIVMSG #{room} :#{commit['message']}" + irc.puts "PRIVMSG #{room} :#{commit['message']}" ? ++ - irc.puts "PRIVMSG #{room} :#{commit['url']}" + irc.puts "PRIVMSG #{room} :#{commit['url']}" ? ++ + end + irc.puts "PART #{room}" end irc.puts "QUIT" end
16
1
9
7
689072150fc2ce9a7f53ba821ce33204286cb785
views/base.xml
views/base.xml
<?xml version="1.0" encoding="utf-8"?> <odoo> <data> <menuitem id="orbeon_base_menu" name="Orbeon" parent="base.menu_custom" sequence="101" /> <menuitem id="orbeon_server_menu" name="Server" parent="orbeon_base_menu" action="orbeon_server_action" sequence="20" /> <menuitem id="orbeon_builder_menu" name="Builder Forms" parent="orbeon_base_menu" action="orbeon_builder_form_action" sequence="30" /> <menuitem id="orbeon_runner_menu" name="Runner Forms" parent="orbeon_base_menu" action="orbeon_runner_form_action" sequence="40" /> </data> </odoo>
<?xml version="1.0" encoding="utf-8"?> <odoo> <data> <menuitem id="orbeon_base_menu" name="Orbeon" sequence="101" /> <menuitem id="orbeon_server_menu" name="Server" parent="orbeon_base_menu" action="orbeon_server_action" sequence="20" /> <menuitem id="orbeon_builder_menu" name="Builder Forms" parent="orbeon_base_menu" action="orbeon_builder_form_action" sequence="30" /> <menuitem id="orbeon_runner_menu" name="Runner Forms" parent="orbeon_base_menu" action="orbeon_runner_form_action" sequence="40" /> </data> </odoo>
Put the Orbeon menu under root (menus).
Put the Orbeon menu under root (menus).
XML
agpl-3.0
open2bizz/odoo-addons,open2bizz/odoo-addons
xml
## Code Before: <?xml version="1.0" encoding="utf-8"?> <odoo> <data> <menuitem id="orbeon_base_menu" name="Orbeon" parent="base.menu_custom" sequence="101" /> <menuitem id="orbeon_server_menu" name="Server" parent="orbeon_base_menu" action="orbeon_server_action" sequence="20" /> <menuitem id="orbeon_builder_menu" name="Builder Forms" parent="orbeon_base_menu" action="orbeon_builder_form_action" sequence="30" /> <menuitem id="orbeon_runner_menu" name="Runner Forms" parent="orbeon_base_menu" action="orbeon_runner_form_action" sequence="40" /> </data> </odoo> ## Instruction: Put the Orbeon menu under root (menus). ## Code After: <?xml version="1.0" encoding="utf-8"?> <odoo> <data> <menuitem id="orbeon_base_menu" name="Orbeon" sequence="101" /> <menuitem id="orbeon_server_menu" name="Server" parent="orbeon_base_menu" action="orbeon_server_action" sequence="20" /> <menuitem id="orbeon_builder_menu" name="Builder Forms" parent="orbeon_base_menu" action="orbeon_builder_form_action" sequence="30" /> <menuitem id="orbeon_runner_menu" name="Runner Forms" parent="orbeon_base_menu" action="orbeon_runner_form_action" sequence="40" /> </data> </odoo>
<?xml version="1.0" encoding="utf-8"?> <odoo> <data> <menuitem id="orbeon_base_menu" name="Orbeon" - parent="base.menu_custom" sequence="101" /> <menuitem id="orbeon_server_menu" name="Server" parent="orbeon_base_menu" action="orbeon_server_action" sequence="20" /> <menuitem id="orbeon_builder_menu" name="Builder Forms" parent="orbeon_base_menu" action="orbeon_builder_form_action" sequence="30" /> <menuitem id="orbeon_runner_menu" name="Runner Forms" parent="orbeon_base_menu" action="orbeon_runner_form_action" sequence="40" /> </data> </odoo>
1
0.028571
0
1
e1e2f9d7823e5dc8dc97887562d2a6d26a802ff0
Something/src/main/java/com/salvadordalvik/something/LoginActivity.java
Something/src/main/java/com/salvadordalvik/something/LoginActivity.java
package com.salvadordalvik.something; import android.app.Activity; import android.os.Bundle; /** * Created by matthewshepard on 1/31/14. */ public class LoginActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); setTitle(R.string.login_activity_title); } }
package com.salvadordalvik.something; import android.os.Bundle; import android.support.v4.app.FragmentActivity; /** * Created by matthewshepard on 1/31/14. */ public class LoginActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); setTitle(R.string.login_activity_title); } }
Update log inactivity to match fragment support.
Update log inactivity to match fragment support.
Java
mit
2fast2fourier/something.apk,2fast2fourier/something.apk,2fast2fourier/something.apk
java
## Code Before: package com.salvadordalvik.something; import android.app.Activity; import android.os.Bundle; /** * Created by matthewshepard on 1/31/14. */ public class LoginActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); setTitle(R.string.login_activity_title); } } ## Instruction: Update log inactivity to match fragment support. ## Code After: package com.salvadordalvik.something; import android.os.Bundle; import android.support.v4.app.FragmentActivity; /** * Created by matthewshepard on 1/31/14. */ public class LoginActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); setTitle(R.string.login_activity_title); } }
package com.salvadordalvik.something; - import android.app.Activity; import android.os.Bundle; + import android.support.v4.app.FragmentActivity; /** * Created by matthewshepard on 1/31/14. */ - public class LoginActivity extends Activity { + public class LoginActivity extends FragmentActivity { ? ++++++++ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); setTitle(R.string.login_activity_title); } }
4
0.235294
2
2
854623e58971c5e729b39ae7e5dbca26bae17c21
controls/clientexportmanager/browser-support.md
controls/clientexportmanager/browser-support.md
--- title: Browser Support page_title: Browser Support | RadClientExportManager for ASP.NET AJAX Documentation description: Browser Support slug: clientexportmanager/browser-support tags: browser,support published: True position: 3 --- # Browser Support ## Browser Support **RadClientExportManager** for ASP.NET AJAX supports the following browsers: * Internet Explorer 9+ (In IE9 and Safari the **RadClientExportManager** requires its **ProxyURL** to be set, as explained in the [IE9 and Safari Compatibility]({%slug clientexportmanager/troubleshooting/ie9-and-safari-compatibility%}) article). * Firefox Current, previous and ESR * Safari 6.0+ * Opera 15.0+ (Blink) and 12.0+ (Presto) * Google Chrome Current and previous
--- title: Browser Support page_title: Browser Support | RadClientExportManager for ASP.NET AJAX Documentation description: Browser Support slug: clientexportmanager/browser-support tags: browser,support published: True position: 3 --- # Browser Support ## Browser Support **RadClientExportManager** for ASP.NET AJAX supports the following browsers: * Internet Explorer 9+ (In IE9,Safari, and any iOS system the **RadClientExportManager** requires its **ProxyURL** to be set, as explained in the [IE9 and Safari Compatibility]({%slug clientexportmanager/troubleshooting/ie9-and-safari-compatibility%}) article). * Firefox Current, previous and ESR * Safari 6.0+ * Opera 15.0+ (Blink) and 12.0+ (Presto) * Google Chrome Current and previous
Update to clarify iOS support
Update to clarify iOS support FileAPI isn't supported any any iOS system. This is a OS limitation so no browser will work without ProxyUrl
Markdown
apache-2.0
telerik/ajax-docs,telerik/ajax-docs,telerik/ajax-docs,telerik/ajax-docs
markdown
## Code Before: --- title: Browser Support page_title: Browser Support | RadClientExportManager for ASP.NET AJAX Documentation description: Browser Support slug: clientexportmanager/browser-support tags: browser,support published: True position: 3 --- # Browser Support ## Browser Support **RadClientExportManager** for ASP.NET AJAX supports the following browsers: * Internet Explorer 9+ (In IE9 and Safari the **RadClientExportManager** requires its **ProxyURL** to be set, as explained in the [IE9 and Safari Compatibility]({%slug clientexportmanager/troubleshooting/ie9-and-safari-compatibility%}) article). * Firefox Current, previous and ESR * Safari 6.0+ * Opera 15.0+ (Blink) and 12.0+ (Presto) * Google Chrome Current and previous ## Instruction: Update to clarify iOS support FileAPI isn't supported any any iOS system. This is a OS limitation so no browser will work without ProxyUrl ## Code After: --- title: Browser Support page_title: Browser Support | RadClientExportManager for ASP.NET AJAX Documentation description: Browser Support slug: clientexportmanager/browser-support tags: browser,support published: True position: 3 --- # Browser Support ## Browser Support **RadClientExportManager** for ASP.NET AJAX supports the following browsers: * Internet Explorer 9+ (In IE9,Safari, and any iOS system the **RadClientExportManager** requires its **ProxyURL** to be set, as explained in the [IE9 and Safari Compatibility]({%slug clientexportmanager/troubleshooting/ie9-and-safari-compatibility%}) article). * Firefox Current, previous and ESR * Safari 6.0+ * Opera 15.0+ (Blink) and 12.0+ (Presto) * Google Chrome Current and previous
--- title: Browser Support page_title: Browser Support | RadClientExportManager for ASP.NET AJAX Documentation description: Browser Support slug: clientexportmanager/browser-support tags: browser,support published: True position: 3 --- # Browser Support ## Browser Support **RadClientExportManager** for ASP.NET AJAX supports the following browsers: - * Internet Explorer 9+ (In IE9 and Safari the **RadClientExportManager** requires its **ProxyURL** to be set, as explained in the [IE9 and Safari Compatibility]({%slug clientexportmanager/troubleshooting/ie9-and-safari-compatibility%}) article). ? ^^^^^ + * Internet Explorer 9+ (In IE9,Safari, and any iOS system the **RadClientExportManager** requires its **ProxyURL** to be set, as explained in the [IE9 and Safari Compatibility]({%slug clientexportmanager/troubleshooting/ie9-and-safari-compatibility%}) article). ? ^ ++++++++++++++++++++ * Firefox Current, previous and ESR * Safari 6.0+ * Opera 15.0+ (Blink) and 12.0+ (Presto) * Google Chrome Current and previous
2
0.074074
1
1
aaa1afaa820dd0c8aaba946a507cca4ee6aa0239
pentaho-xul-gwt/build.properties
pentaho-xul-gwt/build.properties
project.revision=TRUNK-SNAPSHOT ivy.artifact.id=pentaho-xul-gwt ivy.artifact.group=pentaho package.id=${ivy.artifact.id}-package ivy.artifact.group=pentaho impl.title=Pentaho GWT XUL dependency.pentaho-gwt-widgets.revision=TRUNK-SNAPSHOT dependency.gwt.revision=2.4.0 dependency.gwt-incubator.revision=2.1.0 dependency.gwt-dnd.revision=3.1.2 codegenlib.dir=${basedir}/war/WEB-INF/lib lib.dir=${basedir}/war/WEB-INF/lib gwt-module.path=org.pentaho.ui.xul.Gwt
project.revision=TRUNK-SNAPSHOT ivy.artifact.id=pentaho-xul-gwt ivy.artifact.group=pentaho package.id=${ivy.artifact.id}-package ivy.artifact.group=pentaho impl.title=Pentaho GWT XUL dependency.pentaho-gwt-widgets.revision=TRUNK-SNAPSHOT dependency.gwt.revision=2.4.0 dependency.gwt-incubator.revision=2.1.0 dependency.gwt-dnd.revision=3.1.2 codegenlib.dir=${basedir}/war/WEB-INF/lib lib.dir=${basedir}/war/WEB-INF/lib gwt-module.path=org.pentaho.ui.xul.Gwt javadoc.packagenames=org.pentaho.*
Set javadoc.packagenames default property to get rid of requirement to set this in Jenkins ant call.
Set javadoc.packagenames default property to get rid of requirement to set this in Jenkins ant call.
INI
lgpl-2.1
pentaho/pentaho-commons-xul
ini
## Code Before: project.revision=TRUNK-SNAPSHOT ivy.artifact.id=pentaho-xul-gwt ivy.artifact.group=pentaho package.id=${ivy.artifact.id}-package ivy.artifact.group=pentaho impl.title=Pentaho GWT XUL dependency.pentaho-gwt-widgets.revision=TRUNK-SNAPSHOT dependency.gwt.revision=2.4.0 dependency.gwt-incubator.revision=2.1.0 dependency.gwt-dnd.revision=3.1.2 codegenlib.dir=${basedir}/war/WEB-INF/lib lib.dir=${basedir}/war/WEB-INF/lib gwt-module.path=org.pentaho.ui.xul.Gwt ## Instruction: Set javadoc.packagenames default property to get rid of requirement to set this in Jenkins ant call. ## Code After: project.revision=TRUNK-SNAPSHOT ivy.artifact.id=pentaho-xul-gwt ivy.artifact.group=pentaho package.id=${ivy.artifact.id}-package ivy.artifact.group=pentaho impl.title=Pentaho GWT XUL dependency.pentaho-gwt-widgets.revision=TRUNK-SNAPSHOT dependency.gwt.revision=2.4.0 dependency.gwt-incubator.revision=2.1.0 dependency.gwt-dnd.revision=3.1.2 codegenlib.dir=${basedir}/war/WEB-INF/lib lib.dir=${basedir}/war/WEB-INF/lib gwt-module.path=org.pentaho.ui.xul.Gwt javadoc.packagenames=org.pentaho.*
project.revision=TRUNK-SNAPSHOT ivy.artifact.id=pentaho-xul-gwt ivy.artifact.group=pentaho package.id=${ivy.artifact.id}-package ivy.artifact.group=pentaho impl.title=Pentaho GWT XUL dependency.pentaho-gwt-widgets.revision=TRUNK-SNAPSHOT dependency.gwt.revision=2.4.0 dependency.gwt-incubator.revision=2.1.0 dependency.gwt-dnd.revision=3.1.2 codegenlib.dir=${basedir}/war/WEB-INF/lib lib.dir=${basedir}/war/WEB-INF/lib gwt-module.path=org.pentaho.ui.xul.Gwt + javadoc.packagenames=org.pentaho.*
1
0.071429
1
0
777e9e8d76520f1e5d35ee9e17c0f36a7609ebd0
setup.py
setup.py
from setuptools import setup setup( name='scrapy-corenlp', version='0.1.1', description='Scrapy spider middleware :: Stanford CoreNLP Named Entity Recognition', url='https://github.com/vu3jej/scrapy-corenlp', author='Jithesh E J', author_email='mail@jithesh.net', license='BSD-2-Clause', packages=['scrapy_corenlp'], classifiers=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 3.4', 'Topic :: Text Processing :: Linguistic', ] )
from setuptools import setup setup( name='scrapy-corenlp', version='0.2.0', description='Scrapy spider middleware :: Stanford CoreNLP Named Entity Recognition', url='https://github.com/vu3jej/scrapy-corenlp', author='Jithesh E J', author_email='mail@jithesh.net', license='BSD-2-Clause', packages=['scrapy_corenlp'], classifiers=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Text Processing :: Linguistic', ] )
Add support for Python 2.7, 3.4 & 3.5
Add support for Python 2.7, 3.4 & 3.5
Python
bsd-2-clause
vu3jej/scrapy-corenlp
python
## Code Before: from setuptools import setup setup( name='scrapy-corenlp', version='0.1.1', description='Scrapy spider middleware :: Stanford CoreNLP Named Entity Recognition', url='https://github.com/vu3jej/scrapy-corenlp', author='Jithesh E J', author_email='mail@jithesh.net', license='BSD-2-Clause', packages=['scrapy_corenlp'], classifiers=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 3.4', 'Topic :: Text Processing :: Linguistic', ] ) ## Instruction: Add support for Python 2.7, 3.4 & 3.5 ## Code After: from setuptools import setup setup( name='scrapy-corenlp', version='0.2.0', description='Scrapy spider middleware :: Stanford CoreNLP Named Entity Recognition', url='https://github.com/vu3jej/scrapy-corenlp', author='Jithesh E J', author_email='mail@jithesh.net', license='BSD-2-Clause', packages=['scrapy_corenlp'], classifiers=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Text Processing :: Linguistic', ] )
from setuptools import setup setup( name='scrapy-corenlp', - version='0.1.1', ? ^ ^ + version='0.2.0', ? ^ ^ description='Scrapy spider middleware :: Stanford CoreNLP Named Entity Recognition', url='https://github.com/vu3jej/scrapy-corenlp', author='Jithesh E J', author_email='mail@jithesh.net', license='BSD-2-Clause', packages=['scrapy_corenlp'], classifiers=[ 'Development Status :: 3 - Alpha', + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Topic :: Text Processing :: Linguistic', ] )
4
0.222222
3
1
08f3a70b6d051e410561aa9709056b53854babd6
roles/packages/tasks/dev/tools.yml
roles/packages/tasks/dev/tools.yml
--- - community.general.homebrew_cask: name: - docker - p4v - community.general.homebrew: name: - docker-completion - docker-compose-completion - gh
--- - community.general.homebrew_cask: name: - docker - p4v - community.general.homebrew: name: - docker-completion - docker-compose-completion - gh - helm - kubectl@1.22
Add helm and kubectl as dev tool packages
Add helm and kubectl as dev tool packages
YAML
mit
andrasmaroy/dotfiles,andrasmaroy/dotfiles
yaml
## Code Before: --- - community.general.homebrew_cask: name: - docker - p4v - community.general.homebrew: name: - docker-completion - docker-compose-completion - gh ## Instruction: Add helm and kubectl as dev tool packages ## Code After: --- - community.general.homebrew_cask: name: - docker - p4v - community.general.homebrew: name: - docker-completion - docker-compose-completion - gh - helm - kubectl@1.22
--- - community.general.homebrew_cask: name: - docker - p4v - community.general.homebrew: name: - docker-completion - docker-compose-completion - gh + - helm + - kubectl@1.22
2
0.166667
2
0
e558a2cf5267833d5bfa01d9cd5657b2fa338da8
_layouts/default.html
_layouts/default.html
<!DOCTYPE html> <html> <head> <title>{{ page.title }}</title> <link rel="stylesheet" type="text/css" href="/css/main.css" /> </head> <body> <nav> <ul> <li><a href="/">Home</a></li> <li><a href="/blog">Blog</a></li> </ul> </nav> <div class="container"> {{ content }} </div> <footer> <ul> <li><a href="mailto:jan@aagaard.net">jan@aagaard.net</a></li> <li> <a href="https://github.com/janaagaard75">github.com/janaagaard75</a> </li> </ul> </footer> </body> </html>
<!DOCTYPE html> <html> <head> <title>{{ page.title }}</title> <link rel="stylesheet" type="text/css" href="/css/main.css" /> </head> <body> <nav> <ul> <li><a href="/">Home</a></li> <li><a href="/blog">Blog</a></li> </ul> </nav> <div class="container"> {{ content }} </div> <footer> <ul> <li><a href="mailto:jan@aagaard.net">jan@aagaard.net</a></li> <li> <a href="https://github.com/janaagaard75">github.com/janaagaard75</a> </li> <li><a href="/sitemap.xml">XML sitemap</a></li> <li><a href="/feed.xml">ATOM feed</a></li> </ul> </footer> </body> </html>
Add links for sitemap and feed
Add links for sitemap and feed
HTML
mit
janaagaard75/janaagaard75.github.io,janaagaard75/janaagaard75.github.io
html
## Code Before: <!DOCTYPE html> <html> <head> <title>{{ page.title }}</title> <link rel="stylesheet" type="text/css" href="/css/main.css" /> </head> <body> <nav> <ul> <li><a href="/">Home</a></li> <li><a href="/blog">Blog</a></li> </ul> </nav> <div class="container"> {{ content }} </div> <footer> <ul> <li><a href="mailto:jan@aagaard.net">jan@aagaard.net</a></li> <li> <a href="https://github.com/janaagaard75">github.com/janaagaard75</a> </li> </ul> </footer> </body> </html> ## Instruction: Add links for sitemap and feed ## Code After: <!DOCTYPE html> <html> <head> <title>{{ page.title }}</title> <link rel="stylesheet" type="text/css" href="/css/main.css" /> </head> <body> <nav> <ul> <li><a href="/">Home</a></li> <li><a href="/blog">Blog</a></li> </ul> </nav> <div class="container"> {{ content }} </div> <footer> <ul> <li><a href="mailto:jan@aagaard.net">jan@aagaard.net</a></li> <li> <a href="https://github.com/janaagaard75">github.com/janaagaard75</a> </li> <li><a href="/sitemap.xml">XML sitemap</a></li> <li><a href="/feed.xml">ATOM feed</a></li> </ul> </footer> </body> </html>
<!DOCTYPE html> <html> <head> <title>{{ page.title }}</title> <link rel="stylesheet" type="text/css" href="/css/main.css" /> </head> <body> <nav> <ul> <li><a href="/">Home</a></li> <li><a href="/blog">Blog</a></li> </ul> </nav> <div class="container"> {{ content }} </div> <footer> <ul> <li><a href="mailto:jan@aagaard.net">jan@aagaard.net</a></li> <li> <a href="https://github.com/janaagaard75">github.com/janaagaard75</a> </li> + <li><a href="/sitemap.xml">XML sitemap</a></li> + <li><a href="/feed.xml">ATOM feed</a></li> </ul> </footer> </body> </html>
2
0.076923
2
0
3e3b468047dc8ebdfa46ec5a96341b1104a6f38e
transpilation/deploy.ts
transpilation/deploy.ts
import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string) { const result: any = exec(command); return result.stdout; } const porcelain = cmd("git status --porcelain"); if (porcelain.trim()) { throw new Error("This script shouldn't be run when you've got working copy changes."); } cmd("git branch -f gh-pages"); cmd("git checkout gh-pages"); const toDeploy = [ "index.html", "dist/slime.js", ".gitignore", "transpile/deploy.ts", "dist/transpile/deploy.js" ]; const gitignore = ["*"].concat(toDeploy.map(f => "!" + f)).join("\r\n"); fs.writeFileSync(".gitignore", gitignore, "utf8"); cmd("git rm -rf * --dry-run"); toDeploy.forEach(f => cmd(`git add cmd{f}`));
import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string) { const result: any = exec(command); return result.stdout; } const porcelain = cmd("git status --porcelain"); if (porcelain.trim()) { throw new Error("This script shouldn't be run when you've got working copy changes."); } cmd("git branch -f gh-pages"); cmd("git checkout gh-pages"); const toDeploy = [ "index.html", "dist/slime.js", ".gitignore", "transpile/deploy.ts", "dist/transpile/deploy.js" ]; const gitignore = ["*"].concat(toDeploy.map(f => "!" + f)).join("\r\n"); fs.writeFileSync(".gitignore", gitignore, "utf8"); cmd("git rm -rf *"); toDeploy.forEach(f => cmd(`git add cmd{f}`)); console.log(cmd("git status"));
Check status after git rm -rf *.
Check status after git rm -rf *.
TypeScript
mit
mmkal/slimejs,mmkal/slimejs,mmkal/slimejs,mmkal/slimejs
typescript
## Code Before: import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string) { const result: any = exec(command); return result.stdout; } const porcelain = cmd("git status --porcelain"); if (porcelain.trim()) { throw new Error("This script shouldn't be run when you've got working copy changes."); } cmd("git branch -f gh-pages"); cmd("git checkout gh-pages"); const toDeploy = [ "index.html", "dist/slime.js", ".gitignore", "transpile/deploy.ts", "dist/transpile/deploy.js" ]; const gitignore = ["*"].concat(toDeploy.map(f => "!" + f)).join("\r\n"); fs.writeFileSync(".gitignore", gitignore, "utf8"); cmd("git rm -rf * --dry-run"); toDeploy.forEach(f => cmd(`git add cmd{f}`)); ## Instruction: Check status after git rm -rf *. ## Code After: import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string) { const result: any = exec(command); return result.stdout; } const porcelain = cmd("git status --porcelain"); if (porcelain.trim()) { throw new Error("This script shouldn't be run when you've got working copy changes."); } cmd("git branch -f gh-pages"); cmd("git checkout gh-pages"); const toDeploy = [ "index.html", "dist/slime.js", ".gitignore", "transpile/deploy.ts", "dist/transpile/deploy.js" ]; const gitignore = ["*"].concat(toDeploy.map(f => "!" + f)).join("\r\n"); fs.writeFileSync(".gitignore", gitignore, "utf8"); cmd("git rm -rf *"); toDeploy.forEach(f => cmd(`git add cmd{f}`)); console.log(cmd("git status"));
import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string) { const result: any = exec(command); return result.stdout; } const porcelain = cmd("git status --porcelain"); if (porcelain.trim()) { throw new Error("This script shouldn't be run when you've got working copy changes."); } cmd("git branch -f gh-pages"); cmd("git checkout gh-pages"); const toDeploy = [ "index.html", "dist/slime.js", ".gitignore", "transpile/deploy.ts", "dist/transpile/deploy.js" ]; const gitignore = ["*"].concat(toDeploy.map(f => "!" + f)).join("\r\n"); fs.writeFileSync(".gitignore", gitignore, "utf8"); - cmd("git rm -rf * --dry-run"); ? ---------- + cmd("git rm -rf *"); toDeploy.forEach(f => cmd(`git add cmd{f}`)); + + console.log(cmd("git status"));
4
0.16
3
1
97977658d51ac6b02485694965f5f9c9db369bcc
package.json
package.json
{ "name": "gut-flow-lint", "version": "1.0.0", "preferGlobal": true, "private": true, "scripts": { "test": "npm run lint && npm run cache", "lint": "deno lint --config ./deno.json", "cache": "deno cache --config ./deno.json --unstable mod.ts" }, "type": "module", "devDependencies": { "@quilicicf/markdown-formatter": "4.0.5" } }
{ "name": "gut-flow-lint", "version": "1.0.0", "preferGlobal": true, "private": true, "scripts": { "test": "npm run lint && npm run cache", "lint": "deno lint --config ./deno.json", "cache": "deno cache --config ./deno.json --unstable mod.ts", "generate-doc": "deno run --unstable --no-check --allow-env=HOME --allow-run=node --allow-read=$(pwd)/README.md --allow-write=$(pwd)/README.md ./scripts/generateDoc.ts" }, "type": "module", "devDependencies": { "@quilicicf/markdown-formatter": "4.0.5" } }
Add npm script to generate the documentation
:wrench: Add npm script to generate the documentation
JSON
apache-2.0
quilicicf/Gut,quilicicf/Gut
json
## Code Before: { "name": "gut-flow-lint", "version": "1.0.0", "preferGlobal": true, "private": true, "scripts": { "test": "npm run lint && npm run cache", "lint": "deno lint --config ./deno.json", "cache": "deno cache --config ./deno.json --unstable mod.ts" }, "type": "module", "devDependencies": { "@quilicicf/markdown-formatter": "4.0.5" } } ## Instruction: :wrench: Add npm script to generate the documentation ## Code After: { "name": "gut-flow-lint", "version": "1.0.0", "preferGlobal": true, "private": true, "scripts": { "test": "npm run lint && npm run cache", "lint": "deno lint --config ./deno.json", "cache": "deno cache --config ./deno.json --unstable mod.ts", "generate-doc": "deno run --unstable --no-check --allow-env=HOME --allow-run=node --allow-read=$(pwd)/README.md --allow-write=$(pwd)/README.md ./scripts/generateDoc.ts" }, "type": "module", "devDependencies": { "@quilicicf/markdown-formatter": "4.0.5" } }
{ "name": "gut-flow-lint", "version": "1.0.0", "preferGlobal": true, "private": true, "scripts": { "test": "npm run lint && npm run cache", "lint": "deno lint --config ./deno.json", - "cache": "deno cache --config ./deno.json --unstable mod.ts" + "cache": "deno cache --config ./deno.json --unstable mod.ts", ? + + "generate-doc": "deno run --unstable --no-check --allow-env=HOME --allow-run=node --allow-read=$(pwd)/README.md --allow-write=$(pwd)/README.md ./scripts/generateDoc.ts" }, "type": "module", "devDependencies": { "@quilicicf/markdown-formatter": "4.0.5" } }
3
0.2
2
1
35f902c475cfa0a89234ef11ce6d5b2d695f10e7
lib/rapporteur/checks.rb
lib/rapporteur/checks.rb
module Rapporteur module Checks autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check' TimeCheck = lambda { |checker| checker.add_message(:time, Time.now.utc) } RevisionCheck = lambda { |checker| checker.add_message(:revision, Revision.current) } end end
module Rapporteur module Checks autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check' # A check which simply reports the current clock time in UTC. This check is # useful because it shows that the status end point is not being cached and # allows you to determine if your server clocks are abnormally skewed. # # This check has no failure cases. # # Examples # # { # time: "2013-06-21T05:18:59Z" # } # TimeCheck = lambda { |checker| checker.add_message(:time, Time.now.utc) } # A check which reports the current revision of the running application. # # This check has no failure cases. # # Examples # # { # revision: "c74edd04f64b25ff6691308bcfdefcee149aa4b5" # } # RevisionCheck = lambda { |checker| checker.add_message(:revision, Revision.current) } end end
Add documentation to TimeCheck and RevisionCheck.
Add documentation to TimeCheck and RevisionCheck. [ci skip]
Ruby
mit
envylabs/rapporteur,envylabs/rapporteur,codeschool/rapporteur
ruby
## Code Before: module Rapporteur module Checks autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check' TimeCheck = lambda { |checker| checker.add_message(:time, Time.now.utc) } RevisionCheck = lambda { |checker| checker.add_message(:revision, Revision.current) } end end ## Instruction: Add documentation to TimeCheck and RevisionCheck. [ci skip] ## Code After: module Rapporteur module Checks autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check' # A check which simply reports the current clock time in UTC. This check is # useful because it shows that the status end point is not being cached and # allows you to determine if your server clocks are abnormally skewed. # # This check has no failure cases. # # Examples # # { # time: "2013-06-21T05:18:59Z" # } # TimeCheck = lambda { |checker| checker.add_message(:time, Time.now.utc) } # A check which reports the current revision of the running application. # # This check has no failure cases. # # Examples # # { # revision: "c74edd04f64b25ff6691308bcfdefcee149aa4b5" # } # RevisionCheck = lambda { |checker| checker.add_message(:revision, Revision.current) } end end
module Rapporteur module Checks autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check' + # A check which simply reports the current clock time in UTC. This check is + # useful because it shows that the status end point is not being cached and + # allows you to determine if your server clocks are abnormally skewed. + # + # This check has no failure cases. + # + # Examples + # + # { + # time: "2013-06-21T05:18:59Z" + # } + # TimeCheck = lambda { |checker| checker.add_message(:time, Time.now.utc) } + + # A check which reports the current revision of the running application. + # + # This check has no failure cases. + # + # Examples + # + # { + # revision: "c74edd04f64b25ff6691308bcfdefcee149aa4b5" + # } + # RevisionCheck = lambda { |checker| checker.add_message(:revision, Revision.current) } end end
23
2.875
23
0
1b1b043af1c7cfe189940ab1aa28c19060b307d4
lib/ws_light/set/watermelon_set.rb
lib/ws_light/set/watermelon_set.rb
require 'ws_light/set/color_set' module WSLight module Set # Creates a watermelon set, some green, some white, lots of red with a few red dots class WatermelonSet < ColorSet def frame set = [] length_red = (0.72 * @length).to_i length_red_to_white = (0.1 * @length).to_i length_white = (0.1 * @length).to_i white = Color.new(255, 255, 255) red = Color.new(255, 0, 0) @length.times do |i| if i < length_red set << Color.new((rand(25) < 1 ? 0 : 255), 0, 0) elsif i < length_red + length_red_to_white ratio = (i - length_red) / (length_red + length_red_to_white) set << red.mix(white, ratio) elsif i < length_red + length_red_to_white + length_white set << white else set << Color.new(0, 127, 0) end end set end def pixel(number, _frame = 0) frame[number] end end end end
require 'ws_light/set/color_set' module WSLight module Set # Creates a watermelon set, some green, some white, lots of red with a few red dots class WatermelonSet < ColorSet def create_frame set = [] length_red = (0.72 * @length).to_i length_red_to_white = (0.1 * @length).to_i length_white = (0.1 * @length).to_i white = Color.new(255, 255, 255) red = Color.new(255, 0, 0) @length.times do |i| if i < length_red set << Color.new((rand(25) < 1 ? 0 : 255), 0, 0) elsif i < length_red + length_red_to_white ratio = (i - length_red) / (length_red + length_red_to_white) set << red.mix(white, ratio) elsif i < length_red + length_red_to_white + length_white set << white else set << Color.new(0, 127, 0) end end type == :double ? set + set.reverse : set end def frame @set ||= create_frame end def pixel(number) frame[number] end end end end
Extend melon to second led strip
[BUGFIX] Extend melon to second led strip
Ruby
mit
kayssun/ws_light
ruby
## Code Before: require 'ws_light/set/color_set' module WSLight module Set # Creates a watermelon set, some green, some white, lots of red with a few red dots class WatermelonSet < ColorSet def frame set = [] length_red = (0.72 * @length).to_i length_red_to_white = (0.1 * @length).to_i length_white = (0.1 * @length).to_i white = Color.new(255, 255, 255) red = Color.new(255, 0, 0) @length.times do |i| if i < length_red set << Color.new((rand(25) < 1 ? 0 : 255), 0, 0) elsif i < length_red + length_red_to_white ratio = (i - length_red) / (length_red + length_red_to_white) set << red.mix(white, ratio) elsif i < length_red + length_red_to_white + length_white set << white else set << Color.new(0, 127, 0) end end set end def pixel(number, _frame = 0) frame[number] end end end end ## Instruction: [BUGFIX] Extend melon to second led strip ## Code After: require 'ws_light/set/color_set' module WSLight module Set # Creates a watermelon set, some green, some white, lots of red with a few red dots class WatermelonSet < ColorSet def create_frame set = [] length_red = (0.72 * @length).to_i length_red_to_white = (0.1 * @length).to_i length_white = (0.1 * @length).to_i white = Color.new(255, 255, 255) red = Color.new(255, 0, 0) @length.times do |i| if i < length_red set << Color.new((rand(25) < 1 ? 0 : 255), 0, 0) elsif i < length_red + length_red_to_white ratio = (i - length_red) / (length_red + length_red_to_white) set << red.mix(white, ratio) elsif i < length_red + length_red_to_white + length_white set << white else set << Color.new(0, 127, 0) end end type == :double ? set + set.reverse : set end def frame @set ||= create_frame end def pixel(number) frame[number] end end end end
require 'ws_light/set/color_set' module WSLight module Set # Creates a watermelon set, some green, some white, lots of red with a few red dots class WatermelonSet < ColorSet - def frame + def create_frame ? +++++++ set = [] length_red = (0.72 * @length).to_i length_red_to_white = (0.1 * @length).to_i length_white = (0.1 * @length).to_i white = Color.new(255, 255, 255) red = Color.new(255, 0, 0) @length.times do |i| if i < length_red set << Color.new((rand(25) < 1 ? 0 : 255), 0, 0) elsif i < length_red + length_red_to_white ratio = (i - length_red) / (length_red + length_red_to_white) set << red.mix(white, ratio) elsif i < length_red + length_red_to_white + length_white set << white else set << Color.new(0, 127, 0) end end - set + type == :double ? set + set.reverse : set end + def frame + @set ||= create_frame + end + - def pixel(number, _frame = 0) ? ------------ + def pixel(number) frame[number] end end end end
10
0.263158
7
3
1934229ace3bd35b98e3eaa9b8ec75a1000dea78
djkombu/transport.py
djkombu/transport.py
from Queue import Empty from anyjson import serialize, deserialize from kombu.transport import virtual from django.conf import settings from django.core import exceptions as errors from djkombu.models import Queue POLLING_INTERVAL = getattr(settings, "DJKOMBU_POLLING_INTERVAL", 5.0) class Channel(virtual.Channel): def _new_queue(self, queue, **kwargs): Queue.objects.get_or_create(name=queue) def _put(self, queue, message, **kwargs): Queue.objects.publish(queue, serialize(message)) def basic_consume(self, queue, *args, **kwargs): exchange, _ , _ = self.state.bindings[queue] if self.typeof(exchange).type == "fanout": return super(Channel, self).basic_consume(queue, *args, **kwargs) def _get(self, queue): #self.refresh_connection() m = Queue.objects.fetch(queue) if m: return deserialize(m) raise Empty() def _size(self, queue): return Queue.objects.size(queue) def _purge(self, queue): return Queue.objects.purge(queue) def refresh_connection(self): from django import db db.close_connection() class DatabaseTransport(virtual.Transport): Channel = Channel default_port = 0 polling_interval = POLLING_INTERVAL connection_errors = () channel_errors = (errors.ObjectDoesNotExist, errors.MultipleObjectsReturned)
from Queue import Empty from anyjson import serialize, deserialize from kombu.transport import virtual from django.conf import settings from django.core import exceptions as errors from djkombu.models import Queue POLLING_INTERVAL = getattr(settings, "DJKOMBU_POLLING_INTERVAL", 5.0) class Channel(virtual.Channel): def _new_queue(self, queue, **kwargs): Queue.objects.get_or_create(name=queue) def _put(self, queue, message, **kwargs): Queue.objects.publish(queue, serialize(message)) def basic_consume(self, queue, *args, **kwargs): qinfo = self.state.bindings[queue] exchange = qinfo[0] if self.typeof(exchange).type == "fanout": return super(Channel, self).basic_consume(queue, *args, **kwargs) def _get(self, queue): #self.refresh_connection() m = Queue.objects.fetch(queue) if m: return deserialize(m) raise Empty() def _size(self, queue): return Queue.objects.size(queue) def _purge(self, queue): return Queue.objects.purge(queue) def refresh_connection(self): from django import db db.close_connection() class DatabaseTransport(virtual.Transport): Channel = Channel default_port = 0 polling_interval = POLLING_INTERVAL connection_errors = () channel_errors = (errors.ObjectDoesNotExist, errors.MultipleObjectsReturned)
Work with new and *older* kombu versions
Work with new and *older* kombu versions
Python
bsd-3-clause
ask/django-kombu
python
## Code Before: from Queue import Empty from anyjson import serialize, deserialize from kombu.transport import virtual from django.conf import settings from django.core import exceptions as errors from djkombu.models import Queue POLLING_INTERVAL = getattr(settings, "DJKOMBU_POLLING_INTERVAL", 5.0) class Channel(virtual.Channel): def _new_queue(self, queue, **kwargs): Queue.objects.get_or_create(name=queue) def _put(self, queue, message, **kwargs): Queue.objects.publish(queue, serialize(message)) def basic_consume(self, queue, *args, **kwargs): exchange, _ , _ = self.state.bindings[queue] if self.typeof(exchange).type == "fanout": return super(Channel, self).basic_consume(queue, *args, **kwargs) def _get(self, queue): #self.refresh_connection() m = Queue.objects.fetch(queue) if m: return deserialize(m) raise Empty() def _size(self, queue): return Queue.objects.size(queue) def _purge(self, queue): return Queue.objects.purge(queue) def refresh_connection(self): from django import db db.close_connection() class DatabaseTransport(virtual.Transport): Channel = Channel default_port = 0 polling_interval = POLLING_INTERVAL connection_errors = () channel_errors = (errors.ObjectDoesNotExist, errors.MultipleObjectsReturned) ## Instruction: Work with new and *older* kombu versions ## Code After: from Queue import Empty from anyjson import serialize, deserialize from kombu.transport import virtual from django.conf import settings from django.core import exceptions as errors from djkombu.models import Queue POLLING_INTERVAL = getattr(settings, "DJKOMBU_POLLING_INTERVAL", 5.0) class Channel(virtual.Channel): def _new_queue(self, queue, **kwargs): Queue.objects.get_or_create(name=queue) def _put(self, queue, message, **kwargs): Queue.objects.publish(queue, serialize(message)) def basic_consume(self, queue, *args, **kwargs): qinfo = self.state.bindings[queue] exchange = qinfo[0] if self.typeof(exchange).type == "fanout": return super(Channel, self).basic_consume(queue, *args, **kwargs) def _get(self, queue): #self.refresh_connection() m = Queue.objects.fetch(queue) if m: return deserialize(m) raise Empty() def _size(self, queue): return Queue.objects.size(queue) def _purge(self, queue): return Queue.objects.purge(queue) def refresh_connection(self): from django import db db.close_connection() class DatabaseTransport(virtual.Transport): Channel = Channel default_port = 0 polling_interval = POLLING_INTERVAL connection_errors = () channel_errors = (errors.ObjectDoesNotExist, errors.MultipleObjectsReturned)
from Queue import Empty from anyjson import serialize, deserialize from kombu.transport import virtual from django.conf import settings from django.core import exceptions as errors from djkombu.models import Queue POLLING_INTERVAL = getattr(settings, "DJKOMBU_POLLING_INTERVAL", 5.0) class Channel(virtual.Channel): def _new_queue(self, queue, **kwargs): Queue.objects.get_or_create(name=queue) def _put(self, queue, message, **kwargs): Queue.objects.publish(queue, serialize(message)) def basic_consume(self, queue, *args, **kwargs): - exchange, _ , _ = self.state.bindings[queue] ? ^^^^^ ^^^^^^^^^ + qinfo = self.state.bindings[queue] ? ^^ ^^ + exchange = qinfo[0] if self.typeof(exchange).type == "fanout": return super(Channel, self).basic_consume(queue, *args, **kwargs) def _get(self, queue): #self.refresh_connection() m = Queue.objects.fetch(queue) if m: return deserialize(m) raise Empty() def _size(self, queue): return Queue.objects.size(queue) def _purge(self, queue): return Queue.objects.purge(queue) def refresh_connection(self): from django import db db.close_connection() class DatabaseTransport(virtual.Transport): Channel = Channel default_port = 0 polling_interval = POLLING_INTERVAL connection_errors = () channel_errors = (errors.ObjectDoesNotExist, errors.MultipleObjectsReturned)
3
0.056604
2
1
2ccb0a5e52d73aa0362e1e644363ee8fa75c3476
conda-recipe/meta.yaml
conda-recipe/meta.yaml
package: name: conda-verify version: "2.1.0" source: path: ../ requirements: build: - python - setuptools run: - python build: script: python setup.py install about: home: https://github.com/conda/conda-verify license: BSD license_file: LICENSE.txt
package: name: conda-verify version: "2.1.0" source: path: ../ requirements: build: - python - setuptools run: - python build: script: pip install . --no-deps about: home: https://github.com/conda/conda-verify license: BSD license_file: LICENSE.txt
Change conda recipe build script
Change conda recipe build script
YAML
bsd-3-clause
mandeep/conda-verify
yaml
## Code Before: package: name: conda-verify version: "2.1.0" source: path: ../ requirements: build: - python - setuptools run: - python build: script: python setup.py install about: home: https://github.com/conda/conda-verify license: BSD license_file: LICENSE.txt ## Instruction: Change conda recipe build script ## Code After: package: name: conda-verify version: "2.1.0" source: path: ../ requirements: build: - python - setuptools run: - python build: script: pip install . --no-deps about: home: https://github.com/conda/conda-verify license: BSD license_file: LICENSE.txt
package: name: conda-verify version: "2.1.0" source: path: ../ requirements: build: - python - setuptools run: - python build: - script: python setup.py install + script: pip install . --no-deps about: home: https://github.com/conda/conda-verify license: BSD license_file: LICENSE.txt
2
0.090909
1
1
f2a39df197fe324e22c4a8ecf92d5eb76757a85a
extension/chrome/content/tweaks/tabs-on-top.css
extension/chrome/content/tweaks/tabs-on-top.css
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @-moz-document url("chrome://browser/content/browser.xul") { #TabsToolbar { -moz-box-ordinal-group: 200; /* default is 100 */ } }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @-moz-document url("chrome://browser/content/browser.xul") { #toolbar-menubar { -moz-box-ordinal-group: 5; } #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) { -moz-box-ordinal-group: 50; } #TabsToolbar { -moz-box-ordinal-group: 10; } #TabsToolbar[tabsontop="false"] { -moz-box-ordinal-group: 100; } }
Improve "tabs on bottom" tweak
Improve "tabs on bottom" tweak
CSS
mpl-2.0
gnome-integration-team/firefox-gnome,gnome-integration-team/firefox-gnome,lbrfabio/firefox-gnome-flat,lbrfabio/firefox-gnome-flat,synapsos/firefox-gnome,gnome-integration-team/firefox-gnome,lbrfabio/firefox-gnome-flat,lbrfabio/firefox-gnome-flat,synapsos/firefox-gnome,gnome-integration-team/firefox-gnome,synapsos/firefox-gnome,synapsos/firefox-gnome
css
## Code Before: /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @-moz-document url("chrome://browser/content/browser.xul") { #TabsToolbar { -moz-box-ordinal-group: 200; /* default is 100 */ } } ## Instruction: Improve "tabs on bottom" tweak ## Code After: /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @-moz-document url("chrome://browser/content/browser.xul") { #toolbar-menubar { -moz-box-ordinal-group: 5; } #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) { -moz-box-ordinal-group: 50; } #TabsToolbar { -moz-box-ordinal-group: 10; } #TabsToolbar[tabsontop="false"] { -moz-box-ordinal-group: 100; } }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @-moz-document url("chrome://browser/content/browser.xul") { + #toolbar-menubar { + -moz-box-ordinal-group: 5; + } + + #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) { + -moz-box-ordinal-group: 50; + } + #TabsToolbar { - -moz-box-ordinal-group: 200; /* default is 100 */ + -moz-box-ordinal-group: 10; + } + + #TabsToolbar[tabsontop="false"] { + -moz-box-ordinal-group: 100; } }
14
1.076923
13
1
1ca4ce710a79ad9ebb48edfd8c6d67f8d9890b2f
templates/profile.html
templates/profile.html
{% import 'macros/monster.html' as statblocks %} {% import 'macros/errors.html' as errors %} {% extends 'base/two-column-base.html' %} {% block title %}Dungeon World Monster Maker{% endblock title %} {% block left %} {% if error %} {{ errors.error(error) }} {% else %} <h1>Monsters by {{ profile.account.nickname() }}</h1> {% for monster in monsters %} {{ statblocks.statblock(monster) }} {% endfor %} {% endif %} {% endblock left %}
{% import 'macros/monster.html' as statblocks %} {% import 'macros/errors.html' as errors %} {% extends 'base/two-column-base.html' %} {% block title %}Dungeon World Monster Maker{% endblock title %} {% block left %} {% if error %} {{ errors.error(error) }} {% else %} <h1>Monsters by {{ profile.display_name }}</h1> {% for monster in monsters %} {{ statblocks.statblock(monster) }} {% endfor %} {% endif %} {% endblock left %}
Use display name instead of email address.
Use display name instead of email address.
HTML
mit
Sagelt/dungeon-world-codex,Sagelt/dungeon-world-codex
html
## Code Before: {% import 'macros/monster.html' as statblocks %} {% import 'macros/errors.html' as errors %} {% extends 'base/two-column-base.html' %} {% block title %}Dungeon World Monster Maker{% endblock title %} {% block left %} {% if error %} {{ errors.error(error) }} {% else %} <h1>Monsters by {{ profile.account.nickname() }}</h1> {% for monster in monsters %} {{ statblocks.statblock(monster) }} {% endfor %} {% endif %} {% endblock left %} ## Instruction: Use display name instead of email address. ## Code After: {% import 'macros/monster.html' as statblocks %} {% import 'macros/errors.html' as errors %} {% extends 'base/two-column-base.html' %} {% block title %}Dungeon World Monster Maker{% endblock title %} {% block left %} {% if error %} {{ errors.error(error) }} {% else %} <h1>Monsters by {{ profile.display_name }}</h1> {% for monster in monsters %} {{ statblocks.statblock(monster) }} {% endfor %} {% endif %} {% endblock left %}
{% import 'macros/monster.html' as statblocks %} {% import 'macros/errors.html' as errors %} {% extends 'base/two-column-base.html' %} {% block title %}Dungeon World Monster Maker{% endblock title %} {% block left %} {% if error %} {{ errors.error(error) }} {% else %} - <h1>Monsters by {{ profile.account.nickname() }}</h1> ? ^^^^^^^^^^^ -- + <h1>Monsters by {{ profile.display_name }}</h1> ? +++++ ^^ {% for monster in monsters %} {{ statblocks.statblock(monster) }} {% endfor %} {% endif %} {% endblock left %}
2
0.117647
1
1
0a908bb71a5018e34039a8b5633b9f8262df060b
SoberConfig.cmake.in
SoberConfig.cmake.in
find_package(GTest CONFIG REQUIRED PATHS @GTest_DIR@ NO_DEFAULT_PATH) find_package( CppNetlibUri CONFIG REQUIRED PATHS @CppNetlibUri_DIR@ NO_DEFAULT_PATH ) @PACKAGE_INIT@ include("@PACKAGE_CONF_DEST@/SoberTargets.cmake") function(_apply_release_imported_config_as_default tgt) get_target_property(location ${tgt} IMPORTED_LOCATION_RELEASE) get_target_property(link ${tgt} IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) if(NOT location) message(FATAL_ERROR "Release target `${tgt}` not installed") endif() set_target_properties( ${tgt} PROPERTIES IMPORTED_LOCATION "${location}" ) if(link) set_target_properties( ${tgt} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${link}" ) endif() endfunction() _apply_release_imported_config_as_default(sober)
find_package( CppNetlibUri CONFIG REQUIRED PATHS @CppNetlibUri_DIR@ NO_DEFAULT_PATH ) find_package(GTest CONFIG REQUIRED PATHS @GTest_DIR@ NO_DEFAULT_PATH) find_package(JsonSpirit CONFIG REQUIRED PATHS @JsonSpirit_DIR@ NO_DEFAULT_PATH) @PACKAGE_INIT@ include("@PACKAGE_CONF_DEST@/SoberTargets.cmake") function(_apply_release_imported_config_as_default tgt) get_target_property(location ${tgt} IMPORTED_LOCATION_RELEASE) get_target_property(link ${tgt} IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) if(NOT location) message(FATAL_ERROR "Release target `${tgt}` not installed") endif() set_target_properties( ${tgt} PROPERTIES IMPORTED_LOCATION "${location}" ) if(link) set_target_properties( ${tgt} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${link}" ) endif() endfunction() _apply_release_imported_config_as_default(sober)
Add find_package(JsonSpirit ...) to config
Add find_package(JsonSpirit ...) to config
unknown
bsd-2-clause
ruslo/sober
unknown
## Code Before: find_package(GTest CONFIG REQUIRED PATHS @GTest_DIR@ NO_DEFAULT_PATH) find_package( CppNetlibUri CONFIG REQUIRED PATHS @CppNetlibUri_DIR@ NO_DEFAULT_PATH ) @PACKAGE_INIT@ include("@PACKAGE_CONF_DEST@/SoberTargets.cmake") function(_apply_release_imported_config_as_default tgt) get_target_property(location ${tgt} IMPORTED_LOCATION_RELEASE) get_target_property(link ${tgt} IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) if(NOT location) message(FATAL_ERROR "Release target `${tgt}` not installed") endif() set_target_properties( ${tgt} PROPERTIES IMPORTED_LOCATION "${location}" ) if(link) set_target_properties( ${tgt} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${link}" ) endif() endfunction() _apply_release_imported_config_as_default(sober) ## Instruction: Add find_package(JsonSpirit ...) to config ## Code After: find_package( CppNetlibUri CONFIG REQUIRED PATHS @CppNetlibUri_DIR@ NO_DEFAULT_PATH ) find_package(GTest CONFIG REQUIRED PATHS @GTest_DIR@ NO_DEFAULT_PATH) find_package(JsonSpirit CONFIG REQUIRED PATHS @JsonSpirit_DIR@ NO_DEFAULT_PATH) @PACKAGE_INIT@ include("@PACKAGE_CONF_DEST@/SoberTargets.cmake") function(_apply_release_imported_config_as_default tgt) get_target_property(location ${tgt} IMPORTED_LOCATION_RELEASE) get_target_property(link ${tgt} IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) if(NOT location) message(FATAL_ERROR "Release target `${tgt}` not installed") endif() set_target_properties( ${tgt} PROPERTIES IMPORTED_LOCATION "${location}" ) if(link) set_target_properties( ${tgt} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${link}" ) endif() endfunction() _apply_release_imported_config_as_default(sober)
- find_package(GTest CONFIG REQUIRED PATHS @GTest_DIR@ NO_DEFAULT_PATH) find_package( CppNetlibUri CONFIG REQUIRED PATHS @CppNetlibUri_DIR@ NO_DEFAULT_PATH ) + find_package(GTest CONFIG REQUIRED PATHS @GTest_DIR@ NO_DEFAULT_PATH) + find_package(JsonSpirit CONFIG REQUIRED PATHS @JsonSpirit_DIR@ NO_DEFAULT_PATH) @PACKAGE_INIT@ include("@PACKAGE_CONF_DEST@/SoberTargets.cmake") function(_apply_release_imported_config_as_default tgt) get_target_property(location ${tgt} IMPORTED_LOCATION_RELEASE) get_target_property(link ${tgt} IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) if(NOT location) message(FATAL_ERROR "Release target `${tgt}` not installed") endif() set_target_properties( ${tgt} PROPERTIES IMPORTED_LOCATION "${location}" ) if(link) set_target_properties( ${tgt} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${link}" ) endif() endfunction() _apply_release_imported_config_as_default(sober)
3
0.090909
2
1
c61e8508db1cc94d284d0589e7f2ad4527667c12
templates/modules/mod-perspective.tpl
templates/modules/mod-perspective.tpl
{if $perspectives|@count gt 0} {tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle} <form method="get" action="tiki-switch_perspective.php"> <select name="perspective"> <option>{tr}Default{/tr}</option> {foreach from=$perspectives item=persp} <option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option> {/foreach} </select> <input type="submit" value="{tr}Go{/tr}"/> </form> {if $tiki_p_perspective_admin eq 'y'} <div align="center"> <a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a> </div> {/if} {/tikimodule} {/if}
{if $perspectives|@count gt 0} {tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle} <form method="get" action="tiki-switch_perspective.php"> <select name="perspective" onchange="this.form.submit();"> <option>{tr}Default{/tr}</option> {foreach from=$perspectives item=persp} <option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option> {/foreach} </select> <noscript> <input type="submit" value="{tr}Go{/tr}"/> </noscript> </form> {if $tiki_p_perspective_admin eq 'y'} <div align="center"> <a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a> </div> {/if} {/tikimodule} {/if}
Use javascript to switch perspective on select change (and hide "Go" button) if enabled, to be more consistent with other modules (theme, lang etc)
[MOD] Use javascript to switch perspective on select change (and hide "Go" button) if enabled, to be more consistent with other modules (theme, lang etc) git-svn-id: 722c0fef737e30edb7d5e851b50e1eda1e207b8c@26852 b456876b-0849-0410-b77d-98878d47e9d5
Smarty
lgpl-2.1
changi67/tiki,tikiorg/tiki,changi67/tiki,oregional/tiki,tikiorg/tiki,oregional/tiki,oregional/tiki,oregional/tiki,changi67/tiki,changi67/tiki,tikiorg/tiki,tikiorg/tiki,changi67/tiki
smarty
## Code Before: {if $perspectives|@count gt 0} {tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle} <form method="get" action="tiki-switch_perspective.php"> <select name="perspective"> <option>{tr}Default{/tr}</option> {foreach from=$perspectives item=persp} <option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option> {/foreach} </select> <input type="submit" value="{tr}Go{/tr}"/> </form> {if $tiki_p_perspective_admin eq 'y'} <div align="center"> <a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a> </div> {/if} {/tikimodule} {/if} ## Instruction: [MOD] Use javascript to switch perspective on select change (and hide "Go" button) if enabled, to be more consistent with other modules (theme, lang etc) git-svn-id: 722c0fef737e30edb7d5e851b50e1eda1e207b8c@26852 b456876b-0849-0410-b77d-98878d47e9d5 ## Code After: {if $perspectives|@count gt 0} {tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle} <form method="get" action="tiki-switch_perspective.php"> <select name="perspective" onchange="this.form.submit();"> <option>{tr}Default{/tr}</option> {foreach from=$perspectives item=persp} <option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option> {/foreach} </select> <noscript> <input type="submit" value="{tr}Go{/tr}"/> </noscript> </form> {if $tiki_p_perspective_admin eq 'y'} <div align="center"> <a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a> </div> {/if} {/tikimodule} {/if}
{if $perspectives|@count gt 0} {tikimodule error=$module_params.error title=$tpl_module_title name="perspective" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle} <form method="get" action="tiki-switch_perspective.php"> - <select name="perspective"> + <select name="perspective" onchange="this.form.submit();"> <option>{tr}Default{/tr}</option> {foreach from=$perspectives item=persp} <option value="{$persp.perspectiveId|escape}"{if $persp.perspectiveId eq $current_perspective} selected="selected"{/if}>{$persp.name|escape}</option> {/foreach} </select> + <noscript> - <input type="submit" value="{tr}Go{/tr}"/> + <input type="submit" value="{tr}Go{/tr}"/> ? + + </noscript> </form> {if $tiki_p_perspective_admin eq 'y'} <div align="center"> <a href="tiki-edit_perspective.php">{tr}Edit perspectives{/tr}</a> </div> {/if} {/tikimodule} {/if}
6
0.333333
4
2
a78e4bd4f4340d7353351fdb3d20b4cf00ec16d3
src/rewrite_system/ast.mli
src/rewrite_system/ast.mli
(* Auxiliary types *) type type_name = string type type_binders = type_name list (* Kind definition *) (* An atom cannot be parametrized by types. *) (* kind List[A]: type *) (* kind Bool: type is equivalent to kind Bool[]: type *) type kind = | Type of type_binders | Atom (* Type application *) type polymorphic_arg = | RawType of type_name | AnyType (* Underscore representation for any type (e.g. List[_]) *) (* A type application is the process to apply a type to another. *) type type_application = type_name * polymorphic_arg list (* Constant definition *) type constant = type_binders * type_application (* Operator definition *) (* A binder is: "Variable" in Variable . Term * Term -> Term. (Note the '.' that delimitate the binder). *) type binder = type_name option type operator_args = type_application list type operator_result = type_name type operator = type_binders * binder * operator_args * operator_result (* Rule definition *) type pattern = | POperator of string * pattern list | PPlaceholder of string | PConstant of string | PAny type effect = | EOperator of string * effect list | EPlaceholder of string | EConstant of string type rule = pattern * effect (* rewriting system *) type info = Lexing.position type 'a symbol_table = (string, 'a * info) Hashtbl.t type rewriting_system = kind symbol_table * constant symbol_table * operator symbol_table * rule symbol_table
(* Auxiliary types *) type type_name = string type type_binders = type_name list (* Kind definition *) (* An atom cannot be parametrized by types. *) (* kind List: type -> type *) (* kind Variable: atom *) type kind = | Type of type_binders | Atom (* Type application *) (* A type application is the process to apply a type to another. *) (* Example: forall(A).List<A> *) type type_application = type_name * type_name list (* Constant definition *) type constant = type_binders * type_application (* Operator definition *) (* A binder is: "Variable" in [Variable].Term * Term -> Term. (Note the '.' that delimitates the binder). *) type binder = type_name option type operator_args = type_application list type operator_result = type_name type operator = type_binders * binder * operator_args * operator_result (* Rule definition *) type pattern = | POperator of string * pattern list | PPlaceholder of string | PConstant of string | PAny type effect = | EOperator of string * effect list | EPlaceholder of string | EConstant of string type rule = pattern * effect (* rewriting system *) type info = Lexing.position type 'a symbol_table = (string, 'a * info) Hashtbl.t type rewriting_system = kind symbol_table * constant symbol_table * operator symbol_table * rule symbol_table
Remove polymorphics_arg, it's just a type_name list. Update the comments.
Remove polymorphics_arg, it's just a type_name list. Update the comments.
OCaml
mit
fredokun/nominal-workbench
ocaml
## Code Before: (* Auxiliary types *) type type_name = string type type_binders = type_name list (* Kind definition *) (* An atom cannot be parametrized by types. *) (* kind List[A]: type *) (* kind Bool: type is equivalent to kind Bool[]: type *) type kind = | Type of type_binders | Atom (* Type application *) type polymorphic_arg = | RawType of type_name | AnyType (* Underscore representation for any type (e.g. List[_]) *) (* A type application is the process to apply a type to another. *) type type_application = type_name * polymorphic_arg list (* Constant definition *) type constant = type_binders * type_application (* Operator definition *) (* A binder is: "Variable" in Variable . Term * Term -> Term. (Note the '.' that delimitate the binder). *) type binder = type_name option type operator_args = type_application list type operator_result = type_name type operator = type_binders * binder * operator_args * operator_result (* Rule definition *) type pattern = | POperator of string * pattern list | PPlaceholder of string | PConstant of string | PAny type effect = | EOperator of string * effect list | EPlaceholder of string | EConstant of string type rule = pattern * effect (* rewriting system *) type info = Lexing.position type 'a symbol_table = (string, 'a * info) Hashtbl.t type rewriting_system = kind symbol_table * constant symbol_table * operator symbol_table * rule symbol_table ## Instruction: Remove polymorphics_arg, it's just a type_name list. Update the comments. ## Code After: (* Auxiliary types *) type type_name = string type type_binders = type_name list (* Kind definition *) (* An atom cannot be parametrized by types. *) (* kind List: type -> type *) (* kind Variable: atom *) type kind = | Type of type_binders | Atom (* Type application *) (* A type application is the process to apply a type to another. *) (* Example: forall(A).List<A> *) type type_application = type_name * type_name list (* Constant definition *) type constant = type_binders * type_application (* Operator definition *) (* A binder is: "Variable" in [Variable].Term * Term -> Term. (Note the '.' that delimitates the binder). *) type binder = type_name option type operator_args = type_application list type operator_result = type_name type operator = type_binders * binder * operator_args * operator_result (* Rule definition *) type pattern = | POperator of string * pattern list | PPlaceholder of string | PConstant of string | PAny type effect = | EOperator of string * effect list | EPlaceholder of string | EConstant of string type rule = pattern * effect (* rewriting system *) type info = Lexing.position type 'a symbol_table = (string, 'a * info) Hashtbl.t type rewriting_system = kind symbol_table * constant symbol_table * operator symbol_table * rule symbol_table
(* Auxiliary types *) type type_name = string type type_binders = type_name list (* Kind definition *) (* An atom cannot be parametrized by types. *) - (* kind List[A]: type *) ? --- + (* kind List: type -> type *) ? ++++++++ - (* kind Bool: type is equivalent to kind Bool[]: type *) + (* kind Variable: atom *) type kind = | Type of type_binders | Atom (* Type application *) - - type polymorphic_arg = - | RawType of type_name - | AnyType (* Underscore representation for any type (e.g. List[_]) *) - (* A type application is the process to apply a type to another. *) + (* Example: forall(A).List<A> *) - type type_application = type_name * polymorphic_arg list ? ^^^ ^^^^^^^^^^ + type type_application = type_name * type_name list ? ++ ^^^^ ^ (* Constant definition *) type constant = type_binders * type_application (* Operator definition *) - (* A binder is: "Variable" in Variable . Term * Term -> Term. ? ^ - + (* A binder is: "Variable" in [Variable].Term * Term -> Term. ? + ^ - (Note the '.' that delimitate the binder). *) + (Note the '.' that delimitates the binder). *) ? + type binder = type_name option type operator_args = type_application list type operator_result = type_name type operator = type_binders * binder * operator_args * operator_result (* Rule definition *) type pattern = | POperator of string * pattern list | PPlaceholder of string | PConstant of string | PAny type effect = | EOperator of string * effect list | EPlaceholder of string | EConstant of string type rule = pattern * effect (* rewriting system *) type info = Lexing.position type 'a symbol_table = (string, 'a * info) Hashtbl.t type rewriting_system = kind symbol_table * constant symbol_table * operator symbol_table * rule symbol_table
16
0.271186
6
10
94b37ba0abacbff53da342574b61c87810f6a5d4
bulletin/tools/plugins/forms/job.py
bulletin/tools/plugins/forms/job.py
from datetimewidget.widgets import DateTimeWidget from django.forms import ModelForm from form_utils.widgets import ImageWidget from ..models import Job job_field_labels = { 'image': 'Image (10Mb Limit)', 'url': 'URL' } job_help_texts = { 'url': 'Provide a full url, e.g., "http://www.example.com/page.html"' } class JobSubmitForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image'] labels = { } labels = job_field_labels help_texts = job_help_texts class JobUpdateForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image', 'approved', 'include_in_newsletter', 'pub_date'] widgets = { 'pub_date': DateTimeWidget(usel10n=True, bootstrap_version=3), 'image': ImageWidget(), } labels = job_field_labels help_texts = job_help_texts
from datetimewidget.widgets import DateTimeWidget from django.forms import ModelForm from form_utils.widgets import ImageWidget from ..models import Job job_field_labels = { 'image': 'Image (10Mb Limit)', 'url': 'URL' } job_help_texts = { 'url': 'Provide a full url, e.g., "http://www.example.com/page.html"' } field_widgets = { 'image': ImageWidget(attrs={'required': 'required'}) } class JobSubmitForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image'] labels = job_field_labels help_texts = job_help_texts widgets = field_widgets class JobUpdateForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image', 'approved', 'include_in_newsletter', 'pub_date'] widgets = { 'pub_date': DateTimeWidget(usel10n=True, bootstrap_version=3), 'image': ImageWidget(), } labels = job_field_labels help_texts = job_help_texts
Make image required on Job submit form.
Make image required on Job submit form.
Python
mit
AASHE/django-bulletin,AASHE/django-bulletin,AASHE/django-bulletin
python
## Code Before: from datetimewidget.widgets import DateTimeWidget from django.forms import ModelForm from form_utils.widgets import ImageWidget from ..models import Job job_field_labels = { 'image': 'Image (10Mb Limit)', 'url': 'URL' } job_help_texts = { 'url': 'Provide a full url, e.g., "http://www.example.com/page.html"' } class JobSubmitForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image'] labels = { } labels = job_field_labels help_texts = job_help_texts class JobUpdateForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image', 'approved', 'include_in_newsletter', 'pub_date'] widgets = { 'pub_date': DateTimeWidget(usel10n=True, bootstrap_version=3), 'image': ImageWidget(), } labels = job_field_labels help_texts = job_help_texts ## Instruction: Make image required on Job submit form. ## Code After: from datetimewidget.widgets import DateTimeWidget from django.forms import ModelForm from form_utils.widgets import ImageWidget from ..models import Job job_field_labels = { 'image': 'Image (10Mb Limit)', 'url': 'URL' } job_help_texts = { 'url': 'Provide a full url, e.g., "http://www.example.com/page.html"' } field_widgets = { 'image': ImageWidget(attrs={'required': 'required'}) } class JobSubmitForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image'] labels = job_field_labels help_texts = job_help_texts widgets = field_widgets class JobUpdateForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image', 'approved', 'include_in_newsletter', 'pub_date'] widgets = { 'pub_date': DateTimeWidget(usel10n=True, bootstrap_version=3), 'image': ImageWidget(), } labels = job_field_labels help_texts = job_help_texts
from datetimewidget.widgets import DateTimeWidget from django.forms import ModelForm from form_utils.widgets import ImageWidget from ..models import Job job_field_labels = { 'image': 'Image (10Mb Limit)', 'url': 'URL' } job_help_texts = { 'url': 'Provide a full url, e.g., "http://www.example.com/page.html"' } + field_widgets = { + 'image': ImageWidget(attrs={'required': 'required'}) + } + class JobSubmitForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image'] - labels = { - - } labels = job_field_labels help_texts = job_help_texts + widgets = field_widgets class JobUpdateForm(ModelForm): class Meta: model = Job fields = ['title', 'url', 'organization', 'image', 'approved', 'include_in_newsletter', 'pub_date'] widgets = { 'pub_date': DateTimeWidget(usel10n=True, bootstrap_version=3), 'image': ImageWidget(), } labels = job_field_labels help_texts = job_help_texts
8
0.166667
5
3
f6df4f359b3d949b3f87a22bda1a78237c396aef
tests/integrations/current/test_read.py
tests/integrations/current/test_read.py
import os from tests.integrations.base import BaseTest class TestReadCurrentView(BaseTest): def test_listdirs(self): dirs = set(os.listdir("%s/current" % self.mount_path)) assert dirs == set(['testing', 'me']) def test_read_from_a_file(self): with open("%s/current/testing" % self.mount_path) as f: assert f.read() == "just testing around here\n" def test_get_correct_stats(self): filename = "%s/current/testing" % self.mount_path stats = os.stat(filename) # TODO: get created + modified time attrs = { 'st_uid': os.getuid(), 'st_gid': os.getgid(), 'st_mode': 0100644 } for name, value in attrs.iteritems(): assert getattr(stats, name) == value
import os from tests.integrations.base import BaseTest class TestReadCurrentView(BaseTest): def test_listdirs(self): dirs = set(os.listdir("%s/current" % self.mount_path)) assert dirs == set(['testing', 'me']) def test_read_from_a_file(self): with open("%s/current/testing" % self.mount_path) as f: assert f.read() == "just testing around here\n" def test_get_correct_stats(self): filename = "%s/current/testing" % self.mount_path stats = os.stat(filename) filename = "%s/testing_repo/testing" % self.repo_path real_stats = os.stat(filename) attrs = { 'st_uid': os.getuid(), 'st_gid': os.getgid(), 'st_mode': 0100644, 'st_ctime': real_stats.st_ctime, 'st_mtime': real_stats.st_mtime, 'st_atime': real_stats.st_atime, } for name, value in attrs.iteritems(): assert getattr(stats, name) == value
Test time related stats from current view
Test time related stats from current view
Python
apache-2.0
bussiere/gitfs,PressLabs/gitfs,ksmaheshkumar/gitfs,rowhit/gitfs,PressLabs/gitfs
python
## Code Before: import os from tests.integrations.base import BaseTest class TestReadCurrentView(BaseTest): def test_listdirs(self): dirs = set(os.listdir("%s/current" % self.mount_path)) assert dirs == set(['testing', 'me']) def test_read_from_a_file(self): with open("%s/current/testing" % self.mount_path) as f: assert f.read() == "just testing around here\n" def test_get_correct_stats(self): filename = "%s/current/testing" % self.mount_path stats = os.stat(filename) # TODO: get created + modified time attrs = { 'st_uid': os.getuid(), 'st_gid': os.getgid(), 'st_mode': 0100644 } for name, value in attrs.iteritems(): assert getattr(stats, name) == value ## Instruction: Test time related stats from current view ## Code After: import os from tests.integrations.base import BaseTest class TestReadCurrentView(BaseTest): def test_listdirs(self): dirs = set(os.listdir("%s/current" % self.mount_path)) assert dirs == set(['testing', 'me']) def test_read_from_a_file(self): with open("%s/current/testing" % self.mount_path) as f: assert f.read() == "just testing around here\n" def test_get_correct_stats(self): filename = "%s/current/testing" % self.mount_path stats = os.stat(filename) filename = "%s/testing_repo/testing" % self.repo_path real_stats = os.stat(filename) attrs = { 'st_uid': os.getuid(), 'st_gid': os.getgid(), 'st_mode': 0100644, 'st_ctime': real_stats.st_ctime, 'st_mtime': real_stats.st_mtime, 'st_atime': real_stats.st_atime, } for name, value in attrs.iteritems(): assert getattr(stats, name) == value
import os from tests.integrations.base import BaseTest class TestReadCurrentView(BaseTest): def test_listdirs(self): dirs = set(os.listdir("%s/current" % self.mount_path)) assert dirs == set(['testing', 'me']) def test_read_from_a_file(self): with open("%s/current/testing" % self.mount_path) as f: assert f.read() == "just testing around here\n" def test_get_correct_stats(self): filename = "%s/current/testing" % self.mount_path stats = os.stat(filename) - # TODO: get created + modified time + filename = "%s/testing_repo/testing" % self.repo_path + real_stats = os.stat(filename) + attrs = { 'st_uid': os.getuid(), 'st_gid': os.getgid(), - 'st_mode': 0100644 + 'st_mode': 0100644, ? + + 'st_ctime': real_stats.st_ctime, + 'st_mtime': real_stats.st_mtime, + 'st_atime': real_stats.st_atime, } for name, value in attrs.iteritems(): assert getattr(stats, name) == value
9
0.333333
7
2
4465fc80923fe74f7fa1173f73ab083c9577ec77
lib/arel/ts_predications.rb
lib/arel/ts_predications.rb
module Arel module TSPredications def ts_query(expression, language=nil) vector = Arel::Nodes::TSVector.new(self, language) query = Arel::Nodes::TSQuery.new(expression, language) Arel::Nodes::TSMatch.new(vector, query) end end end
module Arel module TSPredications def ts_query(expression, language=nil) vector = Arel::Nodes::TSVector.new(self, language: language) query = Arel::Nodes::TSQuery.new(expression, language: language) Arel::Nodes::TSMatch.new(vector, query) end end end
Update TSPredication to use keyword args
Update TSPredication to use keyword args
Ruby
mit
malomalo/arel-extensions
ruby
## Code Before: module Arel module TSPredications def ts_query(expression, language=nil) vector = Arel::Nodes::TSVector.new(self, language) query = Arel::Nodes::TSQuery.new(expression, language) Arel::Nodes::TSMatch.new(vector, query) end end end ## Instruction: Update TSPredication to use keyword args ## Code After: module Arel module TSPredications def ts_query(expression, language=nil) vector = Arel::Nodes::TSVector.new(self, language: language) query = Arel::Nodes::TSQuery.new(expression, language: language) Arel::Nodes::TSMatch.new(vector, query) end end end
module Arel module TSPredications def ts_query(expression, language=nil) - vector = Arel::Nodes::TSVector.new(self, language) + vector = Arel::Nodes::TSVector.new(self, language: language) ? ++++++++++ - query = Arel::Nodes::TSQuery.new(expression, language) + query = Arel::Nodes::TSQuery.new(expression, language: language) ? ++++++++++ Arel::Nodes::TSMatch.new(vector, query) end end end
4
0.333333
2
2
4fb8fe36e9bb6c302fee1c6cea6b62300b7479b8
README.rst
README.rst
.. -*-restructuredtext-*- .. image:: https://github.com/ubernostrum/django-registration/workflows/CI/badge.svg :alt: CI status image This application provides management of Flash cross-domain access policies for `Django <https://www.djangoproject.com>`_ sites. For example, the following URL pattern is all you'd need to set up cross-domain access for Flash files served from your media server: .. code:: python from django.urls import path from flashpolicies.views import allow_domains urlpatterns = [ # ...your other URL patterns here... path( 'crossdomain.xml', allow_domains, {'domains': ['media.example.com']} ), ] Various other views are included, handling other common and not-so-common cases, as well as utilities for generating custom cross-domain policies. Full documentation for all functionality is also included and `available online <https://django-flashpolicies.readthedocs.io/>`_.
.. -*-restructuredtext-*- .. image:: https://github.com/ubernostrum/django-registration/workflows/CI/badge.svg :alt: CI status image :target: https://github.com/ubernostrum/django-flaskpolicies/actions?query=workflow%3ACI This application provides management of Flash cross-domain access policies for `Django <https://www.djangoproject.com>`_ sites. For example, the following URL pattern is all you'd need to set up cross-domain access for Flash files served from your media server: .. code:: python from django.urls import path from flashpolicies.views import allow_domains urlpatterns = [ # ...your other URL patterns here... path( 'crossdomain.xml', allow_domains, {'domains': ['media.example.com']} ), ] Various other views are included, handling other common and not-so-common cases, as well as utilities for generating custom cross-domain policies. Full documentation for all functionality is also included and `available online <https://django-flashpolicies.readthedocs.io/>`_.
Add CI URL to badge.
Add CI URL to badge.
reStructuredText
bsd-3-clause
ubernostrum/django-flashpolicies
restructuredtext
## Code Before: .. -*-restructuredtext-*- .. image:: https://github.com/ubernostrum/django-registration/workflows/CI/badge.svg :alt: CI status image This application provides management of Flash cross-domain access policies for `Django <https://www.djangoproject.com>`_ sites. For example, the following URL pattern is all you'd need to set up cross-domain access for Flash files served from your media server: .. code:: python from django.urls import path from flashpolicies.views import allow_domains urlpatterns = [ # ...your other URL patterns here... path( 'crossdomain.xml', allow_domains, {'domains': ['media.example.com']} ), ] Various other views are included, handling other common and not-so-common cases, as well as utilities for generating custom cross-domain policies. Full documentation for all functionality is also included and `available online <https://django-flashpolicies.readthedocs.io/>`_. ## Instruction: Add CI URL to badge. ## Code After: .. -*-restructuredtext-*- .. image:: https://github.com/ubernostrum/django-registration/workflows/CI/badge.svg :alt: CI status image :target: https://github.com/ubernostrum/django-flaskpolicies/actions?query=workflow%3ACI This application provides management of Flash cross-domain access policies for `Django <https://www.djangoproject.com>`_ sites. For example, the following URL pattern is all you'd need to set up cross-domain access for Flash files served from your media server: .. code:: python from django.urls import path from flashpolicies.views import allow_domains urlpatterns = [ # ...your other URL patterns here... path( 'crossdomain.xml', allow_domains, {'domains': ['media.example.com']} ), ] Various other views are included, handling other common and not-so-common cases, as well as utilities for generating custom cross-domain policies. Full documentation for all functionality is also included and `available online <https://django-flashpolicies.readthedocs.io/>`_.
.. -*-restructuredtext-*- .. image:: https://github.com/ubernostrum/django-registration/workflows/CI/badge.svg :alt: CI status image + :target: https://github.com/ubernostrum/django-flaskpolicies/actions?query=workflow%3ACI This application provides management of Flash cross-domain access policies for `Django <https://www.djangoproject.com>`_ sites. For example, the following URL pattern is all you'd need to set up cross-domain access for Flash files served from your media server: .. code:: python from django.urls import path from flashpolicies.views import allow_domains urlpatterns = [ # ...your other URL patterns here... path( 'crossdomain.xml', allow_domains, {'domains': ['media.example.com']} ), ] Various other views are included, handling other common and not-so-common cases, as well as utilities for generating custom cross-domain policies. Full documentation for all functionality is also included and `available online <https://django-flashpolicies.readthedocs.io/>`_.
1
0.030303
1
0
60b90ce4058c6a324898b212e90e398fe4094ff2
src/game.cpp
src/game.cpp
// "Game" specific data namespace { bool gIsRunning = false; class GameEventEar : public EventEar { public: void onWindowClose() { Game::stop(); } }; GameEventEar gEar; } void Game::run() { // Don't run it twice. if (gIsRunning) return; // Initialize the basics Window::open(800, 600); Clock::setTime(0.0); Events::addEar(&gEar); // Run the game loop gIsRunning = true; Clock::Timer frameCapTimer; while (gIsRunning) { // Poll for new events Events::poll(); // Perform drawing, logic, etc... // Cap the framerate at 60 Clock::sleepFor((1.0 / 60.0) - dt.get()); frameCapTimer.set(0.0); } // Close the basics Events::removeEar(&gEar); Window::close(); } void Game::stop() { gIsRunning = false; }
// "Game" specific data namespace { bool gIsRunning = false; class GameEventEar : public EventEar { public: void onWindowClose() { Game::stop(); } }; GameEventEar gEar; } void Game::run() { // Don't run it twice. if (gIsRunning) return; // Initialize the basics Window::open(800, 600); Clock::setTime(0.0); Events::addEar(&gEar); // Run the game loop gIsRunning = true; Clock::Timer frameCapTimer; while (gIsRunning) { // Poll for new events Events::poll(); // Perform drawing, logic, etc... // Cap the framerate at 60 Clock::sleepFor((1.0 / 60.0) - frameCapTimer.get()); frameCapTimer.set(0.0); } // Close the basics Events::removeEar(&gEar); Window::close(); } void Game::stop() { gIsRunning = false; }
Fix mistaken local variable name.
Fix mistaken local variable name.
C++
unlicense
jamiesyme/CozyCape
c++
## Code Before: // "Game" specific data namespace { bool gIsRunning = false; class GameEventEar : public EventEar { public: void onWindowClose() { Game::stop(); } }; GameEventEar gEar; } void Game::run() { // Don't run it twice. if (gIsRunning) return; // Initialize the basics Window::open(800, 600); Clock::setTime(0.0); Events::addEar(&gEar); // Run the game loop gIsRunning = true; Clock::Timer frameCapTimer; while (gIsRunning) { // Poll for new events Events::poll(); // Perform drawing, logic, etc... // Cap the framerate at 60 Clock::sleepFor((1.0 / 60.0) - dt.get()); frameCapTimer.set(0.0); } // Close the basics Events::removeEar(&gEar); Window::close(); } void Game::stop() { gIsRunning = false; } ## Instruction: Fix mistaken local variable name. ## Code After: // "Game" specific data namespace { bool gIsRunning = false; class GameEventEar : public EventEar { public: void onWindowClose() { Game::stop(); } }; GameEventEar gEar; } void Game::run() { // Don't run it twice. if (gIsRunning) return; // Initialize the basics Window::open(800, 600); Clock::setTime(0.0); Events::addEar(&gEar); // Run the game loop gIsRunning = true; Clock::Timer frameCapTimer; while (gIsRunning) { // Poll for new events Events::poll(); // Perform drawing, logic, etc... // Cap the framerate at 60 Clock::sleepFor((1.0 / 60.0) - frameCapTimer.get()); frameCapTimer.set(0.0); } // Close the basics Events::removeEar(&gEar); Window::close(); } void Game::stop() { gIsRunning = false; }
// "Game" specific data namespace { bool gIsRunning = false; class GameEventEar : public EventEar { public: void onWindowClose() { Game::stop(); } }; GameEventEar gEar; } void Game::run() { // Don't run it twice. if (gIsRunning) return; // Initialize the basics Window::open(800, 600); Clock::setTime(0.0); Events::addEar(&gEar); // Run the game loop gIsRunning = true; Clock::Timer frameCapTimer; while (gIsRunning) { // Poll for new events Events::poll(); // Perform drawing, logic, etc... // Cap the framerate at 60 - Clock::sleepFor((1.0 / 60.0) - dt.get()); ? ^^ + Clock::sleepFor((1.0 / 60.0) - frameCapTimer.get()); ? ^^^^^^^^^^^^^ frameCapTimer.set(0.0); } // Close the basics Events::removeEar(&gEar); Window::close(); } void Game::stop() { gIsRunning = false; }
2
0.038462
1
1
f87ec4e035fbebf3f35d0efeeb5e163cd0e342c4
_includes/header.html
_includes/header.html
<nav class="navigation"> {% for item in site.data.navigation %} <a class="navigation__link" href="{{ item.link }}"> {{ item.name }} {% endfor %} </a> </nav> <header class="header"> <div class="container"> <div class="pure-g"> <h1 class="header__title pure-u-1 pure-u-md-3-4"> <span>Renan</span> <span class="color-primary">Taranto</span> </h1> </div> <div class="pure-g"> <div class="pure-u-1 pure-u-md-1-3"> <div class="card"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} <span class="pull-right hidden-md"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </span> <p class="card__text">{{ site.description }}</p> </div> </div> <div class="pure-u-1 pure-u-md-1-3 visible-md"> <div class="card card--right"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> </div> </header>
<nav class="navigation"> {% for item in site.data.navigation %} <a class="navigation__link" href="{{ item.link }}"> {{ item.name }} {% endfor %} </a> </nav> <header class="header"> <div class="container"> <div class="pure-g"> <h1 class="header__title pure-u-1 pure-u-md-3-4"> <span>Renan</span> <span class="color-primary">Taranto</span> </h1> </div> <div class="card hidden-md"> <div class="pure-g hidden-md"> <div class="pure-u-1-2"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} <p class="card__text">{{ site.description }}</p> </div> <div class="pure-u-1-2"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> <div class="pure-g visible-md"> <div class="pure-u-md-1-3"> <div class="card"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} <p class="card__text">{{ site.description }}</p> </div> </div> <div class="pure-u-md-1-3"> <div class="card card--right"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> </div> </header>
Update circle icons position on small devices
[Home] Update circle icons position on small devices
HTML
mit
renan-taranto/renan-taranto.github.io,renan-taranto/renan-taranto.github.io,renan-taranto/renan-taranto.github.io
html
## Code Before: <nav class="navigation"> {% for item in site.data.navigation %} <a class="navigation__link" href="{{ item.link }}"> {{ item.name }} {% endfor %} </a> </nav> <header class="header"> <div class="container"> <div class="pure-g"> <h1 class="header__title pure-u-1 pure-u-md-3-4"> <span>Renan</span> <span class="color-primary">Taranto</span> </h1> </div> <div class="pure-g"> <div class="pure-u-1 pure-u-md-1-3"> <div class="card"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} <span class="pull-right hidden-md"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </span> <p class="card__text">{{ site.description }}</p> </div> </div> <div class="pure-u-1 pure-u-md-1-3 visible-md"> <div class="card card--right"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> </div> </header> ## Instruction: [Home] Update circle icons position on small devices ## Code After: <nav class="navigation"> {% for item in site.data.navigation %} <a class="navigation__link" href="{{ item.link }}"> {{ item.name }} {% endfor %} </a> </nav> <header class="header"> <div class="container"> <div class="pure-g"> <h1 class="header__title pure-u-1 pure-u-md-3-4"> <span>Renan</span> <span class="color-primary">Taranto</span> </h1> </div> <div class="card hidden-md"> <div class="pure-g hidden-md"> <div class="pure-u-1-2"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} <p class="card__text">{{ site.description }}</p> </div> <div class="pure-u-1-2"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> <div class="pure-g visible-md"> <div class="pure-u-md-1-3"> <div class="card"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} <p class="card__text">{{ site.description }}</p> </div> </div> <div class="pure-u-md-1-3"> <div class="card card--right"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> </div> </header>
<nav class="navigation"> {% for item in site.data.navigation %} - <a class="navigation__link" href="{{ item.link }}"> ? ---- + <a class="navigation__link" href="{{ item.link }}"> {{ item.name }} - {% endfor %} + {% endfor %} ? ++++ </a> </nav> <header class="header"> <div class="container"> <div class="pure-g"> <h1 class="header__title pure-u-1 pure-u-md-3-4"> <span>Renan</span> <span class="color-primary">Taranto</span> </h1> </div> + + <div class="card hidden-md"> + <div class="pure-g hidden-md"> + <div class="pure-u-1-2"> + {% include card-icon-primary.html %} + {% include card-icon-primary.html %} + {% include card-icon-github.html %} + <p class="card__text">{{ site.description }}</p> + </div> + <div class="pure-u-1-2"> + {% include card-icon-linkedin.html %} + {% include card-icon-rss.html %} + </div> + </div> + </div> + - <div class="pure-g"> + <div class="pure-g visible-md"> ? +++++++++++ - <div class="pure-u-1 pure-u-md-1-3"> ? --------- + <div class="pure-u-md-1-3"> <div class="card"> {% include card-icon-primary.html %} {% include card-icon-primary.html %} {% include card-icon-github.html %} - <span class="pull-right hidden-md"> - {% include card-icon-linkedin.html %} - {% include card-icon-rss.html %} - </span> <p class="card__text">{{ site.description }}</p> </div> </div> - <div class="pure-u-1 pure-u-md-1-3 visible-md"> ? --------- ----------- + <div class="pure-u-md-1-3"> <div class="card card--right"> {% include card-icon-linkedin.html %} {% include card-icon-rss.html %} </div> </div> </div> </div> </header>
30
0.810811
21
9
9b5395ab11d8b28bc996f42e266a11a591057551
online.js
online.js
'use strict'; let [,, onLineSrc, onCloseSrc ] = process.argv; let onLine = eval(onLineSrc) || (line => line); let onClose = eval(onCloseSrc) || (() => undefined); let env = new Set(); require('readline') .createInterface({ input: process.stdin }) .on('line', line => { let columns = line.match(/('(\\'|[^'])*'|"(\\"|[^"])*"|\/(\\\/|[^\/])*\/|(\\ |[^ ])+|[\w-]+)/g) || []; let value = onLine(line, columns, env); if (value != null) { console.log(value); } }) .on('close', () => { onClose(env); });
'use strict'; let [,, onLineSrc, onCloseSrc ] = process.argv; let onLine = eval(onLineSrc) || (line => line); let onClose = eval(onCloseSrc) || (() => undefined); let env = new Set(); require('readline') .createInterface({ input: process.stdin }) .on('line', line => { let columns = line.match(/('(\\'|[^'])*'|"(\\"|[^"])*"|\/(\\\/|[^\/])*\/|(\\ |[^ ])+|[\w-]+)/g) || []; let value = onLine(line, columns, env); if (value != null) { console.log(value); } }) .on('close', () => { let value = onClose(env); if (value != null) { console.log(value); } });
Print the return value of onClose if it's not null
Print the return value of onClose if it's not null
JavaScript
mit
bsdelf/scripts
javascript
## Code Before: 'use strict'; let [,, onLineSrc, onCloseSrc ] = process.argv; let onLine = eval(onLineSrc) || (line => line); let onClose = eval(onCloseSrc) || (() => undefined); let env = new Set(); require('readline') .createInterface({ input: process.stdin }) .on('line', line => { let columns = line.match(/('(\\'|[^'])*'|"(\\"|[^"])*"|\/(\\\/|[^\/])*\/|(\\ |[^ ])+|[\w-]+)/g) || []; let value = onLine(line, columns, env); if (value != null) { console.log(value); } }) .on('close', () => { onClose(env); }); ## Instruction: Print the return value of onClose if it's not null ## Code After: 'use strict'; let [,, onLineSrc, onCloseSrc ] = process.argv; let onLine = eval(onLineSrc) || (line => line); let onClose = eval(onCloseSrc) || (() => undefined); let env = new Set(); require('readline') .createInterface({ input: process.stdin }) .on('line', line => { let columns = line.match(/('(\\'|[^'])*'|"(\\"|[^"])*"|\/(\\\/|[^\/])*\/|(\\ |[^ ])+|[\w-]+)/g) || []; let value = onLine(line, columns, env); if (value != null) { console.log(value); } }) .on('close', () => { let value = onClose(env); if (value != null) { console.log(value); } });
'use strict'; let [,, onLineSrc, onCloseSrc ] = process.argv; let onLine = eval(onLineSrc) || (line => line); let onClose = eval(onCloseSrc) || (() => undefined); let env = new Set(); require('readline') .createInterface({ input: process.stdin }) .on('line', line => { let columns = line.match(/('(\\'|[^'])*'|"(\\"|[^"])*"|\/(\\\/|[^\/])*\/|(\\ |[^ ])+|[\w-]+)/g) || []; let value = onLine(line, columns, env); if (value != null) { console.log(value); } }) .on('close', () => { - onClose(env); + let value = onClose(env); ? ++++++++++++ + if (value != null) { + console.log(value); + } });
5
0.238095
4
1
e0deabd62ca372d421e8b620db53f3c887aa8808
lib/tty/table/operation/truncation.rb
lib/tty/table/operation/truncation.rb
module TTY class Table module Operation # A class responsible for shortening text. class Truncation def truncate(string, width, options={}) trailing = options.fetch :trailing, '…' as_unicode do chars = string.chars.to_a print 'CHARS ' p chars if chars.length < width chars.join else traling_size = trailing.chars.to_a.size ( chars[0, width-traling_size].join ) + trailing end end end if "".respond_to?(:encode) def as_unicode yield end else def as_unicode old, $KCODE = $KCODE, "U" yield ensure $KCODE = old end end end # Truncation end # Operation end # Table end # TTY
module TTY class Table module Operation # A class responsible for shortening text. class Truncation # Shorten given string with traling character. # # @param [String] string # the string to truncate # @param [Integer] width # the maximum width # @param [String] trailing # the trailing character # # @return [String] # # @api public def truncate(string, width, trailing = '…') chars = string.chars.to_a as_unicode do if chars.length < width chars.join else traling_size = trailing.chars.to_a.size ( chars[0, width - traling_size].join ) + trailing end end end if "".respond_to?(:encode) def as_unicode yield end else def as_unicode old, $KCODE = $KCODE, "U" yield ensure $KCODE = old end end end # Truncation end # Operation end # Table end # TTY
Change method signature and simplify, add comments.
Change method signature and simplify, add comments.
Ruby
mit
piotrmurach/tty,doudou/tty,peter-murach/tty,askl56/tty
ruby
## Code Before: module TTY class Table module Operation # A class responsible for shortening text. class Truncation def truncate(string, width, options={}) trailing = options.fetch :trailing, '…' as_unicode do chars = string.chars.to_a print 'CHARS ' p chars if chars.length < width chars.join else traling_size = trailing.chars.to_a.size ( chars[0, width-traling_size].join ) + trailing end end end if "".respond_to?(:encode) def as_unicode yield end else def as_unicode old, $KCODE = $KCODE, "U" yield ensure $KCODE = old end end end # Truncation end # Operation end # Table end # TTY ## Instruction: Change method signature and simplify, add comments. ## Code After: module TTY class Table module Operation # A class responsible for shortening text. class Truncation # Shorten given string with traling character. # # @param [String] string # the string to truncate # @param [Integer] width # the maximum width # @param [String] trailing # the trailing character # # @return [String] # # @api public def truncate(string, width, trailing = '…') chars = string.chars.to_a as_unicode do if chars.length < width chars.join else traling_size = trailing.chars.to_a.size ( chars[0, width - traling_size].join ) + trailing end end end if "".respond_to?(:encode) def as_unicode yield end else def as_unicode old, $KCODE = $KCODE, "U" yield ensure $KCODE = old end end end # Truncation end # Operation end # Table end # TTY
module TTY class Table module Operation # A class responsible for shortening text. class Truncation + # Shorten given string with traling character. + # + # @param [String] string + # the string to truncate + # @param [Integer] width + # the maximum width + # @param [String] trailing + # the trailing character + # + # @return [String] + # + # @api public - def truncate(string, width, options={}) ? -- ^ ^ ^^ + def truncate(string, width, trailing = '…') ? ++ ^^ ^^ ^^^^ + chars = string.chars.to_a - trailing = options.fetch :trailing, '…' - as_unicode do - chars = string.chars.to_a - print 'CHARS ' - p chars if chars.length < width chars.join else traling_size = trailing.chars.to_a.size - ( chars[0, width-traling_size].join ) + trailing + ( chars[0, width - traling_size].join ) + trailing ? + + end end end if "".respond_to?(:encode) def as_unicode yield end else def as_unicode old, $KCODE = $KCODE, "U" yield ensure $KCODE = old end end end # Truncation end # Operation end # Table end # TTY
22
0.536585
15
7
aa7162f3656aff145ab21f283f51a8c344882bc5
themes/galaxy/_layouts/blog.html
themes/galaxy/_layouts/blog.html
<?php $this->layout('layouts::_base') ?> <div class="content" editable=true> <?= $content ?> </div> <?php use Parvula\Core\Model\Page; $i = 0; $limit = 10; if (isset($page->options, $page->options['limit'])) { $limit = $page->options['limit']; } // Order children by date $children = $page->getChildren(); usort($children, function (Page $p1, Page $p2) { return $p1->getDateTime() < $p2->getDateTime(); }); ?> <div class="posts"> <?php if ($children): ?> <?php foreach ($children as $child): ?> <h3><a href="<?= $baseUrl . $child->slug ?>"><?= $child->title ?></a></h3> <p class="post-date font-italic text-muted"><?= $this->e($child, 'pageDateFormat') ?></p> <?php if (++$i >= $limit) { break; } ?> <?php endforeach; ?> <?php else: ?> <em>Nothing for the moment...</em> <?php endif; ?> </div>
<?php $this->layout('layouts::_base') ?> <div class="content" editable=true> <?= $content ?> </div> <?php use Parvula\Core\Model\Page; $i = 0; $limit = 10; if (isset($page->options, $page->options['limit'])) { $limit = $page->options['limit']; } $children = $page->getChildren(); ?> <div class="posts"> <?php if ($children): ?> <?php // Order children by date usort($children, function (Page $p1, Page $p2) { return $p1->getDateTime() < $p2->getDateTime(); }); ?> <?php foreach ($children as $child): ?> <h3><a href="<?= $baseUrl . $child->slug ?>"><?= $child->title ?></a></h3> <p class="post-date font-italic text-muted"><?= $this->e($child, 'pageDateFormat') ?></p> <?php if (++$i >= $limit) { break; } ?> <?php endforeach; ?> <?php else: ?> <em>Nothing for the moment...</em> <?php endif; ?> </div>
Fix bug if no children
Fix bug if no children
HTML
mit
BafS/parvula,ParvulaCMS/parvula,ParvulaCMS/parvula,BafS/parvula,BafS/parvula
html
## Code Before: <?php $this->layout('layouts::_base') ?> <div class="content" editable=true> <?= $content ?> </div> <?php use Parvula\Core\Model\Page; $i = 0; $limit = 10; if (isset($page->options, $page->options['limit'])) { $limit = $page->options['limit']; } // Order children by date $children = $page->getChildren(); usort($children, function (Page $p1, Page $p2) { return $p1->getDateTime() < $p2->getDateTime(); }); ?> <div class="posts"> <?php if ($children): ?> <?php foreach ($children as $child): ?> <h3><a href="<?= $baseUrl . $child->slug ?>"><?= $child->title ?></a></h3> <p class="post-date font-italic text-muted"><?= $this->e($child, 'pageDateFormat') ?></p> <?php if (++$i >= $limit) { break; } ?> <?php endforeach; ?> <?php else: ?> <em>Nothing for the moment...</em> <?php endif; ?> </div> ## Instruction: Fix bug if no children ## Code After: <?php $this->layout('layouts::_base') ?> <div class="content" editable=true> <?= $content ?> </div> <?php use Parvula\Core\Model\Page; $i = 0; $limit = 10; if (isset($page->options, $page->options['limit'])) { $limit = $page->options['limit']; } $children = $page->getChildren(); ?> <div class="posts"> <?php if ($children): ?> <?php // Order children by date usort($children, function (Page $p1, Page $p2) { return $p1->getDateTime() < $p2->getDateTime(); }); ?> <?php foreach ($children as $child): ?> <h3><a href="<?= $baseUrl . $child->slug ?>"><?= $child->title ?></a></h3> <p class="post-date font-italic text-muted"><?= $this->e($child, 'pageDateFormat') ?></p> <?php if (++$i >= $limit) { break; } ?> <?php endforeach; ?> <?php else: ?> <em>Nothing for the moment...</em> <?php endif; ?> </div>
<?php $this->layout('layouts::_base') ?> <div class="content" editable=true> <?= $content ?> </div> <?php use Parvula\Core\Model\Page; $i = 0; $limit = 10; if (isset($page->options, $page->options['limit'])) { $limit = $page->options['limit']; } - // Order children by date $children = $page->getChildren(); - usort($children, function (Page $p1, Page $p2) { - return $p1->getDateTime() < $p2->getDateTime(); - }); ?> <div class="posts"> <?php if ($children): ?> + <?php + // Order children by date + usort($children, function (Page $p1, Page $p2) { + return $p1->getDateTime() < $p2->getDateTime(); + }); + ?> <?php foreach ($children as $child): ?> <h3><a href="<?= $baseUrl . $child->slug ?>"><?= $child->title ?></a></h3> <p class="post-date font-italic text-muted"><?= $this->e($child, 'pageDateFormat') ?></p> <?php if (++$i >= $limit) { break; } ?> <?php endforeach; ?> <?php else: ?> <em>Nothing for the moment...</em> <?php endif; ?> </div>
10
0.30303
6
4
1cb201c57c592ebd014910fe225fa594cd87c745
opendebates/middleware.py
opendebates/middleware.py
from opendebates.utils import get_site_mode class SiteModeMiddleware(object): """ Gets or creates a SiteMode for the request, based on the hostname. """ def process_view(self, request, view_func, view_args, view_kwargs): request.site_mode = get_site_mode(request)
from opendebates.utils import get_site_mode class SiteModeMiddleware(object): """ Gets or creates a SiteMode for the request, based on the hostname. """ def process_request(self, request): request.site_mode = get_site_mode(request)
Make sure that the site mode is populated on the request
Make sure that the site mode is populated on the request even if the request winds up getting dispatched to a flatpage.
Python
apache-2.0
caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates,caktus/django-opendebates
python
## Code Before: from opendebates.utils import get_site_mode class SiteModeMiddleware(object): """ Gets or creates a SiteMode for the request, based on the hostname. """ def process_view(self, request, view_func, view_args, view_kwargs): request.site_mode = get_site_mode(request) ## Instruction: Make sure that the site mode is populated on the request even if the request winds up getting dispatched to a flatpage. ## Code After: from opendebates.utils import get_site_mode class SiteModeMiddleware(object): """ Gets or creates a SiteMode for the request, based on the hostname. """ def process_request(self, request): request.site_mode = get_site_mode(request)
from opendebates.utils import get_site_mode class SiteModeMiddleware(object): """ Gets or creates a SiteMode for the request, based on the hostname. """ - def process_view(self, request, view_func, view_args, view_kwargs): + def process_request(self, request): request.site_mode = get_site_mode(request)
2
0.2
1
1
b9914eb30a009af6ae7bf1bc7b3f28598bfbed39
conda/faiss/meta.yaml
conda/faiss/meta.yaml
package: name: faiss-cpu version: "{{ FAISS_BUILD_VERSION }}" source: git_url: ../../ requirements: build: - {{ compiler('cxx') }} - llvm-openmp # [osx] - setuptools - swig host: - python {{ python }} - intel-openmp # [osx] - numpy 1.11.* - mkl >=2018 run: - python {{ python }} - intel-openmp # [osx] - numpy >=1.11 - blas=*=mkl - mkl >=2018 build: number: {{ FAISS_BUILD_NUMBER }} about: home: https://github.com/facebookresearch/faiss license: MIT license_family: MIT license_file: LICENSE summary: A library for efficient similarity search and clustering of dense vectors.
package: name: faiss-cpu version: "{{ FAISS_BUILD_VERSION }}" source: git_url: ../../ requirements: build: - {{ compiler('cxx') }} - python {{ python }} - llvm-openmp # [osx] - setuptools - swig - mkl >=2018 host: - python {{ python }} - intel-openmp # [osx] - numpy 1.11.* - blas=*=mkl - mkl >=2018 run: - python {{ python }} - intel-openmp # [osx] - numpy >=1.11 - blas=*=mkl - mkl >=2018 build: number: {{ FAISS_BUILD_NUMBER }} about: home: https://github.com/facebookresearch/faiss license: MIT license_family: MIT license_file: LICENSE summary: A library for efficient similarity search and clustering of dense vectors.
Fix conda packages build reqs.
Fix conda packages build reqs.
YAML
mit
facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss,facebookresearch/faiss
yaml
## Code Before: package: name: faiss-cpu version: "{{ FAISS_BUILD_VERSION }}" source: git_url: ../../ requirements: build: - {{ compiler('cxx') }} - llvm-openmp # [osx] - setuptools - swig host: - python {{ python }} - intel-openmp # [osx] - numpy 1.11.* - mkl >=2018 run: - python {{ python }} - intel-openmp # [osx] - numpy >=1.11 - blas=*=mkl - mkl >=2018 build: number: {{ FAISS_BUILD_NUMBER }} about: home: https://github.com/facebookresearch/faiss license: MIT license_family: MIT license_file: LICENSE summary: A library for efficient similarity search and clustering of dense vectors. ## Instruction: Fix conda packages build reqs. ## Code After: package: name: faiss-cpu version: "{{ FAISS_BUILD_VERSION }}" source: git_url: ../../ requirements: build: - {{ compiler('cxx') }} - python {{ python }} - llvm-openmp # [osx] - setuptools - swig - mkl >=2018 host: - python {{ python }} - intel-openmp # [osx] - numpy 1.11.* - blas=*=mkl - mkl >=2018 run: - python {{ python }} - intel-openmp # [osx] - numpy >=1.11 - blas=*=mkl - mkl >=2018 build: number: {{ FAISS_BUILD_NUMBER }} about: home: https://github.com/facebookresearch/faiss license: MIT license_family: MIT license_file: LICENSE summary: A library for efficient similarity search and clustering of dense vectors.
package: name: faiss-cpu version: "{{ FAISS_BUILD_VERSION }}" source: git_url: ../../ requirements: build: - {{ compiler('cxx') }} + - python {{ python }} - llvm-openmp # [osx] - setuptools - swig + - mkl >=2018 host: - python {{ python }} - intel-openmp # [osx] - numpy 1.11.* + - blas=*=mkl - mkl >=2018 run: - python {{ python }} - intel-openmp # [osx] - numpy >=1.11 - blas=*=mkl - mkl >=2018 build: number: {{ FAISS_BUILD_NUMBER }} about: home: https://github.com/facebookresearch/faiss license: MIT license_family: MIT license_file: LICENSE summary: A library for efficient similarity search and clustering of dense vectors.
3
0.083333
3
0
c8878fc24ac0c22c266b202484e047e66be46694
docs/influxdb.md
docs/influxdb.md
cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located: Set the storage driver as InfluxDB. ``` -storage_driver=influxdb ``` Specify what InfluxDB instance to push data to: ``` # The *ip:port* of the database. Default is 'localhost:8086' -storage_driver_host=ip:port # database name. Uses db 'cadvisor' by default -storage_driver_db # database username. Default is 'root' -storage_driver_user # database password. Default is 'root' -storage_driver_password # Use secure connection with database. False by default -storage_driver_secure ```
cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located: Set the storage driver as InfluxDB. ``` -storage_driver=influxdb ``` Specify what InfluxDB instance to push data to: ``` # The *ip:port* of the database. Default is 'localhost:8086' -storage_driver_host=ip:port # database name. Uses db 'cadvisor' by default -storage_driver_db # database username. Default is 'root' -storage_driver_user # database password. Default is 'root' -storage_driver_password # Use secure connection with database. False by default -storage_driver_secure ``` # Examples [Brian Christner](https://www.brianchristner.io) wrote a detailed post on [setting up Docker monitoring](https://www.brianchristner.io/how-to-setup-docker-monitoring) with cAdvisor and Influxdb.
Add a link to the 'docker monitoring' example.
Add a link to the 'docker monitoring' example.
Markdown
apache-2.0
jzaefferer/cadvisor,bowlofstew/cadvisor,derwolfe/cadvisor,vegasbrianc/cadvisor,jzaefferer/cadvisor,derekwaynecarr/cadvisor,Snorch/cadvisor,yolkov/cadvisor,Snorch/cadvisor,timstclair/cadvisor,BrickXu/cadvisor,datawisesystems/cadvisor,carmark/cadvisor,difro/cadvisor,ainsleyc/cadvisor,jimmidyson/cadvisor,c-st/cadvisor,vishh/cadvisor,guoshimin/cadvisor,jimmidyson/cadvisor,whosthatknocking/cadvisor,dchen1107/cadvisor,derwolfe/cadvisor,IFTTT/cadvisor,erSitzt/cadvisor,yifan-gu/cadvisor,BrickXu/cadvisor,linux-on-ibm-z/cadvisor,f0/cadvisor,normanjoyner/cadvisor,CrazyJvm/cadvisor,jhjeong-kr/cadvisor,wulonghui/cadvisor,BrickXu/cadvisor,dchen1107/cadvisor,morpheyesh/cadvisor,bowlofstew/cadvisor,vishh/cadvisor,jzaefferer/cadvisor,megamsys/cadvisor,yolkov/cadvisor,bpradipt/cadvisor,ChengTiesheng/cadvisor,shilpamayanna/cadvisor,mangalaman93/cadvisor,erSitzt/cadvisor,ncdc/cadvisor,feiskyer/cadvisor,erSitzt/cadvisor,guoshimin/cadvisor,dalanlan/cadvisor,mangalaman93/cadvisor,normanjoyner/cadvisor,IFTTT/cadvisor,ChengTiesheng/cadvisor,jmaitrehenry/cadvisor,dalanlan/cadvisor,hzy001/cadvisor,ncdc/cadvisor,derekwaynecarr/cadvisor,atyenoria/cadvisor,f0/cadvisor,c-st/cadvisor,erSitzt/cadvisor,timstclair/cadvisor,vegasbrianc/cadvisor,dchen1107/cadvisor,IFTTT/cadvisor,kmicheal/cadvisor,Clever/cadvisor,dchen1107/cadvisor,pwittrock/cadvisor,jimonreal/cadvisor,IFTTT/cadvisor,erSitzt/cadvisor,IFTTT/cadvisor,pwittrock/cadvisor,jhjeong-kr/cadvisor,bing6/cadvisor,f0/cadvisor,ainsleyc/cadvisor,atyenoria/cadvisor,difro/cadvisor,vegasbrianc/cadvisor,f0/cadvisor,jmaitrehenry/cadvisor,feiskyer/cadvisor,bpradipt/cadvisor,takecy/cadvisor,jimmidyson/cadvisor,yifan-gu/cadvisor,c-st/cadvisor,hacpai/cadvisor,mr-justin/cadvisor,hw-qiaolei/cadvisor,takecy/cadvisor,anarcher/cadvisor,datawisesystems/cadvisor,CrazyJvm/cadvisor,derekwaynecarr/cadvisor,BrickXu/cadvisor,jhjeong-kr/cadvisor,f0/cadvisor,bowlofstew/cadvisor,ainsleyc/cadvisor,feiskyer/cadvisor,aivarasko/cadvisor,hw-qiaolei/cadvisor,whosthatknocking/cadvisor,hw-qiaolei/cadvisor,Clever/cadvisor,ChengTiesheng/cadvisor,jhjeong-kr/cadvisor,anarcher/cadvisor,timstclair/cadvisor,anarcher/cadvisor,mr-justin/cadvisor,rajthilakmca/cadvisor,hzy001/cadvisor,mangalaman93/cadvisor,Clever/cadvisor,jimonreal/cadvisor,pwittrock/cadvisor,aivarasko/cadvisor,hzy001/cadvisor,difro/cadvisor,morpheyesh/cadvisor,hacpai/cadvisor,bing6/cadvisor,rajthilakmca/cadvisor,shilpamayanna/cadvisor,ncdc/cadvisor,kmicheal/cadvisor,wulonghui/cadvisor,guoshimin/cadvisor,ncdc/cadvisor,jimonreal/cadvisor,dalanlan/cadvisor,vishh/cadvisor,derekwaynecarr/cadvisor,wulonghui/cadvisor,bpradipt/cadvisor,megamsys/cadvisor,rajthilakmca/cadvisor,hacpai/cadvisor,aivarasko/cadvisor,afein/cadvisor,ainsleyc/cadvisor,jmaitrehenry/cadvisor,bing6/cadvisor,carmark/cadvisor,ncdc/cadvisor,whosthatknocking/cadvisor,derwolfe/cadvisor,linux-on-ibm-z/cadvisor,yolkov/cadvisor,kmicheal/cadvisor,BrickXu/cadvisor,Snorch/cadvisor,atyenoria/cadvisor,CrazyJvm/cadvisor,linux-on-ibm-z/cadvisor,dchen1107/cadvisor,takecy/cadvisor,derekwaynecarr/cadvisor,mr-justin/cadvisor,jhjeong-kr/cadvisor,afein/cadvisor,yifan-gu/cadvisor
markdown
## Code Before: cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located: Set the storage driver as InfluxDB. ``` -storage_driver=influxdb ``` Specify what InfluxDB instance to push data to: ``` # The *ip:port* of the database. Default is 'localhost:8086' -storage_driver_host=ip:port # database name. Uses db 'cadvisor' by default -storage_driver_db # database username. Default is 'root' -storage_driver_user # database password. Default is 'root' -storage_driver_password # Use secure connection with database. False by default -storage_driver_secure ``` ## Instruction: Add a link to the 'docker monitoring' example. ## Code After: cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located: Set the storage driver as InfluxDB. ``` -storage_driver=influxdb ``` Specify what InfluxDB instance to push data to: ``` # The *ip:port* of the database. Default is 'localhost:8086' -storage_driver_host=ip:port # database name. Uses db 'cadvisor' by default -storage_driver_db # database username. Default is 'root' -storage_driver_user # database password. Default is 'root' -storage_driver_password # Use secure connection with database. False by default -storage_driver_secure ``` # Examples [Brian Christner](https://www.brianchristner.io) wrote a detailed post on [setting up Docker monitoring](https://www.brianchristner.io/how-to-setup-docker-monitoring) with cAdvisor and Influxdb.
cAdvisor supports exporting stats to [InfluxDB](http://influxdb.com). To use InfluxDB, you need to pass some additional flags to cAdvisor telling it where the InfluxDB instance is located: Set the storage driver as InfluxDB. ``` -storage_driver=influxdb ``` Specify what InfluxDB instance to push data to: ``` # The *ip:port* of the database. Default is 'localhost:8086' -storage_driver_host=ip:port # database name. Uses db 'cadvisor' by default -storage_driver_db # database username. Default is 'root' -storage_driver_user # database password. Default is 'root' -storage_driver_password # Use secure connection with database. False by default -storage_driver_secure ``` + + # Examples + + [Brian Christner](https://www.brianchristner.io) wrote a detailed post on [setting up Docker monitoring](https://www.brianchristner.io/how-to-setup-docker-monitoring) with cAdvisor and Influxdb.
4
0.173913
4
0
dc372ddc62d6b50c7359addbb23c93b3545a2c87
src/Support/Migration.php
src/Support/Migration.php
<?php namespace PragmaRX\Tracker\Support; use PragmaRX\Support\Migration as PragmaRxMigration; abstract class Migration extends PragmaRxMigration { protected function checkConnection() { $this->manager = app()->make('db'); $this->connection = $this->manager->connection('tracker'); parent::checkConnection(); } }
<?php namespace PragmaRX\Tracker\Support; use PragmaRX\Support\Migration as PragmaRxMigration; abstract class Migration extends PragmaRxMigration { protected function checkConnection() { $this->manager = app()->make('db'); $this->connection = $this->manager->connection(config('tracker.connection')); parent::checkConnection(); } }
Fix migrations with default MySQL connection.
Fix migrations with default MySQL connection.
PHP
mit
antonioribeiro/tracker,antonioribeiro/tracker
php
## Code Before: <?php namespace PragmaRX\Tracker\Support; use PragmaRX\Support\Migration as PragmaRxMigration; abstract class Migration extends PragmaRxMigration { protected function checkConnection() { $this->manager = app()->make('db'); $this->connection = $this->manager->connection('tracker'); parent::checkConnection(); } } ## Instruction: Fix migrations with default MySQL connection. ## Code After: <?php namespace PragmaRX\Tracker\Support; use PragmaRX\Support\Migration as PragmaRxMigration; abstract class Migration extends PragmaRxMigration { protected function checkConnection() { $this->manager = app()->make('db'); $this->connection = $this->manager->connection(config('tracker.connection')); parent::checkConnection(); } }
<?php namespace PragmaRX\Tracker\Support; use PragmaRX\Support\Migration as PragmaRxMigration; abstract class Migration extends PragmaRxMigration { protected function checkConnection() { $this->manager = app()->make('db'); - $this->connection = $this->manager->connection('tracker'); + $this->connection = $this->manager->connection(config('tracker.connection')); ? +++++++ +++++++++++ + parent::checkConnection(); } }
2
0.117647
1
1
99bfb71d3e6ea4fd17e299ac770e3f9edb344927
preview.php
preview.php
<?php ini_set("display_errors", 0); $thumbdir = 'clip/'; $uuid = uniqid(); $start = floatval($_GET['t']) - 0.9; $duration = 3; $anilistID = rawurldecode($_GET['anilist_id']); $season = rawurldecode($_GET['season']); // deprecated $anime = rawurldecode($_GET['anime']); // deprecated $file = rawurldecode($_GET['file']); $filepath = str_replace('`', '\`', '/mnt/data/anilist/'.$anilistID.'/'.$file); if ($season && $anime) { // deprecated $filepath = str_replace('`', '\`', '/mnt/data/anime_new/'.$season.'/'.$anime.'/'.$file); } $thumbpath = $thumbdir.$uuid.'.mp4'; if(file_exists($filepath)){ exec("ffmpeg -y -ss ".$start." -i \"$filepath\" -to ".$duration." -vf scale=640:-1 -c:v libx264 -preset fast ".$thumbpath); } header('Content-type: video/mp4'); readfile($thumbpath); unlink($thumbpath); ?>
<?php ini_set("display_errors", 0); $thumbdir = 'clip/'; $uuid = uniqid(); $start = floatval($_GET['t']) - 0.9; $duration = 3; $anilistID = rawurldecode($_GET['anilist_id']); $season = rawurldecode($_GET['season']); // deprecated $anime = rawurldecode($_GET['anime']); // deprecated $file = rawurldecode($_GET['file']); $filepath = str_replace('`', '\`', '/mnt/data/anilist/'.$anilistID.'/'.$file); if ($season && $anime) { // deprecated $filepath = str_replace('`', '\`', '/mnt/data/anime_new/'.$season.'/'.$anime.'/'.$file); } $thumbpath = $thumbdir.$uuid.'.mp4'; $mute = isset($_GET['mute']) ? "-an" : ""; if(file_exists($filepath)){ exec("ffmpeg -y -ss ".$start." -i \"$filepath\" -to ".$duration." -vf scale=640:-1 -c:v libx264 ".$mute." -preset fast ".$thumbpath); } header('Content-type: video/mp4'); readfile($thumbpath); unlink($thumbpath); ?>
Add mute param to generate mute video
Add mute param to generate mute video
PHP
mit
soruly/whatanime.ga,soruly/whatanime.ga,soruly/whatanime.ga
php
## Code Before: <?php ini_set("display_errors", 0); $thumbdir = 'clip/'; $uuid = uniqid(); $start = floatval($_GET['t']) - 0.9; $duration = 3; $anilistID = rawurldecode($_GET['anilist_id']); $season = rawurldecode($_GET['season']); // deprecated $anime = rawurldecode($_GET['anime']); // deprecated $file = rawurldecode($_GET['file']); $filepath = str_replace('`', '\`', '/mnt/data/anilist/'.$anilistID.'/'.$file); if ($season && $anime) { // deprecated $filepath = str_replace('`', '\`', '/mnt/data/anime_new/'.$season.'/'.$anime.'/'.$file); } $thumbpath = $thumbdir.$uuid.'.mp4'; if(file_exists($filepath)){ exec("ffmpeg -y -ss ".$start." -i \"$filepath\" -to ".$duration." -vf scale=640:-1 -c:v libx264 -preset fast ".$thumbpath); } header('Content-type: video/mp4'); readfile($thumbpath); unlink($thumbpath); ?> ## Instruction: Add mute param to generate mute video ## Code After: <?php ini_set("display_errors", 0); $thumbdir = 'clip/'; $uuid = uniqid(); $start = floatval($_GET['t']) - 0.9; $duration = 3; $anilistID = rawurldecode($_GET['anilist_id']); $season = rawurldecode($_GET['season']); // deprecated $anime = rawurldecode($_GET['anime']); // deprecated $file = rawurldecode($_GET['file']); $filepath = str_replace('`', '\`', '/mnt/data/anilist/'.$anilistID.'/'.$file); if ($season && $anime) { // deprecated $filepath = str_replace('`', '\`', '/mnt/data/anime_new/'.$season.'/'.$anime.'/'.$file); } $thumbpath = $thumbdir.$uuid.'.mp4'; $mute = isset($_GET['mute']) ? "-an" : ""; if(file_exists($filepath)){ exec("ffmpeg -y -ss ".$start." -i \"$filepath\" -to ".$duration." -vf scale=640:-1 -c:v libx264 ".$mute." -preset fast ".$thumbpath); } header('Content-type: video/mp4'); readfile($thumbpath); unlink($thumbpath); ?>
<?php ini_set("display_errors", 0); $thumbdir = 'clip/'; $uuid = uniqid(); $start = floatval($_GET['t']) - 0.9; $duration = 3; $anilistID = rawurldecode($_GET['anilist_id']); $season = rawurldecode($_GET['season']); // deprecated $anime = rawurldecode($_GET['anime']); // deprecated $file = rawurldecode($_GET['file']); $filepath = str_replace('`', '\`', '/mnt/data/anilist/'.$anilistID.'/'.$file); if ($season && $anime) { // deprecated $filepath = str_replace('`', '\`', '/mnt/data/anime_new/'.$season.'/'.$anime.'/'.$file); } $thumbpath = $thumbdir.$uuid.'.mp4'; + $mute = isset($_GET['mute']) ? "-an" : ""; if(file_exists($filepath)){ - exec("ffmpeg -y -ss ".$start." -i \"$filepath\" -to ".$duration." -vf scale=640:-1 -c:v libx264 -preset fast ".$thumbpath); + exec("ffmpeg -y -ss ".$start." -i \"$filepath\" -to ".$duration." -vf scale=640:-1 -c:v libx264 ".$mute." -preset fast ".$thumbpath); ? ++++++++++ } header('Content-type: video/mp4'); readfile($thumbpath); unlink($thumbpath); ?>
3
0.12
2
1
4363fe9d5927b48488bd1305c8a943147cbb39f0
platform/lang-impl/src/com/intellij/build/BuildEventDispatcher.java
platform/lang-impl/src/com/intellij/build/BuildEventDispatcher.java
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.build; import org.jetbrains.annotations.ApiStatus; import java.io.Closeable; /** * @author Vladislav.Soroka */ @ApiStatus.Experimental public interface BuildEventDispatcher extends Appendable, Closeable, BuildProgressListener { @Override BuildEventDispatcher append(CharSequence csq); @Override BuildEventDispatcher append(CharSequence csq, int start, int end); @Override BuildEventDispatcher append(char c); @Override void close(); void setStdOut(boolean stdOut); }
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.build; import org.jetbrains.annotations.ApiStatus; import java.io.Closeable; /** * @author Vladislav.Soroka */ @ApiStatus.Experimental public interface BuildEventDispatcher extends Appendable, Closeable, BuildProgressListener { @Override default BuildEventDispatcher append(CharSequence csq) {return this;} @Override default BuildEventDispatcher append(CharSequence csq, int start, int end) {return this;} @Override default BuildEventDispatcher append(char c) {return this;} @Override default void close() {} default void setStdOut(boolean stdOut) {} }
Build tw: fix fetching models of android projects w/o output parsing IDEA-209457
Build tw: fix fetching models of android projects w/o output parsing IDEA-209457 GitOrigin-RevId: 4476671907a478bebc377d3922d723f093c389f1
Java
apache-2.0
allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community
java
## Code Before: // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.build; import org.jetbrains.annotations.ApiStatus; import java.io.Closeable; /** * @author Vladislav.Soroka */ @ApiStatus.Experimental public interface BuildEventDispatcher extends Appendable, Closeable, BuildProgressListener { @Override BuildEventDispatcher append(CharSequence csq); @Override BuildEventDispatcher append(CharSequence csq, int start, int end); @Override BuildEventDispatcher append(char c); @Override void close(); void setStdOut(boolean stdOut); } ## Instruction: Build tw: fix fetching models of android projects w/o output parsing IDEA-209457 GitOrigin-RevId: 4476671907a478bebc377d3922d723f093c389f1 ## Code After: // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.build; import org.jetbrains.annotations.ApiStatus; import java.io.Closeable; /** * @author Vladislav.Soroka */ @ApiStatus.Experimental public interface BuildEventDispatcher extends Appendable, Closeable, BuildProgressListener { @Override default BuildEventDispatcher append(CharSequence csq) {return this;} @Override default BuildEventDispatcher append(CharSequence csq, int start, int end) {return this;} @Override default BuildEventDispatcher append(char c) {return this;} @Override default void close() {} default void setStdOut(boolean stdOut) {} }
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.build; import org.jetbrains.annotations.ApiStatus; import java.io.Closeable; /** * @author Vladislav.Soroka */ @ApiStatus.Experimental public interface BuildEventDispatcher extends Appendable, Closeable, BuildProgressListener { @Override - BuildEventDispatcher append(CharSequence csq); + default BuildEventDispatcher append(CharSequence csq) {return this;} ? ++++++++ +++++++++++++ + @Override - BuildEventDispatcher append(CharSequence csq, int start, int end); + default BuildEventDispatcher append(CharSequence csq, int start, int end) {return this;} ? ++++++++ +++++++++++++ + @Override - BuildEventDispatcher append(char c); + default BuildEventDispatcher append(char c) {return this;} ? ++++++++ +++++++++++++ + @Override - void close(); + default void close() {} - void setStdOut(boolean stdOut); ? ^ + default void setStdOut(boolean stdOut) {} ? ++++++++ ^^^ }
10
0.384615
5
5
2e42f1be90726d9b0d4569b7b81c62769cb8a6e5
infrastructure-modules/prod/storage/storage.tf
infrastructure-modules/prod/storage/storage.tf
module "config-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.stack_name}-prod-config" } module "cloudinit-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.stack_name}-prod-cloudinit" } # Outputs to be accessible through remote state output "config-bucket-arn" { value = "${module.config-bucket.arn}" } output "config-bucket-name" { value = "${module.config-bucket.bucket_name}" } output "cloudinit-bucket-arn" { value = "${module.cloudinit-bucket.arn}" }
module "config-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.prod_config_bucket_name}" } module "cloudinit-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.prod_cloudinit_bucket_name}" } # Outputs to be accessible through remote state output "config-bucket-arn" { value = "${module.config-bucket.arn}" } output "config-bucket-name" { value = "${module.config-bucket.bucket_name}" } output "cloudinit-bucket-arn" { value = "${module.cloudinit-bucket.arn}" }
Use prod bucket names from makefile vars
Use prod bucket names from makefile vars
HCL
apache-2.0
stakater/infrastructure-reference
hcl
## Code Before: module "config-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.stack_name}-prod-config" } module "cloudinit-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.stack_name}-prod-cloudinit" } # Outputs to be accessible through remote state output "config-bucket-arn" { value = "${module.config-bucket.arn}" } output "config-bucket-name" { value = "${module.config-bucket.bucket_name}" } output "cloudinit-bucket-arn" { value = "${module.cloudinit-bucket.arn}" } ## Instruction: Use prod bucket names from makefile vars ## Code After: module "config-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.prod_config_bucket_name}" } module "cloudinit-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" name = "${var.prod_cloudinit_bucket_name}" } # Outputs to be accessible through remote state output "config-bucket-arn" { value = "${module.config-bucket.arn}" } output "config-bucket-name" { value = "${module.config-bucket.bucket_name}" } output "cloudinit-bucket-arn" { value = "${module.cloudinit-bucket.arn}" }
module "config-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" - name = "${var.stack_name}-prod-config" + name = "${var.prod_config_bucket_name}" } module "cloudinit-bucket" { source = "github.com/stakater/blueprint-storage-aws.git//modules/s3" - name = "${var.stack_name}-prod-cloudinit" + name = "${var.prod_cloudinit_bucket_name}" } # Outputs to be accessible through remote state output "config-bucket-arn" { value = "${module.config-bucket.arn}" } output "config-bucket-name" { value = "${module.config-bucket.bucket_name}" } output "cloudinit-bucket-arn" { value = "${module.cloudinit-bucket.arn}" }
4
0.181818
2
2
1dc21a911253f9485a71963701355a226b8a71e5
test/load-json-spec.js
test/load-json-spec.js
/* global require, describe, it */ import assert from 'assert'; var urlPrefix = 'http://katas.tddbin.com/katas/es6/language/'; var katasUrl = urlPrefix + '__grouped__.json'; var GroupedKata = require('../src/grouped-kata.js'); describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } new GroupedKata(katasUrl).load(function() {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { function onError(err) { assert.ok(err); done(); } var invalidUrl = urlPrefix; new GroupedKata(invalidUrl).load(onError); }); it('for invalid data', function(done) { function onError(err) { assert.ok(err); done(); } var invalidData = urlPrefix + '__all__.json'; new GroupedKata(invalidData).load(onError); }); }); });
/* global describe, it */ import assert from 'assert'; const urlPrefix = 'http://katas.tddbin.com/katas/es6/language'; const katasUrl = `${urlPrefix}/__grouped__.json`; import GroupedKata from '../src/grouped-kata.js'; describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } new GroupedKata(katasUrl).load(() => {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { function onError(err) { assert.ok(err); done(); } var invalidUrl = urlPrefix; new GroupedKata(invalidUrl).load(onError); }); it('for invalid data', function(done) { function onError(err) { assert.ok(err); done(); } var invalidData = `${urlPrefix}/__all__.json`; new GroupedKata(invalidData).load(onError); }); }); });
Use ES6 in the tests.
Use ES6 in the tests.
JavaScript
mit
wolframkriesing/es6-react-workshop,wolframkriesing/es6-react-workshop
javascript
## Code Before: /* global require, describe, it */ import assert from 'assert'; var urlPrefix = 'http://katas.tddbin.com/katas/es6/language/'; var katasUrl = urlPrefix + '__grouped__.json'; var GroupedKata = require('../src/grouped-kata.js'); describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } new GroupedKata(katasUrl).load(function() {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { function onError(err) { assert.ok(err); done(); } var invalidUrl = urlPrefix; new GroupedKata(invalidUrl).load(onError); }); it('for invalid data', function(done) { function onError(err) { assert.ok(err); done(); } var invalidData = urlPrefix + '__all__.json'; new GroupedKata(invalidData).load(onError); }); }); }); ## Instruction: Use ES6 in the tests. ## Code After: /* global describe, it */ import assert from 'assert'; const urlPrefix = 'http://katas.tddbin.com/katas/es6/language'; const katasUrl = `${urlPrefix}/__grouped__.json`; import GroupedKata from '../src/grouped-kata.js'; describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } new GroupedKata(katasUrl).load(() => {}, onSuccess); }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { function onError(err) { assert.ok(err); done(); } var invalidUrl = urlPrefix; new GroupedKata(invalidUrl).load(onError); }); it('for invalid data', function(done) { function onError(err) { assert.ok(err); done(); } var invalidData = `${urlPrefix}/__all__.json`; new GroupedKata(invalidData).load(onError); }); }); });
- /* global require, describe, it */ ? --------- + /* global describe, it */ import assert from 'assert'; - var urlPrefix = 'http://katas.tddbin.com/katas/es6/language/'; ? ^^^ - + const urlPrefix = 'http://katas.tddbin.com/katas/es6/language'; ? ^^^^^ - var katasUrl = urlPrefix + '__grouped__.json'; ? ^^^ ^^^^ ^ + const katasUrl = `${urlPrefix}/__grouped__.json`; ? ^^^^^ +++ ^^ ^ - var GroupedKata = require('../src/grouped-kata.js'); ? ^^ ^ -------- - + import GroupedKata from '../src/grouped-kata.js'; ? ^^^^ + ^^^^ describe('load ES6 kata data', function() { it('loaded data are as expected', function(done) { function onSuccess(groupedKatas) { assert.ok(groupedKatas); done(); } - new GroupedKata(katasUrl).load(function() {}, onSuccess); ? -------- + new GroupedKata(katasUrl).load(() => {}, onSuccess); ? +++ }); describe('on error, call error callback and the error passed', function() { it('invalid JSON', function(done) { function onError(err) { assert.ok(err); done(); } var invalidUrl = urlPrefix; new GroupedKata(invalidUrl).load(onError); }); it('for invalid data', function(done) { function onError(err) { assert.ok(err); done(); } - var invalidData = urlPrefix + '__all__.json'; ? ^^^^ ^ + var invalidData = `${urlPrefix}/__all__.json`; ? +++ ^^ ^ new GroupedKata(invalidData).load(onError); }); }); });
12
0.315789
6
6
58307b8ada6e2c5ec8c5878739938ab4d7d947e1
src/test/resources/com/foundationdb/sql/pg/yaml/functional/test-script-functions.yaml
src/test/resources/com/foundationdb/sql/pg/yaml/functional/test-script-functions.yaml
--- - Statement: CREATE FUNCTION test_f1(x DOUBLE, y INT) RETURNS DOUBLE LANGUAGE javascript PARAMETER STYLE variables AS 'Math.pow(x, y)' DETERMINISTIC; --- - Statement: SELECT test_f1(10,3) - output: [[1000.0]] --- - Statement: > CREATE FUNCTION test_f2(s VARCHAR(1024), p VARCHAR(128)) RETURNS VARCHAR(1024) AS $$ function f2(s, p) { var re = RegExp(p, "i"); var match = re.exec(s); if (match != null) return match[1]; } $$ LANGUAGE javascript PARAMETER STYLE java EXTERNAL NAME 'f2'; --- - CreateTable: t2 (id INT NOT NULL PRIMARY KEY, s VARCHAR(1024)) --- - Statement: INSERT INTO t2 VALUES(1, 'Hello World'),(2, 'hello test'),(3, 'xyz') --- - Statement: SELECT id, test_f2(s, ?) FROM t2 - params: [['Hello (.*)']] - output: [[1,'World'],[2,'test'],[3,null]] --- # Function as procedure - Statement: CALL test_f1(10,3) - output: [[1000.0]] --- # System FTS needs explict drops of FUNCTION - Statement: DROP FUNCTION test_f1 --- - Statement: DROP FUNCTION test_f2 ...
--- - Statement: CREATE FUNCTION test_f1(x DOUBLE, y INT) RETURNS DOUBLE LANGUAGE javascript PARAMETER STYLE variables AS 'Math.pow(x, y)' DETERMINISTIC; --- - Statement: SELECT test_f1(10,3) - output: [[1000.0]] --- - Statement: > CREATE FUNCTION test_f2(s VARCHAR(1024), p VARCHAR(128)) RETURNS VARCHAR(1024) AS $$ function f2(s, p) { var re = RegExp(p, "i"); var match = re.exec(s); if (match != null) return match[1]; } $$ LANGUAGE javascript PARAMETER STYLE java EXTERNAL NAME 'f2'; --- - CreateTable: t2 (id INT NOT NULL PRIMARY KEY, s VARCHAR(1024)) --- - Statement: INSERT INTO t2 VALUES(1, 'Hello World'),(2, 'hello test'),(3, 'xyz') --- - Statement: SELECT id, test_f2(s, ?) FROM t2 - params: [['Hello (.*)']] - output: [[1,'World'],[2,'test'],[3,null]] --- # JDBC syntax - Statement: '{ ? = CALL test_f1(?,?) }' - params: [[null, 2.0, 3]] - output: [[8.0]] --- # Function as procedure - Statement: CALL test_f1(10,3) - output: [[1000.0]] --- # System FTS needs explict drops of FUNCTION - Statement: DROP FUNCTION test_f1 --- - Statement: DROP FUNCTION test_f2 ...
Add a call to function via JDBC syntax (which is recognized by our parser).
Add a call to function via JDBC syntax (which is recognized by our parser).
YAML
agpl-3.0
ngaut/sql-layer,qiuyesuifeng/sql-layer,wfxiang08/sql-layer-1,ngaut/sql-layer,shunwang/sql-layer-1,qiuyesuifeng/sql-layer,ngaut/sql-layer,relateiq/sql-layer,jaytaylor/sql-layer,shunwang/sql-layer-1,wfxiang08/sql-layer-1,shunwang/sql-layer-1,jaytaylor/sql-layer,relateiq/sql-layer,jaytaylor/sql-layer,relateiq/sql-layer,wfxiang08/sql-layer-1,wfxiang08/sql-layer-1,qiuyesuifeng/sql-layer,relateiq/sql-layer,qiuyesuifeng/sql-layer,jaytaylor/sql-layer,shunwang/sql-layer-1,ngaut/sql-layer
yaml
## Code Before: --- - Statement: CREATE FUNCTION test_f1(x DOUBLE, y INT) RETURNS DOUBLE LANGUAGE javascript PARAMETER STYLE variables AS 'Math.pow(x, y)' DETERMINISTIC; --- - Statement: SELECT test_f1(10,3) - output: [[1000.0]] --- - Statement: > CREATE FUNCTION test_f2(s VARCHAR(1024), p VARCHAR(128)) RETURNS VARCHAR(1024) AS $$ function f2(s, p) { var re = RegExp(p, "i"); var match = re.exec(s); if (match != null) return match[1]; } $$ LANGUAGE javascript PARAMETER STYLE java EXTERNAL NAME 'f2'; --- - CreateTable: t2 (id INT NOT NULL PRIMARY KEY, s VARCHAR(1024)) --- - Statement: INSERT INTO t2 VALUES(1, 'Hello World'),(2, 'hello test'),(3, 'xyz') --- - Statement: SELECT id, test_f2(s, ?) FROM t2 - params: [['Hello (.*)']] - output: [[1,'World'],[2,'test'],[3,null]] --- # Function as procedure - Statement: CALL test_f1(10,3) - output: [[1000.0]] --- # System FTS needs explict drops of FUNCTION - Statement: DROP FUNCTION test_f1 --- - Statement: DROP FUNCTION test_f2 ... ## Instruction: Add a call to function via JDBC syntax (which is recognized by our parser). ## Code After: --- - Statement: CREATE FUNCTION test_f1(x DOUBLE, y INT) RETURNS DOUBLE LANGUAGE javascript PARAMETER STYLE variables AS 'Math.pow(x, y)' DETERMINISTIC; --- - Statement: SELECT test_f1(10,3) - output: [[1000.0]] --- - Statement: > CREATE FUNCTION test_f2(s VARCHAR(1024), p VARCHAR(128)) RETURNS VARCHAR(1024) AS $$ function f2(s, p) { var re = RegExp(p, "i"); var match = re.exec(s); if (match != null) return match[1]; } $$ LANGUAGE javascript PARAMETER STYLE java EXTERNAL NAME 'f2'; --- - CreateTable: t2 (id INT NOT NULL PRIMARY KEY, s VARCHAR(1024)) --- - Statement: INSERT INTO t2 VALUES(1, 'Hello World'),(2, 'hello test'),(3, 'xyz') --- - Statement: SELECT id, test_f2(s, ?) FROM t2 - params: [['Hello (.*)']] - output: [[1,'World'],[2,'test'],[3,null]] --- # JDBC syntax - Statement: '{ ? = CALL test_f1(?,?) }' - params: [[null, 2.0, 3]] - output: [[8.0]] --- # Function as procedure - Statement: CALL test_f1(10,3) - output: [[1000.0]] --- # System FTS needs explict drops of FUNCTION - Statement: DROP FUNCTION test_f1 --- - Statement: DROP FUNCTION test_f2 ...
--- - Statement: CREATE FUNCTION test_f1(x DOUBLE, y INT) RETURNS DOUBLE LANGUAGE javascript PARAMETER STYLE variables AS 'Math.pow(x, y)' DETERMINISTIC; --- - Statement: SELECT test_f1(10,3) - output: [[1000.0]] --- - Statement: > CREATE FUNCTION test_f2(s VARCHAR(1024), p VARCHAR(128)) RETURNS VARCHAR(1024) AS $$ function f2(s, p) { var re = RegExp(p, "i"); var match = re.exec(s); if (match != null) return match[1]; } $$ LANGUAGE javascript PARAMETER STYLE java EXTERNAL NAME 'f2'; --- - CreateTable: t2 (id INT NOT NULL PRIMARY KEY, s VARCHAR(1024)) --- - Statement: INSERT INTO t2 VALUES(1, 'Hello World'),(2, 'hello test'),(3, 'xyz') --- - Statement: SELECT id, test_f2(s, ?) FROM t2 - params: [['Hello (.*)']] - output: [[1,'World'],[2,'test'],[3,null]] --- + # JDBC syntax + - Statement: '{ ? = CALL test_f1(?,?) }' + - params: [[null, 2.0, 3]] + - output: [[8.0]] + --- # Function as procedure - Statement: CALL test_f1(10,3) - output: [[1000.0]] --- # System FTS needs explict drops of FUNCTION - Statement: DROP FUNCTION test_f1 --- - Statement: DROP FUNCTION test_f2 ...
5
0.151515
5
0
5545df9938377b6397f496b22045d9a3895fa669
TrailScribeTest/src/edu/cmu/sv/trailscribe/tests/SynchronizationCenterActivityTest.java
TrailScribeTest/src/edu/cmu/sv/trailscribe/tests/SynchronizationCenterActivityTest.java
package edu.cmu.sv.trailscribe.tests; import android.test.ActivityInstrumentationTestCase2; import edu.cmu.sv.trailscribe.view.SynchronizationCenterActivity; import edu.cmu.sv.trailscribe.R; import android.widget.ListView; public class SynchronizationCenterActivityTest extends ActivityInstrumentationTestCase2<SynchronizationCenterActivity> { private SynchronizationCenterActivity syncActivity; public SynchronizationCenterActivityTest() { super("edu.cmu.sv.trailscribe", SynchronizationCenterActivity.class); } @Override public void setUp() throws Exception { super.setUp(); syncActivity = getActivity(); } public void testPreconditions() { assertNotNull("Sync activity not found", syncActivity); } }
package edu.cmu.sv.trailscribe.tests; import android.test.ActivityInstrumentationTestCase2; import edu.cmu.sv.trailscribe.view.SynchronizationCenterActivity; import edu.cmu.sv.trailscribe.R; import android.widget.ListView; import java.util.concurrent.TimeUnit; import android.database.DataSetObserver; import java.util.concurrent.CountDownLatch; import android.widget.ArrayAdapter; import edu.cmu.sv.trailscribe.model.Map; import android.util.Log; public class SynchronizationCenterActivityTest extends ActivityInstrumentationTestCase2<SynchronizationCenterActivity> { private static final String LOG_TAG = "SynchronizationCenterActivityTest"; private static final long MAP_LIST_FETCH_TIMEOUT = 50L; private SynchronizationCenterActivity syncActivity; public SynchronizationCenterActivityTest() { super("edu.cmu.sv.trailscribe", SynchronizationCenterActivity.class); } @Override public void setUp() throws Exception { super.setUp(); syncActivity = getActivity(); } public void testPreconditions() { assertNotNull("Sync activity not found", syncActivity); } public void testMapList_fetchMaps() { if (syncActivity.areMapsFetched()) { Log.d(LOG_TAG, "Map data has already been fetched"); return; } final CountDownLatch done = new CountDownLatch(1); syncActivity.setMapsFetchedCallback(new Runnable() { @Override public void run() { done.countDown(); } }); try { final boolean result = done.await(MAP_LIST_FETCH_TIMEOUT, TimeUnit.SECONDS); assertTrue("Fetching map list took loo long", result); } catch (InterruptedException e) { fail("Map fetching interrupted"); } } }
Add test for map fetching in sync center
Add test for map fetching in sync center
Java
mit
CMUPracticum/TrailScribe,CMUPracticum/TrailScribe,CMUPracticum/TrailScribe
java
## Code Before: package edu.cmu.sv.trailscribe.tests; import android.test.ActivityInstrumentationTestCase2; import edu.cmu.sv.trailscribe.view.SynchronizationCenterActivity; import edu.cmu.sv.trailscribe.R; import android.widget.ListView; public class SynchronizationCenterActivityTest extends ActivityInstrumentationTestCase2<SynchronizationCenterActivity> { private SynchronizationCenterActivity syncActivity; public SynchronizationCenterActivityTest() { super("edu.cmu.sv.trailscribe", SynchronizationCenterActivity.class); } @Override public void setUp() throws Exception { super.setUp(); syncActivity = getActivity(); } public void testPreconditions() { assertNotNull("Sync activity not found", syncActivity); } } ## Instruction: Add test for map fetching in sync center ## Code After: package edu.cmu.sv.trailscribe.tests; import android.test.ActivityInstrumentationTestCase2; import edu.cmu.sv.trailscribe.view.SynchronizationCenterActivity; import edu.cmu.sv.trailscribe.R; import android.widget.ListView; import java.util.concurrent.TimeUnit; import android.database.DataSetObserver; import java.util.concurrent.CountDownLatch; import android.widget.ArrayAdapter; import edu.cmu.sv.trailscribe.model.Map; import android.util.Log; public class SynchronizationCenterActivityTest extends ActivityInstrumentationTestCase2<SynchronizationCenterActivity> { private static final String LOG_TAG = "SynchronizationCenterActivityTest"; private static final long MAP_LIST_FETCH_TIMEOUT = 50L; private SynchronizationCenterActivity syncActivity; public SynchronizationCenterActivityTest() { super("edu.cmu.sv.trailscribe", SynchronizationCenterActivity.class); } @Override public void setUp() throws Exception { super.setUp(); syncActivity = getActivity(); } public void testPreconditions() { assertNotNull("Sync activity not found", syncActivity); } public void testMapList_fetchMaps() { if (syncActivity.areMapsFetched()) { Log.d(LOG_TAG, "Map data has already been fetched"); return; } final CountDownLatch done = new CountDownLatch(1); syncActivity.setMapsFetchedCallback(new Runnable() { @Override public void run() { done.countDown(); } }); try { final boolean result = done.await(MAP_LIST_FETCH_TIMEOUT, TimeUnit.SECONDS); assertTrue("Fetching map list took loo long", result); } catch (InterruptedException e) { fail("Map fetching interrupted"); } } }
package edu.cmu.sv.trailscribe.tests; import android.test.ActivityInstrumentationTestCase2; import edu.cmu.sv.trailscribe.view.SynchronizationCenterActivity; import edu.cmu.sv.trailscribe.R; import android.widget.ListView; + import java.util.concurrent.TimeUnit; + import android.database.DataSetObserver; + import java.util.concurrent.CountDownLatch; + import android.widget.ArrayAdapter; + import edu.cmu.sv.trailscribe.model.Map; + import android.util.Log; public class SynchronizationCenterActivityTest extends ActivityInstrumentationTestCase2<SynchronizationCenterActivity> { + private static final String LOG_TAG = "SynchronizationCenterActivityTest"; + private static final long MAP_LIST_FETCH_TIMEOUT = 50L; private SynchronizationCenterActivity syncActivity; public SynchronizationCenterActivityTest() { super("edu.cmu.sv.trailscribe", SynchronizationCenterActivity.class); } @Override public void setUp() throws Exception { super.setUp(); syncActivity = getActivity(); } public void testPreconditions() { assertNotNull("Sync activity not found", syncActivity); } + public void testMapList_fetchMaps() { + if (syncActivity.areMapsFetched()) { + Log.d(LOG_TAG, "Map data has already been fetched"); + return; + } + final CountDownLatch done = new CountDownLatch(1); + syncActivity.setMapsFetchedCallback(new Runnable() { + @Override + public void run() { + done.countDown(); + } + }); + try { + final boolean result = done.await(MAP_LIST_FETCH_TIMEOUT, TimeUnit.SECONDS); + assertTrue("Fetching map list took loo long", result); + } catch (InterruptedException e) { + fail("Map fetching interrupted"); + } + } }
27
1.038462
27
0
b4e3e94e3d33138b7a32cf9d3e4f88e0c3ef8694
app/templates/styles/_theme.sass
app/templates/styles/_theme.sass
/** * THEME * * For basic sites this should simply contain colour variables. If a proper theme is to be applied this file should simply import the theme file for each component which should be contained within a theme folder e.g. * * @import theme/component * @import theme/component-two */ /* BRAND COLORS */ /* SEMANTIC COLORS */
/** * THEME * * For basic sites this should simply contain colour variables. If a proper theme is to be applied this file should simply import the theme file for each component which should be contained within a theme folder. */ /* BRAND COLORS */ /* SEMANTIC COLORS */
Remove import comments as they break builds on the server
Remove import comments as they break builds on the server
Sass
mit
kaldor/generator-pugpig,kaldor/generator-pugpig
sass
## Code Before: /** * THEME * * For basic sites this should simply contain colour variables. If a proper theme is to be applied this file should simply import the theme file for each component which should be contained within a theme folder e.g. * * @import theme/component * @import theme/component-two */ /* BRAND COLORS */ /* SEMANTIC COLORS */ ## Instruction: Remove import comments as they break builds on the server ## Code After: /** * THEME * * For basic sites this should simply contain colour variables. If a proper theme is to be applied this file should simply import the theme file for each component which should be contained within a theme folder. */ /* BRAND COLORS */ /* SEMANTIC COLORS */
/** * THEME * - * For basic sites this should simply contain colour variables. If a proper theme is to be applied this file should simply import the theme file for each component which should be contained within a theme folder e.g. ? -- -- + * For basic sites this should simply contain colour variables. If a proper theme is to be applied this file should simply import the theme file for each component which should be contained within a theme folder. - * - * @import theme/component - * @import theme/component-two */ /* BRAND COLORS */ /* SEMANTIC COLORS */
5
0.357143
1
4
2250180ea7cc0eb91c8b1cdc7d565397326f480b
UM/Scene/SceneNodeDecorator.py
UM/Scene/SceneNodeDecorator.py
class SceneNodeDecorator(): def __init__(self): super().__init__() self._node = None def setNode(self, node): self._node = node
class SceneNodeDecorator(): def __init__(self): super().__init__() self._node = None def setNode(self, node): self._node = node def getNode(self): return self._node
Add a getter for a Decorator's Scene Node
Add a getter for a Decorator's Scene Node
Python
agpl-3.0
onitake/Uranium,onitake/Uranium
python
## Code Before: class SceneNodeDecorator(): def __init__(self): super().__init__() self._node = None def setNode(self, node): self._node = node ## Instruction: Add a getter for a Decorator's Scene Node ## Code After: class SceneNodeDecorator(): def __init__(self): super().__init__() self._node = None def setNode(self, node): self._node = node def getNode(self): return self._node
class SceneNodeDecorator(): def __init__(self): super().__init__() self._node = None def setNode(self, node): self._node = node + + def getNode(self): + return self._node
3
0.375
3
0
b7cd3e9d603a6fffa79becf6e1ca72da61fbb5f2
lib/electric_slide.rb
lib/electric_slide.rb
require 'singleton' require 'active_support/dependencies/autoload' require 'adhearsion/foundation/thread_safety' class ElectricSlide < Adhearsion::Plugin extend ActiveSupport::Autoload autoload :QueueStrategy autoload :RoundRobin autoload :RoundRobinMeetme include Singleton def initialize @queues = {} end def create(name, queue_type, agent_type = Agent) synchronize do @queues[name] = const_get(queue_type).new unless @queues.has_key?(name) @queues[name].extend agent_type end end def get_queue(name) synchronize do @queues[name] end end def self.method_missing(method, *args, &block) instance.send method, *args, &block end module Agent def work(agent_call) loop do agent_call.execute 'Bridge', @queue.next_call end end end class CalloutAgent def work(agent_channel) @queue.next_call.each do |next_call| next_call.dial agent_channel end end end class MeetMeAgent include Agent def work(agent_call) loop do agent_call.join agent_conf, @queue.next_call end end end class BridgeAgent include Agent end end
require 'singleton' require 'active_support/dependencies/autoload' require 'adhearsion/foundation/thread_safety' class ElectricSlide < Adhearsion::Plugin extend ActiveSupport::Autoload autoload :QueueStrategy autoload :RoundRobin autoload :RoundRobinMeetme include Singleton def initialize @queues = {} end def create(name, queue_type, agent_type = Agent) synchronize do @queues[name] = queue_type.new unless @queues.has_key?(name) @queues[name].extend agent_type end end def get_queue(name) synchronize do @queues[name] end end def self.method_missing(method, *args, &block) instance.send method, *args, &block end module Agent def work(agent_call) loop do agent_call.execute 'Bridge', @queue.next_call end end end class CalloutAgent def work(agent_channel) @queue.next_call.each do |next_call| next_call.dial agent_channel end end end class MeetMeAgent include Agent def work(agent_call) loop do agent_call.join agent_conf, @queue.next_call end end end class BridgeAgent include Agent end end
Use the supplied class directly
Use the supplied class directly Instead of looking it up with const_get
Ruby
mit
adhearsion/electric_slide,neildecapia/electric_slide
ruby
## Code Before: require 'singleton' require 'active_support/dependencies/autoload' require 'adhearsion/foundation/thread_safety' class ElectricSlide < Adhearsion::Plugin extend ActiveSupport::Autoload autoload :QueueStrategy autoload :RoundRobin autoload :RoundRobinMeetme include Singleton def initialize @queues = {} end def create(name, queue_type, agent_type = Agent) synchronize do @queues[name] = const_get(queue_type).new unless @queues.has_key?(name) @queues[name].extend agent_type end end def get_queue(name) synchronize do @queues[name] end end def self.method_missing(method, *args, &block) instance.send method, *args, &block end module Agent def work(agent_call) loop do agent_call.execute 'Bridge', @queue.next_call end end end class CalloutAgent def work(agent_channel) @queue.next_call.each do |next_call| next_call.dial agent_channel end end end class MeetMeAgent include Agent def work(agent_call) loop do agent_call.join agent_conf, @queue.next_call end end end class BridgeAgent include Agent end end ## Instruction: Use the supplied class directly Instead of looking it up with const_get ## Code After: require 'singleton' require 'active_support/dependencies/autoload' require 'adhearsion/foundation/thread_safety' class ElectricSlide < Adhearsion::Plugin extend ActiveSupport::Autoload autoload :QueueStrategy autoload :RoundRobin autoload :RoundRobinMeetme include Singleton def initialize @queues = {} end def create(name, queue_type, agent_type = Agent) synchronize do @queues[name] = queue_type.new unless @queues.has_key?(name) @queues[name].extend agent_type end end def get_queue(name) synchronize do @queues[name] end end def self.method_missing(method, *args, &block) instance.send method, *args, &block end module Agent def work(agent_call) loop do agent_call.execute 'Bridge', @queue.next_call end end end class CalloutAgent def work(agent_channel) @queue.next_call.each do |next_call| next_call.dial agent_channel end end end class MeetMeAgent include Agent def work(agent_call) loop do agent_call.join agent_conf, @queue.next_call end end end class BridgeAgent include Agent end end
require 'singleton' require 'active_support/dependencies/autoload' require 'adhearsion/foundation/thread_safety' class ElectricSlide < Adhearsion::Plugin extend ActiveSupport::Autoload autoload :QueueStrategy autoload :RoundRobin autoload :RoundRobinMeetme include Singleton def initialize @queues = {} end def create(name, queue_type, agent_type = Agent) synchronize do - @queues[name] = const_get(queue_type).new unless @queues.has_key?(name) ? ---------- - + @queues[name] = queue_type.new unless @queues.has_key?(name) @queues[name].extend agent_type end end def get_queue(name) synchronize do @queues[name] end end def self.method_missing(method, *args, &block) instance.send method, *args, &block end module Agent def work(agent_call) loop do agent_call.execute 'Bridge', @queue.next_call end end end class CalloutAgent def work(agent_channel) @queue.next_call.each do |next_call| next_call.dial agent_channel end end end class MeetMeAgent include Agent def work(agent_call) loop do agent_call.join agent_conf, @queue.next_call end end end class BridgeAgent include Agent end end
2
0.030769
1
1
b29af96038a5b507279c1cbad1350a5c50694b6a
lib/assets/javascripts/new-dashboard/plugins/backbone/backbone-core-models.js
lib/assets/javascripts/new-dashboard/plugins/backbone/backbone-core-models.js
import Vue from 'vue'; // Backbone Models import ConfigModel from 'dashboard/data/config-model'; import UserModel from 'dashboard/data/user-model'; import BackgroundPollingModel from 'dashboard/data/background-polling/dashboard-background-polling-model'; const BackboneCoreModels = {}; BackboneCoreModels.install = function (Vue, options) { Vue.mixin({ beforeCreate () { this.$cartoModels = options; } }); }; const configModel = new ConfigModel({ ...window.CartoConfig.data.config, base_url: window.CartoConfig.data.user_data.base_url }); const userModel = new UserModel(window.CartoConfig.data.user_data); const backgroundPollingModel = new BackgroundPollingModel({ showGeocodingDatasetURLButton: true, geocodingsPolling: true, importsPolling: true }, { configModel, userModel }); Vue.use(BackboneCoreModels, { config: configModel, user: userModel, backgroundPolling: backgroundPollingModel });
import Vue from 'vue'; // Backbone Models import ConfigModel from 'dashboard/data/config-model'; import UserModel from 'dashboard/data/user-model'; import OrganizationModel from 'dashboard/data/organization-model'; import UserGroupsCollection from 'dashboard/data/user-groups-collection'; import BackgroundPollingModel from 'dashboard/data/background-polling/dashboard-background-polling-model'; const BackboneCoreModels = {}; BackboneCoreModels.install = function (Vue, options) { Vue.mixin({ beforeCreate () { this.$cartoModels = options; } }); }; const configModel = new ConfigModel({ ...window.CartoConfig.data.config, base_url: window.CartoConfig.data.user_data.base_url }); const userModel = configureUserModel(window.CartoConfig.data.user_data); const backgroundPollingModel = new BackgroundPollingModel({ showGeocodingDatasetURLButton: true, geocodingsPolling: true, importsPolling: true }, { configModel, userModel }); Vue.use(BackboneCoreModels, { config: configModel, user: userModel, backgroundPolling: backgroundPollingModel }); function configureUserModel (userData) { const userModel = new UserModel(userData); if (userData.organization) { userModel.setOrganization(new OrganizationModel(userData.organization, { configModel })); } if (userData.groups) { userModel.setGroups(new UserGroupsCollection(userData.groups, { configModel })); } return userModel; }
Set organization and user groups to UserModel
Set organization and user groups to UserModel
JavaScript
bsd-3-clause
CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb
javascript
## Code Before: import Vue from 'vue'; // Backbone Models import ConfigModel from 'dashboard/data/config-model'; import UserModel from 'dashboard/data/user-model'; import BackgroundPollingModel from 'dashboard/data/background-polling/dashboard-background-polling-model'; const BackboneCoreModels = {}; BackboneCoreModels.install = function (Vue, options) { Vue.mixin({ beforeCreate () { this.$cartoModels = options; } }); }; const configModel = new ConfigModel({ ...window.CartoConfig.data.config, base_url: window.CartoConfig.data.user_data.base_url }); const userModel = new UserModel(window.CartoConfig.data.user_data); const backgroundPollingModel = new BackgroundPollingModel({ showGeocodingDatasetURLButton: true, geocodingsPolling: true, importsPolling: true }, { configModel, userModel }); Vue.use(BackboneCoreModels, { config: configModel, user: userModel, backgroundPolling: backgroundPollingModel }); ## Instruction: Set organization and user groups to UserModel ## Code After: import Vue from 'vue'; // Backbone Models import ConfigModel from 'dashboard/data/config-model'; import UserModel from 'dashboard/data/user-model'; import OrganizationModel from 'dashboard/data/organization-model'; import UserGroupsCollection from 'dashboard/data/user-groups-collection'; import BackgroundPollingModel from 'dashboard/data/background-polling/dashboard-background-polling-model'; const BackboneCoreModels = {}; BackboneCoreModels.install = function (Vue, options) { Vue.mixin({ beforeCreate () { this.$cartoModels = options; } }); }; const configModel = new ConfigModel({ ...window.CartoConfig.data.config, base_url: window.CartoConfig.data.user_data.base_url }); const userModel = configureUserModel(window.CartoConfig.data.user_data); const backgroundPollingModel = new BackgroundPollingModel({ showGeocodingDatasetURLButton: true, geocodingsPolling: true, importsPolling: true }, { configModel, userModel }); Vue.use(BackboneCoreModels, { config: configModel, user: userModel, backgroundPolling: backgroundPollingModel }); function configureUserModel (userData) { const userModel = new UserModel(userData); if (userData.organization) { userModel.setOrganization(new OrganizationModel(userData.organization, { configModel })); } if (userData.groups) { userModel.setGroups(new UserGroupsCollection(userData.groups, { configModel })); } return userModel; }
import Vue from 'vue'; // Backbone Models import ConfigModel from 'dashboard/data/config-model'; import UserModel from 'dashboard/data/user-model'; + import OrganizationModel from 'dashboard/data/organization-model'; + import UserGroupsCollection from 'dashboard/data/user-groups-collection'; import BackgroundPollingModel from 'dashboard/data/background-polling/dashboard-background-polling-model'; const BackboneCoreModels = {}; BackboneCoreModels.install = function (Vue, options) { Vue.mixin({ beforeCreate () { this.$cartoModels = options; } }); }; const configModel = new ConfigModel({ ...window.CartoConfig.data.config, base_url: window.CartoConfig.data.user_data.base_url }); - const userModel = new UserModel(window.CartoConfig.data.user_data); ? -- + const userModel = configureUserModel(window.CartoConfig.data.user_data); ? ++ +++++ + const backgroundPollingModel = new BackgroundPollingModel({ showGeocodingDatasetURLButton: true, geocodingsPolling: true, importsPolling: true }, { configModel, userModel }); Vue.use(BackboneCoreModels, { config: configModel, user: userModel, backgroundPolling: backgroundPollingModel }); + + function configureUserModel (userData) { + const userModel = new UserModel(userData); + + if (userData.organization) { + userModel.setOrganization(new OrganizationModel(userData.organization, { configModel })); + } + + if (userData.groups) { + userModel.setGroups(new UserGroupsCollection(userData.groups, { configModel })); + } + + return userModel; + }
19
0.575758
18
1
395d8729bc2d768ca8ed214d4a3e04ac2f4473af
Readme.md
Readme.md
<img src="http://d324imu86q1bqn.cloudfront.net/uploads/user/avatar/641/large_Ello.1000x1000.png" width="200px" height="200px" /> # Ello Web Application [![Build Status](https://travis-ci.org/ello/webapp.svg?branch=master)](https://travis-ci.org/ello/webapp) The web app for [ello.co](http://ello.co). ## Code of Conduct Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing [the Ello rules](https://ello.co/wtf/policies/rules/) within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/ello/webapp. ## License Ello Web Application is released under the [MIT License](/LICENSE.txt) :metal::skull::metal: :peace:
<img src="http://d324imu86q1bqn.cloudfront.net/uploads/user/avatar/641/large_Ello.1000x1000.png" width="200px" height="200px" /> # Ello Web Application [![Build Status](https://travis-ci.org/ello/webapp.svg?branch=master)](https://travis-ci.org/ello/webapp) The web app for [ello.co](http://ello.co). ## Code of Conduct Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing [the Ello rules](https://ello.co/wtf/policies/community-guidelines/) within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/ello/webapp. ## License Ello Web Application is released under the [MIT License](/LICENSE.txt) :metal::skull::metal: :peace:
Fix link to rules (now community-guidelines) in README.md
Fix link to rules (now community-guidelines) in README.md
Markdown
mit
ello/webapp,ello/webapp,ello/webapp
markdown
## Code Before: <img src="http://d324imu86q1bqn.cloudfront.net/uploads/user/avatar/641/large_Ello.1000x1000.png" width="200px" height="200px" /> # Ello Web Application [![Build Status](https://travis-ci.org/ello/webapp.svg?branch=master)](https://travis-ci.org/ello/webapp) The web app for [ello.co](http://ello.co). ## Code of Conduct Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing [the Ello rules](https://ello.co/wtf/policies/rules/) within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/ello/webapp. ## License Ello Web Application is released under the [MIT License](/LICENSE.txt) :metal::skull::metal: :peace: ## Instruction: Fix link to rules (now community-guidelines) in README.md ## Code After: <img src="http://d324imu86q1bqn.cloudfront.net/uploads/user/avatar/641/large_Ello.1000x1000.png" width="200px" height="200px" /> # Ello Web Application [![Build Status](https://travis-ci.org/ello/webapp.svg?branch=master)](https://travis-ci.org/ello/webapp) The web app for [ello.co](http://ello.co). ## Code of Conduct Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing [the Ello rules](https://ello.co/wtf/policies/community-guidelines/) within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/ello/webapp. ## License Ello Web Application is released under the [MIT License](/LICENSE.txt) :metal::skull::metal: :peace:
<img src="http://d324imu86q1bqn.cloudfront.net/uploads/user/avatar/641/large_Ello.1000x1000.png" width="200px" height="200px" /> # Ello Web Application [![Build Status](https://travis-ci.org/ello/webapp.svg?branch=master)](https://travis-ci.org/ello/webapp) The web app for [ello.co](http://ello.co). ## Code of Conduct - Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing [the Ello rules](https://ello.co/wtf/policies/rules/) within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse. ? ^^^ + Ello was created by idealists who believe that the essential nature of all human beings is to be kind, considerate, helpful, intelligent, responsible, and respectful of others. To that end, we will be enforcing [the Ello rules](https://ello.co/wtf/policies/community-guidelines/) within all of our open source projects. If you don’t follow the rules, you risk being ignored, banned, or reported for abuse. ? ^^^^^^^^^^^^^^^^^^ ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/ello/webapp. ## License Ello Web Application is released under the [MIT License](/LICENSE.txt) :metal::skull::metal: :peace:
2
0.105263
1
1
13f923d5980c7de294caa15890876aceec4bf0b6
README.md
README.md
[![Build Status][ico-build]][travis] [![Latest Version][ico-package]][package] [![PHP ~5.6][ico-engine]][lang] [![MIT Licensed][ico-license]][license] A PHPUnit test listener for the hamcrest assertion library. ## Installation ```bash ~$ composer require --dev graze/hamcrest-test-listener ``` ## Usage In your **phpunit.xml** file, add the following: ```xml <phpunit> <listeners> <listener class="\Hamcrest\Adapter\PHPUnit\TestListener"></listener> </listeners> </phpunit> ``` <!-- Links --> [travis]: https://travis-ci.org/graze/hamcrest-test-listener [lang]: https://secure.php.net [package]: https://packagist.org/packages/graze/hamcrest-test-listener [license]: https://github.com/graze/hamcrest-test-listener/blob/master/LICENSE <!-- Images --> [ico-license]: https://img.shields.io/packagist/l/graze/formatter.svg [ico-package]: https://img.shields.io/packagist/v/graze/formatter.svg [ico-build]: https://img.shields.io/travis/graze/formatter/master.svg [ico-engine]: https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg
[![Build Status][ico-build]][travis] [![Latest Version][ico-package]][package] [![PHP ~5.6][ico-engine]][lang] [![MIT Licensed][ico-license]][license] A PHPUnit test listener for the hamcrest assertion library. ## Installation ```bash ~$ composer require --dev graze/hamcrest-test-listener ``` ## Usage In your **phpunit.xml** file, add the following: ```xml <phpunit> <listeners> <listener class="\Hamcrest\Adapter\PHPUnit\TestListener"></listener> </listeners> </phpunit> ``` <!-- Links --> [travis]: https://travis-ci.org/graze/hamcrest-test-listener [lang]: https://secure.php.net [package]: https://packagist.org/packages/graze/hamcrest-test-listener [license]: https://github.com/graze/hamcrest-test-listener/blob/master/LICENSE <!-- Images --> [ico-license]: https://img.shields.io/packagist/l/graze/hamcrest-test-listener.svg [ico-package]: https://img.shields.io/packagist/v/graze/hamcrest-test-listener.svg [ico-build]: https://img.shields.io/travis/graze/hamcrest-test-listener/master.svg [ico-engine]: https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg
Use the correct badge image urls.
Use the correct badge image urls.
Markdown
mit
graze/hamcrest-test-listener
markdown
## Code Before: [![Build Status][ico-build]][travis] [![Latest Version][ico-package]][package] [![PHP ~5.6][ico-engine]][lang] [![MIT Licensed][ico-license]][license] A PHPUnit test listener for the hamcrest assertion library. ## Installation ```bash ~$ composer require --dev graze/hamcrest-test-listener ``` ## Usage In your **phpunit.xml** file, add the following: ```xml <phpunit> <listeners> <listener class="\Hamcrest\Adapter\PHPUnit\TestListener"></listener> </listeners> </phpunit> ``` <!-- Links --> [travis]: https://travis-ci.org/graze/hamcrest-test-listener [lang]: https://secure.php.net [package]: https://packagist.org/packages/graze/hamcrest-test-listener [license]: https://github.com/graze/hamcrest-test-listener/blob/master/LICENSE <!-- Images --> [ico-license]: https://img.shields.io/packagist/l/graze/formatter.svg [ico-package]: https://img.shields.io/packagist/v/graze/formatter.svg [ico-build]: https://img.shields.io/travis/graze/formatter/master.svg [ico-engine]: https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg ## Instruction: Use the correct badge image urls. ## Code After: [![Build Status][ico-build]][travis] [![Latest Version][ico-package]][package] [![PHP ~5.6][ico-engine]][lang] [![MIT Licensed][ico-license]][license] A PHPUnit test listener for the hamcrest assertion library. ## Installation ```bash ~$ composer require --dev graze/hamcrest-test-listener ``` ## Usage In your **phpunit.xml** file, add the following: ```xml <phpunit> <listeners> <listener class="\Hamcrest\Adapter\PHPUnit\TestListener"></listener> </listeners> </phpunit> ``` <!-- Links --> [travis]: https://travis-ci.org/graze/hamcrest-test-listener [lang]: https://secure.php.net [package]: https://packagist.org/packages/graze/hamcrest-test-listener [license]: https://github.com/graze/hamcrest-test-listener/blob/master/LICENSE <!-- Images --> [ico-license]: https://img.shields.io/packagist/l/graze/hamcrest-test-listener.svg [ico-package]: https://img.shields.io/packagist/v/graze/hamcrest-test-listener.svg [ico-build]: https://img.shields.io/travis/graze/hamcrest-test-listener/master.svg [ico-engine]: https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg
[![Build Status][ico-build]][travis] [![Latest Version][ico-package]][package] [![PHP ~5.6][ico-engine]][lang] [![MIT Licensed][ico-license]][license] A PHPUnit test listener for the hamcrest assertion library. ## Installation ```bash ~$ composer require --dev graze/hamcrest-test-listener ``` ## Usage In your **phpunit.xml** file, add the following: ```xml <phpunit> <listeners> <listener class="\Hamcrest\Adapter\PHPUnit\TestListener"></listener> </listeners> </phpunit> ``` <!-- Links --> [travis]: https://travis-ci.org/graze/hamcrest-test-listener [lang]: https://secure.php.net [package]: https://packagist.org/packages/graze/hamcrest-test-listener [license]: https://github.com/graze/hamcrest-test-listener/blob/master/LICENSE <!-- Images --> - [ico-license]: https://img.shields.io/packagist/l/graze/formatter.svg ? ^^ ^^ + [ico-license]: https://img.shields.io/packagist/l/graze/hamcrest-test-listener.svg ? ^^^^ ^^ + ++++++++++ - [ico-package]: https://img.shields.io/packagist/v/graze/formatter.svg ? ^^ ^^ + [ico-package]: https://img.shields.io/packagist/v/graze/hamcrest-test-listener.svg ? ^^^^ ^^ + ++++++++++ - [ico-build]: https://img.shields.io/travis/graze/formatter/master.svg ? ^^ ^^ + [ico-build]: https://img.shields.io/travis/graze/hamcrest-test-listener/master.svg ? ^^^^ ^^ + ++++++++++ [ico-engine]: https://img.shields.io/badge/php-%3E%3D5.6-8892BF.svg
6
0.162162
3
3
aacad4d0e7d07d40792cb7dfd3545c1b7ebb6276
dnzo/templates/signup/index.html
dnzo/templates/signup/index.html
{% extends "layouts/base.html" %} {% block page_title %}Sign up for DNZO!{% endblock %} {% block javascripts %} {% javascript_tag signup %} {% endblock %} {% block content %} <h1>Sign up for Dnzo</h1> <form action="/signup/" method="POST"> <div id="signup"> <p> <label for="name"> Choose a <strong>URL</strong> for your account: </label> <span id="url">http://dnzo.appspot.com/</span> <input type="text" name="name" id="name" value="{{ short_name|escape }}"> {% include "signup/availability.html" %} </p> {% include "signup/availability_message.html" %} <p id="buttons"> <a href="/">cancel</a> <input type="submit" value="Sign up"> </p> </div> </form> {% endblock %}
{% load tasks_library %} {% extends "layouts/base.html" %} {% block page_title %}Sign up for DNZO!{% endblock %} {% block javascripts %} {% javascript_tag signup %} {% endblock %} {% block content %} <h1>Sign up for Dnzo</h1> <form action="/signup/" method="POST"> <div id="signup"> <p> <label for="name"> Choose a <strong>URL</strong> for your account: </label> <span id="url">http://dnzo.appspot.com/</span> <input type="text" name="name" id="name" value="{{ short_name|escape }}"> {% include "signup/availability.html" %} </p> {% include "signup/availability_message.html" %} <p id="buttons"> <a href="/">cancel</a> <input type="submit" value="Sign up"> </p> </div> </form> {% endblock %}
Fix minor typo that broke things.
Fix minor typo that broke things. git-svn-id: 062a66634e56759c7c3cc44955c32d2ce0012d25@45 c02d1e6f-6a35-45f2-ab14-3b6f79a691ff
HTML
mit
taylorhughes/done-zo,taylorhughes/done-zo,taylorhughes/done-zo,taylorhughes/done-zo
html
## Code Before: {% extends "layouts/base.html" %} {% block page_title %}Sign up for DNZO!{% endblock %} {% block javascripts %} {% javascript_tag signup %} {% endblock %} {% block content %} <h1>Sign up for Dnzo</h1> <form action="/signup/" method="POST"> <div id="signup"> <p> <label for="name"> Choose a <strong>URL</strong> for your account: </label> <span id="url">http://dnzo.appspot.com/</span> <input type="text" name="name" id="name" value="{{ short_name|escape }}"> {% include "signup/availability.html" %} </p> {% include "signup/availability_message.html" %} <p id="buttons"> <a href="/">cancel</a> <input type="submit" value="Sign up"> </p> </div> </form> {% endblock %} ## Instruction: Fix minor typo that broke things. git-svn-id: 062a66634e56759c7c3cc44955c32d2ce0012d25@45 c02d1e6f-6a35-45f2-ab14-3b6f79a691ff ## Code After: {% load tasks_library %} {% extends "layouts/base.html" %} {% block page_title %}Sign up for DNZO!{% endblock %} {% block javascripts %} {% javascript_tag signup %} {% endblock %} {% block content %} <h1>Sign up for Dnzo</h1> <form action="/signup/" method="POST"> <div id="signup"> <p> <label for="name"> Choose a <strong>URL</strong> for your account: </label> <span id="url">http://dnzo.appspot.com/</span> <input type="text" name="name" id="name" value="{{ short_name|escape }}"> {% include "signup/availability.html" %} </p> {% include "signup/availability_message.html" %} <p id="buttons"> <a href="/">cancel</a> <input type="submit" value="Sign up"> </p> </div> </form> {% endblock %}
+ {% load tasks_library %} + {% extends "layouts/base.html" %} {% block page_title %}Sign up for DNZO!{% endblock %} {% block javascripts %} {% javascript_tag signup %} {% endblock %} {% block content %} <h1>Sign up for Dnzo</h1> <form action="/signup/" method="POST"> <div id="signup"> <p> <label for="name"> Choose a <strong>URL</strong> for your account: </label> <span id="url">http://dnzo.appspot.com/</span> <input type="text" name="name" id="name" value="{{ short_name|escape }}"> {% include "signup/availability.html" %} </p> {% include "signup/availability_message.html" %} <p id="buttons"> <a href="/">cancel</a> <input type="submit" value="Sign up"> </p> </div> </form> {% endblock %}
2
0.0625
2
0
08cb07cbfacdd7935fa1cff680b4ff31aba9f889
types/tslint.json
types/tslint.json
{ "extends": "dtslint/dtslint.json", "rules": { "semicolon": false, "indent": [true, "spaces"], "no-redundant-jsdoc": false, "no-unnecessary-class": false, "no-implicit-dependencies": false } }
{ "extends": "dtslint/dtslint.json", "rules": { "semicolon": false, "indent": [true, "spaces"], "no-redundant-jsdoc": false, "no-unnecessary-class": false, "no-implicit-dependencies": false, "file-name-casing": false } }
Remove file-name-casing rule for tests
Remove file-name-casing rule for tests
JSON
mit
idehub/react-native-google-analytics-bridge,idehub/react-native-google-analytics-bridge,idehub/react-native-google-analytics-bridge,idehub/react-native-google-analytics-bridge
json
## Code Before: { "extends": "dtslint/dtslint.json", "rules": { "semicolon": false, "indent": [true, "spaces"], "no-redundant-jsdoc": false, "no-unnecessary-class": false, "no-implicit-dependencies": false } } ## Instruction: Remove file-name-casing rule for tests ## Code After: { "extends": "dtslint/dtslint.json", "rules": { "semicolon": false, "indent": [true, "spaces"], "no-redundant-jsdoc": false, "no-unnecessary-class": false, "no-implicit-dependencies": false, "file-name-casing": false } }
{ "extends": "dtslint/dtslint.json", "rules": { "semicolon": false, "indent": [true, "spaces"], "no-redundant-jsdoc": false, "no-unnecessary-class": false, - "no-implicit-dependencies": false + "no-implicit-dependencies": false, ? + + "file-name-casing": false } }
3
0.3
2
1
862bf1128178304c50f07838ed18a03bc707da9b
app/views/things/_form.html.haml
app/views/things/_form.html.haml
- thing ||= @thing = form_for thing do |f| = f.text_field :name, placeholder: 'Name' = f.number_field :quantity, placeholder: 'Quantity' = f.submit
- thing ||= @thing = bootstrap_form_for thing do |f| = f.alert_message 'Please fix the issues below.' = f.text_field :name, placeholder: 'Name', required: true = f.number_field :quantity, placeholder: 'Quantity', required: true = f.submit
Switch view to bootstrap form gem
Switch view to bootstrap form gem
Haml
mit
codeintheschools/check_me_out,codeintheschools/check_me_out,codeintheschools/check_me_out
haml
## Code Before: - thing ||= @thing = form_for thing do |f| = f.text_field :name, placeholder: 'Name' = f.number_field :quantity, placeholder: 'Quantity' = f.submit ## Instruction: Switch view to bootstrap form gem ## Code After: - thing ||= @thing = bootstrap_form_for thing do |f| = f.alert_message 'Please fix the issues below.' = f.text_field :name, placeholder: 'Name', required: true = f.number_field :quantity, placeholder: 'Quantity', required: true = f.submit
- thing ||= @thing - = form_for thing do |f| + = bootstrap_form_for thing do |f| ? ++++++++++ + = f.alert_message 'Please fix the issues below.' - = f.text_field :name, placeholder: 'Name' + = f.text_field :name, placeholder: 'Name', required: true ? ++++++++++++++++ - = f.number_field :quantity, placeholder: 'Quantity' + = f.number_field :quantity, placeholder: 'Quantity', required: true ? ++++++++++++++++ = f.submit
7
1.166667
4
3
024e2fe493d181b6378c5ffa74be34032acda7d7
api/posts.json
api/posts.json
--- --- [ {% for post in site.posts %} {% unless post.draft %} { "title": "{{ post.title }}", "category": "{{ post.category }}", "url": "{{ post.url | absolute_url }}", "tags": {{ post.tags | jsonify }}, "date": "{{ post.date }}", "language": "{% if post.language %}{{ post.language | downcase }}{% else %}{{ site.language | downcase }}{% endif %}" }{% unless forloop.last %},{% endunless %} {% endunless %} {% endfor %} ]
--- --- [ {% for post in site.posts %} {% unless post.draft %} { "title": "{{ post.title }}", "category": "{{ post.category }}", "url": "{{ post.url | absolute_url }}", "tags": {{ post.tags | jsonify }}, "date": "{{ post.date | date_to_rfc822 }}", "language": "{% if post.language %}{{ post.language | downcase }}{% else %}{{ site.language | downcase }}{% endif %}" }{% unless forloop.last %},{% endunless %} {% endunless %} {% endfor %} ]
Fix date format for API and 404 page
Fix date format for API and 404 page
JSON
mit
jwillmer/jekyllDecent,jwillmer/jekyllDecent,jwillmer/jekyllDecent
json
## Code Before: --- --- [ {% for post in site.posts %} {% unless post.draft %} { "title": "{{ post.title }}", "category": "{{ post.category }}", "url": "{{ post.url | absolute_url }}", "tags": {{ post.tags | jsonify }}, "date": "{{ post.date }}", "language": "{% if post.language %}{{ post.language | downcase }}{% else %}{{ site.language | downcase }}{% endif %}" }{% unless forloop.last %},{% endunless %} {% endunless %} {% endfor %} ] ## Instruction: Fix date format for API and 404 page ## Code After: --- --- [ {% for post in site.posts %} {% unless post.draft %} { "title": "{{ post.title }}", "category": "{{ post.category }}", "url": "{{ post.url | absolute_url }}", "tags": {{ post.tags | jsonify }}, "date": "{{ post.date | date_to_rfc822 }}", "language": "{% if post.language %}{{ post.language | downcase }}{% else %}{{ site.language | downcase }}{% endif %}" }{% unless forloop.last %},{% endunless %} {% endunless %} {% endfor %} ]
--- --- [ {% for post in site.posts %} {% unless post.draft %} { "title": "{{ post.title }}", "category": "{{ post.category }}", "url": "{{ post.url | absolute_url }}", "tags": {{ post.tags | jsonify }}, - "date": "{{ post.date }}", + "date": "{{ post.date | date_to_rfc822 }}", ? +++++++++++++++++ "language": "{% if post.language %}{{ post.language | downcase }}{% else %}{{ site.language | downcase }}{% endif %}" }{% unless forloop.last %},{% endunless %} {% endunless %} {% endfor %} ]
2
0.125
1
1
719079e29268b15dc2db422a02d0eb270cef5ca6
.travis.yml
.travis.yml
dist: trusty language: java jdk: - openjdk8 - oraclejdk8 script: ./gradlew build notifications: email: false
dist: trusty language: java jdk: - openjdk8 - oraclejdk8 script: ./gradlew build notifications: email: false # Exclude master because it is built on Jenkins branches: except: - master
Exclude master branch from Travis config, will build that on Jenkins
Exclude master branch from Travis config, will build that on Jenkins
YAML
mit
SpongePowered/Mixin
yaml
## Code Before: dist: trusty language: java jdk: - openjdk8 - oraclejdk8 script: ./gradlew build notifications: email: false ## Instruction: Exclude master branch from Travis config, will build that on Jenkins ## Code After: dist: trusty language: java jdk: - openjdk8 - oraclejdk8 script: ./gradlew build notifications: email: false # Exclude master because it is built on Jenkins branches: except: - master
dist: trusty language: java jdk: - openjdk8 - oraclejdk8 script: ./gradlew build notifications: email: false + + # Exclude master because it is built on Jenkins + branches: + except: + - master
5
0.454545
5
0
10a922d7ea42ca236fc077dcb185a1823a762325
README.md
README.md
[![Build Status](https://travis-ci.org/trellis-ldp/trellis-rosid.png?branch=master)](https://travis-ci.org/trellis-ldp/trellis-rosid) [![Build status](https://ci.appveyor.com/api/projects/status/i1geqkvi48w5y9om?svg=true)](https://ci.appveyor.com/project/acoburn/trellis-rosid) [![Coverage Status](https://coveralls.io/repos/github/trellis-ldp/trellis-rosid/badge.svg?branch=master)](https://coveralls.io/github/trellis-ldp/trellis-rosid?branch=master) ## Building Trellis 1. Run `./gradlew clean install` to build the application or download one of the releases.
[![Build Status](https://travis-ci.org/trellis-ldp/trellis-rosid.png?branch=master)](https://travis-ci.org/trellis-ldp/trellis-rosid) [![Build status](https://ci.appveyor.com/api/projects/status/i1geqkvi48w5y9om?svg=true)](https://ci.appveyor.com/project/acoburn/trellis-rosid) [![Coverage Status](https://coveralls.io/repos/github/trellis-ldp/trellis-rosid/badge.svg?branch=master)](https://coveralls.io/github/trellis-ldp/trellis-rosid?branch=master) This is an implementation of the Trellis Linked Data API, using a file-based persistence and internal Kafka event bus. There are two parts to this code: an [HTTP layer](trellis-rosid-app) and an [asynchronous processor](trellis-rosid-file-streaming). Installation and configuration information is available on each subproject README page. ## Building Trellis/Rosid 1. Run `./gradlew clean install` to build the application or download one of the releases.
Update readme with links to subprojects
Update readme with links to subprojects
Markdown
apache-2.0
trellis-ldp/trellis-rosid,trellis-ldp/trellis-rosid,trellis-ldp/trellis-rosid
markdown
## Code Before: [![Build Status](https://travis-ci.org/trellis-ldp/trellis-rosid.png?branch=master)](https://travis-ci.org/trellis-ldp/trellis-rosid) [![Build status](https://ci.appveyor.com/api/projects/status/i1geqkvi48w5y9om?svg=true)](https://ci.appveyor.com/project/acoburn/trellis-rosid) [![Coverage Status](https://coveralls.io/repos/github/trellis-ldp/trellis-rosid/badge.svg?branch=master)](https://coveralls.io/github/trellis-ldp/trellis-rosid?branch=master) ## Building Trellis 1. Run `./gradlew clean install` to build the application or download one of the releases. ## Instruction: Update readme with links to subprojects ## Code After: [![Build Status](https://travis-ci.org/trellis-ldp/trellis-rosid.png?branch=master)](https://travis-ci.org/trellis-ldp/trellis-rosid) [![Build status](https://ci.appveyor.com/api/projects/status/i1geqkvi48w5y9om?svg=true)](https://ci.appveyor.com/project/acoburn/trellis-rosid) [![Coverage Status](https://coveralls.io/repos/github/trellis-ldp/trellis-rosid/badge.svg?branch=master)](https://coveralls.io/github/trellis-ldp/trellis-rosid?branch=master) This is an implementation of the Trellis Linked Data API, using a file-based persistence and internal Kafka event bus. There are two parts to this code: an [HTTP layer](trellis-rosid-app) and an [asynchronous processor](trellis-rosid-file-streaming). Installation and configuration information is available on each subproject README page. ## Building Trellis/Rosid 1. Run `./gradlew clean install` to build the application or download one of the releases.
[![Build Status](https://travis-ci.org/trellis-ldp/trellis-rosid.png?branch=master)](https://travis-ci.org/trellis-ldp/trellis-rosid) [![Build status](https://ci.appveyor.com/api/projects/status/i1geqkvi48w5y9om?svg=true)](https://ci.appveyor.com/project/acoburn/trellis-rosid) [![Coverage Status](https://coveralls.io/repos/github/trellis-ldp/trellis-rosid/badge.svg?branch=master)](https://coveralls.io/github/trellis-ldp/trellis-rosid?branch=master) + This is an implementation of the Trellis Linked Data API, using a file-based persistence and internal Kafka event bus. + + There are two parts to this code: an [HTTP layer](trellis-rosid-app) and an + [asynchronous processor](trellis-rosid-file-streaming). Installation and configuration information is available + on each subproject README page. + - ## Building Trellis + ## Building Trellis/Rosid ? ++++++ 1. Run `./gradlew clean install` to build the application or download one of the releases.
8
0.888889
7
1
0540fb24c63aa3b1fa56601c707e8f947160e5fc
lib/sonia/widgets/tfl.rb
lib/sonia/widgets/tfl.rb
require 'yajl' require 'httparty' module Sonia module Widgets class Tfl < Sonia::Widget def initial_push fetch_data EventMachine::add_periodic_timer(150) { fetch_data } end def format_lines(line) { :status_requested => line["status_requested"], :id => line["id"], :name => line["name"], :status => line["status"], :messages => line["messages"].join("\n") } end private def fetch_data lines = Yajl::Parser.parse(HTTParty.get(config[:url]).to_s)["response"]["lines"].map do |line| format_lines(line) end push lines end end end end
require 'yajl' require 'em-http' module Sonia module Widgets class Tfl < Sonia::Widget def initial_push fetch_data EventMachine::add_periodic_timer(150) { fetch_data } end def format_lines(line) { :status_requested => line["status_requested"], :id => line["id"], :name => line["name"], :status => line["status"], :messages => line["messages"].join("\n") } end private def fetch_data http = EventMachine::HttpRequest.new(config[:url]).get http.callback { lines = Yajl::Parser.parse(http.response)["response"]["lines"].map do |line| format_lines(line) end push lines } end end end end
Make Tfl widget use async HTTP
Make Tfl widget use async HTTP
Ruby
mit
tachikomapocket/pusewicz-_-sonia,pusewicz/sonia,pusewicz/sonia,pusewicz/sonia,tachikomapocket/pusewicz-_-sonia,tachikomapocket/pusewicz-_-sonia
ruby
## Code Before: require 'yajl' require 'httparty' module Sonia module Widgets class Tfl < Sonia::Widget def initial_push fetch_data EventMachine::add_periodic_timer(150) { fetch_data } end def format_lines(line) { :status_requested => line["status_requested"], :id => line["id"], :name => line["name"], :status => line["status"], :messages => line["messages"].join("\n") } end private def fetch_data lines = Yajl::Parser.parse(HTTParty.get(config[:url]).to_s)["response"]["lines"].map do |line| format_lines(line) end push lines end end end end ## Instruction: Make Tfl widget use async HTTP ## Code After: require 'yajl' require 'em-http' module Sonia module Widgets class Tfl < Sonia::Widget def initial_push fetch_data EventMachine::add_periodic_timer(150) { fetch_data } end def format_lines(line) { :status_requested => line["status_requested"], :id => line["id"], :name => line["name"], :status => line["status"], :messages => line["messages"].join("\n") } end private def fetch_data http = EventMachine::HttpRequest.new(config[:url]).get http.callback { lines = Yajl::Parser.parse(http.response)["response"]["lines"].map do |line| format_lines(line) end push lines } end end end end
require 'yajl' - require 'httparty' ? ---- + require 'em-http' ? +++ module Sonia module Widgets class Tfl < Sonia::Widget - def initial_push fetch_data EventMachine::add_periodic_timer(150) { fetch_data } end def format_lines(line) { :status_requested => line["status_requested"], :id => line["id"], :name => line["name"], :status => line["status"], :messages => line["messages"].join("\n") } end private def fetch_data + http = EventMachine::HttpRequest.new(config[:url]).get + http.callback { - lines = Yajl::Parser.parse(HTTParty.get(config[:url]).to_s)["response"]["lines"].map do |line| ? ^^^^^ ---- ^^^ -------------- + lines = Yajl::Parser.parse(http.response)["response"]["lines"].map do |line| ? ++ ^^^^^ ^^ + - format_lines(line) + format_lines(line) ? ++ - end + end ? ++ - push lines + push lines ? ++ + } end end end end
14
0.424242
8
6
edf3e9f6fc87589912436c164483ab5d7436681c
routes/landingPage.js
routes/landingPage.js
const router = require('express').Router(); const data = require("../data"); const forumsData = data.forums; router.get('/', (req, res) => { let userInfo = req.locals || {}; let userId = null; if (req.user) { userId = req.user._id; } forumsData.getForumByUser(userId) .then((forum) => { userInfo.forum = forum; return forumsData.getAllForums(); }) .then((communityForum) => { userInfo.communityForum = communityForum return res.render('landingPage', userInfo); }); }); module.exports = exports = router;
const router = require('express').Router(); const data = require("../data"); const forumsData = data.forums; router.get('/', (req, res) => { let userInfo = req.locals || {}; let userId = null; if (req.user) { userId = req.user._id; } forumsData.getForumByUser(userId) .then((forum) => { userInfo.forum = forum; return forumsData.getAllForums(); }) .then((communityForum) => { userInfo.communityForum = communityForum.sort((f1, f2) => { return (f1.createdOn < f2.createdOn) ? 1 : -1 }); return res.render('landingPage', userInfo); }); }); router.put('/', (req, res) => { let info = req.locals || {}; // Can view forums without being authenticated const sort_by = req.query.sort_by || 'recent'; console.log(sort_by); forumsData.getAllForums().then((forumList) => { info.forums = (forumList && (Array.isArray(forumList))) ? forumList : []; switch (sort_by) { case ('popular'): forumList.sort((f1, f2) => { return (f1.likes.length < f2.likes.length) ? 1 : -1 }); break; case ('recent'): default: forumList.sort((f1, f2) => { return (f1.createdOn < f2.createdOn) ? 1 : -1 }); break; } console.log(forumList) return res.json({forums: forumList}); }).catch((err) => { return res.status(500).json({error: err}); }); }); module.exports = exports = router;
Add route to sort landing page forums by popular or recent
Add route to sort landing page forums by popular or recent
JavaScript
mit
tsangjustin/CS546-Product_Forum,tsangjustin/CS546-Product_Forum
javascript
## Code Before: const router = require('express').Router(); const data = require("../data"); const forumsData = data.forums; router.get('/', (req, res) => { let userInfo = req.locals || {}; let userId = null; if (req.user) { userId = req.user._id; } forumsData.getForumByUser(userId) .then((forum) => { userInfo.forum = forum; return forumsData.getAllForums(); }) .then((communityForum) => { userInfo.communityForum = communityForum return res.render('landingPage', userInfo); }); }); module.exports = exports = router; ## Instruction: Add route to sort landing page forums by popular or recent ## Code After: const router = require('express').Router(); const data = require("../data"); const forumsData = data.forums; router.get('/', (req, res) => { let userInfo = req.locals || {}; let userId = null; if (req.user) { userId = req.user._id; } forumsData.getForumByUser(userId) .then((forum) => { userInfo.forum = forum; return forumsData.getAllForums(); }) .then((communityForum) => { userInfo.communityForum = communityForum.sort((f1, f2) => { return (f1.createdOn < f2.createdOn) ? 1 : -1 }); return res.render('landingPage', userInfo); }); }); router.put('/', (req, res) => { let info = req.locals || {}; // Can view forums without being authenticated const sort_by = req.query.sort_by || 'recent'; console.log(sort_by); forumsData.getAllForums().then((forumList) => { info.forums = (forumList && (Array.isArray(forumList))) ? forumList : []; switch (sort_by) { case ('popular'): forumList.sort((f1, f2) => { return (f1.likes.length < f2.likes.length) ? 1 : -1 }); break; case ('recent'): default: forumList.sort((f1, f2) => { return (f1.createdOn < f2.createdOn) ? 1 : -1 }); break; } console.log(forumList) return res.json({forums: forumList}); }).catch((err) => { return res.status(500).json({error: err}); }); }); module.exports = exports = router;
const router = require('express').Router(); const data = require("../data"); const forumsData = data.forums; router.get('/', (req, res) => { let userInfo = req.locals || {}; let userId = null; if (req.user) { userId = req.user._id; } forumsData.getForumByUser(userId) .then((forum) => { userInfo.forum = forum; return forumsData.getAllForums(); }) .then((communityForum) => { - userInfo.communityForum = communityForum ? - + userInfo.communityForum = communityForum.sort((f1, f2) => { ? +++++++++++++++++++ + return (f1.createdOn < f2.createdOn) ? 1 : -1 + }); return res.render('landingPage', userInfo); }); }); + + router.put('/', (req, res) => { + let info = req.locals || {}; + // Can view forums without being authenticated + const sort_by = req.query.sort_by || 'recent'; + console.log(sort_by); + + forumsData.getAllForums().then((forumList) => { + info.forums = (forumList && (Array.isArray(forumList))) ? forumList : []; + switch (sort_by) { + case ('popular'): + forumList.sort((f1, f2) => { + return (f1.likes.length < f2.likes.length) ? 1 : -1 + }); + break; + case ('recent'): + default: + forumList.sort((f1, f2) => { + return (f1.createdOn < f2.createdOn) ? 1 : -1 + }); + break; + } + console.log(forumList) + return res.json({forums: forumList}); + }).catch((err) => { + return res.status(500).json({error: err}); + }); + }); + + module.exports = exports = router;
34
1.545455
33
1
5d208b6efc552830ce1128ffa89693d567cb5043
.travis.yml
.travis.yml
language: clojure dist: xenial sudo: true branches: only: - master before_install: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157 - sudo apt-get update - bash etc/ci-setup.sh install: true script: eval "$TEST_CMD" after_script: heroku keys:remove $USER@`hostname` env: global: - IS_RUNNING_ON_TRAVIS=true - HATCHET_RETRIES=3 - HATCHET_DEPLOY_STRATEGY=git - HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git" - SHUNIT_HOME="/tmp/shunit2-2.1.6" matrix: - TEST_CMD="/tmp/testrunner/bin/run ." - TEST_CMD="bash etc/hatchet-test.sh"
language: clojure dist: xenial sudo: true branches: only: - master before_install: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157 - sudo apt-get update - bash etc/ci-setup.sh - gem update --system install: true script: eval "$TEST_CMD" after_script: heroku keys:remove $USER@`hostname` env: global: - IS_RUNNING_ON_TRAVIS=true - HATCHET_RETRIES=3 - HATCHET_DEPLOY_STRATEGY=git - HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git" - SHUNIT_HOME="/tmp/shunit2-2.1.6" matrix: - TEST_CMD="/tmp/testrunner/bin/run ." - TEST_CMD="bash etc/hatchet-test.sh"
Add workaround for bundler bug
Add workaround for bundler bug
YAML
mit
heroku/heroku-buildpack-clojure,heroku/heroku-buildpack-clojure
yaml
## Code Before: language: clojure dist: xenial sudo: true branches: only: - master before_install: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157 - sudo apt-get update - bash etc/ci-setup.sh install: true script: eval "$TEST_CMD" after_script: heroku keys:remove $USER@`hostname` env: global: - IS_RUNNING_ON_TRAVIS=true - HATCHET_RETRIES=3 - HATCHET_DEPLOY_STRATEGY=git - HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git" - SHUNIT_HOME="/tmp/shunit2-2.1.6" matrix: - TEST_CMD="/tmp/testrunner/bin/run ." - TEST_CMD="bash etc/hatchet-test.sh" ## Instruction: Add workaround for bundler bug ## Code After: language: clojure dist: xenial sudo: true branches: only: - master before_install: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157 - sudo apt-get update - bash etc/ci-setup.sh - gem update --system install: true script: eval "$TEST_CMD" after_script: heroku keys:remove $USER@`hostname` env: global: - IS_RUNNING_ON_TRAVIS=true - HATCHET_RETRIES=3 - HATCHET_DEPLOY_STRATEGY=git - HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git" - SHUNIT_HOME="/tmp/shunit2-2.1.6" matrix: - TEST_CMD="/tmp/testrunner/bin/run ." - TEST_CMD="bash etc/hatchet-test.sh"
language: clojure dist: xenial sudo: true branches: only: - master before_install: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157 - sudo apt-get update - bash etc/ci-setup.sh + - gem update --system install: true script: eval "$TEST_CMD" after_script: heroku keys:remove $USER@`hostname` env: global: - IS_RUNNING_ON_TRAVIS=true - HATCHET_RETRIES=3 - HATCHET_DEPLOY_STRATEGY=git - HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git" - SHUNIT_HOME="/tmp/shunit2-2.1.6" matrix: - TEST_CMD="/tmp/testrunner/bin/run ." - TEST_CMD="bash etc/hatchet-test.sh"
1
0.043478
1
0
6757d9086ba4165f9422215a091d28ecbad7641b
main.rs
main.rs
enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Pink = 5, Brown = 6, LightGray = 7, DarkGray = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, LightPink = 13, Yellow = 14, White = 15, } enum Option<T> { None, Some(T) } struct IntRange { cur: int, max: int } impl IntRange { fn next(&mut self) -> Option<int> { if self.cur < self.max { self.cur += 1; Some(self.cur - 1) } else { None } } } fn range(lo: int, hi: int) -> IntRange { IntRange { cur: lo, max: hi } } fn clear_screen(background: Color) { for i in range(0, 80 * 25) { unsafe { *((0xb8000 + i * 2) as *mut u16) = (background as u16) << 12; } } } #[no_mangle] #[no_split_stack] pub fn main() { clear_screen(LightRed); }
enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Pink = 5, Brown = 6, LightGray = 7, DarkGray = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, LightPink = 13, Yellow = 14, White = 15, } fn clear_screen(background: Color) { let mut i = 0u16; let max = 80 * 25; while i < max { unsafe { *((0xb8000 + i * 2) as *mut u16) = (background as u16) << 12; } i = i + 1; } } #[no_mangle] #[no_split_stack] pub fn main() { clear_screen(LightRed); }
Remove range since 0.11 doesn't like it.
Remove range since 0.11 doesn't like it.
Rust
mit
smkell/rustboot,smkell/rustboot
rust
## Code Before: enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Pink = 5, Brown = 6, LightGray = 7, DarkGray = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, LightPink = 13, Yellow = 14, White = 15, } enum Option<T> { None, Some(T) } struct IntRange { cur: int, max: int } impl IntRange { fn next(&mut self) -> Option<int> { if self.cur < self.max { self.cur += 1; Some(self.cur - 1) } else { None } } } fn range(lo: int, hi: int) -> IntRange { IntRange { cur: lo, max: hi } } fn clear_screen(background: Color) { for i in range(0, 80 * 25) { unsafe { *((0xb8000 + i * 2) as *mut u16) = (background as u16) << 12; } } } #[no_mangle] #[no_split_stack] pub fn main() { clear_screen(LightRed); } ## Instruction: Remove range since 0.11 doesn't like it. ## Code After: enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Pink = 5, Brown = 6, LightGray = 7, DarkGray = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, LightPink = 13, Yellow = 14, White = 15, } fn clear_screen(background: Color) { let mut i = 0u16; let max = 80 * 25; while i < max { unsafe { *((0xb8000 + i * 2) as *mut u16) = (background as u16) << 12; } i = i + 1; } } #[no_mangle] #[no_split_stack] pub fn main() { clear_screen(LightRed); }
enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Pink = 5, Brown = 6, LightGray = 7, DarkGray = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, LightPink = 13, Yellow = 14, White = 15, } + fn clear_screen(background: Color) { + let mut i = 0u16; + let max = 80 * 25; - enum Option<T> { - None, - Some(T) - } + while i < max { - struct IntRange { - cur: int, - max: int - } - - impl IntRange { - fn next(&mut self) -> Option<int> { - if self.cur < self.max { - self.cur += 1; - Some(self.cur - 1) - } else { - None - } - } - } - - fn range(lo: int, hi: int) -> IntRange { - IntRange { cur: lo, max: hi } - } - - fn clear_screen(background: Color) { - for i in range(0, 80 * 25) { unsafe { *((0xb8000 + i * 2) as *mut u16) = (background as u16) << 12; } + i = i + 1; } } #[no_mangle] #[no_split_stack] pub fn main() { clear_screen(LightRed); }
31
0.534483
5
26
a7c5c9d27d29e14ebb2d314890b40eab318501ac
dialogos/admin.py
dialogos/admin.py
from django.contrib import admin from dialogos.models import Comment class CommentAdmin(admin.ModelAdmin): list_display = ['author', 'content_type', 'public'] list_filter = ['public', 'content_type'] admin.site.register(Comment, CommentAdmin)
from django.contrib import admin from dialogos.models import Comment class CommentAdmin(admin.ModelAdmin): list_display = ["author", "content_type", "public"] list_filter = ["public", "content_type"] admin.site.register(Comment, CommentAdmin)
Update style to match Pinax conventions
Update style to match Pinax conventions
Python
mit
pinax/pinax-comments,rizumu/dialogos,GeoNode/geonode-dialogos,eldarion/dialogos,georgedorn/dialogos,pinax/pinax-comments
python
## Code Before: from django.contrib import admin from dialogos.models import Comment class CommentAdmin(admin.ModelAdmin): list_display = ['author', 'content_type', 'public'] list_filter = ['public', 'content_type'] admin.site.register(Comment, CommentAdmin) ## Instruction: Update style to match Pinax conventions ## Code After: from django.contrib import admin from dialogos.models import Comment class CommentAdmin(admin.ModelAdmin): list_display = ["author", "content_type", "public"] list_filter = ["public", "content_type"] admin.site.register(Comment, CommentAdmin)
from django.contrib import admin + from dialogos.models import Comment + class CommentAdmin(admin.ModelAdmin): - list_display = ['author', 'content_type', 'public'] ? ^ ^ ^ ^ ^ ^ + list_display = ["author", "content_type", "public"] ? ^ ^ ^ ^ ^ ^ - list_filter = ['public', 'content_type'] ? ^ ^ ^ ^ + list_filter = ["public", "content_type"] ? ^ ^ ^ ^ + admin.site.register(Comment, CommentAdmin)
7
0.875
5
2
c803eabf3d0bf1511a85f96b0a91d8238f01001d
examples/snapshots/snapshot14/README.md
examples/snapshots/snapshot14/README.md
Getting started with routing using react-router Key points: - react-router (v0.13.3) - Route - HashLocation - DefaultRoute - Link
Getting started with routing using react-router Key points: - react-router (v0.13.3) - Route - RouteHandler - DefaultRoute - Link
Update description of example 14
Update description of example 14
Markdown
mit
seanlin0800/intro_react,seanlin0800/intro_react
markdown
## Code Before: Getting started with routing using react-router Key points: - react-router (v0.13.3) - Route - HashLocation - DefaultRoute - Link ## Instruction: Update description of example 14 ## Code After: Getting started with routing using react-router Key points: - react-router (v0.13.3) - Route - RouteHandler - DefaultRoute - Link
Getting started with routing using react-router Key points: - react-router (v0.13.3) - Route - - HashLocation + - RouteHandler - DefaultRoute - Link
2
0.222222
1
1
cae2b6283cafc48fea7f58d465cd04f0ec778417
README.md
README.md
Java implementation of core ILP functions See https://github.com/interledger/rfcs/blob/master/0003-interledger-protocol/0003-interledger-protocol.md
Java implementation of core ILP functions See https://github.com/interledger/rfcs/blob/master/0003-interledger-protocol/0003-interledger-protocol.md Depends on https://github.com/adrianhopebailie/java-crypto-conditions
Add note about dependance on Crypto-Conditions
Add note about dependance on Crypto-Conditions
Markdown
apache-2.0
controlsurface/java-ilp-core,interledger/java-ilp-core
markdown
## Code Before: Java implementation of core ILP functions See https://github.com/interledger/rfcs/blob/master/0003-interledger-protocol/0003-interledger-protocol.md ## Instruction: Add note about dependance on Crypto-Conditions ## Code After: Java implementation of core ILP functions See https://github.com/interledger/rfcs/blob/master/0003-interledger-protocol/0003-interledger-protocol.md Depends on https://github.com/adrianhopebailie/java-crypto-conditions
Java implementation of core ILP functions See https://github.com/interledger/rfcs/blob/master/0003-interledger-protocol/0003-interledger-protocol.md + + Depends on https://github.com/adrianhopebailie/java-crypto-conditions
2
0.666667
2
0
76c39d833dd21e58bd981eb14bccbfc3746f7360
README.md
README.md
[![GoDoc](https://godoc.org/github.com/jitsi/jwtsi?status.svg)](https://godoc.org/github.com/jitsi/jwtsi) [![License](https://img.shields.io/badge/license-FreeBSD-blue.svg)](https://opensource.org/licenses/BSD-2-Clause) The Jitsi JWT Service is an OAuth2 frontend that allows authentication with a number of providers and generates a short-lived, signed, JWT (jot) token to assert the users identity to Jitsi Meet. To get started, install `jwtsi` and run it: ```go go get github.com/jitsi/jwtsi go install github.com/jitsi/jwtsi/cmd/jwtsi jwtsi -help ``` ## License The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the file [LICENSE.md][LICENSE]. [LICENSE]: ./LICENSE.md
[![GoDoc](https://godoc.org/github.com/jitsi/jwtsi?status.svg)](https://godoc.org/github.com/jitsi/jwtsi) [![License](https://img.shields.io/badge/license-FreeBSD-blue.svg)](https://opensource.org/licenses/BSD-2-Clause) The Jitsi JWT Service is an OAuth2 frontend that allows authentication with a number of providers and generates a short-lived, signed, JWT (jot) token to assert the users identity to Jitsi Meet. The package contains a number of handlers which can be used to build your own compatible login service. There is also an example service in the `cmd/jwtsi` directory which provides a nice frontend (which can be loaded in an iframe) that supports several providers, and the various required login endpoints. To get started, install the `jwtsi` command and run it: ```go go get github.com/jitsi/jwtsi go install github.com/jitsi/jwtsi/cmd/jwtsi jwtsi -help ``` ## License The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the file [LICENSE.md][LICENSE]. [LICENSE]: ./LICENSE.md
Update description in the readme.
Update description in the readme.
Markdown
bsd-2-clause
jitsi/jap,jitsi/jap
markdown
## Code Before: [![GoDoc](https://godoc.org/github.com/jitsi/jwtsi?status.svg)](https://godoc.org/github.com/jitsi/jwtsi) [![License](https://img.shields.io/badge/license-FreeBSD-blue.svg)](https://opensource.org/licenses/BSD-2-Clause) The Jitsi JWT Service is an OAuth2 frontend that allows authentication with a number of providers and generates a short-lived, signed, JWT (jot) token to assert the users identity to Jitsi Meet. To get started, install `jwtsi` and run it: ```go go get github.com/jitsi/jwtsi go install github.com/jitsi/jwtsi/cmd/jwtsi jwtsi -help ``` ## License The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the file [LICENSE.md][LICENSE]. [LICENSE]: ./LICENSE.md ## Instruction: Update description in the readme. ## Code After: [![GoDoc](https://godoc.org/github.com/jitsi/jwtsi?status.svg)](https://godoc.org/github.com/jitsi/jwtsi) [![License](https://img.shields.io/badge/license-FreeBSD-blue.svg)](https://opensource.org/licenses/BSD-2-Clause) The Jitsi JWT Service is an OAuth2 frontend that allows authentication with a number of providers and generates a short-lived, signed, JWT (jot) token to assert the users identity to Jitsi Meet. The package contains a number of handlers which can be used to build your own compatible login service. There is also an example service in the `cmd/jwtsi` directory which provides a nice frontend (which can be loaded in an iframe) that supports several providers, and the various required login endpoints. To get started, install the `jwtsi` command and run it: ```go go get github.com/jitsi/jwtsi go install github.com/jitsi/jwtsi/cmd/jwtsi jwtsi -help ``` ## License The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the file [LICENSE.md][LICENSE]. [LICENSE]: ./LICENSE.md
[![GoDoc](https://godoc.org/github.com/jitsi/jwtsi?status.svg)](https://godoc.org/github.com/jitsi/jwtsi) [![License](https://img.shields.io/badge/license-FreeBSD-blue.svg)](https://opensource.org/licenses/BSD-2-Clause) The Jitsi JWT Service is an OAuth2 frontend that allows authentication with a number of providers and generates a short-lived, signed, JWT (jot) token to assert the users identity to Jitsi Meet. + The package contains a number of handlers which can be used to build your own + compatible login service. There is also an example service in the `cmd/jwtsi` + directory which provides a nice frontend (which can be loaded in an iframe) that + supports several providers, and the various required login endpoints. + - To get started, install `jwtsi` and run it: + To get started, install the `jwtsi` command and run it: ? ++++ ++++++++ ```go go get github.com/jitsi/jwtsi go install github.com/jitsi/jwtsi/cmd/jwtsi jwtsi -help ``` ## License The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the file [LICENSE.md][LICENSE]. [LICENSE]: ./LICENSE.md
7
0.318182
6
1
cf4efad282939e120046eb8e8271d377f4a3d122
viaduct/templates/page/view_super.htm
viaduct/templates/page/view_super.htm
{% from 'macros/flash.htm' import render_flash %} {% from 'macros/custom_form.htm' import user_fields %} {% from 'macros/form.htm' import render_field %} {% extends 'content.htm' %} {% block content %} <div class='mainblock'> <div class='page-header'> {% if ModuleAPI.can_write('page') and UserAPI.can_write(page) %} <div class='btn-group pull-right'> {% if page.id %} <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'> <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis </a> {% endif %} <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'> <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina </a> </div> {% endif %} <h1>{% block page_title %}{% endblock %}</h1> </div> {% block page_content %}{% endblock %} </div> {% endblock %}
{% from 'macros/flash.htm' import render_flash %} {% from 'macros/custom_form.htm' import user_fields %} {% from 'macros/form.htm' import render_field %} {% extends 'content.htm' %} {% block content %} <div class='mainblock'> <div class='page-header'> {% if ModuleAPI.can_write('page') and (not page.id or UserAPI.can_write(page)) %} <div class='btn-group pull-right'> {% if page.id %} <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'> <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis </a> {% endif %} <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'> <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina </a> </div> {% endif %} <h1>{% block page_title %}{% endblock %}</h1> </div> {% block page_content %}{% endblock %} </div> {% endblock %}
Fix edit button for non-existant pages
Fix edit button for non-existant pages The logic for displaying the edit button on pages was: is the user in a group that can edit the page, and can the user edit this specific page. Now when a page does not exist, the user might have rights to edit pages, but no rights to edit this specific page exist, so the logic fails. This is fixed by changing the logic to: is the user in a group that can edit the page, and is this a non-existant page or can the user edit this specific existant page. Shit wooorks.
HTML
mit
viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct,viaict/viaduct
html
## Code Before: {% from 'macros/flash.htm' import render_flash %} {% from 'macros/custom_form.htm' import user_fields %} {% from 'macros/form.htm' import render_field %} {% extends 'content.htm' %} {% block content %} <div class='mainblock'> <div class='page-header'> {% if ModuleAPI.can_write('page') and UserAPI.can_write(page) %} <div class='btn-group pull-right'> {% if page.id %} <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'> <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis </a> {% endif %} <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'> <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina </a> </div> {% endif %} <h1>{% block page_title %}{% endblock %}</h1> </div> {% block page_content %}{% endblock %} </div> {% endblock %} ## Instruction: Fix edit button for non-existant pages The logic for displaying the edit button on pages was: is the user in a group that can edit the page, and can the user edit this specific page. Now when a page does not exist, the user might have rights to edit pages, but no rights to edit this specific page exist, so the logic fails. This is fixed by changing the logic to: is the user in a group that can edit the page, and is this a non-existant page or can the user edit this specific existant page. Shit wooorks. ## Code After: {% from 'macros/flash.htm' import render_flash %} {% from 'macros/custom_form.htm' import user_fields %} {% from 'macros/form.htm' import render_field %} {% extends 'content.htm' %} {% block content %} <div class='mainblock'> <div class='page-header'> {% if ModuleAPI.can_write('page') and (not page.id or UserAPI.can_write(page)) %} <div class='btn-group pull-right'> {% if page.id %} <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'> <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis </a> {% endif %} <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'> <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina </a> </div> {% endif %} <h1>{% block page_title %}{% endblock %}</h1> </div> {% block page_content %}{% endblock %} </div> {% endblock %}
{% from 'macros/flash.htm' import render_flash %} {% from 'macros/custom_form.htm' import user_fields %} {% from 'macros/form.htm' import render_field %} {% extends 'content.htm' %} {% block content %} <div class='mainblock'> <div class='page-header'> - {% if ModuleAPI.can_write('page') and UserAPI.can_write(page) %} ? ^^^^^^^^^^ ^^^^ ^^ ^ ^^ + {% if ModuleAPI.can_write('page') and (not page.id or ? ^ ^ ^ ^^^ ^^ + UserAPI.can_write(page)) %} <div class='btn-group pull-right'> {% if page.id %} <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'> <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis </a> {% endif %} <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'> <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina </a> </div> {% endif %} <h1>{% block page_title %}{% endblock %}</h1> </div> {% block page_content %}{% endblock %} </div> {% endblock %}
3
0.103448
2
1
9ed6c2e8e7e30a17ca70ff4385fa70db680933a3
README.md
README.md
A generator for protocol buffer described APIs for and in C#. This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library. ## Purpose We aim for this generator to replace the [older monolithic generator](https://github.com/googleapis/gapic-generator). Disclaimer ---------- This generator is currently experimental. Please don't use it for anything mission-critical.
A generator for protocol buffer described APIs for and in C#. [![Travis build Status](https://api.travis-ci.org/googleapis/gapic-generator-csharp.svg?branch=master)](https://travis-ci.org/googleapis/gapic-generator-csharp) This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library. ## Purpose We aim for this generator to replace the [older monolithic generator](https://github.com/googleapis/gapic-generator). Disclaimer ---------- This generator is currently experimental. Please don't use it for anything mission-critical.
Add travis build badge to readme
Add travis build badge to readme
Markdown
apache-2.0
googleapis/gapic-generator-csharp,googleapis/gapic-generator-csharp
markdown
## Code Before: A generator for protocol buffer described APIs for and in C#. This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library. ## Purpose We aim for this generator to replace the [older monolithic generator](https://github.com/googleapis/gapic-generator). Disclaimer ---------- This generator is currently experimental. Please don't use it for anything mission-critical. ## Instruction: Add travis build badge to readme ## Code After: A generator for protocol buffer described APIs for and in C#. [![Travis build Status](https://api.travis-ci.org/googleapis/gapic-generator-csharp.svg?branch=master)](https://travis-ci.org/googleapis/gapic-generator-csharp) This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library. ## Purpose We aim for this generator to replace the [older monolithic generator](https://github.com/googleapis/gapic-generator). Disclaimer ---------- This generator is currently experimental. Please don't use it for anything mission-critical.
A generator for protocol buffer described APIs for and in C#. + + [![Travis build Status](https://api.travis-ci.org/googleapis/gapic-generator-csharp.svg?branch=master)](https://travis-ci.org/googleapis/gapic-generator-csharp) This is a generator for API client libraries for APIs specified by protocol buffers, such as those inside Google. It takes a protocol buffer (with particular annotations) and uses it to generate a client library. ## Purpose We aim for this generator to replace the [older monolithic generator](https://github.com/googleapis/gapic-generator). Disclaimer ---------- This generator is currently experimental. Please don't use it for anything mission-critical.
2
0.153846
2
0
b7e38f3fc299d906ab81ab7826af96ea4769d066
fireplace/cards/wog/neutral_common.py
fireplace/cards/wog/neutral_common.py
from ..utils import * ## # Minions class OG_151: "Tentacle of N'Zoth" deathrattle = Hit(ALL_MINIONS, 1) class OG_156: "Bilefin Tidehunter" play = Summon(CONTROLLER, "OG_156a") class OG_158: "Zealous Initiate" deathrattle = Buff(RANDOM_FRIENDLY_MINION, "OG_158e") OG_158e = buff(+1, +1) class OG_323: "Polluted Hoarder" deathrattle = Draw(CONTROLLER)
from ..utils import * ## # Minions class OG_150: "Aberrant Berserker" enrage = Refresh(SELF, buff="OG_150e") OG_150e = buff(atk=2) class OG_151: "Tentacle of N'Zoth" deathrattle = Hit(ALL_MINIONS, 1) class OG_156: "Bilefin Tidehunter" play = Summon(CONTROLLER, "OG_156a") class OG_158: "Zealous Initiate" deathrattle = Buff(RANDOM_FRIENDLY_MINION, "OG_158e") OG_158e = buff(+1, +1) class OG_249: "Infested Tauren" deathrattle = Summon(CONTROLLER, "OG_249a") class OG_256: "Spawn of N'Zoth" deathrattle = Buff(FRIENDLY_MINIONS, "OG_256e") OG_256e = buff(+1, +1) class OG_323: "Polluted Hoarder" deathrattle = Draw(CONTROLLER)
Implement Aberrant Berserker, Infested Tauren, and Spawn of N'Zoth
Implement Aberrant Berserker, Infested Tauren, and Spawn of N'Zoth
Python
agpl-3.0
NightKev/fireplace,jleclanche/fireplace,beheh/fireplace
python
## Code Before: from ..utils import * ## # Minions class OG_151: "Tentacle of N'Zoth" deathrattle = Hit(ALL_MINIONS, 1) class OG_156: "Bilefin Tidehunter" play = Summon(CONTROLLER, "OG_156a") class OG_158: "Zealous Initiate" deathrattle = Buff(RANDOM_FRIENDLY_MINION, "OG_158e") OG_158e = buff(+1, +1) class OG_323: "Polluted Hoarder" deathrattle = Draw(CONTROLLER) ## Instruction: Implement Aberrant Berserker, Infested Tauren, and Spawn of N'Zoth ## Code After: from ..utils import * ## # Minions class OG_150: "Aberrant Berserker" enrage = Refresh(SELF, buff="OG_150e") OG_150e = buff(atk=2) class OG_151: "Tentacle of N'Zoth" deathrattle = Hit(ALL_MINIONS, 1) class OG_156: "Bilefin Tidehunter" play = Summon(CONTROLLER, "OG_156a") class OG_158: "Zealous Initiate" deathrattle = Buff(RANDOM_FRIENDLY_MINION, "OG_158e") OG_158e = buff(+1, +1) class OG_249: "Infested Tauren" deathrattle = Summon(CONTROLLER, "OG_249a") class OG_256: "Spawn of N'Zoth" deathrattle = Buff(FRIENDLY_MINIONS, "OG_256e") OG_256e = buff(+1, +1) class OG_323: "Polluted Hoarder" deathrattle = Draw(CONTROLLER)
from ..utils import * ## # Minions + + class OG_150: + "Aberrant Berserker" + enrage = Refresh(SELF, buff="OG_150e") + + OG_150e = buff(atk=2) + class OG_151: "Tentacle of N'Zoth" deathrattle = Hit(ALL_MINIONS, 1) class OG_156: "Bilefin Tidehunter" play = Summon(CONTROLLER, "OG_156a") class OG_158: "Zealous Initiate" deathrattle = Buff(RANDOM_FRIENDLY_MINION, "OG_158e") OG_158e = buff(+1, +1) + class OG_249: + "Infested Tauren" + deathrattle = Summon(CONTROLLER, "OG_249a") + + + class OG_256: + "Spawn of N'Zoth" + deathrattle = Buff(FRIENDLY_MINIONS, "OG_256e") + + OG_256e = buff(+1, +1) + + class OG_323: "Polluted Hoarder" deathrattle = Draw(CONTROLLER)
19
0.730769
19
0
c68e3747c5674b459719a620d2c9cd6c22721039
README.md
README.md
Scripts to configure a Mesos cluster using Mesos and Mesosphere services. The main features are: - Mesos master running the Marathon and Chronos frameworks - Mesos agent with Docker containerizer - Mesos DNS for core service discovery - Marathon load balancer using HAProxy for SSL and proxying to internal applications To try it out locally use the [Vagrant](vagrant/README.md) configuration. ## Usage To use the scripts to build a custom Mesos cluster first install the roles in your project: $ ansible-galaxy install --force --roles-path .ansible \ https://github.com/ypg-data/mesos-stack and configure Ansible to load roles from the roles directory provided by this project. `ansible.cfg`: ```ini [defaults] roles_path = .ansible/mesos-stack/roles ``` Alternatively, you can also use a `requirements.yml` file: ```yaml - src: https://github.com/ypg-data/mesos-stack path: .ansible ``` and pull down the roles to your DevOps setup by running: $ ansible-galaxy install -r requirements.yml
Scripts to configure a Mesos cluster using Mesos and Mesosphere services. The main features are: - Mesos master running the Marathon and Chronos frameworks - Mesos agent with Docker containerizer - Mesos DNS for core service discovery - Marathon load balancer using HAProxy for SSL and proxying to internal applications To try it out locally use the [Vagrant](vagrant/README.md) configuration. [![Build Status](https://travis-ci.org/ypg-data/mesos-stack.svg?branch=master)](https://travis-ci.org/ypg-data/mesos-stack) ## Usage To use the scripts to build a custom Mesos cluster first install the roles in your project: $ ansible-galaxy install --force --roles-path .ansible \ https://github.com/ypg-data/mesos-stack and configure Ansible to load roles from the roles directory provided by this project. `ansible.cfg`: ```ini [defaults] roles_path = .ansible/mesos-stack/roles ``` Alternatively, you can also use a `requirements.yml` file: ```yaml - src: https://github.com/ypg-data/mesos-stack path: .ansible ``` and pull down the roles to your DevOps setup by running: $ ansible-galaxy install -r requirements.yml
Add link to Travis build status badge
Add link to Travis build status badge
Markdown
apache-2.0
ypg-data/mesos-stack,ypg-data/mesos-stack
markdown
## Code Before: Scripts to configure a Mesos cluster using Mesos and Mesosphere services. The main features are: - Mesos master running the Marathon and Chronos frameworks - Mesos agent with Docker containerizer - Mesos DNS for core service discovery - Marathon load balancer using HAProxy for SSL and proxying to internal applications To try it out locally use the [Vagrant](vagrant/README.md) configuration. ## Usage To use the scripts to build a custom Mesos cluster first install the roles in your project: $ ansible-galaxy install --force --roles-path .ansible \ https://github.com/ypg-data/mesos-stack and configure Ansible to load roles from the roles directory provided by this project. `ansible.cfg`: ```ini [defaults] roles_path = .ansible/mesos-stack/roles ``` Alternatively, you can also use a `requirements.yml` file: ```yaml - src: https://github.com/ypg-data/mesos-stack path: .ansible ``` and pull down the roles to your DevOps setup by running: $ ansible-galaxy install -r requirements.yml ## Instruction: Add link to Travis build status badge ## Code After: Scripts to configure a Mesos cluster using Mesos and Mesosphere services. The main features are: - Mesos master running the Marathon and Chronos frameworks - Mesos agent with Docker containerizer - Mesos DNS for core service discovery - Marathon load balancer using HAProxy for SSL and proxying to internal applications To try it out locally use the [Vagrant](vagrant/README.md) configuration. [![Build Status](https://travis-ci.org/ypg-data/mesos-stack.svg?branch=master)](https://travis-ci.org/ypg-data/mesos-stack) ## Usage To use the scripts to build a custom Mesos cluster first install the roles in your project: $ ansible-galaxy install --force --roles-path .ansible \ https://github.com/ypg-data/mesos-stack and configure Ansible to load roles from the roles directory provided by this project. `ansible.cfg`: ```ini [defaults] roles_path = .ansible/mesos-stack/roles ``` Alternatively, you can also use a `requirements.yml` file: ```yaml - src: https://github.com/ypg-data/mesos-stack path: .ansible ``` and pull down the roles to your DevOps setup by running: $ ansible-galaxy install -r requirements.yml
Scripts to configure a Mesos cluster using Mesos and Mesosphere services. + The main features are: - Mesos master running the Marathon and Chronos frameworks - Mesos agent with Docker containerizer - Mesos DNS for core service discovery - Marathon load balancer using HAProxy for SSL and proxying to internal applications To try it out locally use the [Vagrant](vagrant/README.md) configuration. + + [![Build Status](https://travis-ci.org/ypg-data/mesos-stack.svg?branch=master)](https://travis-ci.org/ypg-data/mesos-stack) ## Usage To use the scripts to build a custom Mesos cluster first install the roles in your project: $ ansible-galaxy install --force --roles-path .ansible \ https://github.com/ypg-data/mesos-stack and configure Ansible to load roles from the roles directory provided by this project. `ansible.cfg`: ```ini [defaults] roles_path = .ansible/mesos-stack/roles ``` Alternatively, you can also use a `requirements.yml` file: ```yaml - src: https://github.com/ypg-data/mesos-stack path: .ansible ``` and pull down the roles to your DevOps setup by running: $ ansible-galaxy install -r requirements.yml
3
0.076923
3
0
0f2ccc881e8d2b8b0f4064e3e1fae39b14875821
tortilla/utils.py
tortilla/utils.py
import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): try: __IPYTHON__ return True except NameError: return False class Bunch(dict): def __init__(self, kwargs=None): if kwargs is None: kwargs = {} for key, value in six.iteritems(kwargs): kwargs[key] = bunchify(value) super().__init__(kwargs) self.__dict__ = self def bunchify(obj): if isinstance(obj, (list, tuple)): return [bunchify(item) for item in obj] if isinstance(obj, dict): return Bunch(obj) return obj
import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): return getattr(__builtins__, "__IPYTHON__", False) class Bunch(dict): def __init__(self, kwargs=None): if kwargs is None: kwargs = {} for key, value in six.iteritems(kwargs): kwargs[key] = bunchify(value) super().__init__(kwargs) self.__dict__ = self def bunchify(obj): if isinstance(obj, (list, tuple)): return [bunchify(item) for item in obj] if isinstance(obj, dict): return Bunch(obj) return obj
Refactor run_from_ipython() implementation to make it pass static code analysis test
Refactor run_from_ipython() implementation to make it pass static code analysis test
Python
mit
redodo/tortilla
python
## Code Before: import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): try: __IPYTHON__ return True except NameError: return False class Bunch(dict): def __init__(self, kwargs=None): if kwargs is None: kwargs = {} for key, value in six.iteritems(kwargs): kwargs[key] = bunchify(value) super().__init__(kwargs) self.__dict__ = self def bunchify(obj): if isinstance(obj, (list, tuple)): return [bunchify(item) for item in obj] if isinstance(obj, dict): return Bunch(obj) return obj ## Instruction: Refactor run_from_ipython() implementation to make it pass static code analysis test ## Code After: import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): return getattr(__builtins__, "__IPYTHON__", False) class Bunch(dict): def __init__(self, kwargs=None): if kwargs is None: kwargs = {} for key, value in six.iteritems(kwargs): kwargs[key] = bunchify(value) super().__init__(kwargs) self.__dict__ = self def bunchify(obj): if isinstance(obj, (list, tuple)): return [bunchify(item) for item in obj] if isinstance(obj, dict): return Bunch(obj) return obj
import six from formats import FormatBank, discover_json, discover_yaml formats = FormatBank() discover_json(formats, content_type='application/json') discover_yaml(formats, content_type='application/x-yaml') def run_from_ipython(): + return getattr(__builtins__, "__IPYTHON__", False) - try: - __IPYTHON__ - return True - except NameError: - return False class Bunch(dict): def __init__(self, kwargs=None): if kwargs is None: kwargs = {} for key, value in six.iteritems(kwargs): kwargs[key] = bunchify(value) super().__init__(kwargs) self.__dict__ = self def bunchify(obj): if isinstance(obj, (list, tuple)): return [bunchify(item) for item in obj] if isinstance(obj, dict): return Bunch(obj) return obj
6
0.166667
1
5
cede6dcbee2a9179f6932615d4522e70eef942c0
Tests/Unit/Manager/MeasureManagerTest.php
Tests/Unit/Manager/MeasureManagerTest.php
<?php namespace Akeneo\Bundle\MeasureBundle\Tests\Unit\Manager; use Akeneo\Bundle\MeasureBundle\Manager\MeasureManager; class MeasureManagerTest extends \PHPUnit_Framework_TestCase { public function setUp() { $this->measureManager = new MeasureManager; $this->measureManager->setMeasureConfig( array( 'WEIGHT' => array( 'units' => array( 'KILOGRAM' => array('symbol' => 'kg'), 'GRAM' => array('symbol' => 'g') ) ) ) ); } public function testGetUnitForFamily() { $this->assertEquals( array( 'KILOGRAM' => 'kg', 'GRAM' => 'g', ), $this->measureManager->getUnitSymbolsForFamily('WEIGHT') ); } public function testInvalidFamilyWhenGettingUnitForFamily() { try { $this->measureManager->getUnitSymbolsForFamily('LENGTH'); } catch (\InvalidArgumentException $e) { $this->assertEquals('Undefined measure family "LENGTH"', $e->getMessage()); return; } $this->fail('An InvalidArgumentException has not been raised.'); } }
<?php namespace Akeneo\Bundle\MeasureBundle\Tests\Unit\Manager; use Akeneo\Bundle\MeasureBundle\Manager\MeasureManager; class MeasureManagerTest extends \PHPUnit_Framework_TestCase { public function setUp() { $this->measureManager = new MeasureManager; $this->measureManager->setMeasureConfig( array( 'WEIGHT' => array( 'standard' => 'KILOGRAM', 'units' => array( 'KILOGRAM' => array('symbol' => 'kg'), 'GRAM' => array('symbol' => 'g') ) ) ) ); } public function testGetUnitForFamily() { $this->assertEquals( array( 'KILOGRAM' => 'kg', 'GRAM' => 'g', ), $this->measureManager->getUnitSymbolsForFamily('WEIGHT') ); } public function testInvalidFamilyWhenGettingUnitForFamily() { try { $this->measureManager->getUnitSymbolsForFamily('LENGTH'); } catch (\InvalidArgumentException $e) { $this->assertEquals('Undefined measure family "LENGTH"', $e->getMessage()); return; } $this->fail('An InvalidArgumentException has not been raised.'); } public function testGetStandardUnitForFamily() { $this->assertEquals( 'KILOGRAM', $this->measureManager->getStandardUnitForFamily('WEIGHT') ); } }
Add UT on standard family unit
Add UT on standard family unit
PHP
mit
danielsan80/MeasureBundle
php
## Code Before: <?php namespace Akeneo\Bundle\MeasureBundle\Tests\Unit\Manager; use Akeneo\Bundle\MeasureBundle\Manager\MeasureManager; class MeasureManagerTest extends \PHPUnit_Framework_TestCase { public function setUp() { $this->measureManager = new MeasureManager; $this->measureManager->setMeasureConfig( array( 'WEIGHT' => array( 'units' => array( 'KILOGRAM' => array('symbol' => 'kg'), 'GRAM' => array('symbol' => 'g') ) ) ) ); } public function testGetUnitForFamily() { $this->assertEquals( array( 'KILOGRAM' => 'kg', 'GRAM' => 'g', ), $this->measureManager->getUnitSymbolsForFamily('WEIGHT') ); } public function testInvalidFamilyWhenGettingUnitForFamily() { try { $this->measureManager->getUnitSymbolsForFamily('LENGTH'); } catch (\InvalidArgumentException $e) { $this->assertEquals('Undefined measure family "LENGTH"', $e->getMessage()); return; } $this->fail('An InvalidArgumentException has not been raised.'); } } ## Instruction: Add UT on standard family unit ## Code After: <?php namespace Akeneo\Bundle\MeasureBundle\Tests\Unit\Manager; use Akeneo\Bundle\MeasureBundle\Manager\MeasureManager; class MeasureManagerTest extends \PHPUnit_Framework_TestCase { public function setUp() { $this->measureManager = new MeasureManager; $this->measureManager->setMeasureConfig( array( 'WEIGHT' => array( 'standard' => 'KILOGRAM', 'units' => array( 'KILOGRAM' => array('symbol' => 'kg'), 'GRAM' => array('symbol' => 'g') ) ) ) ); } public function testGetUnitForFamily() { $this->assertEquals( array( 'KILOGRAM' => 'kg', 'GRAM' => 'g', ), $this->measureManager->getUnitSymbolsForFamily('WEIGHT') ); } public function testInvalidFamilyWhenGettingUnitForFamily() { try { $this->measureManager->getUnitSymbolsForFamily('LENGTH'); } catch (\InvalidArgumentException $e) { $this->assertEquals('Undefined measure family "LENGTH"', $e->getMessage()); return; } $this->fail('An InvalidArgumentException has not been raised.'); } public function testGetStandardUnitForFamily() { $this->assertEquals( 'KILOGRAM', $this->measureManager->getStandardUnitForFamily('WEIGHT') ); } }
<?php namespace Akeneo\Bundle\MeasureBundle\Tests\Unit\Manager; use Akeneo\Bundle\MeasureBundle\Manager\MeasureManager; class MeasureManagerTest extends \PHPUnit_Framework_TestCase { public function setUp() { $this->measureManager = new MeasureManager; $this->measureManager->setMeasureConfig( array( 'WEIGHT' => array( + 'standard' => 'KILOGRAM', 'units' => array( 'KILOGRAM' => array('symbol' => 'kg'), 'GRAM' => array('symbol' => 'g') ) ) ) ); } public function testGetUnitForFamily() { $this->assertEquals( array( 'KILOGRAM' => 'kg', 'GRAM' => 'g', ), $this->measureManager->getUnitSymbolsForFamily('WEIGHT') ); } public function testInvalidFamilyWhenGettingUnitForFamily() { try { $this->measureManager->getUnitSymbolsForFamily('LENGTH'); } catch (\InvalidArgumentException $e) { $this->assertEquals('Undefined measure family "LENGTH"', $e->getMessage()); return; } $this->fail('An InvalidArgumentException has not been raised.'); } + + public function testGetStandardUnitForFamily() + { + $this->assertEquals( + 'KILOGRAM', + $this->measureManager->getStandardUnitForFamily('WEIGHT') + ); + } }
9
0.195652
9
0
6ca66521bfaeb4d049147893eb61aeb08516451c
app.rb
app.rb
require 'sinatra' class Grokily < Sinatra::Application # Not using the API? Just redirect to Github. get '/' do redirect 'https://github.com/benjaminasmith/grokily' end end
require 'sinatra/base' class Grokily < Sinatra::Base # Not using the API? Just redirect to Github. get '/' do redirect 'https://github.com/benjaminasmith/grokily' end run! if app_file == $0 end
Switch to the simpler Sinatra Base style - let's keep it simple for now and remove unnecessary complexity.
Switch to the simpler Sinatra Base style - let's keep it simple for now and remove unnecessary complexity.
Ruby
mit
benjaminasmith/grokily
ruby
## Code Before: require 'sinatra' class Grokily < Sinatra::Application # Not using the API? Just redirect to Github. get '/' do redirect 'https://github.com/benjaminasmith/grokily' end end ## Instruction: Switch to the simpler Sinatra Base style - let's keep it simple for now and remove unnecessary complexity. ## Code After: require 'sinatra/base' class Grokily < Sinatra::Base # Not using the API? Just redirect to Github. get '/' do redirect 'https://github.com/benjaminasmith/grokily' end run! if app_file == $0 end
- require 'sinatra' + require 'sinatra/base' ? +++++ - class Grokily < Sinatra::Application ? ^^^^^^ ^^^^ + class Grokily < Sinatra::Base ? ^ ^^ # Not using the API? Just redirect to Github. get '/' do redirect 'https://github.com/benjaminasmith/grokily' end + run! if app_file == $0 - - end
7
0.583333
3
4
0b69e5b84bb9cfb066dafac994b26469fe790b16
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
- [ ] This issue is about **specifically** the [git-scm.com](https://git-scm.com) website and is **not** an issue about - [ ] Git (or its man pages), which should be raised with the [community](https://git-scm.com/community), - [ ] Git for Windows, which should be raised at [git-for-windows/git](https://github.com/git-for-windows/git), or - [ ] the contents of the Pro Git book, which should be raised at [progit/progit2](https://github.com/progit/progit2/issues).
- [ ] This issue is about **specifically** the [git-scm.com](https://git-scm.com) website and is **not** an issue about - [ ] Git (or its man pages), which are located under https://git-scm.com/docs, should be raised with the [community](https://git-scm.com/community), - [ ] Git for Windows, which should be raised at [git-for-windows/git](https://github.com/git-for-windows/git), or - [ ] the contents of the Pro Git book, which are located under https://git-scm.com/book, should be raised at [progit/progit2](https://github.com/progit/progit2/issues).
Add more info to location of external sources
Add more info to location of external sources Add more info to location of external sources on issue template
Markdown
mit
mosoft521/gitscm-next,Mokolea/git-scm.com,git/git-scm.com,git/git-scm.com,git/git-scm.com,mosoft521/gitscm-next,mosoft521/gitscm-next,jasonlong/git-scm.com,jasonlong/git-scm.com,jasonlong/git-scm.com,Mokolea/git-scm.com,Mokolea/git-scm.com,jasonlong/git-scm.com,git/git-scm.com,mosoft521/gitscm-next,Mokolea/git-scm.com
markdown
## Code Before: - [ ] This issue is about **specifically** the [git-scm.com](https://git-scm.com) website and is **not** an issue about - [ ] Git (or its man pages), which should be raised with the [community](https://git-scm.com/community), - [ ] Git for Windows, which should be raised at [git-for-windows/git](https://github.com/git-for-windows/git), or - [ ] the contents of the Pro Git book, which should be raised at [progit/progit2](https://github.com/progit/progit2/issues). ## Instruction: Add more info to location of external sources Add more info to location of external sources on issue template ## Code After: - [ ] This issue is about **specifically** the [git-scm.com](https://git-scm.com) website and is **not** an issue about - [ ] Git (or its man pages), which are located under https://git-scm.com/docs, should be raised with the [community](https://git-scm.com/community), - [ ] Git for Windows, which should be raised at [git-for-windows/git](https://github.com/git-for-windows/git), or - [ ] the contents of the Pro Git book, which are located under https://git-scm.com/book, should be raised at [progit/progit2](https://github.com/progit/progit2/issues).
- - [ ] This issue is about **specifically** the [git-scm.com](https://git-scm.com) website and is **not** an issue about ? - + - [ ] This issue is about **specifically** the [git-scm.com](https://git-scm.com) website and is **not** an issue about - - [ ] Git (or its man pages), which should be raised with the [community](https://git-scm.com/community), + - [ ] Git (or its man pages), which are located under https://git-scm.com/docs, should be raised with the [community](https://git-scm.com/community), ? ++++++++++++++++++++++++++++++++++++++++++++ - [ ] Git for Windows, which should be raised at [git-for-windows/git](https://github.com/git-for-windows/git), or - - [ ] the contents of the Pro Git book, which should be raised at [progit/progit2](https://github.com/progit/progit2/issues). + - [ ] the contents of the Pro Git book, which are located under https://git-scm.com/book, should be raised at [progit/progit2](https://github.com/progit/progit2/issues). ? ++++++++++++++++++++++++++++++++++++++++++++
6
1.5
3
3
392f58abf7b163bb34e395f5818daa0a13d05342
pyscriptic/tests/instructions_test.py
pyscriptic/tests/instructions_test.py
from unittest import TestCase from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix class PipetteOpTests(TestCase): def setUp(self): self.mix = PrePostMix( volume="5:microliter", speed="1:microliter/second", repetitions=10, ) def test_transfer(self): op = PipetteOp( groups=[ TransferGroup( from_well="plate/A1", to_well="plate/A2", volume="20:microliter", aspirate_speed="1:microliter/second", dispense_speed="1:microliter/second", mix_before=self.mix, mix_after=self.mix, ), ], ) def test_distribute(self): pass def test_consolidate(self): pass def test_mix(self): pass
from unittest import TestCase from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix from pyscriptic.submit import pyobj_to_std_types class PipetteOpTests(TestCase): def setUp(self): self.mix = PrePostMix( volume="5:microliter", speed="0.5:microliter/second", repetitions=10, ) def test_transfer(self): op = PipetteOp( groups=[ TransferGroup( from_well="plate/A1", to_well="plate/A2", volume="20:microliter", aspirate_speed="1:microliter/second", dispense_speed="2:microliter/second", mix_before=self.mix, mix_after=self.mix, ), ], ) self.assertEqual( pyobj_to_std_types(op), { "op": "pipette", "groups": [{ "transfer": [{ "from": "plate/A1", "to": "plate/A2", "volume": "20:microliter", "aspirate_speed": "1:microliter/second", "dispense_speed": "2:microliter/second", "mix_after": { "volume": "5:microliter", "speed": "0.5:microliter/second", "repetitions": 10, }, "mix_before": { "volume": "5:microliter", "speed": "0.5:microliter/second", "repetitions": 10, }, }] }], }, ) def test_distribute(self): pass def test_consolidate(self): pass def test_mix(self): pass
Test conversion of Transfer to standard types works
Test conversion of Transfer to standard types works
Python
bsd-2-clause
naderm/pytranscriptic,naderm/pytranscriptic
python
## Code Before: from unittest import TestCase from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix class PipetteOpTests(TestCase): def setUp(self): self.mix = PrePostMix( volume="5:microliter", speed="1:microliter/second", repetitions=10, ) def test_transfer(self): op = PipetteOp( groups=[ TransferGroup( from_well="plate/A1", to_well="plate/A2", volume="20:microliter", aspirate_speed="1:microliter/second", dispense_speed="1:microliter/second", mix_before=self.mix, mix_after=self.mix, ), ], ) def test_distribute(self): pass def test_consolidate(self): pass def test_mix(self): pass ## Instruction: Test conversion of Transfer to standard types works ## Code After: from unittest import TestCase from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix from pyscriptic.submit import pyobj_to_std_types class PipetteOpTests(TestCase): def setUp(self): self.mix = PrePostMix( volume="5:microliter", speed="0.5:microliter/second", repetitions=10, ) def test_transfer(self): op = PipetteOp( groups=[ TransferGroup( from_well="plate/A1", to_well="plate/A2", volume="20:microliter", aspirate_speed="1:microliter/second", dispense_speed="2:microliter/second", mix_before=self.mix, mix_after=self.mix, ), ], ) self.assertEqual( pyobj_to_std_types(op), { "op": "pipette", "groups": [{ "transfer": [{ "from": "plate/A1", "to": "plate/A2", "volume": "20:microliter", "aspirate_speed": "1:microliter/second", "dispense_speed": "2:microliter/second", "mix_after": { "volume": "5:microliter", "speed": "0.5:microliter/second", "repetitions": 10, }, "mix_before": { "volume": "5:microliter", "speed": "0.5:microliter/second", "repetitions": 10, }, }] }], }, ) def test_distribute(self): pass def test_consolidate(self): pass def test_mix(self): pass
from unittest import TestCase from pyscriptic.instructions import PipetteOp, TransferGroup, PrePostMix + from pyscriptic.submit import pyobj_to_std_types class PipetteOpTests(TestCase): def setUp(self): self.mix = PrePostMix( volume="5:microliter", - speed="1:microliter/second", ? ^ + speed="0.5:microliter/second", ? ^^^ repetitions=10, ) def test_transfer(self): op = PipetteOp( groups=[ TransferGroup( from_well="plate/A1", to_well="plate/A2", volume="20:microliter", aspirate_speed="1:microliter/second", - dispense_speed="1:microliter/second", ? ^ + dispense_speed="2:microliter/second", ? ^ mix_before=self.mix, mix_after=self.mix, ), ], + ) + self.assertEqual( + pyobj_to_std_types(op), + { + "op": "pipette", + "groups": [{ + "transfer": [{ + "from": "plate/A1", + "to": "plate/A2", + "volume": "20:microliter", + "aspirate_speed": "1:microliter/second", + "dispense_speed": "2:microliter/second", + "mix_after": { + "volume": "5:microliter", + "speed": "0.5:microliter/second", + "repetitions": 10, + }, + "mix_before": { + "volume": "5:microliter", + "speed": "0.5:microliter/second", + "repetitions": 10, + }, + }] + }], + }, ) def test_distribute(self): pass def test_consolidate(self): pass def test_mix(self): pass
30
0.833333
28
2
dda2197b1fd9db8fac38916a12b1cc9759e978fa
src/main/resources/group-id-only-style.json
src/main/resources/group-id-only-style.json
{ "default-node": { "type": "box", "default-font": { "size": 14, "name": "Helvetica" } } }
{ "default-node": { "type": "box", "group-id-font": { "size": 14 } } }
Adjust to new merge mechanism
Adjust to new merge mechanism
JSON
apache-2.0
ferstl/depgraph-maven-plugin
json
## Code Before: { "default-node": { "type": "box", "default-font": { "size": 14, "name": "Helvetica" } } } ## Instruction: Adjust to new merge mechanism ## Code After: { "default-node": { "type": "box", "group-id-font": { "size": 14 } } }
{ "default-node": { "type": "box", - "default-font": { + "group-id-font": { - "size": 14, ? - + "size": 14 - "name": "Helvetica" } } }
5
0.555556
2
3
f49e2a93cbf59fa013429a18ceec1ff082873d46
spec/dummy/app/themes/default/views/thredded/private_topics/_form.html.erb
spec/dummy/app/themes/default/views/thredded/private_topics/_form.html.erb
<h3 class="post-form--title">New Private Topic</h3> <%= form_for [messageboard, private_topic], url: messageboard_private_topics_path(messageboard, @private_topic), html: { class: css_class } do |form| %> <ul class="form-list"> <li> <%= form.label :title %> <%= form.text_field :title, { placeholder: placeholder, autofocus: 'autofocus' } %> </li> <li> <%= form.label :user_id, 'Users' %> <%= form.select :user_ids, form.object.users_options, form.object.selected_options, form.object.html_options %> </li> <%= render 'thredded/posts/content_field', form: form %> <li class="submit"> <%= form.submit 'Create New Private Topic', class: 'button-wide' %> </li> </ul> <% end %>
<%= form_for [messageboard, private_topic], url: messageboard_private_topics_path(messageboard, @private_topic), html: { class: css_class } do |form| %> <ul class="form-list on-top"> <li class="title"> <%= form.label :title, 'Private Topic Title' %> <%= form.text_field :title, { placeholder: placeholder } %> </li> <li> <%= form.label :user_id, 'Users in Private Topic' %> <%= form.select :user_ids, form.object.users_options, form.object.selected_options, form.object.html_options %> </li> <%= render 'thredded/posts/content_field', form: form %> <li class="submit"> <%= form.submit 'Create New Private Topic' %> </li> </ul> <% end %>
Make private topics form act like topics form
Make private topics form act like topics form
HTML+ERB
mit
prohippocoder/thredded,prohippocoder/thredded,jvoss/thredded,jvoss/thredded,jayroh/thredded,thredded/thredded,jayroh/thredded,jayroh/thredded,prohippocoder/thredded,thredded/thredded,jvoss/thredded,prohippocoder/thredded,thredded/thredded,thredded/thredded,jayroh/thredded,jvoss/thredded
html+erb
## Code Before: <h3 class="post-form--title">New Private Topic</h3> <%= form_for [messageboard, private_topic], url: messageboard_private_topics_path(messageboard, @private_topic), html: { class: css_class } do |form| %> <ul class="form-list"> <li> <%= form.label :title %> <%= form.text_field :title, { placeholder: placeholder, autofocus: 'autofocus' } %> </li> <li> <%= form.label :user_id, 'Users' %> <%= form.select :user_ids, form.object.users_options, form.object.selected_options, form.object.html_options %> </li> <%= render 'thredded/posts/content_field', form: form %> <li class="submit"> <%= form.submit 'Create New Private Topic', class: 'button-wide' %> </li> </ul> <% end %> ## Instruction: Make private topics form act like topics form ## Code After: <%= form_for [messageboard, private_topic], url: messageboard_private_topics_path(messageboard, @private_topic), html: { class: css_class } do |form| %> <ul class="form-list on-top"> <li class="title"> <%= form.label :title, 'Private Topic Title' %> <%= form.text_field :title, { placeholder: placeholder } %> </li> <li> <%= form.label :user_id, 'Users in Private Topic' %> <%= form.select :user_ids, form.object.users_options, form.object.selected_options, form.object.html_options %> </li> <%= render 'thredded/posts/content_field', form: form %> <li class="submit"> <%= form.submit 'Create New Private Topic' %> </li> </ul> <% end %>
- <h3 class="post-form--title">New Private Topic</h3> - <%= form_for [messageboard, private_topic], url: messageboard_private_topics_path(messageboard, @private_topic), html: { class: css_class } do |form| %> - <ul class="form-list"> + <ul class="form-list on-top"> ? +++++++ - <li> - <%= form.label :title %> + <li class="title"> + <%= form.label :title, 'Private Topic Title' %> - <%= form.text_field :title, { placeholder: placeholder, autofocus: 'autofocus' } %> ? ------------------------ + <%= form.text_field :title, { placeholder: placeholder } %> </li> <li> - <%= form.label :user_id, 'Users' %> + <%= form.label :user_id, 'Users in Private Topic' %> ? +++++++++++++++++ <%= form.select :user_ids, form.object.users_options, form.object.selected_options, form.object.html_options %> </li> <%= render 'thredded/posts/content_field', form: form %> <li class="submit"> - <%= form.submit 'Create New Private Topic', class: 'button-wide' %> ? ---------------------- + <%= form.submit 'Create New Private Topic' %> </li> </ul> <% end %>
14
0.5
6
8
952da381a38eb169f2533f9e5591b0318d055be9
app/models/sku.rb
app/models/sku.rb
class Sku < ActiveRecord::Base include IslayShop::MetaData include IslayShop::Statuses belongs_to :product has_many :sku_assets, :order => 'position ASC' has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' has_many :stock_logs, :class_name => 'SkuStockLog', :order => 'created_at DESC' has_many :price_logs, :class_name => 'SkuPriceLog', :order => 'created_at DESC' attr_accessible :product_id, :description, :unit, :amount, :price, :stock_level, :published, :template, :position track_user_edits validations_from_schema attr_accessor :template metadata(:metadata) do enum :color, :values => %w(red green blue yellow), :kind => :short end # Summary of this SKU, which includes it's product name, data cols, sizing, # price etc. # # This should be over-ridden in any subclasses to be more specific. def desc "#{product.name} - #{price}" end end
class Sku < ActiveRecord::Base include IslayShop::MetaData include IslayShop::Statuses belongs_to :product has_many :sku_assets, :order => 'position ASC' has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' has_many :stock_logs, :class_name => 'SkuStockLog', :order => 'created_at DESC' has_many :price_logs, :class_name => 'SkuPriceLog', :order => 'created_at DESC' attr_accessible :product_id, :description, :unit, :amount, :price, :stock_level, :published, :template, :position track_user_edits validations_from_schema attr_accessor :template # Summary of this SKU, which includes it's product name, data cols, sizing, # price etc. # # This should be over-ridden in any subclasses to be more specific. def desc "#{product.name} - #{price}" end end
Remove the test meta-data from the SKU model.
Remove the test meta-data from the SKU model.
Ruby
mit
spookandpuff/islay-shop,spookandpuff/islay-shop,spookandpuff/islay-shop
ruby
## Code Before: class Sku < ActiveRecord::Base include IslayShop::MetaData include IslayShop::Statuses belongs_to :product has_many :sku_assets, :order => 'position ASC' has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' has_many :stock_logs, :class_name => 'SkuStockLog', :order => 'created_at DESC' has_many :price_logs, :class_name => 'SkuPriceLog', :order => 'created_at DESC' attr_accessible :product_id, :description, :unit, :amount, :price, :stock_level, :published, :template, :position track_user_edits validations_from_schema attr_accessor :template metadata(:metadata) do enum :color, :values => %w(red green blue yellow), :kind => :short end # Summary of this SKU, which includes it's product name, data cols, sizing, # price etc. # # This should be over-ridden in any subclasses to be more specific. def desc "#{product.name} - #{price}" end end ## Instruction: Remove the test meta-data from the SKU model. ## Code After: class Sku < ActiveRecord::Base include IslayShop::MetaData include IslayShop::Statuses belongs_to :product has_many :sku_assets, :order => 'position ASC' has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' has_many :stock_logs, :class_name => 'SkuStockLog', :order => 'created_at DESC' has_many :price_logs, :class_name => 'SkuPriceLog', :order => 'created_at DESC' attr_accessible :product_id, :description, :unit, :amount, :price, :stock_level, :published, :template, :position track_user_edits validations_from_schema attr_accessor :template # Summary of this SKU, which includes it's product name, data cols, sizing, # price etc. # # This should be over-ridden in any subclasses to be more specific. def desc "#{product.name} - #{price}" end end
class Sku < ActiveRecord::Base include IslayShop::MetaData include IslayShop::Statuses belongs_to :product - has_many :sku_assets, :order => 'position ASC' + has_many :sku_assets, :order => 'position ASC' ? ++++++++ - has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' + has_many :assets, :through => :sku_assets, :order => 'sku_assets.position ASC' ? ++++++++ has_many :stock_logs, :class_name => 'SkuStockLog', :order => 'created_at DESC' has_many :price_logs, :class_name => 'SkuPriceLog', :order => 'created_at DESC' attr_accessible :product_id, :description, :unit, :amount, :price, :stock_level, :published, :template, :position track_user_edits validations_from_schema attr_accessor :template - metadata(:metadata) do - enum :color, :values => %w(red green blue yellow), :kind => :short - end - # Summary of this SKU, which includes it's product name, data cols, sizing, # price etc. # # This should be over-ridden in any subclasses to be more specific. def desc "#{product.name} - #{price}" end end
8
0.275862
2
6
c397de16c2c6b5d832189942f1fcb43b0ef4c5b1
src/geo/ui/widgets/category/paginator_template.tpl
src/geo/ui/widgets/category/paginator_template.tpl
<div class="Widget-contentFlex"> <button class="u-rSpace--m Widget-buttonIcon js-searchToggle"> <i class="CDBIcon CDBIcon-Lens"></i> </button> <p class="Widget-textSmaller Widget-textSmaller--bold Widget-textSmall--upper"> <% if (!isLocked) { %> <%- categoriesCount > 12 ? (categoriesCount - 11) : categoriesCount %> categor<%- categoriesCount !== 1 ? "ies" : "y" %> <%- categoriesCount > 12 ? "more" : "" %> <% } %> </p> </div> <div class="Widget-navDots js-dots"> <% for (var i = 0, l = pages; i < l; i++) { %><button class="Widget-dot Widget-dot--navigation js-page <% if (currentPage === i) { %>is-selected<% } %>" data-page="<%- i %>"></button><% } %> </div>
<div class="Widget-contentFlex"> <button class="u-rSpace--m Widget-buttonIcon js-searchToggle"> <i class="CDBIcon CDBIcon-Lens"></i> </button> <p class="Widget-textSmaller Widget-textSmaller--bold Widget-textSmall--upper"> <% if (isLocked) { %> search <% } else { %> <%- categoriesCount > 12 ? (categoriesCount - 11) : categoriesCount %> categor<%- categoriesCount !== 1 ? "ies" : "y" %> <%- categoriesCount > 12 ? "more" : "" %> <% } %> </p> </div> <div class="Widget-navDots js-dots"> <% for (var i = 0, l = pages; i < l; i++) { %><button class="Widget-dot Widget-dot--navigation js-page <% if (currentPage === i) { %>is-selected<% } %>" data-page="<%- i %>"></button><% } %> </div>
Add search text close to the lens icon when category widget is locked
Add search text close to the lens icon when category widget is locked
Smarty
bsd-3-clause
splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js,splashblot/cartodb.js
smarty
## Code Before: <div class="Widget-contentFlex"> <button class="u-rSpace--m Widget-buttonIcon js-searchToggle"> <i class="CDBIcon CDBIcon-Lens"></i> </button> <p class="Widget-textSmaller Widget-textSmaller--bold Widget-textSmall--upper"> <% if (!isLocked) { %> <%- categoriesCount > 12 ? (categoriesCount - 11) : categoriesCount %> categor<%- categoriesCount !== 1 ? "ies" : "y" %> <%- categoriesCount > 12 ? "more" : "" %> <% } %> </p> </div> <div class="Widget-navDots js-dots"> <% for (var i = 0, l = pages; i < l; i++) { %><button class="Widget-dot Widget-dot--navigation js-page <% if (currentPage === i) { %>is-selected<% } %>" data-page="<%- i %>"></button><% } %> </div> ## Instruction: Add search text close to the lens icon when category widget is locked ## Code After: <div class="Widget-contentFlex"> <button class="u-rSpace--m Widget-buttonIcon js-searchToggle"> <i class="CDBIcon CDBIcon-Lens"></i> </button> <p class="Widget-textSmaller Widget-textSmaller--bold Widget-textSmall--upper"> <% if (isLocked) { %> search <% } else { %> <%- categoriesCount > 12 ? (categoriesCount - 11) : categoriesCount %> categor<%- categoriesCount !== 1 ? "ies" : "y" %> <%- categoriesCount > 12 ? "more" : "" %> <% } %> </p> </div> <div class="Widget-navDots js-dots"> <% for (var i = 0, l = pages; i < l; i++) { %><button class="Widget-dot Widget-dot--navigation js-page <% if (currentPage === i) { %>is-selected<% } %>" data-page="<%- i %>"></button><% } %> </div>
<div class="Widget-contentFlex"> <button class="u-rSpace--m Widget-buttonIcon js-searchToggle"> <i class="CDBIcon CDBIcon-Lens"></i> </button> <p class="Widget-textSmaller Widget-textSmaller--bold Widget-textSmall--upper"> - <% if (!isLocked) { %> ? - + <% if (isLocked) { %> + search + <% } else { %> <%- categoriesCount > 12 ? (categoriesCount - 11) : categoriesCount %> categor<%- categoriesCount !== 1 ? "ies" : "y" %> <%- categoriesCount > 12 ? "more" : "" %> <% } %> </p> </div> <div class="Widget-navDots js-dots"> <% for (var i = 0, l = pages; i < l; i++) { %><button class="Widget-dot Widget-dot--navigation js-page <% if (currentPage === i) { %>is-selected<% } %>" data-page="<%- i %>"></button><% } %> </div>
4
0.307692
3
1
e7ebee397de5ff64d6741eac0d99404ffe53bbc4
data/transition-sites/ea.yml
data/transition-sites/ea.yml
--- site: ea whitehall_slug: environment-agency title: Environment Agency redirection_date: 8th April 2014 furl: www.gov.uk/environment-agency homepage: https://www.gov.uk/government/organisations/environment-agency tna_timestamp: 20131203145522 host: www.environment-agency.gov.uk aliases: - environment-agency.gov.uk - www2.environment-agency.gov.uk
--- site: ea whitehall_slug: environment-agency title: Environment Agency redirection_date: 8th April 2014 furl: www.gov.uk/environment-agency homepage: https://www.gov.uk/government/organisations/environment-agency tna_timestamp: 20131203145522 host: www.environment-agency.gov.uk aliases: - environment-agency.gov.uk - www2.environment-agency.gov.uk - www.lb.environment-agency.gov.uk
Configure additional alias for EA main domain
Configure additional alias for EA main domain
YAML
mit
alphagov/transition-config,alphagov/transition-config
yaml
## Code Before: --- site: ea whitehall_slug: environment-agency title: Environment Agency redirection_date: 8th April 2014 furl: www.gov.uk/environment-agency homepage: https://www.gov.uk/government/organisations/environment-agency tna_timestamp: 20131203145522 host: www.environment-agency.gov.uk aliases: - environment-agency.gov.uk - www2.environment-agency.gov.uk ## Instruction: Configure additional alias for EA main domain ## Code After: --- site: ea whitehall_slug: environment-agency title: Environment Agency redirection_date: 8th April 2014 furl: www.gov.uk/environment-agency homepage: https://www.gov.uk/government/organisations/environment-agency tna_timestamp: 20131203145522 host: www.environment-agency.gov.uk aliases: - environment-agency.gov.uk - www2.environment-agency.gov.uk - www.lb.environment-agency.gov.uk
--- site: ea whitehall_slug: environment-agency title: Environment Agency redirection_date: 8th April 2014 furl: www.gov.uk/environment-agency homepage: https://www.gov.uk/government/organisations/environment-agency tna_timestamp: 20131203145522 host: www.environment-agency.gov.uk aliases: - environment-agency.gov.uk - www2.environment-agency.gov.uk + - www.lb.environment-agency.gov.uk
1
0.083333
1
0
1c6e8571254fb53fc9a434acecf3274e430e5199
webapp-php/js/socorro/nav.js
webapp-php/js/socorro/nav.js
$(document).ready(function () { var url_base = $("#url_base").val(), url_site = $("#url_site").val(), product, product_version, report; $("#q").focus(function () { $(this).attr('value', ''); }); // Used to handle the selection of specific product. if ($("#products_select")) { $("#products_select").change(function () { product = $("#products_select").val(); window.location = url_site + 'products/' + product; }); } // Used to handle the selection of a specific version of a specific product. if ($("#product_version_select")) { $("#product_version_select").change(function () { product_version = $("#product_version_select").val(); if (product_version == 'Current Versions') { window.location = url_base; } else { window.location = url_base + '/versions/' + product_version; } }); } // Used to handle the selection of a specific report. if ($("#report_select")) { $("#report_select").change(function () { report = $("#report_select").val(); if (report !== 'More Reports') { window.location = report; } }); } });
$(document).ready(function () { var url_base = $("#url_base").val(), url_site = $("#url_site").val(), product, product_version, report; $("#q").focus(function () { $(this).attr('value', ''); }); // Used to handle the selection of specific product. if ($("#products_select")) { $("#products_select").change(function () { product = $("#products_select").val(); window.location = url_site + 'products/' + product; }); } // Used to handle the selection of a specific version of a specific product. if ($("#product_version_select")) { $("#product_version_select").change(function () { product_version = $("#product_version_select").val(); if (product_version == 'Current Versions') { window.location = url_base; } else { window.location = url_base + '/versions/' + product_version; } }); } // Used to handle the selection of a specific report. if ($("#report_select")) { $("#report_select").change(function () { report = $("#report_select").val(); // Handle top crasher selection. If no version was selected in the version drop-down // select the top most version and append to the URL. if(report.indexOf('topcrasher') !== -1) { var selectedVersion = $("#product_version_select").val(); if(selectedVersion === "Current Versions") { selectedVersion = $("#product_version_select").find("option:eq(1)").val(); window.location = report + selectedVersion; } else { window.location = report; } } else if (report !== 'More Reports') { window.location = report; } }); } });
Select top most version if non selected for top crashers
Select top most version if non selected for top crashers
JavaScript
mpl-2.0
Tchanders/socorro,Tchanders/socorro,adngdb/socorro,bsmedberg/socorro,cliqz/socorro,Tayamarn/socorro,twobraids/socorro,cliqz/socorro,lonnen/socorro,spthaolt/socorro,linearregression/socorro,yglazko/socorro,pcabido/socorro,bsmedberg/socorro,spthaolt/socorro,adngdb/socorro,rhelmer/socorro,Tchanders/socorro,adngdb/socorro,m8ttyB/socorro,yglazko/socorro,AdrianGaudebert/socorro,cliqz/socorro,yglazko/socorro,luser/socorro,pcabido/socorro,mozilla/socorro,Serg09/socorro,cliqz/socorro,mozilla/socorro,Tayamarn/socorro,KaiRo-at/socorro,spthaolt/socorro,m8ttyB/socorro,Tayamarn/socorro,mozilla/socorro,m8ttyB/socorro,Tchanders/socorro,Serg09/socorro,adngdb/socorro,luser/socorro,Serg09/socorro,Tchanders/socorro,KaiRo-at/socorro,KaiRo-at/socorro,cliqz/socorro,m8ttyB/socorro,Tayamarn/socorro,pcabido/socorro,mozilla/socorro,AdrianGaudebert/socorro,Serg09/socorro,AdrianGaudebert/socorro,AdrianGaudebert/socorro,Tchanders/socorro,bsmedberg/socorro,luser/socorro,spthaolt/socorro,linearregression/socorro,rhelmer/socorro,Tayamarn/socorro,pcabido/socorro,spthaolt/socorro,adngdb/socorro,bsmedberg/socorro,m8ttyB/socorro,lonnen/socorro,KaiRo-at/socorro,linearregression/socorro,adngdb/socorro,twobraids/socorro,Serg09/socorro,luser/socorro,linearregression/socorro,linearregression/socorro,AdrianGaudebert/socorro,luser/socorro,cliqz/socorro,AdrianGaudebert/socorro,lonnen/socorro,twobraids/socorro,yglazko/socorro,Serg09/socorro,Tayamarn/socorro,mozilla/socorro,yglazko/socorro,yglazko/socorro,rhelmer/socorro,rhelmer/socorro,rhelmer/socorro,twobraids/socorro,pcabido/socorro,twobraids/socorro,spthaolt/socorro,mozilla/socorro,twobraids/socorro,linearregression/socorro,KaiRo-at/socorro,lonnen/socorro,rhelmer/socorro,bsmedberg/socorro,luser/socorro,m8ttyB/socorro,pcabido/socorro,KaiRo-at/socorro
javascript
## Code Before: $(document).ready(function () { var url_base = $("#url_base").val(), url_site = $("#url_site").val(), product, product_version, report; $("#q").focus(function () { $(this).attr('value', ''); }); // Used to handle the selection of specific product. if ($("#products_select")) { $("#products_select").change(function () { product = $("#products_select").val(); window.location = url_site + 'products/' + product; }); } // Used to handle the selection of a specific version of a specific product. if ($("#product_version_select")) { $("#product_version_select").change(function () { product_version = $("#product_version_select").val(); if (product_version == 'Current Versions') { window.location = url_base; } else { window.location = url_base + '/versions/' + product_version; } }); } // Used to handle the selection of a specific report. if ($("#report_select")) { $("#report_select").change(function () { report = $("#report_select").val(); if (report !== 'More Reports') { window.location = report; } }); } }); ## Instruction: Select top most version if non selected for top crashers ## Code After: $(document).ready(function () { var url_base = $("#url_base").val(), url_site = $("#url_site").val(), product, product_version, report; $("#q").focus(function () { $(this).attr('value', ''); }); // Used to handle the selection of specific product. if ($("#products_select")) { $("#products_select").change(function () { product = $("#products_select").val(); window.location = url_site + 'products/' + product; }); } // Used to handle the selection of a specific version of a specific product. if ($("#product_version_select")) { $("#product_version_select").change(function () { product_version = $("#product_version_select").val(); if (product_version == 'Current Versions') { window.location = url_base; } else { window.location = url_base + '/versions/' + product_version; } }); } // Used to handle the selection of a specific report. if ($("#report_select")) { $("#report_select").change(function () { report = $("#report_select").val(); // Handle top crasher selection. If no version was selected in the version drop-down // select the top most version and append to the URL. if(report.indexOf('topcrasher') !== -1) { var selectedVersion = $("#product_version_select").val(); if(selectedVersion === "Current Versions") { selectedVersion = $("#product_version_select").find("option:eq(1)").val(); window.location = report + selectedVersion; } else { window.location = report; } } else if (report !== 'More Reports') { window.location = report; } }); } });
$(document).ready(function () { var url_base = $("#url_base").val(), url_site = $("#url_site").val(), product, product_version, report; $("#q").focus(function () { $(this).attr('value', ''); }); // Used to handle the selection of specific product. if ($("#products_select")) { $("#products_select").change(function () { product = $("#products_select").val(); window.location = url_site + 'products/' + product; }); } // Used to handle the selection of a specific version of a specific product. if ($("#product_version_select")) { $("#product_version_select").change(function () { product_version = $("#product_version_select").val(); if (product_version == 'Current Versions') { window.location = url_base; } else { window.location = url_base + '/versions/' + product_version; } }); } // Used to handle the selection of a specific report. if ($("#report_select")) { $("#report_select").change(function () { report = $("#report_select").val(); + + // Handle top crasher selection. If no version was selected in the version drop-down + // select the top most version and append to the URL. + if(report.indexOf('topcrasher') !== -1) { + var selectedVersion = $("#product_version_select").val(); + + if(selectedVersion === "Current Versions") { + selectedVersion = $("#product_version_select").find("option:eq(1)").val(); + window.location = report + selectedVersion; + } else { + window.location = report; + } - if (report !== 'More Reports') { + } else if (report !== 'More Reports') { ? +++++++ window.location = report; } }); } });
14
0.341463
13
1
4270a49c64a5538b0ac6b596fbc8da7b31af3040
app/controllers/concerns/exception_handler.rb
app/controllers/concerns/exception_handler.rb
module Concerns module ExceptionHandler extend ActiveSupport::Concern included do rescue_from ActionController::RoutingError, with: :render_404 rescue_from ActionController::UnknownController, with: :render_404 rescue_from ActiveRecord::RecordNotFound, with: :render_404 rescue_from Pundit::NotAuthorizedError, with: :deny_access rescue_from CanCan::Unauthorized, with: :deny_access end def deny_access(exception) session[:return_to] = request.env['REQUEST_URI'] # Clear the previous response body to avoid a DoubleRenderError # when redirecting or rendering another view self.response_body = nil if current_user.nil? redirect_to new_user_session_path, alert: I18n.t('devise.failure.unauthenticated') elsif request.env['HTTP_REFERER'] redirect_to :back, alert: I18n.t('controllers.unauthorized') else redirect_to root_path, alert: I18n.t('controllers.unauthorized') end end def render_404(exception) @not_found_path = exception.message respond_to do |format| format.html { render template: 'errors/not_found', status: 404 } format.all { render nothing: true, status: 404 } end end end end
module Concerns module ExceptionHandler extend ActiveSupport::Concern included do rescue_from ActionController::RoutingError, with: :render_404 rescue_from ActionController::UnknownController, with: :render_404 rescue_from ActiveRecord::RecordNotFound, with: :render_404 rescue_from Pundit::NotAuthorizedError, with: :deny_access rescue_from CanCan::Unauthorized, with: :deny_access end def deny_access(exception) session[:return_to] = request.env['REQUEST_URI'] # Clear the previous response body to avoid a DoubleRenderError # when redirecting or rendering another view self.response_body = nil if current_user.nil? redirect_to main_app.new_user_session_path, alert: I18n.t('devise.failure.unauthenticated') elsif request.env['HTTP_REFERER'] redirect_to :back, alert: I18n.t('controllers.unauthorized') else redirect_to main_app.root_path, alert: I18n.t('controllers.unauthorized') end end def render_404(exception) @not_found_path = exception.message respond_to do |format| format.html { render template: 'errors/not_found', status: 404 } format.all { render nothing: true, status: 404 } end end end end
Fix redirect when inside an engine
Fix redirect when inside an engine
Ruby
mit
jinutm/silveralms.com,MicroPasts/micropasts-crowdfunding,jinutm/silveralms.com,jinutm/silverpro,jinutm/silverme,gustavoguichard/neighborly,jinutm/silverpro,raksonibs/raimcrowd,jinutm/silverprod,MicroPasts/micropasts-crowdfunding,jinutm/silverme,jinutm/silverprod,MicroPasts/micropasts-crowdfunding,jinutm/silveralms.com,jinutm/silverprod,raksonibs/raimcrowd,jinutm/silverme,jinutm/silverpro,raksonibs/raimcrowd,raksonibs/raimcrowd,gustavoguichard/neighborly,MicroPasts/micropasts-crowdfunding,gustavoguichard/neighborly
ruby
## Code Before: module Concerns module ExceptionHandler extend ActiveSupport::Concern included do rescue_from ActionController::RoutingError, with: :render_404 rescue_from ActionController::UnknownController, with: :render_404 rescue_from ActiveRecord::RecordNotFound, with: :render_404 rescue_from Pundit::NotAuthorizedError, with: :deny_access rescue_from CanCan::Unauthorized, with: :deny_access end def deny_access(exception) session[:return_to] = request.env['REQUEST_URI'] # Clear the previous response body to avoid a DoubleRenderError # when redirecting or rendering another view self.response_body = nil if current_user.nil? redirect_to new_user_session_path, alert: I18n.t('devise.failure.unauthenticated') elsif request.env['HTTP_REFERER'] redirect_to :back, alert: I18n.t('controllers.unauthorized') else redirect_to root_path, alert: I18n.t('controllers.unauthorized') end end def render_404(exception) @not_found_path = exception.message respond_to do |format| format.html { render template: 'errors/not_found', status: 404 } format.all { render nothing: true, status: 404 } end end end end ## Instruction: Fix redirect when inside an engine ## Code After: module Concerns module ExceptionHandler extend ActiveSupport::Concern included do rescue_from ActionController::RoutingError, with: :render_404 rescue_from ActionController::UnknownController, with: :render_404 rescue_from ActiveRecord::RecordNotFound, with: :render_404 rescue_from Pundit::NotAuthorizedError, with: :deny_access rescue_from CanCan::Unauthorized, with: :deny_access end def deny_access(exception) session[:return_to] = request.env['REQUEST_URI'] # Clear the previous response body to avoid a DoubleRenderError # when redirecting or rendering another view self.response_body = nil if current_user.nil? redirect_to main_app.new_user_session_path, alert: I18n.t('devise.failure.unauthenticated') elsif request.env['HTTP_REFERER'] redirect_to :back, alert: I18n.t('controllers.unauthorized') else redirect_to main_app.root_path, alert: I18n.t('controllers.unauthorized') end end def render_404(exception) @not_found_path = exception.message respond_to do |format| format.html { render template: 'errors/not_found', status: 404 } format.all { render nothing: true, status: 404 } end end end end
module Concerns module ExceptionHandler extend ActiveSupport::Concern included do rescue_from ActionController::RoutingError, with: :render_404 rescue_from ActionController::UnknownController, with: :render_404 rescue_from ActiveRecord::RecordNotFound, with: :render_404 rescue_from Pundit::NotAuthorizedError, with: :deny_access rescue_from CanCan::Unauthorized, with: :deny_access end def deny_access(exception) session[:return_to] = request.env['REQUEST_URI'] # Clear the previous response body to avoid a DoubleRenderError # when redirecting or rendering another view self.response_body = nil if current_user.nil? - redirect_to new_user_session_path, alert: I18n.t('devise.failure.unauthenticated') + redirect_to main_app.new_user_session_path, alert: I18n.t('devise.failure.unauthenticated') ? +++++++++ elsif request.env['HTTP_REFERER'] redirect_to :back, alert: I18n.t('controllers.unauthorized') else - redirect_to root_path, alert: I18n.t('controllers.unauthorized') + redirect_to main_app.root_path, alert: I18n.t('controllers.unauthorized') ? +++++++++ end end def render_404(exception) @not_found_path = exception.message respond_to do |format| format.html { render template: 'errors/not_found', status: 404 } format.all { render nothing: true, status: 404 } end end end end
4
0.102564
2
2
ba26418f5e16771681129a28c9308af9b10e8de6
src/profiling.md
src/profiling.md
This discussion talks about how profile the compiler and find out where it spends its time. If you just want to get a general overview, it is often a good idea to just add `-Zself-profile` option to the rustc command line. This will break down time spent into various categories. But if you want a more detailed look, you probably want to break out a custom profiler.
This section talks about how to profile the compiler and find out where it spends its time. Depending on what you're trying to measure, there are several different approaches: - If you want to see if a PR improves or regresses compiler performance: - The [rustc-perf](https://github.com/rust-lang-nursery/rustc-perf) project makes this easy and can be triggered to run on a PR via the `@rustc-perf` bot. - If you want a medium-to-high level overview of where `rustc` is spending its time: - The `-Zself-profile` flag and [measureme](https://github.com/rust-lang/measureme) tools offer a query-based approach to profiling. See [their docs](https://github.com/rust-lang/measureme/blob/master/summarize/Readme.md) for more information. - If you want function level performance data or even just more details than the above approaches: - Consider using a native code profiler such as [perf](profiling/with_perf.html).
Improve "Profiling the compiler" docs
Improve "Profiling the compiler" docs Add mentions and links to `rustc-perf` and `measureme`.
Markdown
apache-2.0
rust-lang/rustc-dev-guide,rust-lang/rustc-dev-guide,rust-lang/rustc-dev-guide,rust-lang/rustc-dev-guide
markdown
## Code Before: This discussion talks about how profile the compiler and find out where it spends its time. If you just want to get a general overview, it is often a good idea to just add `-Zself-profile` option to the rustc command line. This will break down time spent into various categories. But if you want a more detailed look, you probably want to break out a custom profiler. ## Instruction: Improve "Profiling the compiler" docs Add mentions and links to `rustc-perf` and `measureme`. ## Code After: This section talks about how to profile the compiler and find out where it spends its time. Depending on what you're trying to measure, there are several different approaches: - If you want to see if a PR improves or regresses compiler performance: - The [rustc-perf](https://github.com/rust-lang-nursery/rustc-perf) project makes this easy and can be triggered to run on a PR via the `@rustc-perf` bot. - If you want a medium-to-high level overview of where `rustc` is spending its time: - The `-Zself-profile` flag and [measureme](https://github.com/rust-lang/measureme) tools offer a query-based approach to profiling. See [their docs](https://github.com/rust-lang/measureme/blob/master/summarize/Readme.md) for more information. - If you want function level performance data or even just more details than the above approaches: - Consider using a native code profiler such as [perf](profiling/with_perf.html).
- This discussion talks about how profile the compiler and find out ? -- ^^^ + This section talks about how to profile the compiler and find out where it spends its time. ? + ^ +++ ++++++++++++++++++++++++++++ - where it spends its time. If you just want to get a general overview, - it is often a good idea to just add `-Zself-profile` option to the - rustc command line. This will break down time spent into various - categories. But if you want a more detailed look, you probably want - to break out a custom profiler. + Depending on what you're trying to measure, there are several different approaches: + + - If you want to see if a PR improves or regresses compiler performance: + - The [rustc-perf](https://github.com/rust-lang-nursery/rustc-perf) project makes this easy and can be triggered to run on a PR via the `@rustc-perf` bot. + + - If you want a medium-to-high level overview of where `rustc` is spending its time: + - The `-Zself-profile` flag and [measureme](https://github.com/rust-lang/measureme) tools offer a query-based approach to profiling. + See [their docs](https://github.com/rust-lang/measureme/blob/master/summarize/Readme.md) for more information. + + - If you want function level performance data or even just more details than the above approaches: + - Consider using a native code profiler such as [perf](profiling/with_perf.html). +
19
2.375
13
6
ca03a5985f6b089139e85a1c8ad36849be9f5ef7
protocol/Greenstack/payload/CMakeLists.txt
protocol/Greenstack/payload/CMakeLists.txt
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload) macro(Flatbuffers) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h COMMAND ${FLATC} -c -o ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs COMMENT "Generating code for ${ARGV0}") list(APPEND FLATBUFFER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h") endmacro(Flatbuffers) Flatbuffers(AssumeRoleRequest) Flatbuffers(CreateBucketRequest) Flatbuffers(DeleteBucketRequest) Flatbuffers(Document) FlatBuffers(GetRequest) FlatBuffers(GetResponse) Flatbuffers(HelloRequest) Flatbuffers(HelloResponse) FlatBuffers(KeepaliveRequest) Flatbuffers(ListBucketsResponse) Flatbuffers(MutationRequest) Flatbuffers(MutationResponse) Flatbuffers(SaslAuthRequest) Flatbuffers(SaslAuthResponse) Flatbuffers(SelectBucketRequest) add_custom_target(generate_flatbuffer_headers ALL DEPENDS ${FLATBUFFER_SOURCES})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload) macro(Flatbuffers) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h COMMAND ${FLATC} -c -o ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs ${FLATC} COMMENT "Generating code for ${ARGV0}") list(APPEND FLATBUFFER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h") endmacro(Flatbuffers) Flatbuffers(AssumeRoleRequest) Flatbuffers(CreateBucketRequest) Flatbuffers(DeleteBucketRequest) Flatbuffers(Document) FlatBuffers(GetRequest) FlatBuffers(GetResponse) Flatbuffers(HelloRequest) Flatbuffers(HelloResponse) FlatBuffers(KeepaliveRequest) Flatbuffers(ListBucketsResponse) Flatbuffers(MutationRequest) Flatbuffers(MutationResponse) Flatbuffers(SaslAuthRequest) Flatbuffers(SaslAuthResponse) Flatbuffers(SelectBucketRequest) add_custom_target(generate_flatbuffer_headers ALL DEPENDS ${FLATBUFFER_SOURCES})
Add dep to flatc for the generated flatbuffer files
CBD-1942: Add dep to flatc for the generated flatbuffer files The source generated by one version of flatbuffers may not compile with the header files from another version of flatbuffers so they should be regenerated when we upgrade flatbuffers. Change-Id: I269f18245ee8824dea1749f8b7711f619143207e Reviewed-on: http://review.couchbase.org/71399 Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com> Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
Text
bsd-3-clause
daverigby/memcached,daverigby/kv_engine,couchbase/memcached,daverigby/kv_engine,daverigby/kv_engine,couchbase/memcached,couchbase/memcached,daverigby/memcached,daverigby/kv_engine,couchbase/memcached,daverigby/memcached,daverigby/memcached
text
## Code Before: file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload) macro(Flatbuffers) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h COMMAND ${FLATC} -c -o ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs COMMENT "Generating code for ${ARGV0}") list(APPEND FLATBUFFER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h") endmacro(Flatbuffers) Flatbuffers(AssumeRoleRequest) Flatbuffers(CreateBucketRequest) Flatbuffers(DeleteBucketRequest) Flatbuffers(Document) FlatBuffers(GetRequest) FlatBuffers(GetResponse) Flatbuffers(HelloRequest) Flatbuffers(HelloResponse) FlatBuffers(KeepaliveRequest) Flatbuffers(ListBucketsResponse) Flatbuffers(MutationRequest) Flatbuffers(MutationResponse) Flatbuffers(SaslAuthRequest) Flatbuffers(SaslAuthResponse) Flatbuffers(SelectBucketRequest) add_custom_target(generate_flatbuffer_headers ALL DEPENDS ${FLATBUFFER_SOURCES}) ## Instruction: CBD-1942: Add dep to flatc for the generated flatbuffer files The source generated by one version of flatbuffers may not compile with the header files from another version of flatbuffers so they should be regenerated when we upgrade flatbuffers. Change-Id: I269f18245ee8824dea1749f8b7711f619143207e Reviewed-on: http://review.couchbase.org/71399 Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com> Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com> ## Code After: file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload) macro(Flatbuffers) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h COMMAND ${FLATC} -c -o ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs ${FLATC} COMMENT "Generating code for ${ARGV0}") list(APPEND FLATBUFFER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h") endmacro(Flatbuffers) Flatbuffers(AssumeRoleRequest) Flatbuffers(CreateBucketRequest) Flatbuffers(DeleteBucketRequest) Flatbuffers(Document) FlatBuffers(GetRequest) FlatBuffers(GetResponse) Flatbuffers(HelloRequest) Flatbuffers(HelloResponse) FlatBuffers(KeepaliveRequest) Flatbuffers(ListBucketsResponse) Flatbuffers(MutationRequest) Flatbuffers(MutationResponse) Flatbuffers(SaslAuthRequest) Flatbuffers(SaslAuthResponse) Flatbuffers(SelectBucketRequest) add_custom_target(generate_flatbuffer_headers ALL DEPENDS ${FLATBUFFER_SOURCES})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload) macro(Flatbuffers) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h COMMAND ${FLATC} -c -o ${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.fbs + ${FLATC} COMMENT "Generating code for ${ARGV0}") list(APPEND FLATBUFFER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/Greenstack/payload/${ARGV0}_generated.h") endmacro(Flatbuffers) Flatbuffers(AssumeRoleRequest) Flatbuffers(CreateBucketRequest) Flatbuffers(DeleteBucketRequest) Flatbuffers(Document) FlatBuffers(GetRequest) FlatBuffers(GetResponse) Flatbuffers(HelloRequest) Flatbuffers(HelloResponse) FlatBuffers(KeepaliveRequest) Flatbuffers(ListBucketsResponse) Flatbuffers(MutationRequest) Flatbuffers(MutationResponse) Flatbuffers(SaslAuthRequest) Flatbuffers(SaslAuthResponse) Flatbuffers(SelectBucketRequest) add_custom_target(generate_flatbuffer_headers ALL DEPENDS ${FLATBUFFER_SOURCES})
1
0.030303
1
0
8f9615ebd7ae4802b1e44d6b8243aafb785a7fa3
pamqp/__init__.py
pamqp/__init__.py
"""AMQP Specifications and Classes""" __author__ = 'Gavin M. Roy' __email__ = 'gavinmroy@gmail.com' __since__ = '2011-09-23' __version__ '1.0.1' from header import ProtocolHeader from header import ContentHeader import body import codec import frame import specification
"""AMQP Specifications and Classes""" __author__ = 'Gavin M. Roy' __email__ = 'gavinmroy@gmail.com' __since__ = '2011-09-23' __version__ = '1.0.1' from pamqp.header import ProtocolHeader from pamqp.header import ContentHeader from pamqp import body from pamqp import codec from pamqp import frame from pamqp import specification
Use absolute imports and fix the version string
Use absolute imports and fix the version string
Python
bsd-3-clause
gmr/pamqp
python
## Code Before: """AMQP Specifications and Classes""" __author__ = 'Gavin M. Roy' __email__ = 'gavinmroy@gmail.com' __since__ = '2011-09-23' __version__ '1.0.1' from header import ProtocolHeader from header import ContentHeader import body import codec import frame import specification ## Instruction: Use absolute imports and fix the version string ## Code After: """AMQP Specifications and Classes""" __author__ = 'Gavin M. Roy' __email__ = 'gavinmroy@gmail.com' __since__ = '2011-09-23' __version__ = '1.0.1' from pamqp.header import ProtocolHeader from pamqp.header import ContentHeader from pamqp import body from pamqp import codec from pamqp import frame from pamqp import specification
"""AMQP Specifications and Classes""" __author__ = 'Gavin M. Roy' __email__ = 'gavinmroy@gmail.com' __since__ = '2011-09-23' - __version__ '1.0.1' + __version__ = '1.0.1' ? ++ - from header import ProtocolHeader + from pamqp.header import ProtocolHeader ? ++++++ - from header import ContentHeader + from pamqp.header import ContentHeader ? ++++++ - import body - import codec - import frame + from pamqp import body + from pamqp import codec + from pamqp import frame - import specification + from pamqp import specification ? +++++++++++
14
1
7
7
1f915924a5508b005d8359c8ba0d1508468df99e
_includes/components/nav-menu.html
_includes/components/nav-menu.html
<div class="top-bar-container" data-sticky-container> <div class="sticky sticky-topbar" data-sticky data-options="anchor: page; marginTop: 0; stickyOn: small;"> <nav class="top-bar topbar-responsive"> <div class="top-bar-title"> <span data-responsive-toggle="topbar-responsive" data-hide-for="medium"> <button class="menu-icon" type="button" data-toggle></button> </span> <a class="topbar-responsive-logo" href="/"> <img src="/assets/img/fibernet-logotype.png" alt="{{ site.title }}" > </a> </div> <div id="topbar-responsive" class="topbar-responsive-links"> <div class="top-bar-left"> <ul class="menu simple vertical medium-horizontal"> {% for item in site.data.nav-main %} <li><a href="{{ item.url }}">{{ item.link }}</a></li> {% endfor %} <li> <a href="#" class="button hollow topbar-responsive-button">شارژ سریع</a> </li> </ul> </div> </div> </nav> </div> </div>
<div class="top-bar-container" data-sticky-container> <div class="sticky sticky-topbar" data-sticky data-options="anchor: page; marginTop: 0; stickyOn: small;"> <nav class="top-bar topbar-responsive"> <div class="top-bar-title"> <span data-responsive-toggle="topbar-responsive" data-hide-for="medium"> <button class="menu-icon" type="button" data-toggle></button> </span> <a class="topbar-responsive-logo" href="/"> <img src="/assets/img/fibernet-logotype.png" alt="{{ site.title }}" > </a> </div> <div id="topbar-responsive" class="topbar-responsive-links"> <div class="top-bar-left"> <ul class="menu simple vertical medium-horizontal"> {% for item in site.data.nav-main %} <li><a href="{{ item.url }}">{{ item.link }}</a></li> {% endfor %} <li> <a href="/fast-charge" class="button hollow topbar-responsive-button">شارژ سریع</a> </li> </ul> </div> </div> </nav> </div> </div>
Add fast-charge url to main menu
Add fast-charge url to main menu
HTML
mit
parsfibernet/fibernet-ir-official,parsfibernet/fibernet-ir-official,parsfibernet/fibernet-ir-official
html
## Code Before: <div class="top-bar-container" data-sticky-container> <div class="sticky sticky-topbar" data-sticky data-options="anchor: page; marginTop: 0; stickyOn: small;"> <nav class="top-bar topbar-responsive"> <div class="top-bar-title"> <span data-responsive-toggle="topbar-responsive" data-hide-for="medium"> <button class="menu-icon" type="button" data-toggle></button> </span> <a class="topbar-responsive-logo" href="/"> <img src="/assets/img/fibernet-logotype.png" alt="{{ site.title }}" > </a> </div> <div id="topbar-responsive" class="topbar-responsive-links"> <div class="top-bar-left"> <ul class="menu simple vertical medium-horizontal"> {% for item in site.data.nav-main %} <li><a href="{{ item.url }}">{{ item.link }}</a></li> {% endfor %} <li> <a href="#" class="button hollow topbar-responsive-button">شارژ سریع</a> </li> </ul> </div> </div> </nav> </div> </div> ## Instruction: Add fast-charge url to main menu ## Code After: <div class="top-bar-container" data-sticky-container> <div class="sticky sticky-topbar" data-sticky data-options="anchor: page; marginTop: 0; stickyOn: small;"> <nav class="top-bar topbar-responsive"> <div class="top-bar-title"> <span data-responsive-toggle="topbar-responsive" data-hide-for="medium"> <button class="menu-icon" type="button" data-toggle></button> </span> <a class="topbar-responsive-logo" href="/"> <img src="/assets/img/fibernet-logotype.png" alt="{{ site.title }}" > </a> </div> <div id="topbar-responsive" class="topbar-responsive-links"> <div class="top-bar-left"> <ul class="menu simple vertical medium-horizontal"> {% for item in site.data.nav-main %} <li><a href="{{ item.url }}">{{ item.link }}</a></li> {% endfor %} <li> <a href="/fast-charge" class="button hollow topbar-responsive-button">شارژ سریع</a> </li> </ul> </div> </div> </nav> </div> </div>
<div class="top-bar-container" data-sticky-container> <div class="sticky sticky-topbar" data-sticky data-options="anchor: page; marginTop: 0; stickyOn: small;"> <nav class="top-bar topbar-responsive"> <div class="top-bar-title"> <span data-responsive-toggle="topbar-responsive" data-hide-for="medium"> <button class="menu-icon" type="button" data-toggle></button> </span> <a class="topbar-responsive-logo" href="/"> <img src="/assets/img/fibernet-logotype.png" alt="{{ site.title }}" > </a> </div> <div id="topbar-responsive" class="topbar-responsive-links"> <div class="top-bar-left"> <ul class="menu simple vertical medium-horizontal"> {% for item in site.data.nav-main %} <li><a href="{{ item.url }}">{{ item.link }}</a></li> {% endfor %} <li> - <a href="#" class="button hollow topbar-responsive-button">شارژ سریع</a> ? ^ + <a href="/fast-charge" class="button hollow topbar-responsive-button">شارژ سریع</a> ? ^^^^^^^^^^^^ </li> </ul> </div> </div> </nav> </div> </div>
2
0.076923
1
1
41caee25e5dbc65640cfbacb44752cbfc39c4f25
clean.sh
clean.sh
set -eux set -o pipefail if [ ! -f /.dockerenv ]; then echo "This should be run within the container"; exit 0; fi # We want the root user to have the same keys as us. if [ ! -f ~/.ssh/id_rsa ]; then ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''; fi sudo rm -rf /root/.ssh; sudo cp -r ~/.ssh/ /root/.ssh && sudo chown -R root /root/.ssh; dt="$(date "+%Y-%m-%d_%H-%M_%s")"; rm -rf ~/tripleo-quickstart; rm -rf ~/.quickstart ; git clone https://github.com/openstack/tripleo-quickstart.git ~/tripleo-quickstart; unbuffer bash ~/tripleo-quickstart/quickstart.sh --install-deps 2>&1 | tee -a logs/$dt.install.log;
set -eux set -o pipefail if [ ! -f /.dockerenv ]; then echo "This should be run within the container"; exit 0; fi sudo yum -y update; rm -rf ~/tripleo-quickstart; rm -rf ~/.quickstart ; rm -rf ~/.ansible rm -rf ~/.ara rm -rf ~/.novaclient rm -rf ~/.pki # We want the root user to have the same keys as us. if [ ! -f ~/.ssh/id_rsa ]; then ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''; fi sudo rm -rf /root/.ssh; sudo cp -r ~/.ssh/ /root/.ssh && sudo chown -R root /root/.ssh; dt="$(date "+%Y-%m-%d_%H-%M_%s")"; git clone https://github.com/openstack/tripleo-quickstart.git ~/tripleo-quickstart; unbuffer bash ~/tripleo-quickstart/quickstart.sh --install-deps 2>&1 | tee -a logs/$dt.install.log;
Delete more of the temp created stuff
Delete more of the temp created stuff
Shell
bsd-2-clause
d0ugal/tripleo-util,d0ugal/tripleo-util
shell
## Code Before: set -eux set -o pipefail if [ ! -f /.dockerenv ]; then echo "This should be run within the container"; exit 0; fi # We want the root user to have the same keys as us. if [ ! -f ~/.ssh/id_rsa ]; then ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''; fi sudo rm -rf /root/.ssh; sudo cp -r ~/.ssh/ /root/.ssh && sudo chown -R root /root/.ssh; dt="$(date "+%Y-%m-%d_%H-%M_%s")"; rm -rf ~/tripleo-quickstart; rm -rf ~/.quickstart ; git clone https://github.com/openstack/tripleo-quickstart.git ~/tripleo-quickstart; unbuffer bash ~/tripleo-quickstart/quickstart.sh --install-deps 2>&1 | tee -a logs/$dt.install.log; ## Instruction: Delete more of the temp created stuff ## Code After: set -eux set -o pipefail if [ ! -f /.dockerenv ]; then echo "This should be run within the container"; exit 0; fi sudo yum -y update; rm -rf ~/tripleo-quickstart; rm -rf ~/.quickstart ; rm -rf ~/.ansible rm -rf ~/.ara rm -rf ~/.novaclient rm -rf ~/.pki # We want the root user to have the same keys as us. if [ ! -f ~/.ssh/id_rsa ]; then ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''; fi sudo rm -rf /root/.ssh; sudo cp -r ~/.ssh/ /root/.ssh && sudo chown -R root /root/.ssh; dt="$(date "+%Y-%m-%d_%H-%M_%s")"; git clone https://github.com/openstack/tripleo-quickstart.git ~/tripleo-quickstart; unbuffer bash ~/tripleo-quickstart/quickstart.sh --install-deps 2>&1 | tee -a logs/$dt.install.log;
set -eux set -o pipefail if [ ! -f /.dockerenv ]; then echo "This should be run within the container"; exit 0; fi + + sudo yum -y update; + + rm -rf ~/tripleo-quickstart; + rm -rf ~/.quickstart ; + rm -rf ~/.ansible + rm -rf ~/.ara + rm -rf ~/.novaclient + rm -rf ~/.pki # We want the root user to have the same keys as us. if [ ! -f ~/.ssh/id_rsa ]; then ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''; fi sudo rm -rf /root/.ssh; sudo cp -r ~/.ssh/ /root/.ssh && sudo chown -R root /root/.ssh; dt="$(date "+%Y-%m-%d_%H-%M_%s")"; - rm -rf ~/tripleo-quickstart; - rm -rf ~/.quickstart ; - git clone https://github.com/openstack/tripleo-quickstart.git ~/tripleo-quickstart; unbuffer bash ~/tripleo-quickstart/quickstart.sh --install-deps 2>&1 | tee -a logs/$dt.install.log;
12
0.521739
9
3
19490b99cc6e555e1aa3d680749935ef924c72b4
packages/de/describe.yaml
packages/de/describe.yaml
homepage: https://github.com/riugabachi/describe changelog-type: markdown hash: 7f5a96f5fbd6ad724601ceb4556a3483113b79cd8e2776e977b11bc2ab14c261 test-bench-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 describe: -any QuickCheck: -any maintainer: n/a synopsis: Combinators for describing binary data structures changelog: | # Revision history for describe ## 0.1.0.0 -- 2019-06-03 * Initial release. basic-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 all-versions: - 0.1.0.0 author: Riuga latest: 0.1.0.0 description-type: haddock description: Combinators for describing binary data structures, which eliminate the boilerplate of having to write isomorphic Get and Put instances. Please see the Github page for examples. license-name: BSD-3-Clause
homepage: https://github.com/riugabachi/describe changelog-type: markdown hash: 5ab8be078d533709289a168efd64efab9d8d90068836de4ac0fe4da197c046e8 test-bench-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 describe: -any QuickCheck: -any maintainer: n/a synopsis: Combinators for describing binary data structures changelog: | # Revision history for describe ## 0.1.1.0 -- 2019-09-05 * Added Monad instance for Descriptor ## 0.1.0.0 -- 2019-06-03 * Initial release. basic-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 all-versions: - 0.1.0.0 - 0.1.1.0 author: Riuga latest: 0.1.1.0 description-type: haddock description: Combinators for describing binary data structures, which eliminate the boilerplate of having to write isomorphic Get and Put instances. Please see the Github page for examples. license-name: BSD-3-Clause
Update from Hackage at 2019-09-05T15:07:04Z
Update from Hackage at 2019-09-05T15:07:04Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/riugabachi/describe changelog-type: markdown hash: 7f5a96f5fbd6ad724601ceb4556a3483113b79cd8e2776e977b11bc2ab14c261 test-bench-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 describe: -any QuickCheck: -any maintainer: n/a synopsis: Combinators for describing binary data structures changelog: | # Revision history for describe ## 0.1.0.0 -- 2019-06-03 * Initial release. basic-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 all-versions: - 0.1.0.0 author: Riuga latest: 0.1.0.0 description-type: haddock description: Combinators for describing binary data structures, which eliminate the boilerplate of having to write isomorphic Get and Put instances. Please see the Github page for examples. license-name: BSD-3-Clause ## Instruction: Update from Hackage at 2019-09-05T15:07:04Z ## Code After: homepage: https://github.com/riugabachi/describe changelog-type: markdown hash: 5ab8be078d533709289a168efd64efab9d8d90068836de4ac0fe4da197c046e8 test-bench-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 describe: -any QuickCheck: -any maintainer: n/a synopsis: Combinators for describing binary data structures changelog: | # Revision history for describe ## 0.1.1.0 -- 2019-09-05 * Added Monad instance for Descriptor ## 0.1.0.0 -- 2019-06-03 * Initial release. basic-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 all-versions: - 0.1.0.0 - 0.1.1.0 author: Riuga latest: 0.1.1.0 description-type: haddock description: Combinators for describing binary data structures, which eliminate the boilerplate of having to write isomorphic Get and Put instances. Please see the Github page for examples. license-name: BSD-3-Clause
homepage: https://github.com/riugabachi/describe changelog-type: markdown - hash: 7f5a96f5fbd6ad724601ceb4556a3483113b79cd8e2776e977b11bc2ab14c261 + hash: 5ab8be078d533709289a168efd64efab9d8d90068836de4ac0fe4da197c046e8 test-bench-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 describe: -any QuickCheck: -any maintainer: n/a synopsis: Combinators for describing binary data structures changelog: | # Revision history for describe + ## 0.1.1.0 -- 2019-09-05 + + * Added Monad instance for Descriptor + ## 0.1.0.0 -- 2019-06-03 * Initial release. basic-deps: cereal: ! '>=0.5.8 && <0.6' bytestring: ! '>=0.10.8 && <0.11' base: ^>=4.12.0.0 all-versions: - 0.1.0.0 + - 0.1.1.0 author: Riuga - latest: 0.1.0.0 ? ^ + latest: 0.1.1.0 ? ^ description-type: haddock description: Combinators for describing binary data structures, which eliminate the boilerplate of having to write isomorphic Get and Put instances. Please see the Github page for examples. license-name: BSD-3-Clause
9
0.3
7
2
afaee01ed395f254c2a64d00dbc32d4dba808145
pkgs/development/python-modules/pycairo/default.nix
pkgs/development/python-modules/pycairo/default.nix
{ stdenv, fetchurl, python, pkgconfig, cairo, x11 }: stdenv.mkDerivation { name = "pycairo-1.8.8"; src = fetchurl { url = http://cairographics.org/releases/pycairo-1.8.8.tar.gz; sha256 = "0q18hd4ai4raljlvd76ylgi30kxpr2qq83ka6gzwh0ya8fcmjlig"; }; buildInputs = [ python pkgconfig cairo x11 ]; }
{ stdenv, fetchurl, python, pkgconfig, cairo, x11 }: stdenv.mkDerivation rec { version = "1.10.0"; name = "pycairo-${version}"; src = if python.is_py3k or false then fetchurl { url = "http://cairographics.org/releases/pycairo-${version}.tar.bz2"; sha256 = "1gjkf8x6hyx1skq3hhwcbvwifxvrf9qxis5vx8x5igmmgs70g94s"; } else fetchurl { url = "http://cairographics.org/releases/py2cairo-${version}.tar.bz2"; sha256 = "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k"; }; buildInputs = [ python pkgconfig cairo x11 ]; preConfigure = '' sed -e 's@#!/usr/bin/env python@#!${python.executable}@' -i waf head waf ''; configurePhase = "${python.executable} waf configure --prefix=$out"; buildPhase = "${python.executable} waf"; installPhase = "${python.executable} waf install"; }
Update to 1.10.0 and support both python 2 and python 3
pycairo: Update to 1.10.0 and support both python 2 and python 3 Close #1802.
Nix
mit
NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs
nix
## Code Before: { stdenv, fetchurl, python, pkgconfig, cairo, x11 }: stdenv.mkDerivation { name = "pycairo-1.8.8"; src = fetchurl { url = http://cairographics.org/releases/pycairo-1.8.8.tar.gz; sha256 = "0q18hd4ai4raljlvd76ylgi30kxpr2qq83ka6gzwh0ya8fcmjlig"; }; buildInputs = [ python pkgconfig cairo x11 ]; } ## Instruction: pycairo: Update to 1.10.0 and support both python 2 and python 3 Close #1802. ## Code After: { stdenv, fetchurl, python, pkgconfig, cairo, x11 }: stdenv.mkDerivation rec { version = "1.10.0"; name = "pycairo-${version}"; src = if python.is_py3k or false then fetchurl { url = "http://cairographics.org/releases/pycairo-${version}.tar.bz2"; sha256 = "1gjkf8x6hyx1skq3hhwcbvwifxvrf9qxis5vx8x5igmmgs70g94s"; } else fetchurl { url = "http://cairographics.org/releases/py2cairo-${version}.tar.bz2"; sha256 = "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k"; }; buildInputs = [ python pkgconfig cairo x11 ]; preConfigure = '' sed -e 's@#!/usr/bin/env python@#!${python.executable}@' -i waf head waf ''; configurePhase = "${python.executable} waf configure --prefix=$out"; buildPhase = "${python.executable} waf"; installPhase = "${python.executable} waf install"; }
{ stdenv, fetchurl, python, pkgconfig, cairo, x11 }: - stdenv.mkDerivation { + stdenv.mkDerivation rec { ? ++++ - name = "pycairo-1.8.8"; + version = "1.10.0"; + name = "pycairo-${version}"; + src = if python.is_py3k or false - src = fetchurl { ? --- ^ + then fetchurl { ? ^^^^^ - url = http://cairographics.org/releases/pycairo-1.8.8.tar.gz; ? ^^^^^ ^ + url = "http://cairographics.org/releases/pycairo-${version}.tar.bz2"; ? ++ + ^^^^^^^^^^ ^ ++ - sha256 = "0q18hd4ai4raljlvd76ylgi30kxpr2qq83ka6gzwh0ya8fcmjlig"; + sha256 = "1gjkf8x6hyx1skq3hhwcbvwifxvrf9qxis5vx8x5igmmgs70g94s"; + } + else fetchurl { + url = "http://cairographics.org/releases/py2cairo-${version}.tar.bz2"; + sha256 = "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k"; - }; + }; ? ++ buildInputs = [ python pkgconfig cairo x11 ]; + preConfigure = '' + sed -e 's@#!/usr/bin/env python@#!${python.executable}@' -i waf + head waf + ''; + configurePhase = "${python.executable} waf configure --prefix=$out"; + buildPhase = "${python.executable} waf"; + installPhase = "${python.executable} waf install"; }
25
2.272727
19
6
d71ce0031985a876b6908a984747c5d55aece8be
deploy.sh
deploy.sh
git checkout master cd htck npm cache clean npm install bower install grunt build ls cd .. ls htck git branch -D gh-pages cp -R htck/dist/ /tmp/ ls /tmp git checkout --orphan gh-pages # Remove all git tracked files (keeps libs and node_modules) git ls-files -z | xargs -0 rm -f rm .gitignore mv /tmp/dist/* . ls git add content/ images/ index.html scripts/ styles/ views/ git commit -am "Deploying to gh-pages" git push --delete origin gh-pages git push --set-upstream origin gh-pages git checkout master
branch=${1:-"master"} echo "Deploying $branch to gh-pages" git checkout master cd htck npm cache clean npm install bower install grunt build ls cd .. ls htck git branch -D gh-pages cp -R htck/dist/ /tmp/ ls /tmp git checkout --orphan gh-pages # Remove all git tracked files (keeps libs and node_modules) git ls-files -z | xargs -0 rm -f rm .gitignore mv /tmp/dist/* . ls git add content/ images/ index.html scripts/ styles/ views/ git commit -am "Deploying $branch to gh-pages" git push --delete origin gh-pages git push --set-upstream origin gh-pages git checkout master
Deploy a specific branch to gh-pages
Deploy a specific branch to gh-pages
Shell
mit
htck/bayeux,mthoretton/htck,mthoretton/htck,mthoretton/htck,htck/bayeux,htck/bayeux
shell
## Code Before: git checkout master cd htck npm cache clean npm install bower install grunt build ls cd .. ls htck git branch -D gh-pages cp -R htck/dist/ /tmp/ ls /tmp git checkout --orphan gh-pages # Remove all git tracked files (keeps libs and node_modules) git ls-files -z | xargs -0 rm -f rm .gitignore mv /tmp/dist/* . ls git add content/ images/ index.html scripts/ styles/ views/ git commit -am "Deploying to gh-pages" git push --delete origin gh-pages git push --set-upstream origin gh-pages git checkout master ## Instruction: Deploy a specific branch to gh-pages ## Code After: branch=${1:-"master"} echo "Deploying $branch to gh-pages" git checkout master cd htck npm cache clean npm install bower install grunt build ls cd .. ls htck git branch -D gh-pages cp -R htck/dist/ /tmp/ ls /tmp git checkout --orphan gh-pages # Remove all git tracked files (keeps libs and node_modules) git ls-files -z | xargs -0 rm -f rm .gitignore mv /tmp/dist/* . ls git add content/ images/ index.html scripts/ styles/ views/ git commit -am "Deploying $branch to gh-pages" git push --delete origin gh-pages git push --set-upstream origin gh-pages git checkout master
+ branch=${1:-"master"} + echo "Deploying $branch to gh-pages" git checkout master cd htck npm cache clean npm install bower install grunt build ls cd .. ls htck git branch -D gh-pages cp -R htck/dist/ /tmp/ ls /tmp git checkout --orphan gh-pages # Remove all git tracked files (keeps libs and node_modules) git ls-files -z | xargs -0 rm -f rm .gitignore mv /tmp/dist/* . ls git add content/ images/ index.html scripts/ styles/ views/ - git commit -am "Deploying to gh-pages" + git commit -am "Deploying $branch to gh-pages" ? ++++++++ git push --delete origin gh-pages git push --set-upstream origin gh-pages git checkout master
4
0.173913
3
1
deddc688a60fc54ed7196c61ae866b5ddc36f74e
app/Providers/AuthServiceProvider.php
app/Providers/AuthServiceProvider.php
<?php namespace App\Providers; use App\Models\Site; use App\Models\Page; use App\Models\Media; use App\Policies\PagePolicy; use App\Policies\SitePolicy; use App\Policies\RoutePolicy; use App\Policies\MediaPolicy; use App\Models\Definitions\Block as BlockDefinition; use App\Models\Definitions\Layout as LayoutDefinition; use App\Models\Definitions\Region as RegionDefinition; use App\Policies\Definitions\BlockPolicy as BlockDefinitionPolicy; use App\Policies\Definitions\LayoutPolicy as LayoutDefinitionPolicy; use App\Policies\Definitions\RegionPolicy as RegionDefinitionPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ Page::class => PagePolicy::class, Page::class => RoutePolicy::class, Site::class => SitePolicy::class, Media::class => MediaPolicy::class, BlockDefinition::class => BlockDefinitionPolicy::class, LayoutDefinition::class => LayoutDefinitionPolicy::class, RegionDefinition::class => RegionDefinitionPolicy::class, ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } }
<?php namespace App\Providers; use App\Models\Site; use App\Models\Page; use App\Models\Media; use App\Policies\PagePolicy; use App\Policies\SitePolicy; use App\Policies\MediaPolicy; use App\Models\Definitions\Block as BlockDefinition; use App\Models\Definitions\Layout as LayoutDefinition; use App\Models\Definitions\Region as RegionDefinition; use App\Policies\Definitions\BlockPolicy as BlockDefinitionPolicy; use App\Policies\Definitions\LayoutPolicy as LayoutDefinitionPolicy; use App\Policies\Definitions\RegionPolicy as RegionDefinitionPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ Page::class => PagePolicy::class, Site::class => SitePolicy::class, Media::class => MediaPolicy::class, BlockDefinition::class => BlockDefinitionPolicy::class, LayoutDefinition::class => LayoutDefinitionPolicy::class, RegionDefinition::class => RegionDefinitionPolicy::class, ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } }
Remove obsolete code which stopped non-admins from editing.
Remove obsolete code which stopped non-admins from editing.
PHP
mit
unikent/astro,unikent/astro,unikent/astro,unikent/astro,unikent/astro
php
## Code Before: <?php namespace App\Providers; use App\Models\Site; use App\Models\Page; use App\Models\Media; use App\Policies\PagePolicy; use App\Policies\SitePolicy; use App\Policies\RoutePolicy; use App\Policies\MediaPolicy; use App\Models\Definitions\Block as BlockDefinition; use App\Models\Definitions\Layout as LayoutDefinition; use App\Models\Definitions\Region as RegionDefinition; use App\Policies\Definitions\BlockPolicy as BlockDefinitionPolicy; use App\Policies\Definitions\LayoutPolicy as LayoutDefinitionPolicy; use App\Policies\Definitions\RegionPolicy as RegionDefinitionPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ Page::class => PagePolicy::class, Page::class => RoutePolicy::class, Site::class => SitePolicy::class, Media::class => MediaPolicy::class, BlockDefinition::class => BlockDefinitionPolicy::class, LayoutDefinition::class => LayoutDefinitionPolicy::class, RegionDefinition::class => RegionDefinitionPolicy::class, ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } } ## Instruction: Remove obsolete code which stopped non-admins from editing. ## Code After: <?php namespace App\Providers; use App\Models\Site; use App\Models\Page; use App\Models\Media; use App\Policies\PagePolicy; use App\Policies\SitePolicy; use App\Policies\MediaPolicy; use App\Models\Definitions\Block as BlockDefinition; use App\Models\Definitions\Layout as LayoutDefinition; use App\Models\Definitions\Region as RegionDefinition; use App\Policies\Definitions\BlockPolicy as BlockDefinitionPolicy; use App\Policies\Definitions\LayoutPolicy as LayoutDefinitionPolicy; use App\Policies\Definitions\RegionPolicy as RegionDefinitionPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ Page::class => PagePolicy::class, Site::class => SitePolicy::class, Media::class => MediaPolicy::class, BlockDefinition::class => BlockDefinitionPolicy::class, LayoutDefinition::class => LayoutDefinitionPolicy::class, RegionDefinition::class => RegionDefinitionPolicy::class, ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } }
<?php namespace App\Providers; use App\Models\Site; use App\Models\Page; use App\Models\Media; use App\Policies\PagePolicy; use App\Policies\SitePolicy; - use App\Policies\RoutePolicy; use App\Policies\MediaPolicy; use App\Models\Definitions\Block as BlockDefinition; use App\Models\Definitions\Layout as LayoutDefinition; use App\Models\Definitions\Region as RegionDefinition; use App\Policies\Definitions\BlockPolicy as BlockDefinitionPolicy; use App\Policies\Definitions\LayoutPolicy as LayoutDefinitionPolicy; use App\Policies\Definitions\RegionPolicy as RegionDefinitionPolicy; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ Page::class => PagePolicy::class, - Page::class => RoutePolicy::class, Site::class => SitePolicy::class, Media::class => MediaPolicy::class, BlockDefinition::class => BlockDefinitionPolicy::class, LayoutDefinition::class => LayoutDefinitionPolicy::class, RegionDefinition::class => RegionDefinitionPolicy::class, ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } }
2
0.041667
0
2
17d53a1d40b1d15f08a80f9f03dd3922156d9fb6
src/repo.c
src/repo.c
/** * repo.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #include "repo.h" /** * Get all stashes for a repository. */ struct stash *get_stashes (struct repo *r) { return r->stashes; } /** * Set a copy of all stashes for a repository in memory. */ void set_stashes (struct repo *r) { // @todo: Build this function out. char *cmd; FILE *fp; printf("set_stashes -> r->path -> %s\n", r->path); sprintf(cmd, "/usr/bin/git -C %s -- stash list", r->path); fp = popen(cmd, "r"); if (!fp) { printf("Could not open pipe!\n"); exit(EXIT_FAILURE); } while (fgets(r->stashes->entries, (sizeof(r->stashes->entries) - 1), fp) != NULL) { printf("%s\n", r->stashes->entries); } pclose(fp); } /** * Check if the worktree has changed since our last check. */ int has_worktree_changed (struct repo *r) { return 1; }
/** * repo.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #include "repo.h" /** * Get all stash entries for a repository. */ struct stash *get_stash (struct repo *r) { return r->stash; } /** * Set a copy of all stash entries for a repository. */ void set_stash (struct repo *r) { char *cmd; FILE *fp; // Allocate space for command string cmd = ALLOC(sizeof(char) * (strlen(r->path) + 100)); sprintf(cmd, "/usr/bin/git -C %s stash list", r->path); printf("set_stashes -> cmd -> %s\n", cmd); fp = popen(cmd, "r"); if (!fp) { printf("Could not open pipe!\n"); exit(EXIT_FAILURE); } while (fgets(r->stash->entries, (sizeof(r->stash->entries) - 1), fp) != NULL) { printf("%s\n", r->stash->entries); } // Free space allocated for commnad string FREE(cmd); pclose(fp); } /** * Check if the worktree has changed since the last check. */ int has_worktree_changed (struct repo *r) { return 1; }
Work on stash retrieval, memory allocation
Work on stash retrieval, memory allocation
C
mit
nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd
c
## Code Before: /** * repo.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #include "repo.h" /** * Get all stashes for a repository. */ struct stash *get_stashes (struct repo *r) { return r->stashes; } /** * Set a copy of all stashes for a repository in memory. */ void set_stashes (struct repo *r) { // @todo: Build this function out. char *cmd; FILE *fp; printf("set_stashes -> r->path -> %s\n", r->path); sprintf(cmd, "/usr/bin/git -C %s -- stash list", r->path); fp = popen(cmd, "r"); if (!fp) { printf("Could not open pipe!\n"); exit(EXIT_FAILURE); } while (fgets(r->stashes->entries, (sizeof(r->stashes->entries) - 1), fp) != NULL) { printf("%s\n", r->stashes->entries); } pclose(fp); } /** * Check if the worktree has changed since our last check. */ int has_worktree_changed (struct repo *r) { return 1; } ## Instruction: Work on stash retrieval, memory allocation ## Code After: /** * repo.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #include "repo.h" /** * Get all stash entries for a repository. */ struct stash *get_stash (struct repo *r) { return r->stash; } /** * Set a copy of all stash entries for a repository. */ void set_stash (struct repo *r) { char *cmd; FILE *fp; // Allocate space for command string cmd = ALLOC(sizeof(char) * (strlen(r->path) + 100)); sprintf(cmd, "/usr/bin/git -C %s stash list", r->path); printf("set_stashes -> cmd -> %s\n", cmd); fp = popen(cmd, "r"); if (!fp) { printf("Could not open pipe!\n"); exit(EXIT_FAILURE); } while (fgets(r->stash->entries, (sizeof(r->stash->entries) - 1), fp) != NULL) { printf("%s\n", r->stash->entries); } // Free space allocated for commnad string FREE(cmd); pclose(fp); } /** * Check if the worktree has changed since the last check. */ int has_worktree_changed (struct repo *r) { return 1; }
/** * repo.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ - #include "repo.h" /** - * Get all stashes for a repository. + * Get all stash entries for a repository. ? ++++++ */ - struct stash *get_stashes (struct repo *r) { ? -- + struct stash *get_stash (struct repo *r) { - return r->stashes; ? -- + return r->stash; } /** - * Set a copy of all stashes for a repository in memory. ? ---------- + * Set a copy of all stash entries for a repository. ? ++++++ */ - void set_stashes (struct repo *r) { ? -- + void set_stash (struct repo *r) { - // @todo: Build this function out. char *cmd; FILE *fp; - printf("set_stashes -> r->path -> %s\n", r->path); + // Allocate space for command string + cmd = ALLOC(sizeof(char) * (strlen(r->path) + 100)); - sprintf(cmd, "/usr/bin/git -C %s -- stash list", r->path); ? --- + sprintf(cmd, "/usr/bin/git -C %s stash list", r->path); + printf("set_stashes -> cmd -> %s\n", cmd); fp = popen(cmd, "r"); if (!fp) { printf("Could not open pipe!\n"); exit(EXIT_FAILURE); } - while (fgets(r->stashes->entries, (sizeof(r->stashes->entries) - 1), fp) != NULL) { ? -- -- + while (fgets(r->stash->entries, (sizeof(r->stash->entries) - 1), fp) != NULL) { - printf("%s\n", r->stashes->entries); ? -- + printf("%s\n", r->stash->entries); } + // Free space allocated for commnad string + FREE(cmd); pclose(fp); } /** - * Check if the worktree has changed since our last check. ? ^^^ + * Check if the worktree has changed since the last check. ? ^^^ */ int has_worktree_changed (struct repo *r) { return 1; }
26
0.530612
14
12
74caf9b73081a2e77997d87207745f4ac83a3619
package.json
package.json
{ "name": "dispatch-proxy", "description": "A SOCKS5/HTTP proxy that balances traffic between multiple internet connections.", "author": "Alexandre Kirszenberg <a.kirszenberg@gmail.com>", "version": "0.0.9", "repository": { "type": "git", "url": "git@github.com:morhaus/dispatch-proxy.git" }, "bin": { "dispatch": "./bin/dispatch.js" }, "scripts": { "prepublish": "grunt" }, "dependencies": { "commander": "2.0.0" }, "devDependencies": { "grunt": "*", "grunt-cli": "*", "grunt-contrib-watch": "*", "grunt-contrib-coffee": "*", "grunt-contrib-clean": "*" } }
{ "name": "dispatch-proxy", "description": "A SOCKS5/HTTP proxy that balances traffic between multiple internet connections.", "author": "Alexandre Kirszenberg <a.kirszenberg@gmail.com>", "version": "0.0.9", "keywords": [ "dispatch", "proxy", "socks", "socks5", "http", "load", "balancer" ], "repository": { "type": "git", "url": "git@github.com:morhaus/dispatch-proxy.git" }, "bin": { "dispatch": "./bin/dispatch.js" }, "scripts": { "prepublish": "grunt" }, "engines": { "node": ">=0.10.0" }, "dependencies": { "commander": "2.0.0" }, "devDependencies": { "grunt": "*", "grunt-cli": "*", "grunt-contrib-watch": "*", "grunt-contrib-coffee": "*", "grunt-contrib-clean": "*" } }
Add engine dependency (advisory) as well as some keywords for the npm registry
Add engine dependency (advisory) as well as some keywords for the npm registry
JSON
mit
Nithanaroy/dispatch-custom,Morhaus/dispatch-proxy,tadev/dispatch-proxy
json
## Code Before: { "name": "dispatch-proxy", "description": "A SOCKS5/HTTP proxy that balances traffic between multiple internet connections.", "author": "Alexandre Kirszenberg <a.kirszenberg@gmail.com>", "version": "0.0.9", "repository": { "type": "git", "url": "git@github.com:morhaus/dispatch-proxy.git" }, "bin": { "dispatch": "./bin/dispatch.js" }, "scripts": { "prepublish": "grunt" }, "dependencies": { "commander": "2.0.0" }, "devDependencies": { "grunt": "*", "grunt-cli": "*", "grunt-contrib-watch": "*", "grunt-contrib-coffee": "*", "grunt-contrib-clean": "*" } } ## Instruction: Add engine dependency (advisory) as well as some keywords for the npm registry ## Code After: { "name": "dispatch-proxy", "description": "A SOCKS5/HTTP proxy that balances traffic between multiple internet connections.", "author": "Alexandre Kirszenberg <a.kirszenberg@gmail.com>", "version": "0.0.9", "keywords": [ "dispatch", "proxy", "socks", "socks5", "http", "load", "balancer" ], "repository": { "type": "git", "url": "git@github.com:morhaus/dispatch-proxy.git" }, "bin": { "dispatch": "./bin/dispatch.js" }, "scripts": { "prepublish": "grunt" }, "engines": { "node": ">=0.10.0" }, "dependencies": { "commander": "2.0.0" }, "devDependencies": { "grunt": "*", "grunt-cli": "*", "grunt-contrib-watch": "*", "grunt-contrib-coffee": "*", "grunt-contrib-clean": "*" } }
{ "name": "dispatch-proxy", "description": "A SOCKS5/HTTP proxy that balances traffic between multiple internet connections.", "author": "Alexandre Kirszenberg <a.kirszenberg@gmail.com>", "version": "0.0.9", + "keywords": [ + "dispatch", + "proxy", + "socks", + "socks5", + "http", + "load", + "balancer" + ], "repository": { "type": "git", "url": "git@github.com:morhaus/dispatch-proxy.git" }, "bin": { "dispatch": "./bin/dispatch.js" }, "scripts": { "prepublish": "grunt" }, + "engines": { + "node": ">=0.10.0" + }, + "dependencies": { "commander": "2.0.0" }, "devDependencies": { "grunt": "*", "grunt-cli": "*", "grunt-contrib-watch": "*", "grunt-contrib-coffee": "*", "grunt-contrib-clean": "*" } }
13
0.419355
13
0
1358826b2691ed429a1f95e290be43aacde6ebde
travis/macos-install.sh
travis/macos-install.sh
set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version which pip3 pip3 --version brew install albertosottile/syncplay/pyside python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app python3 -c "from py2app.recipes import pyside2" pip3 install twisted[tls] appnope requests certifi
set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version which pip3 pip3 --version brew install albertosottile/syncplay/pyside # Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app python3 -c "from py2app.recipes import pyside2" pip3 install twisted[tls] appnope requests certifi
Upgrade Qt version after the pyside install
Upgrade Qt version after the pyside install
Shell
apache-2.0
Syncplay/syncplay,Syncplay/syncplay,alby128/syncplay,alby128/syncplay
shell
## Code Before: set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version which pip3 pip3 --version brew install albertosottile/syncplay/pyside python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app python3 -c "from py2app.recipes import pyside2" pip3 install twisted[tls] appnope requests certifi ## Instruction: Upgrade Qt version after the pyside install ## Code After: set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version which pip3 pip3 --version brew install albertosottile/syncplay/pyside # Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app python3 -c "from py2app.recipes import pyside2" pip3 install twisted[tls] appnope requests certifi
set -ex export HOMEBREW_NO_INSTALL_CLEANUP=1 # Python 3.7.4 with 10.12 bottle brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb which python3 python3 --version which pip3 pip3 --version brew install albertosottile/syncplay/pyside + + # Explicitly install Qt 5.13.1 as that has both 10.12 compatibility, and a pre-built bottle + brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb + python3 -c "from PySide2 import __version__; print(__version__)" python3 -c "from PySide2.QtCore import __version__; print(__version__)" pip3 install py2app python3 -c "from py2app.recipes import pyside2" pip3 install twisted[tls] appnope requests certifi
4
0.210526
4
0
87509d6afc8c96a7988ef57b1cacc7c4ac3817e5
index.js
index.js
var cp = require('child_process'); module.exports = function whereis(name, cb) { cp.exec('which ' + name, function(error, stdout, stderr) { stdout = stdout.split('\n')[0]; if (error || stderr || stdout === '' || stdout.charAt(0) !== '/') { stdout = stdout.split('\n')[0]; cp.exec('whereis ' + name, function(error, stdout, stderr) { if (error || stderr || stdout === '' || stdout.indexOf('/') === -1) { return cb(new Error('Could not find ' + name + ' or system not supported')); } return cb(null, stdout.split(' ')[1]); }); } else { return cb(null, stdout); } }); };
var cp = require('child_process'); module.exports = function whereis(name, cb) { cp.exec('which ' + name, function(error, stdout, stderr) { stdout = stdout.split('\n')[0]; if (error || stderr || stdout === '' || stdout.charAt(0) !== '/') { stdout = stdout.split('\n')[0]; cp.exec('whereis ' + name, function(error, stdout, stderr) { if ( error || stderr || stdout === '' || stdout.indexOf( '/' ) === -1 ) { cp.exec( 'where ' + name, function ( error, stdout, stderr ) { //windows if ( error || stderr || stdout === '' || stdout.indexOf( '\\' ) === -1 ) { return cb( new Error( 'Could not find ' + name + ' or system not supported' ) ); } return cb( null, stdout ); } ); } else { return cb( null, stdout.split( ' ' )[1] ); } }); } else { return cb(null, stdout); } }); };
Add Windows support using 'where'
Add Windows support using 'where'
JavaScript
mit
vvo/node-whereis
javascript
## Code Before: var cp = require('child_process'); module.exports = function whereis(name, cb) { cp.exec('which ' + name, function(error, stdout, stderr) { stdout = stdout.split('\n')[0]; if (error || stderr || stdout === '' || stdout.charAt(0) !== '/') { stdout = stdout.split('\n')[0]; cp.exec('whereis ' + name, function(error, stdout, stderr) { if (error || stderr || stdout === '' || stdout.indexOf('/') === -1) { return cb(new Error('Could not find ' + name + ' or system not supported')); } return cb(null, stdout.split(' ')[1]); }); } else { return cb(null, stdout); } }); }; ## Instruction: Add Windows support using 'where' ## Code After: var cp = require('child_process'); module.exports = function whereis(name, cb) { cp.exec('which ' + name, function(error, stdout, stderr) { stdout = stdout.split('\n')[0]; if (error || stderr || stdout === '' || stdout.charAt(0) !== '/') { stdout = stdout.split('\n')[0]; cp.exec('whereis ' + name, function(error, stdout, stderr) { if ( error || stderr || stdout === '' || stdout.indexOf( '/' ) === -1 ) { cp.exec( 'where ' + name, function ( error, stdout, stderr ) { //windows if ( error || stderr || stdout === '' || stdout.indexOf( '\\' ) === -1 ) { return cb( new Error( 'Could not find ' + name + ' or system not supported' ) ); } return cb( null, stdout ); } ); } else { return cb( null, stdout.split( ' ' )[1] ); } }); } else { return cb(null, stdout); } }); };
var cp = require('child_process'); module.exports = function whereis(name, cb) { cp.exec('which ' + name, function(error, stdout, stderr) { stdout = stdout.split('\n')[0]; if (error || stderr || stdout === '' || stdout.charAt(0) !== '/') { stdout = stdout.split('\n')[0]; cp.exec('whereis ' + name, function(error, stdout, stderr) { - if (error || stderr || stdout === '' || stdout.indexOf('/') === -1) { + if ( error || stderr || stdout === '' || stdout.indexOf( '/' ) === -1 ) { ? + + + + + cp.exec( 'where ' + name, function ( error, stdout, stderr ) { //windows + if ( error || stderr || stdout === '' || stdout.indexOf( '\\' ) === -1 ) { - return cb(new Error('Could not find ' + name + ' or system not supported')); + return cb( new Error( 'Could not find ' + name + ' or system not supported' ) ); ? ++++ + + + + + } + return cb( null, stdout ); + } ); } - + else { - return cb(null, stdout.split(' ')[1]); + return cb( null, stdout.split( ' ' )[1] ); ? ++ + + + + + } }); } else { return cb(null, stdout); } }); };
14
0.666667
10
4
055df98325e9b2b212236b2f59ac0ad6d6689d55
app/models/game_status.rb
app/models/game_status.rb
class GameStatus < ActiveRecord::Base STATUS_NEW = 0 STATUS_IN_PROGRESS = 1 STATUS_LOST = 2 STATUS_WON = 3 validates :id, numericality: { only_integer: true } validate :game_status_is_valid def game_status_is_valid if id < STATUS_NEW or id > STATUS_WON errors.add(:id, I18n.t('INVALID_GAME_STATUS_ID', valid_range: "0-3")) end end end
class GameStatus < ActiveRecord::Base self.primary_key = "id" STATUS_NEW = 0 STATUS_IN_PROGRESS = 1 STATUS_LOST = 2 STATUS_WON = 3 validates :id, numericality: { only_integer: true } validate :game_status_is_valid def game_status_is_valid if id < STATUS_NEW or id > STATUS_WON errors.add(:id, I18n.t('INVALID_GAME_STATUS_ID', valid_range: "0-3")) end end end
Fix game status primary key when running with sqlite
Fix game status primary key when running with sqlite
Ruby
mit
aclemons/hangman-rails,aclemons/hangman-rails,aclemons/hangman-rails,aclemons/hangman-rails
ruby
## Code Before: class GameStatus < ActiveRecord::Base STATUS_NEW = 0 STATUS_IN_PROGRESS = 1 STATUS_LOST = 2 STATUS_WON = 3 validates :id, numericality: { only_integer: true } validate :game_status_is_valid def game_status_is_valid if id < STATUS_NEW or id > STATUS_WON errors.add(:id, I18n.t('INVALID_GAME_STATUS_ID', valid_range: "0-3")) end end end ## Instruction: Fix game status primary key when running with sqlite ## Code After: class GameStatus < ActiveRecord::Base self.primary_key = "id" STATUS_NEW = 0 STATUS_IN_PROGRESS = 1 STATUS_LOST = 2 STATUS_WON = 3 validates :id, numericality: { only_integer: true } validate :game_status_is_valid def game_status_is_valid if id < STATUS_NEW or id > STATUS_WON errors.add(:id, I18n.t('INVALID_GAME_STATUS_ID', valid_range: "0-3")) end end end
class GameStatus < ActiveRecord::Base + self.primary_key = "id" + STATUS_NEW = 0 STATUS_IN_PROGRESS = 1 STATUS_LOST = 2 STATUS_WON = 3 validates :id, numericality: { only_integer: true } validate :game_status_is_valid def game_status_is_valid if id < STATUS_NEW or id > STATUS_WON errors.add(:id, I18n.t('INVALID_GAME_STATUS_ID', valid_range: "0-3")) end end end
2
0.125
2
0
227dac8b50c8817e3a85497e76ad405d5e453d5a
src/hakim/hakim.go
src/hakim/hakim.go
package main import ( "checks" "flag" "log" "github.com/mitchellh/go-ps" ) var ( gardenAddr = flag.String("gardenAddr", "localhost:9241", "Garden host and port (typically localhost:9241)") requiredProcesses = []string{"consul.exe", "containerizer.exe", "garden-windows.exe", "rep.exe", "metron.exe"} bbsConsulHost = "bbs.service.cf.internal" ) func main() { flag.Parse() processes, err := ps.Processes() if err != nil { panic(err) } err = checks.ProcessCheck(processes, requiredProcesses) if err != nil { log.Fatal(err) } err = checks.ContainerCheck(*gardenAddr) if err != nil { log.Fatal(err) } err = checks.ConsulDnsCheck(bbsConsulHost) if err != nil { log.Fatal(err) } err = checks.FairShareCpuCheck() if err != nil { log.Fatal(err) } err = checks.FirewallCheck() if err != nil { log.Fatal(err) } err = checks.NtpCheck() if err != nil { log.Fatal(err) } }
package main import ( "checks" "flag" "log" "github.com/mitchellh/go-ps" ) var ( gardenAddr = flag.String("gardenAddr", "localhost:9241", "Garden host and port (typically localhost:9241)") requiredProcesses = []string{"consul.exe", "containerizer.exe", "garden-windows.exe", "rep.exe", "metron.exe"} bbsConsulHost = "bbs.service.cf.internal" ) func main() { flag.Parse() processes, err := ps.Processes() if err == nil { err = checks.ProcessCheck(processes, requiredProcesses) if err != nil { log.Print(err) } } else { log.Print(err) } err = checks.ContainerCheck(*gardenAddr) if err != nil { log.Print(err) } err = checks.ConsulDnsCheck(bbsConsulHost) if err != nil { log.Print(err) } err = checks.FairShareCpuCheck() if err != nil { log.Print(err) } err = checks.FirewallCheck() if err != nil { log.Print(err) } err = checks.NtpCheck() if err != nil { log.Print(err) } }
Print out all the failing things
Print out all the failing things Instead of just running one check, run them all. Signed-off-by: Anthony Emengo <7b3c5a7825e2f856203b8d882230abcb78036abf@pivotal.io>
Go
apache-2.0
cloudfoundry-incubator/hakim
go
## Code Before: package main import ( "checks" "flag" "log" "github.com/mitchellh/go-ps" ) var ( gardenAddr = flag.String("gardenAddr", "localhost:9241", "Garden host and port (typically localhost:9241)") requiredProcesses = []string{"consul.exe", "containerizer.exe", "garden-windows.exe", "rep.exe", "metron.exe"} bbsConsulHost = "bbs.service.cf.internal" ) func main() { flag.Parse() processes, err := ps.Processes() if err != nil { panic(err) } err = checks.ProcessCheck(processes, requiredProcesses) if err != nil { log.Fatal(err) } err = checks.ContainerCheck(*gardenAddr) if err != nil { log.Fatal(err) } err = checks.ConsulDnsCheck(bbsConsulHost) if err != nil { log.Fatal(err) } err = checks.FairShareCpuCheck() if err != nil { log.Fatal(err) } err = checks.FirewallCheck() if err != nil { log.Fatal(err) } err = checks.NtpCheck() if err != nil { log.Fatal(err) } } ## Instruction: Print out all the failing things Instead of just running one check, run them all. Signed-off-by: Anthony Emengo <7b3c5a7825e2f856203b8d882230abcb78036abf@pivotal.io> ## Code After: package main import ( "checks" "flag" "log" "github.com/mitchellh/go-ps" ) var ( gardenAddr = flag.String("gardenAddr", "localhost:9241", "Garden host and port (typically localhost:9241)") requiredProcesses = []string{"consul.exe", "containerizer.exe", "garden-windows.exe", "rep.exe", "metron.exe"} bbsConsulHost = "bbs.service.cf.internal" ) func main() { flag.Parse() processes, err := ps.Processes() if err == nil { err = checks.ProcessCheck(processes, requiredProcesses) if err != nil { log.Print(err) } } else { log.Print(err) } err = checks.ContainerCheck(*gardenAddr) if err != nil { log.Print(err) } err = checks.ConsulDnsCheck(bbsConsulHost) if err != nil { log.Print(err) } err = checks.FairShareCpuCheck() if err != nil { log.Print(err) } err = checks.FirewallCheck() if err != nil { log.Print(err) } err = checks.NtpCheck() if err != nil { log.Print(err) } }
package main import ( "checks" "flag" "log" "github.com/mitchellh/go-ps" ) var ( gardenAddr = flag.String("gardenAddr", "localhost:9241", "Garden host and port (typically localhost:9241)") requiredProcesses = []string{"consul.exe", "containerizer.exe", "garden-windows.exe", "rep.exe", "metron.exe"} bbsConsulHost = "bbs.service.cf.internal" ) func main() { flag.Parse() processes, err := ps.Processes() - if err != nil { ? ^ + if err == nil { ? ^ - panic(err) - } - - err = checks.ProcessCheck(processes, requiredProcesses) + err = checks.ProcessCheck(processes, requiredProcesses) ? + - if err != nil { + if err != nil { ? + + log.Print(err) + } + } else { - log.Fatal(err) ? ^^ -- + log.Print(err) ? ^^^^ } err = checks.ContainerCheck(*gardenAddr) if err != nil { - log.Fatal(err) ? ^^ -- + log.Print(err) ? ^^^^ } err = checks.ConsulDnsCheck(bbsConsulHost) if err != nil { - log.Fatal(err) ? ^^ -- + log.Print(err) ? ^^^^ } err = checks.FairShareCpuCheck() if err != nil { - log.Fatal(err) ? ^^ -- + log.Print(err) ? ^^^^ } err = checks.FirewallCheck() if err != nil { - log.Fatal(err) ? ^^ -- + log.Print(err) ? ^^^^ } err = checks.NtpCheck() if err != nil { - log.Fatal(err) ? ^^ -- + log.Print(err) ? ^^^^ } }
24
0.444444
12
12
e944c62bbb47f7c050186ab2d942cdd01373e812
app/views/assets/_map.html.haml
app/views/assets/_map.html.haml
= LeafletMap({:mapid => 'lmap', :markers => @markers, :tile_provider => Rails.application.config.map_tile_provider, :map_key => Rails.application.config.map_tile_key, :access_token => Rails.application.config.map_access_token, :min_zoom => Rails.application.config.map_min_zoom_level, :max_zoom => Rails.application.config.map_max_zoom_level, :class => "map", :style => "height:400px;"}) = yield :scripts
= LeafletMap({:mapid => 'lmap', :markers => @asset.map_markers.to_json, :tile_provider => Rails.application.config.map_tile_provider, :map_key => Rails.application.config.map_tile_key, :access_token => Rails.application.config.map_access_token, :min_zoom => Rails.application.config.map_min_zoom_level, :max_zoom => Rails.application.config.map_max_zoom_level, :class => "map", :style => "height:400px;"}) = yield :scripts
Fix issue where an asset was not being rendered on the map
Fix issue where an asset was not being rendered on the map
Haml
mit
camsys/transam_spatial,camsys/transam_spatial,camsys/transam_spatial
haml
## Code Before: = LeafletMap({:mapid => 'lmap', :markers => @markers, :tile_provider => Rails.application.config.map_tile_provider, :map_key => Rails.application.config.map_tile_key, :access_token => Rails.application.config.map_access_token, :min_zoom => Rails.application.config.map_min_zoom_level, :max_zoom => Rails.application.config.map_max_zoom_level, :class => "map", :style => "height:400px;"}) = yield :scripts ## Instruction: Fix issue where an asset was not being rendered on the map ## Code After: = LeafletMap({:mapid => 'lmap', :markers => @asset.map_markers.to_json, :tile_provider => Rails.application.config.map_tile_provider, :map_key => Rails.application.config.map_tile_key, :access_token => Rails.application.config.map_access_token, :min_zoom => Rails.application.config.map_min_zoom_level, :max_zoom => Rails.application.config.map_max_zoom_level, :class => "map", :style => "height:400px;"}) = yield :scripts
= LeafletMap({:mapid => 'lmap', - :markers => @markers, + :markers => @asset.map_markers.to_json, :tile_provider => Rails.application.config.map_tile_provider, :map_key => Rails.application.config.map_tile_key, :access_token => Rails.application.config.map_access_token, :min_zoom => Rails.application.config.map_min_zoom_level, :max_zoom => Rails.application.config.map_max_zoom_level, :class => "map", :style => "height:400px;"}) = yield :scripts
2
0.181818
1
1
f0bc01603b491f14e593cc24329c18efc2beaf40
lib/amazon/metadata-config.js
lib/amazon/metadata-config.js
// -------------------------------------------------------------------------------------------------------------------- // // metadata-config.js - config for AWS Instance Metadata // // Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/ // Written by Andrew Chilton <chilts@appsattic.com> // // License: http://opensource.org/licenses/MIT // // -------------------------------------------------------------------------------------------------------------------- function pathCategory(options, args) { return '/' + args.Version + args.Category; } function pathLatest(options, args) { return '/latest/' + args.Category; } // -------------------------------------------------------------------------------------------------------------------- // From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html module.exports = { 'ListApiVersions' : { // request 'path' : '/', // response 'body' : 'blob', }, 'Get' : { // request 'path' : pathCategory, 'args' : { Category : { 'required' : true, 'type' : 'special', }, Version : { 'required' : true, 'type' : 'special', }, }, // response 'body' : 'blob', }, }; // --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------- // // metadata-config.js - config for AWS Instance Metadata // // Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/ // Written by Andrew Chilton <chilts@appsattic.com> // // License: http://opensource.org/licenses/MIT // // -------------------------------------------------------------------------------------------------------------------- function path(options, args) { return '/' + args.Version + args.Category; } // -------------------------------------------------------------------------------------------------------------------- // From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html module.exports = { 'ListApiVersions' : { // request 'path' : '/', // response 'extractBody' : 'blob', }, 'Get' : { // request 'path' : path, 'args' : { Category : { 'required' : true, 'type' : 'special', }, Version : { 'required' : true, 'type' : 'special', }, }, // response 'extractBody' : 'blob', }, }; // --------------------------------------------------------------------------------------------------------------------
Make sure the extractBody is set (not just body)
Make sure the extractBody is set (not just body)
JavaScript
mit
chilts/awssum
javascript
## Code Before: // -------------------------------------------------------------------------------------------------------------------- // // metadata-config.js - config for AWS Instance Metadata // // Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/ // Written by Andrew Chilton <chilts@appsattic.com> // // License: http://opensource.org/licenses/MIT // // -------------------------------------------------------------------------------------------------------------------- function pathCategory(options, args) { return '/' + args.Version + args.Category; } function pathLatest(options, args) { return '/latest/' + args.Category; } // -------------------------------------------------------------------------------------------------------------------- // From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html module.exports = { 'ListApiVersions' : { // request 'path' : '/', // response 'body' : 'blob', }, 'Get' : { // request 'path' : pathCategory, 'args' : { Category : { 'required' : true, 'type' : 'special', }, Version : { 'required' : true, 'type' : 'special', }, }, // response 'body' : 'blob', }, }; // -------------------------------------------------------------------------------------------------------------------- ## Instruction: Make sure the extractBody is set (not just body) ## Code After: // -------------------------------------------------------------------------------------------------------------------- // // metadata-config.js - config for AWS Instance Metadata // // Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/ // Written by Andrew Chilton <chilts@appsattic.com> // // License: http://opensource.org/licenses/MIT // // -------------------------------------------------------------------------------------------------------------------- function path(options, args) { return '/' + args.Version + args.Category; } // -------------------------------------------------------------------------------------------------------------------- // From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html module.exports = { 'ListApiVersions' : { // request 'path' : '/', // response 'extractBody' : 'blob', }, 'Get' : { // request 'path' : path, 'args' : { Category : { 'required' : true, 'type' : 'special', }, Version : { 'required' : true, 'type' : 'special', }, }, // response 'extractBody' : 'blob', }, }; // --------------------------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------------------------- // // metadata-config.js - config for AWS Instance Metadata // // Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/ // Written by Andrew Chilton <chilts@appsattic.com> // // License: http://opensource.org/licenses/MIT // // -------------------------------------------------------------------------------------------------------------------- - function pathCategory(options, args) { ? -------- + function path(options, args) { return '/' + args.Version + args.Category; - } - - function pathLatest(options, args) { - return '/latest/' + args.Category; } // -------------------------------------------------------------------------------------------------------------------- // From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html module.exports = { 'ListApiVersions' : { // request 'path' : '/', // response - 'body' : 'blob', ? ^ + 'extractBody' : 'blob', ? ^^^^^^^^ }, 'Get' : { // request - 'path' : pathCategory, ? -------- + 'path' : path, 'args' : { Category : { 'required' : true, 'type' : 'special', }, Version : { 'required' : true, 'type' : 'special', }, }, // response - 'body' : 'blob', ? ^ + 'extractBody' : 'blob', ? ^^^^^^^^ }, }; // --------------------------------------------------------------------------------------------------------------------
12
0.230769
4
8
0fbf0ec5106cbae23fe7d48b4276f63cc2664ed8
.travis.yml
.travis.yml
language: python dist: xenial python: - "2.6" - "2.7" - "3.3" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8-dev" # linux deps addons: apt: packages: - mlocate - coreutils - python-virtualenv # osx deps before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python &>/dev/null || brew install python; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python3 &>/dev/null || brew install python3; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pyenv-virtualenv; fi install: - python setup.py install script: - make test matrix: include: - os: osx language: generic env: TOXENV=py27 - os: osx language: generic env: TOXENV=py35 allow_failures: - python: "3.8-dev" - os: osx fast_finish: true
language: python dist: xenial python: - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8-dev" # linux deps addons: apt: packages: - mlocate - coreutils - python-virtualenv # osx deps before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python &>/dev/null || brew install python; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python3 &>/dev/null || brew install python3; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pyenv-virtualenv; fi install: - python setup.py install script: - make test matrix: include: - dist: trusty python: "2.6" - dist: trusty python: "3.3" - os: osx language: generic env: TOXENV=py27 - os: osx language: generic env: TOXENV=py35 allow_failures: - python: "3.8-dev" - os: osx fast_finish: true
Use trusty for ancient py26/py33 CI builds
Use trusty for ancient py26/py33 CI builds
YAML
mit
randomir/envie,randomir/envie
yaml
## Code Before: language: python dist: xenial python: - "2.6" - "2.7" - "3.3" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8-dev" # linux deps addons: apt: packages: - mlocate - coreutils - python-virtualenv # osx deps before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python &>/dev/null || brew install python; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python3 &>/dev/null || brew install python3; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pyenv-virtualenv; fi install: - python setup.py install script: - make test matrix: include: - os: osx language: generic env: TOXENV=py27 - os: osx language: generic env: TOXENV=py35 allow_failures: - python: "3.8-dev" - os: osx fast_finish: true ## Instruction: Use trusty for ancient py26/py33 CI builds ## Code After: language: python dist: xenial python: - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8-dev" # linux deps addons: apt: packages: - mlocate - coreutils - python-virtualenv # osx deps before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python &>/dev/null || brew install python; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python3 &>/dev/null || brew install python3; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pyenv-virtualenv; fi install: - python setup.py install script: - make test matrix: include: - dist: trusty python: "2.6" - dist: trusty python: "3.3" - os: osx language: generic env: TOXENV=py27 - os: osx language: generic env: TOXENV=py35 allow_failures: - python: "3.8-dev" - os: osx fast_finish: true
language: python dist: xenial python: - - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8-dev" # linux deps addons: apt: packages: - mlocate - coreutils - python-virtualenv # osx deps before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python &>/dev/null || brew install python; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list python3 &>/dev/null || brew install python3; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pyenv-virtualenv; fi install: - python setup.py install script: - make test matrix: include: + - dist: trusty + python: "2.6" + - dist: trusty + python: "3.3" - os: osx language: generic env: TOXENV=py27 - os: osx language: generic env: TOXENV=py35 allow_failures: - python: "3.8-dev" - os: osx fast_finish: true
6
0.12766
4
2
0bdd2df16823f129b39549a0e41adf1b29470d88
challenges/__init__.py
challenges/__init__.py
from os.path import dirname, basename, isfile import glob import sys modules = glob.glob(dirname(__file__)+"/c*[0-9].py") sys.path.append(dirname(__file__)) # Load all of the modules containing the challenge classes modules = [basename(path)[:-3] for path in modules] modules.sort() # Ensure that modules are in c1-c* order modules = [__import__(mod) for mod in modules] # Extract the challenge class from each module challengeClasses = [] for i in range(1, len(modules)+1): challengeClasses.append(getattr(modules[i-1], 'c' + str(i)))
from os.path import dirname, basename, isfile import glob import sys modules = glob.glob(dirname(__file__)+"/c*[0-9].py") sys.path.append(dirname(__file__)) # Load all of the modules containing the challenge classes modules = [basename(path)[:-3] for path in modules] modules.sort() # Ensure that modules are in c1-c* order modules = [__import__(mod) for mod in modules] # Extract the challenge class from each module challengeClasses = [] for i in range(1, len(modules)+1): try: challengeClasses.append(getattr(modules[i-1], 'c' + str(i))) except: continue
Fix bug in loading of c* modules
Fix bug in loading of c* modules
Python
mit
GunshipPenguin/billionaire_challenge,GunshipPenguin/billionaire_challenge
python
## Code Before: from os.path import dirname, basename, isfile import glob import sys modules = glob.glob(dirname(__file__)+"/c*[0-9].py") sys.path.append(dirname(__file__)) # Load all of the modules containing the challenge classes modules = [basename(path)[:-3] for path in modules] modules.sort() # Ensure that modules are in c1-c* order modules = [__import__(mod) for mod in modules] # Extract the challenge class from each module challengeClasses = [] for i in range(1, len(modules)+1): challengeClasses.append(getattr(modules[i-1], 'c' + str(i))) ## Instruction: Fix bug in loading of c* modules ## Code After: from os.path import dirname, basename, isfile import glob import sys modules = glob.glob(dirname(__file__)+"/c*[0-9].py") sys.path.append(dirname(__file__)) # Load all of the modules containing the challenge classes modules = [basename(path)[:-3] for path in modules] modules.sort() # Ensure that modules are in c1-c* order modules = [__import__(mod) for mod in modules] # Extract the challenge class from each module challengeClasses = [] for i in range(1, len(modules)+1): try: challengeClasses.append(getattr(modules[i-1], 'c' + str(i))) except: continue
from os.path import dirname, basename, isfile import glob import sys modules = glob.glob(dirname(__file__)+"/c*[0-9].py") sys.path.append(dirname(__file__)) # Load all of the modules containing the challenge classes modules = [basename(path)[:-3] for path in modules] modules.sort() # Ensure that modules are in c1-c* order modules = [__import__(mod) for mod in modules] # Extract the challenge class from each module challengeClasses = [] for i in range(1, len(modules)+1): + try: - challengeClasses.append(getattr(modules[i-1], 'c' + str(i))) + challengeClasses.append(getattr(modules[i-1], 'c' + str(i))) ? ++++ + except: + continue
5
0.3125
4
1