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
9edfad2717498c4f405b5ce93e0808e708d780ef
pkgs/applications/networking/instant-messengers/toxic/default.nix
pkgs/applications/networking/instant-messengers/toxic/default.nix
{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses , libtoxcore, pkgconfig }: let version = "b308e19e6b"; date = "20140224"; in stdenv.mkDerivation rec { name = "toxic-${date}-${version}"; src = fetchurl { url = "https://github.com/Tox/toxic/tarball/${version}"; name = "${name}.tar.gz"; sha256 = "0fgkvnpy3dl2h378h796z9md0zg05b3174fgx17b919av6j9x4ma"; }; preConfigure = '' autoreconf -i ''; NIX_LDFLAGS = "-lsodium"; configureFlags = [ "--with-libtoxcore-headers=${libtoxcore}/include" "--with-libtoxcore-libs=${libtoxcore}/lib" "--with-libsodium-headers=${libtoxcore}/include" "--with-libsodium-libs=${libtoxcore}/lib" ]; buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses pkgconfig ]; doCheck = true; meta = { description = "Reference CLI for Tox"; license = stdenv.lib.licenses.gpl3Plus; maintainers = with stdenv.lib.maintainers; [ viric ]; platforms = stdenv.lib.platforms.all; }; }
{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses , libtoxcore, openal, libvpx, freealut, libconfig, pkgconfig }: let version = "7566aa9d26"; date = "20140728"; in stdenv.mkDerivation rec { name = "toxic-${date}-${version}"; src = fetchurl { url = "https://github.com/Tox/toxic/tarball/${version}"; name = "${name}.tar.gz"; sha256 = "13vns0qc0hxhab6rpz0irnzgv42mp3v1nrbwm90iymhf4xkc9nwa"; }; makeFlags = [ "-Cbuild" "VERSION=${version}" ]; installFlags = [ "PREFIX=$(out)" ]; buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses openal libvpx freealut libconfig pkgconfig ]; meta = { description = "Reference CLI for Tox"; license = stdenv.lib.licenses.gpl3Plus; maintainers = with stdenv.lib.maintainers; [ viric ]; platforms = stdenv.lib.platforms.all; }; }
Update to latest upstream Git master.
toxic: Update to latest upstream Git master. Unfortunately they've changed their build system to be makefile-only and they don't seem to include test cases in the CLI anymore, so we needed to adapt accordingly. Also added freealut and openal to the buildInputs, in order to allow audio support. Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org>
Nix
mit
SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs
nix
## Code Before: { stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses , libtoxcore, pkgconfig }: let version = "b308e19e6b"; date = "20140224"; in stdenv.mkDerivation rec { name = "toxic-${date}-${version}"; src = fetchurl { url = "https://github.com/Tox/toxic/tarball/${version}"; name = "${name}.tar.gz"; sha256 = "0fgkvnpy3dl2h378h796z9md0zg05b3174fgx17b919av6j9x4ma"; }; preConfigure = '' autoreconf -i ''; NIX_LDFLAGS = "-lsodium"; configureFlags = [ "--with-libtoxcore-headers=${libtoxcore}/include" "--with-libtoxcore-libs=${libtoxcore}/lib" "--with-libsodium-headers=${libtoxcore}/include" "--with-libsodium-libs=${libtoxcore}/lib" ]; buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses pkgconfig ]; doCheck = true; meta = { description = "Reference CLI for Tox"; license = stdenv.lib.licenses.gpl3Plus; maintainers = with stdenv.lib.maintainers; [ viric ]; platforms = stdenv.lib.platforms.all; }; } ## Instruction: toxic: Update to latest upstream Git master. Unfortunately they've changed their build system to be makefile-only and they don't seem to include test cases in the CLI anymore, so we needed to adapt accordingly. Also added freealut and openal to the buildInputs, in order to allow audio support. Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org> ## Code After: { stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses , libtoxcore, openal, libvpx, freealut, libconfig, pkgconfig }: let version = "7566aa9d26"; date = "20140728"; in stdenv.mkDerivation rec { name = "toxic-${date}-${version}"; src = fetchurl { url = "https://github.com/Tox/toxic/tarball/${version}"; name = "${name}.tar.gz"; sha256 = "13vns0qc0hxhab6rpz0irnzgv42mp3v1nrbwm90iymhf4xkc9nwa"; }; makeFlags = [ "-Cbuild" "VERSION=${version}" ]; installFlags = [ "PREFIX=$(out)" ]; buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses openal libvpx freealut libconfig pkgconfig ]; meta = { description = "Reference CLI for Tox"; license = stdenv.lib.licenses.gpl3Plus; maintainers = with stdenv.lib.maintainers; [ viric ]; platforms = stdenv.lib.platforms.all; }; }
{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses - , libtoxcore, pkgconfig }: + , libtoxcore, openal, libvpx, freealut, libconfig, pkgconfig }: let - version = "b308e19e6b"; + version = "7566aa9d26"; - date = "20140224"; ? ^^ + date = "20140728"; ? + ^ in stdenv.mkDerivation rec { name = "toxic-${date}-${version}"; src = fetchurl { url = "https://github.com/Tox/toxic/tarball/${version}"; name = "${name}.tar.gz"; - sha256 = "0fgkvnpy3dl2h378h796z9md0zg05b3174fgx17b919av6j9x4ma"; + sha256 = "13vns0qc0hxhab6rpz0irnzgv42mp3v1nrbwm90iymhf4xkc9nwa"; }; + makeFlags = [ "-Cbuild" "VERSION=${version}" ]; + installFlags = [ "PREFIX=$(out)" ]; - preConfigure = '' - autoreconf -i - ''; + buildInputs = [ + autoconf libtool automake libtoxcore libsodium ncurses openal libvpx + freealut libconfig pkgconfig - NIX_LDFLAGS = "-lsodium"; - - configureFlags = [ - "--with-libtoxcore-headers=${libtoxcore}/include" - "--with-libtoxcore-libs=${libtoxcore}/lib" - "--with-libsodium-headers=${libtoxcore}/include" - "--with-libsodium-libs=${libtoxcore}/lib" ]; - - buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses pkgconfig ]; - - doCheck = true; meta = { description = "Reference CLI for Tox"; license = stdenv.lib.licenses.gpl3Plus; maintainers = with stdenv.lib.maintainers; [ viric ]; platforms = stdenv.lib.platforms.all; }; }
27
0.675
9
18
bdd81fcae7421003b3594e43fe19d8b4978c2bc3
metadata.rb
metadata.rb
name 'awscreds' maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'Creates /root/.aws/config from chef-vault' long_description %( Loads credentials from chef vault and creates an aws config file (.ini format) from the loaded credentials. Supports multiple profiles and alternate locations for the credentials file.) version '0.1.0' depends 'chef-vault' source_url 'https://github.com/opscode-cookbooks/awscreds' if respond_to?(:source_url) issues_url 'https://github.com/opscode-cookbooks/awscreds/issues' if respond_to?(:issues_url)
name 'awscreds' maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'Creates /root/.aws/config from chef-vault' long_description %( Loads credentials from chef vault and creates an aws config file (.ini format) from the loaded credentials. Supports multiple profiles and alternate locations for the credentials file.) version '0.1.0' depends 'chef-vault' source_url 'https://github.com/chef-cookbooks/awscreds' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/awscreds/issues' if respond_to?(:issues_url)
Update URLs and add license
Update URLs and add license
Ruby
apache-2.0
opscode-cookbooks/awscreds,chef-cookbooks/awscreds,opscode-cookbooks/awscreds,chef-cookbooks/awscreds
ruby
## Code Before: name 'awscreds' maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'Creates /root/.aws/config from chef-vault' long_description %( Loads credentials from chef vault and creates an aws config file (.ini format) from the loaded credentials. Supports multiple profiles and alternate locations for the credentials file.) version '0.1.0' depends 'chef-vault' source_url 'https://github.com/opscode-cookbooks/awscreds' if respond_to?(:source_url) issues_url 'https://github.com/opscode-cookbooks/awscreds/issues' if respond_to?(:issues_url) ## Instruction: Update URLs and add license ## Code After: name 'awscreds' maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'Creates /root/.aws/config from chef-vault' long_description %( Loads credentials from chef vault and creates an aws config file (.ini format) from the loaded credentials. Supports multiple profiles and alternate locations for the credentials file.) version '0.1.0' depends 'chef-vault' source_url 'https://github.com/chef-cookbooks/awscreds' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/awscreds/issues' if respond_to?(:issues_url)
name 'awscreds' maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'Creates /root/.aws/config from chef-vault' long_description %( Loads credentials from chef vault and creates an aws config file (.ini format) from the loaded credentials. Supports multiple profiles and alternate locations for the credentials file.) version '0.1.0' depends 'chef-vault' - source_url 'https://github.com/opscode-cookbooks/awscreds' if respond_to?(:source_url) ? --- ^^ + source_url 'https://github.com/chef-cookbooks/awscreds' if respond_to?(:source_url) ? ^ + - issues_url 'https://github.com/opscode-cookbooks/awscreds/issues' if respond_to?(:issues_url) ? --- ^^ + issues_url 'https://github.com/chef-cookbooks/awscreds/issues' if respond_to?(:issues_url) ? ^ +
4
0.266667
2
2
2f9f9ceaf5843fb411445e074ea32ed7f679b846
week-4/count-between/my_solution.rb
week-4/count-between/my_solution.rb
def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 if (list_of_integers.length == 0) || (upper_bound < lower_bound) return 0 elsif (lower_bound == upper_bound) return list_of_integers.length else list_of_integers.each do |x| if (x >= lower_bound) && (x <= upper_bound) sum += 1 end end return sum end end
=begin Initial Solution def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 if (list_of_integers.length == 0) || (upper_bound < lower_bound) return 0 elsif (lower_bound == upper_bound) return list_of_integers.length else list_of_integers.each do |x| if (x >= lower_bound) && (x <= upper_bound) sum += 1 end end return sum end end def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 list_of_integers.each { |x| sum+=1 if (x >= lower_bound) && (x <= upper_bound) } return sum end =end #Refactored Solution def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! return list_of_integers.count { |x| (x >= lower_bound) && (x <= upper_bound) } end
Add refactored count between solution
Add refactored count between solution
Ruby
mit
espezua/phase-0,espezua/phase-0,espezua/phase-0
ruby
## Code Before: def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 if (list_of_integers.length == 0) || (upper_bound < lower_bound) return 0 elsif (lower_bound == upper_bound) return list_of_integers.length else list_of_integers.each do |x| if (x >= lower_bound) && (x <= upper_bound) sum += 1 end end return sum end end ## Instruction: Add refactored count between solution ## Code After: =begin Initial Solution def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 if (list_of_integers.length == 0) || (upper_bound < lower_bound) return 0 elsif (lower_bound == upper_bound) return list_of_integers.length else list_of_integers.each do |x| if (x >= lower_bound) && (x <= upper_bound) sum += 1 end end return sum end end def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 list_of_integers.each { |x| sum+=1 if (x >= lower_bound) && (x <= upper_bound) } return sum end =end #Refactored Solution def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! return list_of_integers.count { |x| (x >= lower_bound) && (x <= upper_bound) } end
+ =begin Initial Solution def count_between(list_of_integers, lower_bound, upper_bound) # Your code goes here! sum = 0 if (list_of_integers.length == 0) || (upper_bound < lower_bound) return 0 elsif (lower_bound == upper_bound) return list_of_integers.length else list_of_integers.each do |x| if (x >= lower_bound) && (x <= upper_bound) sum += 1 end end return sum end end + + def count_between(list_of_integers, lower_bound, upper_bound) + # Your code goes here! + sum = 0 + list_of_integers.each { |x| sum+=1 if (x >= lower_bound) && (x <= upper_bound) } + return sum + end + =end + + #Refactored Solution + + def count_between(list_of_integers, lower_bound, upper_bound) + # Your code goes here! + return list_of_integers.count { |x| (x >= lower_bound) && (x <= upper_bound) } + end
16
0.941176
16
0
0c03820bec06e044dc8d9694686efe20d5140fdc
renderer-process/matchTimestamps.js
renderer-process/matchTimestamps.js
const matchTimestamps = function (inputText) { const lengthOfDelimiter = 1 // Have to advance past/before the opening/closing brackets let bracketPattern = /\[(\d{1,2}[:.]){1,3}\d{2}\]/g let match = bracketPattern.exec(inputText) let matches = [] let startingIndex let matchLength while (match !== null) { startingIndex = (match.index + lengthOfDelimiter) matchLength = (bracketPattern.lastIndex - startingIndex - lengthOfDelimiter) matches = matches.concat({ index: startingIndex, length: matchLength }) match = bracketPattern.exec(inputText) } return (matches) } module.exports = matchTimestamps
const matchTimestamps = function (inputText) { const lengthOfDelimiter = 1 // Have to advance past/before the opening/closing brackets let bracketPattern = /\[(\d|:|.)+\]/g let match = bracketPattern.exec(inputText) let matches = [] let startingIndex let matchLength while (match !== null) { startingIndex = (match.index + lengthOfDelimiter) matchLength = (bracketPattern.lastIndex - startingIndex - lengthOfDelimiter) matches = matches.concat({ index: startingIndex, length: matchLength }) match = bracketPattern.exec(inputText) } return (matches) } module.exports = matchTimestamps
Simplify the pattern for matching timestamps
Simplify the pattern for matching timestamps This new pattern makes less strict assumptions about the structure of the timestamp. But, it also shouldn't accidentally pick up pure numbers (e.g., [22]), nor will it pick up anything with alphanumeric characters.
JavaScript
agpl-3.0
briandk/transcriptase,briandk/transcriptase
javascript
## Code Before: const matchTimestamps = function (inputText) { const lengthOfDelimiter = 1 // Have to advance past/before the opening/closing brackets let bracketPattern = /\[(\d{1,2}[:.]){1,3}\d{2}\]/g let match = bracketPattern.exec(inputText) let matches = [] let startingIndex let matchLength while (match !== null) { startingIndex = (match.index + lengthOfDelimiter) matchLength = (bracketPattern.lastIndex - startingIndex - lengthOfDelimiter) matches = matches.concat({ index: startingIndex, length: matchLength }) match = bracketPattern.exec(inputText) } return (matches) } module.exports = matchTimestamps ## Instruction: Simplify the pattern for matching timestamps This new pattern makes less strict assumptions about the structure of the timestamp. But, it also shouldn't accidentally pick up pure numbers (e.g., [22]), nor will it pick up anything with alphanumeric characters. ## Code After: const matchTimestamps = function (inputText) { const lengthOfDelimiter = 1 // Have to advance past/before the opening/closing brackets let bracketPattern = /\[(\d|:|.)+\]/g let match = bracketPattern.exec(inputText) let matches = [] let startingIndex let matchLength while (match !== null) { startingIndex = (match.index + lengthOfDelimiter) matchLength = (bracketPattern.lastIndex - startingIndex - lengthOfDelimiter) matches = matches.concat({ index: startingIndex, length: matchLength }) match = bracketPattern.exec(inputText) } return (matches) } module.exports = matchTimestamps
const matchTimestamps = function (inputText) { const lengthOfDelimiter = 1 // Have to advance past/before the opening/closing brackets - let bracketPattern = /\[(\d{1,2}[:.]){1,3}\d{2}\]/g ? ^^^^^^ - ^^^^^^^^^^ + let bracketPattern = /\[(\d|:|.)+\]/g ? ^ + ^ let match = bracketPattern.exec(inputText) let matches = [] let startingIndex let matchLength while (match !== null) { startingIndex = (match.index + lengthOfDelimiter) matchLength = (bracketPattern.lastIndex - startingIndex - lengthOfDelimiter) matches = matches.concat({ index: startingIndex, length: matchLength }) match = bracketPattern.exec(inputText) } return (matches) } module.exports = matchTimestamps
2
0.095238
1
1
adb7f8b96ed421488f067dcdf042645d4ce41b6d
webapp/app/controllers/touch_event_filter.rb
webapp/app/controllers/touch_event_filter.rb
class TouchEventFilter def self.filter(controller) controller.instance_variable_get("@event").save end end
class TouchEventFilter def self.filter(controller) touch controller.instance_variable_get("@event") end def self.touch(object, attribute = nil) current_time = Time.current if attribute object.write_attribute(attribute, current_time) else object.write_attribute('updated_at', current_time) if object.respond_to?(:updated_at) object.write_attribute('updated_on', current_time) if object.respond_to?(:updated_on) end object.save! end end
Fix TouchEventFilter to actually update the updated_at timestamp on the event record
Fix TouchEventFilter to actually update the updated_at timestamp on the event record
Ruby
agpl-3.0
csinitiative/trisano,csinitiative/trisano,csinitiative/trisano,csinitiative/trisano,csinitiative/trisano
ruby
## Code Before: class TouchEventFilter def self.filter(controller) controller.instance_variable_get("@event").save end end ## Instruction: Fix TouchEventFilter to actually update the updated_at timestamp on the event record ## Code After: class TouchEventFilter def self.filter(controller) touch controller.instance_variable_get("@event") end def self.touch(object, attribute = nil) current_time = Time.current if attribute object.write_attribute(attribute, current_time) else object.write_attribute('updated_at', current_time) if object.respond_to?(:updated_at) object.write_attribute('updated_on', current_time) if object.respond_to?(:updated_on) end object.save! end end
class TouchEventFilter def self.filter(controller) - controller.instance_variable_get("@event").save ? ----- + touch controller.instance_variable_get("@event") ? ++++++ + end + + def self.touch(object, attribute = nil) + current_time = Time.current + + if attribute + object.write_attribute(attribute, current_time) + else + object.write_attribute('updated_at', current_time) if object.respond_to?(:updated_at) + object.write_attribute('updated_on', current_time) if object.respond_to?(:updated_on) + end + + object.save! end end
15
3
14
1
36ebcb5fe592afce6394ab270f6f8dcb75e1df19
src/com/opengamma/transport/CollectingFudgeMessageReceiver.java
src/com/opengamma/transport/CollectingFudgeMessageReceiver.java
/** * Copyright (C) 2009 - 2010 by OpenGamma Inc. * * Please see distribution for license. */ package com.opengamma.transport; import java.util.LinkedList; import java.util.List; import org.fudgemsg.FudgeContext; import org.fudgemsg.FudgeMsgEnvelope; /** * Collects all Fudge message envelopes in an array for later analysis. * * @author kirk */ public class CollectingFudgeMessageReceiver implements FudgeMessageReceiver { private final List<FudgeMsgEnvelope> _messages = new LinkedList<FudgeMsgEnvelope>(); @Override public synchronized void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) { _messages.add(msgEnvelope); } public List<FudgeMsgEnvelope> getMessages() { return _messages; } public synchronized void clear() { _messages.clear(); } }
/** * Copyright (C) 2009 - 2010 by OpenGamma Inc. * * Please see distribution for license. */ package com.opengamma.transport; import java.util.LinkedList; import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import org.fudgemsg.FudgeContext; import org.fudgemsg.FudgeMsgEnvelope; /** * Collects all Fudge message envelopes in an array for later analysis. * * @author kirk */ public class CollectingFudgeMessageReceiver implements FudgeMessageReceiver { private final BlockingQueue<FudgeMsgEnvelope> _messages = new LinkedBlockingQueue<FudgeMsgEnvelope>(); @Override public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) { _messages.add(msgEnvelope); } public List<FudgeMsgEnvelope> getMessages() { return new LinkedList<FudgeMsgEnvelope>(_messages); } public void clear() { _messages.clear(); } public FudgeMsgEnvelope waitForMessage(final long timeoutMillis) { try { return _messages.poll(timeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { return null; } } }
Use a blocking queue rather than a list so that tests can wait for a message to have arrived.
Use a blocking queue rather than a list so that tests can wait for a message to have arrived.
Java
apache-2.0
nssales/OG-Platform,jeorme/OG-Platform,DevStreet/FinanceAnalytics,ChinaQuants/OG-Platform,ChinaQuants/OG-Platform,nssales/OG-Platform,McLeodMoores/starling,DevStreet/FinanceAnalytics,McLeodMoores/starling,codeaudit/OG-Platform,McLeodMoores/starling,DevStreet/FinanceAnalytics,jerome79/OG-Platform,jeorme/OG-Platform,jeorme/OG-Platform,codeaudit/OG-Platform,ChinaQuants/OG-Platform,jeorme/OG-Platform,nssales/OG-Platform,nssales/OG-Platform,jerome79/OG-Platform,jerome79/OG-Platform,ChinaQuants/OG-Platform,codeaudit/OG-Platform,codeaudit/OG-Platform,DevStreet/FinanceAnalytics,McLeodMoores/starling,jerome79/OG-Platform
java
## Code Before: /** * Copyright (C) 2009 - 2010 by OpenGamma Inc. * * Please see distribution for license. */ package com.opengamma.transport; import java.util.LinkedList; import java.util.List; import org.fudgemsg.FudgeContext; import org.fudgemsg.FudgeMsgEnvelope; /** * Collects all Fudge message envelopes in an array for later analysis. * * @author kirk */ public class CollectingFudgeMessageReceiver implements FudgeMessageReceiver { private final List<FudgeMsgEnvelope> _messages = new LinkedList<FudgeMsgEnvelope>(); @Override public synchronized void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) { _messages.add(msgEnvelope); } public List<FudgeMsgEnvelope> getMessages() { return _messages; } public synchronized void clear() { _messages.clear(); } } ## Instruction: Use a blocking queue rather than a list so that tests can wait for a message to have arrived. ## Code After: /** * Copyright (C) 2009 - 2010 by OpenGamma Inc. * * Please see distribution for license. */ package com.opengamma.transport; import java.util.LinkedList; import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import org.fudgemsg.FudgeContext; import org.fudgemsg.FudgeMsgEnvelope; /** * Collects all Fudge message envelopes in an array for later analysis. * * @author kirk */ public class CollectingFudgeMessageReceiver implements FudgeMessageReceiver { private final BlockingQueue<FudgeMsgEnvelope> _messages = new LinkedBlockingQueue<FudgeMsgEnvelope>(); @Override public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) { _messages.add(msgEnvelope); } public List<FudgeMsgEnvelope> getMessages() { return new LinkedList<FudgeMsgEnvelope>(_messages); } public void clear() { _messages.clear(); } public FudgeMsgEnvelope waitForMessage(final long timeoutMillis) { try { return _messages.poll(timeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { return null; } } }
/** * Copyright (C) 2009 - 2010 by OpenGamma Inc. * * Please see distribution for license. */ package com.opengamma.transport; import java.util.LinkedList; import java.util.List; + import java.util.concurrent.BlockingQueue; + import java.util.concurrent.LinkedBlockingQueue; + import java.util.concurrent.TimeUnit; import org.fudgemsg.FudgeContext; import org.fudgemsg.FudgeMsgEnvelope; /** * Collects all Fudge message envelopes in an array for later analysis. * * @author kirk */ public class CollectingFudgeMessageReceiver implements FudgeMessageReceiver { - private final List<FudgeMsgEnvelope> _messages = new LinkedList<FudgeMsgEnvelope>(); ? ^ ^^ ^ ^^ + private final BlockingQueue<FudgeMsgEnvelope> _messages = new LinkedBlockingQueue<FudgeMsgEnvelope>(); ? ^^^^^ ^^^^^^^ ^^^^^ ^^^^^^^ @Override + public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) { - public synchronized void messageReceived(FudgeContext fudgeContext, - FudgeMsgEnvelope msgEnvelope) { _messages.add(msgEnvelope); } public List<FudgeMsgEnvelope> getMessages() { - return _messages; + return new LinkedList<FudgeMsgEnvelope>(_messages); } - public synchronized void clear() { ? ------------- + public void clear() { _messages.clear(); } + public FudgeMsgEnvelope waitForMessage(final long timeoutMillis) { + try { + return _messages.poll(timeoutMillis, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + return null; + } + } + }
20
0.555556
15
5
569f6d4dd3a34738eb635859b8f2cc3500a232d5
buddybuild_release_notes.txt
buddybuild_release_notes.txt
* Customização do mapa e fontes * Visualização dos bicicletários no mapa * Página de detalhes do bicicletário com foto, tags, nota, tipo e público/restrito * Expansão da foto do bicicletário * Busca por endereço * Como chegar redirecionando pro google maps. * Hamburger menu (nada funcional ainda) * Botão de "minha localização" * Filtragem de bicicletários
* Customização do mapa e fontes * Visualização dos bicicletários no mapa * Página de detalhes do bicicletário com foto, tags, nota, tipo e público/restrito * Expansão da foto do bicicletário * Busca por endereço * Como chegar redirecionando pro google maps. * Hamburger menu (nada funcional ainda) * Botão de "minha localização" * Filtragem de bicicletários * Caching de thumbnails bonitinhos.
Add changes to buddybuild release notes.
Add changes to buddybuild release notes.
Text
mit
EduardoVernier/bikedeboa-android
text
## Code Before: * Customização do mapa e fontes * Visualização dos bicicletários no mapa * Página de detalhes do bicicletário com foto, tags, nota, tipo e público/restrito * Expansão da foto do bicicletário * Busca por endereço * Como chegar redirecionando pro google maps. * Hamburger menu (nada funcional ainda) * Botão de "minha localização" * Filtragem de bicicletários ## Instruction: Add changes to buddybuild release notes. ## Code After: * Customização do mapa e fontes * Visualização dos bicicletários no mapa * Página de detalhes do bicicletário com foto, tags, nota, tipo e público/restrito * Expansão da foto do bicicletário * Busca por endereço * Como chegar redirecionando pro google maps. * Hamburger menu (nada funcional ainda) * Botão de "minha localização" * Filtragem de bicicletários * Caching de thumbnails bonitinhos.
* Customização do mapa e fontes * Visualização dos bicicletários no mapa * Página de detalhes do bicicletário com foto, tags, nota, tipo e público/restrito * Expansão da foto do bicicletário * Busca por endereço * Como chegar redirecionando pro google maps. * Hamburger menu (nada funcional ainda) * Botão de "minha localização" * Filtragem de bicicletários + * Caching de thumbnails bonitinhos.
1
0.111111
1
0
8119e3bd379a8cbacc895487463fb24a0048dd16
app/views/gobierto_admin/gobierto_people/configuration/_navigation.html.erb
app/views/gobierto_admin/gobierto_people/configuration/_navigation.html.erb
<div class="admin_breadcrumb"> <%= link_to t("gobierto_admin.welcome.index.title"), admin_root_path %> » <%= link_to t("gobierto_admin.gobierto_people.people.index.title"), admin_people_people_path %> » <%= link_to t("gobierto_admin.gobierto_people.configuration.title"), admin_people_configuration_political_groups_path %> » <% if controller_name == 'political_groups' %> <%= t("gobierto_admin.gobierto_people.political_groups.title") %> <% elsif controller_name == 'settings' %> <%= t("gobierto_admin.gobierto_people.settings.title") %> <% end %> </div> <h1><%= t("gobierto_admin.gobierto_people.configuration.title") %></h1> <div class="tabs"> <ul> <li <%= %Q{class="active"}.html_safe if controller_name == 'political_groups'%>> <%= link_to t("gobierto_admin.gobierto_people.political_groups.title"), admin_people_configuration_political_groups_path %> </li> <li <%= %Q{class="active"}.html_safe if controller_name == 'settings'%>> <%= link_to t("gobierto_admin.gobierto_people.settings.title"), admin_people_configuration_settings_path %> </li> </ul> </div>
<div class="admin_breadcrumb"> <%= link_to t("gobierto_admin.welcome.index.title"), admin_root_path %> » <%= link_to t("gobierto_admin.gobierto_people.people.index.title"), admin_people_people_path %> » <%= link_to t("gobierto_admin.gobierto_people.configuration.title"), admin_people_configuration_political_groups_path %> » <% if controller_name == 'political_groups' %> <%= t("gobierto_admin.gobierto_people.political_groups.title") %> <% elsif controller_name == 'settings' %> <%= t("gobierto_admin.gobierto_people.settings.title") %> <% end %> </div> <h1><%= t("gobierto_admin.gobierto_people.configuration.title") %></h1> <div class="tabs"> <ul> <li <%= %Q{class="active"}.html_safe if controller_name == 'settings'%>> <%= link_to t("gobierto_admin.gobierto_people.settings.title"), admin_people_configuration_settings_path %> </li> <li <%= %Q{class="active"}.html_safe if controller_name == 'political_groups'%>> <%= link_to t("gobierto_admin.gobierto_people.political_groups.title"), admin_people_configuration_political_groups_path %> </li> </ul> </div>
Make preferences tab in admin/people/configuration/settings appear first
Make preferences tab in admin/people/configuration/settings appear first
HTML+ERB
agpl-3.0
PopulateTools/gobierto,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev
html+erb
## Code Before: <div class="admin_breadcrumb"> <%= link_to t("gobierto_admin.welcome.index.title"), admin_root_path %> » <%= link_to t("gobierto_admin.gobierto_people.people.index.title"), admin_people_people_path %> » <%= link_to t("gobierto_admin.gobierto_people.configuration.title"), admin_people_configuration_political_groups_path %> » <% if controller_name == 'political_groups' %> <%= t("gobierto_admin.gobierto_people.political_groups.title") %> <% elsif controller_name == 'settings' %> <%= t("gobierto_admin.gobierto_people.settings.title") %> <% end %> </div> <h1><%= t("gobierto_admin.gobierto_people.configuration.title") %></h1> <div class="tabs"> <ul> <li <%= %Q{class="active"}.html_safe if controller_name == 'political_groups'%>> <%= link_to t("gobierto_admin.gobierto_people.political_groups.title"), admin_people_configuration_political_groups_path %> </li> <li <%= %Q{class="active"}.html_safe if controller_name == 'settings'%>> <%= link_to t("gobierto_admin.gobierto_people.settings.title"), admin_people_configuration_settings_path %> </li> </ul> </div> ## Instruction: Make preferences tab in admin/people/configuration/settings appear first ## Code After: <div class="admin_breadcrumb"> <%= link_to t("gobierto_admin.welcome.index.title"), admin_root_path %> » <%= link_to t("gobierto_admin.gobierto_people.people.index.title"), admin_people_people_path %> » <%= link_to t("gobierto_admin.gobierto_people.configuration.title"), admin_people_configuration_political_groups_path %> » <% if controller_name == 'political_groups' %> <%= t("gobierto_admin.gobierto_people.political_groups.title") %> <% elsif controller_name == 'settings' %> <%= t("gobierto_admin.gobierto_people.settings.title") %> <% end %> </div> <h1><%= t("gobierto_admin.gobierto_people.configuration.title") %></h1> <div class="tabs"> <ul> <li <%= %Q{class="active"}.html_safe if controller_name == 'settings'%>> <%= link_to t("gobierto_admin.gobierto_people.settings.title"), admin_people_configuration_settings_path %> </li> <li <%= %Q{class="active"}.html_safe if controller_name == 'political_groups'%>> <%= link_to t("gobierto_admin.gobierto_people.political_groups.title"), admin_people_configuration_political_groups_path %> </li> </ul> </div>
<div class="admin_breadcrumb"> <%= link_to t("gobierto_admin.welcome.index.title"), admin_root_path %> » <%= link_to t("gobierto_admin.gobierto_people.people.index.title"), admin_people_people_path %> » <%= link_to t("gobierto_admin.gobierto_people.configuration.title"), admin_people_configuration_political_groups_path %> » <% if controller_name == 'political_groups' %> <%= t("gobierto_admin.gobierto_people.political_groups.title") %> <% elsif controller_name == 'settings' %> <%= t("gobierto_admin.gobierto_people.settings.title") %> <% end %> </div> <h1><%= t("gobierto_admin.gobierto_people.configuration.title") %></h1> <div class="tabs"> <ul> + <li <%= %Q{class="active"}.html_safe if controller_name == 'settings'%>> + <%= link_to t("gobierto_admin.gobierto_people.settings.title"), admin_people_configuration_settings_path %> + </li> <li <%= %Q{class="active"}.html_safe if controller_name == 'political_groups'%>> <%= link_to t("gobierto_admin.gobierto_people.political_groups.title"), admin_people_configuration_political_groups_path %> </li> - <li <%= %Q{class="active"}.html_safe if controller_name == 'settings'%>> - <%= link_to t("gobierto_admin.gobierto_people.settings.title"), admin_people_configuration_settings_path %> - </li> </ul> </div>
6
0.26087
3
3
41f5cf796910ac2037e2d98a28c0aa7e293c6139
assets/css/scss/_freebies.scss
assets/css/scss/_freebies.scss
/* Start freebies.scss * Date Created: 29/12/2015 * Last Modified: 29/12/2015 */ body { &.freebies-page { } }
/* Start freebies.scss * Date Created: 29/12/2015 * Last Modified: 29/12/2015 */ body { &.freebies-page { .site-content { margin: 100px auto 0 auto; max-width: 1379px; width: $full; } } } .freebies-page { .freebies-section { width: $full; @extend .text-center; height: 500px; } }
Add basic styles to freebies page
Add basic styles to freebies page
SCSS
mit
Whizkydee/webtwic,Whizkydee/webtwic,webtwic/webtwic.github.io,webtwic/webtwic.github.io
scss
## Code Before: /* Start freebies.scss * Date Created: 29/12/2015 * Last Modified: 29/12/2015 */ body { &.freebies-page { } } ## Instruction: Add basic styles to freebies page ## Code After: /* Start freebies.scss * Date Created: 29/12/2015 * Last Modified: 29/12/2015 */ body { &.freebies-page { .site-content { margin: 100px auto 0 auto; max-width: 1379px; width: $full; } } } .freebies-page { .freebies-section { width: $full; @extend .text-center; height: 500px; } }
/* Start freebies.scss * Date Created: 29/12/2015 * Last Modified: 29/12/2015 */ body { &.freebies-page { - + .site-content { + margin: 100px auto 0 auto; + max-width: 1379px; + width: $full; + } } } + .freebies-page { + .freebies-section { + width: $full; + @extend .text-center; + height: 500px; + } + }
13
0.866667
12
1
b5bcbf48e129864891f3cc5fc3ef7878cac91b3a
stage.sh
stage.sh
DATE=`date "+%Y-%m-%d"` TARGET=saw-alpha-${DATE} NM=`uname` mkdir -p ${TARGET}/bin mkdir -p ${TARGET}/doc if [ "${OS}" == "Windows_NT" ]; then EXEDIR=windows elif [ "${NM}" == "Darwin" ]; then EXEDIR=macosx else EXEDIR=linux fi echo Staging ... strip build/bin/* cp deps/abcBridge/abc/copyright.txt ${TARGET}/ABC_LICENSE cp build/bin/* ${TARGET}/bin cp doc/extcore.txt ${TARGET}/doc cp doc/tutorial/tutorial.* ${TARGET}/doc cp -r doc/tutorial/code ${TARGET}/doc rm -f build/bin/long-test rm -f build/bin/ppsh if [ "${OS}" == "Windows_NT" ]; then zip -r ${TARGET}-${EXEDIR}.zip ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.zip" else tar cvfz ${TARGET}-${EXEDIR}.tar.gz ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.tar.gz" fi
DATE=`date "+%Y-%m-%d"` TARGET=saw-alpha-${DATE} NM=`uname` mkdir -p ${TARGET}/bin mkdir -p ${TARGET}/doc if [ "${OS}" == "Windows_NT" ]; then EXEDIR=windows elif [ "${NM}" == "Darwin" ]; then EXEDIR=macosx else EXEDIR=linux fi echo Staging ... strip build/bin/* cp deps/abcBridge/abc/copyright.txt ${TARGET}/ABC_LICENSE cp build/bin/* ${TARGET}/bin cp doc/extcore.txt ${TARGET}/doc cp doc/tutorial/tutorial.* ${TARGET}/doc cp -r doc/tutorial/code ${TARGET}/doc cp -r ../Examples/ecdsa ${TARGET}/ecdsa rm -f build/bin/long-test* rm -f build/bin/ppsh* rm -f build/bin/cryptol* rm -rf ${TARGET}/ecdsa/cryptol-2-spec if [ "${OS}" == "Windows_NT" ]; then zip -r ${TARGET}-${EXEDIR}.zip ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.zip" else tar cvfz ${TARGET}-${EXEDIR}.tar.gz ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.tar.gz" fi
Include ECDSA proof in binary tarballs.
Include ECDSA proof in binary tarballs.
Shell
bsd-3-clause
GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script
shell
## Code Before: DATE=`date "+%Y-%m-%d"` TARGET=saw-alpha-${DATE} NM=`uname` mkdir -p ${TARGET}/bin mkdir -p ${TARGET}/doc if [ "${OS}" == "Windows_NT" ]; then EXEDIR=windows elif [ "${NM}" == "Darwin" ]; then EXEDIR=macosx else EXEDIR=linux fi echo Staging ... strip build/bin/* cp deps/abcBridge/abc/copyright.txt ${TARGET}/ABC_LICENSE cp build/bin/* ${TARGET}/bin cp doc/extcore.txt ${TARGET}/doc cp doc/tutorial/tutorial.* ${TARGET}/doc cp -r doc/tutorial/code ${TARGET}/doc rm -f build/bin/long-test rm -f build/bin/ppsh if [ "${OS}" == "Windows_NT" ]; then zip -r ${TARGET}-${EXEDIR}.zip ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.zip" else tar cvfz ${TARGET}-${EXEDIR}.tar.gz ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.tar.gz" fi ## Instruction: Include ECDSA proof in binary tarballs. ## Code After: DATE=`date "+%Y-%m-%d"` TARGET=saw-alpha-${DATE} NM=`uname` mkdir -p ${TARGET}/bin mkdir -p ${TARGET}/doc if [ "${OS}" == "Windows_NT" ]; then EXEDIR=windows elif [ "${NM}" == "Darwin" ]; then EXEDIR=macosx else EXEDIR=linux fi echo Staging ... strip build/bin/* cp deps/abcBridge/abc/copyright.txt ${TARGET}/ABC_LICENSE cp build/bin/* ${TARGET}/bin cp doc/extcore.txt ${TARGET}/doc cp doc/tutorial/tutorial.* ${TARGET}/doc cp -r doc/tutorial/code ${TARGET}/doc cp -r ../Examples/ecdsa ${TARGET}/ecdsa rm -f build/bin/long-test* rm -f build/bin/ppsh* rm -f build/bin/cryptol* rm -rf ${TARGET}/ecdsa/cryptol-2-spec if [ "${OS}" == "Windows_NT" ]; then zip -r ${TARGET}-${EXEDIR}.zip ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.zip" else tar cvfz ${TARGET}-${EXEDIR}.tar.gz ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.tar.gz" fi
DATE=`date "+%Y-%m-%d"` TARGET=saw-alpha-${DATE} NM=`uname` mkdir -p ${TARGET}/bin mkdir -p ${TARGET}/doc if [ "${OS}" == "Windows_NT" ]; then EXEDIR=windows elif [ "${NM}" == "Darwin" ]; then EXEDIR=macosx else EXEDIR=linux fi echo Staging ... strip build/bin/* cp deps/abcBridge/abc/copyright.txt ${TARGET}/ABC_LICENSE cp build/bin/* ${TARGET}/bin cp doc/extcore.txt ${TARGET}/doc cp doc/tutorial/tutorial.* ${TARGET}/doc cp -r doc/tutorial/code ${TARGET}/doc + cp -r ../Examples/ecdsa ${TARGET}/ecdsa - rm -f build/bin/long-test + rm -f build/bin/long-test* ? + - rm -f build/bin/ppsh + rm -f build/bin/ppsh* ? + + rm -f build/bin/cryptol* + rm -rf ${TARGET}/ecdsa/cryptol-2-spec if [ "${OS}" == "Windows_NT" ]; then zip -r ${TARGET}-${EXEDIR}.zip ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.zip" else tar cvfz ${TARGET}-${EXEDIR}.tar.gz ${TARGET} echo "Release package is ${TARGET}-${EXEDIR}.tar.gz" fi
7
0.194444
5
2
1a01c15560ce6e9dbbf2843a29008e3e76b2c3a5
requirements.txt
requirements.txt
amqp==2.1.4 appdirs==1.4.0 asgi-redis==1.0.0 asgiref==1.0.0 autobahn==0.17.1 billiard==3.5.0.2 celery==4.0.2 channels==1.0.2 constantly==15.1.0 daphne==1.0.1 Django==1.10.5 django-auth-ldap==1.2.8 incremental==16.10.1 kombu==4.0.2 msgpack-python==0.4.8 packaging==16.8 psycopg2==2.6.2 pyldap==2.4.28 pyparsing==2.1.10 pytz==2016.10 redis==2.10.5 requests==2.13.0 six==1.10.0 slacker==0.9.42 Twisted==16.6.0 txaio==2.6.0 vine==1.1.3 zope.interface==4.3.3
amqp==2.1.4 appdirs==1.4.0 asgi-redis==1.0.0 asgiref==1.0.0 autobahn==0.17.1 Babel==2.3.4 billiard==3.5.0.2 celery==4.0.2 channels==1.0.2 constantly==15.1.0 daphne==1.0.1 Django==1.10.5 django-auth-ldap==1.2.8 flower==0.9.1 incremental==16.10.1 kombu==4.0.2 msgpack-python==0.4.8 packaging==16.8 psycopg2==2.6.2 pyldap==2.4.28 pyparsing==2.1.10 pytz==2016.10 redis==2.10.5 requests==2.13.0 six==1.10.0 slacker==0.9.42 tornado==4.2 Twisted==16.6.0 txaio==2.6.0 vine==1.1.3 zope.interface==4.3.3
Add flower for worker monitoring
Add flower for worker monitoring
Text
apache-2.0
ritstudentgovernment/PawPrints,ritstudentgovernment/PawPrints,ritstudentgovernment/PawPrints,ritstudentgovernment/PawPrints
text
## Code Before: amqp==2.1.4 appdirs==1.4.0 asgi-redis==1.0.0 asgiref==1.0.0 autobahn==0.17.1 billiard==3.5.0.2 celery==4.0.2 channels==1.0.2 constantly==15.1.0 daphne==1.0.1 Django==1.10.5 django-auth-ldap==1.2.8 incremental==16.10.1 kombu==4.0.2 msgpack-python==0.4.8 packaging==16.8 psycopg2==2.6.2 pyldap==2.4.28 pyparsing==2.1.10 pytz==2016.10 redis==2.10.5 requests==2.13.0 six==1.10.0 slacker==0.9.42 Twisted==16.6.0 txaio==2.6.0 vine==1.1.3 zope.interface==4.3.3 ## Instruction: Add flower for worker monitoring ## Code After: amqp==2.1.4 appdirs==1.4.0 asgi-redis==1.0.0 asgiref==1.0.0 autobahn==0.17.1 Babel==2.3.4 billiard==3.5.0.2 celery==4.0.2 channels==1.0.2 constantly==15.1.0 daphne==1.0.1 Django==1.10.5 django-auth-ldap==1.2.8 flower==0.9.1 incremental==16.10.1 kombu==4.0.2 msgpack-python==0.4.8 packaging==16.8 psycopg2==2.6.2 pyldap==2.4.28 pyparsing==2.1.10 pytz==2016.10 redis==2.10.5 requests==2.13.0 six==1.10.0 slacker==0.9.42 tornado==4.2 Twisted==16.6.0 txaio==2.6.0 vine==1.1.3 zope.interface==4.3.3
amqp==2.1.4 appdirs==1.4.0 asgi-redis==1.0.0 asgiref==1.0.0 autobahn==0.17.1 + Babel==2.3.4 billiard==3.5.0.2 celery==4.0.2 channels==1.0.2 constantly==15.1.0 daphne==1.0.1 Django==1.10.5 django-auth-ldap==1.2.8 + flower==0.9.1 incremental==16.10.1 kombu==4.0.2 msgpack-python==0.4.8 packaging==16.8 psycopg2==2.6.2 pyldap==2.4.28 pyparsing==2.1.10 pytz==2016.10 redis==2.10.5 requests==2.13.0 six==1.10.0 slacker==0.9.42 + tornado==4.2 Twisted==16.6.0 txaio==2.6.0 vine==1.1.3 zope.interface==4.3.3
3
0.107143
3
0
dc0842fd7cca71f2e54969b18d45376a4acafc48
metadata/net.gsantner.markor.txt
metadata/net.gsantner.markor.txt
Categories:Writing License:MIT Web Site:https://github.com/gsantner/markor/blob/HEAD/README.md Source Code:https://github.com/gsantner/markor Issue Tracker:https://github.com/gsantner/markor/issues Changelog:https://github.com/gsantner/markor/blob/HEAD/CHANGELOG.md Donate:https://gsantner.github.io/#donate Bitcoin:1B9ZyYdQoY9BxMe9dRUEKaZbJWsbQqfXU5 Auto Name:Markor Repo Type:git Repo:https://github.com/gsantner/markor Build:0.1.0,1 commit=v0.1.0 subdir=app submodules=yes gradle=FlavorDefault Maintainer Notes: Description and summary in git metadata submodule . Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.1.0 Current Version Code:1
Categories:Writing License:MIT Web Site:https://github.com/gsantner/markor/blob/HEAD/README.md Source Code:https://github.com/gsantner/markor Issue Tracker:https://github.com/gsantner/markor/issues Changelog:https://github.com/gsantner/markor/blob/HEAD/CHANGELOG.md Donate:https://gsantner.github.io/#donate Bitcoin:1B9ZyYdQoY9BxMe9dRUEKaZbJWsbQqfXU5 Auto Name:Markor Repo Type:git Repo:https://github.com/gsantner/markor Build:0.1.0,1 commit=v0.1.0 subdir=app submodules=yes gradle=FlavorDefault Build:0.1.1,2 commit=v0.1.1 subdir=app submodules=yes gradle=FlavorDefault Maintainer Notes: Description and summary in git metadata submodule . Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.1.1 Current Version Code:2
Update Markor to 0.1.1 (2)
Update Markor to 0.1.1 (2)
Text
agpl-3.0
f-droid/fdroiddata,f-droid/fdroid-data,f-droid/fdroiddata
text
## Code Before: Categories:Writing License:MIT Web Site:https://github.com/gsantner/markor/blob/HEAD/README.md Source Code:https://github.com/gsantner/markor Issue Tracker:https://github.com/gsantner/markor/issues Changelog:https://github.com/gsantner/markor/blob/HEAD/CHANGELOG.md Donate:https://gsantner.github.io/#donate Bitcoin:1B9ZyYdQoY9BxMe9dRUEKaZbJWsbQqfXU5 Auto Name:Markor Repo Type:git Repo:https://github.com/gsantner/markor Build:0.1.0,1 commit=v0.1.0 subdir=app submodules=yes gradle=FlavorDefault Maintainer Notes: Description and summary in git metadata submodule . Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.1.0 Current Version Code:1 ## Instruction: Update Markor to 0.1.1 (2) ## Code After: Categories:Writing License:MIT Web Site:https://github.com/gsantner/markor/blob/HEAD/README.md Source Code:https://github.com/gsantner/markor Issue Tracker:https://github.com/gsantner/markor/issues Changelog:https://github.com/gsantner/markor/blob/HEAD/CHANGELOG.md Donate:https://gsantner.github.io/#donate Bitcoin:1B9ZyYdQoY9BxMe9dRUEKaZbJWsbQqfXU5 Auto Name:Markor Repo Type:git Repo:https://github.com/gsantner/markor Build:0.1.0,1 commit=v0.1.0 subdir=app submodules=yes gradle=FlavorDefault Build:0.1.1,2 commit=v0.1.1 subdir=app submodules=yes gradle=FlavorDefault Maintainer Notes: Description and summary in git metadata submodule . Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.1.1 Current Version Code:2
Categories:Writing License:MIT Web Site:https://github.com/gsantner/markor/blob/HEAD/README.md Source Code:https://github.com/gsantner/markor Issue Tracker:https://github.com/gsantner/markor/issues Changelog:https://github.com/gsantner/markor/blob/HEAD/CHANGELOG.md Donate:https://gsantner.github.io/#donate Bitcoin:1B9ZyYdQoY9BxMe9dRUEKaZbJWsbQqfXU5 Auto Name:Markor Repo Type:git Repo:https://github.com/gsantner/markor Build:0.1.0,1 commit=v0.1.0 subdir=app submodules=yes gradle=FlavorDefault + Build:0.1.1,2 + commit=v0.1.1 + subdir=app + submodules=yes + gradle=FlavorDefault + Maintainer Notes: Description and summary in git metadata submodule . Auto Update Mode:Version v%v Update Check Mode:Tags - Current Version:0.1.0 ? ^ + Current Version:0.1.1 ? ^ - Current Version Code:1 ? ^ + Current Version Code:2 ? ^
10
0.357143
8
2
1b8fb69c19a7a0bb7b4ad49355128a1aa21792c4
admeshgui.rb
admeshgui.rb
class Admeshgui < Formula homepage "https://github.com/vyvledav/ADMeshGUI" head "https://github.com/vyvledav/ADMeshGUI.git" env :std depends_on "admesh" depends_on "stlsplit" depends_on "qt5" depends_on "gettext" def install system "qmake", "LIBS+=-L#{HOMEBREW_PREFIX}/opt/admesh/lib -L#{HOMEBREW_PREFIX}/opt/stlsplit/lib -L#{HOMEBREW_PREFIX}/opt/gettext/lib", "QMAKE_CXXFLAGS+=-I#{HOMEBREW_PREFIX}/opt/gettext/include" system "make" system "ln", "-s", "../admeshgui.app/Contents/MacOS/admeshgui", "admeshgui" prefix.install "admeshgui.app" bin.install "admeshgui" end test do system "true" end end
class Admeshgui < Formula homepage "https://github.com/vyvledav/ADMeshGUI" head "https://github.com/vyvledav/ADMeshGUI.git" env :std depends_on "admesh" depends_on "stlsplit" depends_on "qt5" depends_on "gettext" def install system "qmake", "LIBS+=-L#{HOMEBREW_PREFIX}/opt/admesh/lib -L#{HOMEBREW_PREFIX}/opt/stlsplit/lib -L#{HOMEBREW_PREFIX}/opt/gettext/lib", "QMAKE_CXXFLAGS+=-I#{HOMEBREW_PREFIX}/opt/gettext/include" system "make" system "ln", "-s", "../ADMeshGUI.app/Contents/MacOS/ADMeshGUI", "admeshgui" prefix.install "ADMeshGUI.app" bin.install "admeshgui" end test do system "true" end end
Rename the app bundle to camel case
Rename the app bundle to camel case
Ruby
bsd-2-clause
admesh/homebrew-admesh
ruby
## Code Before: class Admeshgui < Formula homepage "https://github.com/vyvledav/ADMeshGUI" head "https://github.com/vyvledav/ADMeshGUI.git" env :std depends_on "admesh" depends_on "stlsplit" depends_on "qt5" depends_on "gettext" def install system "qmake", "LIBS+=-L#{HOMEBREW_PREFIX}/opt/admesh/lib -L#{HOMEBREW_PREFIX}/opt/stlsplit/lib -L#{HOMEBREW_PREFIX}/opt/gettext/lib", "QMAKE_CXXFLAGS+=-I#{HOMEBREW_PREFIX}/opt/gettext/include" system "make" system "ln", "-s", "../admeshgui.app/Contents/MacOS/admeshgui", "admeshgui" prefix.install "admeshgui.app" bin.install "admeshgui" end test do system "true" end end ## Instruction: Rename the app bundle to camel case ## Code After: class Admeshgui < Formula homepage "https://github.com/vyvledav/ADMeshGUI" head "https://github.com/vyvledav/ADMeshGUI.git" env :std depends_on "admesh" depends_on "stlsplit" depends_on "qt5" depends_on "gettext" def install system "qmake", "LIBS+=-L#{HOMEBREW_PREFIX}/opt/admesh/lib -L#{HOMEBREW_PREFIX}/opt/stlsplit/lib -L#{HOMEBREW_PREFIX}/opt/gettext/lib", "QMAKE_CXXFLAGS+=-I#{HOMEBREW_PREFIX}/opt/gettext/include" system "make" system "ln", "-s", "../ADMeshGUI.app/Contents/MacOS/ADMeshGUI", "admeshgui" prefix.install "ADMeshGUI.app" bin.install "admeshgui" end test do system "true" end end
class Admeshgui < Formula homepage "https://github.com/vyvledav/ADMeshGUI" head "https://github.com/vyvledav/ADMeshGUI.git" env :std depends_on "admesh" depends_on "stlsplit" depends_on "qt5" depends_on "gettext" def install system "qmake", "LIBS+=-L#{HOMEBREW_PREFIX}/opt/admesh/lib -L#{HOMEBREW_PREFIX}/opt/stlsplit/lib -L#{HOMEBREW_PREFIX}/opt/gettext/lib", "QMAKE_CXXFLAGS+=-I#{HOMEBREW_PREFIX}/opt/gettext/include" system "make" - system "ln", "-s", "../admeshgui.app/Contents/MacOS/admeshgui", "admeshgui" ? ^^^ ^^^ ^^^ ^^^ + system "ln", "-s", "../ADMeshGUI.app/Contents/MacOS/ADMeshGUI", "admeshgui" ? ^^^ ^^^ ^^^ ^^^ - prefix.install "admeshgui.app" ? ^^^ ^^^ + prefix.install "ADMeshGUI.app" ? ^^^ ^^^ bin.install "admeshgui" end test do system "true" end end
4
0.173913
2
2
bfe216a204a7256940a239fc8a1a3c9c57bab49c
composer.json
composer.json
{ "name": "mandango/mandango-behaviors", "description": "Bahaviors for Mandango, the Simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB", "homepage": "http://mandango.org/", "keywords": ["mandango","behaviors"], "type": "library", "license": "MIT", "authors": [ { "name": "Pablo Díez", "email": "pablodip@gmail.com" } ], "require": { "php": ">=5.3.0", "mandango/mandango": "dev-master" }, "autoload": { "psr-0": { "Mandango\\Behavior\\": "src/" } }, "minimum-stability": "dev" }
{ "name": "mandango/mandango-behaviors", "description": "Bahaviors for Mandango, the Simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB", "homepage": "http://mandango.org/", "keywords": ["mandango","behaviors"], "type": "library", "license": "MIT", "authors": [ { "name": "Pablo Díez", "email": "pablodip@gmail.com" } ], "require": { "php": ">=5.3.0", "mandango/mandango": "~1.1" }, "autoload": { "psr-0": { "Mandango\\Behavior\\": "src/" } }, "minimum-stability": "dev" }
Use a higher version of mandango.
Use a higher version of mandango.
JSON
mit
whiteoctober/mandango-behaviors,whiteoctober/mandango-behaviors
json
## Code Before: { "name": "mandango/mandango-behaviors", "description": "Bahaviors for Mandango, the Simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB", "homepage": "http://mandango.org/", "keywords": ["mandango","behaviors"], "type": "library", "license": "MIT", "authors": [ { "name": "Pablo Díez", "email": "pablodip@gmail.com" } ], "require": { "php": ">=5.3.0", "mandango/mandango": "dev-master" }, "autoload": { "psr-0": { "Mandango\\Behavior\\": "src/" } }, "minimum-stability": "dev" } ## Instruction: Use a higher version of mandango. ## Code After: { "name": "mandango/mandango-behaviors", "description": "Bahaviors for Mandango, the Simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB", "homepage": "http://mandango.org/", "keywords": ["mandango","behaviors"], "type": "library", "license": "MIT", "authors": [ { "name": "Pablo Díez", "email": "pablodip@gmail.com" } ], "require": { "php": ">=5.3.0", "mandango/mandango": "~1.1" }, "autoload": { "psr-0": { "Mandango\\Behavior\\": "src/" } }, "minimum-stability": "dev" }
{ "name": "mandango/mandango-behaviors", "description": "Bahaviors for Mandango, the Simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB", "homepage": "http://mandango.org/", "keywords": ["mandango","behaviors"], "type": "library", "license": "MIT", "authors": [ { "name": "Pablo Díez", "email": "pablodip@gmail.com" } ], "require": { "php": ">=5.3.0", - "mandango/mandango": "dev-master" ? ^^^^^^^^^^ + "mandango/mandango": "~1.1" ? ^^^^ }, "autoload": { "psr-0": { "Mandango\\Behavior\\": "src/" } }, "minimum-stability": "dev" }
2
0.090909
1
1
e5f8efbd43362f0cc0acf0a98594c293944935fd
.travis.yml
.travis.yml
sudo: false language: python python: - "2.7" - "3.4" env: - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_mysql' - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_mysql' - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_mysql' addons: - postgresql: "9.3" install: - pip install -q Django==$DJANGO - pip install coveralls - pip install -r test_requirements.pip script: - coverage run --source=django_cron setup.py test after_success: - coveralls before_script: - mysql -e 'create database travis_test;' - psql -c 'create database travis_test;' -U postgres - flake8 . --config=flake8
sudo: false language: python python: - "2.7" - "3.4" env: - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_mysql' - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_mysql' addons: - postgresql: "9.3" install: - pip install -q Django==$DJANGO - pip install coveralls - pip install -r test_requirements.pip script: - coverage run --source=django_cron setup.py test after_success: - coveralls before_script: - mysql -e 'create database travis_test;' - psql -c 'create database travis_test;' -U postgres - flake8 . --config=flake8
Update Django versions in Travis config
Update Django versions in Travis config
YAML
mit
Tivix/django-cron
yaml
## Code Before: sudo: false language: python python: - "2.7" - "3.4" env: - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_mysql' - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_mysql' - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_mysql' addons: - postgresql: "9.3" install: - pip install -q Django==$DJANGO - pip install coveralls - pip install -r test_requirements.pip script: - coverage run --source=django_cron setup.py test after_success: - coveralls before_script: - mysql -e 'create database travis_test;' - psql -c 'create database travis_test;' -U postgres - flake8 . --config=flake8 ## Instruction: Update Django versions in Travis config ## Code After: sudo: false language: python python: - "2.7" - "3.4" env: - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_mysql' - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_sqllite' - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_postgres' - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_mysql' addons: - postgresql: "9.3" install: - pip install -q Django==$DJANGO - pip install coveralls - pip install -r test_requirements.pip script: - coverage run --source=django_cron setup.py test after_success: - coveralls before_script: - mysql -e 'create database travis_test;' - psql -c 'create database travis_test;' -U postgres - flake8 . --config=flake8
sudo: false language: python python: - "2.7" - "3.4" env: - - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_sqllite' - - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_postgres' - - DJANGO=1.8.7 DJANGO_SETTINGS_MODULE='settings_mysql' - - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_sqllite' - - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_postgres' - - DJANGO=1.9 DJANGO_SETTINGS_MODULE='settings_mysql' - - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_sqllite' ? ^ + - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_sqllite' ? ^ + - - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_postgres' ? ^ + - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_postgres' ? ^ + - - DJANGO=1.10.1 DJANGO_SETTINGS_MODULE='settings_mysql' ? ^ + - DJANGO=1.11.13 DJANGO_SETTINGS_MODULE='settings_mysql' ? ^ + + - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_sqllite' + - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_postgres' + - DJANGO=2.0.6 DJANGO_SETTINGS_MODULE='settings_mysql' addons: - postgresql: "9.3" install: - pip install -q Django==$DJANGO - pip install coveralls - pip install -r test_requirements.pip script: - coverage run --source=django_cron setup.py test after_success: - coveralls before_script: - mysql -e 'create database travis_test;' - psql -c 'create database travis_test;' -U postgres - flake8 . --config=flake8
15
0.517241
6
9
fe98809bc006d165d7681a6a9b5411ebc0c2caf2
app/views/welcome/index.html.erb
app/views/welcome/index.html.erb
<h1 id="wak">wak</h1> <img id="wak-img" src="/assets/gunther.png" alt="Gunther from Adventure Time">
<h1 id="wak">wak</h1> <%= image_tag 'gunther.png', id: 'wak-img', alt: 'Gunther from Adventure Time' %>
Fix declaration of image to use asset helper
Fix declaration of image to use asset helper
HTML+ERB
mit
mgarbacz/existential.io
html+erb
## Code Before: <h1 id="wak">wak</h1> <img id="wak-img" src="/assets/gunther.png" alt="Gunther from Adventure Time"> ## Instruction: Fix declaration of image to use asset helper ## Code After: <h1 id="wak">wak</h1> <%= image_tag 'gunther.png', id: 'wak-img', alt: 'Gunther from Adventure Time' %>
<h1 id="wak">wak</h1> - <img id="wak-img" src="/assets/gunther.png" alt="Gunther from Adventure Time"> + <%= image_tag 'gunther.png', + id: 'wak-img', + alt: 'Gunther from Adventure Time' %>
4
2
3
1
d55c4f15d2f4ffc4972271bd589b188ddf66a0b7
.travis.yml
.travis.yml
language: java before_install: - git clone https://github.com/ivanceras/commons.git - cd commons - mvn clean install
language: java before_install: - git clone https://github.com/ivanceras/parent.git - cd parent - mvn clean install - cd ../ - git clone https://github.com/ivanceras/commons.git - cd commons - mvn clean install
Put back both dependency checkout to have a succesfull build
Put back both dependency checkout to have a succesfull build
YAML
apache-2.0
ivanceras/fluentsql
yaml
## Code Before: language: java before_install: - git clone https://github.com/ivanceras/commons.git - cd commons - mvn clean install ## Instruction: Put back both dependency checkout to have a succesfull build ## Code After: language: java before_install: - git clone https://github.com/ivanceras/parent.git - cd parent - mvn clean install - cd ../ - git clone https://github.com/ivanceras/commons.git - cd commons - mvn clean install
language: java before_install: + - git clone https://github.com/ivanceras/parent.git + - cd parent + - mvn clean install + - cd ../ - git clone https://github.com/ivanceras/commons.git - cd commons - mvn clean install
4
0.666667
4
0
c265f3a24ba26800a15ddf54ad3aa7515695fb3f
app/__init__.py
app/__init__.py
from flask import Flask from .extensions import db from . import views def create_app(config): """ Create a Flask App base on a config obejct. """ app = Flask(__name__) app.config.from_object(config) register_extensions(app) register_views(app) # @app.route("/") # def index(): # return "Hello World!" return app def register_extensions(app): """ Register all extensions with the app. """ db.init_app(app) def register_views(app): """ Register all views class. """ views.Main.register(app) views.Post.register(app)
from flask import Flask from flask_user import UserManager from . import views from .extensions import db, mail, toolbar from .models import DataStoreAdapter, UserModel def create_app(config): """ Create a Flask App base on a config obejct. """ app = Flask(__name__) app.config.from_object(config) register_extensions(app) register_views(app) return app def register_extensions(app): """ Register all extensions with the app. """ db.init_app(app) mail.init_app(app) toolbar.init_app(app) # Cannot put it in extension files # due to will create a circular import. db_adapter = DataStoreAdapter(db, UserModel) user_manager = UserManager(db_adapter, app) def register_views(app): """ Register all views class. """ views.Main.register(app) views.Post.register(app)
Update app init to user flask user, mail and toolbar ext
Update app init to user flask user, mail and toolbar ext
Python
mit
oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog
python
## Code Before: from flask import Flask from .extensions import db from . import views def create_app(config): """ Create a Flask App base on a config obejct. """ app = Flask(__name__) app.config.from_object(config) register_extensions(app) register_views(app) # @app.route("/") # def index(): # return "Hello World!" return app def register_extensions(app): """ Register all extensions with the app. """ db.init_app(app) def register_views(app): """ Register all views class. """ views.Main.register(app) views.Post.register(app) ## Instruction: Update app init to user flask user, mail and toolbar ext ## Code After: from flask import Flask from flask_user import UserManager from . import views from .extensions import db, mail, toolbar from .models import DataStoreAdapter, UserModel def create_app(config): """ Create a Flask App base on a config obejct. """ app = Flask(__name__) app.config.from_object(config) register_extensions(app) register_views(app) return app def register_extensions(app): """ Register all extensions with the app. """ db.init_app(app) mail.init_app(app) toolbar.init_app(app) # Cannot put it in extension files # due to will create a circular import. db_adapter = DataStoreAdapter(db, UserModel) user_manager = UserManager(db_adapter, app) def register_views(app): """ Register all views class. """ views.Main.register(app) views.Post.register(app)
from flask import Flask - from .extensions import db + from flask_user import UserManager from . import views + from .extensions import db, mail, toolbar + from .models import DataStoreAdapter, UserModel def create_app(config): """ Create a Flask App base on a config obejct. """ app = Flask(__name__) app.config.from_object(config) register_extensions(app) register_views(app) - # @app.route("/") - # def index(): - # return "Hello World!" - return app def register_extensions(app): """ Register all extensions with the app. """ db.init_app(app) + mail.init_app(app) + toolbar.init_app(app) + + # Cannot put it in extension files + # due to will create a circular import. + db_adapter = DataStoreAdapter(db, UserModel) + user_manager = UserManager(db_adapter, app) def register_views(app): """ Register all views class. """ views.Main.register(app) views.Post.register(app)
15
0.517241
10
5
05b34109a0b63ac0e1e4d3c1d0b26aa9f4fb29a6
apps/app_sample.json
apps/app_sample.json
{ "name": "Tyk Test API", "api_id": "1", "org_id": "default", "definition": { "location": "header", "key": "version" }, "auth": { "auth_header_name": "authorization" }, "use_keyless": true, "version_data": { "not_versioned": true, "versions": { "Default": { "name": "Default", "expires": "3000-01-02 15:04", "use_extended_paths": true, "extended_paths": { "ignored": [], "white_list": [], "black_list": [] } } } }, "proxy": { "listen_path": "/otto/", "target_url": "http://127.0.0.1/", "strip_listen_path": true }, "event_handlers": {}, "custom_middleware": { "pre": [ { "name": "samplePreProcessMiddleware", "path": "middleware/sample_pre.js", "require_session": false } ], "post": [ { "name": "samplePostProcessMiddleware", "path": "middleware/sample_post.js", "require_session": false } ] }, "enable_batch_request_support": false }
{ "name": "Tyk Test API", "api_id": "1", "org_id": "default", "definition": { "location": "header", "key": "version" }, "auth": { "auth_header_name": "authorization" }, "use_keyless": false, "version_data": { "not_versioned": true, "versions": { "Default": { "name": "Default", "expires": "3000-01-02 15:04", "use_extended_paths": true, "extended_paths": { "ignored": [], "white_list": [], "black_list": [] } } } }, "proxy": { "listen_path": "/otto/", "target_url": "http://127.0.0.1/", "strip_listen_path": true }, "event_handlers": { "events": { "AuthFailure": [ { "handler_name":"cp_dynamic_handler", "handler_meta": { "name": "my_handler" } } ] } }, "custom_middleware": { "pre": [ { "name": "samplePreProcessMiddleware", "path": "middleware/sample_pre.js", "require_session": false } ], "post": [ { "name": "samplePostProcessMiddleware", "path": "middleware/sample_post.js", "require_session": false } ] }, "enable_batch_request_support": false }
Use cp_dynamic_handler in sample API spec
Use cp_dynamic_handler in sample API spec
JSON
mpl-2.0
nebolsin/tyk,nebolsin/tyk,nebolsin/tyk,lonelycode/tyk,lonelycode/tyk,nebolsin/tyk,mvdan/tyk,nebolsin/tyk,mvdan/tyk,lonelycode/tyk,mvdan/tyk,nebolsin/tyk,mvdan/tyk,mvdan/tyk,nebolsin/tyk,nebolsin/tyk,mvdan/tyk,mvdan/tyk,mvdan/tyk
json
## Code Before: { "name": "Tyk Test API", "api_id": "1", "org_id": "default", "definition": { "location": "header", "key": "version" }, "auth": { "auth_header_name": "authorization" }, "use_keyless": true, "version_data": { "not_versioned": true, "versions": { "Default": { "name": "Default", "expires": "3000-01-02 15:04", "use_extended_paths": true, "extended_paths": { "ignored": [], "white_list": [], "black_list": [] } } } }, "proxy": { "listen_path": "/otto/", "target_url": "http://127.0.0.1/", "strip_listen_path": true }, "event_handlers": {}, "custom_middleware": { "pre": [ { "name": "samplePreProcessMiddleware", "path": "middleware/sample_pre.js", "require_session": false } ], "post": [ { "name": "samplePostProcessMiddleware", "path": "middleware/sample_post.js", "require_session": false } ] }, "enable_batch_request_support": false } ## Instruction: Use cp_dynamic_handler in sample API spec ## Code After: { "name": "Tyk Test API", "api_id": "1", "org_id": "default", "definition": { "location": "header", "key": "version" }, "auth": { "auth_header_name": "authorization" }, "use_keyless": false, "version_data": { "not_versioned": true, "versions": { "Default": { "name": "Default", "expires": "3000-01-02 15:04", "use_extended_paths": true, "extended_paths": { "ignored": [], "white_list": [], "black_list": [] } } } }, "proxy": { "listen_path": "/otto/", "target_url": "http://127.0.0.1/", "strip_listen_path": true }, "event_handlers": { "events": { "AuthFailure": [ { "handler_name":"cp_dynamic_handler", "handler_meta": { "name": "my_handler" } } ] } }, "custom_middleware": { "pre": [ { "name": "samplePreProcessMiddleware", "path": "middleware/sample_pre.js", "require_session": false } ], "post": [ { "name": "samplePostProcessMiddleware", "path": "middleware/sample_post.js", "require_session": false } ] }, "enable_batch_request_support": false }
{ "name": "Tyk Test API", "api_id": "1", "org_id": "default", "definition": { "location": "header", "key": "version" }, "auth": { "auth_header_name": "authorization" }, - "use_keyless": true, ? ^^^ + "use_keyless": false, ? ^^^^ "version_data": { "not_versioned": true, "versions": { "Default": { "name": "Default", "expires": "3000-01-02 15:04", "use_extended_paths": true, "extended_paths": { "ignored": [], "white_list": [], "black_list": [] } } } }, "proxy": { "listen_path": "/otto/", "target_url": "http://127.0.0.1/", "strip_listen_path": true }, - "event_handlers": {}, ? -- + "event_handlers": { + "events": { + "AuthFailure": [ + { + "handler_name":"cp_dynamic_handler", + "handler_meta": { + "name": "my_handler" + } + } + ] + } + }, "custom_middleware": { "pre": [ { "name": "samplePreProcessMiddleware", "path": "middleware/sample_pre.js", "require_session": false } ], "post": [ { "name": "samplePostProcessMiddleware", "path": "middleware/sample_post.js", "require_session": false } ] }, "enable_batch_request_support": false }
15
0.294118
13
2
9660fb734ecf2ad2c181eba790cdd2ddc9ed423e
cyder/core/system/forms.py
cyder/core/system/forms.py
from django import forms from cyder.base.eav.forms import get_eav_form from cyder.base.mixins import UsabilityFormMixin from cyder.core.system.models import System, SystemAV class SystemForm(forms.ModelForm): class Meta: model = System class ExtendedSystemForm(forms.ModelForm, UsabilityFormMixin): interface_type = forms.ChoiceField( widget=forms.RadioSelect, choices=( ('Static', 'Static Interface'), ('Dynamic', 'Dynamic Interface'))) class Meta: model = System SystemAVForm = get_eav_form(SystemAV, System)
from django import forms from cyder.base.eav.forms import get_eav_form from cyder.base.mixins import UsabilityFormMixin from cyder.core.system.models import System, SystemAV class SystemForm(forms.ModelForm): class Meta: model = System class ExtendedSystemForm(forms.ModelForm, UsabilityFormMixin): interface_type = forms.ChoiceField( widget=forms.RadioSelect, choices=( ('static_interface', 'Static Interface'), ('dynamic_interface', 'Dynamic Interface'))) class Meta: model = System SystemAVForm = get_eav_form(SystemAV, System)
Fix system form interface_type choices
Fix system form interface_type choices
Python
bsd-3-clause
murrown/cyder,drkitty/cyder,OSU-Net/cyder,akeym/cyder,murrown/cyder,OSU-Net/cyder,murrown/cyder,akeym/cyder,murrown/cyder,drkitty/cyder,zeeman/cyder,zeeman/cyder,OSU-Net/cyder,akeym/cyder,zeeman/cyder,OSU-Net/cyder,drkitty/cyder,akeym/cyder,drkitty/cyder,zeeman/cyder
python
## Code Before: from django import forms from cyder.base.eav.forms import get_eav_form from cyder.base.mixins import UsabilityFormMixin from cyder.core.system.models import System, SystemAV class SystemForm(forms.ModelForm): class Meta: model = System class ExtendedSystemForm(forms.ModelForm, UsabilityFormMixin): interface_type = forms.ChoiceField( widget=forms.RadioSelect, choices=( ('Static', 'Static Interface'), ('Dynamic', 'Dynamic Interface'))) class Meta: model = System SystemAVForm = get_eav_form(SystemAV, System) ## Instruction: Fix system form interface_type choices ## Code After: from django import forms from cyder.base.eav.forms import get_eav_form from cyder.base.mixins import UsabilityFormMixin from cyder.core.system.models import System, SystemAV class SystemForm(forms.ModelForm): class Meta: model = System class ExtendedSystemForm(forms.ModelForm, UsabilityFormMixin): interface_type = forms.ChoiceField( widget=forms.RadioSelect, choices=( ('static_interface', 'Static Interface'), ('dynamic_interface', 'Dynamic Interface'))) class Meta: model = System SystemAVForm = get_eav_form(SystemAV, System)
from django import forms from cyder.base.eav.forms import get_eav_form from cyder.base.mixins import UsabilityFormMixin from cyder.core.system.models import System, SystemAV class SystemForm(forms.ModelForm): class Meta: model = System class ExtendedSystemForm(forms.ModelForm, UsabilityFormMixin): interface_type = forms.ChoiceField( widget=forms.RadioSelect, choices=( - ('Static', 'Static Interface'), ? ^ + ('static_interface', 'Static Interface'), ? ^ ++++++++++ - ('Dynamic', 'Dynamic Interface'))) ? ^ + ('dynamic_interface', 'Dynamic Interface'))) ? ^ ++++++++++ class Meta: model = System SystemAVForm = get_eav_form(SystemAV, System)
4
0.166667
2
2
96340b3829ba8b7412e30813ce281ded29abd651
python/getting_started/readme.md
python/getting_started/readme.md
* example of importing a module in python * from datetime import datetime * now = datetime.now() * print now.year * print now.month * print now.day * from the above example we import into the the symbol datetime the module or package datetime * in general we can write > from module_name import symbol * this gives us the added methods that come with the datetime package including instantiating a date that is datetime.now() * printing out the year, month and day with the subsequent date object calls. * The above code is located in the file print_now.py * You'll see an output similar to this: ![alt text](/imgs/print_now.png "sample of the print_now output") ## Resources * [ccodecademy.com python course](https://www.codecademy.com/learn/python)
* example of importing a module in python * from datetime import datetime * now = datetime.now() * print now.year * print now.month * print now.day * from the above example we import into the the symbol datetime the module or package datetime * in general we can write > from module_name import symbol * this gives us the added methods that come with the datetime package including instantiating a date that is datetime.now() * printing out the year, month and day with the subsequent date object calls. * The above code is located in the file print_now.py * You'll see an output similar to this: ![picture of commandline](/imgs/print_now_output.png "sample of the print_now output") ## Resources * [ccodecademy.com python course](https://www.codecademy.com/learn/python)
Fix a image link typo
Fix a image link typo
Markdown
mit
calvinsettachatgul/athena,calvinsettachatgul/athena,calvinsettachatgul/athena,calvinsettachatgul/athena,calvinsettachatgul/athena
markdown
## Code Before: * example of importing a module in python * from datetime import datetime * now = datetime.now() * print now.year * print now.month * print now.day * from the above example we import into the the symbol datetime the module or package datetime * in general we can write > from module_name import symbol * this gives us the added methods that come with the datetime package including instantiating a date that is datetime.now() * printing out the year, month and day with the subsequent date object calls. * The above code is located in the file print_now.py * You'll see an output similar to this: ![alt text](/imgs/print_now.png "sample of the print_now output") ## Resources * [ccodecademy.com python course](https://www.codecademy.com/learn/python) ## Instruction: Fix a image link typo ## Code After: * example of importing a module in python * from datetime import datetime * now = datetime.now() * print now.year * print now.month * print now.day * from the above example we import into the the symbol datetime the module or package datetime * in general we can write > from module_name import symbol * this gives us the added methods that come with the datetime package including instantiating a date that is datetime.now() * printing out the year, month and day with the subsequent date object calls. * The above code is located in the file print_now.py * You'll see an output similar to this: ![picture of commandline](/imgs/print_now_output.png "sample of the print_now output") ## Resources * [ccodecademy.com python course](https://www.codecademy.com/learn/python)
* example of importing a module in python * from datetime import datetime * now = datetime.now() * print now.year * print now.month * print now.day * from the above example we import into the the symbol datetime the module or package datetime * in general we can write > from module_name import symbol * this gives us the added methods that come with the datetime package including instantiating a date that is datetime.now() * printing out the year, month and day with the subsequent date object calls. * The above code is located in the file print_now.py * You'll see an output similar to this: - ![alt text](/imgs/print_now.png "sample of the print_now output") ? ^^^ -- + ![picture of commandline](/imgs/print_now_output.png "sample of the print_now output") ? +++++++++++++++ ++ ^^ +++++++ ## Resources * [ccodecademy.com python course](https://www.codecademy.com/learn/python)
2
0.060606
1
1
4e9511221b3057f4d529c4f095743bf49cb59938
http4k-core/src/main/kotlin/org/http4k/filter/ResponseFilters.kt
http4k-core/src/main/kotlin/org/http4k/filter/ResponseFilters.kt
package org.http4k.filter import org.http4k.core.Filter import org.http4k.core.Request import org.http4k.core.Response import java.time.Clock import java.time.Duration import java.time.Duration.between object ResponseFilters { /** * Intercept the response after it is sent to the next service. */ fun Tap(fn: (Response) -> Unit) = Filter { next -> { next(it).let { fn(it) it } } } fun ReportLatency(clock: Clock, recordFn: (Request, Response, Duration) -> Unit): Filter = Filter { next -> { val start = clock.instant() val response = next(it) recordFn(it, response, between(start, clock.instant())) response } } }
package org.http4k.filter import org.http4k.core.Filter import org.http4k.core.Request import org.http4k.core.Response import java.time.Clock import java.time.Duration import java.time.Duration.between object ResponseFilters { /** * Intercept the response after it is sent to the next service. */ fun Tap(fn: (Response) -> Unit) = Filter { next -> { next(it).let { fn(it) it } } } fun ReportLatency(clock: Clock = Clock.systemUTC(), recordFn: (Request, Response, Duration) -> Unit): Filter = Filter { next -> { val start = clock.instant() val response = next(it) recordFn(it, response, between(start, clock.instant())) response } } }
Add default system clock to ReportLatency
Add default system clock to ReportLatency
Kotlin
apache-2.0
http4k/http4k,http4k/http4k,http4k/http4k,http4k/http4k,http4k/http4k,grover-ws-1/http4k,grover-ws-1/http4k,http4k/http4k,http4k/http4k,grover-ws-1/http4k,grover-ws-1/http4k,grover-ws-1/http4k
kotlin
## Code Before: package org.http4k.filter import org.http4k.core.Filter import org.http4k.core.Request import org.http4k.core.Response import java.time.Clock import java.time.Duration import java.time.Duration.between object ResponseFilters { /** * Intercept the response after it is sent to the next service. */ fun Tap(fn: (Response) -> Unit) = Filter { next -> { next(it).let { fn(it) it } } } fun ReportLatency(clock: Clock, recordFn: (Request, Response, Duration) -> Unit): Filter = Filter { next -> { val start = clock.instant() val response = next(it) recordFn(it, response, between(start, clock.instant())) response } } } ## Instruction: Add default system clock to ReportLatency ## Code After: package org.http4k.filter import org.http4k.core.Filter import org.http4k.core.Request import org.http4k.core.Response import java.time.Clock import java.time.Duration import java.time.Duration.between object ResponseFilters { /** * Intercept the response after it is sent to the next service. */ fun Tap(fn: (Response) -> Unit) = Filter { next -> { next(it).let { fn(it) it } } } fun ReportLatency(clock: Clock = Clock.systemUTC(), recordFn: (Request, Response, Duration) -> Unit): Filter = Filter { next -> { val start = clock.instant() val response = next(it) recordFn(it, response, between(start, clock.instant())) response } } }
package org.http4k.filter import org.http4k.core.Filter import org.http4k.core.Request import org.http4k.core.Response import java.time.Clock import java.time.Duration import java.time.Duration.between object ResponseFilters { /** * Intercept the response after it is sent to the next service. */ fun Tap(fn: (Response) -> Unit) = Filter { next -> { next(it).let { fn(it) it } } } - fun ReportLatency(clock: Clock, recordFn: (Request, Response, Duration) -> Unit): Filter = Filter { + fun ReportLatency(clock: Clock = Clock.systemUTC(), recordFn: (Request, Response, Duration) -> Unit): Filter = Filter { ? ++++++++++++++++++++ next -> { val start = clock.instant() val response = next(it) recordFn(it, response, between(start, clock.instant())) response } } }
2
0.055556
1
1
95529efca6a2e3c3544aeb306aaf62a02f2f5408
primes.py
primes.py
import sys Max=int(sys.argv[1]) # get Max from command line args P = {x: True for x in range(2,Max)} # first assume numbers are prime for i in range(2, int(Max** (0.5))): # until square root of Max if P[i]: # for j in range(i*i, Max, i): # mark all multiples of a prime P[j]=False # as not beeing a prime numprimes = 0; # Count all primes for i,isprime in P.items(): if isprime: numprimes=numprimes+1 print(numprimes) # print number of primes
import array import math import sys n = int(sys.argv[1]) nums = array.array('i', [False] * 2 + [True] * (n - 2)) upper_lim = int(math.sqrt(n)) i = 2 while i <= upper_lim: if nums[i]: m = i**2 while m < n: nums[m] = False m += i i += 1 print(len([x for x in nums if nums]))
Make Python code equivalent to Ruby
Make Python code equivalent to Ruby Using a dictionary instead is really unfair. Small variation: m must not be equal to n. Not sure how the algorithm is meant is exactly...
Python
mit
oliworx/chartbench,oliworx/chartbench,oliworx/chartbench,oliworx/chartbench,oliworx/chartbench
python
## Code Before: import sys Max=int(sys.argv[1]) # get Max from command line args P = {x: True for x in range(2,Max)} # first assume numbers are prime for i in range(2, int(Max** (0.5))): # until square root of Max if P[i]: # for j in range(i*i, Max, i): # mark all multiples of a prime P[j]=False # as not beeing a prime numprimes = 0; # Count all primes for i,isprime in P.items(): if isprime: numprimes=numprimes+1 print(numprimes) # print number of primes ## Instruction: Make Python code equivalent to Ruby Using a dictionary instead is really unfair. Small variation: m must not be equal to n. Not sure how the algorithm is meant is exactly... ## Code After: import array import math import sys n = int(sys.argv[1]) nums = array.array('i', [False] * 2 + [True] * (n - 2)) upper_lim = int(math.sqrt(n)) i = 2 while i <= upper_lim: if nums[i]: m = i**2 while m < n: nums[m] = False m += i i += 1 print(len([x for x in nums if nums]))
+ import array + import math import sys - Max=int(sys.argv[1]) # get Max from command line args - P = {x: True for x in range(2,Max)} # first assume numbers are prime - for i in range(2, int(Max** (0.5))): # until square root of Max - if P[i]: # - for j in range(i*i, Max, i): # mark all multiples of a prime - P[j]=False # as not beeing a prime + n = int(sys.argv[1]) + nums = array.array('i', [False] * 2 + [True] * (n - 2)) - numprimes = 0; # Count all primes - for i,isprime in P.items(): - if isprime: - numprimes=numprimes+1 - print(numprimes) # print number of primes + upper_lim = int(math.sqrt(n)) + i = 2 + while i <= upper_lim: + if nums[i]: + m = i**2 + while m < n: + nums[m] = False + m += i + i += 1 + + print(len([x for x in nums if nums]))
26
1.857143
15
11
aa25d08c3df65862671fbf54b57214cb154eb6dc
phpcs.xml
phpcs.xml
<?xml version="1.0"?> <ruleset name="Site Kit by Google Project Rules"> <rule ref="WordPress-Core" /> <rule ref="WordPress-Docs" /> <rule ref="WordPress-Extra"> <!-- Forget about file names --> <exclude name="WordPress.Files.FileName"/> </rule> <!-- Use correct textdomain --> <rule ref="WordPress.WP.I18n"> <properties> <property name="text_domain" value="google-site-kit" /> </properties> </rule> <!-- Show details about violated sniffs --> <arg value="s"/> <!-- Iterate over all PHP files by default --> <arg name="extensions" value="php"/> <file>.</file> <exclude-pattern>*/phpunit.xml*</exclude-pattern> <exclude-pattern>*/languages/*</exclude-pattern> <exclude-pattern>*/tests/*</exclude-pattern> <!-- Third-party code --> <exclude-pattern>*/bower-components/*</exclude-pattern> <exclude-pattern>*/node_modules/*</exclude-pattern> <exclude-pattern>*/vendor/*</exclude-pattern> <!-- Check for cross-version support for PHP 5.4 and higher. --> <config name="testVersion" value="5.4-"/> <rule ref="PHPCompatibility" /> </ruleset>
<?xml version="1.0"?> <ruleset name="Site Kit by Google Project Rules"> <rule ref="WordPress-Core" /> <rule ref="WordPress-Docs" /> <rule ref="WordPress-Extra"> <!-- Forget about file names --> <exclude name="WordPress.Files.FileName"/> </rule> <!-- Use correct textdomain --> <rule ref="WordPress.WP.I18n"> <properties> <property name="text_domain" value="google-site-kit" /> </properties> </rule> <!-- Show details about violated sniffs --> <arg value="s"/> <!-- Iterate over all PHP files by default --> <arg name="extensions" value="php"/> <file>.</file> <exclude-pattern>*/phpunit.xml*</exclude-pattern> <exclude-pattern>*/languages/*</exclude-pattern> <exclude-pattern>*/tests/*</exclude-pattern> <!-- Third-party code --> <exclude-pattern>*/bower-components/*</exclude-pattern> <exclude-pattern>*/node_modules/*</exclude-pattern> <exclude-pattern>*/third-party/*</exclude-pattern> <exclude-pattern>*/vendor/*</exclude-pattern> <!-- Check for cross-version support for PHP 5.4 and higher. --> <config name="testVersion" value="5.4-"/> <rule ref="PHPCompatibility" /> </ruleset>
Exclude third-party directory from PHPCodeSniffer.
Exclude third-party directory from PHPCodeSniffer.
XML
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
xml
## Code Before: <?xml version="1.0"?> <ruleset name="Site Kit by Google Project Rules"> <rule ref="WordPress-Core" /> <rule ref="WordPress-Docs" /> <rule ref="WordPress-Extra"> <!-- Forget about file names --> <exclude name="WordPress.Files.FileName"/> </rule> <!-- Use correct textdomain --> <rule ref="WordPress.WP.I18n"> <properties> <property name="text_domain" value="google-site-kit" /> </properties> </rule> <!-- Show details about violated sniffs --> <arg value="s"/> <!-- Iterate over all PHP files by default --> <arg name="extensions" value="php"/> <file>.</file> <exclude-pattern>*/phpunit.xml*</exclude-pattern> <exclude-pattern>*/languages/*</exclude-pattern> <exclude-pattern>*/tests/*</exclude-pattern> <!-- Third-party code --> <exclude-pattern>*/bower-components/*</exclude-pattern> <exclude-pattern>*/node_modules/*</exclude-pattern> <exclude-pattern>*/vendor/*</exclude-pattern> <!-- Check for cross-version support for PHP 5.4 and higher. --> <config name="testVersion" value="5.4-"/> <rule ref="PHPCompatibility" /> </ruleset> ## Instruction: Exclude third-party directory from PHPCodeSniffer. ## Code After: <?xml version="1.0"?> <ruleset name="Site Kit by Google Project Rules"> <rule ref="WordPress-Core" /> <rule ref="WordPress-Docs" /> <rule ref="WordPress-Extra"> <!-- Forget about file names --> <exclude name="WordPress.Files.FileName"/> </rule> <!-- Use correct textdomain --> <rule ref="WordPress.WP.I18n"> <properties> <property name="text_domain" value="google-site-kit" /> </properties> </rule> <!-- Show details about violated sniffs --> <arg value="s"/> <!-- Iterate over all PHP files by default --> <arg name="extensions" value="php"/> <file>.</file> <exclude-pattern>*/phpunit.xml*</exclude-pattern> <exclude-pattern>*/languages/*</exclude-pattern> <exclude-pattern>*/tests/*</exclude-pattern> <!-- Third-party code --> <exclude-pattern>*/bower-components/*</exclude-pattern> <exclude-pattern>*/node_modules/*</exclude-pattern> <exclude-pattern>*/third-party/*</exclude-pattern> <exclude-pattern>*/vendor/*</exclude-pattern> <!-- Check for cross-version support for PHP 5.4 and higher. --> <config name="testVersion" value="5.4-"/> <rule ref="PHPCompatibility" /> </ruleset>
<?xml version="1.0"?> <ruleset name="Site Kit by Google Project Rules"> <rule ref="WordPress-Core" /> <rule ref="WordPress-Docs" /> <rule ref="WordPress-Extra"> <!-- Forget about file names --> <exclude name="WordPress.Files.FileName"/> </rule> <!-- Use correct textdomain --> <rule ref="WordPress.WP.I18n"> <properties> <property name="text_domain" value="google-site-kit" /> </properties> </rule> <!-- Show details about violated sniffs --> <arg value="s"/> <!-- Iterate over all PHP files by default --> <arg name="extensions" value="php"/> <file>.</file> <exclude-pattern>*/phpunit.xml*</exclude-pattern> <exclude-pattern>*/languages/*</exclude-pattern> <exclude-pattern>*/tests/*</exclude-pattern> <!-- Third-party code --> <exclude-pattern>*/bower-components/*</exclude-pattern> <exclude-pattern>*/node_modules/*</exclude-pattern> + <exclude-pattern>*/third-party/*</exclude-pattern> <exclude-pattern>*/vendor/*</exclude-pattern> <!-- Check for cross-version support for PHP 5.4 and higher. --> <config name="testVersion" value="5.4-"/> <rule ref="PHPCompatibility" /> </ruleset>
1
0.025
1
0
e4d06cf4121bc9e1a1f9635e159187b8bed1b2ee
pyalysis/analysers/raw.py
pyalysis/analysers/raw.py
import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) )
import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
Fix location of line length check
Fix location of line length check
Python
bsd-3-clause
DasIch/pyalysis,DasIch/pyalysis
python
## Code Before: import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) ) ## Instruction: Fix location of line length check ## Code After: import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] - def emit(self, warning_cls, message, lineno, start, end): ? -------------------- + def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, - Location(lineno, start), - Location(lineno, end) ? ^^^ + Location(self.lineno, 0), ? +++++ ^ + + Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): + self.lineno = i + self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', - lineno, - 79, - len(line.rstrip()) )
11
0.22449
5
6
c855bf43c9119307e13096ad29647cc721018ad5
collections/Keys.js
collections/Keys.js
Keys = new Mongo.Collection("keys"); KeySchema = new SimpleSchema({ keyID: { type: Number, label: "Key ID", min: 0 }, vCode: { type: String, label: "Verification Code", regEx: /^[0-9a-zA-Z]+$/, custom: function() { if (this.field("keyID").isSet === false) return "keyIDMissing"; if (this.field("keyID").value < 0) return "keyIDInvalid"; keyValidationResult = Meteor.apply('validateKey', [this.field("keyID").value, this.value], true); console.log(keyValidationResult); if (keyValidationResult.ok === true) return 0; else return "keyFailed"; } } }); KeySchema.messages({ "minNumber keyID": "[label] must be a positive number", "keyIDMissing": "You must enter a Key ID", "keyIDInvalid": "Key ID is invalid", "regEx vCode": "[label] must contain only letters and numbers", "keyFailed": "The API key failed verification with the server" }); Keys.attachSchema(KeySchema);
Keys = new Mongo.Collection("keys"); StatusSchema = new SimpleSchema({ ok: { type: Boolean, optional: true }, reasons: { type: [String], optional: true }, lastChecked: { type: Date, optional: true }, error: { type: String, optional: true } }); KeySchema = new SimpleSchema({ keyID: { type: Number, label: "Key ID", min: 0 }, vCode: { type: String, label: "Verification Code", regEx: /^[0-9a-zA-Z]+$/, custom: function() { if (this.field("keyID").isSet === false) return "keyIDMissing"; if (this.field("keyID").value < 0) return "keyIDInvalid"; } }, createdAt: { type: Date, autoValue: function() { if (this.isInsert) { return new Date; } else if (this.isUpsert) { return {$setOnInsert: new Date}; } else { this.unset(); // Prevent user from supplying their own value } }, autoform: { omit: true } }, status: { type: StatusSchema, // optional: true, autoform: { omit: true } } }); KeySchema.messages({ "minNumber keyID": "[label] must be a positive number", "keyIDMissing": "You must enter a Key ID", "keyIDInvalid": "Key ID is invalid", "regEx vCode": "[label] must contain only letters and numbers", "keyFailed": "The API key failed verification with the server" }); Keys.attachSchema(KeySchema);
Add createdAt prop and status object to schema
Add createdAt prop and status object to schema
JavaScript
mit
eve-apps/spaicheck,eve-apps/spaicheck
javascript
## Code Before: Keys = new Mongo.Collection("keys"); KeySchema = new SimpleSchema({ keyID: { type: Number, label: "Key ID", min: 0 }, vCode: { type: String, label: "Verification Code", regEx: /^[0-9a-zA-Z]+$/, custom: function() { if (this.field("keyID").isSet === false) return "keyIDMissing"; if (this.field("keyID").value < 0) return "keyIDInvalid"; keyValidationResult = Meteor.apply('validateKey', [this.field("keyID").value, this.value], true); console.log(keyValidationResult); if (keyValidationResult.ok === true) return 0; else return "keyFailed"; } } }); KeySchema.messages({ "minNumber keyID": "[label] must be a positive number", "keyIDMissing": "You must enter a Key ID", "keyIDInvalid": "Key ID is invalid", "regEx vCode": "[label] must contain only letters and numbers", "keyFailed": "The API key failed verification with the server" }); Keys.attachSchema(KeySchema); ## Instruction: Add createdAt prop and status object to schema ## Code After: Keys = new Mongo.Collection("keys"); StatusSchema = new SimpleSchema({ ok: { type: Boolean, optional: true }, reasons: { type: [String], optional: true }, lastChecked: { type: Date, optional: true }, error: { type: String, optional: true } }); KeySchema = new SimpleSchema({ keyID: { type: Number, label: "Key ID", min: 0 }, vCode: { type: String, label: "Verification Code", regEx: /^[0-9a-zA-Z]+$/, custom: function() { if (this.field("keyID").isSet === false) return "keyIDMissing"; if (this.field("keyID").value < 0) return "keyIDInvalid"; } }, createdAt: { type: Date, autoValue: function() { if (this.isInsert) { return new Date; } else if (this.isUpsert) { return {$setOnInsert: new Date}; } else { this.unset(); // Prevent user from supplying their own value } }, autoform: { omit: true } }, status: { type: StatusSchema, // optional: true, autoform: { omit: true } } }); KeySchema.messages({ "minNumber keyID": "[label] must be a positive number", "keyIDMissing": "You must enter a Key ID", "keyIDInvalid": "Key ID is invalid", "regEx vCode": "[label] must contain only letters and numbers", "keyFailed": "The API key failed verification with the server" }); Keys.attachSchema(KeySchema);
Keys = new Mongo.Collection("keys"); + + StatusSchema = new SimpleSchema({ + ok: { + type: Boolean, + optional: true + }, + reasons: { + type: [String], + optional: true + }, + lastChecked: { + type: Date, + optional: true + }, + error: { + type: String, + optional: true + } + }); KeySchema = new SimpleSchema({ keyID: { type: Number, label: "Key ID", min: 0 }, vCode: { type: String, label: "Verification Code", regEx: /^[0-9a-zA-Z]+$/, custom: function() { if (this.field("keyID").isSet === false) return "keyIDMissing"; if (this.field("keyID").value < 0) return "keyIDInvalid"; - - keyValidationResult = Meteor.apply('validateKey', [this.field("keyID").value, this.value], true); - console.log(keyValidationResult); - if (keyValidationResult.ok === true) return 0; - else return "keyFailed"; + } + }, + createdAt: { + type: Date, + autoValue: function() { + if (this.isInsert) { + return new Date; + } else if (this.isUpsert) { + return {$setOnInsert: new Date}; + } else { + this.unset(); // Prevent user from supplying their own value + } + }, + autoform: { + omit: true + } + }, + status: { + type: StatusSchema, + // optional: true, + autoform: { + omit: true } } }); KeySchema.messages({ "minNumber keyID": "[label] must be a positive number", "keyIDMissing": "You must enter a Key ID", "keyIDInvalid": "Key ID is invalid", "regEx vCode": "[label] must contain only letters and numbers", "keyFailed": "The API key failed verification with the server" }); Keys.attachSchema(KeySchema);
46
1.4375
41
5
a6da9426947f5aa1bbff88cb68e6b495929740f7
.travis.yml
.travis.yml
language: go go: - tip before_install: - git clone git://github.com/hcatlin/libsass.git - cd libsass - autoreconf -i - ./configure - make && make shared && sudo make install && sudo make install-shared - sudo cp sass_interface.h /usr/include/ - sudo cp sass.h /usr/local/include/ - cd .. script: - go test - go build
language: go go: - tip before_install: - git clone git://github.com/hcatlin/libsass.git - cd libsass - autoreconf -i - ./configure - make && sudo make install - sudo cp sass_interface.h /usr/include/ - sudo cp sass.h /usr/local/include/ - cd .. script: - go test - go build
Use unix style line endings
Use unix style line endings
YAML
mit
vinhhrv/go-sass
yaml
## Code Before: language: go go: - tip before_install: - git clone git://github.com/hcatlin/libsass.git - cd libsass - autoreconf -i - ./configure - make && make shared && sudo make install && sudo make install-shared - sudo cp sass_interface.h /usr/include/ - sudo cp sass.h /usr/local/include/ - cd .. script: - go test - go build ## Instruction: Use unix style line endings ## Code After: language: go go: - tip before_install: - git clone git://github.com/hcatlin/libsass.git - cd libsass - autoreconf -i - ./configure - make && sudo make install - sudo cp sass_interface.h /usr/include/ - sudo cp sass.h /usr/local/include/ - cd .. script: - go test - go build
language: go go: - tip before_install: - git clone git://github.com/hcatlin/libsass.git - cd libsass - autoreconf -i - ./configure - - make && make shared && sudo make install && sudo make install-shared + - make && sudo make install - sudo cp sass_interface.h /usr/include/ - sudo cp sass.h /usr/local/include/ - cd .. script: - go test - go build
2
0.133333
1
1
233f828b3627a0967bb225625f249da11d33d05a
gather/templates/user/index.html
gather/templates/user/index.html
{% extends "layout.html" %} {% block title %}用户{% endblock %} {% from "snippet/nav.html" import navigation %} {% block nav %}{{ navigation('user') }}{% endblock %} {% block content %} {% for user in paginator.items %} <div class="user-card"> {% set user_profile = url_for('.profile', name=user.username) %} <a href="{{ user_profile }}"><img src="{{ user.avatar(size=80) }}"></a> <header><a href="{{ user_profile }}">{{ user.username }}</a></header> {% if user.website %} <a href="{{ user.website }}" rel="nofollow">{{ user.website }}</a> {% else %} 注册于: {{ user.created.strftime("%Y-%m-%d") }} {% endif %} </div> {% endfor %} {# TODO: 增加换页 #} {% endblock %}
{% extends "layout.html" %} {% block title %}用户{% endblock %} {% from "snippet/nav.html" import navigation %} {% block nav %}{{ navigation('user') }}{% endblock %} {% block content %} {% for user in paginator.items %} <div class="user-card"> {% set user_profile = url_for('.profile', name=user.username) %} <a href="{{ user_profile }}"><img src="{{ user.avatar(size=80) }}"></a> <header><a href="{{ user_profile }}">{{ user.username }}</a></header> {% if user.website %} <a href="{{ user.website }}" rel="nofollow">{{ user.website }}</a> {% else %} 注册于: {{ user.created.strftime("%Y-%m-%d") }} {% endif %} </div> {% endfor %} {% from "snippet/pagination.html" import pagination %} {{ pagination(paginator, url_for(".index")) }} {% endblock %}
Add pagination in user page
Add pagination in user page
HTML
mit
whtsky/Gather,whtsky/Gather
html
## Code Before: {% extends "layout.html" %} {% block title %}用户{% endblock %} {% from "snippet/nav.html" import navigation %} {% block nav %}{{ navigation('user') }}{% endblock %} {% block content %} {% for user in paginator.items %} <div class="user-card"> {% set user_profile = url_for('.profile', name=user.username) %} <a href="{{ user_profile }}"><img src="{{ user.avatar(size=80) }}"></a> <header><a href="{{ user_profile }}">{{ user.username }}</a></header> {% if user.website %} <a href="{{ user.website }}" rel="nofollow">{{ user.website }}</a> {% else %} 注册于: {{ user.created.strftime("%Y-%m-%d") }} {% endif %} </div> {% endfor %} {# TODO: 增加换页 #} {% endblock %} ## Instruction: Add pagination in user page ## Code After: {% extends "layout.html" %} {% block title %}用户{% endblock %} {% from "snippet/nav.html" import navigation %} {% block nav %}{{ navigation('user') }}{% endblock %} {% block content %} {% for user in paginator.items %} <div class="user-card"> {% set user_profile = url_for('.profile', name=user.username) %} <a href="{{ user_profile }}"><img src="{{ user.avatar(size=80) }}"></a> <header><a href="{{ user_profile }}">{{ user.username }}</a></header> {% if user.website %} <a href="{{ user.website }}" rel="nofollow">{{ user.website }}</a> {% else %} 注册于: {{ user.created.strftime("%Y-%m-%d") }} {% endif %} </div> {% endfor %} {% from "snippet/pagination.html" import pagination %} {{ pagination(paginator, url_for(".index")) }} {% endblock %}
{% extends "layout.html" %} {% block title %}用户{% endblock %} {% from "snippet/nav.html" import navigation %} {% block nav %}{{ navigation('user') }}{% endblock %} {% block content %} {% for user in paginator.items %} <div class="user-card"> {% set user_profile = url_for('.profile', name=user.username) %} <a href="{{ user_profile }}"><img src="{{ user.avatar(size=80) }}"></a> <header><a href="{{ user_profile }}">{{ user.username }}</a></header> {% if user.website %} <a href="{{ user.website }}" rel="nofollow">{{ user.website }}</a> {% else %} 注册于: {{ user.created.strftime("%Y-%m-%d") }} {% endif %} </div> {% endfor %} + {% from "snippet/pagination.html" import pagination %} + {{ pagination(paginator, url_for(".index")) }} - {# - TODO: 增加换页 - #} {% endblock %}
5
0.208333
2
3
43166af8255120cc3a0986944ee0fd3dd8dceec7
src/CMakeLists.txt
src/CMakeLists.txt
configure_file(tenyr_config.h.in tenyr_config.h) add_subdirectory(os) add_library(common STATIC common.c param.c stream.c ) target_include_directories(common PUBLIC .) target_link_libraries(common os_support )
configure_file(tenyr_config.h.in tenyr_config.h) add_subdirectory(os) add_library(common STATIC common.c param.c stream.c ) target_include_directories(common PUBLIC .) target_link_libraries(common PUBLIC os_support) add_executable(tld tld.c obj.c ) target_link_libraries(tld PUBLIC common)
Add executable target for tld
Add executable target for tld
Text
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
text
## Code Before: configure_file(tenyr_config.h.in tenyr_config.h) add_subdirectory(os) add_library(common STATIC common.c param.c stream.c ) target_include_directories(common PUBLIC .) target_link_libraries(common os_support ) ## Instruction: Add executable target for tld ## Code After: configure_file(tenyr_config.h.in tenyr_config.h) add_subdirectory(os) add_library(common STATIC common.c param.c stream.c ) target_include_directories(common PUBLIC .) target_link_libraries(common PUBLIC os_support) add_executable(tld tld.c obj.c ) target_link_libraries(tld PUBLIC common)
configure_file(tenyr_config.h.in tenyr_config.h) add_subdirectory(os) add_library(common STATIC common.c param.c stream.c ) target_include_directories(common PUBLIC .) - target_link_libraries(common - os_support + target_link_libraries(common PUBLIC os_support) + + add_executable(tld + tld.c + + obj.c ) + target_link_libraries(tld PUBLIC common)
9
0.642857
7
2
2085e55286d0c890e737e6f0fdc3fb84826e421f
src/entities/SelectInput.js
src/entities/SelectInput.js
import { Component } from 'substance' export default class SelectInput extends Component { render($$) { const label = this.props.label const value = this.props.value const options = this.props.availableOptions const el = $$('div').addClass('sc-select-input') const selectEl = $$('select').addClass('se-select') .ref('input') .on('change', this._onChange) const defaultOpt = $$('option').attr({value: false}) .append(this.getLabel('select-default-value')) if(!value) { defaultOpt.attr({selected: 'selected'}) } selectEl.append(defaultOpt) options.forEach(opt => { const optEl = $$('option').attr({value: opt.id}).append(opt.text) if(opt.id === value) optEl.attr({selected: 'selected'}) selectEl.append(optEl) }) el.append( $$('div').addClass('se-label').append(label), selectEl ) return el } _onChange() { const id = this.props.id if(id) { const value = this._getValue() this.send('input:change', id, value) } } _getValue() { const input = this.refs.input return input.value } }
import { Component } from 'substance' export default class SelectInput extends Component { render($$) { const label = this.props.label const value = this.props.value const options = this.props.availableOptions const el = $$('div').addClass('sc-select-input') const selectEl = $$('select').addClass('se-select') .ref('input') .on('change', this._onChange) const defaultOpt = $$('option').attr({value: false}) .append(this.getLabel('select-default-value')) if(!value) { defaultOpt.attr({selected: 'selected'}) } selectEl.append(defaultOpt) options.forEach(opt => { const optEl = $$('option').attr({value: opt.id}).append(opt.text) if(opt.id === value) optEl.attr({selected: 'selected'}) selectEl.append(optEl) }) el.append( $$('div').addClass('se-label').append(label), selectEl ) return el } _onChange() { const name = this.props.name const value = this._getValue() this.send('set-value', name, value) } _getValue() { const input = this.refs.input return input.value } }
Use a new updating strategy.
Use a new updating strategy.
JavaScript
mit
substance/texture,substance/texture
javascript
## Code Before: import { Component } from 'substance' export default class SelectInput extends Component { render($$) { const label = this.props.label const value = this.props.value const options = this.props.availableOptions const el = $$('div').addClass('sc-select-input') const selectEl = $$('select').addClass('se-select') .ref('input') .on('change', this._onChange) const defaultOpt = $$('option').attr({value: false}) .append(this.getLabel('select-default-value')) if(!value) { defaultOpt.attr({selected: 'selected'}) } selectEl.append(defaultOpt) options.forEach(opt => { const optEl = $$('option').attr({value: opt.id}).append(opt.text) if(opt.id === value) optEl.attr({selected: 'selected'}) selectEl.append(optEl) }) el.append( $$('div').addClass('se-label').append(label), selectEl ) return el } _onChange() { const id = this.props.id if(id) { const value = this._getValue() this.send('input:change', id, value) } } _getValue() { const input = this.refs.input return input.value } } ## Instruction: Use a new updating strategy. ## Code After: import { Component } from 'substance' export default class SelectInput extends Component { render($$) { const label = this.props.label const value = this.props.value const options = this.props.availableOptions const el = $$('div').addClass('sc-select-input') const selectEl = $$('select').addClass('se-select') .ref('input') .on('change', this._onChange) const defaultOpt = $$('option').attr({value: false}) .append(this.getLabel('select-default-value')) if(!value) { defaultOpt.attr({selected: 'selected'}) } selectEl.append(defaultOpt) options.forEach(opt => { const optEl = $$('option').attr({value: opt.id}).append(opt.text) if(opt.id === value) optEl.attr({selected: 'selected'}) selectEl.append(optEl) }) el.append( $$('div').addClass('se-label').append(label), selectEl ) return el } _onChange() { const name = this.props.name const value = this._getValue() this.send('set-value', name, value) } _getValue() { const input = this.refs.input return input.value } }
import { Component } from 'substance' export default class SelectInput extends Component { render($$) { const label = this.props.label const value = this.props.value const options = this.props.availableOptions const el = $$('div').addClass('sc-select-input') const selectEl = $$('select').addClass('se-select') .ref('input') .on('change', this._onChange) const defaultOpt = $$('option').attr({value: false}) .append(this.getLabel('select-default-value')) if(!value) { defaultOpt.attr({selected: 'selected'}) } selectEl.append(defaultOpt) options.forEach(opt => { const optEl = $$('option').attr({value: opt.id}).append(opt.text) if(opt.id === value) optEl.attr({selected: 'selected'}) selectEl.append(optEl) }) el.append( $$('div').addClass('se-label').append(label), selectEl ) return el } _onChange() { - const id = this.props.id ? ^^ ^^ + const name = this.props.name ? ^^^^ ^^^^ - if(id) { - const value = this._getValue() ? -- + const value = this._getValue() + this.send('set-value', name, value) - this.send('input:change', id, value) - } } _getValue() { const input = this.refs.input return input.value } }
8
0.163265
3
5
ac9863acadfa514721ed3602f6027f7c53e246a6
WEB-INF/src/edu/wustl/catissuecore/util/global/HibernateProperties.java
WEB-INF/src/edu/wustl/catissuecore/util/global/HibernateProperties.java
/* * Created on Jul 19, 2004 * */ package edu.wustl.catissuecore.util.global; import java.util.ResourceBundle; /** * This class is used to retrieve values of keys from the ApplicationResources.properties file. * @author kapil_kaveeshwar */ public class HibernateProperties { private static ResourceBundle bundle; public static void initBundle(String baseName) { bundle = ResourceBundle.getBundle(baseName); } public static String getValue(String theKey) { return bundle.getString(theKey); } }
/* * Created on Jul 19, 2004 * */ package edu.wustl.catissuecore.util.global; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.util.Properties; /** * This class is used to retrieve values of keys from the ApplicationResources.properties file. * @author kapil_kaveeshwar */ public class HibernateProperties { private static Properties p; public static void initBundle(String baseName) { try { File file = new File(baseName); BufferedInputStream stram = new BufferedInputStream(new FileInputStream(file)); p = new Properties(); p.load(stram); stram.close(); } catch(Exception exe) { exe.printStackTrace(); throw new RuntimeException( "Exception building HibernateProperties: " + exe.getMessage(), exe); } //ResourceBundle. } public static String getValue(String theKey) { return p.getProperty(theKey); } }
Use of properties class for reading resources
Use of properties class for reading resources SVN-Revision: 864
Java
bsd-3-clause
NCIP/catissue-core,NCIP/catissue-core,krishagni/openspecimen,NCIP/catissue-core,asamgir/openspecimen,asamgir/openspecimen,krishagni/openspecimen,krishagni/openspecimen,asamgir/openspecimen
java
## Code Before: /* * Created on Jul 19, 2004 * */ package edu.wustl.catissuecore.util.global; import java.util.ResourceBundle; /** * This class is used to retrieve values of keys from the ApplicationResources.properties file. * @author kapil_kaveeshwar */ public class HibernateProperties { private static ResourceBundle bundle; public static void initBundle(String baseName) { bundle = ResourceBundle.getBundle(baseName); } public static String getValue(String theKey) { return bundle.getString(theKey); } } ## Instruction: Use of properties class for reading resources SVN-Revision: 864 ## Code After: /* * Created on Jul 19, 2004 * */ package edu.wustl.catissuecore.util.global; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.util.Properties; /** * This class is used to retrieve values of keys from the ApplicationResources.properties file. * @author kapil_kaveeshwar */ public class HibernateProperties { private static Properties p; public static void initBundle(String baseName) { try { File file = new File(baseName); BufferedInputStream stram = new BufferedInputStream(new FileInputStream(file)); p = new Properties(); p.load(stram); stram.close(); } catch(Exception exe) { exe.printStackTrace(); throw new RuntimeException( "Exception building HibernateProperties: " + exe.getMessage(), exe); } //ResourceBundle. } public static String getValue(String theKey) { return p.getProperty(theKey); } }
/* * Created on Jul 19, 2004 * */ package edu.wustl.catissuecore.util.global; - import java.util.ResourceBundle; + import java.io.BufferedInputStream; + import java.io.File; + import java.io.FileInputStream; + import java.util.Properties; /** * This class is used to retrieve values of keys from the ApplicationResources.properties file. * @author kapil_kaveeshwar */ public class HibernateProperties { - private static ResourceBundle bundle; + private static Properties p; public static void initBundle(String baseName) { - bundle = ResourceBundle.getBundle(baseName); + try + { + File file = new File(baseName); + BufferedInputStream stram = new BufferedInputStream(new FileInputStream(file)); + p = new Properties(); + p.load(stram); + stram.close(); + } + catch(Exception exe) + { + exe.printStackTrace(); + throw new RuntimeException( + "Exception building HibernateProperties: " + exe.getMessage(), exe); + } + + //ResourceBundle. } public static String getValue(String theKey) { - return bundle.getString(theKey); + return p.getProperty(theKey); } }
26
1
22
4
7098b34b75b2f4b3fc7247904b7e222ac76f843b
dashboard_app/templates/dashboard_app/add_test_definition.html
dashboard_app/templates/dashboard_app/add_test_definition.html
{% extends "dashboard_app/_content_with_sidebar.html" %} {% load i18n %} {% load stylize %} {% block extrahead %} <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/> {% endblock %} {% block sidebar %} <h3>Actions</h3> <ul> <li><a href="{% url dashboard_app.views.test_definition %}"> List test definitions</a></li> <li><a href="{% url dashboard_app.views.add_test_definition %}"> Add test definition</a></li> </ul> {% endblock %} {% block content %} <form method="post" action=""> {% csrf_token %} <table class="form_helper"> {% for field in form %} {% block form_field %} <tr> <th><label for="{{ field.id_for_label }}">{{ field.label }}</label></th> <td> {% if field.errors %} <div class="ui-state-error"> {{ field.errors }} {{ field }} </div> {% else %} {{ field }} {% endif %} <p class='help_text'>{{ field.help_text }}</p> </td> </tr> {% endblock %} {% endfor %} </table> <input type="submit" value="Save"/> </form> {% endblock %}
{% extends "dashboard_app/_content_with_sidebar.html" %} {% load i18n %} {% load stylize %} {% block extrahead %} <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/> {% endblock %} {% block sidebar %} <h3>Actions</h3> <ul> <li><a href="{% url dashboard_app.views.test_definition %}"> List test definitions</a></li> <li><a href="{% url dashboard_app.views.add_test_definition %}"> Add test definition</a></li> </ul> {% endblock %} {% block content %} <form method="post" action=""> {% csrf_token %} <table>{{ form.as_table }}</table> <input type="submit" value="Save"/> </form> {% endblock %}
Use form.as_table to display add test definition form.
Use form.as_table to display add test definition form.
HTML
agpl-3.0
Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,OSSystems/lava-server,OSSystems/lava-server
html
## Code Before: {% extends "dashboard_app/_content_with_sidebar.html" %} {% load i18n %} {% load stylize %} {% block extrahead %} <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/> {% endblock %} {% block sidebar %} <h3>Actions</h3> <ul> <li><a href="{% url dashboard_app.views.test_definition %}"> List test definitions</a></li> <li><a href="{% url dashboard_app.views.add_test_definition %}"> Add test definition</a></li> </ul> {% endblock %} {% block content %} <form method="post" action=""> {% csrf_token %} <table class="form_helper"> {% for field in form %} {% block form_field %} <tr> <th><label for="{{ field.id_for_label }}">{{ field.label }}</label></th> <td> {% if field.errors %} <div class="ui-state-error"> {{ field.errors }} {{ field }} </div> {% else %} {{ field }} {% endif %} <p class='help_text'>{{ field.help_text }}</p> </td> </tr> {% endblock %} {% endfor %} </table> <input type="submit" value="Save"/> </form> {% endblock %} ## Instruction: Use form.as_table to display add test definition form. ## Code After: {% extends "dashboard_app/_content_with_sidebar.html" %} {% load i18n %} {% load stylize %} {% block extrahead %} <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/> {% endblock %} {% block sidebar %} <h3>Actions</h3> <ul> <li><a href="{% url dashboard_app.views.test_definition %}"> List test definitions</a></li> <li><a href="{% url dashboard_app.views.add_test_definition %}"> Add test definition</a></li> </ul> {% endblock %} {% block content %} <form method="post" action=""> {% csrf_token %} <table>{{ form.as_table }}</table> <input type="submit" value="Save"/> </form> {% endblock %}
{% extends "dashboard_app/_content_with_sidebar.html" %} {% load i18n %} {% load stylize %} {% block extrahead %} <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/> {% endblock %} {% block sidebar %} <h3>Actions</h3> <ul> <li><a href="{% url dashboard_app.views.test_definition %}"> List test definitions</a></li> <li><a href="{% url dashboard_app.views.add_test_definition %}"> Add test definition</a></li> </ul> {% endblock %} {% block content %} <form method="post" action=""> {% csrf_token %} + <table>{{ form.as_table }}</table> - <table class="form_helper"> - {% for field in form %} - {% block form_field %} - <tr> - <th><label for="{{ field.id_for_label }}">{{ field.label }}</label></th> - <td> - {% if field.errors %} - <div class="ui-state-error"> - {{ field.errors }} - {{ field }} - </div> - {% else %} - {{ field }} - {% endif %} - <p class='help_text'>{{ field.help_text }}</p> - </td> - </tr> - {% endblock %} - {% endfor %} - </table> <input type="submit" value="Save"/> </form> {% endblock %}
21
0.477273
1
20
4eb358e74a0c7835022cf29962c547cd3713a603
test-generator-tools/randoop/get-tool.sh
test-generator-tools/randoop/get-tool.sh
CWD="$( cd "$(dirname "$(readlink "$0" || printf %s "$0")")" pwd -P )" rm -f "$CWD/randoop.jar" wget "https://github.com/mernst/randoop/releases/download/v1.3.6/randoop-1.3.6.jar" -O "$CWD/randoop.jar" chmod +x "$CWD/randoop.jar" echo "1.3.6" > "$CWD/VERSION"
VERSION=2.1.4 CWD="$( cd "$(dirname "$(readlink "$0" || printf %s "$0")")" pwd -P )" rm -f "$CWD/randoop.jar" wget "https://github.com/mernst/randoop/releases/download/v$VERSION/randoop-$VERSION.jar" -O "$CWD/randoop.jar" chmod +x "$CWD/randoop.jar" echo "$VERSION" > "$CWD/VERSION"
Update randoop version to 2.1.4
Update randoop version to 2.1.4
Shell
apache-2.0
SETTE-Testing/sette-tool,SETTE-Testing/sette-tool
shell
## Code Before: CWD="$( cd "$(dirname "$(readlink "$0" || printf %s "$0")")" pwd -P )" rm -f "$CWD/randoop.jar" wget "https://github.com/mernst/randoop/releases/download/v1.3.6/randoop-1.3.6.jar" -O "$CWD/randoop.jar" chmod +x "$CWD/randoop.jar" echo "1.3.6" > "$CWD/VERSION" ## Instruction: Update randoop version to 2.1.4 ## Code After: VERSION=2.1.4 CWD="$( cd "$(dirname "$(readlink "$0" || printf %s "$0")")" pwd -P )" rm -f "$CWD/randoop.jar" wget "https://github.com/mernst/randoop/releases/download/v$VERSION/randoop-$VERSION.jar" -O "$CWD/randoop.jar" chmod +x "$CWD/randoop.jar" echo "$VERSION" > "$CWD/VERSION"
- + VERSION=2.1.4 CWD="$( cd "$(dirname "$(readlink "$0" || printf %s "$0")")" pwd -P )" rm -f "$CWD/randoop.jar" - wget "https://github.com/mernst/randoop/releases/download/v1.3.6/randoop-1.3.6.jar" -O "$CWD/randoop.jar" ? ^^^^^ ^^^^^ + wget "https://github.com/mernst/randoop/releases/download/v$VERSION/randoop-$VERSION.jar" -O "$CWD/randoop.jar" ? ^^^^^^^^ ^^^^^^^^ chmod +x "$CWD/randoop.jar" - echo "1.3.6" > "$CWD/VERSION" ? ^^^^^ + echo "$VERSION" > "$CWD/VERSION" ? ^^^^^^^^
6
0.545455
3
3
4ec61469d199f1033fe289275e79a48e97c4889c
build.sbt
build.sbt
name := "twitter4j-tutorial" version := "0.1.0 " scalaVersion := "2.10.0" libraryDependencies += "org.twitter4j" % "twitter4j-stream" % "3.0.3"
name := "twitter4j-tutorial" version := "0.2.0 " scalaVersion := "2.10.0" libraryDependencies ++= Seq( "org.twitter4j" % "twitter4j-core" % "3.0.3", "org.twitter4j" % "twitter4j-stream" % "3.0.3" )
Increase version to 0.2.0. Add twitter4j-core dependency.
Increase version to 0.2.0. Add twitter4j-core dependency.
Scala
apache-2.0
jasonbaldridge/twitter4j-tutorial
scala
## Code Before: name := "twitter4j-tutorial" version := "0.1.0 " scalaVersion := "2.10.0" libraryDependencies += "org.twitter4j" % "twitter4j-stream" % "3.0.3" ## Instruction: Increase version to 0.2.0. Add twitter4j-core dependency. ## Code After: name := "twitter4j-tutorial" version := "0.2.0 " scalaVersion := "2.10.0" libraryDependencies ++= Seq( "org.twitter4j" % "twitter4j-core" % "3.0.3", "org.twitter4j" % "twitter4j-stream" % "3.0.3" )
name := "twitter4j-tutorial" - version := "0.1.0 " ? ^ + version := "0.2.0 " ? ^ scalaVersion := "2.10.0" + libraryDependencies ++= Seq( + "org.twitter4j" % "twitter4j-core" % "3.0.3", - libraryDependencies += "org.twitter4j" % "twitter4j-stream" % "3.0.3" ? ------------------- -- + "org.twitter4j" % "twitter4j-stream" % "3.0.3" + )
7
1
5
2
dbf9d905c5de1b5416a6ad1677e6b6474dd015e5
README.md
README.md
=wluxui= ======== To map this repo on your local dev machine, see this illustration at: ![diagram showing how to map github repos to web server.](https://github.com/weblabux/wlux_web_service/blob/master/documentation/WebSiteFolderMap.png?raw=true)
WLUXUI ====== To map this repo on your local dev machine, see this illustration at: ![diagram showing how to map github repos to web server.](https://github.com/weblabux/wlux_web_service/blob/master/documentation/WebSiteFolderMap.png?raw=true) More stuff goes here. For instance ... this. More more more.
Add extra text to the read me
Add extra text to the read me
Markdown
mit
weblabux/wluxui,weblabux/wluxui,weblabux/wluxui
markdown
## Code Before: =wluxui= ======== To map this repo on your local dev machine, see this illustration at: ![diagram showing how to map github repos to web server.](https://github.com/weblabux/wlux_web_service/blob/master/documentation/WebSiteFolderMap.png?raw=true) ## Instruction: Add extra text to the read me ## Code After: WLUXUI ====== To map this repo on your local dev machine, see this illustration at: ![diagram showing how to map github repos to web server.](https://github.com/weblabux/wlux_web_service/blob/master/documentation/WebSiteFolderMap.png?raw=true) More stuff goes here. For instance ... this. More more more.
- =wluxui= + WLUXUI - ======== ? -- + ====== To map this repo on your local dev machine, see this illustration at: ![diagram showing how to map github repos to web server.](https://github.com/weblabux/wlux_web_service/blob/master/documentation/WebSiteFolderMap.png?raw=true) + + More stuff goes here. For instance ... this. More more more.
6
1.5
4
2
08bb24ad80db72457c87533288b97942cc178dd6
src/kanboard/urls.py
src/kanboard/urls.py
import os from django.conf.urls.defaults import patterns, url import kanboard urlpatterns = patterns('kanboard.views', url(r'^board/(?P<board_slug>[\w-]+)/$', 'board'), url(r'^board/(?P<board_slug>[\w-]+)/update/$', 'update'), ) # Serve static content static_root = os.path.join(os.path.dirname(kanboard.__file__), 'static') urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': static_root}) )
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('kanboard.views', url(r'^board/(?P<board_slug>[\w-]+)/$', 'board'), url(r'^board/(?P<board_slug>[\w-]+)/update/$', 'update'), )
Remove static file serving (using django-staticfiles instead is recommended)
Remove static file serving (using django-staticfiles instead is recommended)
Python
bsd-3-clause
zellyn/django-kanboard,zellyn/django-kanboard
python
## Code Before: import os from django.conf.urls.defaults import patterns, url import kanboard urlpatterns = patterns('kanboard.views', url(r'^board/(?P<board_slug>[\w-]+)/$', 'board'), url(r'^board/(?P<board_slug>[\w-]+)/update/$', 'update'), ) # Serve static content static_root = os.path.join(os.path.dirname(kanboard.__file__), 'static') urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': static_root}) ) ## Instruction: Remove static file serving (using django-staticfiles instead is recommended) ## Code After: from django.conf.urls.defaults import patterns, url urlpatterns = patterns('kanboard.views', url(r'^board/(?P<board_slug>[\w-]+)/$', 'board'), url(r'^board/(?P<board_slug>[\w-]+)/update/$', 'update'), )
- import os from django.conf.urls.defaults import patterns, url - import kanboard urlpatterns = patterns('kanboard.views', url(r'^board/(?P<board_slug>[\w-]+)/$', 'board'), url(r'^board/(?P<board_slug>[\w-]+)/update/$', 'update'), ) - # Serve static content - static_root = os.path.join(os.path.dirname(kanboard.__file__), 'static') - urlpatterns += patterns('', - (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': static_root}) - )
7
0.5
0
7
703ff26008525bce769b137fafe51ac080a6af81
plyer/platforms/ios/compass.py
plyer/platforms/ios/compass.py
''' iOS Compass --------------------- ''' from plyer.facades import Compass from pyobjus import autoclass class IosCompass(Compass): def __init__(self): super(IosCompass, self).__init__() self.bridge = autoclass('bridge').alloc().init() self.bridge.motionManager.setMagnetometerUpdateInterval_(0.1) def _enable(self): self.bridge.startMagnetometer() def _disable(self): self.bridge.stopMagnetometer() def _get_orientation(self): return ( self.bridge.mg_x, self.bridge.mg_y, self.bridge.mg_z) def instance(): return IosCompass()
''' iOS Compass ----------- ''' from plyer.facades import Compass from pyobjus import autoclass class IosCompass(Compass): def __init__(self): super(IosCompass, self).__init__() self.bridge = autoclass('bridge').alloc().init() self.bridge.motionManager.setMagnetometerUpdateInterval_(0.1) self.bridge.motionManager.setDeviceMotionUpdateInterval_(0.1) def _enable(self): self.bridge.startMagnetometer() self.bridge.startDeviceMotionWithReferenceFrame() def _disable(self): self.bridge.stopMagnetometer() self.bridge.stopDeviceMotion() def _get_orientation(self): return ( self.bridge.mf_x, self.bridge.mf_y, self.bridge.mf_z) def _get_field_uncalib(self): return ( self.bridge.mg_x, self.bridge.mg_y, self.bridge.mg_z, self.bridge.mg_x - self.bridge.mf_x, self.bridge.mg_y - self.bridge.mf_y, self.bridge.mg_z - self.bridge.mf_z) def instance(): return IosCompass()
Add iOS implementation to get uncalibrated values
Add iOS implementation to get uncalibrated values
Python
mit
kivy/plyer,KeyWeeUsr/plyer,kivy/plyer,kivy/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer
python
## Code Before: ''' iOS Compass --------------------- ''' from plyer.facades import Compass from pyobjus import autoclass class IosCompass(Compass): def __init__(self): super(IosCompass, self).__init__() self.bridge = autoclass('bridge').alloc().init() self.bridge.motionManager.setMagnetometerUpdateInterval_(0.1) def _enable(self): self.bridge.startMagnetometer() def _disable(self): self.bridge.stopMagnetometer() def _get_orientation(self): return ( self.bridge.mg_x, self.bridge.mg_y, self.bridge.mg_z) def instance(): return IosCompass() ## Instruction: Add iOS implementation to get uncalibrated values ## Code After: ''' iOS Compass ----------- ''' from plyer.facades import Compass from pyobjus import autoclass class IosCompass(Compass): def __init__(self): super(IosCompass, self).__init__() self.bridge = autoclass('bridge').alloc().init() self.bridge.motionManager.setMagnetometerUpdateInterval_(0.1) self.bridge.motionManager.setDeviceMotionUpdateInterval_(0.1) def _enable(self): self.bridge.startMagnetometer() self.bridge.startDeviceMotionWithReferenceFrame() def _disable(self): self.bridge.stopMagnetometer() self.bridge.stopDeviceMotion() def _get_orientation(self): return ( self.bridge.mf_x, self.bridge.mf_y, self.bridge.mf_z) def _get_field_uncalib(self): return ( self.bridge.mg_x, self.bridge.mg_y, self.bridge.mg_z, self.bridge.mg_x - self.bridge.mf_x, self.bridge.mg_y - self.bridge.mf_y, self.bridge.mg_z - self.bridge.mf_z) def instance(): return IosCompass()
''' iOS Compass - --------------------- + ----------- ''' from plyer.facades import Compass from pyobjus import autoclass class IosCompass(Compass): def __init__(self): super(IosCompass, self).__init__() self.bridge = autoclass('bridge').alloc().init() self.bridge.motionManager.setMagnetometerUpdateInterval_(0.1) + self.bridge.motionManager.setDeviceMotionUpdateInterval_(0.1) def _enable(self): self.bridge.startMagnetometer() + self.bridge.startDeviceMotionWithReferenceFrame() def _disable(self): self.bridge.stopMagnetometer() + self.bridge.stopDeviceMotion() def _get_orientation(self): return ( + self.bridge.mf_x, + self.bridge.mf_y, + self.bridge.mf_z) + + def _get_field_uncalib(self): + return ( self.bridge.mg_x, self.bridge.mg_y, - self.bridge.mg_z) ? ^ + self.bridge.mg_z, ? ^ + self.bridge.mg_x - self.bridge.mf_x, + self.bridge.mg_y - self.bridge.mf_y, + self.bridge.mg_z - self.bridge.mf_z) def instance(): return IosCompass()
16
0.516129
14
2
5713be499d368dc5e3f5ec6b07115b71a2f5306e
README.md
README.md
minnow 鯫 ======== Winnow and chaff example in golang To start the client: ``go run chaff/chaff.go`` See: http://people.csail.mit.edu/rivest/Chaffing.txt And: http://en.wikipedia.org/wiki/Chaffing_and_winnowing ![](http://i.imgur.com/cuwkJr1.gif)
minnow 鯫 ======== Winnow and chaff example in golang To run the server: ``go run winnow/winnow.go`` To run the test client: ``go run chaff/chaff.go`` See: http://people.csail.mit.edu/rivest/Chaffing.txt And: http://en.wikipedia.org/wiki/Chaffing_and_winnowing ![](http://i.imgur.com/cuwkJr1.gif)
Add instructions for running server / winnow
Add instructions for running server / winnow
Markdown
unlicense
schmichael/minnow
markdown
## Code Before: minnow 鯫 ======== Winnow and chaff example in golang To start the client: ``go run chaff/chaff.go`` See: http://people.csail.mit.edu/rivest/Chaffing.txt And: http://en.wikipedia.org/wiki/Chaffing_and_winnowing ![](http://i.imgur.com/cuwkJr1.gif) ## Instruction: Add instructions for running server / winnow ## Code After: minnow 鯫 ======== Winnow and chaff example in golang To run the server: ``go run winnow/winnow.go`` To run the test client: ``go run chaff/chaff.go`` See: http://people.csail.mit.edu/rivest/Chaffing.txt And: http://en.wikipedia.org/wiki/Chaffing_and_winnowing ![](http://i.imgur.com/cuwkJr1.gif)
minnow 鯫 ======== Winnow and chaff example in golang + To run the server: ``go run winnow/winnow.go`` + - To start the client: ``go run chaff/chaff.go`` ? --- ^ + To run the test client: ``go run chaff/chaff.go`` ? ^^ +++++ See: http://people.csail.mit.edu/rivest/Chaffing.txt And: http://en.wikipedia.org/wiki/Chaffing_and_winnowing ![](http://i.imgur.com/cuwkJr1.gif)
4
0.285714
3
1
91d344fed44084daba3dd16aefaefb4f289de652
src/main/java/us/crast/mondochest/persist/PlayerState.java
src/main/java/us/crast/mondochest/persist/PlayerState.java
package us.crast.mondochest.persist; import org.bukkit.Location; import org.bukkit.entity.Player; public class PlayerState { private Location lastClickedMaster; private State state = State.NORMAL; public PlayerState(Player player) {} /* Getters/Setters */ public Location getLastClickedMaster() { return lastClickedMaster; } public void setLastClickedMaster(Location lastClickedMaster) { this.lastClickedMaster = lastClickedMaster; } public boolean isManagingChest() { return this.state == State.MANAGING_CHEST; } public void setManagingChest() { this.state = State.MANAGING_CHEST; } public void setNormalMode() { this.state = State.NORMAL; } enum State { NORMAL, MANAGING_CHEST; } }
package us.crast.mondochest.persist; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.util.Vector; public class PlayerState { private String lastClickedWorld; private Vector lastClickedVector; private State state = State.NORMAL; public PlayerState(Player player) {} /* Getters/Setters */ public Location getLastClickedMaster() { return new Location( Bukkit.getWorld(lastClickedWorld), lastClickedVector.getX(), lastClickedVector.getY(), lastClickedVector.getZ() ); } public void setLastClickedMaster(Location lastClickedMaster) { this.lastClickedWorld = lastClickedMaster.getWorld().toString(); this.lastClickedVector = lastClickedMaster.toVector(); } public boolean isManagingChest() { return this.state == State.MANAGING_CHEST; } public void setManagingChest() { this.state = State.MANAGING_CHEST; } public void setNormalMode() { this.state = State.NORMAL; } enum State { NORMAL, MANAGING_CHEST; } }
Clean up possible World memory leak in storing locations.
Clean up possible World memory leak in storing locations.
Java
bsd-3-clause
crast/MondoChest,crast/MondoChest
java
## Code Before: package us.crast.mondochest.persist; import org.bukkit.Location; import org.bukkit.entity.Player; public class PlayerState { private Location lastClickedMaster; private State state = State.NORMAL; public PlayerState(Player player) {} /* Getters/Setters */ public Location getLastClickedMaster() { return lastClickedMaster; } public void setLastClickedMaster(Location lastClickedMaster) { this.lastClickedMaster = lastClickedMaster; } public boolean isManagingChest() { return this.state == State.MANAGING_CHEST; } public void setManagingChest() { this.state = State.MANAGING_CHEST; } public void setNormalMode() { this.state = State.NORMAL; } enum State { NORMAL, MANAGING_CHEST; } } ## Instruction: Clean up possible World memory leak in storing locations. ## Code After: package us.crast.mondochest.persist; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.util.Vector; public class PlayerState { private String lastClickedWorld; private Vector lastClickedVector; private State state = State.NORMAL; public PlayerState(Player player) {} /* Getters/Setters */ public Location getLastClickedMaster() { return new Location( Bukkit.getWorld(lastClickedWorld), lastClickedVector.getX(), lastClickedVector.getY(), lastClickedVector.getZ() ); } public void setLastClickedMaster(Location lastClickedMaster) { this.lastClickedWorld = lastClickedMaster.getWorld().toString(); this.lastClickedVector = lastClickedMaster.toVector(); } public boolean isManagingChest() { return this.state == State.MANAGING_CHEST; } public void setManagingChest() { this.state = State.MANAGING_CHEST; } public void setNormalMode() { this.state = State.NORMAL; } enum State { NORMAL, MANAGING_CHEST; } }
package us.crast.mondochest.persist; + import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; + import org.bukkit.util.Vector; public class PlayerState { - private Location lastClickedMaster; ? ^^^^ - ^^^^^ + private String lastClickedWorld; ? ^ + + ^^ ++ + private Vector lastClickedVector; + private State state = State.NORMAL; public PlayerState(Player player) {} /* Getters/Setters */ public Location getLastClickedMaster() { - return lastClickedMaster; + return new Location( + Bukkit.getWorld(lastClickedWorld), + lastClickedVector.getX(), + lastClickedVector.getY(), + lastClickedVector.getZ() + ); } + public void setLastClickedMaster(Location lastClickedMaster) { + this.lastClickedWorld = lastClickedMaster.getWorld().toString(); - this.lastClickedMaster = lastClickedMaster; ? ^^^ ^ + this.lastClickedVector = lastClickedMaster.toVector(); ? ^^^ ^ +++++++++++ } public boolean isManagingChest() { return this.state == State.MANAGING_CHEST; } public void setManagingChest() { this.state = State.MANAGING_CHEST; } public void setNormalMode() { this.state = State.NORMAL; } enum State { NORMAL, MANAGING_CHEST; } }
17
0.485714
14
3
2cd7bfac239561ab7ad119d558a6508e66e4ad22
app/javascript/flavours/glitch/containers/poll_container.js
app/javascript/flavours/glitch/containers/poll_container.js
import { connect } from 'react-redux'; import Poll from 'mastodon/components/poll'; const mapStateToProps = (state, { pollId }) => ({ poll: state.getIn(['polls', pollId]), }); export default connect(mapStateToProps)(Poll);
import { connect } from 'react-redux'; import Poll from 'flavours/glitch/components/poll'; const mapStateToProps = (state, { pollId }) => ({ poll: state.getIn(['polls', pollId]), }); export default connect(mapStateToProps)(Poll);
Use glitch-soc's poll component instead of upstream's
Use glitch-soc's poll component instead of upstream's
JavaScript
agpl-3.0
Kirishima21/mastodon,Kirishima21/mastodon,im-in-space/mastodon,im-in-space/mastodon,Kirishima21/mastodon,im-in-space/mastodon,Kirishima21/mastodon,glitch-soc/mastodon,glitch-soc/mastodon,glitch-soc/mastodon,glitch-soc/mastodon,im-in-space/mastodon
javascript
## Code Before: import { connect } from 'react-redux'; import Poll from 'mastodon/components/poll'; const mapStateToProps = (state, { pollId }) => ({ poll: state.getIn(['polls', pollId]), }); export default connect(mapStateToProps)(Poll); ## Instruction: Use glitch-soc's poll component instead of upstream's ## Code After: import { connect } from 'react-redux'; import Poll from 'flavours/glitch/components/poll'; const mapStateToProps = (state, { pollId }) => ({ poll: state.getIn(['polls', pollId]), }); export default connect(mapStateToProps)(Poll);
import { connect } from 'react-redux'; - import Poll from 'mastodon/components/poll'; ? ^ ^^^^ + import Poll from 'flavours/glitch/components/poll'; ? ^^ ++++ ++++ ^^ const mapStateToProps = (state, { pollId }) => ({ poll: state.getIn(['polls', pollId]), }); export default connect(mapStateToProps)(Poll);
2
0.25
1
1
cbc86da5a0b1e92f6cff4bebb1783cf23204d0f6
package.json
package.json
{ "devDependencies": { "bower": "~1.3.0", "grunt": "~0.4.1", "grunt-browserify": "^5.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-sass": "~0.8.0", "grunt-contrib-watch": "~0.6.0", "grunt-exorcise": "^2.1.1", "grunt-img": "~0.1.0", "grunt-standard": "^2.0.0" } }
{ "devDependencies": { "bower": "~1.3.0", "grunt": "~0.4.1", "grunt-browserify": "^5.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-sass": "~0.8.0", "grunt-contrib-watch": "~0.6.0", "grunt-exorcise": "^2.1.1", "grunt-img": "~0.1.0", "grunt-modernizr": "^1.0.2", "grunt-standard": "^2.0.0" } }
Add missing dependency for grunt
Add missing dependency for grunt
JSON
mit
dxw/whippet-theme-template,dxw/whippet-theme-template
json
## Code Before: { "devDependencies": { "bower": "~1.3.0", "grunt": "~0.4.1", "grunt-browserify": "^5.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-sass": "~0.8.0", "grunt-contrib-watch": "~0.6.0", "grunt-exorcise": "^2.1.1", "grunt-img": "~0.1.0", "grunt-standard": "^2.0.0" } } ## Instruction: Add missing dependency for grunt ## Code After: { "devDependencies": { "bower": "~1.3.0", "grunt": "~0.4.1", "grunt-browserify": "^5.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-sass": "~0.8.0", "grunt-contrib-watch": "~0.6.0", "grunt-exorcise": "^2.1.1", "grunt-img": "~0.1.0", "grunt-modernizr": "^1.0.2", "grunt-standard": "^2.0.0" } }
{ "devDependencies": { "bower": "~1.3.0", "grunt": "~0.4.1", "grunt-browserify": "^5.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-sass": "~0.8.0", "grunt-contrib-watch": "~0.6.0", "grunt-exorcise": "^2.1.1", "grunt-img": "~0.1.0", + "grunt-modernizr": "^1.0.2", "grunt-standard": "^2.0.0" } }
1
0.076923
1
0
737bf244f36b73a54b5b4f89f0c7e604d3f34b72
tests/grammar_term-nonterm_test/NonterminalGetTest.py
tests/grammar_term-nonterm_test/NonterminalGetTest.py
from unittest import TestCase, main from grammpy import Grammar from grammpy import Nonterminal class TempClass(Nonterminal): pass class Second(Nonterminal): pass class Third(Nonterminal): pass class TerminalGetTest(TestCase): pass if __name__ == '__main__': main()
from unittest import TestCase, main from grammpy import Grammar from grammpy import Nonterminal class TempClass(Nonterminal): pass class Second(Nonterminal): pass class Third(Nonterminal): pass class TerminalGetTest(TestCase): def test_getNontermEmpty(self): gr = Grammar() self.assertIsNone(gr.get_nonterm(TempClass)) self.assertIsNone(gr.get_nonterm(Second)) self.assertIsNone(gr.get_nonterm(Third)) def test_getNontermClass(self): gr = Grammar() gr.add_nonterm(TempClass) self.assertEqual(gr.get_nonterm(TempClass), TempClass) def test_getNontermArray(self): gr = Grammar() gr.add_nonterm([TempClass, Second, Third]) g = gr.get_term([Second, TempClass]) for i in g: self.assertTrue(i in [TempClass, Second, Third]) self.assertEqual(g[0], Second) self.assertEqual(g[1], TempClass) def test_dontGetNontermArray(self): gr = Grammar() gr.add_term([TempClass, Second]) g = gr.get_term([TempClass, Third]) self.assertEqual(g[0], TempClass) self.assertIsNone(g[1]) def test_getNontermTuple(self): gr = Grammar() gr.add_term([TempClass, Second, Third]) g = gr.get_term((Third, TempClass)) for i in g: self.assertTrue(i in [TempClass, Second, Third]) self.assertEqual(g[0], Third) self.assertEqual(g[1], TempClass) def test_dontGetNontermTuple(self): gr = Grammar() gr.add_term([TempClass, Second]) g = gr.get_term((TempClass, Third)) self.assertEqual(g[0], TempClass) self.assertIsNone(g[1]) if __name__ == '__main__': main()
Add tests of get nonterms
Add tests of get nonterms
Python
mit
PatrikValkovic/grammpy
python
## Code Before: from unittest import TestCase, main from grammpy import Grammar from grammpy import Nonterminal class TempClass(Nonterminal): pass class Second(Nonterminal): pass class Third(Nonterminal): pass class TerminalGetTest(TestCase): pass if __name__ == '__main__': main() ## Instruction: Add tests of get nonterms ## Code After: from unittest import TestCase, main from grammpy import Grammar from grammpy import Nonterminal class TempClass(Nonterminal): pass class Second(Nonterminal): pass class Third(Nonterminal): pass class TerminalGetTest(TestCase): def test_getNontermEmpty(self): gr = Grammar() self.assertIsNone(gr.get_nonterm(TempClass)) self.assertIsNone(gr.get_nonterm(Second)) self.assertIsNone(gr.get_nonterm(Third)) def test_getNontermClass(self): gr = Grammar() gr.add_nonterm(TempClass) self.assertEqual(gr.get_nonterm(TempClass), TempClass) def test_getNontermArray(self): gr = Grammar() gr.add_nonterm([TempClass, Second, Third]) g = gr.get_term([Second, TempClass]) for i in g: self.assertTrue(i in [TempClass, Second, Third]) self.assertEqual(g[0], Second) self.assertEqual(g[1], TempClass) def test_dontGetNontermArray(self): gr = Grammar() gr.add_term([TempClass, Second]) g = gr.get_term([TempClass, Third]) self.assertEqual(g[0], TempClass) self.assertIsNone(g[1]) def test_getNontermTuple(self): gr = Grammar() gr.add_term([TempClass, Second, Third]) g = gr.get_term((Third, TempClass)) for i in g: self.assertTrue(i in [TempClass, Second, Third]) self.assertEqual(g[0], Third) self.assertEqual(g[1], TempClass) def test_dontGetNontermTuple(self): gr = Grammar() gr.add_term([TempClass, Second]) g = gr.get_term((TempClass, Third)) self.assertEqual(g[0], TempClass) self.assertIsNone(g[1]) if __name__ == '__main__': main()
from unittest import TestCase, main from grammpy import Grammar from grammpy import Nonterminal class TempClass(Nonterminal): pass class Second(Nonterminal): pass class Third(Nonterminal): pass class TerminalGetTest(TestCase): - pass + def test_getNontermEmpty(self): + gr = Grammar() + self.assertIsNone(gr.get_nonterm(TempClass)) + self.assertIsNone(gr.get_nonterm(Second)) + self.assertIsNone(gr.get_nonterm(Third)) + + def test_getNontermClass(self): + gr = Grammar() + gr.add_nonterm(TempClass) + self.assertEqual(gr.get_nonterm(TempClass), TempClass) + + def test_getNontermArray(self): + gr = Grammar() + gr.add_nonterm([TempClass, Second, Third]) + g = gr.get_term([Second, TempClass]) + for i in g: + self.assertTrue(i in [TempClass, Second, Third]) + self.assertEqual(g[0], Second) + self.assertEqual(g[1], TempClass) + + def test_dontGetNontermArray(self): + gr = Grammar() + gr.add_term([TempClass, Second]) + g = gr.get_term([TempClass, Third]) + self.assertEqual(g[0], TempClass) + self.assertIsNone(g[1]) + + def test_getNontermTuple(self): + gr = Grammar() + gr.add_term([TempClass, Second, Third]) + g = gr.get_term((Third, TempClass)) + for i in g: + self.assertTrue(i in [TempClass, Second, Third]) + self.assertEqual(g[0], Third) + self.assertEqual(g[1], TempClass) + + def test_dontGetNontermTuple(self): + gr = Grammar() + gr.add_term([TempClass, Second]) + g = gr.get_term((TempClass, Third)) + self.assertEqual(g[0], TempClass) + self.assertIsNone(g[1]) + if __name__ == '__main__': main()
44
1.913043
43
1
93926a9986ab4ba7704cd564d0052b6e60ff38cb
casepro/pods/base.py
casepro/pods/base.py
import json from confmodel import fields, Config as ConfmodelConfig from django.apps import AppConfig class PodConfig(ConfmodelConfig): ''' This is the config that all pods should use as the base for their own config. ''' index = fields.ConfigInt( "A unique identifier for the specific instance of this pod." "Automatically determined and set in the pod registry.", required=True) title = fields.ConfigText( "The title to show in the UI for this pod", default=None) class Pod(object): ''' The base class for all pod plugins. ''' def __init__(self, pod_type, config): self.pod_type = pod_type self.config = config @property def config_json(self): return json.dumps(self.config._config_data) def read_data(self, params): '''Should return the data that should be used to create the display for the pod.''' return {} def perform_action(self, params): '''Should perform the action specified by params.''' return {} class PodPlugin(AppConfig): name = 'casepro.pods' label = 'base_pod' pod_class = Pod config_class = PodConfig title = 'Pod' controller = None directive = None
import json from confmodel import fields, Config as ConfmodelConfig from django.apps import AppConfig class PodConfig(ConfmodelConfig): ''' This is the config that all pods should use as the base for their own config. ''' index = fields.ConfigInt( "A unique identifier for the specific instance of this pod." "Automatically determined and set in the pod registry.", required=True) title = fields.ConfigText( "The title to show in the UI for this pod", default=None) class Pod(object): ''' The base class for all pod plugins. ''' def __init__(self, pod_type, config): self.pod_type = pod_type self.config = config @property def config_json(self): return json.dumps(self.config._config_data) def read_data(self, params): '''Should return the data that should be used to create the display for the pod.''' return {} def perform_action(self, params): '''Should perform the action specified by params.''' return {} class PodPlugin(AppConfig): name = 'casepro.pods' pod_class = Pod config_class = PodConfig # django application label, used to determine which pod type to use when # loading pods configured in `settings.PODS` label = 'base_pod' # default title to use when configuring each pod title = 'Pod' # override to use a different angular controller controller = 'PodController' # override to use a different angular directive directive = 'pod' # override with paths to custom scripts that the pod needs scripts = () # override with paths to custom styles that the pod needs styles = ()
Add the class-level vars we need for pod angular components to PodPlugin
Add the class-level vars we need for pod angular components to PodPlugin
Python
bsd-3-clause
rapidpro/casepro,praekelt/casepro,xkmato/casepro,rapidpro/casepro,praekelt/casepro,xkmato/casepro,praekelt/casepro,rapidpro/casepro
python
## Code Before: import json from confmodel import fields, Config as ConfmodelConfig from django.apps import AppConfig class PodConfig(ConfmodelConfig): ''' This is the config that all pods should use as the base for their own config. ''' index = fields.ConfigInt( "A unique identifier for the specific instance of this pod." "Automatically determined and set in the pod registry.", required=True) title = fields.ConfigText( "The title to show in the UI for this pod", default=None) class Pod(object): ''' The base class for all pod plugins. ''' def __init__(self, pod_type, config): self.pod_type = pod_type self.config = config @property def config_json(self): return json.dumps(self.config._config_data) def read_data(self, params): '''Should return the data that should be used to create the display for the pod.''' return {} def perform_action(self, params): '''Should perform the action specified by params.''' return {} class PodPlugin(AppConfig): name = 'casepro.pods' label = 'base_pod' pod_class = Pod config_class = PodConfig title = 'Pod' controller = None directive = None ## Instruction: Add the class-level vars we need for pod angular components to PodPlugin ## Code After: import json from confmodel import fields, Config as ConfmodelConfig from django.apps import AppConfig class PodConfig(ConfmodelConfig): ''' This is the config that all pods should use as the base for their own config. ''' index = fields.ConfigInt( "A unique identifier for the specific instance of this pod." "Automatically determined and set in the pod registry.", required=True) title = fields.ConfigText( "The title to show in the UI for this pod", default=None) class Pod(object): ''' The base class for all pod plugins. ''' def __init__(self, pod_type, config): self.pod_type = pod_type self.config = config @property def config_json(self): return json.dumps(self.config._config_data) def read_data(self, params): '''Should return the data that should be used to create the display for the pod.''' return {} def perform_action(self, params): '''Should perform the action specified by params.''' return {} class PodPlugin(AppConfig): name = 'casepro.pods' pod_class = Pod config_class = PodConfig # django application label, used to determine which pod type to use when # loading pods configured in `settings.PODS` label = 'base_pod' # default title to use when configuring each pod title = 'Pod' # override to use a different angular controller controller = 'PodController' # override to use a different angular directive directive = 'pod' # override with paths to custom scripts that the pod needs scripts = () # override with paths to custom styles that the pod needs styles = ()
import json from confmodel import fields, Config as ConfmodelConfig from django.apps import AppConfig class PodConfig(ConfmodelConfig): ''' This is the config that all pods should use as the base for their own config. ''' index = fields.ConfigInt( "A unique identifier for the specific instance of this pod." "Automatically determined and set in the pod registry.", required=True) title = fields.ConfigText( "The title to show in the UI for this pod", default=None) class Pod(object): ''' The base class for all pod plugins. ''' def __init__(self, pod_type, config): self.pod_type = pod_type self.config = config @property def config_json(self): return json.dumps(self.config._config_data) def read_data(self, params): '''Should return the data that should be used to create the display for the pod.''' return {} def perform_action(self, params): '''Should perform the action specified by params.''' return {} class PodPlugin(AppConfig): name = 'casepro.pods' - label = 'base_pod' pod_class = Pod config_class = PodConfig + # django application label, used to determine which pod type to use when + # loading pods configured in `settings.PODS` + label = 'base_pod' + + # default title to use when configuring each pod title = 'Pod' + # override to use a different angular controller - controller = None ? ^ + controller = 'PodController' ? ^^^^^ +++++ ++ + # override to use a different angular directive - directive = None ? ^ ^^ + directive = 'pod' ? ^^ ^^ + + # override with paths to custom scripts that the pod needs + scripts = () + + # override with paths to custom styles that the pod needs + styles = ()
18
0.339623
15
3
ab77c1fa4d01725a0ff1f78e9b79b0ceefbdd03e
.travis.yml
.travis.yml
language: php php: - 7.0 - 7.1 - hhvm before_install: - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt-get install --yes nodejs - npm install -g grunt-cli install: - npm install - composer install script: - grunt after_script: - php vendor/bin/coveralls -v - chmod +x code-climate-test-reporter - CODECLIMATE_REPO_TOKEN=fbbb8faf1226ee12fa1f4f6b838fb021e0fcfcb4c48a8be1906adedcc255a860 ./code-climate-test-reporter
language: php php: - 7.0 - 7.1 - hhvm before_install: - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt-get install --yes nodejs - npm install -g grunt-cli install: - npm install - composer install script: - grunt after_script: - php vendor/bin/coveralls -v - chmod +x code-climate-test-reporter - CODECLIMATE_REPO_TOKEN=22f651c22e953865509abf9a97b48de2909e3d03e48f7d50ceb332082b278c81 ./code-climate-test-reporter
Update Code Climate repo token.
Update Code Climate repo token.
YAML
mit
gomoob/php-websocket-server,gomoob/php-websocket-server,gomoob/php-websocket-server
yaml
## Code Before: language: php php: - 7.0 - 7.1 - hhvm before_install: - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt-get install --yes nodejs - npm install -g grunt-cli install: - npm install - composer install script: - grunt after_script: - php vendor/bin/coveralls -v - chmod +x code-climate-test-reporter - CODECLIMATE_REPO_TOKEN=fbbb8faf1226ee12fa1f4f6b838fb021e0fcfcb4c48a8be1906adedcc255a860 ./code-climate-test-reporter ## Instruction: Update Code Climate repo token. ## Code After: language: php php: - 7.0 - 7.1 - hhvm before_install: - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt-get install --yes nodejs - npm install -g grunt-cli install: - npm install - composer install script: - grunt after_script: - php vendor/bin/coveralls -v - chmod +x code-climate-test-reporter - CODECLIMATE_REPO_TOKEN=22f651c22e953865509abf9a97b48de2909e3d03e48f7d50ceb332082b278c81 ./code-climate-test-reporter
language: php php: - 7.0 - 7.1 - hhvm before_install: - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt-get install --yes nodejs - npm install -g grunt-cli install: - npm install - composer install script: - grunt after_script: - php vendor/bin/coveralls -v - chmod +x code-climate-test-reporter - - CODECLIMATE_REPO_TOKEN=fbbb8faf1226ee12fa1f4f6b838fb021e0fcfcb4c48a8be1906adedcc255a860 ./code-climate-test-reporter + - CODECLIMATE_REPO_TOKEN=22f651c22e953865509abf9a97b48de2909e3d03e48f7d50ceb332082b278c81 ./code-climate-test-reporter
2
0.086957
1
1
650cb87a348e8adef099c6ab6f2a4b92e89b593c
project.clj
project.clj
(defproject buddy/buddy-hashers "0.4.2" :description "A collection of secure password hashers for Clojure" :url "https://github.com/funcool/buddy-hashers" :license {:name "Apache 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0"} :dependencies [[org.clojure/clojure "1.6.0"] [buddy/buddy-core "0.5.0"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] :test-paths ["test"])
(defproject buddy/buddy-hashers "0.4.2" :description "A collection of secure password hashers for Clojure" :url "https://github.com/funcool/buddy-hashers" :license {:name "Apache 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0"} :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"] [buddy/buddy-core "0.5.0"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] :test-paths ["test"] :profiles {:dev {:plugins [[lein-ancient "0.6.7"]]}})
Add lein-ancient plugin and set "provided" scope for clojure.
Add lein-ancient plugin and set "provided" scope for clojure.
Clojure
apache-2.0
rorygibson/buddy-hashers,funcool/buddy-hashers,rorygibson/buddy-hashers,funcool/buddy-hashers
clojure
## Code Before: (defproject buddy/buddy-hashers "0.4.2" :description "A collection of secure password hashers for Clojure" :url "https://github.com/funcool/buddy-hashers" :license {:name "Apache 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0"} :dependencies [[org.clojure/clojure "1.6.0"] [buddy/buddy-core "0.5.0"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] :test-paths ["test"]) ## Instruction: Add lein-ancient plugin and set "provided" scope for clojure. ## Code After: (defproject buddy/buddy-hashers "0.4.2" :description "A collection of secure password hashers for Clojure" :url "https://github.com/funcool/buddy-hashers" :license {:name "Apache 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0"} :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"] [buddy/buddy-core "0.5.0"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] :test-paths ["test"] :profiles {:dev {:plugins [[lein-ancient "0.6.7"]]}})
(defproject buddy/buddy-hashers "0.4.2" :description "A collection of secure password hashers for Clojure" :url "https://github.com/funcool/buddy-hashers" :license {:name "Apache 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0"} - :dependencies [[org.clojure/clojure "1.6.0"] + :dependencies [[org.clojure/clojure "1.6.0" :scope "provided"] ? ++++++++++++++++++ [buddy/buddy-core "0.5.0"] [clojurewerkz/scrypt "1.2.0"]] :source-paths ["src/clojure"] :java-source-paths ["src/java"] :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] - :test-paths ["test"]) ? - + :test-paths ["test"] + :profiles {:dev {:plugins [[lein-ancient "0.6.7"]]}})
5
0.416667
3
2
de0db0b8cd59a350dd18bec4a1588aba9724cfcf
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
class DashboardController < ApplicationController before_filter :authenticate_user! def show end end
class DashboardController < ApplicationController before_filter :authenticate_user! def show session[:CTF_FLAG] = "2112" end end
Add a flag in triage.
Add a flag in triage.
Ruby
mit
secure-pipeline/rails-travis-example,Jemurai/triage,Jemurai/triage,secure-pipeline/rails-travis-example,secure-pipeline/rails-travis-example
ruby
## Code Before: class DashboardController < ApplicationController before_filter :authenticate_user! def show end end ## Instruction: Add a flag in triage. ## Code After: class DashboardController < ApplicationController before_filter :authenticate_user! def show session[:CTF_FLAG] = "2112" end end
class DashboardController < ApplicationController before_filter :authenticate_user! def show - + session[:CTF_FLAG] = "2112" end end
2
0.285714
1
1
91712f57a2153046bb5f6f423fc19c15cf0c2b7a
build_matrix_sdk_lib_develop.sh
build_matrix_sdk_lib_develop.sh
echo updir cd .. echo remove sdk folder rm -rf matrix-android-sdk echo clone the git folder git clone -b develop https://github.com/matrix-org/matrix-android-sdk cd matrix-android-sdk ./gradlew clean assembleRelease cd ../riot-android # Ensure the lib is updated by removing the previous one rm vector/libs/matrix-sdk.aar cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar
echo "Save current dir" currentDir=`pwd` echo "up dir" cd .. echo "remove sdk folder" rm -rf matrix-android-sdk echo "clone the matrix-android-sdk repository, and checkout develop branch" git clone -b develop https://github.com/matrix-org/matrix-android-sdk cd matrix-android-sdk echo "Build matrix sdk from source" ./gradlew clean assembleRelease cd ${currentDir} echo "Copy freshly built matrix sdk to the libs folder" # Ensure the lib is updated by removing the previous one rm vector/libs/matrix-sdk.aar cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar
Fix issue on script for Jenkins related to path
Fix issue on script for Jenkins related to path
Shell
apache-2.0
vector-im/vector-android,vector-im/riot-android,vector-im/riot-android,vector-im/vector-android,vector-im/vector-android,vector-im/riot-android,vector-im/vector-android,vector-im/riot-android,vector-im/riot-android
shell
## Code Before: echo updir cd .. echo remove sdk folder rm -rf matrix-android-sdk echo clone the git folder git clone -b develop https://github.com/matrix-org/matrix-android-sdk cd matrix-android-sdk ./gradlew clean assembleRelease cd ../riot-android # Ensure the lib is updated by removing the previous one rm vector/libs/matrix-sdk.aar cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar ## Instruction: Fix issue on script for Jenkins related to path ## Code After: echo "Save current dir" currentDir=`pwd` echo "up dir" cd .. echo "remove sdk folder" rm -rf matrix-android-sdk echo "clone the matrix-android-sdk repository, and checkout develop branch" git clone -b develop https://github.com/matrix-org/matrix-android-sdk cd matrix-android-sdk echo "Build matrix sdk from source" ./gradlew clean assembleRelease cd ${currentDir} echo "Copy freshly built matrix sdk to the libs folder" # Ensure the lib is updated by removing the previous one rm vector/libs/matrix-sdk.aar cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar
+ echo "Save current dir" + currentDir=`pwd` + - echo updir + echo "up dir" ? + + + cd .. - echo remove sdk folder + echo "remove sdk folder" ? + + rm -rf matrix-android-sdk - echo clone the git folder + echo "clone the matrix-android-sdk repository, and checkout develop branch" git clone -b develop https://github.com/matrix-org/matrix-android-sdk - cd matrix-android-sdk ? - + cd matrix-android-sdk + echo "Build matrix sdk from source" ./gradlew clean assembleRelease - cd ../riot-android + cd ${currentDir} + echo "Copy freshly built matrix sdk to the libs folder" # Ensure the lib is updated by removing the previous one rm vector/libs/matrix-sdk.aar - cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar ? - + cp ../matrix-android-sdk/matrix-sdk/build/outputs/aar/matrix-sdk-release-*.aar vector/libs/matrix-sdk.aar -
18
0.857143
11
7
b1a7ce456c65b5086804065f30920e661dbd82e2
S06-signature/unpack-array.t
S06-signature/unpack-array.t
use v6; use Test; plan 3; # L<S06/Unpacking array parameters> sub foo($x, [$y, *@z]) { return "$x|$y|" ~ @z.join(';'); } my @a = 2, 3, 4, 5; is foo(1, @a), '2|3|4;5', 'array unpacking'; sub bar([$x, $y, $z]) { return [*] $x, $y, $z; } ok bar(@a[0..2]) == 24, 'fixed length array unpacking'; dies_ok { bar [1,2] }, 'fixed length array unpacking with wrong length'; # vim: ft=perl6
use v6; use Test; plan 3; # L<S06/Unpacking array parameters> sub foo($x, [$y, *@z]) { return "$x|$y|" ~ @z.join(';'); } my @a = 2, 3, 4, 5; is foo(1, @a), '1|2|3;4;5', 'array unpacking'; sub bar([$x, $y, $z]) { return $x * $y * $z; } ok bar(@a[0..2]) == 24, 'fixed length array unpacking'; dies_ok { bar [1,2] }, 'fixed length array unpacking with wrong length'; # vim: ft=perl6
Correct mistake in array unpacking test, and make it work without reduction operator.
[t/spec] Correct mistake in array unpacking test, and make it work without reduction operator. git-svn-id: 53605643c415f7495558be95614cf14171f1db78@29753 c213334d-75ef-0310-aa23-eaa082d1ae64
Perl
artistic-2.0
perl6/roast,b2gills/roast,bitrauser/roast,dankogai/roast,bitrauser/roast,zostay/roast,skids/roast,zostay/roast,laben/roast,cygx/roast,b2gills/roast,dogbert17/roast,dankogai/roast,dankogai/roast,cygx/roast,skids/roast,zostay/roast,b2gills/roast,skids/roast,niner/roast,laben/roast,niner/roast,dogbert17/roast,niner/roast,laben/roast,cygx/roast
perl
## Code Before: use v6; use Test; plan 3; # L<S06/Unpacking array parameters> sub foo($x, [$y, *@z]) { return "$x|$y|" ~ @z.join(';'); } my @a = 2, 3, 4, 5; is foo(1, @a), '2|3|4;5', 'array unpacking'; sub bar([$x, $y, $z]) { return [*] $x, $y, $z; } ok bar(@a[0..2]) == 24, 'fixed length array unpacking'; dies_ok { bar [1,2] }, 'fixed length array unpacking with wrong length'; # vim: ft=perl6 ## Instruction: [t/spec] Correct mistake in array unpacking test, and make it work without reduction operator. git-svn-id: 53605643c415f7495558be95614cf14171f1db78@29753 c213334d-75ef-0310-aa23-eaa082d1ae64 ## Code After: use v6; use Test; plan 3; # L<S06/Unpacking array parameters> sub foo($x, [$y, *@z]) { return "$x|$y|" ~ @z.join(';'); } my @a = 2, 3, 4, 5; is foo(1, @a), '1|2|3;4;5', 'array unpacking'; sub bar([$x, $y, $z]) { return $x * $y * $z; } ok bar(@a[0..2]) == 24, 'fixed length array unpacking'; dies_ok { bar [1,2] }, 'fixed length array unpacking with wrong length'; # vim: ft=perl6
use v6; use Test; plan 3; # L<S06/Unpacking array parameters> sub foo($x, [$y, *@z]) { return "$x|$y|" ~ @z.join(';'); } my @a = 2, 3, 4, 5; - is foo(1, @a), '2|3|4;5', 'array unpacking'; ? ^ + is foo(1, @a), '1|2|3;4;5', 'array unpacking'; ? ++ ^ sub bar([$x, $y, $z]) { - return [*] $x, $y, $z; ? ---- ^ ^ + return $x * $y * $z; ? ^^ ^^ } ok bar(@a[0..2]) == 24, 'fixed length array unpacking'; dies_ok { bar [1,2] }, 'fixed length array unpacking with wrong length'; # vim: ft=perl6
4
0.190476
2
2
cf79568336641741f02c60c8be2291d3fa96ee3d
server/routes/users/index.js
server/routes/users/index.js
import express from 'express'; import * as userController from '../../controllers/users'; const user = express.Router(); // define route controllers for creating sign up, login and sign out user.post('/signup', userController.signUp); user.post('/signin', userController.signIn); user.post('/signout', userController.signOut); export default user;
import express from 'express'; import * as userController from '../../controllers/users'; import * as recipeController from '../../controllers/recipes'; const user = express.Router(); // define route controllers for creating sign up, login and sign out user.post('/signup', userController.signUp); user.post('/signin', userController.signIn); user.post('/signout', userController.signOut); // define route for fetching User stored recipes user.get('/myRecipes', recipeController.getUserRecipes); export default user;
Implement getUserRecipes on api/v1/users/myRecipes route
Implement getUserRecipes on api/v1/users/myRecipes route
JavaScript
apache-2.0
larrystone/BC-26-More-Recipes,larrystone/BC-26-More-Recipes
javascript
## Code Before: import express from 'express'; import * as userController from '../../controllers/users'; const user = express.Router(); // define route controllers for creating sign up, login and sign out user.post('/signup', userController.signUp); user.post('/signin', userController.signIn); user.post('/signout', userController.signOut); export default user; ## Instruction: Implement getUserRecipes on api/v1/users/myRecipes route ## Code After: import express from 'express'; import * as userController from '../../controllers/users'; import * as recipeController from '../../controllers/recipes'; const user = express.Router(); // define route controllers for creating sign up, login and sign out user.post('/signup', userController.signUp); user.post('/signin', userController.signIn); user.post('/signout', userController.signOut); // define route for fetching User stored recipes user.get('/myRecipes', recipeController.getUserRecipes); export default user;
import express from 'express'; import * as userController from '../../controllers/users'; + import * as recipeController from '../../controllers/recipes'; const user = express.Router(); // define route controllers for creating sign up, login and sign out user.post('/signup', userController.signUp); user.post('/signin', userController.signIn); user.post('/signout', userController.signOut); - + // define route for fetching User stored recipes + user.get('/myRecipes', recipeController.getUserRecipes); export default user;
4
0.285714
3
1
43539f403ef11d38439ea5a74cbe81cd88b6fc8d
lib/api-umbrella-gatekeeper.rb
lib/api-umbrella-gatekeeper.rb
require "active_support/core_ext" module ApiUmbrella module Gatekeeper mattr_accessor :redis mattr_accessor :logger self.logger = Logger.new(STDOUT) end end require "api-umbrella-gatekeeper/server"
require "active_support/core_ext" module ApiUmbrella module Gatekeeper mattr_accessor :redis mattr_accessor :logger $stdout.sync = true self.logger = Logger.new($stdout) end end require "api-umbrella-gatekeeper/server"
Disable buffering on stdout logger.
Disable buffering on stdout logger.
Ruby
mit
apinf/api-umbrella,NREL/api-umbrella,NREL/api-umbrella,apinf/api-umbrella,NREL/api-umbrella,NREL/api-umbrella,OdiloOrg/api-umbrella-gatekeeper,apinf/api-umbrella,apinf/api-umbrella,apinf/api-umbrella,cmc333333/api-umbrella-gatekeeper,NREL/api-umbrella-gatekeeper
ruby
## Code Before: require "active_support/core_ext" module ApiUmbrella module Gatekeeper mattr_accessor :redis mattr_accessor :logger self.logger = Logger.new(STDOUT) end end require "api-umbrella-gatekeeper/server" ## Instruction: Disable buffering on stdout logger. ## Code After: require "active_support/core_ext" module ApiUmbrella module Gatekeeper mattr_accessor :redis mattr_accessor :logger $stdout.sync = true self.logger = Logger.new($stdout) end end require "api-umbrella-gatekeeper/server"
require "active_support/core_ext" module ApiUmbrella module Gatekeeper mattr_accessor :redis mattr_accessor :logger + + $stdout.sync = true - self.logger = Logger.new(STDOUT) ? ^^^^^^ + self.logger = Logger.new($stdout) ? ^^^^^^^ end end require "api-umbrella-gatekeeper/server"
4
0.333333
3
1
fac8976cc69007cf8c49a27bc881944c582581ce
app/controllers/spree/shipwire_webhook_controller.rb
app/controllers/spree/shipwire_webhook_controller.rb
module Spree class ShipwireWebhookController < ActionController::Base respond_to :json before_action :validate_key, except: :subscribe def subscribe if exists_in_post?("/shipwire_webhooks/#{params[:path]}") head :ok else head :not_found end end private def exists_in_post?(path) Spree::Core::Engine.routes.recognize_path(path, method: :post) true rescue ActionController::RoutingError false end def validate_key render json: { result: :unauthorized }, status: :unauthorized unless valid_shipwire_token? end def valid_shipwire_token? request.headers['HTTP_X_SHIPWIRE_SIGNATURE'] == calculated_hmac end def data request.body.rewind request.body.read end def calculated_hmac Base64.encode64( OpenSSL::HMAC.digest( OpenSSL::Digest.new('sha256'), Spree::ShipwireConfig.secret, data ) ).strip end end end
module Spree class ShipwireWebhookController < ActionController::Base respond_to :json before_action :validate_key, except: :subscribe def subscribe if exists_in_post?("/shipwire_webhooks/#{params[:path]}") head :ok else head :not_found end end private def exists_in_post?(path) Spree::Core::Engine.routes.recognize_path(path, method: :post) true rescue ActionController::RoutingError false end def validate_key render json: { result: :unauthorized }, status: :unauthorized unless valid_shipwire_token? end def valid_shipwire_token? request.headers['HTTP_X_SHIPWIRE_SIGNATURE'] == calculated_hmac end def calculated_hmac OpenSSL::HMAC.hexdigest( OpenSSL::Digest.new('SHA256'), Spree::ShipwireConfig.secret, request.raw_post ) end end end
Change digest for shipwire signature
Change digest for shipwire signature
Ruby
bsd-3-clause
nebulab/solidus_shipwire,nebulab/solidus_shipwire,nebulab/solidus_shipwire
ruby
## Code Before: module Spree class ShipwireWebhookController < ActionController::Base respond_to :json before_action :validate_key, except: :subscribe def subscribe if exists_in_post?("/shipwire_webhooks/#{params[:path]}") head :ok else head :not_found end end private def exists_in_post?(path) Spree::Core::Engine.routes.recognize_path(path, method: :post) true rescue ActionController::RoutingError false end def validate_key render json: { result: :unauthorized }, status: :unauthorized unless valid_shipwire_token? end def valid_shipwire_token? request.headers['HTTP_X_SHIPWIRE_SIGNATURE'] == calculated_hmac end def data request.body.rewind request.body.read end def calculated_hmac Base64.encode64( OpenSSL::HMAC.digest( OpenSSL::Digest.new('sha256'), Spree::ShipwireConfig.secret, data ) ).strip end end end ## Instruction: Change digest for shipwire signature ## Code After: module Spree class ShipwireWebhookController < ActionController::Base respond_to :json before_action :validate_key, except: :subscribe def subscribe if exists_in_post?("/shipwire_webhooks/#{params[:path]}") head :ok else head :not_found end end private def exists_in_post?(path) Spree::Core::Engine.routes.recognize_path(path, method: :post) true rescue ActionController::RoutingError false end def validate_key render json: { result: :unauthorized }, status: :unauthorized unless valid_shipwire_token? end def valid_shipwire_token? request.headers['HTTP_X_SHIPWIRE_SIGNATURE'] == calculated_hmac end def calculated_hmac OpenSSL::HMAC.hexdigest( OpenSSL::Digest.new('SHA256'), Spree::ShipwireConfig.secret, request.raw_post ) end end end
module Spree class ShipwireWebhookController < ActionController::Base respond_to :json before_action :validate_key, except: :subscribe def subscribe if exists_in_post?("/shipwire_webhooks/#{params[:path]}") head :ok else head :not_found end end private def exists_in_post?(path) Spree::Core::Engine.routes.recognize_path(path, method: :post) true rescue ActionController::RoutingError false end def validate_key render json: { result: :unauthorized }, status: :unauthorized unless valid_shipwire_token? end def valid_shipwire_token? request.headers['HTTP_X_SHIPWIRE_SIGNATURE'] == calculated_hmac end - def data - request.body.rewind - request.body.read - end - def calculated_hmac - Base64.encode64( - OpenSSL::HMAC.digest( ? -- + OpenSSL::HMAC.hexdigest( ? +++ - OpenSSL::Digest.new('sha256'), ? -- ^^^ + OpenSSL::Digest.new('SHA256'), ? ^^^ - Spree::ShipwireConfig.secret, ? -- + Spree::ShipwireConfig.secret, - data + request.raw_post - ) ? -- + ) - ).strip end end end
17
0.361702
5
12
a04e5daf2f6f25b11582279f04581622f7fbc0d2
src/test/sv/string_utils_unit_test.sv
src/test/sv/string_utils_unit_test.sv
module string_utils_unit_test; import svunit_pkg::*; `include "svunit_defines.svh" string name = "string_utils_ut"; svunit_testcase svunit_ut; import svunit_under_test::string_utils; function void build(); svunit_ut = new(name); endfunction task setup(); svunit_ut.setup(); endtask task teardown(); svunit_ut.teardown(); endtask `SVUNIT_TESTS_BEGIN `SVTEST(can_split_string_by_underscore) string some_string = "some_string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "some", "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore) string some_string = "string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVUNIT_TESTS_END endmodule
module string_utils_unit_test; import svunit_stable_pkg::*; `include "svunit_stable_defines.svh" string name = "string_utils_ut"; svunit_testcase svunit_ut; import svunit_under_test::string_utils; function void build(); svunit_ut = new(name); endfunction task setup(); svunit_ut.setup(); endtask task teardown(); svunit_ut.teardown(); endtask `SVUNIT_TESTS_BEGIN `SVTEST(can_split_string_by_underscore) string some_string = "some_string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "some", "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore) string some_string = "string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVUNIT_TESTS_END endmodule
Update unit test to use updated names for SVUnit version for testing
Update unit test to use updated names for SVUnit version for testing
SystemVerilog
apache-2.0
svunit/svunit,svunit/svunit,svunit/svunit
systemverilog
## Code Before: module string_utils_unit_test; import svunit_pkg::*; `include "svunit_defines.svh" string name = "string_utils_ut"; svunit_testcase svunit_ut; import svunit_under_test::string_utils; function void build(); svunit_ut = new(name); endfunction task setup(); svunit_ut.setup(); endtask task teardown(); svunit_ut.teardown(); endtask `SVUNIT_TESTS_BEGIN `SVTEST(can_split_string_by_underscore) string some_string = "some_string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "some", "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore) string some_string = "string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVUNIT_TESTS_END endmodule ## Instruction: Update unit test to use updated names for SVUnit version for testing ## Code After: module string_utils_unit_test; import svunit_stable_pkg::*; `include "svunit_stable_defines.svh" string name = "string_utils_ut"; svunit_testcase svunit_ut; import svunit_under_test::string_utils; function void build(); svunit_ut = new(name); endfunction task setup(); svunit_ut.setup(); endtask task teardown(); svunit_ut.teardown(); endtask `SVUNIT_TESTS_BEGIN `SVTEST(can_split_string_by_underscore) string some_string = "some_string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "some", "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore) string some_string = "string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVUNIT_TESTS_END endmodule
module string_utils_unit_test; - import svunit_pkg::*; + import svunit_stable_pkg::*; ? +++++++ - `include "svunit_defines.svh" + `include "svunit_stable_defines.svh" ? +++++++ string name = "string_utils_ut"; svunit_testcase svunit_ut; import svunit_under_test::string_utils; function void build(); svunit_ut = new(name); endfunction task setup(); svunit_ut.setup(); endtask task teardown(); svunit_ut.teardown(); endtask `SVUNIT_TESTS_BEGIN `SVTEST(can_split_string_by_underscore) string some_string = "some_string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "some", "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVTEST(split_string_by_underscore_does_nothing_when_no_underscore) string some_string = "string"; string parts[] = string_utils::split_by_char("_", some_string); string exp_parts[] = '{ "string" }; `FAIL_UNLESS_EQUAL(parts, exp_parts) `SVTEST_END `SVUNIT_TESTS_END endmodule
4
0.086957
2
2
59cf09deabc87dbf523439640a1cedecc851d740
mbc-logging-processor/mbc-logging-processor.php
mbc-logging-processor/mbc-logging-processor.php
<?php /** * mbc-import-logging.php * * Collect user import activity from the userImportExistingLoggingQueue. Update * the LoggingAPI / database with import activity via mb-logging. */ date_default_timezone_set('America/New_York'); define('CONFIG_PATH', __DIR__ . '/messagebroker-config'); // Load up the Composer autoload magic require_once __DIR__ . '/vendor/autoload.php'; use DoSomething\MBC_LoggingGateway\MBC_LoggingGateway; // Load configuration settings specific to this application require_once __DIR__ . '/mbc-logging-gateway.config.inc'; echo '------- mbc-logging-processor START - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL; // Kick off $mbcLoggingProcessor = new MBC_LoggingProcessor($credentials, $config, $settings); $mbcLoggingProcessor->processLoggedEvents(); echo '------- mbc-logging-processor END - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL;
<?php /** * mbc-import-logging.php * * Collect user import activity from the userImportExistingLoggingQueue. Update * the LoggingAPI / database with import activity via mb-logging. */ date_default_timezone_set('America/New_York'); define('CONFIG_PATH', __DIR__ . '/messagebroker-config'); // Load up the Composer autoload magic require_once __DIR__ . '/vendor/autoload.php'; use DoSomething\MBC_LoggingGateway\MBC_LoggingGateway; // Load configuration settings specific to this application require_once __DIR__ . '/mbc-logging-gateway.config.inc'; echo '------- mbc-logging-processor START - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL; // Kick off if (isset($_GET['interval'])) { $interval = $_GET['interval']; } elseif (isset($argv[1])) { $interval = $argv[1]; } if (isset($_GET['offset'])) { $offset = $_GET['offset']; } elseif (isset($argv[2])) { $offset = $argv[2]; } // Validate if (is_numeric($interval) && is_numeric($offset)) { $mbcLoggingProcessor = new MBC_LoggingProcessor($credentials, $config, $settings); $mbcLoggingProcessor->processLoggedEvents($interval, $offset); } echo '------- mbc-logging-processor END - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL;
Support interval and offset parms
Support interval and offset parms
PHP
mit
DoSomething/MessageBroker-PHP,DoSomething/MessageBroker-PHP,DoSomething/messagebroker-ds-PHP,DoSomething/messagebroker-ds-PHP
php
## Code Before: <?php /** * mbc-import-logging.php * * Collect user import activity from the userImportExistingLoggingQueue. Update * the LoggingAPI / database with import activity via mb-logging. */ date_default_timezone_set('America/New_York'); define('CONFIG_PATH', __DIR__ . '/messagebroker-config'); // Load up the Composer autoload magic require_once __DIR__ . '/vendor/autoload.php'; use DoSomething\MBC_LoggingGateway\MBC_LoggingGateway; // Load configuration settings specific to this application require_once __DIR__ . '/mbc-logging-gateway.config.inc'; echo '------- mbc-logging-processor START - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL; // Kick off $mbcLoggingProcessor = new MBC_LoggingProcessor($credentials, $config, $settings); $mbcLoggingProcessor->processLoggedEvents(); echo '------- mbc-logging-processor END - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL; ## Instruction: Support interval and offset parms ## Code After: <?php /** * mbc-import-logging.php * * Collect user import activity from the userImportExistingLoggingQueue. Update * the LoggingAPI / database with import activity via mb-logging. */ date_default_timezone_set('America/New_York'); define('CONFIG_PATH', __DIR__ . '/messagebroker-config'); // Load up the Composer autoload magic require_once __DIR__ . '/vendor/autoload.php'; use DoSomething\MBC_LoggingGateway\MBC_LoggingGateway; // Load configuration settings specific to this application require_once __DIR__ . '/mbc-logging-gateway.config.inc'; echo '------- mbc-logging-processor START - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL; // Kick off if (isset($_GET['interval'])) { $interval = $_GET['interval']; } elseif (isset($argv[1])) { $interval = $argv[1]; } if (isset($_GET['offset'])) { $offset = $_GET['offset']; } elseif (isset($argv[2])) { $offset = $argv[2]; } // Validate if (is_numeric($interval) && is_numeric($offset)) { $mbcLoggingProcessor = new MBC_LoggingProcessor($credentials, $config, $settings); $mbcLoggingProcessor->processLoggedEvents($interval, $offset); } echo '------- mbc-logging-processor END - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL;
<?php /** * mbc-import-logging.php * * Collect user import activity from the userImportExistingLoggingQueue. Update * the LoggingAPI / database with import activity via mb-logging. */ date_default_timezone_set('America/New_York'); define('CONFIG_PATH', __DIR__ . '/messagebroker-config'); // Load up the Composer autoload magic require_once __DIR__ . '/vendor/autoload.php'; use DoSomething\MBC_LoggingGateway\MBC_LoggingGateway; // Load configuration settings specific to this application require_once __DIR__ . '/mbc-logging-gateway.config.inc'; echo '------- mbc-logging-processor START - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL; // Kick off + if (isset($_GET['interval'])) { + $interval = $_GET['interval']; + } + elseif (isset($argv[1])) { + $interval = $argv[1]; + } + if (isset($_GET['offset'])) { + $offset = $_GET['offset']; + } + elseif (isset($argv[2])) { + $offset = $argv[2]; + } + + // Validate + if (is_numeric($interval) && is_numeric($offset)) { + - $mbcLoggingProcessor = new MBC_LoggingProcessor($credentials, $config, $settings); + $mbcLoggingProcessor = new MBC_LoggingProcessor($credentials, $config, $settings); ? ++ - $mbcLoggingProcessor->processLoggedEvents(); + $mbcLoggingProcessor->processLoggedEvents($interval, $offset); ? ++ ++++++++++++++++++ + + } echo '------- mbc-logging-processor END - ' . date('j D M Y G:i:s T') . ' -------', PHP_EOL;
22
0.846154
20
2
70442c91a96dfc3f724e310ef0ca5b60f987ffbc
README.md
README.md
Bash scripts I use to make my command line friendlier.
Bash scripts I use to make my command line friendlier. ## Links - http://askubuntu.com/questions/17823/how-to-list-all-installed-packages - http://askubuntu.com/questions/347555/how-do-i-list-all-installed-packages-with-specific-version-numbers
Add links to dpkg usage
Add links to dpkg usage
Markdown
isc
MattMS/bash_scripts
markdown
## Code Before: Bash scripts I use to make my command line friendlier. ## Instruction: Add links to dpkg usage ## Code After: Bash scripts I use to make my command line friendlier. ## Links - http://askubuntu.com/questions/17823/how-to-list-all-installed-packages - http://askubuntu.com/questions/347555/how-do-i-list-all-installed-packages-with-specific-version-numbers
Bash scripts I use to make my command line friendlier. + + + ## Links + + - http://askubuntu.com/questions/17823/how-to-list-all-installed-packages + + - http://askubuntu.com/questions/347555/how-do-i-list-all-installed-packages-with-specific-version-numbers
7
3.5
7
0
9c9dcf64136e83bc27dc074020ee236d4284de54
config/routes.rb
config/routes.rb
Rails.application.routes.draw do root 'home#show' scope '/:locale' do resource :styleguide, controller: 'styleguide', only: 'show', constraints: { locale: I18n.default_locale } do member do get 'components' get 'forms' get 'layouts' get 'html' get 'javascript' get 'ruby' scope 'pages' do get 'pages', path: '/' get 'pages_guide', path: '/guide' end scope 'css' do get 'css_overview', path: '/' get 'css_basic', path: '/basic' get 'css_article_demo', path: '/article-demo' get 'css_default_styles', path: '/default-styles' end scope 'sass' do get 'sass_overview', path: '/' get 'sass_variables', path: '/variables' end end end end end
Rails.application.routes.draw do root 'home#show' scope '/:locale' do resource :styleguide, controller: 'styleguide', only: 'show', constraints: { locale: I18n.default_locale } do member do get 'components' get 'forms' get 'layouts' get 'html' get 'javascript' get 'ruby' scope 'pages' do get 'pages', path: '/' get 'pages_guide', path: '/guide' get 'pages_error', path: '/error' end scope 'css' do get 'css_overview', path: '/' get 'css_basic', path: '/basic' get 'css_article_demo', path: '/article-demo' get 'css_default_styles', path: '/default-styles' end scope 'sass' do get 'sass_overview', path: '/' get 'sass_variables', path: '/variables' end end end end end
Configure route for error page.
Configure route for error page.
Ruby
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
ruby
## Code Before: Rails.application.routes.draw do root 'home#show' scope '/:locale' do resource :styleguide, controller: 'styleguide', only: 'show', constraints: { locale: I18n.default_locale } do member do get 'components' get 'forms' get 'layouts' get 'html' get 'javascript' get 'ruby' scope 'pages' do get 'pages', path: '/' get 'pages_guide', path: '/guide' end scope 'css' do get 'css_overview', path: '/' get 'css_basic', path: '/basic' get 'css_article_demo', path: '/article-demo' get 'css_default_styles', path: '/default-styles' end scope 'sass' do get 'sass_overview', path: '/' get 'sass_variables', path: '/variables' end end end end end ## Instruction: Configure route for error page. ## Code After: Rails.application.routes.draw do root 'home#show' scope '/:locale' do resource :styleguide, controller: 'styleguide', only: 'show', constraints: { locale: I18n.default_locale } do member do get 'components' get 'forms' get 'layouts' get 'html' get 'javascript' get 'ruby' scope 'pages' do get 'pages', path: '/' get 'pages_guide', path: '/guide' get 'pages_error', path: '/error' end scope 'css' do get 'css_overview', path: '/' get 'css_basic', path: '/basic' get 'css_article_demo', path: '/article-demo' get 'css_default_styles', path: '/default-styles' end scope 'sass' do get 'sass_overview', path: '/' get 'sass_variables', path: '/variables' end end end end end
Rails.application.routes.draw do root 'home#show' scope '/:locale' do resource :styleguide, controller: 'styleguide', only: 'show', constraints: { locale: I18n.default_locale } do member do get 'components' get 'forms' get 'layouts' get 'html' get 'javascript' get 'ruby' scope 'pages' do get 'pages', path: '/' get 'pages_guide', path: '/guide' + get 'pages_error', path: '/error' end scope 'css' do get 'css_overview', path: '/' get 'css_basic', path: '/basic' get 'css_article_demo', path: '/article-demo' get 'css_default_styles', path: '/default-styles' end scope 'sass' do get 'sass_overview', path: '/' get 'sass_variables', path: '/variables' end end end end end
1
0.027778
1
0
776686594b89fc30f8d5e0915628bc85b7d28b92
.travis.yml
.travis.yml
branches: only: - master language: php php: - 5.3 before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit --bootstrap tests/bootstrap.example.php tests/ notifications: irc: - "irc.freenode.org#fluxbb"
branches: only: - master language: php php: - 5.3 env: - DB_MYSQL_DBNAME=fluxbb_test - DB_MYSQL_HOST=0.0.0.0 - DB_MYSQL_USER= - DB_MYSQL_PASSWD= - DB_SQLITE_DBNAME=:memory: - DB_PGSQL_DBNAME=fluxbb_test - DB_PGSQL_HOST=127.0.0.1 - DB_PGSQL_USER=postgres - DB_PGSQL_PASSWD= before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit tests/ notifications: irc: - "irc.freenode.org#fluxbb"
Add environment variables to build script (which means we don't need a bootstrap file anymore).
Add environment variables to build script (which means we don't need a bootstrap file anymore).
YAML
lgpl-2.1
fluxbb/database
yaml
## Code Before: branches: only: - master language: php php: - 5.3 before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit --bootstrap tests/bootstrap.example.php tests/ notifications: irc: - "irc.freenode.org#fluxbb" ## Instruction: Add environment variables to build script (which means we don't need a bootstrap file anymore). ## Code After: branches: only: - master language: php php: - 5.3 env: - DB_MYSQL_DBNAME=fluxbb_test - DB_MYSQL_HOST=0.0.0.0 - DB_MYSQL_USER= - DB_MYSQL_PASSWD= - DB_SQLITE_DBNAME=:memory: - DB_PGSQL_DBNAME=fluxbb_test - DB_PGSQL_HOST=127.0.0.1 - DB_PGSQL_USER=postgres - DB_PGSQL_PASSWD= before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit tests/ notifications: irc: - "irc.freenode.org#fluxbb"
branches: only: - master language: php php: - 5.3 + env: + - DB_MYSQL_DBNAME=fluxbb_test + - DB_MYSQL_HOST=0.0.0.0 + - DB_MYSQL_USER= + - DB_MYSQL_PASSWD= + - DB_SQLITE_DBNAME=:memory: + - DB_PGSQL_DBNAME=fluxbb_test + - DB_PGSQL_HOST=127.0.0.1 + - DB_PGSQL_USER=postgres + - DB_PGSQL_PASSWD= + before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" - script: phpunit --bootstrap tests/bootstrap.example.php tests/ + script: phpunit tests/ notifications: irc: - "irc.freenode.org#fluxbb"
13
0.722222
12
1
a8e534e6e5146d012874a26181e1a58e20f34e58
pkgs_debian.txt
pkgs_debian.txt
dnsutils gcc g++ libcurl4-openssl-dev libffi-dev make net-tools netcat-openbsd ntp python-minimal python-pip python3-dev python3-minimal python3-pip screen zookeeperd
dnsutils cgroup-bin gcc g++ libcurl4-openssl-dev libffi-dev make net-tools netcat-openbsd ntp python-minimal python-pip python3-dev python3-minimal python3-pip screen zookeeperd
Fix an issue where docker wouldn't work on a fresh install.
Fix an issue where docker wouldn't work on a fresh install. Without the cgroups-bin package installed, docker can't mount cgroups, and then dies.
Text
apache-2.0
Oncilla/scion,klausman/scion,Oncilla/scion,FR4NK-W/osourced-scion,dmpiergiacomo/scion,Oncilla/scion,dmpiergiacomo/scion,netsec-ethz/scion,klausman/scion,dmpiergiacomo/scion,FR4NK-W/osourced-scion,FR4NK-W/osourced-scion,dmpiergiacomo/scion,Oncilla/scion,netsec-ethz/scion,FR4NK-W/osourced-scion,dmpiergiacomo/scion,dmpiergiacomo/scion,FR4NK-W/osourced-scion,klausman/scion,netsec-ethz/scion,netsec-ethz/scion,klausman/scion,klausman/scion
text
## Code Before: dnsutils gcc g++ libcurl4-openssl-dev libffi-dev make net-tools netcat-openbsd ntp python-minimal python-pip python3-dev python3-minimal python3-pip screen zookeeperd ## Instruction: Fix an issue where docker wouldn't work on a fresh install. Without the cgroups-bin package installed, docker can't mount cgroups, and then dies. ## Code After: dnsutils cgroup-bin gcc g++ libcurl4-openssl-dev libffi-dev make net-tools netcat-openbsd ntp python-minimal python-pip python3-dev python3-minimal python3-pip screen zookeeperd
dnsutils + cgroup-bin gcc g++ libcurl4-openssl-dev libffi-dev make net-tools netcat-openbsd ntp python-minimal python-pip python3-dev python3-minimal python3-pip screen zookeeperd
1
0.0625
1
0
8dbd3f8c3b80e0af6a19397759e9701183046e3c
apps/artist/client/index.coffee
apps/artist/client/index.coffee
_ = require 'underscore' Backbone = require 'backbone' Artist = require '../../../models/artist.coffee' CurrentUser = require '../../../models/current_user.coffee' ArtistRouter = require './router.coffee' analytics = require './analytics.coffee' attachArtworkModal = require '../../../components/page_modal/index.coffee' module.exports.init = -> analytics.listenToEvents() model = new Artist sd.ARTIST user = CurrentUser.orNull() router = new ArtistRouter model: model, user: user Backbone.history.start pushState: true if user?.isAdmin?() attachArtworkModal '.carousel-figure, .artwork-item-image-link', { 'artist/:id': 'close' 'artwork/:id': 'modal' } analytics.trackArtistPageView model
_ = require 'underscore' Backbone = require 'backbone' Artist = require '../../../models/artist.coffee' CurrentUser = require '../../../models/current_user.coffee' ArtistRouter = require './router.coffee' analytics = require './analytics.coffee' attachArtworkModal = require '../../../components/page_modal/index.coffee' module.exports.init = -> analytics.listenToEvents() model = new Artist sd.ARTIST user = CurrentUser.orNull() router = new ArtistRouter model: model, user: user Backbone.history.start pushState: true if user?.isAdmin?() selectors = [ '.carousel-figure a[href^="/artwork"]' '#artwork-section .artwork-item-image-link' ] attachArtworkModal selectors.join(', '), { 'artist/:id': 'close' 'artwork/:id': 'modal' } analytics.trackArtistPageView model
Fix selectors for enabled test
Fix selectors for enabled test
CoffeeScript
mit
oxaudo/force,mzikherman/force,cavvia/force-1,yuki24/force,xtina-starr/force,izakp/force,cavvia/force-1,xtina-starr/force,damassi/force,cavvia/force-1,joeyAghion/force,mzikherman/force,TribeMedia/force-public,kanaabe/force,joeyAghion/force,anandaroop/force,izakp/force,artsy/force,kanaabe/force,dblock/force,joeyAghion/force,yuki24/force,anandaroop/force,kanaabe/force,dblock/force,damassi/force,xtina-starr/force,kanaabe/force,yuki24/force,izakp/force,damassi/force,xtina-starr/force,eessex/force,izakp/force,yuki24/force,anandaroop/force,erikdstock/force,oxaudo/force,erikdstock/force,cavvia/force-1,dblock/force,eessex/force,artsy/force-public,joeyAghion/force,mzikherman/force,erikdstock/force,mzikherman/force,TribeMedia/force-public,eessex/force,anandaroop/force,erikdstock/force,artsy/force-public,oxaudo/force,artsy/force,damassi/force,artsy/force,eessex/force,kanaabe/force,artsy/force,oxaudo/force
coffeescript
## Code Before: _ = require 'underscore' Backbone = require 'backbone' Artist = require '../../../models/artist.coffee' CurrentUser = require '../../../models/current_user.coffee' ArtistRouter = require './router.coffee' analytics = require './analytics.coffee' attachArtworkModal = require '../../../components/page_modal/index.coffee' module.exports.init = -> analytics.listenToEvents() model = new Artist sd.ARTIST user = CurrentUser.orNull() router = new ArtistRouter model: model, user: user Backbone.history.start pushState: true if user?.isAdmin?() attachArtworkModal '.carousel-figure, .artwork-item-image-link', { 'artist/:id': 'close' 'artwork/:id': 'modal' } analytics.trackArtistPageView model ## Instruction: Fix selectors for enabled test ## Code After: _ = require 'underscore' Backbone = require 'backbone' Artist = require '../../../models/artist.coffee' CurrentUser = require '../../../models/current_user.coffee' ArtistRouter = require './router.coffee' analytics = require './analytics.coffee' attachArtworkModal = require '../../../components/page_modal/index.coffee' module.exports.init = -> analytics.listenToEvents() model = new Artist sd.ARTIST user = CurrentUser.orNull() router = new ArtistRouter model: model, user: user Backbone.history.start pushState: true if user?.isAdmin?() selectors = [ '.carousel-figure a[href^="/artwork"]' '#artwork-section .artwork-item-image-link' ] attachArtworkModal selectors.join(', '), { 'artist/:id': 'close' 'artwork/:id': 'modal' } analytics.trackArtistPageView model
_ = require 'underscore' Backbone = require 'backbone' Artist = require '../../../models/artist.coffee' CurrentUser = require '../../../models/current_user.coffee' ArtistRouter = require './router.coffee' analytics = require './analytics.coffee' attachArtworkModal = require '../../../components/page_modal/index.coffee' module.exports.init = -> analytics.listenToEvents() model = new Artist sd.ARTIST user = CurrentUser.orNull() router = new ArtistRouter model: model, user: user Backbone.history.start pushState: true if user?.isAdmin?() - attachArtworkModal '.carousel-figure, .artwork-item-image-link', { + selectors = [ + '.carousel-figure a[href^="/artwork"]' + '#artwork-section .artwork-item-image-link' + ] + + attachArtworkModal selectors.join(', '), { 'artist/:id': 'close' 'artwork/:id': 'modal' } analytics.trackArtistPageView model
7
0.291667
6
1
9ff55d671c3155e454dee8df41d2e9320ea3320f
dplace_app/static/js/directives.js
dplace_app/static/js/directives.js
angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); scope.map = $('#mapdiv').vectorMap({map: 'world_mill_en'}).vectorMap('get','mapObject'); scope.addMarkers = function() { scope.map.removeAllMarkers(); if(!scope.societies) { return; } scope.societies.forEach(function(societyResult) { var society = societyResult.society; // Add a marker for each point var marker = {latLng: society.location.coordinates.reverse(), name: society.name} scope.map.addMarker(society.id, marker); }); }; // Update markers when societies change scope.$watchCollection('societies', function(oldvalue, newvalue) { scope.addMarkers(); }); scope.$on('mapTabActivated', function(event, args) { scope.map.setSize(); }); } return { restrict: 'E', scope: { societies: '=' }, link: link }; });
angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); scope.map = $('#mapdiv').vectorMap({ map: 'world_mill_en', backgroundColor: 'white', regionStyle: { initial: { fill: '#428bca', "fill-opacity": 1, stroke: '#357ebd', "stroke-width": 0, "stroke-opacity": 1 }, hover: { "fill-opacity": 0.8 }, selected: { fill: 'yellow' }, selectedHover: { } } }).vectorMap('get','mapObject'); scope.addMarkers = function() { scope.map.removeAllMarkers(); if(!scope.societies) { return; } scope.societies.forEach(function(societyResult) { var society = societyResult.society; // Add a marker for each point var marker = {latLng: society.location.coordinates.reverse(), name: society.name} scope.map.addMarker(society.id, marker); }); }; // Update markers when societies change scope.$watchCollection('societies', function(oldvalue, newvalue) { scope.addMarkers(); }); scope.$on('mapTabActivated', function(event, args) { scope.map.setSize(); }); } return { restrict: 'E', scope: { societies: '=' }, link: link }; });
Tweak map styles to match theme
Tweak map styles to match theme
JavaScript
mit
stefelisabeth/dplace,stefelisabeth/dplace,D-PLACE/dplace,shh-dlce/dplace,NESCent/dplace,NESCent/dplace,NESCent/dplace,D-PLACE/dplace,D-PLACE/dplace,shh-dlce/dplace,NESCent/dplace,stefelisabeth/dplace,D-PLACE/dplace,stefelisabeth/dplace,shh-dlce/dplace,shh-dlce/dplace
javascript
## Code Before: angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); scope.map = $('#mapdiv').vectorMap({map: 'world_mill_en'}).vectorMap('get','mapObject'); scope.addMarkers = function() { scope.map.removeAllMarkers(); if(!scope.societies) { return; } scope.societies.forEach(function(societyResult) { var society = societyResult.society; // Add a marker for each point var marker = {latLng: society.location.coordinates.reverse(), name: society.name} scope.map.addMarker(society.id, marker); }); }; // Update markers when societies change scope.$watchCollection('societies', function(oldvalue, newvalue) { scope.addMarkers(); }); scope.$on('mapTabActivated', function(event, args) { scope.map.setSize(); }); } return { restrict: 'E', scope: { societies: '=' }, link: link }; }); ## Instruction: Tweak map styles to match theme ## Code After: angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); scope.map = $('#mapdiv').vectorMap({ map: 'world_mill_en', backgroundColor: 'white', regionStyle: { initial: { fill: '#428bca', "fill-opacity": 1, stroke: '#357ebd', "stroke-width": 0, "stroke-opacity": 1 }, hover: { "fill-opacity": 0.8 }, selected: { fill: 'yellow' }, selectedHover: { } } }).vectorMap('get','mapObject'); scope.addMarkers = function() { scope.map.removeAllMarkers(); if(!scope.societies) { return; } scope.societies.forEach(function(societyResult) { var society = societyResult.society; // Add a marker for each point var marker = {latLng: society.location.coordinates.reverse(), name: society.name} scope.map.addMarker(society.id, marker); }); }; // Update markers when societies change scope.$watchCollection('societies', function(oldvalue, newvalue) { scope.addMarkers(); }); scope.$on('mapTabActivated', function(event, args) { scope.map.setSize(); }); } return { restrict: 'E', scope: { societies: '=' }, link: link }; });
angular.module('dplaceMapDirective', []) .directive('dplaceMap', function() { function link(scope, element, attrs) { element.append("<div id='mapdiv' style='width:1140px; height:480px;'></div>"); - scope.map = $('#mapdiv').vectorMap({map: 'world_mill_en'}).vectorMap('get','mapObject'); + scope.map = $('#mapdiv').vectorMap({ + map: 'world_mill_en', + backgroundColor: 'white', + regionStyle: { + initial: { + fill: '#428bca', + "fill-opacity": 1, + stroke: '#357ebd', + "stroke-width": 0, + "stroke-opacity": 1 + }, + hover: { + "fill-opacity": 0.8 + }, + selected: { + fill: 'yellow' + }, + selectedHover: { + } + } + }).vectorMap('get','mapObject'); scope.addMarkers = function() { scope.map.removeAllMarkers(); if(!scope.societies) { return; } scope.societies.forEach(function(societyResult) { var society = societyResult.society; // Add a marker for each point var marker = {latLng: society.location.coordinates.reverse(), name: society.name} scope.map.addMarker(society.id, marker); }); }; // Update markers when societies change scope.$watchCollection('societies', function(oldvalue, newvalue) { scope.addMarkers(); }); scope.$on('mapTabActivated', function(event, args) { scope.map.setSize(); }); } return { restrict: 'E', scope: { societies: '=' }, link: link }; });
22
0.611111
21
1
963fa85893ca37bcfa59755557bb873a3bb1b852
examples/rust-gcoap/Cargo.toml
examples/rust-gcoap/Cargo.toml
[package] name = "rust-gcoap" version = "0.1.0" authors = ["Christian Amsüss <chrysn@fsfe.org>"] edition = "2018" resolver = "2" [lib] crate-type = ["staticlib"] [profile.release] # Setting the panic mode has little effect on the built code (as Rust on RIOT # supports no unwinding), but setting it allows builds on native without using # the nightly-only lang_items feature. panic = "abort" [dependencies] riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] } coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-handler-implementations = "0.3" riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples/", features = [ "vfs" ] } # While currently this exmple does not use any RIOT modules implemented in # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. rust_riotmodules = { path = "../../sys/rust_riotmodules/" }
[package] name = "rust-gcoap" version = "0.1.0" authors = ["Christian Amsüss <chrysn@fsfe.org>"] edition = "2018" resolver = "2" [lib] crate-type = ["staticlib"] [profile.release] # Setting the panic mode has little effect on the built code (as Rust on RIOT # supports no unwinding), but setting it allows builds on native without using # the nightly-only lang_items feature. panic = "abort" # This is a typical set of options that helps Rust binaries stay small lto = true codegen-units = 1 opt-level = "s" [dependencies] riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] } coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-handler-implementations = "0.3" riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples/", features = [ "vfs" ] } # While currently this exmple does not use any RIOT modules implemented in # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. rust_riotmodules = { path = "../../sys/rust_riotmodules/" }
Add Rust options for small binaries (-Os)
rust-gcoap: Add Rust options for small binaries (-Os)
TOML
lgpl-2.1
kaspar030/RIOT,RIOT-OS/RIOT,miri64/RIOT,miri64/RIOT,ant9000/RIOT,miri64/RIOT,jasonatran/RIOT,miri64/RIOT,jasonatran/RIOT,RIOT-OS/RIOT,RIOT-OS/RIOT,ant9000/RIOT,miri64/RIOT,jasonatran/RIOT,jasonatran/RIOT,RIOT-OS/RIOT,kaspar030/RIOT,kaspar030/RIOT,jasonatran/RIOT,kaspar030/RIOT,ant9000/RIOT,ant9000/RIOT,ant9000/RIOT,kaspar030/RIOT,RIOT-OS/RIOT
toml
## Code Before: [package] name = "rust-gcoap" version = "0.1.0" authors = ["Christian Amsüss <chrysn@fsfe.org>"] edition = "2018" resolver = "2" [lib] crate-type = ["staticlib"] [profile.release] # Setting the panic mode has little effect on the built code (as Rust on RIOT # supports no unwinding), but setting it allows builds on native without using # the nightly-only lang_items feature. panic = "abort" [dependencies] riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] } coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-handler-implementations = "0.3" riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples/", features = [ "vfs" ] } # While currently this exmple does not use any RIOT modules implemented in # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. rust_riotmodules = { path = "../../sys/rust_riotmodules/" } ## Instruction: rust-gcoap: Add Rust options for small binaries (-Os) ## Code After: [package] name = "rust-gcoap" version = "0.1.0" authors = ["Christian Amsüss <chrysn@fsfe.org>"] edition = "2018" resolver = "2" [lib] crate-type = ["staticlib"] [profile.release] # Setting the panic mode has little effect on the built code (as Rust on RIOT # supports no unwinding), but setting it allows builds on native without using # the nightly-only lang_items feature. panic = "abort" # This is a typical set of options that helps Rust binaries stay small lto = true codegen-units = 1 opt-level = "s" [dependencies] riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] } coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-handler-implementations = "0.3" riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples/", features = [ "vfs" ] } # While currently this exmple does not use any RIOT modules implemented in # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. rust_riotmodules = { path = "../../sys/rust_riotmodules/" }
[package] name = "rust-gcoap" version = "0.1.0" authors = ["Christian Amsüss <chrysn@fsfe.org>"] edition = "2018" resolver = "2" [lib] crate-type = ["staticlib"] [profile.release] # Setting the panic mode has little effect on the built code (as Rust on RIOT # supports no unwinding), but setting it allows builds on native without using # the nightly-only lang_items feature. panic = "abort" + # This is a typical set of options that helps Rust binaries stay small + lto = true + codegen-units = 1 + opt-level = "s" [dependencies] riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] } coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-handler-implementations = "0.3" riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-examples/", features = [ "vfs" ] } # While currently this exmple does not use any RIOT modules implemented in # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. rust_riotmodules = { path = "../../sys/rust_riotmodules/" }
4
0.142857
4
0
b27d88bed374107c6261dda51139d760bf17208b
Twig/TwigExtensions.php
Twig/TwigExtensions.php
<?php namespace Ob\CmsBundle\Twig; class TwigExtensions extends \Twig_Extension { private $configs; /** * @param array $configs */ public function __construct($configs) { $this->configs = $configs; } public function getFunctions() { return array( 'varType' => new \Twig_Function_Method($this, 'varType'), 'varClass' => new \Twig_Function_Method($this, 'varClass') ); } public function getGlobals() { return array( 'templates' => $this->configs['templates'], 'logo' => $this->configs['logo'] ); } public function varType($var) { return gettype($var); } public function varClass($var) { return get_class($var); } public function getName() { return 'ob_cms_twig_extension'; } }
<?php namespace Ob\CmsBundle\Twig; class TwigExtensions extends \Twig_Extension { private $configs; /** * @param array $configs */ public function __construct($configs) { $this->configs = $configs; } public function getFunctions() { return array( 'varType' => new \Twig_SimpleFunction('varType', array($this, 'varType')), 'varClass' => new \Twig_SimpleFunction('varClass', array($this, 'varClass')), ); } public function getGlobals() { return array( 'templates' => $this->configs['templates'], 'logo' => $this->configs['logo'] ); } public function varType($var) { return gettype($var); } public function varClass($var) { return get_class($var); } public function getName() { return 'ob_cms_twig_extension'; } }
Refactor deprecated Twig_Function_Method to Twig_SimpleFunction
Refactor deprecated Twig_Function_Method to Twig_SimpleFunction
PHP
mit
marcaube/ObCmsBundle,marcaube/ObCmsBundle
php
## Code Before: <?php namespace Ob\CmsBundle\Twig; class TwigExtensions extends \Twig_Extension { private $configs; /** * @param array $configs */ public function __construct($configs) { $this->configs = $configs; } public function getFunctions() { return array( 'varType' => new \Twig_Function_Method($this, 'varType'), 'varClass' => new \Twig_Function_Method($this, 'varClass') ); } public function getGlobals() { return array( 'templates' => $this->configs['templates'], 'logo' => $this->configs['logo'] ); } public function varType($var) { return gettype($var); } public function varClass($var) { return get_class($var); } public function getName() { return 'ob_cms_twig_extension'; } } ## Instruction: Refactor deprecated Twig_Function_Method to Twig_SimpleFunction ## Code After: <?php namespace Ob\CmsBundle\Twig; class TwigExtensions extends \Twig_Extension { private $configs; /** * @param array $configs */ public function __construct($configs) { $this->configs = $configs; } public function getFunctions() { return array( 'varType' => new \Twig_SimpleFunction('varType', array($this, 'varType')), 'varClass' => new \Twig_SimpleFunction('varClass', array($this, 'varClass')), ); } public function getGlobals() { return array( 'templates' => $this->configs['templates'], 'logo' => $this->configs['logo'] ); } public function varType($var) { return gettype($var); } public function varClass($var) { return get_class($var); } public function getName() { return 'ob_cms_twig_extension'; } }
<?php namespace Ob\CmsBundle\Twig; class TwigExtensions extends \Twig_Extension { private $configs; /** * @param array $configs */ public function __construct($configs) { $this->configs = $configs; } public function getFunctions() { return array( - 'varType' => new \Twig_Function_Method($this, 'varType'), ? ^^ ^^^^ + 'varType' => new \Twig_SimpleFunction('varType', array($this, 'varType')), ? ++++++ ^^^^^^^^ ^^^^^^^^ + - 'varClass' => new \Twig_Function_Method($this, 'varClass') ? ^^^^^^^ + 'varClass' => new \Twig_SimpleFunction('varClass', array($this, 'varClass')), ? ++++++ ^^^^^^^^^^^^^^^^^^ ++ ); } public function getGlobals() { return array( 'templates' => $this->configs['templates'], 'logo' => $this->configs['logo'] ); } public function varType($var) { return gettype($var); } public function varClass($var) { return get_class($var); } public function getName() { return 'ob_cms_twig_extension'; } }
4
0.085106
2
2
31810c8ee272f1867d3e78a6ebf21fb24f725c29
app/helpers/date_helper.rb
app/helpers/date_helper.rb
module DateHelper # Presents a fragment of a date string # Used for the rendering of a date field value. def date_value(measure, field) return if field.blank? return unless field =~ /^\d{4}-\d{2}-\d{2}$/ year, month, day = field.split("-") { "year" => year, "month" => month, "day" => day }[measure] end # Constructs a date string, attempting to produce # the format YYYY-MM-dd. Expects the Rails convention # for multiple parameter date fragments. def date_param_value(params, key) k = clean_key(key.to_s) attrs = params.symbolize_keys if attrs.key?(:"#{k}(1i)") format_date = [ attrs.fetch(:"#{k}(1i)"), attrs.fetch(:"#{k}(2i)"), attrs.fetch(:"#{k}(3i)"), ] format_date.delete_if(&:empty?) format_date.map { |d| zero_pad(d) }.join("-") end end def clean_key(key) key.gsub(/\(\di\)$/, "") end private def zero_pad(value) return value unless value =~ /^\d$/ format("%02d", value) end end
module DateHelper # Presents a fragment of a date string # Used for the rendering of a date field value. def date_value(measure, field) return if field.blank? return unless field =~ /^\d{4}-\d{2}-\d{2}$/ year, month, day = field.split("-") { "year" => year, "month" => month, "day" => day }[measure] end # Constructs a date string, attempting to produce # the format YYYY-MM-dd. Expects the Rails convention # for multiple parameter date fragments. def date_param_value(params, key) k = clean_key(key.to_s) attrs = params.symbolize_keys if attrs.key?(:"#{k}(1i)") format_date = [ attrs.fetch(:"#{k}(1i)"), attrs.fetch(:"#{k}(2i)"), attrs.fetch(:"#{k}(3i)"), ] format_date.delete_if(&:empty?) format_date.map { |d| zero_pad(d) }.join("-") end end def clean_key(key) key.gsub(/\(\di\)$/, "") end private def zero_pad(value) return value unless value =~ /^\d$/ sprintf("%02d", value) # rubocop:disable Style/FormatString end end
Fix buggy auto-correct for 'format' method
Fix buggy auto-correct for 'format' method Previously we changed to use the Kernel 'format' method, but this conflicts with an app-specific 'format' method. This switches to using 'sprintf' and disables the associated Cop. Unfortantely the term 'format' is too prevalent in this app to rename the method.
Ruby
mit
alphagov/specialist-publisher-rebuild,alphagov/specialist-publisher,alphagov/specialist-publisher-rebuild,alphagov/specialist-publisher,alphagov/specialist-publisher,alphagov/specialist-publisher-rebuild,alphagov/specialist-publisher-rebuild
ruby
## Code Before: module DateHelper # Presents a fragment of a date string # Used for the rendering of a date field value. def date_value(measure, field) return if field.blank? return unless field =~ /^\d{4}-\d{2}-\d{2}$/ year, month, day = field.split("-") { "year" => year, "month" => month, "day" => day }[measure] end # Constructs a date string, attempting to produce # the format YYYY-MM-dd. Expects the Rails convention # for multiple parameter date fragments. def date_param_value(params, key) k = clean_key(key.to_s) attrs = params.symbolize_keys if attrs.key?(:"#{k}(1i)") format_date = [ attrs.fetch(:"#{k}(1i)"), attrs.fetch(:"#{k}(2i)"), attrs.fetch(:"#{k}(3i)"), ] format_date.delete_if(&:empty?) format_date.map { |d| zero_pad(d) }.join("-") end end def clean_key(key) key.gsub(/\(\di\)$/, "") end private def zero_pad(value) return value unless value =~ /^\d$/ format("%02d", value) end end ## Instruction: Fix buggy auto-correct for 'format' method Previously we changed to use the Kernel 'format' method, but this conflicts with an app-specific 'format' method. This switches to using 'sprintf' and disables the associated Cop. Unfortantely the term 'format' is too prevalent in this app to rename the method. ## Code After: module DateHelper # Presents a fragment of a date string # Used for the rendering of a date field value. def date_value(measure, field) return if field.blank? return unless field =~ /^\d{4}-\d{2}-\d{2}$/ year, month, day = field.split("-") { "year" => year, "month" => month, "day" => day }[measure] end # Constructs a date string, attempting to produce # the format YYYY-MM-dd. Expects the Rails convention # for multiple parameter date fragments. def date_param_value(params, key) k = clean_key(key.to_s) attrs = params.symbolize_keys if attrs.key?(:"#{k}(1i)") format_date = [ attrs.fetch(:"#{k}(1i)"), attrs.fetch(:"#{k}(2i)"), attrs.fetch(:"#{k}(3i)"), ] format_date.delete_if(&:empty?) format_date.map { |d| zero_pad(d) }.join("-") end end def clean_key(key) key.gsub(/\(\di\)$/, "") end private def zero_pad(value) return value unless value =~ /^\d$/ sprintf("%02d", value) # rubocop:disable Style/FormatString end end
module DateHelper # Presents a fragment of a date string # Used for the rendering of a date field value. def date_value(measure, field) return if field.blank? return unless field =~ /^\d{4}-\d{2}-\d{2}$/ year, month, day = field.split("-") { "year" => year, "month" => month, "day" => day }[measure] end # Constructs a date string, attempting to produce # the format YYYY-MM-dd. Expects the Rails convention # for multiple parameter date fragments. def date_param_value(params, key) k = clean_key(key.to_s) attrs = params.symbolize_keys if attrs.key?(:"#{k}(1i)") format_date = [ attrs.fetch(:"#{k}(1i)"), attrs.fetch(:"#{k}(2i)"), attrs.fetch(:"#{k}(3i)"), ] format_date.delete_if(&:empty?) format_date.map { |d| zero_pad(d) }.join("-") end end def clean_key(key) key.gsub(/\(\di\)$/, "") end private def zero_pad(value) return value unless value =~ /^\d$/ - format("%02d", value) + sprintf("%02d", value) # rubocop:disable Style/FormatString end end
2
0.05
1
1
1bf1fe25ed6321de309f48f25f27451af5f745c5
contract-spel/src/main/java/com/github/sebhoss/contract/verifier/SpELBasedContractContextFactory.java
contract-spel/src/main/java/com/github/sebhoss/contract/verifier/SpELBasedContractContextFactory.java
/* * Copyright © 2012 Sebastian Hoß <mail@shoss.de> * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. */ package com.github.sebhoss.contract.verifier; import com.github.sebhoss.contract.annotation.Clause; import com.github.sebhoss.contract.annotation.SpEL; import org.springframework.expression.EvaluationContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; /** * SpEL-based implementation of the {@link ContractContextFactory}. */ @SpEL public class SpELBasedContractContextFactory implements ContractContextFactory { @Override public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) { final ExpressionParser parser = new SpelExpressionParser(); final EvaluationContext context = new StandardEvaluationContext(); for (int index = 0; index < arguments.length; index++) { context.setVariable(parameterNames[index], arguments[index]); } context.setVariable(Clause.THIS, instance); return new SpELContractContext(parser, context); } }
/* * Copyright © 2012 Sebastian Hoß <mail@shoss.de> * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. */ package com.github.sebhoss.contract.verifier; import com.github.sebhoss.contract.annotation.SpEL; import org.springframework.expression.EvaluationContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; /** * SpEL-based implementation of the {@link ContractContextFactory}. */ @SpEL public class SpELBasedContractContextFactory implements ContractContextFactory { @Override public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) { final ExpressionParser parser = new SpelExpressionParser(); final EvaluationContext context = new StandardEvaluationContext(instance); for (int index = 0; index < arguments.length; index++) { context.setVariable(parameterNames[index], arguments[index]); } return new SpELContractContext(parser, context); } }
Set current instance as root object
Set current instance as root object Signed-off-by: Sebastian Hoß <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@shoss.de>
Java
unlicense
sebhoss/annotated-contracts
java
## Code Before: /* * Copyright © 2012 Sebastian Hoß <mail@shoss.de> * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. */ package com.github.sebhoss.contract.verifier; import com.github.sebhoss.contract.annotation.Clause; import com.github.sebhoss.contract.annotation.SpEL; import org.springframework.expression.EvaluationContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; /** * SpEL-based implementation of the {@link ContractContextFactory}. */ @SpEL public class SpELBasedContractContextFactory implements ContractContextFactory { @Override public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) { final ExpressionParser parser = new SpelExpressionParser(); final EvaluationContext context = new StandardEvaluationContext(); for (int index = 0; index < arguments.length; index++) { context.setVariable(parameterNames[index], arguments[index]); } context.setVariable(Clause.THIS, instance); return new SpELContractContext(parser, context); } } ## Instruction: Set current instance as root object Signed-off-by: Sebastian Hoß <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@shoss.de> ## Code After: /* * Copyright © 2012 Sebastian Hoß <mail@shoss.de> * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. */ package com.github.sebhoss.contract.verifier; import com.github.sebhoss.contract.annotation.SpEL; import org.springframework.expression.EvaluationContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; /** * SpEL-based implementation of the {@link ContractContextFactory}. */ @SpEL public class SpELBasedContractContextFactory implements ContractContextFactory { @Override public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) { final ExpressionParser parser = new SpelExpressionParser(); final EvaluationContext context = new StandardEvaluationContext(instance); for (int index = 0; index < arguments.length; index++) { context.setVariable(parameterNames[index], arguments[index]); } return new SpELContractContext(parser, context); } }
/* * Copyright © 2012 Sebastian Hoß <mail@shoss.de> * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. */ package com.github.sebhoss.contract.verifier; - import com.github.sebhoss.contract.annotation.Clause; import com.github.sebhoss.contract.annotation.SpEL; import org.springframework.expression.EvaluationContext; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; /** * SpEL-based implementation of the {@link ContractContextFactory}. */ @SpEL public class SpELBasedContractContextFactory implements ContractContextFactory { @Override public ContractContext createContext(final Object instance, final Object[] arguments, final String[] parameterNames) { final ExpressionParser parser = new SpelExpressionParser(); - final EvaluationContext context = new StandardEvaluationContext(); + final EvaluationContext context = new StandardEvaluationContext(instance); ? ++++++++ for (int index = 0; index < arguments.length; index++) { context.setVariable(parameterNames[index], arguments[index]); } - context.setVariable(Clause.THIS, instance); return new SpELContractContext(parser, context); } }
4
0.111111
1
3
c0f6741f1de35d59d795e1445971ba8a50577344
README.md
README.md
WebViewMarker ============= Text selection support library for Android WebView. The core logic is the same as BTAndroidWebViewSelection. ## What's the difference - More modular (not inherit webview) - Not depend quick action lib (for actionbar support) - Mimic ICS native text selection handler - Smart tap selection for CJK characters
WebViewMarker ============= Text selection support library for Android WebView. The core logic is the same as BTAndroidWebViewSelection. ## What's the difference? - More modular (not inherit webview) - Not depend quick action lib (for actionbar support) - Mimic ICS native text selection handlers - Smart tap selection for CJK characters ## Requirement Tested on API 8-19 (Android 2.2-4.4.2). ## Hot to use See `samples/demos` directory.
Add requirements and how to use
Add requirements and how to use
Markdown
mit
naoak/WebViewMarker
markdown
## Code Before: WebViewMarker ============= Text selection support library for Android WebView. The core logic is the same as BTAndroidWebViewSelection. ## What's the difference - More modular (not inherit webview) - Not depend quick action lib (for actionbar support) - Mimic ICS native text selection handler - Smart tap selection for CJK characters ## Instruction: Add requirements and how to use ## Code After: WebViewMarker ============= Text selection support library for Android WebView. The core logic is the same as BTAndroidWebViewSelection. ## What's the difference? - More modular (not inherit webview) - Not depend quick action lib (for actionbar support) - Mimic ICS native text selection handlers - Smart tap selection for CJK characters ## Requirement Tested on API 8-19 (Android 2.2-4.4.2). ## Hot to use See `samples/demos` directory.
WebViewMarker ============= Text selection support library for Android WebView. The core logic is the same as BTAndroidWebViewSelection. - ## What's the difference + ## What's the difference? ? + - More modular (not inherit webview) - Not depend quick action lib (for actionbar support) - - Mimic ICS native text selection handler + - Mimic ICS native text selection handlers ? + - Smart tap selection for CJK characters + + ## Requirement + Tested on API 8-19 (Android 2.2-4.4.2). + + ## Hot to use + See `samples/demos` directory.
10
1
8
2
2b48e786c3e2439876ff41fc82bd814b42d40ca4
app.py
app.py
from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0')
from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
Revert "Added the output for hostname"
Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.
Python
bsd-2-clause
vioan/minflask
python
## Code Before: from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0') ## Instruction: Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318. ## Code After: from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
+ from flask import Flask - import socket - app = Flask(__name__) @app.route("/") def index(): - return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) + return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
5
0.384615
2
3
297543244f2e520f3ab8ca8097bc193594fb2bb4
web/expense-list.html
web/expense-list.html
<div class="row"> <div class="col-md-12"> <?php # put this in a table to align nicely with the list ?> <table class="table table-condensed"> <thead> <tr> <td> <?php # use td instead of th to avoid showing extra horizontal lines ?> <button type="button" class="btn btn-primary" ng-click="go('/edit/new')">Add New</button> </td> </tr> </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <table class="table table-condensed table-hover"> <thead> <tr> <th>Recipient Name</th> <th>Personal Note</th> <th class="text-right">Amount</th> <th class="text-center">Date of transaction</th> <th class="text-center">Receipt</th> </tr> </thead> <tbody> <tr ng-repeat="exp in expenseList" ng-click="go('/edit/'+exp.id)"> <td>{{exp.recipient}}</td> <td>{{exp.note}}</td> <td class="text-right">{{exp.amount}}</td> <td class="text-center">{{exp.tr_date}}</td> <td class="text-center"><span ng-show="exp.img_size > 0" class="glyphicon glyphicon-ok" title="Receipt picture"></span></td> </tr> </tbody> </table> </div> </div>
<div class="row"> <div class="col-md-12"> <!-- put this in a table to align nicely with the list --> <table class="table table-condensed"> <thead> <tr> <td> <!-- use td instead of th to avoid showing extra horizontal lines --> <button type="button" class="btn btn-primary" ng-click="go('/edit/new')">Add New</button> </td> </tr> </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <table class="table table-condensed table-hover"> <thead> <tr> <th>Recipient Name</th> <th>Personal Note</th> <th class="text-right">Amount</th> <th class="text-center">Date of transaction</th> <th class="text-center">Receipt</th> </tr> </thead> <tbody> <tr ng-repeat="exp in expenseList" ng-click="go('/edit/'+exp.id)"> <td>{{exp.recipient}}</td> <td>{{exp.note}}</td> <td class="text-right">{{exp.amount}}</td> <td class="text-center">{{exp.tr_date}}</td> <td class="text-center"><span ng-show="exp.img_size > 0" class="glyphicon glyphicon-ok" title="Receipt picture"></span></td> </tr> </tbody> </table> </div> </div>
Fix comment format in html
Fix comment format in html
HTML
unlicense
quietcat/expense-log,quietcat/expense-log,quietcat/expense-log,quietcat/expense-log
html
## Code Before: <div class="row"> <div class="col-md-12"> <?php # put this in a table to align nicely with the list ?> <table class="table table-condensed"> <thead> <tr> <td> <?php # use td instead of th to avoid showing extra horizontal lines ?> <button type="button" class="btn btn-primary" ng-click="go('/edit/new')">Add New</button> </td> </tr> </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <table class="table table-condensed table-hover"> <thead> <tr> <th>Recipient Name</th> <th>Personal Note</th> <th class="text-right">Amount</th> <th class="text-center">Date of transaction</th> <th class="text-center">Receipt</th> </tr> </thead> <tbody> <tr ng-repeat="exp in expenseList" ng-click="go('/edit/'+exp.id)"> <td>{{exp.recipient}}</td> <td>{{exp.note}}</td> <td class="text-right">{{exp.amount}}</td> <td class="text-center">{{exp.tr_date}}</td> <td class="text-center"><span ng-show="exp.img_size > 0" class="glyphicon glyphicon-ok" title="Receipt picture"></span></td> </tr> </tbody> </table> </div> </div> ## Instruction: Fix comment format in html ## Code After: <div class="row"> <div class="col-md-12"> <!-- put this in a table to align nicely with the list --> <table class="table table-condensed"> <thead> <tr> <td> <!-- use td instead of th to avoid showing extra horizontal lines --> <button type="button" class="btn btn-primary" ng-click="go('/edit/new')">Add New</button> </td> </tr> </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <table class="table table-condensed table-hover"> <thead> <tr> <th>Recipient Name</th> <th>Personal Note</th> <th class="text-right">Amount</th> <th class="text-center">Date of transaction</th> <th class="text-center">Receipt</th> </tr> </thead> <tbody> <tr ng-repeat="exp in expenseList" ng-click="go('/edit/'+exp.id)"> <td>{{exp.recipient}}</td> <td>{{exp.note}}</td> <td class="text-right">{{exp.amount}}</td> <td class="text-center">{{exp.tr_date}}</td> <td class="text-center"><span ng-show="exp.img_size > 0" class="glyphicon glyphicon-ok" title="Receipt picture"></span></td> </tr> </tbody> </table> </div> </div>
<div class="row"> <div class="col-md-12"> - <?php # put this in a table to align nicely with the list ?> ? ^^^^^^ ^ + <!-- put this in a table to align nicely with the list --> ? ^^^ ^^ <table class="table table-condensed"> <thead> <tr> <td> - <?php # use td instead of th to avoid showing extra horizontal lines ?> ? ^^^^^^ ^ + <!-- use td instead of th to avoid showing extra horizontal lines --> ? ^^^ ^^ <button type="button" class="btn btn-primary" ng-click="go('/edit/new')">Add New</button> </td> </tr> </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <table class="table table-condensed table-hover"> <thead> <tr> <th>Recipient Name</th> <th>Personal Note</th> <th class="text-right">Amount</th> <th class="text-center">Date of transaction</th> <th class="text-center">Receipt</th> </tr> </thead> <tbody> <tr ng-repeat="exp in expenseList" ng-click="go('/edit/'+exp.id)"> <td>{{exp.recipient}}</td> <td>{{exp.note}}</td> <td class="text-right">{{exp.amount}}</td> <td class="text-center">{{exp.tr_date}}</td> <td class="text-center"><span ng-show="exp.img_size > 0" class="glyphicon glyphicon-ok" title="Receipt picture"></span></td> </tr> </tbody> </table> </div> </div>
4
0.095238
2
2
8196a5c350127ab94b70ae783fdd1e2458d6598b
install_modules_unit.sh
install_modules_unit.sh
set -ex if [ -n "${GEM_HOME}" ]; then GEM_BIN_DIR=${GEM_HOME}/bin/ export PATH=${PATH}:${GEM_BIN_DIR} fi if [ "${PUPPET_MAJ_VERSION}" = 4 ]; then export PUPPET_BASE_PATH=/etc/puppetlabs/code else export PUPPET_BASE_PATH=/etc/puppet fi export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules} source $SCRIPT_DIR/functions print_header 'Start (install_modules_unit.sh)' print_header 'Install Modules' install_modules print_header 'Module List' puppet module list --modulepath ./spec/fixtures/modules print_header 'Done (install_modules_unit.sh)'
set -ex if [ -n "${GEM_HOME}" ]; then GEM_BIN_DIR=${GEM_HOME}/bin/ export PATH=${PATH}:${GEM_BIN_DIR} fi export PUPPET_BASE_PATH=/etc/puppetlabs/code export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules} source $SCRIPT_DIR/functions print_header 'Start (install_modules_unit.sh)' print_header 'Install Modules' install_modules print_header 'Module List' puppet module list --modulepath ./spec/fixtures/modules print_header 'Done (install_modules_unit.sh)'
Remove PUPPET_MAJ_VERSION check for unit modules
Remove PUPPET_MAJ_VERSION check for unit modules The install_modules_unit.sh which is called by the spec helper to install the modules for the unit tests checks the PUPPET_MAJ_VERSION variable when selecting the puppet base path. The zuul jobs is not configured to give this env variable so unit tests failed when using the puppet base path for v3 which was /etc/puppet instead of /etc/puppetlabs/code that is valid for v4 and v5. We don't test v3 specifically so the check should not be needed. Change-Id: I6a9c53d58f05dfbb8646ad36d3bf5f6bad5588e1
Shell
apache-2.0
openstack/puppet-openstack-integration,openstack/puppet-openstack-integration,openstack/puppet-openstack-integration
shell
## Code Before: set -ex if [ -n "${GEM_HOME}" ]; then GEM_BIN_DIR=${GEM_HOME}/bin/ export PATH=${PATH}:${GEM_BIN_DIR} fi if [ "${PUPPET_MAJ_VERSION}" = 4 ]; then export PUPPET_BASE_PATH=/etc/puppetlabs/code else export PUPPET_BASE_PATH=/etc/puppet fi export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules} source $SCRIPT_DIR/functions print_header 'Start (install_modules_unit.sh)' print_header 'Install Modules' install_modules print_header 'Module List' puppet module list --modulepath ./spec/fixtures/modules print_header 'Done (install_modules_unit.sh)' ## Instruction: Remove PUPPET_MAJ_VERSION check for unit modules The install_modules_unit.sh which is called by the spec helper to install the modules for the unit tests checks the PUPPET_MAJ_VERSION variable when selecting the puppet base path. The zuul jobs is not configured to give this env variable so unit tests failed when using the puppet base path for v3 which was /etc/puppet instead of /etc/puppetlabs/code that is valid for v4 and v5. We don't test v3 specifically so the check should not be needed. Change-Id: I6a9c53d58f05dfbb8646ad36d3bf5f6bad5588e1 ## Code After: set -ex if [ -n "${GEM_HOME}" ]; then GEM_BIN_DIR=${GEM_HOME}/bin/ export PATH=${PATH}:${GEM_BIN_DIR} fi export PUPPET_BASE_PATH=/etc/puppetlabs/code export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules} source $SCRIPT_DIR/functions print_header 'Start (install_modules_unit.sh)' print_header 'Install Modules' install_modules print_header 'Module List' puppet module list --modulepath ./spec/fixtures/modules print_header 'Done (install_modules_unit.sh)'
set -ex if [ -n "${GEM_HOME}" ]; then GEM_BIN_DIR=${GEM_HOME}/bin/ export PATH=${PATH}:${GEM_BIN_DIR} fi - if [ "${PUPPET_MAJ_VERSION}" = 4 ]; then - export PUPPET_BASE_PATH=/etc/puppetlabs/code ? -- + export PUPPET_BASE_PATH=/etc/puppetlabs/code - else - export PUPPET_BASE_PATH=/etc/puppet - fi - export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules} source $SCRIPT_DIR/functions print_header 'Start (install_modules_unit.sh)' print_header 'Install Modules' install_modules print_header 'Module List' puppet module list --modulepath ./spec/fixtures/modules print_header 'Done (install_modules_unit.sh)'
7
0.259259
1
6
c794982eb830c0175ec73f4df1a47aa63a5cb982
sli/admin-tools/admin-rails/test/fixtures/education_organization.yml
sli/admin-tools/admin-rails/test/fixtures/education_organization.yml
state: id: 1 organizationCategories: ["State Education Agency"] nameOfInstitution: "Some Fake District" metaData: updated: 10000000 created: 10000000 local: id: 2 organizationCategories: ["Local Education Agency"] nameOfInstitution: "A Fake Local District" assoc_one: educationOrganizationParentId: 1 educationOrganizationChildId: 2
state: id: 1 organizationCategories: ["State Education Agency"] nameOfInstitution: "Some Fake District" stateOrganizationId: "STATE" metaData: updated: 10000000 created: 10000000 local: id: 2 organizationCategories: ["Local Education Agency"] nameOfInstitution: "A Fake Local District" stateOrganizationId: "LOCAL" assoc_one: educationOrganizationParentId: 1 educationOrganizationChildId: 2
Fix admin tools rake tests
Fix admin tools rake tests
YAML
apache-2.0
inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service,inbloom/secure-data-service
yaml
## Code Before: state: id: 1 organizationCategories: ["State Education Agency"] nameOfInstitution: "Some Fake District" metaData: updated: 10000000 created: 10000000 local: id: 2 organizationCategories: ["Local Education Agency"] nameOfInstitution: "A Fake Local District" assoc_one: educationOrganizationParentId: 1 educationOrganizationChildId: 2 ## Instruction: Fix admin tools rake tests ## Code After: state: id: 1 organizationCategories: ["State Education Agency"] nameOfInstitution: "Some Fake District" stateOrganizationId: "STATE" metaData: updated: 10000000 created: 10000000 local: id: 2 organizationCategories: ["Local Education Agency"] nameOfInstitution: "A Fake Local District" stateOrganizationId: "LOCAL" assoc_one: educationOrganizationParentId: 1 educationOrganizationChildId: 2
state: id: 1 organizationCategories: ["State Education Agency"] nameOfInstitution: "Some Fake District" + stateOrganizationId: "STATE" metaData: updated: 10000000 created: 10000000 local: id: 2 organizationCategories: ["Local Education Agency"] nameOfInstitution: "A Fake Local District" + stateOrganizationId: "LOCAL" assoc_one: educationOrganizationParentId: 1 educationOrganizationChildId: 2
2
0.117647
2
0
e9a445a4c12986680654e1ccb2feb3917ccbd263
setup.py
setup.py
from setuptools import setup, find_packages setup(name='addressable', description='Use lists like you would dictionaries.', long_description=open('README.rst').read(), author='Stijn Debrouwere', author_email='stijn@stdout.be', url='http://stdbrouw.github.com/python-addressable/', download_url='http://www.github.com/stdbrouw/python-addressable/tarball/master', version='1.1.0', license='ISC', packages=find_packages(), keywords='utility', classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities', ], )
from setuptools import setup, find_packages setup(name='addressable', description='Use lists like you would dictionaries.', long_description=open('README.rst').read(), author='Stijn Debrouwere', author_email='stijn@debrouwere.org', url='https://github.com/debrouwere/python-addressable/', download_url='http://www.github.com/debrouwere/python-addressable/tarball/master', version='1.1.1', license='ISC', packages=find_packages(), keywords='utility', classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities', ], )
Fix faulty URL reference in the package metadata.
Fix faulty URL reference in the package metadata.
Python
isc
debrouwere/python-addressable
python
## Code Before: from setuptools import setup, find_packages setup(name='addressable', description='Use lists like you would dictionaries.', long_description=open('README.rst').read(), author='Stijn Debrouwere', author_email='stijn@stdout.be', url='http://stdbrouw.github.com/python-addressable/', download_url='http://www.github.com/stdbrouw/python-addressable/tarball/master', version='1.1.0', license='ISC', packages=find_packages(), keywords='utility', classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities', ], ) ## Instruction: Fix faulty URL reference in the package metadata. ## Code After: from setuptools import setup, find_packages setup(name='addressable', description='Use lists like you would dictionaries.', long_description=open('README.rst').read(), author='Stijn Debrouwere', author_email='stijn@debrouwere.org', url='https://github.com/debrouwere/python-addressable/', download_url='http://www.github.com/debrouwere/python-addressable/tarball/master', version='1.1.1', license='ISC', packages=find_packages(), keywords='utility', classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities', ], )
from setuptools import setup, find_packages setup(name='addressable', description='Use lists like you would dictionaries.', long_description=open('README.rst').read(), author='Stijn Debrouwere', - author_email='stijn@stdout.be', ? -- ^ ^^ + author_email='stijn@debrouwere.org', ? +++ ^^^^ ^^^ - url='http://stdbrouw.github.com/python-addressable/', ? --------- + url='https://github.com/debrouwere/python-addressable/', ? + +++++++++++ - download_url='http://www.github.com/stdbrouw/python-addressable/tarball/master', ? -- + download_url='http://www.github.com/debrouwere/python-addressable/tarball/master', ? + +++ - version='1.1.0', ? ^ + version='1.1.1', ? ^ license='ISC', packages=find_packages(), keywords='utility', classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities', ], )
8
0.380952
4
4
02e6e2c80e87d0922d901025397f805e2f96a151
english-learning/09-34.md
english-learning/09-34.md
- I need to **straighten up** before I can have anyone over. - the future - I can be there by nine PM. - That's in two hours. #### Sentences & phrase - I have to **do the dishes**, clean the floors, **do the laundry**, and I have **a stack of** paperwork to **go through** before work tomorrow. - My place is a mess. - I can help you **tidy up** your apartment. - do house work - Are you going to stay in and relax? - Are you getting ready for the party tomorrow? #### Idiom ## Lesson2 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Lesson3 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Summary
- the future - I can be there by nine PM. - That's in two hours. - subordinate clause - Is there a place **where** I can put this down? - Yes, it was the day **when** you had my new design. - We can go for a walk when we get to the forest. #### New Words - I need to **straighten up** before I can have anyone over. - Do you remember when I was in your **cubicle** the other day? - It was a **hill**, not a mountain. - We stopped here and watched the **sun set**. - We camped next to a river last weekend. #### Sentences & phrase - I have to **do the dishes**, clean the floors, **do the laundry**, and I have **a stack of** paperwork to **go through** before work tomorrow. - My place is a mess. - I can help you **tidy up** your apartment. - do house work - Are you going to stay in and relax? - Are you getting ready for the party tomorrow? - Your briefcase wasn't in the place where you left it. - We wanted to add something to it that reminds people of nature. - So we `went on a trip` to find materials for it. - But we did get `a lot of sand in our` shoes. - Then we drove for two hours **out of** the city to the forest to go for a walk. - We walked past a frozen river, then we climbed a mountain. - We climbed a hill and there was a giant stone `at the top`. #### Idiom ## Lesson2 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Lesson3 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Summary
Complete L9 U34 Lesson 1-2.
[englist] Complete L9 U34 Lesson 1-2.
Markdown
apache-2.0
sleticalboy/sleticalboy.github.io,sleticalboy/sleticalboy.github.io,sleticalboy/sleticalboy.github.io,sleticalboy/sleticalboy.github.io
markdown
## Code Before: - I need to **straighten up** before I can have anyone over. - the future - I can be there by nine PM. - That's in two hours. #### Sentences & phrase - I have to **do the dishes**, clean the floors, **do the laundry**, and I have **a stack of** paperwork to **go through** before work tomorrow. - My place is a mess. - I can help you **tidy up** your apartment. - do house work - Are you going to stay in and relax? - Are you getting ready for the party tomorrow? #### Idiom ## Lesson2 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Lesson3 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Summary ## Instruction: [englist] Complete L9 U34 Lesson 1-2. ## Code After: - the future - I can be there by nine PM. - That's in two hours. - subordinate clause - Is there a place **where** I can put this down? - Yes, it was the day **when** you had my new design. - We can go for a walk when we get to the forest. #### New Words - I need to **straighten up** before I can have anyone over. - Do you remember when I was in your **cubicle** the other day? - It was a **hill**, not a mountain. - We stopped here and watched the **sun set**. - We camped next to a river last weekend. #### Sentences & phrase - I have to **do the dishes**, clean the floors, **do the laundry**, and I have **a stack of** paperwork to **go through** before work tomorrow. - My place is a mess. - I can help you **tidy up** your apartment. - do house work - Are you going to stay in and relax? - Are you getting ready for the party tomorrow? - Your briefcase wasn't in the place where you left it. - We wanted to add something to it that reminds people of nature. - So we `went on a trip` to find materials for it. - But we did get `a lot of sand in our` shoes. - Then we drove for two hours **out of** the city to the forest to go for a walk. - We walked past a frozen river, then we climbed a mountain. - We climbed a hill and there was a giant stone `at the top`. #### Idiom ## Lesson2 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Lesson3 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Summary
- - I need to **straighten up** before I can have anyone over. - the future - I can be there by nine PM. - That's in two hours. + - subordinate clause + - Is there a place **where** I can put this down? + - Yes, it was the day **when** you had my new design. + - We can go for a walk when we get to the forest. + + #### New Words + - I need to **straighten up** before I can have anyone over. + - Do you remember when I was in your **cubicle** the other day? + - It was a **hill**, not a mountain. + - We stopped here and watched the **sun set**. + - We camped next to a river last weekend. #### Sentences & phrase - I have to **do the dishes**, clean the floors, **do the laundry**, and I have **a stack of** paperwork to **go through** before work tomorrow. - My place is a mess. - I can help you **tidy up** your apartment. - do house work - Are you going to stay in and relax? - Are you getting ready for the party tomorrow? + - Your briefcase wasn't in the place where you left it. + - We wanted to add something to it that reminds people of nature. + - So we `went on a trip` to find materials for it. + - But we did get `a lot of sand in our` shoes. + - Then we drove for two hours **out of** the city to the forest to go for a walk. + - We walked past a frozen river, then we climbed a mountain. + - We climbed a hill and there was a giant stone `at the top`. #### Idiom ## Lesson2 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Lesson3 #### Grammer #### New Words #### Sentences & phrase #### Idiom ## Summary
19
0.678571
18
1
1fc47a1f083f3ac37cde22cd09ba38c1ccfbc1f2
_projects/rich-cat-poor-cat.md
_projects/rich-cat-poor-cat.md
--- title: Rich Cat/Poor Cat order: -5 --- [![Rich Cat/Poor Cat](/assets/rich_cat_poor_cat.gif)](http://richpoorcat.com/) [Demo](http://richpoorcat.com/) / [GitHub](https://github.com/ash106/rich_cat_poor_cat) Built with Rails, Bootstrap and [Pixi.js](http://www.pixijs.com/) A game about the rising income inequality between cats. Just kidding, it's a way to look at cat pictures disguised as a game!
--- title: Rich Cat/Poor Cat order: -5 --- [![Rich Cat/Poor Cat](/assets/rich_cat_poor_cat.gif)](http://richpoorcat.com/) [Demo](http://richpoorcat.com/) / [GitHub](https://github.com/ash106/rich_cat_poor_cat) Built with Rails, Materialize and `<canvas>` A game about the rising income inequality between cats. Just kidding, it's a way to look at cat pictures disguised as a game!
Update rich cat poor cat frameworks
Update rich cat poor cat frameworks
Markdown
mit
ash106/ash106.github.io,ash106/ash106.github.io
markdown
## Code Before: --- title: Rich Cat/Poor Cat order: -5 --- [![Rich Cat/Poor Cat](/assets/rich_cat_poor_cat.gif)](http://richpoorcat.com/) [Demo](http://richpoorcat.com/) / [GitHub](https://github.com/ash106/rich_cat_poor_cat) Built with Rails, Bootstrap and [Pixi.js](http://www.pixijs.com/) A game about the rising income inequality between cats. Just kidding, it's a way to look at cat pictures disguised as a game! ## Instruction: Update rich cat poor cat frameworks ## Code After: --- title: Rich Cat/Poor Cat order: -5 --- [![Rich Cat/Poor Cat](/assets/rich_cat_poor_cat.gif)](http://richpoorcat.com/) [Demo](http://richpoorcat.com/) / [GitHub](https://github.com/ash106/rich_cat_poor_cat) Built with Rails, Materialize and `<canvas>` A game about the rising income inequality between cats. Just kidding, it's a way to look at cat pictures disguised as a game!
--- title: Rich Cat/Poor Cat order: -5 --- [![Rich Cat/Poor Cat](/assets/rich_cat_poor_cat.gif)](http://richpoorcat.com/) [Demo](http://richpoorcat.com/) / [GitHub](https://github.com/ash106/rich_cat_poor_cat) - Built with Rails, Bootstrap and [Pixi.js](http://www.pixijs.com/) + Built with Rails, Materialize and `<canvas>` A game about the rising income inequality between cats. Just kidding, it's a way to look at cat pictures disguised as a game!
2
0.166667
1
1
404231a6b17227bdce7babccf523b8eed379c828
src/components/common/reaction/Base.js
src/components/common/reaction/Base.js
import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './Base.module.css'; const renderLabel = label => { if (typeof label === 'undefined') { return null; } return <div className={styles.label}>{label}</div>; }; const renderCount = count => { if (typeof count === 'undefined') { return null; } return <div className={styles.count}>{count}</div>; }; const Base = ({ className, style, children, label, count, onClick }) => ( <div className={cn(className, styles.container)} style={style} onClick={onClick} > <div>{children}</div> {renderLabel(label)} {renderCount(count)} </div> ); Base.propTypes = { className: PropTypes.string, children: PropTypes.node.isRequired, label: PropTypes.string, count: PropTypes.number, style: PropTypes.object, onClick: PropTypes.func, }; export default Base;
import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './Base.module.css'; const renderLabel = label => { if (typeof label === 'undefined') { return null; } return <div className={styles.label}>{label}</div>; }; const renderCount = count => { if (typeof count === 'undefined') { return null; } return <div className={styles.count}>{count}</div>; }; const Base = ({ className, style, children, label, count, onClick }) => ( <div className={cn(className, styles.container)} style={style} onClick={onClick} > <div>{children}</div> {renderLabel(label)} {renderCount(count)} </div> ); Base.propTypes = { className: PropTypes.string, children: PropTypes.node, label: PropTypes.string, count: PropTypes.number, style: PropTypes.object, onClick: PropTypes.func, }; export default Base;
Fix warning if children is null
Fix warning if children is null
JavaScript
mit
goodjoblife/GoodJobShare
javascript
## Code Before: import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './Base.module.css'; const renderLabel = label => { if (typeof label === 'undefined') { return null; } return <div className={styles.label}>{label}</div>; }; const renderCount = count => { if (typeof count === 'undefined') { return null; } return <div className={styles.count}>{count}</div>; }; const Base = ({ className, style, children, label, count, onClick }) => ( <div className={cn(className, styles.container)} style={style} onClick={onClick} > <div>{children}</div> {renderLabel(label)} {renderCount(count)} </div> ); Base.propTypes = { className: PropTypes.string, children: PropTypes.node.isRequired, label: PropTypes.string, count: PropTypes.number, style: PropTypes.object, onClick: PropTypes.func, }; export default Base; ## Instruction: Fix warning if children is null ## Code After: import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './Base.module.css'; const renderLabel = label => { if (typeof label === 'undefined') { return null; } return <div className={styles.label}>{label}</div>; }; const renderCount = count => { if (typeof count === 'undefined') { return null; } return <div className={styles.count}>{count}</div>; }; const Base = ({ className, style, children, label, count, onClick }) => ( <div className={cn(className, styles.container)} style={style} onClick={onClick} > <div>{children}</div> {renderLabel(label)} {renderCount(count)} </div> ); Base.propTypes = { className: PropTypes.string, children: PropTypes.node, label: PropTypes.string, count: PropTypes.number, style: PropTypes.object, onClick: PropTypes.func, }; export default Base;
import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import styles from './Base.module.css'; const renderLabel = label => { if (typeof label === 'undefined') { return null; } return <div className={styles.label}>{label}</div>; }; const renderCount = count => { if (typeof count === 'undefined') { return null; } return <div className={styles.count}>{count}</div>; }; const Base = ({ className, style, children, label, count, onClick }) => ( <div className={cn(className, styles.container)} style={style} onClick={onClick} > <div>{children}</div> {renderLabel(label)} {renderCount(count)} </div> ); Base.propTypes = { className: PropTypes.string, - children: PropTypes.node.isRequired, ? ----------- + children: PropTypes.node, label: PropTypes.string, count: PropTypes.number, style: PropTypes.object, onClick: PropTypes.func, }; export default Base;
2
0.047619
1
1
059d3f324f6fc2f7a9e4818016d81d18b3c5c554
python-requirements.txt
python-requirements.txt
git+https://github.com/lowRISC/edalize.git@ot # Development version with OT-specific changes git+https://github.com/lowRISC/fusesoc.git@ot pyyaml mako
git+https://github.com/lowRISC/edalize.git@ot # Development version with OT-specific changes git+https://github.com/lowRISC/fusesoc.git@ot pyyaml mako # Needed by dvsim.py (not actually used in Ibex) premailer
Add missing Python dependency on premailer library
Add missing Python dependency on premailer library This dependency gets pulled in with dvsim.py since OpenTitan commit 1aff665d2, vendored in with Ibex commit 1bbcce0.
Text
apache-2.0
lowRISC/ibex,lowRISC/ibex,AmbiML/ibex,lowRISC/ibex,lowRISC/ibex,AmbiML/ibex,AmbiML/ibex,AmbiML/ibex
text
## Code Before: git+https://github.com/lowRISC/edalize.git@ot # Development version with OT-specific changes git+https://github.com/lowRISC/fusesoc.git@ot pyyaml mako ## Instruction: Add missing Python dependency on premailer library This dependency gets pulled in with dvsim.py since OpenTitan commit 1aff665d2, vendored in with Ibex commit 1bbcce0. ## Code After: git+https://github.com/lowRISC/edalize.git@ot # Development version with OT-specific changes git+https://github.com/lowRISC/fusesoc.git@ot pyyaml mako # Needed by dvsim.py (not actually used in Ibex) premailer
git+https://github.com/lowRISC/edalize.git@ot # Development version with OT-specific changes git+https://github.com/lowRISC/fusesoc.git@ot pyyaml mako + + # Needed by dvsim.py (not actually used in Ibex) + premailer
3
0.428571
3
0
c624da102a4aa1cb42e7d1ac02c7cb94fe85928e
index.html
index.html
<!DOCTYPE html> <html> <head> <title>David Fox</title> <link rel="stylesheet" href="css/styles.css"/> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet"> <script src="https://platform.linkedin.com/badges/js/profile.js" async defer type="text/javascript"></script> </head> <body> <section id="content"> <h1>David Fox</h1> <p>Software Developer, Musician, Artist</p> <p>Email me at dfox.io</p> </section> <section id="linkedin"> <div class="badge-base LI-profile-badge" data-locale="en_US" data-size="medium" data-theme="dark" data-type="VERTICAL" data-vanity="dmfox" data-version="v1"> <a class="badge-base__link LI-simple-link" href="https://www.linkedin.com/in/dmfox?trk=profile-badge">LinkedIn Profile</a> </div> </section> </body> </html>
<!DOCTYPE html> <html> <head> <title>David Fox</title> <link rel="stylesheet" href="css/styles.css"/> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet"> </head> <body> <section id="content"> <h1>David Fox</h1> <p>Software Developer, Musician, Artist</p> <p>Email me at dfox.io</p> </section> </body> </html>
Remove LinkedIn because it messes up the styles
Remove LinkedIn because it messes up the styles
HTML
mit
dfox/dfox.github.io,dfox/dfox.github.io,dfox/dfox.github.io
html
## Code Before: <!DOCTYPE html> <html> <head> <title>David Fox</title> <link rel="stylesheet" href="css/styles.css"/> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet"> <script src="https://platform.linkedin.com/badges/js/profile.js" async defer type="text/javascript"></script> </head> <body> <section id="content"> <h1>David Fox</h1> <p>Software Developer, Musician, Artist</p> <p>Email me at dfox.io</p> </section> <section id="linkedin"> <div class="badge-base LI-profile-badge" data-locale="en_US" data-size="medium" data-theme="dark" data-type="VERTICAL" data-vanity="dmfox" data-version="v1"> <a class="badge-base__link LI-simple-link" href="https://www.linkedin.com/in/dmfox?trk=profile-badge">LinkedIn Profile</a> </div> </section> </body> </html> ## Instruction: Remove LinkedIn because it messes up the styles ## Code After: <!DOCTYPE html> <html> <head> <title>David Fox</title> <link rel="stylesheet" href="css/styles.css"/> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet"> </head> <body> <section id="content"> <h1>David Fox</h1> <p>Software Developer, Musician, Artist</p> <p>Email me at dfox.io</p> </section> </body> </html>
<!DOCTYPE html> <html> <head> <title>David Fox</title> <link rel="stylesheet" href="css/styles.css"/> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet"> - <script src="https://platform.linkedin.com/badges/js/profile.js" async defer type="text/javascript"></script> + </head> <body> <section id="content"> <h1>David Fox</h1> <p>Software Developer, Musician, Artist</p> <p>Email me at dfox.io</p> </section> - <section id="linkedin"> - <div - class="badge-base LI-profile-badge" - data-locale="en_US" - data-size="medium" - data-theme="dark" - data-type="VERTICAL" - data-vanity="dmfox" - data-version="v1"> - <a class="badge-base__link LI-simple-link" - href="https://www.linkedin.com/in/dmfox?trk=profile-badge">LinkedIn Profile</a> - </div> - </section> </body> </html>
15
0.483871
1
14
cbe91ba87818ec17c2a161953d0fca1121598289
ui/client/components/modals/ValidationLabels.js
ui/client/components/modals/ValidationLabels.js
import React from "react"; import {v4 as uuid4} from "uuid"; export default class ValidationLabels extends React.Component { render() { const {validators, value} = this.props return validators.map(validator => validator.isValid(value) ? null : <label key={uuid4()} className='validation-label'>{validator.message}</label>) } }
import React from "react"; import {v4 as uuid4} from "uuid"; export default class ValidationLabels extends React.Component { render() { const {validators, value} = this.props return validators.map(validator => validator.isValid(value) ? null : <span className='validation-label'>{validator.message}</span>) } }
Change validation label to span
Change validation label to span
JavaScript
apache-2.0
TouK/nussknacker,TouK/nussknacker,TouK/nussknacker,TouK/nussknacker,TouK/nussknacker
javascript
## Code Before: import React from "react"; import {v4 as uuid4} from "uuid"; export default class ValidationLabels extends React.Component { render() { const {validators, value} = this.props return validators.map(validator => validator.isValid(value) ? null : <label key={uuid4()} className='validation-label'>{validator.message}</label>) } } ## Instruction: Change validation label to span ## Code After: import React from "react"; import {v4 as uuid4} from "uuid"; export default class ValidationLabels extends React.Component { render() { const {validators, value} = this.props return validators.map(validator => validator.isValid(value) ? null : <span className='validation-label'>{validator.message}</span>) } }
import React from "react"; import {v4 as uuid4} from "uuid"; export default class ValidationLabels extends React.Component { render() { const {validators, value} = this.props return validators.map(validator => validator.isValid(value) ? null : - <label key={uuid4()} className='validation-label'>{validator.message}</label>) ? ^ ^^^^^^^^^^^^^^^^^ ^ ^^^ + <span className='validation-label'>{validator.message}</span>) ? ^^ ^ ^^ ^ } }
2
0.181818
1
1
6b73b5948288ea595180a6e6140ebbb39326385c
README.md
README.md
Markcop is our friendly Markdown enforcer. ## License See [LICENSE](LICENSE).
Markcop is our friendly Markdown enforcer. ## Running It Copy and paste the following into your terminal: curl -sL https://git.io/vswrY | bash If you're worried about piping from the internet to bash (which you should be), you can run Markcop manually by downloading `bin/markcop` and running it manually. ## License See [LICENSE](LICENSE).
Create one-liner to run Markcop
Create one-liner to run Markcop
Markdown
mit
hackedu/markcop,zachlatta/markcop,hackedu/markval,hackclub/markcop
markdown
## Code Before: Markcop is our friendly Markdown enforcer. ## License See [LICENSE](LICENSE). ## Instruction: Create one-liner to run Markcop ## Code After: Markcop is our friendly Markdown enforcer. ## Running It Copy and paste the following into your terminal: curl -sL https://git.io/vswrY | bash If you're worried about piping from the internet to bash (which you should be), you can run Markcop manually by downloading `bin/markcop` and running it manually. ## License See [LICENSE](LICENSE).
Markcop is our friendly Markdown enforcer. + + ## Running It + + Copy and paste the following into your terminal: + + curl -sL https://git.io/vswrY | bash + + If you're worried about piping from the internet to bash (which you should be), + you can run Markcop manually by downloading `bin/markcop` and running it + manually. ## License See [LICENSE](LICENSE).
10
1.666667
10
0
0923b039c49ab4f3ae4b5cb20cc1afb5ab71116e
deployments/schema/postgres/1000_schema.sql
deployments/schema/postgres/1000_schema.sql
-- -- PostgreSQL database dump -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; CREATE FUNCTION update_updated_at_column() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$; CREATE TABLE deployment_tracker ( id integer NOT NULL, dbname text, deployment_type text NOT NULL, deployment_name text, deployment_outcome text, created_at timestamp without time zone DEFAULT now(), updated_at timestamp without time zone DEFAULT now(), is_active boolean DEFAULT true, deployed_by character varying(32), deployed_as character varying(32), reference_url text ); CREATE SEQUENCE deployment_tracker_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE deployment_tracker_id_seq OWNED BY deployment_tracker.id; CREATE INDEX index_deployment_on_deployment_name ON deployment_tracker USING btree (deployment_name); CREATE TRIGGER update_updated_at_modtime BEFORE UPDATE ON deployment_tracker FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column(); ALTER TABLE ONLY deployment_tracker ALTER COLUMN id SET DEFAULT nextval('deployment_tracker_id_seq'::regclass); -- -- PostgreSQL database dump complete --
-- -- PostgreSQL database dump -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; CREATE FUNCTION update_updated_at_column() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$; CREATE TABLE deployment_tracker ( id integer NOT NULL, dbname text, deployment_type text NOT NULL, deployment_name text, deployment_outcome text, created_at timestamp without time zone DEFAULT now(), updated_at timestamp without time zone DEFAULT now(), is_active boolean DEFAULT true, deployed_by character varying(32), deployed_as character varying(32), reference_url text ); CREATE SEQUENCE deployment_tracker_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE deployment_tracker_id_seq OWNED BY deployment_tracker.id; CREATE INDEX index_deployment_on_deployment_name ON deployment_tracker USING btree (deployment_name); CREATE TRIGGER update_updated_at_modtime BEFORE UPDATE ON deployment_tracker FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column(); ALTER TABLE ONLY deployment_tracker ALTER COLUMN id SET DEFAULT nextval('deployment_tracker_id_seq'::regclass); -- -- PostgreSQL database dump complete --
Adjust a comment line that prevents cloud from deploying
Adjust a comment line that prevents cloud from deploying
SQL
mit
covermymeds/dbdeployer
sql
## Code Before: -- -- PostgreSQL database dump -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; CREATE FUNCTION update_updated_at_column() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$; CREATE TABLE deployment_tracker ( id integer NOT NULL, dbname text, deployment_type text NOT NULL, deployment_name text, deployment_outcome text, created_at timestamp without time zone DEFAULT now(), updated_at timestamp without time zone DEFAULT now(), is_active boolean DEFAULT true, deployed_by character varying(32), deployed_as character varying(32), reference_url text ); CREATE SEQUENCE deployment_tracker_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE deployment_tracker_id_seq OWNED BY deployment_tracker.id; CREATE INDEX index_deployment_on_deployment_name ON deployment_tracker USING btree (deployment_name); CREATE TRIGGER update_updated_at_modtime BEFORE UPDATE ON deployment_tracker FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column(); ALTER TABLE ONLY deployment_tracker ALTER COLUMN id SET DEFAULT nextval('deployment_tracker_id_seq'::regclass); -- -- PostgreSQL database dump complete -- ## Instruction: Adjust a comment line that prevents cloud from deploying ## Code After: -- -- PostgreSQL database dump -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; CREATE FUNCTION update_updated_at_column() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$; CREATE TABLE deployment_tracker ( id integer NOT NULL, dbname text, deployment_type text NOT NULL, deployment_name text, deployment_outcome text, created_at timestamp without time zone DEFAULT now(), updated_at timestamp without time zone DEFAULT now(), is_active boolean DEFAULT true, deployed_by character varying(32), deployed_as character varying(32), reference_url text ); CREATE SEQUENCE deployment_tracker_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE deployment_tracker_id_seq OWNED BY deployment_tracker.id; CREATE INDEX index_deployment_on_deployment_name ON deployment_tracker USING btree (deployment_name); CREATE TRIGGER update_updated_at_modtime BEFORE UPDATE ON deployment_tracker FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column(); ALTER TABLE ONLY deployment_tracker ALTER COLUMN id SET DEFAULT nextval('deployment_tracker_id_seq'::regclass); -- -- PostgreSQL database dump complete --
-- -- PostgreSQL database dump -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - - - COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - CREATE FUNCTION update_updated_at_column() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$; CREATE TABLE deployment_tracker ( id integer NOT NULL, dbname text, deployment_type text NOT NULL, deployment_name text, deployment_outcome text, created_at timestamp without time zone DEFAULT now(), updated_at timestamp without time zone DEFAULT now(), is_active boolean DEFAULT true, deployed_by character varying(32), deployed_as character varying(32), reference_url text ); CREATE SEQUENCE deployment_tracker_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE deployment_tracker_id_seq OWNED BY deployment_tracker.id; CREATE INDEX index_deployment_on_deployment_name ON deployment_tracker USING btree (deployment_name); CREATE TRIGGER update_updated_at_modtime BEFORE UPDATE ON deployment_tracker FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column(); ALTER TABLE ONLY deployment_tracker ALTER COLUMN id SET DEFAULT nextval('deployment_tracker_id_seq'::regclass); -- -- PostgreSQL database dump complete --
5
0.078125
0
5
4febb4663bf9b944b2701a00a66ba095ea886745
README.md
README.md
Generic website generator This repo doesn't do anything just yet, but it should: given a `JSON` object like the one below...: ```json { "title": "Franzjipan", "domain": "franzjipan.be", "subtitle": "top notch bakery", "theme": "this could be anything", "references": { "jeroen": "url or logo", "kymer": "url or logo", "damiaan": "url or logo" } ... } ``` > __Please note that:__ this `JSON` object is a mere example and could be something completely different once finished. ... should create a generic, static, portfolio type website. Why? because I need one and I much rather fiddle around in javascript than any other website generator or god forbid, HTML + CSS... > __Please note that:__ while this package doesn't have a `1.0.0` version, the default branch will remain `develop`. After an initial release we will switch to `1.0.0`
Generic website generator This repo doesn't do anything just yet, but it should: given a `JSON` file named `.gwrc` (short for `generic-website-rc` ([read this to know what rc actually means](http://stackoverflow.com/questions/11030552/what-does-rc-mean-in-dot-files)) like the one below...: ```json { "title": "Franzjipan", "domain": "franzjipan.be", "subtitle": "top notch bakery", "theme": "this could be anything", "references": { "jeroen": "url or logo", "kymer": "url or logo", "damiaan": "url or logo" } ... } ``` > __Please note that:__ this `JSON` object is a mere example and could be something completely different once finished. ... should create a generic, static, portfolio type website. Why? because I need one and I much rather fiddle around in javascript than any other website generator or god forbid, HTML + CSS... > __Please note that:__ while this package doesn't have a `1.0.0` version, the default branch will remain `develop`. After an initial release we will switch to `1.0.0`
Update readme with rc namedrop
Update readme with rc namedrop
Markdown
mpl-2.0
Quite-nice/generic-website
markdown
## Code Before: Generic website generator This repo doesn't do anything just yet, but it should: given a `JSON` object like the one below...: ```json { "title": "Franzjipan", "domain": "franzjipan.be", "subtitle": "top notch bakery", "theme": "this could be anything", "references": { "jeroen": "url or logo", "kymer": "url or logo", "damiaan": "url or logo" } ... } ``` > __Please note that:__ this `JSON` object is a mere example and could be something completely different once finished. ... should create a generic, static, portfolio type website. Why? because I need one and I much rather fiddle around in javascript than any other website generator or god forbid, HTML + CSS... > __Please note that:__ while this package doesn't have a `1.0.0` version, the default branch will remain `develop`. After an initial release we will switch to `1.0.0` ## Instruction: Update readme with rc namedrop ## Code After: Generic website generator This repo doesn't do anything just yet, but it should: given a `JSON` file named `.gwrc` (short for `generic-website-rc` ([read this to know what rc actually means](http://stackoverflow.com/questions/11030552/what-does-rc-mean-in-dot-files)) like the one below...: ```json { "title": "Franzjipan", "domain": "franzjipan.be", "subtitle": "top notch bakery", "theme": "this could be anything", "references": { "jeroen": "url or logo", "kymer": "url or logo", "damiaan": "url or logo" } ... } ``` > __Please note that:__ this `JSON` object is a mere example and could be something completely different once finished. ... should create a generic, static, portfolio type website. Why? because I need one and I much rather fiddle around in javascript than any other website generator or god forbid, HTML + CSS... > __Please note that:__ while this package doesn't have a `1.0.0` version, the default branch will remain `develop`. After an initial release we will switch to `1.0.0`
Generic website generator This repo doesn't do anything just yet, but it should: - given a `JSON` object like the one below...: + given a `JSON` file named `.gwrc` (short for `generic-website-rc` ([read this to know what rc actually means](http://stackoverflow.com/questions/11030552/what-does-rc-mean-in-dot-files)) like the one below...: ```json { "title": "Franzjipan", "domain": "franzjipan.be", "subtitle": "top notch bakery", "theme": "this could be anything", "references": { "jeroen": "url or logo", "kymer": "url or logo", "damiaan": "url or logo" } ... } ``` > __Please note that:__ this `JSON` object is a mere example and could be something completely different once finished. ... should create a generic, static, portfolio type website. Why? because I need one and I much rather fiddle around in javascript than any other website generator or god forbid, HTML + CSS... > __Please note that:__ while this package doesn't have a `1.0.0` version, the default branch will remain `develop`. After an initial release we will switch to `1.0.0`
2
0.076923
1
1
75d5479773347da2379ddfafd148a315d21a5d5e
Cargo.toml
Cargo.toml
[project] name = "rustbox" version = "0.1.0" authors = ["gregchapple1@gmail.com"] [[lib]] name = "rustbox"
[project] name = "rustbox" version = "0.1.0" authors = ["Greg Chapple <gregchapple1@gmail.com>"] [[lib]] name = "rustbox"
Fix formatting for author field
Fix formatting for author field
TOML
mit
benaryorg/rustbox,tempbottle/rustbox,christopherdumas/rustbox,Zypeh/rustbox,tedsta/rustbox,gchp/rustbox
toml
## Code Before: [project] name = "rustbox" version = "0.1.0" authors = ["gregchapple1@gmail.com"] [[lib]] name = "rustbox" ## Instruction: Fix formatting for author field ## Code After: [project] name = "rustbox" version = "0.1.0" authors = ["Greg Chapple <gregchapple1@gmail.com>"] [[lib]] name = "rustbox"
[project] name = "rustbox" version = "0.1.0" - authors = ["gregchapple1@gmail.com"] + authors = ["Greg Chapple <gregchapple1@gmail.com>"] ? ++++++++++++++ + [[lib]] name = "rustbox"
2
0.285714
1
1
30985523b35df85d3454060e2167b51a7f402474
src/lib.rs
src/lib.rs
extern crate libc; pub fn readline() -> Option<String> { // Buffer to hold readline input let buffer = String::new(); let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; if isatty { println!("stdin is a tty"); } else { println!("stdin is not a tty"); } buffer }
extern crate libc; fn isatty() -> bool { let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; isatty } pub fn readline() -> Option<String> { if isatty() { Some(buffer) } else { None } }
Split out tty check to a separate function
Split out tty check to a separate function
Rust
mit
kkawakam/rustyline,dubrowgn/rustyline,dubrowgn/rustyline,gwenn/rustyline,cavedweller/rustyline
rust
## Code Before: extern crate libc; pub fn readline() -> Option<String> { // Buffer to hold readline input let buffer = String::new(); let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; if isatty { println!("stdin is a tty"); } else { println!("stdin is not a tty"); } buffer } ## Instruction: Split out tty check to a separate function ## Code After: extern crate libc; fn isatty() -> bool { let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; isatty } pub fn readline() -> Option<String> { if isatty() { Some(buffer) } else { None } }
extern crate libc; + + + fn isatty() -> bool { + let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; + isatty + } + pub fn readline() -> Option<String> { - // Buffer to hold readline input - let buffer = String::new(); + if isatty() { + Some(buffer) + } else { + None + } + } - let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; - if isatty { - println!("stdin is a tty"); - } else { - println!("stdin is not a tty"); - } + - buffer - }
24
1.6
14
10
b30b08fc36ae833c5d4716875b6ed34d222aad9e
lib/junos-ez/facts/ifd_style.rb
lib/junos-ez/facts/ifd_style.rb
Junos::Ez::Facts::Keeper.define( :ifd_style ) do |ndev, facts| persona = uses :personality facts[:ifd_style] = case persona when :SWITCH :SWITCH else :CLASSIC end end
Junos::Ez::Facts::Keeper.define( :ifd_style ) do |ndev, facts| persona,sw_style = uses :personality,:switch_style facts[:ifd_style] = case persona when :SWITCH if sw_style == :VLAN_L2NG :CLASSIC else :SWITCH end else :CLASSIC end end
Fix to identify ifd style based on L2NG system
Fix to identify ifd style based on L2NG system
Ruby
bsd-2-clause
rterrero/ruby-junos-ez-stdlib,ganeshnalawade/ruby-junos-ez-stdlib
ruby
## Code Before: Junos::Ez::Facts::Keeper.define( :ifd_style ) do |ndev, facts| persona = uses :personality facts[:ifd_style] = case persona when :SWITCH :SWITCH else :CLASSIC end end ## Instruction: Fix to identify ifd style based on L2NG system ## Code After: Junos::Ez::Facts::Keeper.define( :ifd_style ) do |ndev, facts| persona,sw_style = uses :personality,:switch_style facts[:ifd_style] = case persona when :SWITCH if sw_style == :VLAN_L2NG :CLASSIC else :SWITCH end else :CLASSIC end end
- Junos::Ez::Facts::Keeper.define( :ifd_style ) do |ndev, facts| - persona = uses :personality + persona,sw_style = uses :personality,:switch_style facts[:ifd_style] = case persona when :SWITCH + if sw_style == :VLAN_L2NG + :CLASSIC + else - :SWITCH + :SWITCH ? ++ + end else :CLASSIC end end
9
0.642857
6
3
e9040147ae78d75a7d28c9e491c1f20403a4155c
server.js
server.js
'use strict'; const config = require('./config'); const JiraTicket = require('./jira-ticket'); const JiraBot = require('./jira-bot'); const log = require('winston'); let jiraTicket = new JiraTicket(config.jira), jiraBot = new JiraBot(config.slack); jiraBot.on('ticketKeyFound', (key, channel) => { jiraTicket.get(key, function(error, ticket) { if (error) { return; } const message = `>*${ticket.key}*\n>${ticket.summary}\n>Status: ${ticket.status}\n>${ticket.url}`; jiraBot.sendMessage(message, channel.id); }); }); jiraBot.login();
'use strict'; const config = require('./config'); const JiraTicket = require('./jira-ticket'); const JiraBot = require('./jira-bot'); const log = require('winston'); let jiraTicket = new JiraTicket(config.jira), jiraBot = new JiraBot(config.slack); jiraBot.on('ticketKeyFound', (key, channel) => { jiraTicket.get(key, function(error, ticket) { if (error) { return; } const message = `>*${ticket.key}*\n>${ticket.summary}\n>Status: ${ticket.status}\n>${ticket.url}`; jiraBot.sendMessage(message, channel.id, (error) => { if(error) { log.error('Error while posting issue info to Slack', error); return; } log.info(`Posted Jira issue info to channel #${channel.name}`); }); }); }); jiraBot.login();
Add logging for sending issue info to Slack
Add logging for sending issue info to Slack
JavaScript
mit
okovpashko/slack-jira-ticket-parser
javascript
## Code Before: 'use strict'; const config = require('./config'); const JiraTicket = require('./jira-ticket'); const JiraBot = require('./jira-bot'); const log = require('winston'); let jiraTicket = new JiraTicket(config.jira), jiraBot = new JiraBot(config.slack); jiraBot.on('ticketKeyFound', (key, channel) => { jiraTicket.get(key, function(error, ticket) { if (error) { return; } const message = `>*${ticket.key}*\n>${ticket.summary}\n>Status: ${ticket.status}\n>${ticket.url}`; jiraBot.sendMessage(message, channel.id); }); }); jiraBot.login(); ## Instruction: Add logging for sending issue info to Slack ## Code After: 'use strict'; const config = require('./config'); const JiraTicket = require('./jira-ticket'); const JiraBot = require('./jira-bot'); const log = require('winston'); let jiraTicket = new JiraTicket(config.jira), jiraBot = new JiraBot(config.slack); jiraBot.on('ticketKeyFound', (key, channel) => { jiraTicket.get(key, function(error, ticket) { if (error) { return; } const message = `>*${ticket.key}*\n>${ticket.summary}\n>Status: ${ticket.status}\n>${ticket.url}`; jiraBot.sendMessage(message, channel.id, (error) => { if(error) { log.error('Error while posting issue info to Slack', error); return; } log.info(`Posted Jira issue info to channel #${channel.name}`); }); }); }); jiraBot.login();
'use strict'; const config = require('./config'); const JiraTicket = require('./jira-ticket'); const JiraBot = require('./jira-bot'); const log = require('winston'); let jiraTicket = new JiraTicket(config.jira), jiraBot = new JiraBot(config.slack); jiraBot.on('ticketKeyFound', (key, channel) => { jiraTicket.get(key, function(error, ticket) { if (error) { return; } const message = `>*${ticket.key}*\n>${ticket.summary}\n>Status: ${ticket.status}\n>${ticket.url}`; - jiraBot.sendMessage(message, channel.id); ? ^ + jiraBot.sendMessage(message, channel.id, (error) => { ? ++++++++ ^^^^^ + if(error) { + log.error('Error while posting issue info to Slack', error); + return; + } + + log.info(`Posted Jira issue info to channel #${channel.name}`); + }); }); }); jiraBot.login();
9
0.409091
8
1
1ee412f07e39a32e53b12fad291ffd41595590bb
asset/js/render.js
asset/js/render.js
var shipment = $("#shipment-templ").html(); var template = Handlebars.compile(shipment); //Sample - To be replaced by GET db content // { // author: "zachlatta", // name: "Hack Club", // timestamp: "11:09 PM - 7 Jul 2017", // desc: "We help high schoolers start awesome after-school coding clubs!", // link: "https://hackclub.com", // code: "https://github.com/hackclub/hackclub", // upvote: 255 // uuid: 125121 // } function loadShipment(id) { $("#shipped-placeholder").hide(); $("#shipped").prepend(template(id)); } $("#launch").on("click", openShipper); $("#unlaunch").on("click", closeShipper); function openShipper() { $("#ship-modal").addClass("is-active"); } function closeShipper() { $(".modal").removeClass("is-active"); } function shareShipment(uuid) { $("#share-modal").addClass("is-active"); }
var shipment = $("#shipment-templ").html(); var template = Handlebars.compile(shipment); //Sample - To be replaced by GET db content // { // author: "zachlatta", // name: "Hack Club", // timestamp: "11:09 PM - 7 Jul 2017", // desc: "We help high schoolers start awesome after-school coding clubs!", // link: "https://hackclub.com", // code: "https://github.com/hackclub/hackclub", // upvote: 255 // uuid: 125121 // } function loadShipment(id) { $("#shipped-placeholder").hide(); $("#shipped").prepend(template(id)); } $("#launch").on("click", openShipper); $(".modal-close").on("click", closeShipper); function openShipper() { $("#ship-modal").addClass("is-active"); } function closeShipper() { $(".modal").removeClass("is-active"); } function shareShipment(uuid) { $("#share-modal").addClass("is-active"); }
Fix modal does not close bug
Fix modal does not close bug
JavaScript
mit
hackclub/shipit,hackclub/shipit
javascript
## Code Before: var shipment = $("#shipment-templ").html(); var template = Handlebars.compile(shipment); //Sample - To be replaced by GET db content // { // author: "zachlatta", // name: "Hack Club", // timestamp: "11:09 PM - 7 Jul 2017", // desc: "We help high schoolers start awesome after-school coding clubs!", // link: "https://hackclub.com", // code: "https://github.com/hackclub/hackclub", // upvote: 255 // uuid: 125121 // } function loadShipment(id) { $("#shipped-placeholder").hide(); $("#shipped").prepend(template(id)); } $("#launch").on("click", openShipper); $("#unlaunch").on("click", closeShipper); function openShipper() { $("#ship-modal").addClass("is-active"); } function closeShipper() { $(".modal").removeClass("is-active"); } function shareShipment(uuid) { $("#share-modal").addClass("is-active"); } ## Instruction: Fix modal does not close bug ## Code After: var shipment = $("#shipment-templ").html(); var template = Handlebars.compile(shipment); //Sample - To be replaced by GET db content // { // author: "zachlatta", // name: "Hack Club", // timestamp: "11:09 PM - 7 Jul 2017", // desc: "We help high schoolers start awesome after-school coding clubs!", // link: "https://hackclub.com", // code: "https://github.com/hackclub/hackclub", // upvote: 255 // uuid: 125121 // } function loadShipment(id) { $("#shipped-placeholder").hide(); $("#shipped").prepend(template(id)); } $("#launch").on("click", openShipper); $(".modal-close").on("click", closeShipper); function openShipper() { $("#ship-modal").addClass("is-active"); } function closeShipper() { $(".modal").removeClass("is-active"); } function shareShipment(uuid) { $("#share-modal").addClass("is-active"); }
var shipment = $("#shipment-templ").html(); var template = Handlebars.compile(shipment); //Sample - To be replaced by GET db content // { // author: "zachlatta", // name: "Hack Club", // timestamp: "11:09 PM - 7 Jul 2017", // desc: "We help high schoolers start awesome after-school coding clubs!", // link: "https://hackclub.com", // code: "https://github.com/hackclub/hackclub", // upvote: 255 // uuid: 125121 // } function loadShipment(id) { $("#shipped-placeholder").hide(); $("#shipped").prepend(template(id)); } $("#launch").on("click", openShipper); - $("#unlaunch").on("click", closeShipper); ? ^^^ ^^^ ^ + $(".modal-close").on("click", closeShipper); ? ^^^^^ ^ ^^^^ + function openShipper() { $("#ship-modal").addClass("is-active"); } function closeShipper() { $(".modal").removeClass("is-active"); } function shareShipment(uuid) { $("#share-modal").addClass("is-active"); }
3
0.090909
2
1
d66edd5f07130260e63253b0e2d25ce24ed6f6f2
.travis.yml
.travis.yml
language: python python: - "3.4" - "3.5" - "3.6" sudo: required install: - pip install -r requirements.txt - pip install coverage python-coveralls - source continuous_integration/install.sh env: matrix: - SCHEDULER="SLURM" - SCHEDULER="NONE" script: make test after_success: coveralls cache: apt
dist: xenial language: python python: - "3.4" - "3.5" - "3.6" sudo: required install: - pip install -r requirements.txt - pip install coverage python-coveralls - source continuous_integration/install.sh env: matrix: - SCHEDULER="SLURM" - SCHEDULER="NONE" script: make test after_success: coveralls cache: apt
FIX Slurm fails on Travis CI
FIX Slurm fails on Travis CI
YAML
bsd-3-clause
jm-begon/clustertools,jm-begon/clustertools
yaml
## Code Before: language: python python: - "3.4" - "3.5" - "3.6" sudo: required install: - pip install -r requirements.txt - pip install coverage python-coveralls - source continuous_integration/install.sh env: matrix: - SCHEDULER="SLURM" - SCHEDULER="NONE" script: make test after_success: coveralls cache: apt ## Instruction: FIX Slurm fails on Travis CI ## Code After: dist: xenial language: python python: - "3.4" - "3.5" - "3.6" sudo: required install: - pip install -r requirements.txt - pip install coverage python-coveralls - source continuous_integration/install.sh env: matrix: - SCHEDULER="SLURM" - SCHEDULER="NONE" script: make test after_success: coveralls cache: apt
+ dist: xenial + language: python python: - "3.4" - "3.5" - "3.6" sudo: required install: - pip install -r requirements.txt - pip install coverage python-coveralls - source continuous_integration/install.sh env: matrix: - SCHEDULER="SLURM" - SCHEDULER="NONE" script: make test after_success: coveralls cache: apt
2
0.090909
2
0
5a0840f03caa275af91fc9ee94779a3179fae224
sql/reading/get_readings_by_meter_id_and_date_range.sql
sql/reading/get_readings_by_meter_id_and_date_range.sql
-- Coalesce returns the first non-null value SELECT meter_id, reading, read_timestamp FROM readings WHERE meter_id = ${meterID} AND read_timestamp BETWEEN COALESCE(${startDate}, DATE '1970-01-01') AND COALESCE(${endDate}, DATE '50000-01-01');
SELECT meter_id, reading, read_timestamp FROM readings WHERE meter_id = ${meterID} AND read_timestamp BETWEEN -- Coalesce returns the first non-null value, so this defaults the start date to 1970 and end to 50000, -- effectively not restricting them COALESCE(${startDate}, DATE '1970-01-01') AND COALESCE(${endDate}, DATE '50000-01-01');
Clarify a comment about COALESCE
Clarify a comment about COALESCE
SQL
mpl-2.0
beloitcollegecomputerscience/OED,OpenEnergyDashboard/OED,OpenEnergyDashboard/OED,OpenEnergyDashboard/OED,beloitcollegecomputerscience/OED,OpenEnergyDashboard/OED,beloitcollegecomputerscience/OED,beloitcollegecomputerscience/OED
sql
## Code Before: -- Coalesce returns the first non-null value SELECT meter_id, reading, read_timestamp FROM readings WHERE meter_id = ${meterID} AND read_timestamp BETWEEN COALESCE(${startDate}, DATE '1970-01-01') AND COALESCE(${endDate}, DATE '50000-01-01'); ## Instruction: Clarify a comment about COALESCE ## Code After: SELECT meter_id, reading, read_timestamp FROM readings WHERE meter_id = ${meterID} AND read_timestamp BETWEEN -- Coalesce returns the first non-null value, so this defaults the start date to 1970 and end to 50000, -- effectively not restricting them COALESCE(${startDate}, DATE '1970-01-01') AND COALESCE(${endDate}, DATE '50000-01-01');
- -- Coalesce returns the first non-null value SELECT meter_id, reading, read_timestamp FROM readings WHERE meter_id = ${meterID} AND read_timestamp BETWEEN + -- Coalesce returns the first non-null value, so this defaults the start date to 1970 and end to 50000, + -- effectively not restricting them COALESCE(${startDate}, DATE '1970-01-01') AND COALESCE(${endDate}, DATE '50000-01-01');
3
0.375
2
1
cf8d145b5c8c7acf0ec128f1a08b012b8856d3f4
README.md
README.md
Mumble supports querying server information by sending a ping packet to the target server. This includes: server version, currently connected users, max users allowed, allowed bandwidth. This implementation doesn't require anything on the server side, and will work on any server. Read more about it [here](http://wiki.mumble.info/wiki/Protocol#UDP_Ping_packet). ### How to use it ```php <?php use xPaw\Mumble; // require or your favourite autoloader require __DIR__ . '/MumblePing.php'; $Info = MumblePing( 'example.com', 64738 ); echo 'Users: ' . $Info[ 'Users' ] . ' / ' . $Info[ 'MaxUsers' ] . '<br>'; echo 'Version: ' . $Info[ 'Version' ] . '<br>'; echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)<br>'; ```
Mumble supports querying server information by sending a ping packet to the target server. This includes: server version, currently connected users, max users allowed, allowed bandwidth. This implementation doesn't require anything on the server side, and will work on any server. Read more about it [here](http://wiki.mumble.info/wiki/Protocol#UDP_Ping_packet). ### How to use it ```php <?php use xPaw\Mumble; // require or your favourite autoloader require __DIR__ . '/MumblePing.php'; $Info = MumblePing( 'example.com', 64738 ); if( $Info === false ) { echo 'Ping failed.'; } else { echo 'Users: ' . $Info[ 'Users' ] . ' / ' . $Info[ 'MaxUsers' ] . '<br>'; echo 'Version: ' . $Info[ 'Version' ] . '<br>'; echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)<br>'; } ```
Add error check in example
Add error check in example
Markdown
unlicense
xPaw/MumblePing
markdown
## Code Before: Mumble supports querying server information by sending a ping packet to the target server. This includes: server version, currently connected users, max users allowed, allowed bandwidth. This implementation doesn't require anything on the server side, and will work on any server. Read more about it [here](http://wiki.mumble.info/wiki/Protocol#UDP_Ping_packet). ### How to use it ```php <?php use xPaw\Mumble; // require or your favourite autoloader require __DIR__ . '/MumblePing.php'; $Info = MumblePing( 'example.com', 64738 ); echo 'Users: ' . $Info[ 'Users' ] . ' / ' . $Info[ 'MaxUsers' ] . '<br>'; echo 'Version: ' . $Info[ 'Version' ] . '<br>'; echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)<br>'; ``` ## Instruction: Add error check in example ## Code After: Mumble supports querying server information by sending a ping packet to the target server. This includes: server version, currently connected users, max users allowed, allowed bandwidth. This implementation doesn't require anything on the server side, and will work on any server. Read more about it [here](http://wiki.mumble.info/wiki/Protocol#UDP_Ping_packet). ### How to use it ```php <?php use xPaw\Mumble; // require or your favourite autoloader require __DIR__ . '/MumblePing.php'; $Info = MumblePing( 'example.com', 64738 ); if( $Info === false ) { echo 'Ping failed.'; } else { echo 'Users: ' . $Info[ 'Users' ] . ' / ' . $Info[ 'MaxUsers' ] . '<br>'; echo 'Version: ' . $Info[ 'Version' ] . '<br>'; echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)<br>'; } ```
Mumble supports querying server information by sending a ping packet to the target server. This includes: server version, currently connected users, max users allowed, allowed bandwidth. This implementation doesn't require anything on the server side, and will work on any server. Read more about it [here](http://wiki.mumble.info/wiki/Protocol#UDP_Ping_packet). ### How to use it ```php <?php use xPaw\Mumble; // require or your favourite autoloader require __DIR__ . '/MumblePing.php'; $Info = MumblePing( 'example.com', 64738 ); + if( $Info === false ) + { + echo 'Ping failed.'; + } + else + { - echo 'Users: ' . $Info[ 'Users' ] . ' / ' . $Info[ 'MaxUsers' ] . '<br>'; + echo 'Users: ' . $Info[ 'Users' ] . ' / ' . $Info[ 'MaxUsers' ] . '<br>'; ? + - echo 'Version: ' . $Info[ 'Version' ] . '<br>'; + echo 'Version: ' . $Info[ 'Version' ] . '<br>'; ? + - echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)<br>'; + echo 'Bandwidth: ' . $Info[ 'Bandwidth' ] . ' (bytes)<br>'; ? + + } ```
13
0.52
10
3
111682e3c19784aa87d5f3d4b56149226e6f9d3b
app/tests/archives_tests/test_models.py
app/tests/archives_tests/test_models.py
import pytest from tests.archives_tests.factories import ArchiveFactory from tests.model_helpers import do_test_factory @pytest.mark.django_db class TestArchivesModels: # test functions are added dynamically to this class def test_study_str(self): model = ArchiveFactory() assert str(model) == "<{} {}>".format( model.__class__.__name__, model.name ) @pytest.mark.django_db @pytest.mark.parametrize("factory", (ArchiveFactory,)) class TestFactories: def test_factory_creation(self, factory): do_test_factory(factory)
import pytest from django.core.exceptions import ObjectDoesNotExist from tests.archives_tests.factories import ArchiveFactory from tests.cases_tests.factories import ImageFactoryWithImageFile from tests.model_helpers import do_test_factory @pytest.mark.django_db class TestArchivesModels: # test functions are added dynamically to this class def test_str(self): model = ArchiveFactory() assert str(model) == "<{} {}>".format( model.__class__.__name__, model.name ) @pytest.mark.django_db @pytest.mark.parametrize("factory", (ArchiveFactory,)) class TestFactories: def test_factory_creation(self, factory): do_test_factory(factory) @pytest.mark.django_db class TestCascadeDelete: def test_removes_all_related_models( self, ArchivePatientStudyImageSet, AnnotationSetForImage ): apsi_set = ArchivePatientStudyImageSet annotation_set = AnnotationSetForImage( retina_grader=True, image=apsi_set.images111[0] ) image_not_in_archive = ImageFactoryWithImageFile( study=apsi_set.study111 ) apsi_set.archive1.delete() all_deleted_models = ( apsi_set.archive1, apsi_set.patient11, apsi_set.patient12, apsi_set.study111, apsi_set.study112, apsi_set.study113, apsi_set.study121, apsi_set.study122, *apsi_set.images111, *apsi_set.images112, *apsi_set.images113, *apsi_set.images122, *apsi_set.images121, annotation_set.measurement, annotation_set.boolean, annotation_set.polygon, annotation_set.coordinatelist, annotation_set.singlelandmarks[0], annotation_set.etdrs, annotation_set.integer, image_not_in_archive, ) for model in all_deleted_models: with pytest.raises(ObjectDoesNotExist): assert model.refresh_from_db() not_deleted_models = ( apsi_set.archive2, *apsi_set.images211, annotation_set.landmark, *annotation_set.singlelandmarks[1:], ) for model in not_deleted_models: assert model.refresh_from_db() is None
Add test for cascading deletion of archive
Add test for cascading deletion of archive
Python
apache-2.0
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
python
## Code Before: import pytest from tests.archives_tests.factories import ArchiveFactory from tests.model_helpers import do_test_factory @pytest.mark.django_db class TestArchivesModels: # test functions are added dynamically to this class def test_study_str(self): model = ArchiveFactory() assert str(model) == "<{} {}>".format( model.__class__.__name__, model.name ) @pytest.mark.django_db @pytest.mark.parametrize("factory", (ArchiveFactory,)) class TestFactories: def test_factory_creation(self, factory): do_test_factory(factory) ## Instruction: Add test for cascading deletion of archive ## Code After: import pytest from django.core.exceptions import ObjectDoesNotExist from tests.archives_tests.factories import ArchiveFactory from tests.cases_tests.factories import ImageFactoryWithImageFile from tests.model_helpers import do_test_factory @pytest.mark.django_db class TestArchivesModels: # test functions are added dynamically to this class def test_str(self): model = ArchiveFactory() assert str(model) == "<{} {}>".format( model.__class__.__name__, model.name ) @pytest.mark.django_db @pytest.mark.parametrize("factory", (ArchiveFactory,)) class TestFactories: def test_factory_creation(self, factory): do_test_factory(factory) @pytest.mark.django_db class TestCascadeDelete: def test_removes_all_related_models( self, ArchivePatientStudyImageSet, AnnotationSetForImage ): apsi_set = ArchivePatientStudyImageSet annotation_set = AnnotationSetForImage( retina_grader=True, image=apsi_set.images111[0] ) image_not_in_archive = ImageFactoryWithImageFile( study=apsi_set.study111 ) apsi_set.archive1.delete() all_deleted_models = ( apsi_set.archive1, apsi_set.patient11, apsi_set.patient12, apsi_set.study111, apsi_set.study112, apsi_set.study113, apsi_set.study121, apsi_set.study122, *apsi_set.images111, *apsi_set.images112, *apsi_set.images113, *apsi_set.images122, *apsi_set.images121, annotation_set.measurement, annotation_set.boolean, annotation_set.polygon, annotation_set.coordinatelist, annotation_set.singlelandmarks[0], annotation_set.etdrs, annotation_set.integer, image_not_in_archive, ) for model in all_deleted_models: with pytest.raises(ObjectDoesNotExist): assert model.refresh_from_db() not_deleted_models = ( apsi_set.archive2, *apsi_set.images211, annotation_set.landmark, *annotation_set.singlelandmarks[1:], ) for model in not_deleted_models: assert model.refresh_from_db() is None
import pytest + from django.core.exceptions import ObjectDoesNotExist + from tests.archives_tests.factories import ArchiveFactory + from tests.cases_tests.factories import ImageFactoryWithImageFile from tests.model_helpers import do_test_factory @pytest.mark.django_db class TestArchivesModels: # test functions are added dynamically to this class - def test_study_str(self): ? ------ + def test_str(self): model = ArchiveFactory() assert str(model) == "<{} {}>".format( model.__class__.__name__, model.name ) @pytest.mark.django_db @pytest.mark.parametrize("factory", (ArchiveFactory,)) class TestFactories: def test_factory_creation(self, factory): do_test_factory(factory) + + + @pytest.mark.django_db + class TestCascadeDelete: + def test_removes_all_related_models( + self, ArchivePatientStudyImageSet, AnnotationSetForImage + ): + apsi_set = ArchivePatientStudyImageSet + annotation_set = AnnotationSetForImage( + retina_grader=True, image=apsi_set.images111[0] + ) + image_not_in_archive = ImageFactoryWithImageFile( + study=apsi_set.study111 + ) + apsi_set.archive1.delete() + all_deleted_models = ( + apsi_set.archive1, + apsi_set.patient11, + apsi_set.patient12, + apsi_set.study111, + apsi_set.study112, + apsi_set.study113, + apsi_set.study121, + apsi_set.study122, + *apsi_set.images111, + *apsi_set.images112, + *apsi_set.images113, + *apsi_set.images122, + *apsi_set.images121, + annotation_set.measurement, + annotation_set.boolean, + annotation_set.polygon, + annotation_set.coordinatelist, + annotation_set.singlelandmarks[0], + annotation_set.etdrs, + annotation_set.integer, + image_not_in_archive, + ) + for model in all_deleted_models: + with pytest.raises(ObjectDoesNotExist): + assert model.refresh_from_db() + + not_deleted_models = ( + apsi_set.archive2, + *apsi_set.images211, + annotation_set.landmark, + *annotation_set.singlelandmarks[1:], + ) + for model in not_deleted_models: + assert model.refresh_from_db() is None
55
2.75
54
1
527e8a853793ede4e9c74a0a223ff1ddd152ed9f
CHANGELOG.md
CHANGELOG.md
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ## Unreleased as of Sprint 71 ending 2017-10-16 ### Changed - Rename ws to api to not be confused with websockets [(#131)](https://github.com/ManageIQ/manageiq-appliance/pull/131) ## Unreleased as of Sprint 69 ending 2017-09-18 ### Added - Add miqldap_to_sssd launcher [(#134)](https://github.com/ManageIQ/manageiq-appliance/pull/134) ## Unreleased as of Sprint 68 ending 2017-09-04 ### Fixed - Platform - Add support for the domain user attribute [(#127)](https://github.com/ManageIQ/manageiq-appliance/pull/127) ## Fine-1 ### Fixed - Add the tower log files to our rotation script [(#120)](https://github.com/ManageIQ/manageiq-appliance/pull/120) - Generate new certificate when the default one is not present [(#119)](https://github.com/ManageIQ/manageiq-appliance/pull/119)
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ## Gaprindashvili Beta1 ### Added - Add miqldap_to_sssd launcher [(#134)](https://github.com/ManageIQ/manageiq-appliance/pull/134) ### Changed - Rename ws to api to not be confused with websockets [(#131)](https://github.com/ManageIQ/manageiq-appliance/pull/131) ### Fixed - Platform - Add support for the domain user attribute [(#127)](https://github.com/ManageIQ/manageiq-appliance/pull/127) ## Fine-1 ### Fixed - Add the tower log files to our rotation script [(#120)](https://github.com/ManageIQ/manageiq-appliance/pull/120) - Generate new certificate when the default one is not present [(#119)](https://github.com/ManageIQ/manageiq-appliance/pull/119)
Update master changelog for Gaprindashvili Beta1
Update master changelog for Gaprindashvili Beta1 [skip ci]
Markdown
apache-2.0
ManageIQ/manageiq-appliance,ManageIQ/manageiq-appliance,ManageIQ/manageiq-appliance
markdown
## Code Before: All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ## Unreleased as of Sprint 71 ending 2017-10-16 ### Changed - Rename ws to api to not be confused with websockets [(#131)](https://github.com/ManageIQ/manageiq-appliance/pull/131) ## Unreleased as of Sprint 69 ending 2017-09-18 ### Added - Add miqldap_to_sssd launcher [(#134)](https://github.com/ManageIQ/manageiq-appliance/pull/134) ## Unreleased as of Sprint 68 ending 2017-09-04 ### Fixed - Platform - Add support for the domain user attribute [(#127)](https://github.com/ManageIQ/manageiq-appliance/pull/127) ## Fine-1 ### Fixed - Add the tower log files to our rotation script [(#120)](https://github.com/ManageIQ/manageiq-appliance/pull/120) - Generate new certificate when the default one is not present [(#119)](https://github.com/ManageIQ/manageiq-appliance/pull/119) ## Instruction: Update master changelog for Gaprindashvili Beta1 [skip ci] ## Code After: All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ## Gaprindashvili Beta1 ### Added - Add miqldap_to_sssd launcher [(#134)](https://github.com/ManageIQ/manageiq-appliance/pull/134) ### Changed - Rename ws to api to not be confused with websockets [(#131)](https://github.com/ManageIQ/manageiq-appliance/pull/131) ### Fixed - Platform - Add support for the domain user attribute [(#127)](https://github.com/ManageIQ/manageiq-appliance/pull/127) ## Fine-1 ### Fixed - Add the tower log files to our rotation script [(#120)](https://github.com/ManageIQ/manageiq-appliance/pull/120) - Generate new certificate when the default one is not present [(#119)](https://github.com/ManageIQ/manageiq-appliance/pull/119)
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) + ## Gaprindashvili Beta1 - ## Unreleased as of Sprint 71 ending 2017-10-16 - - ### Changed - - Rename ws to api to not be confused with websockets [(#131)](https://github.com/ManageIQ/manageiq-appliance/pull/131) - - ## Unreleased as of Sprint 69 ending 2017-09-18 ### Added - Add miqldap_to_sssd launcher [(#134)](https://github.com/ManageIQ/manageiq-appliance/pull/134) - ## Unreleased as of Sprint 68 ending 2017-09-04 + ### Changed + - Rename ws to api to not be confused with websockets [(#131)](https://github.com/ManageIQ/manageiq-appliance/pull/131) ### Fixed - Platform - Add support for the domain user attribute [(#127)](https://github.com/ManageIQ/manageiq-appliance/pull/127) ## Fine-1 ### Fixed - Add the tower log files to our rotation script [(#120)](https://github.com/ManageIQ/manageiq-appliance/pull/120) - Generate new certificate when the default one is not present [(#119)](https://github.com/ManageIQ/manageiq-appliance/pull/119)
10
0.37037
3
7
5d7501059210574de91f16f52841d21ed9bf63ae
buildouts/lxml.cfg
buildouts/lxml.cfg
[buildout] eggs = lxml parts = lxml versions = versions [versions] lxml = 3.2.1 [lxml] recipe = z3c.recipe.staticlxml egg = lxml libxslt-url = ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz libxml2-url = ftp://xmlsoft.org/libxslt/libxml2-2.8.0.tar.gz
[buildout] eggs = lxml parts = lxml versions = versions [versions] lxml = 3.2.1 [lxml] recipe = z3c.recipe.staticlxml egg = lxml libxslt-url = ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz libxml2-url = ftp://xmlsoft.org/libxslt/libxml2-2.8.0.tar.gz # http urls: # libxml2-url = http://gd.tuwien.ac.at/pub/libxml/libxml2-2.8.0.tar.gz # libxslt-url = http://gd.tuwien.ac.at/pub/libxml/libxslt-1.1.26.tar.gz
Add http urls for libxml in case ftp isn't available
Add http urls for libxml in case ftp isn't available
INI
agpl-3.0
alkadis/vcv,alkadis/vcv,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,liqd/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,phihag/adhocracy,phihag/adhocracy,alkadis/vcv,phihag/adhocracy,liqd/adhocracy,liqd/adhocracy
ini
## Code Before: [buildout] eggs = lxml parts = lxml versions = versions [versions] lxml = 3.2.1 [lxml] recipe = z3c.recipe.staticlxml egg = lxml libxslt-url = ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz libxml2-url = ftp://xmlsoft.org/libxslt/libxml2-2.8.0.tar.gz ## Instruction: Add http urls for libxml in case ftp isn't available ## Code After: [buildout] eggs = lxml parts = lxml versions = versions [versions] lxml = 3.2.1 [lxml] recipe = z3c.recipe.staticlxml egg = lxml libxslt-url = ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz libxml2-url = ftp://xmlsoft.org/libxslt/libxml2-2.8.0.tar.gz # http urls: # libxml2-url = http://gd.tuwien.ac.at/pub/libxml/libxml2-2.8.0.tar.gz # libxslt-url = http://gd.tuwien.ac.at/pub/libxml/libxslt-1.1.26.tar.gz
[buildout] eggs = lxml parts = lxml versions = versions [versions] lxml = 3.2.1 [lxml] recipe = z3c.recipe.staticlxml egg = lxml libxslt-url = ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz libxml2-url = ftp://xmlsoft.org/libxslt/libxml2-2.8.0.tar.gz + # http urls: + # libxml2-url = http://gd.tuwien.ac.at/pub/libxml/libxml2-2.8.0.tar.gz + # libxslt-url = http://gd.tuwien.ac.at/pub/libxml/libxslt-1.1.26.tar.gz
3
0.176471
3
0
64851e56be9d3f9c3ad2c4f384249a4f468e118f
CRM/Speakcivi/Logic/Consent.php
CRM/Speakcivi/Logic/Consent.php
<?php class CRM_Speakcivi_Logic_Consent { public $publicId; public $version; public $language; public $date; public $createDate; public $level; public $method; public $methodOption; /** * @param $param * * @return array */ public static function prepareFields($param) { $consents = []; if (property_exists($param, 'consents')) { foreach ($param->consents as $consent) { list($consentVersion, $consentLanguage) = explode('-', $consent->public_id); $cd = new DateTime(substr($param->create_dt, 0, 10)); $c = new self(); $c->publicId = $consent->public_id; $c->version = $consentVersion; $c->language = $consentLanguage; $c->date = $cd->format('Y-m-d'); $c->createDate = $cd->format('Y-m-d H:i:s'); $c->level = $consent->consent_level; $c->method = $consent->consent_method; $c->methodOption = $consent->consent_method_option; $consents[] = $c; } } return $consents; } }
<?php class CRM_Speakcivi_Logic_Consent { public $publicId; public $version; public $language; public $date; public $createDate; public $level; public $method; public $methodOption; /** * @param $param * * @return array */ public static function prepareFields($param) { $consents = []; if (property_exists($param, 'consents')) { foreach ($param->consents as $consent) { list($consentVersion, $consentLanguage) = explode('-', $consent->public_id); $cd = new DateTime(substr($param->create_dt, 0, 10)); $c = new self(); $c->publicId = $consent->public_id; $c->version = $consentVersion; $c->language = $consentLanguage; $c->date = $cd->format('Y-m-d'); $c->createDate = $param->create_dt; $c->level = $consent->consent_level; $c->method = $consent->consent_method; $c->methodOption = $consent->consent_method_option; $consents[] = $c; } } return $consents; } }
Fix date of DPA activity properly
Fix date of DPA activity properly
PHP
agpl-3.0
WeMoveEU/bsd_api
php
## Code Before: <?php class CRM_Speakcivi_Logic_Consent { public $publicId; public $version; public $language; public $date; public $createDate; public $level; public $method; public $methodOption; /** * @param $param * * @return array */ public static function prepareFields($param) { $consents = []; if (property_exists($param, 'consents')) { foreach ($param->consents as $consent) { list($consentVersion, $consentLanguage) = explode('-', $consent->public_id); $cd = new DateTime(substr($param->create_dt, 0, 10)); $c = new self(); $c->publicId = $consent->public_id; $c->version = $consentVersion; $c->language = $consentLanguage; $c->date = $cd->format('Y-m-d'); $c->createDate = $cd->format('Y-m-d H:i:s'); $c->level = $consent->consent_level; $c->method = $consent->consent_method; $c->methodOption = $consent->consent_method_option; $consents[] = $c; } } return $consents; } } ## Instruction: Fix date of DPA activity properly ## Code After: <?php class CRM_Speakcivi_Logic_Consent { public $publicId; public $version; public $language; public $date; public $createDate; public $level; public $method; public $methodOption; /** * @param $param * * @return array */ public static function prepareFields($param) { $consents = []; if (property_exists($param, 'consents')) { foreach ($param->consents as $consent) { list($consentVersion, $consentLanguage) = explode('-', $consent->public_id); $cd = new DateTime(substr($param->create_dt, 0, 10)); $c = new self(); $c->publicId = $consent->public_id; $c->version = $consentVersion; $c->language = $consentLanguage; $c->date = $cd->format('Y-m-d'); $c->createDate = $param->create_dt; $c->level = $consent->consent_level; $c->method = $consent->consent_method; $c->methodOption = $consent->consent_method_option; $consents[] = $c; } } return $consents; } }
<?php class CRM_Speakcivi_Logic_Consent { public $publicId; public $version; public $language; public $date; public $createDate; public $level; public $method; public $methodOption; /** * @param $param * * @return array */ public static function prepareFields($param) { $consents = []; if (property_exists($param, 'consents')) { foreach ($param->consents as $consent) { list($consentVersion, $consentLanguage) = explode('-', $consent->public_id); $cd = new DateTime(substr($param->create_dt, 0, 10)); $c = new self(); $c->publicId = $consent->public_id; $c->version = $consentVersion; $c->language = $consentLanguage; $c->date = $cd->format('Y-m-d'); - $c->createDate = $cd->format('Y-m-d H:i:s'); + $c->createDate = $param->create_dt; $c->level = $consent->consent_level; $c->method = $consent->consent_method; $c->methodOption = $consent->consent_method_option; $consents[] = $c; } } return $consents; } }
2
0.051282
1
1
32eb33cbf802337847d11b682039c64dff88ed99
el.spec.js
el.spec.js
var el = require('./el'); var outputEl = document.querySelector('#el-js'); function assertDomContent(elTree, expected) { el(outputEl, elTree); var actual = outputEl.innerHTML.replace(/\s+/g, ' ').trim(); if (actual === expected) return; throw new Error('Unexpected element output; to debug this, break on errors and inspect the DOM'); } function resetOutputEl() { outputEl.innerHTML = ''; } describe('el.js', function() { afterEach(resetOutputEl); it('produces the simplest possible element', function() { assertDomContent( el('div', 'Hello World'), '<div>Hello World</div>' ); }); });
var el = require('./el'); var outputEl = document.querySelector('#el-js'); function assertDomContent(elTree, expected) { el(outputEl, elTree); var actual = outputEl.innerHTML.replace(/\s+/g, ' ').trim(); if (actual === expected) return; throw new Error('\n\nExpected: ' + expected + '\n Actual: ' + actual + '\n\n'); } function resetOutputEl() { outputEl.innerHTML = ''; } describe('el.js', function() { afterEach(resetOutputEl); it('produces the simplest possible element', function() { assertDomContent( el('div', 'Hello World'), '<div>Hello World</div>' ); }); it('produces more complex elements', function() { assertDomContent( el('p', { class: 'cool' }, el('<!', 'this is a comment'), el('a', 'Click here', { href: '#some-location' }), el('', 'Text after link') ), '<p class="cool"><!--this is a comment--><a href="#some-location">Click here</a>Text after link</p>' ); }); });
Add a more involved test case.
Add a more involved test case.
JavaScript
mit
jareware/el-js,jareware/el-js
javascript
## Code Before: var el = require('./el'); var outputEl = document.querySelector('#el-js'); function assertDomContent(elTree, expected) { el(outputEl, elTree); var actual = outputEl.innerHTML.replace(/\s+/g, ' ').trim(); if (actual === expected) return; throw new Error('Unexpected element output; to debug this, break on errors and inspect the DOM'); } function resetOutputEl() { outputEl.innerHTML = ''; } describe('el.js', function() { afterEach(resetOutputEl); it('produces the simplest possible element', function() { assertDomContent( el('div', 'Hello World'), '<div>Hello World</div>' ); }); }); ## Instruction: Add a more involved test case. ## Code After: var el = require('./el'); var outputEl = document.querySelector('#el-js'); function assertDomContent(elTree, expected) { el(outputEl, elTree); var actual = outputEl.innerHTML.replace(/\s+/g, ' ').trim(); if (actual === expected) return; throw new Error('\n\nExpected: ' + expected + '\n Actual: ' + actual + '\n\n'); } function resetOutputEl() { outputEl.innerHTML = ''; } describe('el.js', function() { afterEach(resetOutputEl); it('produces the simplest possible element', function() { assertDomContent( el('div', 'Hello World'), '<div>Hello World</div>' ); }); it('produces more complex elements', function() { assertDomContent( el('p', { class: 'cool' }, el('<!', 'this is a comment'), el('a', 'Click here', { href: '#some-location' }), el('', 'Text after link') ), '<p class="cool"><!--this is a comment--><a href="#some-location">Click here</a>Text after link</p>' ); }); });
var el = require('./el'); var outputEl = document.querySelector('#el-js'); function assertDomContent(elTree, expected) { el(outputEl, elTree); var actual = outputEl.innerHTML.replace(/\s+/g, ' ').trim(); if (actual === expected) return; - throw new Error('Unexpected element output; to debug this, break on errors and inspect the DOM'); + throw new Error('\n\nExpected: ' + expected + '\n Actual: ' + actual + '\n\n'); } function resetOutputEl() { outputEl.innerHTML = ''; } describe('el.js', function() { afterEach(resetOutputEl); it('produces the simplest possible element', function() { assertDomContent( el('div', 'Hello World'), '<div>Hello World</div>' ); }); + it('produces more complex elements', function() { + assertDomContent( + el('p', { class: 'cool' }, + el('<!', 'this is a comment'), + el('a', 'Click here', { + href: '#some-location' + }), + el('', 'Text after link') + ), + '<p class="cool"><!--this is a comment--><a href="#some-location">Click here</a>Text after link</p>' + ); + }); + });
15
0.576923
14
1
428a2bf6fd40ab642a5fcc74dfd591987232e949
README.md
README.md
Asynchronous loading and creation of google maps [![Build Status](https://travis-ci.org/zpratt/async-google-maps.svg)](https://travis-ci.org/zpratt/async-google-maps) ## Running tests 1. Install io.js (needed for jsdom) - `npm i` - `npm test`
Asynchronous loading and creation of google maps [![Build Status](https://travis-ci.org/zpratt/async-google-maps.svg)](https://travis-ci.org/zpratt/async-google-maps) ## Running tests 1. Install io.js (needed for jsdom) - `npm i` - `npm test` ## Usage ```javascript var MapLoader = require('async-google-maps'); MapLoader.load({ key: 'some-api-key', version: '3.20' }); MapLoader.create( document.querySelector('.map-container'), { center: { lat: 40.0, lng: -90.0 }, zoom: 7 } ); ``` ### Promises This library leverages the ES6 promise implementation, which is currently [available in most modern browsers](http://caniuse.com/#feat=promises). If you wish to use it with browsers that do not support the ES6 promise implementation, then I recommend using [a polyfill](https://github.com/jakearchibald/es6-promise). ### Why? I have intentionally limited the production dependencies of this module, so you are not forced to use a particular library. ## API ### MapLoader.load Asynchronously loads the google maps javascript library, given the supplied options. Returns a promise that will be resolved once the google maps loader has finished. Once the promise resolves, it is safe to reference anything under the `google.maps` namespace. This method should only be called once for a given application. ### MapLoader.create Creates a map instance given the supplied options. The options will be passed into the `google.maps.Map` constructor, therefore, all options from the [google maps api](https://developers.google.com/maps/documentation/javascript/reference#MapOptions) can be used. This function returns a promise which will be resolved once the newly created map instance is in the `idle` state, which is the point at which overlays, markers, and geometries can be added to the map.
Document the API and how to use the library.
Document the API and how to use the library.
Markdown
mit
zpratt/async-google-maps
markdown
## Code Before: Asynchronous loading and creation of google maps [![Build Status](https://travis-ci.org/zpratt/async-google-maps.svg)](https://travis-ci.org/zpratt/async-google-maps) ## Running tests 1. Install io.js (needed for jsdom) - `npm i` - `npm test` ## Instruction: Document the API and how to use the library. ## Code After: Asynchronous loading and creation of google maps [![Build Status](https://travis-ci.org/zpratt/async-google-maps.svg)](https://travis-ci.org/zpratt/async-google-maps) ## Running tests 1. Install io.js (needed for jsdom) - `npm i` - `npm test` ## Usage ```javascript var MapLoader = require('async-google-maps'); MapLoader.load({ key: 'some-api-key', version: '3.20' }); MapLoader.create( document.querySelector('.map-container'), { center: { lat: 40.0, lng: -90.0 }, zoom: 7 } ); ``` ### Promises This library leverages the ES6 promise implementation, which is currently [available in most modern browsers](http://caniuse.com/#feat=promises). If you wish to use it with browsers that do not support the ES6 promise implementation, then I recommend using [a polyfill](https://github.com/jakearchibald/es6-promise). ### Why? I have intentionally limited the production dependencies of this module, so you are not forced to use a particular library. ## API ### MapLoader.load Asynchronously loads the google maps javascript library, given the supplied options. Returns a promise that will be resolved once the google maps loader has finished. Once the promise resolves, it is safe to reference anything under the `google.maps` namespace. This method should only be called once for a given application. ### MapLoader.create Creates a map instance given the supplied options. The options will be passed into the `google.maps.Map` constructor, therefore, all options from the [google maps api](https://developers.google.com/maps/documentation/javascript/reference#MapOptions) can be used. This function returns a promise which will be resolved once the newly created map instance is in the `idle` state, which is the point at which overlays, markers, and geometries can be added to the map.
Asynchronous loading and creation of google maps [![Build Status](https://travis-ci.org/zpratt/async-google-maps.svg)](https://travis-ci.org/zpratt/async-google-maps) ## Running tests 1. Install io.js (needed for jsdom) - `npm i` - `npm test` + + ## Usage + + ```javascript + + var MapLoader = require('async-google-maps'); + + MapLoader.load({ + key: 'some-api-key', + version: '3.20' + }); + + MapLoader.create( + document.querySelector('.map-container'), + { + center: { + lat: 40.0, + lng: -90.0 + }, + zoom: 7 + } + ); + ``` + + ### Promises + + This library leverages the ES6 promise implementation, which is currently [available in most modern browsers](http://caniuse.com/#feat=promises). If you wish to use it with browsers that do not support the ES6 promise implementation, then I recommend using [a polyfill](https://github.com/jakearchibald/es6-promise). + + ### Why? + + I have intentionally limited the production dependencies of this module, so you are not forced to use a particular library. + + ## API + + ### MapLoader.load + + Asynchronously loads the google maps javascript library, given the supplied options. Returns a promise that will be resolved once the google maps loader has finished. Once the promise resolves, it is safe to reference anything under the `google.maps` namespace. This method should only be called once for a given application. + + ### MapLoader.create + + Creates a map instance given the supplied options. The options will be passed into the `google.maps.Map` constructor, therefore, all options from the [google maps api](https://developers.google.com/maps/documentation/javascript/reference#MapOptions) can be used. This function returns a promise which will be resolved once the newly created map instance is in the `idle` state, which is the point at which overlays, markers, and geometries can be added to the map.
41
4.555556
41
0
dffcfb01f093567d0a7a86a527e3b745dc9dd469
de.tototec.sbuild/src/main/scala/de/tototec/sbuild/Path.scala
de.tototec.sbuild/src/main/scala/de/tototec/sbuild/Path.scala
package de.tototec.sbuild import java.io.File object Path { def apply(path: String)(implicit project: Project): File = { val origFile = new File(path) if (origFile.isAbsolute) { origFile.getCanonicalFile } else { val absFile = new File(project.projectDirectory, path) absFile.getCanonicalFile } } }
package de.tototec.sbuild import java.io.File object Path { def apply(path: String, pathes: String*)(implicit project: Project): File = { val file = { val origFile = new File(path) if (origFile.isAbsolute) { origFile.getCanonicalFile } else { val absFile = new File(project.projectDirectory, path) absFile.getCanonicalFile } } if(pathes.isEmpty) { file } else { pathes.foldLeft(file)((f, e) => new File(f, e)) } } }
Support for more than one path segment. All segments will be concatenated.
Support for more than one path segment. All segments will be concatenated.
Scala
apache-2.0
SBuild-org/sbuild,SBuild-org/sbuild
scala
## Code Before: package de.tototec.sbuild import java.io.File object Path { def apply(path: String)(implicit project: Project): File = { val origFile = new File(path) if (origFile.isAbsolute) { origFile.getCanonicalFile } else { val absFile = new File(project.projectDirectory, path) absFile.getCanonicalFile } } } ## Instruction: Support for more than one path segment. All segments will be concatenated. ## Code After: package de.tototec.sbuild import java.io.File object Path { def apply(path: String, pathes: String*)(implicit project: Project): File = { val file = { val origFile = new File(path) if (origFile.isAbsolute) { origFile.getCanonicalFile } else { val absFile = new File(project.projectDirectory, path) absFile.getCanonicalFile } } if(pathes.isEmpty) { file } else { pathes.foldLeft(file)((f, e) => new File(f, e)) } } }
package de.tototec.sbuild import java.io.File object Path { - def apply(path: String)(implicit project: Project): File = { + def apply(path: String, pathes: String*)(implicit project: Project): File = { ? +++++++++++++++++ + val file = { - val origFile = new File(path) + val origFile = new File(path) ? ++ - if (origFile.isAbsolute) { + if (origFile.isAbsolute) { ? ++ - origFile.getCanonicalFile + origFile.getCanonicalFile ? ++ - } else { + } else { ? ++ - val absFile = new File(project.projectDirectory, path) + val absFile = new File(project.projectDirectory, path) ? ++ - absFile.getCanonicalFile + absFile.getCanonicalFile ? ++ + } + } + if(pathes.isEmpty) { + file + } + else { + pathes.foldLeft(file)((f, e) => new File(f, e)) } } }
22
1.375
15
7
5c1ac8fa341e3ac384c9d6533307a4aeba62db3c
app/models/issue_tracker.rb
app/models/issue_tracker.rb
class IssueTracker include Mongoid::Document include Mongoid::Timestamps include HashHelper include Rails.application.routes.url_helpers default_url_options[:host] = Errbit::Application.config.action_mailer.default_url_options[:host] embedded_in :app, :inverse_of => :issue_tracker field :project_id, :type => String field :alt_project_id, :type => String # Specify an alternative project id. e.g. for viewing files field :api_token, :type => String field :account, :type => String field :username, :type => String field :password, :type => String field :ticket_properties, :type => String validate :check_params # Subclasses are responsible for overwriting this method. def check_params; true; end def issue_title err "[#{ err.environment }][#{ err.where }] #{err.message.to_s.truncate(100)}" end # Allows us to set the issue tracker class from a single form. def type; self._type; end def type=(t); self._type=t; end end
class IssueTracker include Mongoid::Document include Mongoid::Timestamps include HashHelper include Rails.application.routes.url_helpers default_url_options[:host] = ActionMailer::Base.default_url_options[:host] embedded_in :app, :inverse_of => :issue_tracker field :project_id, :type => String field :alt_project_id, :type => String # Specify an alternative project id. e.g. for viewing files field :api_token, :type => String field :account, :type => String field :username, :type => String field :password, :type => String field :ticket_properties, :type => String validate :check_params # Subclasses are responsible for overwriting this method. def check_params; true; end def issue_title err "[#{ err.environment }][#{ err.where }] #{err.message.to_s.truncate(100)}" end # Allows us to set the issue tracker class from a single form. def type; self._type; end def type=(t); self._type=t; end end
Fix default_url_options in IssueTracker model
Fix default_url_options in IssueTracker model
Ruby
mit
concordia-publishing-house/errbit,errbit/errbit,accessd/errbit,bonusboxme/errbit,bengler/errbit,diowa/errbit,PeggApp/pegg-errors,deskrock/errbit,wombatsecurity/errbit,rud/errbit,deskrock/errbit,Talentee/errbit,cph/errbit,griff/errbit,sideci-sample/sideci-sample-errbit,ZeusWPI/errbit,wombatsecurity/errbit,disvelop/errbit,chautoni/mingle-errbit,Undev/errbit,cognoa/errbit,steveyken/errbit,Nimonik/errbit,notch8/errbit,lucianosousa/errbit,micred/errbit,mvz/errbit,huangxiangdan/errbit,mikk150/errbit,threatsim/errbit,appdate/errbit,linki/errbit,ndlib/errbit,ZeusWPI/errbit,errbit/errbit,arrowcircle/errbit,14113/errbit-1,damau/errbit,gravity-platform/errbit,notch8/errbit,shyftplan/errbit,bonanza-market/errbit,fxposter/errbit,vinco/errbit,francetv/errbit,salemove/errbit,chautoni/mingle-errbit,otzy007/errbit,fireho/errbit,openSUSE/errbit,rightscale/errbit_old,chautoni/mingle-errbit,micred/errbit,Stackato-Apps/errbit,sinrutina/errbit,apptopia/errbit-pg,Undev/errbit,alphagov/errbit,openSUSE/errbit,3zcurdia/errbit,Stackato-Apps/errbit,jjosten/errbit,jjosten/errbit,subvisual/errbit,griff/errbit,appdate/errbit,steveyken/errbit,huangxiangdan/errbit,lucianosousa/errbit,stevecrozz/errbit,burningpony/errbit,fireho/errbit,diowa/errbit,wombatsecurity/errbit,jaronkk/errbit,fusco/errbit,concordia-publishing-house/errbit,gravity-platform/errbit,Strnadj/errbit,bonusboxme/errbit,startdatelabs/errbit,12spokes/errbit,assetricity/errbit,cph/errbit,fxposter/errbit,Gratzi/pegg-errors,Cloud-Temple/errbit,peertransfer/errbit,disvelop/errbit,jjosten/errbit,rud/errbit,Talentee/errbit,steveyken/errbit,joshuaswilcox/Errbitstrap,vinco/errbit,fusco/errbit,denyago/errbit,ndlib/errbit,threatsim/errbit,otzy007/errbit,threatsim/errbit,disvelop/errbit,arrowcircle/errbit,otzy007/errbit,rightscale/errbit,peertransfer/errbit,shivanibhanwal/errbit,shyftplan/errbit,shivanibhanwal/errbit,peertransfer/errbit,zenjoy/errbit,12spokes/errbit,iFixit/errbit,CarlosCD/errbit,Cloud-Temple/errbit,smonsalve/lacasona-errbit,rightscale/errbit_old,subvisual/errbit,vinco/errbit,14113/errbit-1,rightscale/errbit,Nimonik/errbit,denyago/errbit,apptopia/errbit-pg,pandora2000/errbit,jordoh/errbit,cph/errbit,huangxiangdan/errbit,damau/errbit,felixbuenemann/errbit,subvisual/errbit,mak-it/errbit,concordia-publishing-house/errbit,felixbuenemann/errbit,espnbr/errbit,alphagov/errbit,aurels/errbit,francetv/errbit,espnbr/errbit,Promptus/errbit,shyftplan/errbit,sinrutina/errbit,denyago/errbit,diowa/errbit,arrowcircle/errbit,pallan/errbit,14113/errbit-1,cph/errbit,arrowcircle/errbit,CarlosCD/errbit,cognoa/errbit,appdate/errbit,PeggApp/pegg-errors,accessd/errbit,joshuaswilcox/Errbitstrap,Stackato-Apps/errbit,ninech/errbit,assetricity/errbit,sideci-sample/sideci-sample-errbit,projectdx/errbit,mak-it/errbit,pallan/errbit,francetv/errbit,projectdx/errbit,Gratzi/pegg-errors,smonsalve/lacasona-errbit,Gratzi/pegg-errors,zenjoy/errbit,14113/errbit-1,pandora2000/errbit,accessd/errbit,wombatsecurity/errbit,deskrock/errbit,linki/errbit,CarlosCD/errbit,rightscale/errbit_old,jordoh/errbit,micred/errbit,openSUSE/errbit,KomalDhanwani/errorinspector,fireho/errbit,bonanza-market/errbit,accessd/errbit,Talentee/errbit,stevecrozz/errbit,deskrock/errbit,Undev/errbit,errbit/errbit,concordia-publishing-house/errbit,rightscale/errbit,salemove/errbit,alphagov/errbit,ZeusWPI/errbit,shivanibhanwal/errbit,espnbr/errbit,alphagov/errbit,projectdx/errbit,mikk150/errbit,notch8/errbit,burningpony/errbit,dwilkie/errbit,lucianosousa/errbit,KomalDhanwani/errorinspector,Strnadj/errbit,Talentee/errbit,joshuaswilcox/Errbitstrap,rightscale/errbit_old,sinrutina/errbit,fxposter/errbit,Promptus/errbit,bengler/errbit,3zcurdia/errbit,startdatelabs/errbit,mikk150/errbit,ninech/errbit,cognoa/errbit,jaronkk/errbit,jaronkk/errbit,pandora2000/errbit,PeggApp/pegg-errors,gravity-platform/errbit,burningpony/errbit,Cloud-Temple/errbit,12spokes/errbit,damau/errbit,KomalDhanwani/errorinspector,bonanza-market/errbit,mak-it/errbit,Nimonik/errbit,Promptus/errbit,3zcurdia/errbit,jordoh/errbit,bengler/errbit,rud/errbit,ndlib/errbit,mvz/errbit,iFixit/errbit,mvz/errbit,Strnadj/errbit,stevecrozz/errbit,ninech/errbit,threatsim/errbit,dwilkie/errbit,assetricity/errbit,griff/errbit,apptopia/errbit-pg,fusco/errbit,Undev/errbit,startdatelabs/errbit,felixbuenemann/errbit,salemove/errbit,subvisual/errbit,denyago/errbit,aurels/errbit,iFixit/errbit,dwilkie/errbit,linki/errbit
ruby
## Code Before: class IssueTracker include Mongoid::Document include Mongoid::Timestamps include HashHelper include Rails.application.routes.url_helpers default_url_options[:host] = Errbit::Application.config.action_mailer.default_url_options[:host] embedded_in :app, :inverse_of => :issue_tracker field :project_id, :type => String field :alt_project_id, :type => String # Specify an alternative project id. e.g. for viewing files field :api_token, :type => String field :account, :type => String field :username, :type => String field :password, :type => String field :ticket_properties, :type => String validate :check_params # Subclasses are responsible for overwriting this method. def check_params; true; end def issue_title err "[#{ err.environment }][#{ err.where }] #{err.message.to_s.truncate(100)}" end # Allows us to set the issue tracker class from a single form. def type; self._type; end def type=(t); self._type=t; end end ## Instruction: Fix default_url_options in IssueTracker model ## Code After: class IssueTracker include Mongoid::Document include Mongoid::Timestamps include HashHelper include Rails.application.routes.url_helpers default_url_options[:host] = ActionMailer::Base.default_url_options[:host] embedded_in :app, :inverse_of => :issue_tracker field :project_id, :type => String field :alt_project_id, :type => String # Specify an alternative project id. e.g. for viewing files field :api_token, :type => String field :account, :type => String field :username, :type => String field :password, :type => String field :ticket_properties, :type => String validate :check_params # Subclasses are responsible for overwriting this method. def check_params; true; end def issue_title err "[#{ err.environment }][#{ err.where }] #{err.message.to_s.truncate(100)}" end # Allows us to set the issue tracker class from a single form. def type; self._type; end def type=(t); self._type=t; end end
class IssueTracker include Mongoid::Document include Mongoid::Timestamps include HashHelper include Rails.application.routes.url_helpers - default_url_options[:host] = Errbit::Application.config.action_mailer.default_url_options[:host] ? -------- ------------------- ^^ + default_url_options[:host] = ActionMailer::Base.default_url_options[:host] ? ^ ++++++ embedded_in :app, :inverse_of => :issue_tracker field :project_id, :type => String field :alt_project_id, :type => String # Specify an alternative project id. e.g. for viewing files field :api_token, :type => String field :account, :type => String field :username, :type => String field :password, :type => String field :ticket_properties, :type => String validate :check_params # Subclasses are responsible for overwriting this method. def check_params; true; end def issue_title err "[#{ err.environment }][#{ err.where }] #{err.message.to_s.truncate(100)}" end # Allows us to set the issue tracker class from a single form. def type; self._type; end def type=(t); self._type=t; end end
2
0.064516
1
1
88d61f7dcf260b53099196758a1fd0fc8f144710
test/integration/provisioning/server_client.rb
test/integration/provisioning/server_client.rb
require 'chef/provisioning' require 'chef/provisioning/vagrant_driver' with_driver "vagrant:#{File.dirname(__FILE__)}/../../../vms" machine_batch do [%w(client 11), %w(server 12)].each do |name, ip_suff| machine name do machine_options vagrant_options: { 'vm.box' => 'bento/centos-7.2', 'vm.box_version' => '2.2.9', }, convergence_options: { chef_version: '12.10.24', } add_machine_options vagrant_config: <<-EOF config.vm.network "private_network", ip: "192.168.60.#{ip_suff}" EOF recipe "rdiff-backup-test::#{name}" file('/etc/chef/encrypted_data_bag_secret', File.dirname(__FILE__) + '/../encrypted_data_bag_secret') converge true end end end
require 'chef/provisioning' require 'chef/provisioning/vagrant_driver' with_driver "vagrant:#{File.dirname(__FILE__)}/../../../vms" machine_batch do [%w(client 11), %w(create_server 12)].each do |name, ip_suff| # (host)name can't have underscores machine name.tr('_', '-') do machine_options vagrant_options: { 'vm.box' => 'bento/centos-7.5', }, convergence_options: { chef_version: '13.8.5', } add_machine_options vagrant_config: <<-EOF config.vm.network "private_network", ip: "192.168.60.#{ip_suff}" EOF recipe "rdiff-backup-test::#{name}" file('/etc/chef/encrypted_data_bag_secret', File.dirname(__FILE__) + '/../encrypted_data_bag_secret') converge true end end end
Update and fix Vagrant provisioning
Update and fix Vagrant provisioning
Ruby
apache-2.0
osuosl-cookbooks/rdiff-backup,osuosl-cookbooks/rdiff-backup,osuosl-cookbooks/rdiff-backup,osuosl-cookbooks/rdiff-backup
ruby
## Code Before: require 'chef/provisioning' require 'chef/provisioning/vagrant_driver' with_driver "vagrant:#{File.dirname(__FILE__)}/../../../vms" machine_batch do [%w(client 11), %w(server 12)].each do |name, ip_suff| machine name do machine_options vagrant_options: { 'vm.box' => 'bento/centos-7.2', 'vm.box_version' => '2.2.9', }, convergence_options: { chef_version: '12.10.24', } add_machine_options vagrant_config: <<-EOF config.vm.network "private_network", ip: "192.168.60.#{ip_suff}" EOF recipe "rdiff-backup-test::#{name}" file('/etc/chef/encrypted_data_bag_secret', File.dirname(__FILE__) + '/../encrypted_data_bag_secret') converge true end end end ## Instruction: Update and fix Vagrant provisioning ## Code After: require 'chef/provisioning' require 'chef/provisioning/vagrant_driver' with_driver "vagrant:#{File.dirname(__FILE__)}/../../../vms" machine_batch do [%w(client 11), %w(create_server 12)].each do |name, ip_suff| # (host)name can't have underscores machine name.tr('_', '-') do machine_options vagrant_options: { 'vm.box' => 'bento/centos-7.5', }, convergence_options: { chef_version: '13.8.5', } add_machine_options vagrant_config: <<-EOF config.vm.network "private_network", ip: "192.168.60.#{ip_suff}" EOF recipe "rdiff-backup-test::#{name}" file('/etc/chef/encrypted_data_bag_secret', File.dirname(__FILE__) + '/../encrypted_data_bag_secret') converge true end end end
require 'chef/provisioning' require 'chef/provisioning/vagrant_driver' with_driver "vagrant:#{File.dirname(__FILE__)}/../../../vms" machine_batch do - [%w(client 11), %w(server 12)].each do |name, ip_suff| + [%w(client 11), %w(create_server 12)].each do |name, ip_suff| ? +++++++ - machine name do + # (host)name can't have underscores + machine name.tr('_', '-') do machine_options vagrant_options: { - 'vm.box' => 'bento/centos-7.2', ? ^ + 'vm.box' => 'bento/centos-7.5', ? ^ - 'vm.box_version' => '2.2.9', }, convergence_options: { - chef_version: '12.10.24', ? ^ ^^ ^^ + chef_version: '13.8.5', ? ^ ^ ^ } add_machine_options vagrant_config: <<-EOF config.vm.network "private_network", ip: "192.168.60.#{ip_suff}" EOF recipe "rdiff-backup-test::#{name}" file('/etc/chef/encrypted_data_bag_secret', File.dirname(__FILE__) + '/../encrypted_data_bag_secret') converge true end end end
10
0.384615
5
5
fb0cf55456c142671a8f4603e5ed4e3cc534f1e5
app/src/component/Button.tsx
app/src/component/Button.tsx
import * as React from "react"; import "./style/Button.css"; interface IProps { className?: string; onClick?: () => void; onMouseOver?: () => void; onMouseOut?: () => void; style?: object; type?: string; } export default class extends React.Component<IProps> { public render() { const { children, className, onClick, onMouseOver, onMouseOut, style, type } = this.props; return ( <button className={"Button-container " + className} onClick={(event) => { onClick(); event.stopPropagation(); }} onMouseOver={onMouseOver} onMouseOut={onMouseOut} style={style} type={type} > {children} </button> ); } }
import * as React from "react"; import "./style/Button.css"; interface IProps { className?: string; onClick?: () => void; onMouseOver?: () => void; onMouseOut?: () => void; style?: object; type?: string; } export default class extends React.Component<IProps> { public render() { const { children, className, onClick, onMouseOver, onMouseOut, style, type } = this.props; return ( <button className={"Button-container " + className} onClick={onClick && ((event) => { onClick(); event.stopPropagation(); })} onMouseOver={onMouseOver} onMouseOut={onMouseOut} style={style} type={type} > {children} </button> ); } }
Set undefined to onClick prop when nothing is provided by parent
Set undefined to onClick prop when nothing is provided by parent
TypeScript
mit
raviqqe/code2d,raviqqe/code2d,raviqqe/code2d,raviqqe/code2d
typescript
## Code Before: import * as React from "react"; import "./style/Button.css"; interface IProps { className?: string; onClick?: () => void; onMouseOver?: () => void; onMouseOut?: () => void; style?: object; type?: string; } export default class extends React.Component<IProps> { public render() { const { children, className, onClick, onMouseOver, onMouseOut, style, type } = this.props; return ( <button className={"Button-container " + className} onClick={(event) => { onClick(); event.stopPropagation(); }} onMouseOver={onMouseOver} onMouseOut={onMouseOut} style={style} type={type} > {children} </button> ); } } ## Instruction: Set undefined to onClick prop when nothing is provided by parent ## Code After: import * as React from "react"; import "./style/Button.css"; interface IProps { className?: string; onClick?: () => void; onMouseOver?: () => void; onMouseOut?: () => void; style?: object; type?: string; } export default class extends React.Component<IProps> { public render() { const { children, className, onClick, onMouseOver, onMouseOut, style, type } = this.props; return ( <button className={"Button-container " + className} onClick={onClick && ((event) => { onClick(); event.stopPropagation(); })} onMouseOver={onMouseOver} onMouseOut={onMouseOut} style={style} type={type} > {children} </button> ); } }
import * as React from "react"; import "./style/Button.css"; interface IProps { className?: string; onClick?: () => void; onMouseOver?: () => void; onMouseOut?: () => void; style?: object; type?: string; } export default class extends React.Component<IProps> { public render() { const { children, className, onClick, onMouseOver, onMouseOut, style, type } = this.props; return ( <button className={"Button-container " + className} - onClick={(event) => { + onClick={onClick && ((event) => { ? ++++++++++++ onClick(); event.stopPropagation(); - }} + })} ? + onMouseOver={onMouseOver} onMouseOut={onMouseOut} style={style} type={type} > {children} </button> ); } }
4
0.114286
2
2
006e72ff5a34d6cf326cc98d041a717c38349636
db/migrate/20130221215017_add_description_to_categories.rb
db/migrate/20130221215017_add_description_to_categories.rb
class AddDescriptionToCategories < ActiveRecord::Migration def up add_column :categories, :description, :text, null: true # While we're at it, remove unused columns remove_column :categories, :top1_topic_id remove_column :categories, :top2_topic_id remove_column :categories, :top1_user_id remove_column :categories, :top2_user_id # Migrate excerpts over Category.all.each do |c| post = c.topic.posts.order(:post_number).first PostRevisor.new(post).send(:update_category_description) end end def down remove_column :categories, :description end end
class AddDescriptionToCategories < ActiveRecord::Migration def up add_column :categories, :description, :text, null: true # While we're at it, remove unused columns remove_column :categories, :top1_topic_id remove_column :categories, :top2_topic_id remove_column :categories, :top1_user_id remove_column :categories, :top2_user_id # Migrate excerpts over Category.order('id').each do |c| post = c.topic.posts.order(:post_number).first PostRevisor.new(post).send(:update_category_description) end end def down remove_column :categories, :description end end
Fix migration that does not contain position
Fix migration that does not contain position
Ruby
mit
tadp/learnswift,tadp/learnswift,natefinch/discourse,natefinch/discourse,tadp/learnswift
ruby
## Code Before: class AddDescriptionToCategories < ActiveRecord::Migration def up add_column :categories, :description, :text, null: true # While we're at it, remove unused columns remove_column :categories, :top1_topic_id remove_column :categories, :top2_topic_id remove_column :categories, :top1_user_id remove_column :categories, :top2_user_id # Migrate excerpts over Category.all.each do |c| post = c.topic.posts.order(:post_number).first PostRevisor.new(post).send(:update_category_description) end end def down remove_column :categories, :description end end ## Instruction: Fix migration that does not contain position ## Code After: class AddDescriptionToCategories < ActiveRecord::Migration def up add_column :categories, :description, :text, null: true # While we're at it, remove unused columns remove_column :categories, :top1_topic_id remove_column :categories, :top2_topic_id remove_column :categories, :top1_user_id remove_column :categories, :top2_user_id # Migrate excerpts over Category.order('id').each do |c| post = c.topic.posts.order(:post_number).first PostRevisor.new(post).send(:update_category_description) end end def down remove_column :categories, :description end end
class AddDescriptionToCategories < ActiveRecord::Migration def up add_column :categories, :description, :text, null: true # While we're at it, remove unused columns remove_column :categories, :top1_topic_id remove_column :categories, :top2_topic_id remove_column :categories, :top1_user_id remove_column :categories, :top2_user_id # Migrate excerpts over - Category.all.each do |c| ? ^^^ + Category.order('id').each do |c| ? ^^^^^^^^^^^ post = c.topic.posts.order(:post_number).first PostRevisor.new(post).send(:update_category_description) end end def down remove_column :categories, :description end end
2
0.086957
1
1
b82332ae9f403b34f2a04213c5f6c4122baf06aa
dev/user.clj
dev/user.clj
(ns user (:require [clojure.tools.namespace.repl :as repl] [clojure.walk :refer [macroexpand-all]] [clojure.pprint :refer [pprint]] [clojure.test :as test])) (defonce ^:dynamic *namespaces* ['cats.core-spec 'cats.builtin-spec 'cats.applicative.validation-spec 'cats.monad.identity-spec 'cats.monad.either-spec 'cats.monad.exception-spec 'cats.monad.maybe-spec]) (defn run-tests' [] (apply test/run-tests *namespaces*)) (defn run-tests [& nss] (if (pos? (count nss)) (binding [*namespaces* nss] (repl/refresh :after 'user/run-tests')) (repl/refresh :after 'user/run-tests'))) (defn trace "Asynchronous friendly println variant." [& strings] (locking println (apply println strings))) ;; (require '[cats.core :as m] ;; '[cats.context :as mc] ;; '[cats.monad.either :as either] ;; '[cats.builtin])
(ns user (:require [clojure.tools.namespace.repl :as repl] [clojure.walk :refer [macroexpand-all]] [clojure.pprint :refer [pprint]] [clojure.test :as test])) (defonce ^:dynamic *namespaces* ['cats.core-spec 'cats.builtin-spec 'cats.applicative.validation-spec 'cats.labs.channel-spec 'cats.monad.identity-spec 'cats.monad.either-spec 'cats.monad.exception-spec 'cats.monad.maybe-spec]) (defn run-tests' [] (apply test/run-tests *namespaces*)) (defn run-tests [& nss] (if (pos? (count nss)) (binding [*namespaces* nss] (repl/refresh :after 'user/run-tests')) (repl/refresh :after 'user/run-tests'))) (defn trace "Asynchronous friendly println variant." [& strings] (locking println (apply println strings))) ;; (require '[cats.core :as m] ;; '[cats.context :as mc] ;; '[cats.monad.either :as either] ;; '[cats.builtin])
Add cats.labs.channel-spec to testing namespaces.
Add cats.labs.channel-spec to testing namespaces.
Clojure
bsd-2-clause
tcsavage/cats,OlegTheCat/cats,funcool/cats,mccraigmccraig/cats,alesguzik/cats,yurrriq/cats
clojure
## Code Before: (ns user (:require [clojure.tools.namespace.repl :as repl] [clojure.walk :refer [macroexpand-all]] [clojure.pprint :refer [pprint]] [clojure.test :as test])) (defonce ^:dynamic *namespaces* ['cats.core-spec 'cats.builtin-spec 'cats.applicative.validation-spec 'cats.monad.identity-spec 'cats.monad.either-spec 'cats.monad.exception-spec 'cats.monad.maybe-spec]) (defn run-tests' [] (apply test/run-tests *namespaces*)) (defn run-tests [& nss] (if (pos? (count nss)) (binding [*namespaces* nss] (repl/refresh :after 'user/run-tests')) (repl/refresh :after 'user/run-tests'))) (defn trace "Asynchronous friendly println variant." [& strings] (locking println (apply println strings))) ;; (require '[cats.core :as m] ;; '[cats.context :as mc] ;; '[cats.monad.either :as either] ;; '[cats.builtin]) ## Instruction: Add cats.labs.channel-spec to testing namespaces. ## Code After: (ns user (:require [clojure.tools.namespace.repl :as repl] [clojure.walk :refer [macroexpand-all]] [clojure.pprint :refer [pprint]] [clojure.test :as test])) (defonce ^:dynamic *namespaces* ['cats.core-spec 'cats.builtin-spec 'cats.applicative.validation-spec 'cats.labs.channel-spec 'cats.monad.identity-spec 'cats.monad.either-spec 'cats.monad.exception-spec 'cats.monad.maybe-spec]) (defn run-tests' [] (apply test/run-tests *namespaces*)) (defn run-tests [& nss] (if (pos? (count nss)) (binding [*namespaces* nss] (repl/refresh :after 'user/run-tests')) (repl/refresh :after 'user/run-tests'))) (defn trace "Asynchronous friendly println variant." [& strings] (locking println (apply println strings))) ;; (require '[cats.core :as m] ;; '[cats.context :as mc] ;; '[cats.monad.either :as either] ;; '[cats.builtin])
(ns user (:require [clojure.tools.namespace.repl :as repl] [clojure.walk :refer [macroexpand-all]] [clojure.pprint :refer [pprint]] [clojure.test :as test])) (defonce ^:dynamic *namespaces* ['cats.core-spec 'cats.builtin-spec 'cats.applicative.validation-spec + 'cats.labs.channel-spec 'cats.monad.identity-spec 'cats.monad.either-spec 'cats.monad.exception-spec 'cats.monad.maybe-spec]) (defn run-tests' [] (apply test/run-tests *namespaces*)) (defn run-tests [& nss] (if (pos? (count nss)) (binding [*namespaces* nss] (repl/refresh :after 'user/run-tests')) (repl/refresh :after 'user/run-tests'))) (defn trace "Asynchronous friendly println variant." [& strings] (locking println (apply println strings))) ;; (require '[cats.core :as m] ;; '[cats.context :as mc] ;; '[cats.monad.either :as either] ;; '[cats.builtin])
1
0.027027
1
0
8be5530e1fca59aff42b404b64324b68235bfd87
setup.py
setup.py
from setuptools import setup, find_packages import chagallpy setup( name='chagallpy', version=chagallpy.__version__, packages=find_packages(), license='MIT', description='CHArming GALLEry in PYthon', long_description=open('README.md').read(), author='Jan Pipek', author_email='jan DOT pipek AT gmail COM', url='https://github.com/janpipek/chagallpy', install_requires = [ 'wowp', 'pillow', "jinja2" ], entry_points = { 'console_scripts' : [ 'chagall = chagallpy:generate' ] }, include_package_data = True, package_data = { 'resources': ['*.*'], 'templates': ['*.html'] }, )
from setuptools import setup, find_packages import chagallpy setup( name='chagallpy', version=chagallpy.__version__, packages=find_packages(), license='MIT', description='CHArming GALLEry in PYthon', long_description=open('README.md').read(), author='Jan Pipek', author_email='jan.pipek@gmail.com', url='https://github.com/janpipek/chagallpy', install_requires = [ 'wowp', 'pillow', "jinja2" ], entry_points = { 'console_scripts' : [ 'chagall = chagallpy:generate' ] }, include_package_data = True, package_data = { 'resources': ['*.*'], 'templates': ['*.html'] }, )
Fix email address to be able to upload to pypi
Fix email address to be able to upload to pypi
Python
mit
janpipek/chagallpy,janpipek/chagallpy,janpipek/chagallpy
python
## Code Before: from setuptools import setup, find_packages import chagallpy setup( name='chagallpy', version=chagallpy.__version__, packages=find_packages(), license='MIT', description='CHArming GALLEry in PYthon', long_description=open('README.md').read(), author='Jan Pipek', author_email='jan DOT pipek AT gmail COM', url='https://github.com/janpipek/chagallpy', install_requires = [ 'wowp', 'pillow', "jinja2" ], entry_points = { 'console_scripts' : [ 'chagall = chagallpy:generate' ] }, include_package_data = True, package_data = { 'resources': ['*.*'], 'templates': ['*.html'] }, ) ## Instruction: Fix email address to be able to upload to pypi ## Code After: from setuptools import setup, find_packages import chagallpy setup( name='chagallpy', version=chagallpy.__version__, packages=find_packages(), license='MIT', description='CHArming GALLEry in PYthon', long_description=open('README.md').read(), author='Jan Pipek', author_email='jan.pipek@gmail.com', url='https://github.com/janpipek/chagallpy', install_requires = [ 'wowp', 'pillow', "jinja2" ], entry_points = { 'console_scripts' : [ 'chagall = chagallpy:generate' ] }, include_package_data = True, package_data = { 'resources': ['*.*'], 'templates': ['*.html'] }, )
from setuptools import setup, find_packages import chagallpy setup( name='chagallpy', version=chagallpy.__version__, packages=find_packages(), license='MIT', description='CHArming GALLEry in PYthon', long_description=open('README.md').read(), author='Jan Pipek', - author_email='jan DOT pipek AT gmail COM', ? ^^^^^ ^^^^ ^^^^ + author_email='jan.pipek@gmail.com', ? ^ ^ ^^^^ url='https://github.com/janpipek/chagallpy', install_requires = [ 'wowp', 'pillow', "jinja2" ], entry_points = { 'console_scripts' : [ 'chagall = chagallpy:generate' ] }, include_package_data = True, package_data = { 'resources': ['*.*'], 'templates': ['*.html'] }, )
2
0.08
1
1
3d499ee48fa5fa19c5cfe184371d9eeb70536259
scripts/initialize.sh
scripts/initialize.sh
set -e echo "=> Begin Initialize Script" echo "=> Export NVM path" export NVM_DIR="/usr/local/nvm" echo "=> Load NVM" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" echo "=> Enter Mobile project directory" cd /code/mobilefe echo "=> Run Grunt (this may take a while...)" grunt server
set -e echo "=> Begin Initialize Script" echo "=> Export NVM path" export NVM_DIR="/usr/local/nvm" echo "=> Load NVM" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" echo "=> Enter Mobile project directory" cd /code/mobilefe echo "=> NPM Install" npm install echo "=> Bower Install" bower install echo "=> Run Grunt (this may take a while...)" grunt server
Add npm and bower install
Add npm and bower install
Shell
mit
schoeffman/docker-grunt
shell
## Code Before: set -e echo "=> Begin Initialize Script" echo "=> Export NVM path" export NVM_DIR="/usr/local/nvm" echo "=> Load NVM" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" echo "=> Enter Mobile project directory" cd /code/mobilefe echo "=> Run Grunt (this may take a while...)" grunt server ## Instruction: Add npm and bower install ## Code After: set -e echo "=> Begin Initialize Script" echo "=> Export NVM path" export NVM_DIR="/usr/local/nvm" echo "=> Load NVM" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" echo "=> Enter Mobile project directory" cd /code/mobilefe echo "=> NPM Install" npm install echo "=> Bower Install" bower install echo "=> Run Grunt (this may take a while...)" grunt server
set -e echo "=> Begin Initialize Script" echo "=> Export NVM path" export NVM_DIR="/usr/local/nvm" echo "=> Load NVM" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" echo "=> Enter Mobile project directory" cd /code/mobilefe + echo "=> NPM Install" + npm install + + echo "=> Bower Install" + bower install + echo "=> Run Grunt (this may take a while...)" grunt server
6
0.375
6
0