commit stringlengths 40 40 | old_file stringlengths 4 237 | new_file stringlengths 4 237 | old_contents stringlengths 1 4.24k | new_contents stringlengths 5 4.84k | subject stringlengths 15 778 | message stringlengths 16 6.86k | lang stringlengths 1 30 | license stringclasses 13 values | repos stringlengths 5 116k | config stringlengths 1 30 | content stringlengths 105 8.72k |
|---|---|---|---|---|---|---|---|---|---|---|---|
aaa86f1a80f941844ef835061a22ae282af3e712 | lib/rhythmmml/game.rb | lib/rhythmmml/game.rb | require "gosu"
require "rhythmmml/scene"
module Rhythmmml
class Game < Gosu::Window
attr_reader :mml, :options, :scenes
def initialize(mml, options={})
super(640, 480, false)
self.caption = "Rhythmmml"
@mml = mml
@options = options
@scenes = []
@scenes << Scene::Title.new(self)
end
def update
current_scene.update
end
def draw
current_scene.draw
end
def button_down(id)
case id
when Gosu::KbEscape
close
else
current_scene.button_down(id)
end
end
private
def current_scene
@scenes[0]
end
end
end
| require "gosu"
require "gosu/swig_patches"
require "gosu/patches"
require "rhythmmml/scene"
module Rhythmmml
class Game < Gosu::Window
attr_reader :mml, :options, :scenes
def initialize(mml, options={})
super(640, 480, false)
self.caption = "Rhythmmml"
@mml = mml
@options = options
@scenes = []
@scenes << Scene::Title.new(self)
end
def update
current_scene.update
end
def draw
current_scene.draw
end
def button_down(id)
case id
when Gosu::KbEscape
close
else
current_scene.button_down(id)
end
end
private
def current_scene
@scenes[0]
end
end
end
| Add workaround for NoMethodError in gem package | Add workaround for NoMethodError in gem package
| Ruby | mit | myokoym/rhythmmml | ruby | ## Code Before:
require "gosu"
require "rhythmmml/scene"
module Rhythmmml
class Game < Gosu::Window
attr_reader :mml, :options, :scenes
def initialize(mml, options={})
super(640, 480, false)
self.caption = "Rhythmmml"
@mml = mml
@options = options
@scenes = []
@scenes << Scene::Title.new(self)
end
def update
current_scene.update
end
def draw
current_scene.draw
end
def button_down(id)
case id
when Gosu::KbEscape
close
else
current_scene.button_down(id)
end
end
private
def current_scene
@scenes[0]
end
end
end
## Instruction:
Add workaround for NoMethodError in gem package
## Code After:
require "gosu"
require "gosu/swig_patches"
require "gosu/patches"
require "rhythmmml/scene"
module Rhythmmml
class Game < Gosu::Window
attr_reader :mml, :options, :scenes
def initialize(mml, options={})
super(640, 480, false)
self.caption = "Rhythmmml"
@mml = mml
@options = options
@scenes = []
@scenes << Scene::Title.new(self)
end
def update
current_scene.update
end
def draw
current_scene.draw
end
def button_down(id)
case id
when Gosu::KbEscape
close
else
current_scene.button_down(id)
end
end
private
def current_scene
@scenes[0]
end
end
end
|
1cab84d3f3726df2a7cfe4e5ad8efee81051c73e | tests/test_patched_stream.py | tests/test_patched_stream.py | import nose
import StringIO
import cle
def test_patched_stream():
stream = StringIO.StringIO('0123456789abcdef')
stream1 = cle.PatchedStream(stream, [(2, 'AA')])
stream1.seek(0)
nose.tools.assert_equal(stream1.read(), '01AA456789abcdef')
stream2 = cle.PatchedStream(stream, [(2, 'AA')])
stream2.seek(0)
nose.tools.assert_equal(stream2.read(3), '01A')
stream3 = cle.PatchedStream(stream, [(2, 'AA')])
stream3.seek(3)
nose.tools.assert_equal(stream3.read(3), 'A45')
stream4 = cle.PatchedStream(stream, [(-1, 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')])
stream4.seek(0)
nose.tools.assert_equal(stream4.read(), 'A'*0x10)
| import nose
import StringIO
import os
import cle
tests_path = os.path.join(os.path.dirname(__file__), '..', '..', 'binaries', 'tests')
def test_patched_stream():
stream = StringIO.StringIO('0123456789abcdef')
stream1 = cle.PatchedStream(stream, [(2, 'AA')])
stream1.seek(0)
nose.tools.assert_equal(stream1.read(), '01AA456789abcdef')
stream2 = cle.PatchedStream(stream, [(2, 'AA')])
stream2.seek(0)
nose.tools.assert_equal(stream2.read(3), '01A')
stream3 = cle.PatchedStream(stream, [(2, 'AA')])
stream3.seek(3)
nose.tools.assert_equal(stream3.read(3), 'A45')
stream4 = cle.PatchedStream(stream, [(-1, 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')])
stream4.seek(0)
nose.tools.assert_equal(stream4.read(), 'A'*0x10)
def test_malformed_sections():
ld = cle.Loader(os.path.join(tests_path, 'i386', 'oxfoo1m3'))
nose.tools.assert_equal(len(ld.main_object.segments), 1)
nose.tools.assert_equal(len(ld.main_object.sections), 0)
| Add tests for loading binaries with malformed sections | Add tests for loading binaries with malformed sections
| Python | bsd-2-clause | angr/cle | python | ## Code Before:
import nose
import StringIO
import cle
def test_patched_stream():
stream = StringIO.StringIO('0123456789abcdef')
stream1 = cle.PatchedStream(stream, [(2, 'AA')])
stream1.seek(0)
nose.tools.assert_equal(stream1.read(), '01AA456789abcdef')
stream2 = cle.PatchedStream(stream, [(2, 'AA')])
stream2.seek(0)
nose.tools.assert_equal(stream2.read(3), '01A')
stream3 = cle.PatchedStream(stream, [(2, 'AA')])
stream3.seek(3)
nose.tools.assert_equal(stream3.read(3), 'A45')
stream4 = cle.PatchedStream(stream, [(-1, 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')])
stream4.seek(0)
nose.tools.assert_equal(stream4.read(), 'A'*0x10)
## Instruction:
Add tests for loading binaries with malformed sections
## Code After:
import nose
import StringIO
import os
import cle
tests_path = os.path.join(os.path.dirname(__file__), '..', '..', 'binaries', 'tests')
def test_patched_stream():
stream = StringIO.StringIO('0123456789abcdef')
stream1 = cle.PatchedStream(stream, [(2, 'AA')])
stream1.seek(0)
nose.tools.assert_equal(stream1.read(), '01AA456789abcdef')
stream2 = cle.PatchedStream(stream, [(2, 'AA')])
stream2.seek(0)
nose.tools.assert_equal(stream2.read(3), '01A')
stream3 = cle.PatchedStream(stream, [(2, 'AA')])
stream3.seek(3)
nose.tools.assert_equal(stream3.read(3), 'A45')
stream4 = cle.PatchedStream(stream, [(-1, 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')])
stream4.seek(0)
nose.tools.assert_equal(stream4.read(), 'A'*0x10)
def test_malformed_sections():
ld = cle.Loader(os.path.join(tests_path, 'i386', 'oxfoo1m3'))
nose.tools.assert_equal(len(ld.main_object.segments), 1)
nose.tools.assert_equal(len(ld.main_object.sections), 0)
|
1409cb6f92a80916c7d93e6d5e7e60be4ab3796e | Cargo.toml | Cargo.toml | [package]
name = "perfcnt"
version = "0.7.1"
authors = ["Gerd Zellweger <mail@gerdzellweger.com>", "Brian Martin <bmartin@twitter.com>", "Jens Breitbart <jbreitbart@gmail.com>", "Marshall Pierce <marshall@mpierce.org>"]
description = "Library to configure and read hardware performance counters in rust."
homepage = "https://github.com/gz/rust-perfcnt"
repository = "https://github.com/gz/rust-perfcnt"
documentation = "http://gz.github.io/rust-perfcnt/perfcnt/"
readme = "README.md"
keywords = ["performance", "counter", "events", "pmu", "perf"]
license = "MIT"
edition = '2018'
[dependencies]
bitflags = "1.2.1"
libc = "0.2"
x86 = { version = "0.37.0", features = ["performance-counter"] }
mmap = "0.1.*"
byteorder = "1.3.4"
nom = "4.2.3"
phf = "0.8.0"
[[bin]]
name = "perfcnt-list"
path = "src/bin/list.rs"
[[bin]]
name = "perfcnt-parse"
path = "src/bin/parse.rs"
[[bin]]
name = "perfcnt-stats"
path = "src/bin/stats.rs"
| [package]
name = "perfcnt"
version = "0.7.1"
authors = ["Gerd Zellweger <mail@gerdzellweger.com>", "Brian Martin <bmartin@twitter.com>", "Jens Breitbart <jbreitbart@gmail.com>", "Marshall Pierce <marshall@mpierce.org>"]
description = "Library to configure and read hardware performance counters in rust."
homepage = "https://github.com/gz/rust-perfcnt"
repository = "https://github.com/gz/rust-perfcnt"
documentation = "http://gz.github.io/rust-perfcnt/perfcnt/"
readme = "README.md"
keywords = ["performance", "counter", "events", "pmu", "perf"]
license = "MIT"
edition = '2018'
[dependencies.x86]
version = "0.42.1"
features = ["performance-counter"]
[dependencies]
bitflags = "1.2.1"
libc = "0.2"
mmap = "0.1.*"
byteorder = "1.3.4"
nom = "4.2.3"
phf = "0.8.0"
[[bin]]
name = "perfcnt-list"
path = "src/bin/list.rs"
[[bin]]
name = "perfcnt-parse"
path = "src/bin/parse.rs"
[[bin]]
name = "perfcnt-stats"
path = "src/bin/stats.rs"
| Update to latest x86 deps | cargo: Update to latest x86 deps
| TOML | mit | gz/rust-perfcnt | toml | ## Code Before:
[package]
name = "perfcnt"
version = "0.7.1"
authors = ["Gerd Zellweger <mail@gerdzellweger.com>", "Brian Martin <bmartin@twitter.com>", "Jens Breitbart <jbreitbart@gmail.com>", "Marshall Pierce <marshall@mpierce.org>"]
description = "Library to configure and read hardware performance counters in rust."
homepage = "https://github.com/gz/rust-perfcnt"
repository = "https://github.com/gz/rust-perfcnt"
documentation = "http://gz.github.io/rust-perfcnt/perfcnt/"
readme = "README.md"
keywords = ["performance", "counter", "events", "pmu", "perf"]
license = "MIT"
edition = '2018'
[dependencies]
bitflags = "1.2.1"
libc = "0.2"
x86 = { version = "0.37.0", features = ["performance-counter"] }
mmap = "0.1.*"
byteorder = "1.3.4"
nom = "4.2.3"
phf = "0.8.0"
[[bin]]
name = "perfcnt-list"
path = "src/bin/list.rs"
[[bin]]
name = "perfcnt-parse"
path = "src/bin/parse.rs"
[[bin]]
name = "perfcnt-stats"
path = "src/bin/stats.rs"
## Instruction:
cargo: Update to latest x86 deps
## Code After:
[package]
name = "perfcnt"
version = "0.7.1"
authors = ["Gerd Zellweger <mail@gerdzellweger.com>", "Brian Martin <bmartin@twitter.com>", "Jens Breitbart <jbreitbart@gmail.com>", "Marshall Pierce <marshall@mpierce.org>"]
description = "Library to configure and read hardware performance counters in rust."
homepage = "https://github.com/gz/rust-perfcnt"
repository = "https://github.com/gz/rust-perfcnt"
documentation = "http://gz.github.io/rust-perfcnt/perfcnt/"
readme = "README.md"
keywords = ["performance", "counter", "events", "pmu", "perf"]
license = "MIT"
edition = '2018'
[dependencies.x86]
version = "0.42.1"
features = ["performance-counter"]
[dependencies]
bitflags = "1.2.1"
libc = "0.2"
mmap = "0.1.*"
byteorder = "1.3.4"
nom = "4.2.3"
phf = "0.8.0"
[[bin]]
name = "perfcnt-list"
path = "src/bin/list.rs"
[[bin]]
name = "perfcnt-parse"
path = "src/bin/parse.rs"
[[bin]]
name = "perfcnt-stats"
path = "src/bin/stats.rs"
|
1ba2384d4b04194a3b047ac3652c36eef086c9a8 | .travis.yml | .travis.yml | before_install:
- sudo apt-get -qq update
- sudo apt-get install -y maven javascriptcoregtk-4.0 libglib2.0-dev libzip-dev
- cd planck-cljs
language: clojure
jdk: oraclejdk8
script: cd ../planck-c && make bundle-and-build && ./planck -e'(map inc (range e))'
| before_install:
- sudo apt-get -qq update
- sudo apt-get install -y maven javascriptcoregtk-3.0 libglib2.0-dev libzip-dev libcurl4-gnutls-dev
- cd planck-cljs
dist: trusty
language: clojure
jdk: oraclejdk8
script: cd ../planck-c && make bundle-and-build && ./planck -e '(map inc (range 3))'
| Update Travic CI for Ubuntu 14.04 | Update Travic CI for Ubuntu 14.04
| YAML | epl-1.0 | slipset/planck,slipset/planck,slipset/planck,mfikes/planck,mfikes/planck,mfikes/planck,mfikes/planck,mfikes/planck,slipset/planck,slipset/planck,mfikes/planck | yaml | ## Code Before:
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y maven javascriptcoregtk-4.0 libglib2.0-dev libzip-dev
- cd planck-cljs
language: clojure
jdk: oraclejdk8
script: cd ../planck-c && make bundle-and-build && ./planck -e'(map inc (range e))'
## Instruction:
Update Travic CI for Ubuntu 14.04
## Code After:
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y maven javascriptcoregtk-3.0 libglib2.0-dev libzip-dev libcurl4-gnutls-dev
- cd planck-cljs
dist: trusty
language: clojure
jdk: oraclejdk8
script: cd ../planck-c && make bundle-and-build && ./planck -e '(map inc (range 3))'
|
3da570842c8b130da217d1f29716daf1e72ff2e8 | core/lib/spree/localized_number.rb | core/lib/spree/localized_number.rb | module Spree
class LocalizedNumber
# Strips all non-price-like characters from the number, taking into account locale settings.
def self.parse(number)
return number unless number.is_a?(String)
separator, delimiter = I18n.t([:'number.currency.format.separator', :'number.currency.format.delimiter'])
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
number.gsub!(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number.gsub!(separator, '.') unless separator == '.'
number.to_d
end
end
end
| module Spree
class LocalizedNumber
# Strips all non-price-like characters from the number, taking into account locale settings.
def self.parse(number)
return number unless number.is_a?(String)
separator, delimiter = I18n.t([:'number.currency.format.separator', :'number.currency.format.delimiter'])
non_number_characters = /[^0-9\-#{separator}]/
# work on a copy, prevent original argument modification
number = number.dup
# strip everything else first, including thousands delimiter
number.gsub!(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number.gsub!(separator, '.') unless separator == '.'
number.to_d
end
end
end
| Fix of bug in `Spree::LocalizedNumber.parse`, which mangles object passed as an argument. | Fix of bug in `Spree::LocalizedNumber.parse`, which mangles object passed as an argument.
| Ruby | bsd-3-clause | yushine/spree,yushine/spree,yushine/spree,yushine/spree | ruby | ## Code Before:
module Spree
class LocalizedNumber
# Strips all non-price-like characters from the number, taking into account locale settings.
def self.parse(number)
return number unless number.is_a?(String)
separator, delimiter = I18n.t([:'number.currency.format.separator', :'number.currency.format.delimiter'])
non_number_characters = /[^0-9\-#{separator}]/
# strip everything else first
number.gsub!(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number.gsub!(separator, '.') unless separator == '.'
number.to_d
end
end
end
## Instruction:
Fix of bug in `Spree::LocalizedNumber.parse`, which mangles object passed as an argument.
## Code After:
module Spree
class LocalizedNumber
# Strips all non-price-like characters from the number, taking into account locale settings.
def self.parse(number)
return number unless number.is_a?(String)
separator, delimiter = I18n.t([:'number.currency.format.separator', :'number.currency.format.delimiter'])
non_number_characters = /[^0-9\-#{separator}]/
# work on a copy, prevent original argument modification
number = number.dup
# strip everything else first, including thousands delimiter
number.gsub!(non_number_characters, '')
# then replace the locale-specific decimal separator with the standard separator if necessary
number.gsub!(separator, '.') unless separator == '.'
number.to_d
end
end
end
|
7db3f67cf0bfc8622e81c0523df592cd91f942c3 | stylesheets/components/_content_formatter.scss | stylesheets/components/_content_formatter.scss | // ContentFormatter
//
// Aligns content.
//
// default - Aligns the text to the left
// .ContentFormatter--centerHorizontally - Content is always centered horizontally
// .ContentFormatter--center - Content is always centered horizontally and vertically
//
// markup:
// <div class="ContentFormatter {$modifiers}" style="height: 200px;">
// Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
// </div>
//
// Styleguide 1.11
@import '../reset';
@import '../theme_vars';
.ContentFormatter {
width: 100%; // flex children aren't full width by default
text-align: left;
}
.ContentFormatter.ContentFormatter--centerHorizontally {
text-align: center;
}
.ContentFormatter.ContentFormatter--center {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
| // ContentFormatter
//
// Aligns content.
//
// default - Aligns the text to the left
// .ContentFormatter--centerHorizontally - Content is always centered horizontally
// .ContentFormatter--center - Content is always centered horizontally and vertically
// .ContentFormatter--right - Aligns text to the right
//
// markup:
// <div class="ContentFormatter {$modifiers}" style="height: 200px;">
// Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
// </div>
//
// Styleguide 1.11
@import '../reset';
@import '../theme_vars';
.ContentFormatter {
width: 100%; // flex children aren't full width by default
text-align: left;
}
.ContentFormatter.ContentFormatter--centerHorizontally {
text-align: center;
}
.ContentFormatter.ContentFormatter--center {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.ContentFormatter.ContentFormatter--right {
text-align: right;
}
| Add ContentFormatter modifier to align right | Add ContentFormatter modifier to align right
| SCSS | mit | subvisual/blue,subvisual/blue | scss | ## Code Before:
// ContentFormatter
//
// Aligns content.
//
// default - Aligns the text to the left
// .ContentFormatter--centerHorizontally - Content is always centered horizontally
// .ContentFormatter--center - Content is always centered horizontally and vertically
//
// markup:
// <div class="ContentFormatter {$modifiers}" style="height: 200px;">
// Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
// </div>
//
// Styleguide 1.11
@import '../reset';
@import '../theme_vars';
.ContentFormatter {
width: 100%; // flex children aren't full width by default
text-align: left;
}
.ContentFormatter.ContentFormatter--centerHorizontally {
text-align: center;
}
.ContentFormatter.ContentFormatter--center {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
## Instruction:
Add ContentFormatter modifier to align right
## Code After:
// ContentFormatter
//
// Aligns content.
//
// default - Aligns the text to the left
// .ContentFormatter--centerHorizontally - Content is always centered horizontally
// .ContentFormatter--center - Content is always centered horizontally and vertically
// .ContentFormatter--right - Aligns text to the right
//
// markup:
// <div class="ContentFormatter {$modifiers}" style="height: 200px;">
// Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
// </div>
//
// Styleguide 1.11
@import '../reset';
@import '../theme_vars';
.ContentFormatter {
width: 100%; // flex children aren't full width by default
text-align: left;
}
.ContentFormatter.ContentFormatter--centerHorizontally {
text-align: center;
}
.ContentFormatter.ContentFormatter--center {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.ContentFormatter.ContentFormatter--right {
text-align: right;
}
|
1b6c4f75ba6778292caa275309c60f4ff03d6ff5 | setup.cfg | setup.cfg | [flake8]
ignore = F405
max-line-length = 95
[metadata]
description-file = README.rst
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and 3.
universal=1
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all-files = True
[versioneer]
VCS = git
style = pep440
versionfile_source = metpy/_version.py
versionfile_build = metpy/_version.py
tag_prefix = v
parentdir_prefix = metpy-
[aliases]
test = pytest
| [flake8]
ignore = F405
max-line-length = 95
exclude = metpy/_version.py
[metadata]
description-file = README.rst
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and 3.
universal=1
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all-files = True
[versioneer]
VCS = git
style = pep440
versionfile_source = metpy/_version.py
versionfile_build = metpy/_version.py
tag_prefix = v
parentdir_prefix = metpy-
[aliases]
test = pytest
| Add _version.py to flake8 excludes. | MNT: Add _version.py to flake8 excludes.
This didn't work for me before, but seems to work fine now.
| INI | bsd-3-clause | ahaberlie/MetPy,ShawnMurd/MetPy,ahaberlie/MetPy,jrleeman/MetPy,Unidata/MetPy,Unidata/MetPy,dopplershift/MetPy,jrleeman/MetPy,ahill818/MetPy,dopplershift/MetPy | ini | ## Code Before:
[flake8]
ignore = F405
max-line-length = 95
[metadata]
description-file = README.rst
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and 3.
universal=1
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all-files = True
[versioneer]
VCS = git
style = pep440
versionfile_source = metpy/_version.py
versionfile_build = metpy/_version.py
tag_prefix = v
parentdir_prefix = metpy-
[aliases]
test = pytest
## Instruction:
MNT: Add _version.py to flake8 excludes.
This didn't work for me before, but seems to work fine now.
## Code After:
[flake8]
ignore = F405
max-line-length = 95
exclude = metpy/_version.py
[metadata]
description-file = README.rst
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and 3.
universal=1
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all-files = True
[versioneer]
VCS = git
style = pep440
versionfile_source = metpy/_version.py
versionfile_build = metpy/_version.py
tag_prefix = v
parentdir_prefix = metpy-
[aliases]
test = pytest
|
84a5df4e7ed19943ae142ea34217366fc269eb2c | lib/learn_to_rank/load_search_queries.rb | lib/learn_to_rank/load_search_queries.rb | require "csv"
module LearnToRank
module LoadSearchQueries
def self.from_csv(datafile)
queries = {}
CSV.foreach(datafile, headers: true) do |row|
# Todo change the column names in the query
query = row["searchTerm"].strip
queries[query] ||= []
queries[query] << {
content_id: row["contentId"],
rank: row["avg_rank"],
views: row["views"],
clicks: row["clicks"],
}
end
queries
end
end
end
| require "csv"
module LearnToRank
module LoadSearchQueries
def self.from_csv(datafile)
queries = {}
CSV.foreach(datafile, headers: true) do |row|
# Todo change the column names in the query
query = row["searchTerm"].strip
queries[query] ||= []
queries[query] << {
link: row["link"],
rank: row["avg_rank"],
views: row["views"],
clicks: row["clicks"],
}
end
queries
end
end
end
| Use link field from bigquery | Use link field from bigquery
We don't store content IDs in ecommerce data any more.
| Ruby | mit | alphagov/rummager,alphagov/rummager | ruby | ## Code Before:
require "csv"
module LearnToRank
module LoadSearchQueries
def self.from_csv(datafile)
queries = {}
CSV.foreach(datafile, headers: true) do |row|
# Todo change the column names in the query
query = row["searchTerm"].strip
queries[query] ||= []
queries[query] << {
content_id: row["contentId"],
rank: row["avg_rank"],
views: row["views"],
clicks: row["clicks"],
}
end
queries
end
end
end
## Instruction:
Use link field from bigquery
We don't store content IDs in ecommerce data any more.
## Code After:
require "csv"
module LearnToRank
module LoadSearchQueries
def self.from_csv(datafile)
queries = {}
CSV.foreach(datafile, headers: true) do |row|
# Todo change the column names in the query
query = row["searchTerm"].strip
queries[query] ||= []
queries[query] << {
link: row["link"],
rank: row["avg_rank"],
views: row["views"],
clicks: row["clicks"],
}
end
queries
end
end
end
|
b3d7c61ba74bb4b27757251a16b8be7e3b7c4e7e | library/Respect/Validation/Exceptions/IpException.php | library/Respect/Validation/Exceptions/IpException.php | <?php
namespace Respect\Validation\Exceptions;
class IpException extends ValidationException
{
public static $defaultTemplates = array(
self::MODE_DEFAULT => array(
self::STANDARD => '{{name}} must be an IP address',
),
self::MODE_NEGATIVE => array(
self::STANDARD => '{{name}} must not be an IP address',
)
);
}
| <?php
namespace Respect\Validation\Exceptions;
class IpException extends ValidationException
{
const STANDARD = 0;
const NETWORK_RANGE = 1;
public static $defaultTemplates = array(
self::MODE_DEFAULT => array(
self::STANDARD => '{{name}} must be an IP address',
self::NETWORK_RANGE => '{{name}} must be an IP address in the {{range}} range',
),
self::MODE_NEGATIVE => array(
self::STANDARD => '{{name}} must not be an IP address',
self::NETWORK_RANGE => '{{name}} must not be an IP address in the {{range}} range',
)
);
public function configure($name, array $params=array())
{
if ($params['networkRange']) {
$range = $params['networkRange'];
$message = $range['min'];
if (isset($range['max']))
$message .= '-' . $range['max'];
else
$message .= '/' . $range['mask'];
$params['range'] = $message;
}
return parent::configure($name, $params);
}
public function chooseTemplate()
{
if (!$this->getParam('networkRange'))
return static::STANDARD;
else
return static::NETWORK_RANGE;
}
}
| Fix the exception message when the valitor has a network range | Fix the exception message when the valitor has a network range
| PHP | bsd-3-clause | maliayas/Validation,hudolfhess/Validation,augustohp/Validation,Respect/Validation,mubassirhayat/Validation,riyan8250/Validation,caferrari/Validation,zinovyev/Validation,mrsoto/Validation,Whyounes/Validation,jpjoao/Validation,regdos/Validation,solvire/Validation,Ye-Yong-Chi/Validation,guilhermesiani/Validation,thedavidmeister/Validation,lalocespedes/Validation,osiux/Validation,Respect/Validation,rozehnal/Validation,ahmetgunes/Validation,mta59066/Validation,rogeriopradoj/Validation | php | ## Code Before:
<?php
namespace Respect\Validation\Exceptions;
class IpException extends ValidationException
{
public static $defaultTemplates = array(
self::MODE_DEFAULT => array(
self::STANDARD => '{{name}} must be an IP address',
),
self::MODE_NEGATIVE => array(
self::STANDARD => '{{name}} must not be an IP address',
)
);
}
## Instruction:
Fix the exception message when the valitor has a network range
## Code After:
<?php
namespace Respect\Validation\Exceptions;
class IpException extends ValidationException
{
const STANDARD = 0;
const NETWORK_RANGE = 1;
public static $defaultTemplates = array(
self::MODE_DEFAULT => array(
self::STANDARD => '{{name}} must be an IP address',
self::NETWORK_RANGE => '{{name}} must be an IP address in the {{range}} range',
),
self::MODE_NEGATIVE => array(
self::STANDARD => '{{name}} must not be an IP address',
self::NETWORK_RANGE => '{{name}} must not be an IP address in the {{range}} range',
)
);
public function configure($name, array $params=array())
{
if ($params['networkRange']) {
$range = $params['networkRange'];
$message = $range['min'];
if (isset($range['max']))
$message .= '-' . $range['max'];
else
$message .= '/' . $range['mask'];
$params['range'] = $message;
}
return parent::configure($name, $params);
}
public function chooseTemplate()
{
if (!$this->getParam('networkRange'))
return static::STANDARD;
else
return static::NETWORK_RANGE;
}
}
|
dd453fc6f94b6a7b48d8c29ff99ac413bb8c3510 | README.md | README.md | Movie showtimes around the globe.
[](https://travis-ci.org/anault/projection)
[](http://coveralls.io/r/anault/projection)
<!---
## Installation
Coming soon!
```bash
npm install projection
```
## How to use
```javascript
// Coming soon!
```
##Wanna help?
Any contribution is welcomed!
-->
| Movie showtimes around the globe.
[](https://travis-ci.org/anault/projection)
[](https://coveralls.io/r/anault/projection)
<!---
## Installation
Coming soon!
```bash
npm install projection
```
## How to use
```javascript
// Coming soon!
```
##Wanna help?
Any contribution is welcomed!
-->
| Use shields.io for cuter looking badges | Use shields.io for cuter looking badges | Markdown | mit | anault/projection | markdown | ## Code Before:
Movie showtimes around the globe.
[](https://travis-ci.org/anault/projection)
[](http://coveralls.io/r/anault/projection)
<!---
## Installation
Coming soon!
```bash
npm install projection
```
## How to use
```javascript
// Coming soon!
```
##Wanna help?
Any contribution is welcomed!
-->
## Instruction:
Use shields.io for cuter looking badges
## Code After:
Movie showtimes around the globe.
[](https://travis-ci.org/anault/projection)
[](https://coveralls.io/r/anault/projection)
<!---
## Installation
Coming soon!
```bash
npm install projection
```
## How to use
```javascript
// Coming soon!
```
##Wanna help?
Any contribution is welcomed!
-->
|
5a98c733fe887884f3fbc5fd408fc9184c478d54 | lib/comp_player.rb | lib/comp_player.rb | class CompPlayer
def minimax(board, rules, increment = 10)
return 1000 if rules.won?(board, "X")
return -1000 if rules.won?(board, "O")
return 0 if rules.draw?(board, board.turn)
board.valid_slots.map{ |index| minimax(board.move(index), rules, increment + 10) }.send(board.whose_turn(:max, :min)) + board.whose_turn(-increment, increment)
end
def optimal_move
valid_slots.send(whose_turn(:max_by, :min_by)){|index| move(index).minimax}
end
end | class CompPlayer
def minimax(board, rules, increment = 10)
return 1000 if rules.won?(board, "X")
return -1000 if rules.won?(board, "O")
return 0 if rules.draw?(board, board.turn)
board.valid_slots.map{ |index| minimax(board.move(index), rules, increment + 10) }.send(board.whose_turn(:max, :min)) + board.whose_turn(-increment, increment)
end
def optimal_move(board, rules)
board.valid_slots.send(board.whose_turn(:max_by, :min_by)){|index| minimax(board.move(index), rules)}
end
end | Refactor optimal_move to take in board and rules as parameters | Refactor optimal_move to take in board and rules as parameters
| Ruby | mit | portatlas/tictactoe,portatlas/tictactoe | ruby | ## Code Before:
class CompPlayer
def minimax(board, rules, increment = 10)
return 1000 if rules.won?(board, "X")
return -1000 if rules.won?(board, "O")
return 0 if rules.draw?(board, board.turn)
board.valid_slots.map{ |index| minimax(board.move(index), rules, increment + 10) }.send(board.whose_turn(:max, :min)) + board.whose_turn(-increment, increment)
end
def optimal_move
valid_slots.send(whose_turn(:max_by, :min_by)){|index| move(index).minimax}
end
end
## Instruction:
Refactor optimal_move to take in board and rules as parameters
## Code After:
class CompPlayer
def minimax(board, rules, increment = 10)
return 1000 if rules.won?(board, "X")
return -1000 if rules.won?(board, "O")
return 0 if rules.draw?(board, board.turn)
board.valid_slots.map{ |index| minimax(board.move(index), rules, increment + 10) }.send(board.whose_turn(:max, :min)) + board.whose_turn(-increment, increment)
end
def optimal_move(board, rules)
board.valid_slots.send(board.whose_turn(:max_by, :min_by)){|index| minimax(board.move(index), rules)}
end
end |
60f102d683e36056b08620c37730d921b3aa3393 | README.md | README.md |
0. Download and install [Node.js v7+](https://nodejs.org/en/download/)
1. Open your terminal window and execute these two commands:
```sh
_npm install_
_npm start_
'''
2. Enjoy learning :) |
0. Download and install [Node.js v6+](https://nodejs.org/en/download/)
1. Open your terminal window and execute these two commands:
```sh
_npm install_
_npm start_
```
2. Enjoy learning :)
| Correct error on readme file | Correct error on readme file | Markdown | mit | jesusreal/learn-with-jesus,jesusreal/learn-with-jesus,jesusreal/learn-with-jesus | markdown | ## Code Before:
0. Download and install [Node.js v7+](https://nodejs.org/en/download/)
1. Open your terminal window and execute these two commands:
```sh
_npm install_
_npm start_
'''
2. Enjoy learning :)
## Instruction:
Correct error on readme file
## Code After:
0. Download and install [Node.js v6+](https://nodejs.org/en/download/)
1. Open your terminal window and execute these two commands:
```sh
_npm install_
_npm start_
```
2. Enjoy learning :)
|
3869f66fd10f6f4c70d6897f8b546bd1f60c861d | src/main/java/fr/insee/rmes/utils/CustomXmlEscapingWriterFactory.java | src/main/java/fr/insee/rmes/utils/CustomXmlEscapingWriterFactory.java | package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
return new Writer(){
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
//WARN : the cbuf contains only part of the string = can't validate xml here
String val = "";
for (int i = off; i < len; i++) {
val += cbuf[i];
}
String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
out.write(escapedStr);
}
@Override
public void flush() throws IOException {
out.flush();
}
@Override
public void close() throws IOException {
out.close();
}
};
}
private String escapeHtml(String s) {
return s.replace("&", "&")
.replace(">", ">")
.replace("<", "<")
.replace("\"", """);
}
public Writer createEscapingWriterFor(OutputStream out, String enc) {
throw new IllegalArgumentException("not supported");
}
} | package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.apache.commons.text.StringEscapeUtils;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
return new Writer(){
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
//WARN : the cbuf contains only part of the string = can't validate xml here
String val = "";
for (int i = off; i < len; i++) {
val += cbuf[i];
}
String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
out.write(escapedStr);
}
@Override
public void flush() throws IOException {
out.flush();
}
@Override
public void close() throws IOException {
out.close();
}
};
}
private String escapeHtml(String s) {
s = StringEscapeUtils.unescapeHtml4(s);
return s.replace("&", "&")
.replace(">", ">")
.replace("<", "<")
.replace("\"", """);
}
public Writer createEscapingWriterFor(OutputStream out, String enc) {
throw new IllegalArgumentException("not supported");
}
} | Fix issue with accent escaped in some xml response | Fix issue with accent escaped in some xml response
| Java | mit | FranckCo/Metadata-API | java | ## Code Before:
package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
return new Writer(){
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
//WARN : the cbuf contains only part of the string = can't validate xml here
String val = "";
for (int i = off; i < len; i++) {
val += cbuf[i];
}
String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
out.write(escapedStr);
}
@Override
public void flush() throws IOException {
out.flush();
}
@Override
public void close() throws IOException {
out.close();
}
};
}
private String escapeHtml(String s) {
return s.replace("&", "&")
.replace(">", ">")
.replace("<", "<")
.replace("\"", """);
}
public Writer createEscapingWriterFor(OutputStream out, String enc) {
throw new IllegalArgumentException("not supported");
}
}
## Instruction:
Fix issue with accent escaped in some xml response
## Code After:
package fr.insee.rmes.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
import org.apache.commons.text.StringEscapeUtils;
import org.codehaus.stax2.io.EscapingWriterFactory;
public class CustomXmlEscapingWriterFactory implements EscapingWriterFactory {
public Writer createEscapingWriterFor(final Writer out, String enc) {
return new Writer(){
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
//WARN : the cbuf contains only part of the string = can't validate xml here
String val = "";
for (int i = off; i < len; i++) {
val += cbuf[i];
}
String escapedStr = XmlUtils.encodeXml(escapeHtml(val)); //encode manually some xml tags
out.write(escapedStr);
}
@Override
public void flush() throws IOException {
out.flush();
}
@Override
public void close() throws IOException {
out.close();
}
};
}
private String escapeHtml(String s) {
s = StringEscapeUtils.unescapeHtml4(s);
return s.replace("&", "&")
.replace(">", ">")
.replace("<", "<")
.replace("\"", """);
}
public Writer createEscapingWriterFor(OutputStream out, String enc) {
throw new IllegalArgumentException("not supported");
}
} |
65ecab30698049cbff1411dac8edfabdb940e88f | cmake/Modules/CMakeCOGCXXInformation.cmake | cmake/Modules/CMakeCOGCXXInformation.cmake |
message( STATUS "CMakeCOGCXXInformation.cmake" )
set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )
|
message( STATUS "CMakeCOGCXXInformation.cmake" )
# object extension
set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )
# object compilation
set(
CMAKE_COGCXX_COMPILE_OBJECT
"<CMAKE_COGCXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> <SOURCE>"
)
| Add object compilation rule for COGCXX | Add object compilation rule for COGCXX
| CMake | apache-2.0 | apcountryman/toolchain-parallax_p8x32a | cmake | ## Code Before:
message( STATUS "CMakeCOGCXXInformation.cmake" )
set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )
## Instruction:
Add object compilation rule for COGCXX
## Code After:
message( STATUS "CMakeCOGCXXInformation.cmake" )
# object extension
set( CMAKE_COGCXX_OUTPUT_EXTENSION .cog )
# object compilation
set(
CMAKE_COGCXX_COMPILE_OBJECT
"<CMAKE_COGCXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> <SOURCE>"
)
|
cf74154a34cc30274d791f491da74f9b10aa6a91 | README.md | README.md |
PHP library for connecting with [DoneDone](http://www.getdonedone.com/).
## Installation
Install via composer:
```
composer require manavo/donedone-api-php
```
## Usage
### Get all projects
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$projects = $client->projects();
```
### Get all priority levels
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$priorityLevels = $client->priorityLevels();
```
### Get all people of a project
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$people = $client->project(1234)->people();
```
### Create a new issue
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$project = $client->project(1111);
$issue = new \Manavo\DoneDone\Issue();
$issue->setTitle('Brand new issue!');
$issue->setPriorityLevel(1);
$issue->setFixer(4321);
$issue->setTester(1234);
$addedIssue = $project->addIssue($issue);
``` |
PHP library for connecting with [DoneDone](http://www.getdonedone.com/).
## Installation
Install via composer:
```
composer require manavo/donedone-api-php
```
## Usage
### Get all projects
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$projects = $client->projects();
```
### Get all priority levels
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$priorityLevels = $client->priorityLevels();
```
### Get all people of a project
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$people = $client->project(1234)->people();
```
### Create a new issue
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$project = $client->project(1111);
$issue = new \Manavo\DoneDone\Issue();
$issue->setTitle('Brand new issue!');
$issue->setPriorityLevel(1);
$issue->setFixer(4321);
$issue->setTester(1234);
$issue->addAttachment('/path/to/some/file.md');
$addedIssue = $project->addIssue($issue);
``` | Add example of adding attachments to new issues | Add example of adding attachments to new issues
| Markdown | mit | manavo/donedone-api-php | markdown | ## Code Before:
PHP library for connecting with [DoneDone](http://www.getdonedone.com/).
## Installation
Install via composer:
```
composer require manavo/donedone-api-php
```
## Usage
### Get all projects
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$projects = $client->projects();
```
### Get all priority levels
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$priorityLevels = $client->priorityLevels();
```
### Get all people of a project
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$people = $client->project(1234)->people();
```
### Create a new issue
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$project = $client->project(1111);
$issue = new \Manavo\DoneDone\Issue();
$issue->setTitle('Brand new issue!');
$issue->setPriorityLevel(1);
$issue->setFixer(4321);
$issue->setTester(1234);
$addedIssue = $project->addIssue($issue);
```
## Instruction:
Add example of adding attachments to new issues
## Code After:
PHP library for connecting with [DoneDone](http://www.getdonedone.com/).
## Installation
Install via composer:
```
composer require manavo/donedone-api-php
```
## Usage
### Get all projects
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$projects = $client->projects();
```
### Get all priority levels
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$priorityLevels = $client->priorityLevels();
```
### Get all people of a project
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$people = $client->project(1234)->people();
```
### Create a new issue
```php
$client = new Manavo\DoneDone\Client('team_name', 'username', 'password-or-api_token');
$project = $client->project(1111);
$issue = new \Manavo\DoneDone\Issue();
$issue->setTitle('Brand new issue!');
$issue->setPriorityLevel(1);
$issue->setFixer(4321);
$issue->setTester(1234);
$issue->addAttachment('/path/to/some/file.md');
$addedIssue = $project->addIssue($issue);
``` |
88c71627c1a329b2277ba2a49974a5f8b630ac21 | .travis.yml | .travis.yml | language: php
php:
- 5.5
- 5.6
- 7.0
- 7.1
install: composer require --no-update symfony/http-foundation $SYMFONY_VERSION; composer install
script: vendor/bin/phpunit && vendor/bin/php-cs-fixer fix -v --dry-run
env:
- SYMFONY_VERSION: ~2.8.0
- SYMFONY_VERSION: ~3.2.0
| language: php
php:
- 5.5
- 5.6
- 7.0
- 7.1
install:
- composer require --no-update symfony/http-foundation $SYMFONY_VERSION; composer install
script:
- vendor/bin/phpunit
- vendor/bin/php-cs-fixer fix -v --dry-run
env:
- SYMFONY_VERSION: ~2
- SYMFONY_VERSION: ~3
- SYMFONY_VERSION: ~4
| Add Symfony 4 to test matrix | Add Symfony 4 to test matrix
| YAML | mit | 99designs/http-signatures-php | yaml | ## Code Before:
language: php
php:
- 5.5
- 5.6
- 7.0
- 7.1
install: composer require --no-update symfony/http-foundation $SYMFONY_VERSION; composer install
script: vendor/bin/phpunit && vendor/bin/php-cs-fixer fix -v --dry-run
env:
- SYMFONY_VERSION: ~2.8.0
- SYMFONY_VERSION: ~3.2.0
## Instruction:
Add Symfony 4 to test matrix
## Code After:
language: php
php:
- 5.5
- 5.6
- 7.0
- 7.1
install:
- composer require --no-update symfony/http-foundation $SYMFONY_VERSION; composer install
script:
- vendor/bin/phpunit
- vendor/bin/php-cs-fixer fix -v --dry-run
env:
- SYMFONY_VERSION: ~2
- SYMFONY_VERSION: ~3
- SYMFONY_VERSION: ~4
|
53d069269eba08206fb5a82fba3c73298b6998c9 | lib/horza/core_extensions/string.rb | lib/horza/core_extensions/string.rb | module Horza
module CoreExtensions
module String
def singular?
singularize(:en) == self
end
def plural?
pluralize(:en) == self
end
def symbolize
underscore.to_sym
end
def underscore
gsub(/::/, '/')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.tr('-', '_')
.downcase
end
end
end
end
| module Horza
module CoreExtensions
module String
def singular?
singularize(:en) == self
end
def plural?
pluralize(:en) == self
end
def symbolize
underscore.to_sym
end
end
end
end
| Remove :underscore method as it is not needed or being called. | Remove :underscore method as it is not needed or being called.
Because of the dependency load order, the actual method being
called is the one defined in /active_support/core_ext/string/inflections.rb
| Ruby | mit | pap/horza,onfido/horza | ruby | ## Code Before:
module Horza
module CoreExtensions
module String
def singular?
singularize(:en) == self
end
def plural?
pluralize(:en) == self
end
def symbolize
underscore.to_sym
end
def underscore
gsub(/::/, '/')
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
.tr('-', '_')
.downcase
end
end
end
end
## Instruction:
Remove :underscore method as it is not needed or being called.
Because of the dependency load order, the actual method being
called is the one defined in /active_support/core_ext/string/inflections.rb
## Code After:
module Horza
module CoreExtensions
module String
def singular?
singularize(:en) == self
end
def plural?
pluralize(:en) == self
end
def symbolize
underscore.to_sym
end
end
end
end
|
6262eafdbca8fcc817490560518aa3c38c01e2e2 | services/QrCodeWriter.php | services/QrCodeWriter.php | <?php
namespace Services;
class QrCodeWriter implements TicketPartWriterInterface {
private $writer;
private $outputDirectoryPath;
public function __construct(\BaconQrCode\Writer $writer, $outputDirectoryPath) {
$this->writer = $writer;
$this->outputDirectoryPath = $outputDirectoryPath;
}
public function write(ExpandedReservationInterface $reservation, array $partFilePaths, $printOrderId, $locale) {
$filePath = $this->outputDirectoryPath . '/' . $reservation->unique_id . '_qr.png';
$this->writer->writeFile($reservation->unique_id, $filePath);
$partFilePaths['qr'] = $filePath;
return $partFilePaths;
}
} | <?php
namespace Services;
class QrCodeWriter implements TicketPartWriterInterface {
private $writer;
private $outputDirectoryPath;
public function __construct(\BaconQrCode\Writer $writer, $outputDirectoryPath) {
$this->writer = $writer;
$this->outputDirectoryPath = $outputDirectoryPath;
}
public function write(ExpandedReservationInterface $reservation, array $partFilePaths, $printOrderId, $locale) {
$dataUrl = 'data:image/png;base64,' . base64_encode($this->writer->writeString($reservation->unique_id));
$partFilePaths['qr'] = $dataUrl;
return $partFilePaths;
}
} | Embed QR code as Data URL | Embed QR code as Data URL
| PHP | mit | ssigg/ticketbox-server-php,ssigg/ticketbox-server-php,ssigg/ticketbox-server-php | php | ## Code Before:
<?php
namespace Services;
class QrCodeWriter implements TicketPartWriterInterface {
private $writer;
private $outputDirectoryPath;
public function __construct(\BaconQrCode\Writer $writer, $outputDirectoryPath) {
$this->writer = $writer;
$this->outputDirectoryPath = $outputDirectoryPath;
}
public function write(ExpandedReservationInterface $reservation, array $partFilePaths, $printOrderId, $locale) {
$filePath = $this->outputDirectoryPath . '/' . $reservation->unique_id . '_qr.png';
$this->writer->writeFile($reservation->unique_id, $filePath);
$partFilePaths['qr'] = $filePath;
return $partFilePaths;
}
}
## Instruction:
Embed QR code as Data URL
## Code After:
<?php
namespace Services;
class QrCodeWriter implements TicketPartWriterInterface {
private $writer;
private $outputDirectoryPath;
public function __construct(\BaconQrCode\Writer $writer, $outputDirectoryPath) {
$this->writer = $writer;
$this->outputDirectoryPath = $outputDirectoryPath;
}
public function write(ExpandedReservationInterface $reservation, array $partFilePaths, $printOrderId, $locale) {
$dataUrl = 'data:image/png;base64,' . base64_encode($this->writer->writeString($reservation->unique_id));
$partFilePaths['qr'] = $dataUrl;
return $partFilePaths;
}
} |
a54f2261b6e9fb96f1945fb8cfeda86db79afd6d | src/api-umbrella/admin-ui/app/controllers/stats/base.js | src/api-umbrella/admin-ui/app/controllers/stats/base.js | import Ember from 'ember';
export default Ember.Controller.extend({
tz: jstz.determine().name(),
search: null,
interval: 'day',
prefix: '0/',
region: 'world',
start_at: moment().subtract(29, 'days').format('YYYY-MM-DD'),
end_at: moment().format('YYYY-MM-DD'),
query: JSON.stringify({
condition: 'AND',
rules: [{
field: 'gatekeeper_denied_code',
id: 'gatekeeper_denied_code',
input: 'select',
operator: 'is_null',
type: 'string',
value: null,
}],
}),
beta_analytics: false,
actions: {
submit() {
let query = this.get('query');
query.beginPropertyChanges();
if($('#filter_type_advanced').css('display') === 'none') {
query.set('params.search', '');
query.set('params.query', JSON.stringify($('#query_builder').queryBuilder('getRules')));
} else {
query.set('params.query', '');
query.set('params.search', $('#filter_form input[name=search]').val());
}
query.endPropertyChanges();
},
},
});
| import Ember from 'ember';
export default Ember.Controller.extend({
tz: jstz.determine().name(),
search: '',
interval: 'day',
prefix: '0/',
region: 'world',
start_at: moment().subtract(29, 'days').format('YYYY-MM-DD'),
end_at: moment().format('YYYY-MM-DD'),
query: JSON.stringify({
condition: 'AND',
rules: [{
field: 'gatekeeper_denied_code',
id: 'gatekeeper_denied_code',
input: 'select',
operator: 'is_null',
type: 'string',
value: null,
}],
}),
beta_analytics: false,
actions: {
submit() {
if($('#filter_type_advanced').css('display') === 'none') {
this.set('search', '');
this.set('query', JSON.stringify($('#query_builder').queryBuilder('getRules')));
} else {
this.set('query', '');
this.set('search', $('#filter_form input[name=search]').val());
}
},
},
});
| Fix submitting query builder form params. | Fix submitting query builder form params.
| JavaScript | mit | apinf/api-umbrella,apinf/api-umbrella,NREL/api-umbrella,NREL/api-umbrella,apinf/api-umbrella,apinf/api-umbrella,NREL/api-umbrella,NREL/api-umbrella,apinf/api-umbrella | javascript | ## Code Before:
import Ember from 'ember';
export default Ember.Controller.extend({
tz: jstz.determine().name(),
search: null,
interval: 'day',
prefix: '0/',
region: 'world',
start_at: moment().subtract(29, 'days').format('YYYY-MM-DD'),
end_at: moment().format('YYYY-MM-DD'),
query: JSON.stringify({
condition: 'AND',
rules: [{
field: 'gatekeeper_denied_code',
id: 'gatekeeper_denied_code',
input: 'select',
operator: 'is_null',
type: 'string',
value: null,
}],
}),
beta_analytics: false,
actions: {
submit() {
let query = this.get('query');
query.beginPropertyChanges();
if($('#filter_type_advanced').css('display') === 'none') {
query.set('params.search', '');
query.set('params.query', JSON.stringify($('#query_builder').queryBuilder('getRules')));
} else {
query.set('params.query', '');
query.set('params.search', $('#filter_form input[name=search]').val());
}
query.endPropertyChanges();
},
},
});
## Instruction:
Fix submitting query builder form params.
## Code After:
import Ember from 'ember';
export default Ember.Controller.extend({
tz: jstz.determine().name(),
search: '',
interval: 'day',
prefix: '0/',
region: 'world',
start_at: moment().subtract(29, 'days').format('YYYY-MM-DD'),
end_at: moment().format('YYYY-MM-DD'),
query: JSON.stringify({
condition: 'AND',
rules: [{
field: 'gatekeeper_denied_code',
id: 'gatekeeper_denied_code',
input: 'select',
operator: 'is_null',
type: 'string',
value: null,
}],
}),
beta_analytics: false,
actions: {
submit() {
if($('#filter_type_advanced').css('display') === 'none') {
this.set('search', '');
this.set('query', JSON.stringify($('#query_builder').queryBuilder('getRules')));
} else {
this.set('query', '');
this.set('search', $('#filter_form input[name=search]').val());
}
},
},
});
|
60bc511b1070c7c57e17c8cc4c78a67a99421748 | Frontend/public_django/static/views/topbar.html | Frontend/public_django/static/views/topbar.html | <div ng-controller="topbarCtrl">
<ul class="title-area">
<li class="name">
<h1><a href="/">CorpoChat</a></h1>
</li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li ng-show="show"><a href="#" ng-bind="username"></a</li>
<li ng-hide="show"><a href="#" ng-click="login()"><i class="fi-social-google-plus"></i> Sign in with Google</a></li>
<li ng-show="show"><a href="#" ng-click="logout()"><i class="fi-power"></i> Logout</a></li>
<li><a href="#">About</a></li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li><a href="/"><i class="fi-plus"></i> Join existing room</a></li>
<li>
<a href="/new"><i class="fi-page-add"></i> Create room</a>
</li>
<li class="divider"></li>
<li ng-repeat="room in activeRooms"><a ng-attr-href="/{{room._id}}" ng-bind="room.name">
<i class="fi-lightbulb" ng-show="room.indicator"></i></a>
</li>
</ul>
</section>
</div>
| <div ng-controller="topbarCtrl">
<ul class="title-area">
<li class="name">
<h1><a href="/">CorpoChat</a></h1>
</li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li ng-show="show"><a href="#" ng-bind="username"></a</li>
<li ng-hide="show"><a href="#" ng-click="login()"><i class="fi-social-google-plus"></i> Sign in with Google</a></li>
<li ng-show="show"><a href="#" ng-click="logout()"><i class="fi-power"></i> Logout</a></li>
<li><a href="#">About</a></li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li><a href="/"><i class="fi-plus"></i> Join existing room</a></li>
<li>
<a href="/new"><i class="fi-page-add"></i> Create room</a>
</li>
<li class="divider"></li>
<li ng-repeat="room in activeRooms">
<a ng-attr-href="/{{room._id}}" ng-bind="room.name" class="roomAnchor">
<i class="fi-lightbulb" ng-show="room.indicator"></i>
</a>
</li>
</ul>
</section>
</div>
| Add class for anchor in toolbar | Add class for anchor in toolbar
| HTML | mit | vitoss/Corpo-Chat,vitoss/Corpo-Chat,vitoss/Corpo-Chat,vitoss/Corpo-Chat | html | ## Code Before:
<div ng-controller="topbarCtrl">
<ul class="title-area">
<li class="name">
<h1><a href="/">CorpoChat</a></h1>
</li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li ng-show="show"><a href="#" ng-bind="username"></a</li>
<li ng-hide="show"><a href="#" ng-click="login()"><i class="fi-social-google-plus"></i> Sign in with Google</a></li>
<li ng-show="show"><a href="#" ng-click="logout()"><i class="fi-power"></i> Logout</a></li>
<li><a href="#">About</a></li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li><a href="/"><i class="fi-plus"></i> Join existing room</a></li>
<li>
<a href="/new"><i class="fi-page-add"></i> Create room</a>
</li>
<li class="divider"></li>
<li ng-repeat="room in activeRooms"><a ng-attr-href="/{{room._id}}" ng-bind="room.name">
<i class="fi-lightbulb" ng-show="room.indicator"></i></a>
</li>
</ul>
</section>
</div>
## Instruction:
Add class for anchor in toolbar
## Code After:
<div ng-controller="topbarCtrl">
<ul class="title-area">
<li class="name">
<h1><a href="/">CorpoChat</a></h1>
</li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li ng-show="show"><a href="#" ng-bind="username"></a</li>
<li ng-hide="show"><a href="#" ng-click="login()"><i class="fi-social-google-plus"></i> Sign in with Google</a></li>
<li ng-show="show"><a href="#" ng-click="logout()"><i class="fi-power"></i> Logout</a></li>
<li><a href="#">About</a></li>
</ul>
<!-- Left Nav Section -->
<ul class="left">
<li><a href="/"><i class="fi-plus"></i> Join existing room</a></li>
<li>
<a href="/new"><i class="fi-page-add"></i> Create room</a>
</li>
<li class="divider"></li>
<li ng-repeat="room in activeRooms">
<a ng-attr-href="/{{room._id}}" ng-bind="room.name" class="roomAnchor">
<i class="fi-lightbulb" ng-show="room.indicator"></i>
</a>
</li>
</ul>
</section>
</div>
|
4df134a89071c64e0eb2d945415e557df2a1e78d | server/src/main/java/scoutmgr/server/rest/JaxRsActivator.java | server/src/main/java/scoutmgr/server/rest/JaxRsActivator.java | package scoutmgr.server.rest;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath( "/api" )
public class JaxRsActivator
extends Application
{
@Override
public Set<Class<?>> getClasses()
{
final Set<Class<?>> classes = new HashSet<>();
classes.addAll( super.getClasses() );
classes.add( ScoutmgrSessionRestService.class );
classes.add( ScoutmgrReplicantPollRestService.class );
classes.add( ScoutmgrBadSessionExceptionMapper.class );
return classes;
}
}
| package scoutmgr.server.rest;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath( "/api" )
public class JaxRsActivator
extends Application
{
@Override
public Set<Class<?>> getClasses()
{
final Set<Class<?>> classes = new HashSet<>();
classes.addAll( super.getClasses() );
classes.add( ScoutmgrSessionRestService.class );
classes.add( ScoutmgrReplicantPollRestService.class );
return classes;
}
}
| Remove mapper. Unsure why we are keeping this class at all. | Remove mapper.
Unsure why we are keeping this class at all.
| Java | apache-2.0 | jcosmo/scoutmgr,jcosmo/scoutmgr,jcosmo/scoutmgr | java | ## Code Before:
package scoutmgr.server.rest;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath( "/api" )
public class JaxRsActivator
extends Application
{
@Override
public Set<Class<?>> getClasses()
{
final Set<Class<?>> classes = new HashSet<>();
classes.addAll( super.getClasses() );
classes.add( ScoutmgrSessionRestService.class );
classes.add( ScoutmgrReplicantPollRestService.class );
classes.add( ScoutmgrBadSessionExceptionMapper.class );
return classes;
}
}
## Instruction:
Remove mapper.
Unsure why we are keeping this class at all.
## Code After:
package scoutmgr.server.rest;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath( "/api" )
public class JaxRsActivator
extends Application
{
@Override
public Set<Class<?>> getClasses()
{
final Set<Class<?>> classes = new HashSet<>();
classes.addAll( super.getClasses() );
classes.add( ScoutmgrSessionRestService.class );
classes.add( ScoutmgrReplicantPollRestService.class );
return classes;
}
}
|
cd233a94eeb1e10aef6b3214d0035b00c78b66b9 | src/Interpreter.cpp | src/Interpreter.cpp |
tkom::Interpreter::Interpreter(const std::vector<std::string>& arguments)
{
try
{
modules::ErrorHandler::error("Hello world!");
}
catch (std::exception& e)
{}
modules::ErrorHandler::warning("Hello world!");
modules::ErrorHandler::notice("Hello world!");
// Main program body
}
|
using Interpreter = tkom::Interpreter;
using ErrorHandler = tkom::modules::ErrorHandler;
using Lexer = tkom::modules::Lexer;
Interpreter::Interpreter(const std::vector<std::string>& arguments)
{
try
{
if (arguments.size() < 1)
{
ErrorHandler::error("No input file specified");
}
Lexer lexer(arguments.at(0));
Token token;
do
{
token = lexer.nextToken();
std::cout << tkom::modules::utils::getTokenTypeName(token.type) << " = " << token.value << std::endl;
}
while(token.type != TokenType::Invalid && token.type != TokenType::EndOfFile);
}
catch(ErrorHandler::Exception &e)
{
ErrorHandler::error("Terminating...", true);
}
}
| Create a simple example of file tokenization | Create a simple example of file tokenization
| C++ | mit | mdziekon/eiti-tkom-interpreter,mdziekon/eiti-tkom-interpreter | c++ | ## Code Before:
tkom::Interpreter::Interpreter(const std::vector<std::string>& arguments)
{
try
{
modules::ErrorHandler::error("Hello world!");
}
catch (std::exception& e)
{}
modules::ErrorHandler::warning("Hello world!");
modules::ErrorHandler::notice("Hello world!");
// Main program body
}
## Instruction:
Create a simple example of file tokenization
## Code After:
using Interpreter = tkom::Interpreter;
using ErrorHandler = tkom::modules::ErrorHandler;
using Lexer = tkom::modules::Lexer;
Interpreter::Interpreter(const std::vector<std::string>& arguments)
{
try
{
if (arguments.size() < 1)
{
ErrorHandler::error("No input file specified");
}
Lexer lexer(arguments.at(0));
Token token;
do
{
token = lexer.nextToken();
std::cout << tkom::modules::utils::getTokenTypeName(token.type) << " = " << token.value << std::endl;
}
while(token.type != TokenType::Invalid && token.type != TokenType::EndOfFile);
}
catch(ErrorHandler::Exception &e)
{
ErrorHandler::error("Terminating...", true);
}
}
|
107bc57521c62dd611f4feeb27987e8647381522 | lib/shop_finder/shops/wildberries.rb | lib/shop_finder/shops/wildberries.rb | module ShopFinder
module Shops
class Wildberries
def self.parse_attributes(page)
raise 'Not implemented'
end
def self.parse_images(page)
uri = page.uri
page.search('ul.carousel/li/a').map do |a|
uri.scheme + ':' + a.attributes['rev'].value
end
end
end
end
end | module ShopFinder
module Shops
class Wildberries
def self.parse_attributes(page)
raise 'Not implemented'
end
def self.parse_images(page)
uri = page.uri
page.search('ul.carousel/li/a.enabledZoom').map do |a|
uri.scheme + ':' + a.attributes['rev'].value unless a.attributes['rev'].nil?
end.compact
end
end
end
end | Fix for products having video thumbnail | Fix for products having video thumbnail
| Ruby | mit | dmitryp/shop_finder | ruby | ## Code Before:
module ShopFinder
module Shops
class Wildberries
def self.parse_attributes(page)
raise 'Not implemented'
end
def self.parse_images(page)
uri = page.uri
page.search('ul.carousel/li/a').map do |a|
uri.scheme + ':' + a.attributes['rev'].value
end
end
end
end
end
## Instruction:
Fix for products having video thumbnail
## Code After:
module ShopFinder
module Shops
class Wildberries
def self.parse_attributes(page)
raise 'Not implemented'
end
def self.parse_images(page)
uri = page.uri
page.search('ul.carousel/li/a.enabledZoom').map do |a|
uri.scheme + ':' + a.attributes['rev'].value unless a.attributes['rev'].nil?
end.compact
end
end
end
end |
bb3605bd99892bed37ecb2b6371d2bc88d599e1a | caso/__init__.py | caso/__init__.py |
import pbr.version
__version__ = pbr.version.VersionInfo(
'caso').version_string()
user_agent = "caso/%s" % __version__
|
import pbr.version
__version__ = pbr.version.VersionInfo(
'caso').version_string()
user_agent = "caso/%s (OpenStack)" % __version__
| Include "OpenStack" string in the user agent | Include "OpenStack" string in the user agent
EGI's accounting team requires that we put "OpenStack" in the UA string.
closes IFCA/caso#38
| Python | apache-2.0 | alvarolopez/caso,IFCA/caso,IFCA/caso | python | ## Code Before:
import pbr.version
__version__ = pbr.version.VersionInfo(
'caso').version_string()
user_agent = "caso/%s" % __version__
## Instruction:
Include "OpenStack" string in the user agent
EGI's accounting team requires that we put "OpenStack" in the UA string.
closes IFCA/caso#38
## Code After:
import pbr.version
__version__ = pbr.version.VersionInfo(
'caso').version_string()
user_agent = "caso/%s (OpenStack)" % __version__
|
5604ae9d4b9d00e0c24720056942d94b2cdd3f5d | test/test_people_GET.py | test/test_people_GET.py | from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_people().status_code == 200
def test_header_content_type(self, get_people):
assert_header_value('content-type', 'application/json; charset=UTF-8', get_people().headers)
def test_body(self, get_people):
assert_json_response({'data': [], 'type': 'person_list'}, get_people())
# noinspection PyPep8Naming,PyShadowingNames,PyUnusedLocal
class Test_When_One_Person_Exists(object):
def test_body_should_contain_one_person(self, create_person, get_people):
response = create_person('Frank Stella')
people = get_json_from_response(get_people())['data']
assert len(people) == 1
person = people[0]
person_id = get_identifier_for_created_person(response)
assert person['name'] == 'Frank Stella'
assert person['id'] == person_id
| from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_people().status_code == 200
def test_header_content_type(self, get_people):
assert_header_value('content-type', 'application/json; charset=UTF-8', get_people().headers)
def test_body(self, get_people):
assert_json_response({'data': [], 'type': 'person_list'}, get_people())
# noinspection PyPep8Naming,PyShadowingNames,PyUnusedLocal
class Test_When_One_Person_Exists(object):
def test_body_should_contain_one_person(self, create_person, get_people):
response = create_person('Frank Stella')
people = get_json_from_response(get_people())['data']
assert len(people) == 1
person = people[0]
person_id = get_identifier_for_created_person(response)
assert len(person) == 2
assert person['name'] == 'Frank Stella'
assert person['id'] == person_id
| Add assertion for number of fields on person | Add assertion for number of fields on person
| Python | mit | wileykestner/falcon-sqlalchemy-demo,wileykestner/falcon-sqlalchemy-demo | python | ## Code Before:
from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_people().status_code == 200
def test_header_content_type(self, get_people):
assert_header_value('content-type', 'application/json; charset=UTF-8', get_people().headers)
def test_body(self, get_people):
assert_json_response({'data': [], 'type': 'person_list'}, get_people())
# noinspection PyPep8Naming,PyShadowingNames,PyUnusedLocal
class Test_When_One_Person_Exists(object):
def test_body_should_contain_one_person(self, create_person, get_people):
response = create_person('Frank Stella')
people = get_json_from_response(get_people())['data']
assert len(people) == 1
person = people[0]
person_id = get_identifier_for_created_person(response)
assert person['name'] == 'Frank Stella'
assert person['id'] == person_id
## Instruction:
Add assertion for number of fields on person
## Code After:
from test.utils.assertions import assert_header_value, assert_json_response
from test.utils.helpers import get_json_from_response, get_identifier_for_created_person
# noinspection PyPep8Naming,PyShadowingNames
class Test_When_No_People_Exist(object):
def test_status_code(self, get_people):
assert get_people().status_code == 200
def test_header_content_type(self, get_people):
assert_header_value('content-type', 'application/json; charset=UTF-8', get_people().headers)
def test_body(self, get_people):
assert_json_response({'data': [], 'type': 'person_list'}, get_people())
# noinspection PyPep8Naming,PyShadowingNames,PyUnusedLocal
class Test_When_One_Person_Exists(object):
def test_body_should_contain_one_person(self, create_person, get_people):
response = create_person('Frank Stella')
people = get_json_from_response(get_people())['data']
assert len(people) == 1
person = people[0]
person_id = get_identifier_for_created_person(response)
assert len(person) == 2
assert person['name'] == 'Frank Stella'
assert person['id'] == person_id
|
af35e6b08626d0cf9007613e7084fd5c4a5ac3c9 | tests/phpunit/bootstrap.php | tests/phpunit/bootstrap.php | <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 cc=80; */
/**
* @package omeka
* @subpackage fedora-connector
* @copyright 2012 Rector and Board of Visitors, University of Virginia
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
define('FEDORA_DIR', dirname(dirname(dirname(__FILE__))));
define('FEDORA_TEST_DIR', FEDORA_DIR.'/tests/phpunit');
define('OMEKA_DIR', dirname(dirname(FEDORA_DIR)));
// Bootstrap Omeka.
require_once OMEKA_DIR.'/application/tests/bootstrap.php';
// Laod the base test case.
require_once FEDORA_TEST_DIR.'/cases/FedoraConnector_Case_Default.php';
| <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 cc=80; */
/**
* @package omeka
* @subpackage fedora-connector
* @copyright 2012 Rector and Board of Visitors, University of Virginia
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
define('FEDORA_DIR', dirname(dirname(dirname(__FILE__))));
define('FEDORA_TEST_DIR', FEDORA_DIR.'/tests/phpunit');
define('OMEKA_DIR', dirname(dirname(FEDORA_DIR)));
// Bootstrap Omeka.
require_once OMEKA_DIR.'/application/tests/bootstrap.php';
// Laod the base test case.
require_once FEDORA_TEST_DIR.'/cases/FedoraConnector_Case_Default.php';
require_once FEDORA_DIR . '/libraries/FedoraConnector/AbstractImporter.php';
require_once FEDORA_DIR . '/importers/DC.php';
| Make sure to load the importers. | Make sure to load the importers.
| PHP | apache-2.0 | scholarslab/FedoraConnector,scholarslab/FedoraConnector,yorkulibraries/FedoraConnector,scholarslab/FedoraConnector,yorkulibraries/FedoraConnector,yorkulibraries/FedoraConnector | php | ## Code Before:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 cc=80; */
/**
* @package omeka
* @subpackage fedora-connector
* @copyright 2012 Rector and Board of Visitors, University of Virginia
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
define('FEDORA_DIR', dirname(dirname(dirname(__FILE__))));
define('FEDORA_TEST_DIR', FEDORA_DIR.'/tests/phpunit');
define('OMEKA_DIR', dirname(dirname(FEDORA_DIR)));
// Bootstrap Omeka.
require_once OMEKA_DIR.'/application/tests/bootstrap.php';
// Laod the base test case.
require_once FEDORA_TEST_DIR.'/cases/FedoraConnector_Case_Default.php';
## Instruction:
Make sure to load the importers.
## Code After:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 cc=80; */
/**
* @package omeka
* @subpackage fedora-connector
* @copyright 2012 Rector and Board of Visitors, University of Virginia
* @license http://www.apache.org/licenses/LICENSE-2.0.html
*/
define('FEDORA_DIR', dirname(dirname(dirname(__FILE__))));
define('FEDORA_TEST_DIR', FEDORA_DIR.'/tests/phpunit');
define('OMEKA_DIR', dirname(dirname(FEDORA_DIR)));
// Bootstrap Omeka.
require_once OMEKA_DIR.'/application/tests/bootstrap.php';
// Laod the base test case.
require_once FEDORA_TEST_DIR.'/cases/FedoraConnector_Case_Default.php';
require_once FEDORA_DIR . '/libraries/FedoraConnector/AbstractImporter.php';
require_once FEDORA_DIR . '/importers/DC.php';
|
b2c3414560cc667407bc8492466be4dded002ce3 | CHANGELOG.md | CHANGELOG.md |
- flake8 and pep8 compatible
- Use valid SPDX license expression
# 0.2.1 (November 2016)
- Update Intructions and classifiers
# 0.2.0 (October 2016)
- Change package structure
- Release the app from PyPI
# 0.1.0 (September 2016)
- Initial release | 0.3.0 (April 2016)
------------------
- flake8 and pep8 compatible
- Use valid SPDX license expression
0.2.1 (November 2016)
---------------------
- Update intructions and classifiers
0.2.0 (October 2016)
--------------------
- Change package structure
- Release the app from PyPI
0.1.0 (September 2016)
----------------------
- Initial release | Change formatting and fix typo | Change formatting and fix typo
| Markdown | agpl-3.0 | openmicroscopy/weberror,openmicroscopy/weberror | markdown | ## Code Before:
- flake8 and pep8 compatible
- Use valid SPDX license expression
# 0.2.1 (November 2016)
- Update Intructions and classifiers
# 0.2.0 (October 2016)
- Change package structure
- Release the app from PyPI
# 0.1.0 (September 2016)
- Initial release
## Instruction:
Change formatting and fix typo
## Code After:
0.3.0 (April 2016)
------------------
- flake8 and pep8 compatible
- Use valid SPDX license expression
0.2.1 (November 2016)
---------------------
- Update intructions and classifiers
0.2.0 (October 2016)
--------------------
- Change package structure
- Release the app from PyPI
0.1.0 (September 2016)
----------------------
- Initial release |
dbbca0fb82162a6f73c240d0558af886feaf2c46 | app/controllers/qrcodes_controller.rb | app/controllers/qrcodes_controller.rb | class QrcodesController < ApplicationController
skip_before_filter :authenticate_user!
ALLOWED_PATTERN = /^[a-zA-Z0-9\:\/\-\?\=]{1,255}$/
def show
data = URI.decode(params[:data])
raise "Invalid data" unless data.match(ALLOWED_PATTERN)
png_data = QREncoder.encode(data, :correction => :high).
png(:pixels_per_module => 6, :margin => 1).
to_blob
send_data png_data,
:type => 'image/png',
:disposition => 'inline',
:filename => "#{params[:filename] || data}.png"
end
end
| class QrcodesController < ApplicationController
skip_before_filter :authenticate_user!
ALLOWED_PATTERN = /^[a-zA-Z0-9\:\/\-\?\=]{1,255}$/
def show
data = params[:data]
raise "Invalid data" unless data.match(ALLOWED_PATTERN)
png_data = QREncoder.encode(data, :correction => :high).
png(:pixels_per_module => 6, :margin => 1).
to_blob
send_data png_data,
:type => 'image/png',
:disposition => 'inline',
:filename => "#{params[:filename] || data}.png"
end
end
| Revert "Fixed problem with Google Authenticator / QR Code" | Revert "Fixed problem with Google Authenticator / QR Code"
This reverts commit dbf8989378e881cac489f6d355f021cdb6f60113.
| Ruby | agpl-3.0 | Bitfication/bitfication-full,Bitfication/bitfication-front,Bitfication/bitfication-front,tgautier/bitfication,tgautier/bitfication,Bitfication/bitfication-full,Bitfication/bitfication-full,Bitfication/bitfication-full,Bitfication/bitfication-front,Bitfication/bitfication-front | ruby | ## Code Before:
class QrcodesController < ApplicationController
skip_before_filter :authenticate_user!
ALLOWED_PATTERN = /^[a-zA-Z0-9\:\/\-\?\=]{1,255}$/
def show
data = URI.decode(params[:data])
raise "Invalid data" unless data.match(ALLOWED_PATTERN)
png_data = QREncoder.encode(data, :correction => :high).
png(:pixels_per_module => 6, :margin => 1).
to_blob
send_data png_data,
:type => 'image/png',
:disposition => 'inline',
:filename => "#{params[:filename] || data}.png"
end
end
## Instruction:
Revert "Fixed problem with Google Authenticator / QR Code"
This reverts commit dbf8989378e881cac489f6d355f021cdb6f60113.
## Code After:
class QrcodesController < ApplicationController
skip_before_filter :authenticate_user!
ALLOWED_PATTERN = /^[a-zA-Z0-9\:\/\-\?\=]{1,255}$/
def show
data = params[:data]
raise "Invalid data" unless data.match(ALLOWED_PATTERN)
png_data = QREncoder.encode(data, :correction => :high).
png(:pixels_per_module => 6, :margin => 1).
to_blob
send_data png_data,
:type => 'image/png',
:disposition => 'inline',
:filename => "#{params[:filename] || data}.png"
end
end
|
ccbff358ae3921e8e8c2c7030d97ffdc3d226f5d | app/src/Event/EventDb.php | app/src/Event/EventDb.php | <?php
namespace Event;
use Application\BaseDb;
class EventDb extends BaseDb
{
protected $keyName = 'events';
public function save(EventEntity $event)
{
$data = array(
"url_friendly_name" => $event->getUrlFriendlyName(),
"uri" => $event->getUri(),
"stub" => $event->getStub(),
"verbose_uri" => $event->getVerboseUri()
);
$this->cache->save($this->keyName, $data, 'uri', $event->getUri());
$this->cache->save($this->keyName, $data, 'url_friendly_name', $event->getUrlFriendlyName());
$this->cache->save($this->keyName, $data, 'stub', $event->getStub());
}
}
| <?php
namespace Event;
use Application\BaseDb;
class EventDb extends BaseDb
{
protected $keyName = 'events';
public function save(EventEntity $event)
{
$data = array(
"url_friendly_name" => $event->getUrlFriendlyName(),
"uri" => $event->getUri(),
"stub" => $event->getStub(),
"verbose_uri" => $event->getVerboseUri(),
"name" => $event->getName(),
);
$this->cache->save($this->keyName, $data, 'uri', $event->getUri());
$this->cache->save($this->keyName, $data, 'url_friendly_name', $event->getUrlFriendlyName());
$this->cache->save($this->keyName, $data, 'stub', $event->getStub());
}
}
| Store the event's name in the database | Store the event's name in the database
| PHP | bsd-3-clause | aenglander/joindin-web2,tdutrion/joindin-web2,jozzya/joindin-web2,akrabat/joindin-web2,cal-tec/joindin-web2,studio24/joindin-web2,kazu9su/joindin-web2,rogeriopradoj/joindin-web2,jan2442/joindin-web2,richsage/joindin-web2,jozzya/joindin-web2,dstockto/joindin-web2,jan2442/joindin-web2,phoenixrises/joindin-web2,shaunmza/joindin-web2,shaunmza/joindin-web2,rogeriopradoj/joindin-web2,akrabat/joindin-web2,richsage/joindin-web2,dannym87/joindin-web2,EricHogue/joindin-web2,richsage/joindin-web2,aenglander/joindin-web2,EricHogue/joindin-web2,EricHogue/joindin-web2,studio24/joindin-web2,waterada/joindin-web2,lornajane/web2,waterada/joindin-web2,studio24/joindin-web2,studio24/joindin-web2,waterada/joindin-web2,cal-tec/joindin-web2,lornajane/web2,phoenixrises/joindin-web2,rogeriopradoj/joindin-web2,richsage/joindin-web2,rogeriopradoj/joindin-web2,lornajane/web2,heiglandreas/joindin-web2,jozzya/joindin-web2,joindin/joindin-web2,lornajane/web2,railto/joindin-web2,dstockto/joindin-web2,kazu9su/joindin-web2,jan2442/joindin-web2,aenglander/joindin-web2,heiglandreas/joindin-web2,asgrim/joindin-web2,cal-tec/joindin-web2,liam-wiltshire/joindin-web2,dstockto/joindin-web2,tdutrion/joindin-web2,dannym87/joindin-web2,dannym87/joindin-web2,akrabat/joindin-web2,kazu9su/joindin-web2,akrabat/joindin-web2,phoenixrises/joindin-web2,heiglandreas/joindin-web2,liam-wiltshire/joindin-web2,shaunmza/joindin-web2,railto/joindin-web2,jozzya/joindin-web2,liam-wiltshire/joindin-web2,aenglander/joindin-web2,asgrim/joindin-web2,dannym87/joindin-web2,EricHogue/joindin-web2,asgrim/joindin-web2,heiglandreas/joindin-web2,phoenixrises/joindin-web2,railto/joindin-web2,dstockto/joindin-web2,liam-wiltshire/joindin-web2,jan2442/joindin-web2,waterada/joindin-web2,shaunmza/joindin-web2,joindin/joindin-web2,joindin/joindin-web2,tdutrion/joindin-web2,cal-tec/joindin-web2,joindin/joindin-web2,railto/joindin-web2,asgrim/joindin-web2,tdutrion/joindin-web2 | php | ## Code Before:
<?php
namespace Event;
use Application\BaseDb;
class EventDb extends BaseDb
{
protected $keyName = 'events';
public function save(EventEntity $event)
{
$data = array(
"url_friendly_name" => $event->getUrlFriendlyName(),
"uri" => $event->getUri(),
"stub" => $event->getStub(),
"verbose_uri" => $event->getVerboseUri()
);
$this->cache->save($this->keyName, $data, 'uri', $event->getUri());
$this->cache->save($this->keyName, $data, 'url_friendly_name', $event->getUrlFriendlyName());
$this->cache->save($this->keyName, $data, 'stub', $event->getStub());
}
}
## Instruction:
Store the event's name in the database
## Code After:
<?php
namespace Event;
use Application\BaseDb;
class EventDb extends BaseDb
{
protected $keyName = 'events';
public function save(EventEntity $event)
{
$data = array(
"url_friendly_name" => $event->getUrlFriendlyName(),
"uri" => $event->getUri(),
"stub" => $event->getStub(),
"verbose_uri" => $event->getVerboseUri(),
"name" => $event->getName(),
);
$this->cache->save($this->keyName, $data, 'uri', $event->getUri());
$this->cache->save($this->keyName, $data, 'url_friendly_name', $event->getUrlFriendlyName());
$this->cache->save($this->keyName, $data, 'stub', $event->getStub());
}
}
|
94bab8662a7d6ba6fda72836d6b38a0bf44c0120 | railties/lib/rails/api/generator.rb | railties/lib/rails/api/generator.rb |
require "sdoc"
class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:
RDoc::RDoc.add_generator self
def generate_class_tree_level(classes, visited = {})
# Only process core extensions on the first visit.
if visited.empty?
core_exts, classes = classes.partition { |klass| core_extension?(klass) }
super.unshift([ "Core extensions", "", "", build_core_ext_subtree(core_exts, visited) ])
else
super
end
end
private
def build_core_ext_subtree(classes, visited)
classes.map do |klass|
[ klass.name, klass.document_self_or_methods ? klass.path : "", "",
generate_class_tree_level(klass.classes_and_modules, visited) ]
end
end
def core_extension?(klass)
klass.name != "ActiveSupport" && klass.in_files.any? { |file| file.absolute_name.include?("core_ext") }
end
end
|
require "sdoc"
class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:
RDoc::RDoc.add_generator self
def generate_class_tree_level(classes, visited = {})
# Only process core extensions on the first visit and remove
# Active Storage duplicated classes that are at the top level
# since they aren't nested under a definition of the `ActiveStorage` module.
if visited.empty?
classes = classes.reject { |klass| active_storage?(klass) }
core_exts, classes = classes.partition { |klass| core_extension?(klass) }
super.unshift([ "Core extensions", "", "", build_core_ext_subtree(core_exts, visited) ])
else
super
end
end
private
def build_core_ext_subtree(classes, visited)
classes.map do |klass|
[ klass.name, klass.document_self_or_methods ? klass.path : "", "",
generate_class_tree_level(klass.classes_and_modules, visited) ]
end
end
def core_extension?(klass)
klass.name != "ActiveSupport" && klass.in_files.any? { |file| file.absolute_name.include?("core_ext") }
end
def active_storage?(klass)
klass.name != "ActiveStorage" && klass.in_files.all? { |file| file.absolute_name.include?("active_storage") }
end
end
| Remove Active Storage duplicated classes from the API site | Remove Active Storage duplicated classes from the API site
Since cb5af0d7, some classes that are under Active Storage are now
part of the API site.
However, these classes aren't nested under a definition of the
`ActiveStorage` module but rather name-spaced under it like
`ActiveStorage::Foo`.
Thus, these classes are present both under the ActiveStorage label
and at the root of the site's sidebar so we have to strip out
duplicates.
[ci skip]
| Ruby | mit | untidy-hair/rails,vipulnsward/rails,betesh/rails,iainbeeston/rails,Stellenticket/rails,eileencodes/rails,palkan/rails,notapatch/rails,untidy-hair/rails,kamipo/rails,jeremy/rails,Stellenticket/rails,yalab/rails,georgeclaghorn/rails,illacceptanything/illacceptanything,gfvcastro/rails,Envek/rails,pvalena/rails,tjschuck/rails,assain/rails,flanger001/rails,iainbeeston/rails,starknx/rails,alecspopa/rails,yahonda/rails,printercu/rails,kamipo/rails,Sen-Zhang/rails,jeremy/rails,mechanicles/rails,BlakeWilliams/rails,illacceptanything/illacceptanything,BlakeWilliams/rails,mohitnatoo/rails,gauravtiwari/rails,illacceptanything/illacceptanything,mohitnatoo/rails,Vasfed/rails,schuetzm/rails,lcreid/rails,schuetzm/rails,assain/rails,Stellenticket/rails,kirs/rails-1,rails/rails,Vasfed/rails,betesh/rails,kmayer/rails,bogdanvlviv/rails,fabianoleittes/rails,Edouard-chin/rails,georgeclaghorn/rails,baerjam/rails,prathamesh-sonpatki/rails,notapatch/rails,Sen-Zhang/rails,printercu/rails,joonyou/rails,iainbeeston/rails,Edouard-chin/rails,rails/rails,starknx/rails,utilum/rails,tgxworld/rails,yhirano55/rails,prathamesh-sonpatki/rails,flanger001/rails,printercu/rails,rafaelfranca/omg-rails,bogdanvlviv/rails,rafaelfranca/omg-rails,shioyama/rails,schuetzm/rails,deraru/rails,EmmaB/rails-1,repinel/rails,brchristian/rails,BlakeWilliams/rails,yasslab/railsguides.jp,illacceptanything/illacceptanything,starknx/rails,alecspopa/rails,jeremy/rails,notapatch/rails,repinel/rails,gauravtiwari/rails,felipecvo/rails,arunagw/rails,vipulnsward/rails,georgeclaghorn/rails,eileencodes/rails,flanger001/rails,mohitnatoo/rails,joonyou/rails,tgxworld/rails,odedniv/rails,pvalena/rails,gauravtiwari/rails,kmcphillips/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,schuetzm/rails,mechanicles/rails,MSP-Greg/rails,notapatch/rails,palkan/rails,Edouard-chin/rails,yasslab/railsguides.jp,yahonda/rails,repinel/rails,gfvcastro/rails,yalab/rails,esparta/rails,utilum/rails,tjschuck/rails,joonyou/rails,aditya-kapoor/rails,iainbeeston/rails,Stellenticket/rails,assain/rails,yhirano55/rails,vipulnsward/rails,mechanicles/rails,MSP-Greg/rails,yawboakye/rails,arunagw/rails,fabianoleittes/rails,yawboakye/rails,tgxworld/rails,illacceptanything/illacceptanything,Envek/rails,kddeisz/rails,EmmaB/rails-1,illacceptanything/illacceptanything,illacceptanything/illacceptanything,arunagw/rails,odedniv/rails,repinel/rails,prathamesh-sonpatki/rails,esparta/rails,felipecvo/rails,fabianoleittes/rails,Sen-Zhang/rails,rails/rails,eileencodes/rails,illacceptanything/illacceptanything,jeremy/rails,kmayer/rails,georgeclaghorn/rails,utilum/rails,yahonda/rails,yahonda/rails,lcreid/rails,deraru/rails,lcreid/rails,travisofthenorth/rails,esparta/rails,EmmaB/rails-1,aditya-kapoor/rails,yalab/rails,illacceptanything/illacceptanything,baerjam/rails,kmcphillips/rails,betesh/rails,arunagw/rails,illacceptanything/illacceptanything,palkan/rails,kddeisz/rails,rails/rails,aditya-kapoor/rails,shioyama/rails,kddeisz/rails,kirs/rails-1,tjschuck/rails,mohitnatoo/rails,yhirano55/rails,felipecvo/rails,travisofthenorth/rails,pvalena/rails,Envek/rails,illacceptanything/illacceptanything,Erol/rails,yawboakye/rails,assain/rails,flanger001/rails,tjschuck/rails,kirs/rails-1,tgxworld/rails,alecspopa/rails,kamipo/rails,Vasfed/rails,palkan/rails,esparta/rails,deraru/rails,vipulnsward/rails,prathamesh-sonpatki/rails,travisofthenorth/rails,odedniv/rails,yalab/rails,utilum/rails,Vasfed/rails,shioyama/rails,Erol/rails,yasslab/railsguides.jp,rafaelfranca/omg-rails,eileencodes/rails,aditya-kapoor/rails,Erol/rails,MSP-Greg/rails,yasslab/railsguides.jp,joonyou/rails,kmcphillips/rails,mechanicles/rails,shioyama/rails,travisofthenorth/rails,illacceptanything/illacceptanything,fabianoleittes/rails,Edouard-chin/rails,bogdanvlviv/rails,deraru/rails,bogdanvlviv/rails,lcreid/rails,brchristian/rails,gfvcastro/rails,printercu/rails,illacceptanything/illacceptanything,kddeisz/rails,yhirano55/rails,untidy-hair/rails,kmayer/rails,kmcphillips/rails,yawboakye/rails,untidy-hair/rails,gfvcastro/rails,Erol/rails,Envek/rails,brchristian/rails,baerjam/rails,MSP-Greg/rails,betesh/rails,pvalena/rails,BlakeWilliams/rails,baerjam/rails | ruby | ## Code Before:
require "sdoc"
class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:
RDoc::RDoc.add_generator self
def generate_class_tree_level(classes, visited = {})
# Only process core extensions on the first visit.
if visited.empty?
core_exts, classes = classes.partition { |klass| core_extension?(klass) }
super.unshift([ "Core extensions", "", "", build_core_ext_subtree(core_exts, visited) ])
else
super
end
end
private
def build_core_ext_subtree(classes, visited)
classes.map do |klass|
[ klass.name, klass.document_self_or_methods ? klass.path : "", "",
generate_class_tree_level(klass.classes_and_modules, visited) ]
end
end
def core_extension?(klass)
klass.name != "ActiveSupport" && klass.in_files.any? { |file| file.absolute_name.include?("core_ext") }
end
end
## Instruction:
Remove Active Storage duplicated classes from the API site
Since cb5af0d7, some classes that are under Active Storage are now
part of the API site.
However, these classes aren't nested under a definition of the
`ActiveStorage` module but rather name-spaced under it like
`ActiveStorage::Foo`.
Thus, these classes are present both under the ActiveStorage label
and at the root of the site's sidebar so we have to strip out
duplicates.
[ci skip]
## Code After:
require "sdoc"
class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:
RDoc::RDoc.add_generator self
def generate_class_tree_level(classes, visited = {})
# Only process core extensions on the first visit and remove
# Active Storage duplicated classes that are at the top level
# since they aren't nested under a definition of the `ActiveStorage` module.
if visited.empty?
classes = classes.reject { |klass| active_storage?(klass) }
core_exts, classes = classes.partition { |klass| core_extension?(klass) }
super.unshift([ "Core extensions", "", "", build_core_ext_subtree(core_exts, visited) ])
else
super
end
end
private
def build_core_ext_subtree(classes, visited)
classes.map do |klass|
[ klass.name, klass.document_self_or_methods ? klass.path : "", "",
generate_class_tree_level(klass.classes_and_modules, visited) ]
end
end
def core_extension?(klass)
klass.name != "ActiveSupport" && klass.in_files.any? { |file| file.absolute_name.include?("core_ext") }
end
def active_storage?(klass)
klass.name != "ActiveStorage" && klass.in_files.all? { |file| file.absolute_name.include?("active_storage") }
end
end
|
cfefe1cc30bc70c6de38f4c13d0b2c3adaf7fd4d | README.md | README.md | Robot Code 2015 [](https://travis-ci.org/HarkerRobo/RobotCode2015)
==============
## Robot Code for 2015
### Installation Instructions
#### For OSX/Linux
1. Clone the repository. (If you are having trouble here please learn how to GitHub first)
2. You're good to go! Have fun :)
#### For PC
Sadly it's not so simple... yet
1. Clone the repository. (If you are having trouble here please learn how to GitHub first)
2. Then, get the latest copy of HarkerRoboLib (link [here](https://github.com/HarkerRobo/HarkerRoboLib/))
3. Go into the build.xml file of the Robot Code project and follow the instructions in the comments.
4. Find the line that reads
```<arg value="/PATH/TO/ROBOLIB/HarkerRoboLib/src/" />``` and change the path to reflect the direction to the HarkerRoboLib source directory. This is VERY important. The code will not compile and will be very angry with you and spew lots of errors. [James Clark](http://en.wikipedia.org/wiki/James_Clark_(XML_expert)) will cry. Don't do that to him.
4. You're good to go! Have fun :)
| Robot Code 2015 [](https://travis-ci.org/HarkerRobo/RobotCode2015)
==============
## Robot Code for 2015
### Installation Instructions
1. Clone the repository. (If you are having trouble here please learn how to GitHub first)
2. You're good to go! Have fun :)
| Update for recent portability improvements | Update for recent portability improvements | Markdown | apache-2.0 | HarkerRobo/drive-core,HarkerRobo/drive-core,HarkerRobo/drive-core,HarkerRobo/drive-core | markdown | ## Code Before:
Robot Code 2015 [](https://travis-ci.org/HarkerRobo/RobotCode2015)
==============
## Robot Code for 2015
### Installation Instructions
#### For OSX/Linux
1. Clone the repository. (If you are having trouble here please learn how to GitHub first)
2. You're good to go! Have fun :)
#### For PC
Sadly it's not so simple... yet
1. Clone the repository. (If you are having trouble here please learn how to GitHub first)
2. Then, get the latest copy of HarkerRoboLib (link [here](https://github.com/HarkerRobo/HarkerRoboLib/))
3. Go into the build.xml file of the Robot Code project and follow the instructions in the comments.
4. Find the line that reads
```<arg value="/PATH/TO/ROBOLIB/HarkerRoboLib/src/" />``` and change the path to reflect the direction to the HarkerRoboLib source directory. This is VERY important. The code will not compile and will be very angry with you and spew lots of errors. [James Clark](http://en.wikipedia.org/wiki/James_Clark_(XML_expert)) will cry. Don't do that to him.
4. You're good to go! Have fun :)
## Instruction:
Update for recent portability improvements
## Code After:
Robot Code 2015 [](https://travis-ci.org/HarkerRobo/RobotCode2015)
==============
## Robot Code for 2015
### Installation Instructions
1. Clone the repository. (If you are having trouble here please learn how to GitHub first)
2. You're good to go! Have fun :)
|
85ba499463cb350fb5ecbdfef82b84d8b8d1b5be | scripts/postinstall.js | scripts/postinstall.js | const shell = require('shelljs');
const path = require('path');
const { rebuild } = require('electron-rebuild');
function rebuildModules(buildPath) {
if (process.platform === 'darwin') {
return rebuild({
buildPath,
// eslint-disable-next-line
electronVersion: require('electron/package.json').version,
extraModules: [],
force: true,
types: ['prod', 'optional'],
});
}
}
async function run() {
shell.cd('npm-package');
shell.exec('yarn');
shell.cd('-');
await rebuildModules(path.resolve(__dirname, '..'));
shell.cd('dist');
shell.exec('yarn');
await rebuildModules(path.resolve(__dirname, '../dist'));
shell.rm(
'-rf',
'node_modules/*/{example,examples,test,tests,*.md,*.markdown,CHANGELOG*,.*,Makefile}'
);
// eslint-disable-next-line
require('./patch-modules');
}
run();
| const shell = require('shelljs');
const path = require('path');
const { rebuild } = require('electron-rebuild');
function rebuildModules(buildPath) {
if (process.platform === 'darwin') {
return rebuild({
buildPath,
// eslint-disable-next-line
electronVersion: require('electron/package.json').version,
extraModules: [],
force: true,
types: ['prod', 'optional'],
});
}
}
async function run() {
shell.cd('npm-package');
shell.exec('yarn');
shell.cd('-');
await rebuildModules(path.resolve(__dirname, '..'));
shell.cd('dist');
shell.exec('yarn');
await rebuildModules(path.resolve(__dirname, '../dist'));
shell.rm(
'-rf',
'node_modules/*/{example,examples,test,tests,*.md,*.markdown,CHANGELOG*,.*,Makefile}'
);
// Remove unnecessary files in apollo-client-devtools
shell.rm(
'-rf',
'node_modules/apollo-client-devtools/{assets,build,development,shells/dev,src}'
);
// eslint-disable-next-line
require('./patch-modules');
}
run();
| Remove more unnecessary files in dist/node_modules/ | Remove more unnecessary files in dist/node_modules/
| JavaScript | mit | jhen0409/react-native-debugger,jhen0409/react-native-debugger,jhen0409/react-native-debugger | javascript | ## Code Before:
const shell = require('shelljs');
const path = require('path');
const { rebuild } = require('electron-rebuild');
function rebuildModules(buildPath) {
if (process.platform === 'darwin') {
return rebuild({
buildPath,
// eslint-disable-next-line
electronVersion: require('electron/package.json').version,
extraModules: [],
force: true,
types: ['prod', 'optional'],
});
}
}
async function run() {
shell.cd('npm-package');
shell.exec('yarn');
shell.cd('-');
await rebuildModules(path.resolve(__dirname, '..'));
shell.cd('dist');
shell.exec('yarn');
await rebuildModules(path.resolve(__dirname, '../dist'));
shell.rm(
'-rf',
'node_modules/*/{example,examples,test,tests,*.md,*.markdown,CHANGELOG*,.*,Makefile}'
);
// eslint-disable-next-line
require('./patch-modules');
}
run();
## Instruction:
Remove more unnecessary files in dist/node_modules/
## Code After:
const shell = require('shelljs');
const path = require('path');
const { rebuild } = require('electron-rebuild');
function rebuildModules(buildPath) {
if (process.platform === 'darwin') {
return rebuild({
buildPath,
// eslint-disable-next-line
electronVersion: require('electron/package.json').version,
extraModules: [],
force: true,
types: ['prod', 'optional'],
});
}
}
async function run() {
shell.cd('npm-package');
shell.exec('yarn');
shell.cd('-');
await rebuildModules(path.resolve(__dirname, '..'));
shell.cd('dist');
shell.exec('yarn');
await rebuildModules(path.resolve(__dirname, '../dist'));
shell.rm(
'-rf',
'node_modules/*/{example,examples,test,tests,*.md,*.markdown,CHANGELOG*,.*,Makefile}'
);
// Remove unnecessary files in apollo-client-devtools
shell.rm(
'-rf',
'node_modules/apollo-client-devtools/{assets,build,development,shells/dev,src}'
);
// eslint-disable-next-line
require('./patch-modules');
}
run();
|
8c9e06632c57ac71044c59bffa5b63107f8a8361 | database.default.yml | database.default.yml | production:
dsn: <%= ENV['DATABASE_URL'] || ENV.select{|k|k=~/^HEROKU_POSTGRESQL_\w+_URL/}.to_a[0][1] %>
development:
dsn: sqlite3://<%= root %>/db/development.sqlite3
test:
dsn: <%= ENV['DATABASE_URL'] || "sqlite3://#{root}/db/test.sqlite3" %>
| production:
dsn: <%= ENV['DATABASE_URL'] %>
development:
dsn: sqlite3://<%= root %>/db/development.sqlite3
test:
dsn: <%= ENV['DATABASE_URL'] || "sqlite3://#{root}/db/test.sqlite3" %>
| Remove dsn that it is only for heroku | Remove dsn that it is only for heroku
| YAML | mit | lokka/lokka,fjordllc/jobs-fjord-jp,kmamiya/lokka,hrysd/lokka,komagata/docs-komagata-org,komagata/docs-komagata-org,fjordllc/blog-kowabana-jp,morygonzalez/portalshit.net,willnet/lokka,machida/zurui-book,morygonzalez/lokka,fjordllc/blog-kowabana-jp,morygonzalez/lokka,morygonzalez/portalshit.net,lokka/lokka,hrysd/lokka,jiikko/blog,fukajun/lokka,lokka/lokka,fjordllc/jobs-fjord-jp,kmamiya/lokka,jiikko/blog,morygonzalez/portalshit.net,komagata/docs-komagata-org,willnet/lokka,fukajun/lokka,machida/zurui-book,komagata/docs-komagata-org,lokka/lokka,jiikko/blog,willnet/lokka,jiikko/blog,morygonzalez/lokka,fukajun/lokka,kmamiya/lokka,morygonzalez/portalshit.net | yaml | ## Code Before:
production:
dsn: <%= ENV['DATABASE_URL'] || ENV.select{|k|k=~/^HEROKU_POSTGRESQL_\w+_URL/}.to_a[0][1] %>
development:
dsn: sqlite3://<%= root %>/db/development.sqlite3
test:
dsn: <%= ENV['DATABASE_URL'] || "sqlite3://#{root}/db/test.sqlite3" %>
## Instruction:
Remove dsn that it is only for heroku
## Code After:
production:
dsn: <%= ENV['DATABASE_URL'] %>
development:
dsn: sqlite3://<%= root %>/db/development.sqlite3
test:
dsn: <%= ENV['DATABASE_URL'] || "sqlite3://#{root}/db/test.sqlite3" %>
|
33da566804c1521d829cbc6e81b5aa237170cd8a | frontend/src/app/config.js | frontend/src/app/config.js | export default {
experimentsURL: '/api/experiments.json',
usageCountsURL: '/api/experiments/usage_counts.json'
};
| export default {
experimentsURL: '/api/experiments.json',
usageCountsURL: 'https://analysis-output.telemetry.mozilla.org/testpilot/data/installation-counts/latest.json'
};
| Switch to Telemetry data for experiment usage counts | Switch to Telemetry data for experiment usage counts
Issue #1039
| JavaScript | mpl-2.0 | mozilla/idea-town,6a68/testpilot,lmorchard/testpilot,mozilla/testpilot,clouserw/testpilot,mozilla/testpilot,fzzzy/testpilot,clouserw/testpilot,flodolo/testpilot,mozilla/idea-town-server,mozilla/idea-town-server,chuckharmston/testpilot,dannycoates/testpilot,meandavejustice/testpilot,mozilla/idea-town-server,fzzzy/testpilot,6a68/idea-town,flodolo/testpilot,6a68/testpilot,6a68/idea-town,meandavejustice/testpilot,mathjazz/testpilot,meandavejustice/testpilot,meandavejustice/testpilot,flodolo/testpilot,mozilla/testpilot,mozilla/idea-town,dannycoates/testpilot,lmorchard/idea-town,fzzzy/testpilot,lmorchard/idea-town,mozilla/testpilot,lmorchard/idea-town,mathjazz/testpilot,mozilla/idea-town,clouserw/testpilot,lmorchard/testpilot,lmorchard/idea-town-server,lmorchard/idea-town-server,lmorchard/idea-town,lmorchard/idea-town-server,lmorchard/idea-town-server,chuckharmston/testpilot,mathjazz/testpilot,mathjazz/testpilot,6a68/idea-town,dannycoates/testpilot,mozilla/idea-town-server,flodolo/testpilot,6a68/testpilot,dannycoates/testpilot,lmorchard/testpilot,6a68/testpilot,chuckharmston/testpilot,clouserw/testpilot,chuckharmston/testpilot,fzzzy/testpilot,lmorchard/testpilot,mozilla/idea-town,6a68/idea-town | javascript | ## Code Before:
export default {
experimentsURL: '/api/experiments.json',
usageCountsURL: '/api/experiments/usage_counts.json'
};
## Instruction:
Switch to Telemetry data for experiment usage counts
Issue #1039
## Code After:
export default {
experimentsURL: '/api/experiments.json',
usageCountsURL: 'https://analysis-output.telemetry.mozilla.org/testpilot/data/installation-counts/latest.json'
};
|
2565d252ecb9aeee3fde9850f0a671c7bf8b78d3 | _config.yml | _config.yml | destination: ./_site
lsi: false
port: 4000
highligher: true
markdown: rdiscount
permalink: pretty
paginate: 3
paginate_path: "archive/page:num/"
rdiscount:
extensions: [smart]
| destination: ./_site
lsi: false
port: 4000
highligher: true
markdown: rdiscount
permalink: pretty
baseurl: http://www.bradwestness.com/
paginate: 3
paginate_path: "archive/page:num/"
rdiscount:
extensions: [smart]
| Add baseurl site configuration value | Add baseurl site configuration value
| YAML | mit | bradwestness/bradwestness.github.io,bradwestness/bradwestness.github.io,bradwestness/bradwestness.github.io | yaml | ## Code Before:
destination: ./_site
lsi: false
port: 4000
highligher: true
markdown: rdiscount
permalink: pretty
paginate: 3
paginate_path: "archive/page:num/"
rdiscount:
extensions: [smart]
## Instruction:
Add baseurl site configuration value
## Code After:
destination: ./_site
lsi: false
port: 4000
highligher: true
markdown: rdiscount
permalink: pretty
baseurl: http://www.bradwestness.com/
paginate: 3
paginate_path: "archive/page:num/"
rdiscount:
extensions: [smart]
|
ee0e138c637eead114c38c7059cefdad3fdd663b | .travis.yml | .travis.yml | dist: trusty
sudo: false
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
script:
- CXX=/usr/bin/g++-5 CC=/usr/bin/gcc-5 cmake . -D ENABLE_COVERAGE:BOOL=TRUE
- cmake --build . -- -j2
- ctest -j2
- bash <(curl -s https://codecov.io/bash)
| dist: trusty
sudo: false
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
script:
- CXX=/usr/bin/g++-5 CC=/usr/bin/gcc-5 -D ENABLE_COVERAGE:BOOL=TRUE cmake .
- cmake --build . -- -j2
- ctest -j2
- bash <(curl -s https://codecov.io/bash)
| Fix order of defines for cmake | Fix order of defines for cmake
| YAML | unlicense | lefticus/cpp_starter_project | yaml | ## Code Before:
dist: trusty
sudo: false
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
script:
- CXX=/usr/bin/g++-5 CC=/usr/bin/gcc-5 cmake . -D ENABLE_COVERAGE:BOOL=TRUE
- cmake --build . -- -j2
- ctest -j2
- bash <(curl -s https://codecov.io/bash)
## Instruction:
Fix order of defines for cmake
## Code After:
dist: trusty
sudo: false
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
script:
- CXX=/usr/bin/g++-5 CC=/usr/bin/gcc-5 -D ENABLE_COVERAGE:BOOL=TRUE cmake .
- cmake --build . -- -j2
- ctest -j2
- bash <(curl -s https://codecov.io/bash)
|
4541e857ccb7e750a7d090344951d301b7727a33 | vim/vim.symlink/ftplugin/tex.vim | vim/vim.symlink/ftplugin/tex.vim | " vimlatex macros
call IMAP('DDpart', '\frac{\partial <++>}{\partial <++>}<++>', 'tex')
" conceal
set cole=2
let g:tex_conceal= 'adgm'
hi Conceal gui=BOLD guibg=#1e1e27 guifg=#c080d0
| " vimlatex macros
call IMAP('DDpart', '\frac{\partial <++>}{\partial <++>}<++>', 'tex')
call IMAP('FRFIG', "\<C-r>=FloatRowFig(2)\<CR>", 'tex')
function! FloatRowFig(cols)
let cols = a:cols
let ffigbox =
\ "\\ffigbox{\<CR>" .
\ "\\caption{<+caption text+>}\<CR>" .
\ "\\label{fig:<+label+>}\<CR>" .
\ "}\<CR>" .
\ "{\\includegraphics[width=".string(1.0/cols)."\\textwidth]{<+file+>}}\<CR>"
let ffigboxes = ''
for i in range(1,cols)
let ffigboxes = ffigboxes . ffigbox
endfor
return IMAP_PutTextWithMovement(
\ "\\begin{figure}[<+Hhtpb+>]\<CR>" .
\ "\\begin{floatrow}\<CR>" .
\ "\\centering\<CR>" .
\ ffigboxes .
\ "\\end{floatrow}\<CR>" .
\ "\\end{figure}<++>"
\ )
endfunction
" conceal
set cole=2
let g:tex_conceal= 'adgm'
hi Conceal gui=BOLD guibg=#1e1e27 guifg=#c080d0
| Add FRFIG IMAP for fig float row | vim: Add FRFIG IMAP for fig float row
| VimL | mit | mhelmer/dotfiles,mhelmer/dotfiles,mhelmer/dotfiles | viml | ## Code Before:
" vimlatex macros
call IMAP('DDpart', '\frac{\partial <++>}{\partial <++>}<++>', 'tex')
" conceal
set cole=2
let g:tex_conceal= 'adgm'
hi Conceal gui=BOLD guibg=#1e1e27 guifg=#c080d0
## Instruction:
vim: Add FRFIG IMAP for fig float row
## Code After:
" vimlatex macros
call IMAP('DDpart', '\frac{\partial <++>}{\partial <++>}<++>', 'tex')
call IMAP('FRFIG', "\<C-r>=FloatRowFig(2)\<CR>", 'tex')
function! FloatRowFig(cols)
let cols = a:cols
let ffigbox =
\ "\\ffigbox{\<CR>" .
\ "\\caption{<+caption text+>}\<CR>" .
\ "\\label{fig:<+label+>}\<CR>" .
\ "}\<CR>" .
\ "{\\includegraphics[width=".string(1.0/cols)."\\textwidth]{<+file+>}}\<CR>"
let ffigboxes = ''
for i in range(1,cols)
let ffigboxes = ffigboxes . ffigbox
endfor
return IMAP_PutTextWithMovement(
\ "\\begin{figure}[<+Hhtpb+>]\<CR>" .
\ "\\begin{floatrow}\<CR>" .
\ "\\centering\<CR>" .
\ ffigboxes .
\ "\\end{floatrow}\<CR>" .
\ "\\end{figure}<++>"
\ )
endfunction
" conceal
set cole=2
let g:tex_conceal= 'adgm'
hi Conceal gui=BOLD guibg=#1e1e27 guifg=#c080d0
|
de110bc460c69ed23a1e30b8f9391c68c23b7570 | README.md | README.md |
Easily stream G-code to your 3D printer!
```
$ npm install -g gstream
$ gtream file.gcode
```
|
Easily stream G-code to your 3D printer!
```
$ npm install -g gstream
$ gstream
Connected to printer!
> M105
< ok T:17.3 /0.0 B:0.0 /0.0 T0:17.3 /0.0 T1:21.9 /0.0 T2:38.0 /0.0 @:0 B@:0
```
| Send 1 real gcode manually for example :hurtrealbad: | Send 1 real gcode manually for example :hurtrealbad:
| Markdown | mit | skalnik/gstream | markdown | ## Code Before:
Easily stream G-code to your 3D printer!
```
$ npm install -g gstream
$ gtream file.gcode
```
## Instruction:
Send 1 real gcode manually for example :hurtrealbad:
## Code After:
Easily stream G-code to your 3D printer!
```
$ npm install -g gstream
$ gstream
Connected to printer!
> M105
< ok T:17.3 /0.0 B:0.0 /0.0 T0:17.3 /0.0 T1:21.9 /0.0 T2:38.0 /0.0 @:0 B@:0
```
|
ee9f7925b2a972c31626bf871889a455436d974c | project/plugins.sbt | project/plugins.sbt | resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
resolvers += "maven" at "http://repo1.maven.org/maven2/"
resolvers += Classpaths.sbtPluginReleases
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.20")
| resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
resolvers += "maven" at "http://repo1.maven.org/maven2/"
resolvers += Classpaths.sbtPluginReleases
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC5")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.20")
| Add coursier plugin to speed up build | Add coursier plugin to speed up build
Summary: Problem/Solution:
Use coursier sbt plugin for a better Artifact Fetching, reduce sbt build time.
Result:
Build time down to 40 mins on average now.
JIRA Issues: CSL-4742
Differential Revision: https://phabricator.twitter.biz/D64117
| Scala | apache-2.0 | twitter/scrooge,twitter/scrooge,twitter/scrooge,twitter/scrooge | scala | ## Code Before:
resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
resolvers += "maven" at "http://repo1.maven.org/maven2/"
resolvers += Classpaths.sbtPluginReleases
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.20")
## Instruction:
Add coursier plugin to speed up build
Summary: Problem/Solution:
Use coursier sbt plugin for a better Artifact Fetching, reduce sbt build time.
Result:
Build time down to 40 mins on average now.
JIRA Issues: CSL-4742
Differential Revision: https://phabricator.twitter.biz/D64117
## Code After:
resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
resolvers += "maven" at "http://repo1.maven.org/maven2/"
resolvers += Classpaths.sbtPluginReleases
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC5")
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.20")
|
911efc673b4c6020bef0351a148d6559640501ec | app/mailers/invitations_mailer.rb | app/mailers/invitations_mailer.rb | class InvitationsMailer < ApplicationMailer
def invitation_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
@days_to_confirm = Setting.get.days_to_confirm_invitation
mail(to: email, subject: 'Confirm your Rails Girls Kraków 2017 participation!')
@contact_email = contact_email
end
def reminder_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
mail(to: email, subject: 'Your invitation link expires soon!')
@contact_email = contact_email
end
end
| class InvitationsMailer < ApplicationMailer
def invitation_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
@days_to_confirm = Setting.get.days_to_confirm_invitation
@contact_email = contact_email
mail(to: email, subject: 'Confirm your Rails Girls Kraków 2017 participation!')
end
def reminder_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
@contact_email = contact_email
mail(to: email, subject: 'Your invitation link expires soon!')
end
end
| Fix showing contact_mail in mails | [168] Fix showing contact_mail in mails
| Ruby | mit | LunarLogic/rails-girls-submissions,LunarLogic/rails-girls-submissions,LunarLogic/rails-girls-submissions | ruby | ## Code Before:
class InvitationsMailer < ApplicationMailer
def invitation_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
@days_to_confirm = Setting.get.days_to_confirm_invitation
mail(to: email, subject: 'Confirm your Rails Girls Kraków 2017 participation!')
@contact_email = contact_email
end
def reminder_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
mail(to: email, subject: 'Your invitation link expires soon!')
@contact_email = contact_email
end
end
## Instruction:
[168] Fix showing contact_mail in mails
## Code After:
class InvitationsMailer < ApplicationMailer
def invitation_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
@days_to_confirm = Setting.get.days_to_confirm_invitation
@contact_email = contact_email
mail(to: email, subject: 'Confirm your Rails Girls Kraków 2017 participation!')
end
def reminder_email(submission, event_dates, event_venue, contact_email)
email = submission.email
@token = submission.invitation_token
@event_dates = event_dates
@event_venue = event_venue
@contact_email = contact_email
mail(to: email, subject: 'Your invitation link expires soon!')
end
end
|
f0a7d8fb874bb91769a3309b427053dd04385df0 | src/docs/deployment/amazon-s3.md | src/docs/deployment/amazon-s3.md | ---
layout: docs
title: Deploying to Amazon S3 bucket
---
# Deploying to Amazon S3 bucket
Amazon S3 deployment provider copies all or selected artifacts to Amazon S3 storage.
## Provider settings
* **Access key ID** (`access_key_id`) - AWS account access key.
* **Secret access key** (`secret_access_key`) - AWS secret access key.
* **Bucket name** (`bucket`) - the name of bucket to copy artifacts to.
* **Region** (`region`) - AWS region where the bucket is located.
* **Folder** (`folder`) - name of folder to copy to.
* **Artifact** (`artifact`) - name of artifact to copy.
Configuring in `appveyor.yml`:
```yaml
deploy:
provider: S3
access_key_id:
secret_access_key:
bucket:
region: eu-west-1
set_public: true|false (disabled by default)
folder:
artifact:
```
| ---
layout: docs
title: Deploying to Amazon S3 bucket
---
# Deploying to Amazon S3 bucket
Amazon S3 deployment provider copies all or selected artifacts to Amazon S3 storage.
## Provider settings
* **Access key ID** (`access_key_id`) - AWS account access key.
* **Secret access key** (`secret_access_key`) - AWS secret access key.
* **Bucket name** (`bucket`) - the name of bucket to copy artifacts to.
* **Region** (`region`) - AWS region where the bucket is located.
* **Folder** (`folder`) - name of folder to copy to.
* **Artifact** (`artifact`) - name of artifact to copy.
* **Enable public access to published S3 objects** (`set_public`) - Default is `false`.
* **Enable server-side encryption (AES-256)** (`encrypt`) - Default is `false`.
* **Use Reduced Redundancy Storage** (`reduced_redundancy`) - Default is `false`.
* **Retry attempts** (`max_error_retry`) - Number of times provider will retry after a failure. Default is `0`.
Configuring in `appveyor.yml`:
```yaml
deploy:
provider: S3
access_key_id:
secret_access_key:
bucket:
region: eu-west-1
set_public: true|false (disabled by default)
folder:
artifact:
```
| Add missed Amazon S3 settings | Add missed Amazon S3 settings | Markdown | mit | appveyor/website,appveyor/website,appveyor/website | markdown | ## Code Before:
---
layout: docs
title: Deploying to Amazon S3 bucket
---
# Deploying to Amazon S3 bucket
Amazon S3 deployment provider copies all or selected artifacts to Amazon S3 storage.
## Provider settings
* **Access key ID** (`access_key_id`) - AWS account access key.
* **Secret access key** (`secret_access_key`) - AWS secret access key.
* **Bucket name** (`bucket`) - the name of bucket to copy artifacts to.
* **Region** (`region`) - AWS region where the bucket is located.
* **Folder** (`folder`) - name of folder to copy to.
* **Artifact** (`artifact`) - name of artifact to copy.
Configuring in `appveyor.yml`:
```yaml
deploy:
provider: S3
access_key_id:
secret_access_key:
bucket:
region: eu-west-1
set_public: true|false (disabled by default)
folder:
artifact:
```
## Instruction:
Add missed Amazon S3 settings
## Code After:
---
layout: docs
title: Deploying to Amazon S3 bucket
---
# Deploying to Amazon S3 bucket
Amazon S3 deployment provider copies all or selected artifacts to Amazon S3 storage.
## Provider settings
* **Access key ID** (`access_key_id`) - AWS account access key.
* **Secret access key** (`secret_access_key`) - AWS secret access key.
* **Bucket name** (`bucket`) - the name of bucket to copy artifacts to.
* **Region** (`region`) - AWS region where the bucket is located.
* **Folder** (`folder`) - name of folder to copy to.
* **Artifact** (`artifact`) - name of artifact to copy.
* **Enable public access to published S3 objects** (`set_public`) - Default is `false`.
* **Enable server-side encryption (AES-256)** (`encrypt`) - Default is `false`.
* **Use Reduced Redundancy Storage** (`reduced_redundancy`) - Default is `false`.
* **Retry attempts** (`max_error_retry`) - Number of times provider will retry after a failure. Default is `0`.
Configuring in `appveyor.yml`:
```yaml
deploy:
provider: S3
access_key_id:
secret_access_key:
bucket:
region: eu-west-1
set_public: true|false (disabled by default)
folder:
artifact:
```
|
e4e1aea52f777ccab644d2980f5989106630cdb6 | h2o-docs/source/developuser/rest.rst | h2o-docs/source/developuser/rest.rst |
REST/JSON API
-------------
Data ingestion
""""""""""""""
.. Disable ImportFiles2 for now.
.. DocGen/ImportFiles2
.. toctree::
:maxdepth: 1
DocGen/Parse2
Algorithms
""""""""""""""
.. toctree::
:maxdepth: 1
DocGen/DRF2
DocGen/GBM
DocGen/GLM2
DocGen/KMeans2
DocGen/Summary2
|
REST/JSON API
-------------
Data ingestion
""""""""""""""
.. Disable ImportFiles2 for now.
.. DocGen/ImportFiles2
.. toctree::
:maxdepth: 1
DocGen/Parse2
Algorithms
""""""""""""""
.. toctree::
:maxdepth: 1
DocGen/DRF2
DocGen/GBM
DocGen/GLM2
DocGen/KMeans2
| Remove warning about building Summary2. | Remove warning about building Summary2.
| reStructuredText | apache-2.0 | elkingtonmcb/h2o-2,vbelakov/h2o,eg-zhang/h2o-2,calvingit21/h2o-2,100star/h2o,rowhit/h2o-2,h2oai/h2o,rowhit/h2o-2,eg-zhang/h2o-2,111t8e/h2o-2,vbelakov/h2o,100star/h2o,111t8e/h2o-2,elkingtonmcb/h2o-2,111t8e/h2o-2,eg-zhang/h2o-2,h2oai/h2o,eg-zhang/h2o-2,h2oai/h2o-2,h2oai/h2o-2,100star/h2o,111t8e/h2o-2,111t8e/h2o-2,eg-zhang/h2o-2,elkingtonmcb/h2o-2,h2oai/h2o-2,calvingit21/h2o-2,eg-zhang/h2o-2,111t8e/h2o-2,h2oai/h2o-2,calvingit21/h2o-2,eg-zhang/h2o-2,rowhit/h2o-2,eg-zhang/h2o-2,111t8e/h2o-2,calvingit21/h2o-2,h2oai/h2o,111t8e/h2o-2,100star/h2o,elkingtonmcb/h2o-2,calvingit21/h2o-2,calvingit21/h2o-2,h2oai/h2o,vbelakov/h2o,h2oai/h2o-2,h2oai/h2o-2,vbelakov/h2o,elkingtonmcb/h2o-2,100star/h2o,rowhit/h2o-2,100star/h2o,elkingtonmcb/h2o-2,rowhit/h2o-2,calvingit21/h2o-2,vbelakov/h2o,vbelakov/h2o,h2oai/h2o,rowhit/h2o-2,vbelakov/h2o,rowhit/h2o-2,rowhit/h2o-2,calvingit21/h2o-2,rowhit/h2o-2,calvingit21/h2o-2,elkingtonmcb/h2o-2,vbelakov/h2o,eg-zhang/h2o-2,111t8e/h2o-2,h2oai/h2o-2,h2oai/h2o-2,100star/h2o,h2oai/h2o,elkingtonmcb/h2o-2,calvingit21/h2o-2,h2oai/h2o,elkingtonmcb/h2o-2,eg-zhang/h2o-2,h2oai/h2o,h2oai/h2o-2,h2oai/h2o-2,elkingtonmcb/h2o-2,rowhit/h2o-2,h2oai/h2o,vbelakov/h2o,100star/h2o,100star/h2o,111t8e/h2o-2,vbelakov/h2o,h2oai/h2o | restructuredtext | ## Code Before:
REST/JSON API
-------------
Data ingestion
""""""""""""""
.. Disable ImportFiles2 for now.
.. DocGen/ImportFiles2
.. toctree::
:maxdepth: 1
DocGen/Parse2
Algorithms
""""""""""""""
.. toctree::
:maxdepth: 1
DocGen/DRF2
DocGen/GBM
DocGen/GLM2
DocGen/KMeans2
DocGen/Summary2
## Instruction:
Remove warning about building Summary2.
## Code After:
REST/JSON API
-------------
Data ingestion
""""""""""""""
.. Disable ImportFiles2 for now.
.. DocGen/ImportFiles2
.. toctree::
:maxdepth: 1
DocGen/Parse2
Algorithms
""""""""""""""
.. toctree::
:maxdepth: 1
DocGen/DRF2
DocGen/GBM
DocGen/GLM2
DocGen/KMeans2
|
adda4b54973d99eb68db02ff7c9170a7072903e6 | test/test_helper.rb | test/test_helper.rb | require 'test/unit'
require 'fileutils'
$:.unshift("#{File.dirname(__FILE__)}/../lib")
# Ensure the app root is empty
FileUtils.rm_rf('test/app_root')
FileUtils.mkdir('test/app_root')
# Use an in-memory log so that the app root can be removed without having to
# close all loggers in use
require 'logger'
require 'stringio'
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(StringIO.new))
Test::Unit::TestCase.class_eval do
private
def assert_valid_environment
assert_not_nil ApplicationController
assert ActiveRecord::Base.connection.active?
end
def setup_app(name)
FileUtils.cp_r(Dir["test/app_roots/#{name}/*"], 'test/app_root')
# Load the environment
load 'plugin_test_helper.rb'
assert_valid_environment
end
def teardown_app
# Clear dependencies
self.class.use_transactional_fixtures = false
ActiveRecord::Base.reset_subclasses
Dependencies.clear
# Reset open streams
ActiveRecord::Base.clear_reloadable_connections!
# Forget that the environment files were loaded so that a new app environment
# can be set up again
$".delete('config/environment.rb')
$".delete('test_help.rb')
# Remove the app folder
FileUtils.rm_r(Dir['test/app_root/*'])
end
end
| require 'test/unit'
require 'fileutils'
$:.unshift("#{File.dirname(__FILE__)}/../lib")
# Ensure the app root is empty
FileUtils.rm_rf('test/app_root')
FileUtils.mkdir('test/app_root')
# Use an in-memory log so that the app root can be removed without having to
# close all loggers in use
require 'logger'
require 'stringio'
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(StringIO.new))
Test::Unit::TestCase.class_eval do
private
def assert_valid_environment
assert_not_nil ApplicationController
assert ActiveRecord::Base.connection.active?
end
def setup_app(name)
FileUtils.cp_r(Dir["test/app_roots/#{name}/*"], 'test/app_root')
# Load the environment
load 'plugin_test_helper.rb'
assert_valid_environment
end
def teardown_app
# Clear dependencies
self.class.use_transactional_fixtures = false
ActiveRecord::Base.reset_subclasses
ActiveSupport::Dependencies.clear
# Reset open streams
ActiveRecord::Base.clear_reloadable_connections!
# Forget that the environment files were loaded so that a new app environment
# can be set up again
$".delete('config/environment.rb')
$".delete('test_help.rb')
# Remove the app folder
FileUtils.rm_r(Dir['test/app_root/*'])
end
end
| Fix tests to reference ActiveSupport::Dependencies instead of Dependencies | Fix tests to reference ActiveSupport::Dependencies instead of Dependencies
| Ruby | mit | pluginaweek/plugin_test_helper | ruby | ## Code Before:
require 'test/unit'
require 'fileutils'
$:.unshift("#{File.dirname(__FILE__)}/../lib")
# Ensure the app root is empty
FileUtils.rm_rf('test/app_root')
FileUtils.mkdir('test/app_root')
# Use an in-memory log so that the app root can be removed without having to
# close all loggers in use
require 'logger'
require 'stringio'
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(StringIO.new))
Test::Unit::TestCase.class_eval do
private
def assert_valid_environment
assert_not_nil ApplicationController
assert ActiveRecord::Base.connection.active?
end
def setup_app(name)
FileUtils.cp_r(Dir["test/app_roots/#{name}/*"], 'test/app_root')
# Load the environment
load 'plugin_test_helper.rb'
assert_valid_environment
end
def teardown_app
# Clear dependencies
self.class.use_transactional_fixtures = false
ActiveRecord::Base.reset_subclasses
Dependencies.clear
# Reset open streams
ActiveRecord::Base.clear_reloadable_connections!
# Forget that the environment files were loaded so that a new app environment
# can be set up again
$".delete('config/environment.rb')
$".delete('test_help.rb')
# Remove the app folder
FileUtils.rm_r(Dir['test/app_root/*'])
end
end
## Instruction:
Fix tests to reference ActiveSupport::Dependencies instead of Dependencies
## Code After:
require 'test/unit'
require 'fileutils'
$:.unshift("#{File.dirname(__FILE__)}/../lib")
# Ensure the app root is empty
FileUtils.rm_rf('test/app_root')
FileUtils.mkdir('test/app_root')
# Use an in-memory log so that the app root can be removed without having to
# close all loggers in use
require 'logger'
require 'stringio'
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(StringIO.new))
Test::Unit::TestCase.class_eval do
private
def assert_valid_environment
assert_not_nil ApplicationController
assert ActiveRecord::Base.connection.active?
end
def setup_app(name)
FileUtils.cp_r(Dir["test/app_roots/#{name}/*"], 'test/app_root')
# Load the environment
load 'plugin_test_helper.rb'
assert_valid_environment
end
def teardown_app
# Clear dependencies
self.class.use_transactional_fixtures = false
ActiveRecord::Base.reset_subclasses
ActiveSupport::Dependencies.clear
# Reset open streams
ActiveRecord::Base.clear_reloadable_connections!
# Forget that the environment files were loaded so that a new app environment
# can be set up again
$".delete('config/environment.rb')
$".delete('test_help.rb')
# Remove the app folder
FileUtils.rm_r(Dir['test/app_root/*'])
end
end
|
26de1b9f0646bdd495a9457923a8146120704f1a | bin/dicebag.js | bin/dicebag.js | /* eslint no-console: 0 */
const { parse, roll, pool } = require('../index.js')
const parseArgs = () => {
const args = process.argv.slice(2)
const parsedArgs = {
roller: roll,
expression: null
}
while (args.length > 0) {
const arg = args.shift()
if (arg === '-p') {
parsedArgs.roller = pool
} else {
parsedArgs.expression = arg
}
}
return parsedArgs
}
const rollDie = (string, roller) => {
try {
const die = parse(string.trim())
console.log(roller(die))
} catch (error) {
console.log(error.message)
}
}
const runIoLoop = (roller) => {
process.stdin.setEncoding('utf8')
process.stdin.on('data', (string) => {
rollDie(string, roller)
})
}
const parsedArgs = parseArgs()
if (parsedArgs.expression) {
rollDie(parsedArgs.expression, parsedArgs.roller)
} else {
runIoLoop(parsedArgs.roller)
}
| /* eslint no-console: 0 */
const { parse, roll, pool } = require('../index.js')
const parseArgs = () => {
const args = process.argv.slice(2)
const parsedArgs = {
roller: roll,
expression: null
}
while (args.length > 0) {
const arg = args.shift()
if (arg === '-p') {
parsedArgs.roller = pool
} else {
parsedArgs.expression = arg
}
}
return parsedArgs
}
const rollDie = (string, roller) => {
try {
const die = parse(string)
console.log(roller(die))
} catch (error) {
console.log(error.message)
}
}
const runIoLoop = (roller) => {
console.log("Type 'quit' or 'exit' to exit")
process.stdin.setEncoding('utf8')
process.stdin.on('data', (string) => {
string = string.trim()
if (string === 'exit' || string === 'quit') {
process.exit(0)
}
rollDie(string, roller)
})
}
const parsedArgs = parseArgs()
if (parsedArgs.expression) {
rollDie(parsedArgs.expression, parsedArgs.roller)
} else {
runIoLoop(parsedArgs.roller)
}
| Add ability to exit IO loop | Add ability to exit IO loop
| JavaScript | mit | m-chrzan/dicebag | javascript | ## Code Before:
/* eslint no-console: 0 */
const { parse, roll, pool } = require('../index.js')
const parseArgs = () => {
const args = process.argv.slice(2)
const parsedArgs = {
roller: roll,
expression: null
}
while (args.length > 0) {
const arg = args.shift()
if (arg === '-p') {
parsedArgs.roller = pool
} else {
parsedArgs.expression = arg
}
}
return parsedArgs
}
const rollDie = (string, roller) => {
try {
const die = parse(string.trim())
console.log(roller(die))
} catch (error) {
console.log(error.message)
}
}
const runIoLoop = (roller) => {
process.stdin.setEncoding('utf8')
process.stdin.on('data', (string) => {
rollDie(string, roller)
})
}
const parsedArgs = parseArgs()
if (parsedArgs.expression) {
rollDie(parsedArgs.expression, parsedArgs.roller)
} else {
runIoLoop(parsedArgs.roller)
}
## Instruction:
Add ability to exit IO loop
## Code After:
/* eslint no-console: 0 */
const { parse, roll, pool } = require('../index.js')
const parseArgs = () => {
const args = process.argv.slice(2)
const parsedArgs = {
roller: roll,
expression: null
}
while (args.length > 0) {
const arg = args.shift()
if (arg === '-p') {
parsedArgs.roller = pool
} else {
parsedArgs.expression = arg
}
}
return parsedArgs
}
const rollDie = (string, roller) => {
try {
const die = parse(string)
console.log(roller(die))
} catch (error) {
console.log(error.message)
}
}
const runIoLoop = (roller) => {
console.log("Type 'quit' or 'exit' to exit")
process.stdin.setEncoding('utf8')
process.stdin.on('data', (string) => {
string = string.trim()
if (string === 'exit' || string === 'quit') {
process.exit(0)
}
rollDie(string, roller)
})
}
const parsedArgs = parseArgs()
if (parsedArgs.expression) {
rollDie(parsedArgs.expression, parsedArgs.roller)
} else {
runIoLoop(parsedArgs.roller)
}
|
bb90f8a959617b47bf83c63cab26799c22ea5d97 | README.md | README.md |
KickFlix is a simple command line program that you can use to stream torrents to VLC.
It uses the Peerflix module and KickAssTorrents.
Tested on OS X, Linux and Windows.
# Requirements:
- [NodeJS](https://nodejs.org/)
- [VLC](http://www.videolan.org/index.html)
# Usage
- $ sudo npm install -g kickflix
- $ kickflix

# To Do
UI needs to be improved
Upgrade code to ES2016
|
KickFlix is a simple command line program that you can use to stream torrents to VLC.
It uses the Peerflix module and ThePirateBay.
Tested on OS X, Linux and Windows.
# Requirements:
- [NodeJS](https://nodejs.org/)
- [VLC](http://www.videolan.org/index.html)
# Usage
- $ sudo npm install -g kickflix
- $ kickflix

# To Do
UI needs to be improved
Upgrade code to ES2016
| Switch content source to TPB | Switch content source to TPB
Since you're not using KAT anymore, it should reflect that. | Markdown | mit | djmbritt/kickflix,davbritt/kickflix | markdown | ## Code Before:
KickFlix is a simple command line program that you can use to stream torrents to VLC.
It uses the Peerflix module and KickAssTorrents.
Tested on OS X, Linux and Windows.
# Requirements:
- [NodeJS](https://nodejs.org/)
- [VLC](http://www.videolan.org/index.html)
# Usage
- $ sudo npm install -g kickflix
- $ kickflix

# To Do
UI needs to be improved
Upgrade code to ES2016
## Instruction:
Switch content source to TPB
Since you're not using KAT anymore, it should reflect that.
## Code After:
KickFlix is a simple command line program that you can use to stream torrents to VLC.
It uses the Peerflix module and ThePirateBay.
Tested on OS X, Linux and Windows.
# Requirements:
- [NodeJS](https://nodejs.org/)
- [VLC](http://www.videolan.org/index.html)
# Usage
- $ sudo npm install -g kickflix
- $ kickflix

# To Do
UI needs to be improved
Upgrade code to ES2016
|
3cc4bb6162c0ee351d046622ca688165844c35a5 | desk/web-project.sh | desk/web-project.sh | PROJECT_PATH=$1
PROJECT_DB=$2
PROJECT_SQL=$3
PROJECT_HOST=$4
alias dev-http="xdg-open http://${DESK_NAME}.dev/ > /dev/null" # Open browser on dev server
alias dev-mysql="mysql ${PROJECT_DB}" # mysql alias with dbname inserted
alias dev-mysqldump="mysqldump --opt ${PROJECT_DB}" # mysqldump alias with dbname inserted
alias dev-dumpdb="mysqldump --opt ${PROJECT_DB} > ${PROJECT_SQL}" # Dump the database to sql file
alias dev-restoredb="mysql -e \"DROP DATABASE \\\`${PROJECT_DB}\\\`\" &>/dev/null ; \mysql -e \"CREATE DATABASE \\\`${PROJECT_DB}\\\`\" ; mysql ${PROJECT_DB} < ${PROJECT_SQL}" # Restore the database using the sql file
alias prd-http="xdg-open http://${PROJECT_HOST}/ > /dev/null" # Open browser on prod server
alias prd-ftp="filezilla -c 0/${PROJECT_HOST} &" # Open Filezilla on prod server
alias prd-ssh="ssh ${PROJECT_HOST}" # Open SSH on prod server
alias prd-getdb="ssh ${PROJECT_HOST} \"mysqldump $PRJ_NAME\" > $PRJ_PATH/sql/prod_db.sql" # Download production database
| PROJECT_PATH=$1
PROJECT_DB=$2
PROJECT_SQL=$3
PROJECT_HOST=$4
alias dev-http="xdg-open http://${DESK_NAME}.dev/ > /dev/null" # Open browser on dev server
alias dev-log="tail -f /var/log/nginx/${DESK_NAME}.dev-error.log" # Tail nginx error log
alias dev-mysql="mysql ${PROJECT_DB}" # mysql alias with dbname inserted
alias dev-mysqldump="mysqldump --opt ${PROJECT_DB}" # mysqldump alias with dbname inserted
alias dev-dumpdb="mysqldump --opt ${PROJECT_DB} > ${PROJECT_SQL}" # Dump the database to sql file
alias dev-restoredb="mysql -e \"DROP DATABASE \\\`${PROJECT_DB}\\\`\" &>/dev/null ; \mysql -e \"CREATE DATABASE \\\`${PROJECT_DB}\\\`\" ; mysql ${PROJECT_DB} < ${PROJECT_SQL}" # Restore the database using the sql file
alias prd-http="xdg-open http://${PROJECT_HOST}/ > /dev/null" # Open browser on prod server
alias prd-ftp="filezilla -c 0/${PROJECT_HOST} &" # Open Filezilla on prod server
alias prd-ssh="ssh ${PROJECT_HOST}" # Open SSH on prod server
alias prd-getdb="ssh ${PROJECT_HOST} \"mysqldump $PRJ_NAME\" > $PRJ_PATH/sql/prod_db.sql" # Download production database
| Add nginx error log tail on desk common file | Add nginx error log tail on desk common file
| Shell | mit | Benoth/dotfiles,Benoth/dotfiles | shell | ## Code Before:
PROJECT_PATH=$1
PROJECT_DB=$2
PROJECT_SQL=$3
PROJECT_HOST=$4
alias dev-http="xdg-open http://${DESK_NAME}.dev/ > /dev/null" # Open browser on dev server
alias dev-mysql="mysql ${PROJECT_DB}" # mysql alias with dbname inserted
alias dev-mysqldump="mysqldump --opt ${PROJECT_DB}" # mysqldump alias with dbname inserted
alias dev-dumpdb="mysqldump --opt ${PROJECT_DB} > ${PROJECT_SQL}" # Dump the database to sql file
alias dev-restoredb="mysql -e \"DROP DATABASE \\\`${PROJECT_DB}\\\`\" &>/dev/null ; \mysql -e \"CREATE DATABASE \\\`${PROJECT_DB}\\\`\" ; mysql ${PROJECT_DB} < ${PROJECT_SQL}" # Restore the database using the sql file
alias prd-http="xdg-open http://${PROJECT_HOST}/ > /dev/null" # Open browser on prod server
alias prd-ftp="filezilla -c 0/${PROJECT_HOST} &" # Open Filezilla on prod server
alias prd-ssh="ssh ${PROJECT_HOST}" # Open SSH on prod server
alias prd-getdb="ssh ${PROJECT_HOST} \"mysqldump $PRJ_NAME\" > $PRJ_PATH/sql/prod_db.sql" # Download production database
## Instruction:
Add nginx error log tail on desk common file
## Code After:
PROJECT_PATH=$1
PROJECT_DB=$2
PROJECT_SQL=$3
PROJECT_HOST=$4
alias dev-http="xdg-open http://${DESK_NAME}.dev/ > /dev/null" # Open browser on dev server
alias dev-log="tail -f /var/log/nginx/${DESK_NAME}.dev-error.log" # Tail nginx error log
alias dev-mysql="mysql ${PROJECT_DB}" # mysql alias with dbname inserted
alias dev-mysqldump="mysqldump --opt ${PROJECT_DB}" # mysqldump alias with dbname inserted
alias dev-dumpdb="mysqldump --opt ${PROJECT_DB} > ${PROJECT_SQL}" # Dump the database to sql file
alias dev-restoredb="mysql -e \"DROP DATABASE \\\`${PROJECT_DB}\\\`\" &>/dev/null ; \mysql -e \"CREATE DATABASE \\\`${PROJECT_DB}\\\`\" ; mysql ${PROJECT_DB} < ${PROJECT_SQL}" # Restore the database using the sql file
alias prd-http="xdg-open http://${PROJECT_HOST}/ > /dev/null" # Open browser on prod server
alias prd-ftp="filezilla -c 0/${PROJECT_HOST} &" # Open Filezilla on prod server
alias prd-ssh="ssh ${PROJECT_HOST}" # Open SSH on prod server
alias prd-getdb="ssh ${PROJECT_HOST} \"mysqldump $PRJ_NAME\" > $PRJ_PATH/sql/prod_db.sql" # Download production database
|
2e18a7ce9a392875c7d8e9faa0c94a7062c6f5f0 | src/Auth/NoDatabaseUserProvider.php | src/Auth/NoDatabaseUserProvider.php | <?php
namespace Adldap\Laravel\Auth;
use Adldap\Utilities;
use Adldap\Laravel\Traits\AuthenticatesUsers;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
class NoDatabaseUserProvider implements UserProvider
{
use AuthenticatesUsers {
retrieveByCredentials as retrieveLdapUserByCredentials;
}
/**
* {@inheritdoc}
*/
public function retrieveById($identifier)
{
$user = $this->newAdldapUserQuery()->where([
$this->getSchema()->objectGuid() => Utilities::stringGuidToHex($identifier),
])->first();
if ($user instanceof Authenticatable) {
return $user;
}
}
/**
* {@inheritdoc}
*/
public function retrieveByToken($identifier, $token)
{
return;
}
/**
* {@inheritdoc}
*/
public function updateRememberToken(Authenticatable $user, $token)
{
//
}
/**
* {@inheritdoc}
*/
public function retrieveByCredentials(array $credentials)
{
return $this->retrieveLdapUserByCredentials($credentials);
}
/**
* {@inheritdoc}
*/
public function validateCredentials(Authenticatable $user, array $credentials)
{
// Retrieve the authentication username for the AD user.
$username = $this->getUsernameFromAuthenticatable($user);
// Retrieve the users password.
$password = $this->getPasswordFromCredentials($credentials);
// Perform LDAP authentication.
return $this->authenticate($username, $password);
}
}
| <?php
namespace Adldap\Laravel\Auth;
use Adldap\Utilities;
use Adldap\Laravel\Traits\AuthenticatesUsers;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
class NoDatabaseUserProvider implements UserProvider
{
use AuthenticatesUsers {
retrieveByCredentials as retrieveLdapUserByCredentials;
}
/**
* {@inheritdoc}
*/
public function retrieveById($identifier)
{
$user = $this->newAdldapUserQuery()->where([
$this->getSchema()->objectSid() => $identifier,
])->first();
if ($user instanceof Authenticatable) {
return $user;
}
}
/**
* {@inheritdoc}
*/
public function retrieveByToken($identifier, $token)
{
return;
}
/**
* {@inheritdoc}
*/
public function updateRememberToken(Authenticatable $user, $token)
{
//
}
/**
* {@inheritdoc}
*/
public function retrieveByCredentials(array $credentials)
{
return $this->retrieveLdapUserByCredentials($credentials);
}
/**
* {@inheritdoc}
*/
public function validateCredentials(Authenticatable $user, array $credentials)
{
// Retrieve the authentication username for the AD user.
$username = $this->getLoginUsernameFromUser($user);
// Retrieve the users password.
$password = $this->getPasswordFromCredentials($credentials);
// Perform LDAP authentication.
return $this->authenticate($username, $password);
}
}
| Use object SID instead of GUID | Use object SID instead of GUID
| PHP | lgpl-2.1 | Adldap2/Adldap2-laravel | php | ## Code Before:
<?php
namespace Adldap\Laravel\Auth;
use Adldap\Utilities;
use Adldap\Laravel\Traits\AuthenticatesUsers;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
class NoDatabaseUserProvider implements UserProvider
{
use AuthenticatesUsers {
retrieveByCredentials as retrieveLdapUserByCredentials;
}
/**
* {@inheritdoc}
*/
public function retrieveById($identifier)
{
$user = $this->newAdldapUserQuery()->where([
$this->getSchema()->objectGuid() => Utilities::stringGuidToHex($identifier),
])->first();
if ($user instanceof Authenticatable) {
return $user;
}
}
/**
* {@inheritdoc}
*/
public function retrieveByToken($identifier, $token)
{
return;
}
/**
* {@inheritdoc}
*/
public function updateRememberToken(Authenticatable $user, $token)
{
//
}
/**
* {@inheritdoc}
*/
public function retrieveByCredentials(array $credentials)
{
return $this->retrieveLdapUserByCredentials($credentials);
}
/**
* {@inheritdoc}
*/
public function validateCredentials(Authenticatable $user, array $credentials)
{
// Retrieve the authentication username for the AD user.
$username = $this->getUsernameFromAuthenticatable($user);
// Retrieve the users password.
$password = $this->getPasswordFromCredentials($credentials);
// Perform LDAP authentication.
return $this->authenticate($username, $password);
}
}
## Instruction:
Use object SID instead of GUID
## Code After:
<?php
namespace Adldap\Laravel\Auth;
use Adldap\Utilities;
use Adldap\Laravel\Traits\AuthenticatesUsers;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
class NoDatabaseUserProvider implements UserProvider
{
use AuthenticatesUsers {
retrieveByCredentials as retrieveLdapUserByCredentials;
}
/**
* {@inheritdoc}
*/
public function retrieveById($identifier)
{
$user = $this->newAdldapUserQuery()->where([
$this->getSchema()->objectSid() => $identifier,
])->first();
if ($user instanceof Authenticatable) {
return $user;
}
}
/**
* {@inheritdoc}
*/
public function retrieveByToken($identifier, $token)
{
return;
}
/**
* {@inheritdoc}
*/
public function updateRememberToken(Authenticatable $user, $token)
{
//
}
/**
* {@inheritdoc}
*/
public function retrieveByCredentials(array $credentials)
{
return $this->retrieveLdapUserByCredentials($credentials);
}
/**
* {@inheritdoc}
*/
public function validateCredentials(Authenticatable $user, array $credentials)
{
// Retrieve the authentication username for the AD user.
$username = $this->getLoginUsernameFromUser($user);
// Retrieve the users password.
$password = $this->getPasswordFromCredentials($credentials);
// Perform LDAP authentication.
return $this->authenticate($username, $password);
}
}
|
141d8fb767131cfaad4547666b940c41cff86785 | .github/workflows/ruby.yml | .github/workflows/ruby.yml | name: Ruby
on: [push]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.3.x
- name: Test with Serverspec
run: |
gem install bundler
bundle install --jobs 4 --retry 3
cd test
rake
| name: Ruby
on: [push]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.3
uses: actions/setup-ruby@v1
with:
ruby-version: 2.3.x
- name: Install Serverspec
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Install Docker
run: |
apt-get -y update
apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
apt-get -y update
apt install docker-ce
- name: Run test
run: |
cd test
rake
| Install docker then run tests | Install docker then run tests | YAML | mpl-2.0 | chorrell/docker-image-testing-example | yaml | ## Code Before:
name: Ruby
on: [push]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.3.x
- name: Test with Serverspec
run: |
gem install bundler
bundle install --jobs 4 --retry 3
cd test
rake
## Instruction:
Install docker then run tests
## Code After:
name: Ruby
on: [push]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 2.3
uses: actions/setup-ruby@v1
with:
ruby-version: 2.3.x
- name: Install Serverspec
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Install Docker
run: |
apt-get -y update
apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
apt-get -y update
apt install docker-ce
- name: Run test
run: |
cd test
rake
|
3387219010fbe9e0120cfe6c35c61dc818e01dca | lib/chrono/trigger.rb | lib/chrono/trigger.rb | module Chrono
class Trigger
attr_reader :block, :source
def initialize(source, &block)
@source = source
@block = block || -> {}
end
def once
wait
call
end
def run
loop { once }
end
private
def call
block.call
end
def iterator
@iterator ||= Iterator.new(source)
end
def wait
sleep(period)
end
def period
iterator.next - Time.now
end
end
end
| module Chrono
class Trigger
attr_reader :block, :source
def initialize(source, &block)
@source = source
@block = block || -> {}
end
def once
wait
call
end
def run
loop { once }
end
private
def call
block.call
end
def iterator
@iterator ||= Iterator.new(source)
end
def wait
sleep(period)
end
def period
iterator.next - Time.now + 1.second
end
end
end
| Add extra sleep time to adjust to exact minute | Add extra sleep time to adjust to exact minute
| Ruby | mit | r7kamura/chrono,eagletmt/chrono | ruby | ## Code Before:
module Chrono
class Trigger
attr_reader :block, :source
def initialize(source, &block)
@source = source
@block = block || -> {}
end
def once
wait
call
end
def run
loop { once }
end
private
def call
block.call
end
def iterator
@iterator ||= Iterator.new(source)
end
def wait
sleep(period)
end
def period
iterator.next - Time.now
end
end
end
## Instruction:
Add extra sleep time to adjust to exact minute
## Code After:
module Chrono
class Trigger
attr_reader :block, :source
def initialize(source, &block)
@source = source
@block = block || -> {}
end
def once
wait
call
end
def run
loop { once }
end
private
def call
block.call
end
def iterator
@iterator ||= Iterator.new(source)
end
def wait
sleep(period)
end
def period
iterator.next - Time.now + 1.second
end
end
end
|
c9f0fe19ee96a2efd788cad4583fd86bc2d2631f | lib/generators/hyrax/work/templates/model.rb.erb | lib/generators/hyrax/work/templates/model.rb.erb | class <%= class_name %> < ActiveFedora::Base
include ::Hyrax::WorkBehavior
# This must come after the WorkBehavior because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
self.indexer = <%= class_name %>Indexer
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
validates :title, presence: { message: 'Your work must have a title.' }
self.human_readable_type = '<%= name.underscore.titleize %>'
end
| class <%= class_name %> < ActiveFedora::Base
include ::Hyrax::WorkBehavior
self.indexer = <%= class_name %>Indexer
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
validates :title, presence: { message: 'Your work must have a title.' }
self.human_readable_type = '<%= name.underscore.titleize %>'
# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
end
| Work generator: move BasicMetadata mixin to bottom of class | Work generator: move BasicMetadata mixin to bottom of class
| HTML+ERB | apache-2.0 | samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax | html+erb | ## Code Before:
class <%= class_name %> < ActiveFedora::Base
include ::Hyrax::WorkBehavior
# This must come after the WorkBehavior because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
self.indexer = <%= class_name %>Indexer
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
validates :title, presence: { message: 'Your work must have a title.' }
self.human_readable_type = '<%= name.underscore.titleize %>'
end
## Instruction:
Work generator: move BasicMetadata mixin to bottom of class
## Code After:
class <%= class_name %> < ActiveFedora::Base
include ::Hyrax::WorkBehavior
self.indexer = <%= class_name %>Indexer
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
validates :title, presence: { message: 'Your work must have a title.' }
self.human_readable_type = '<%= name.underscore.titleize %>'
# This must be included at the end, because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::BasicMetadata
end
|
000fc141cf307dc0d20879944b7fa6b63884dd01 | app/assets/javascripts/photographs.js.coffee | app/assets/javascripts/photographs.js.coffee | $(document).ready ->
# Photo grid
photoGrid = $(".photo-grid")
photoGrid.on "reload:grid", ->
opts = wookmarkOptions(calculateGridWidth())
photoGrid.find(".photo, .user-block").wookmark(opts)
photoGrid.trigger "reload:grid"
$(window).resize ->
photoGrid.trigger "reload:grid"
# Description size tweaking on photo show
image = $(".display .image img")
description = image.siblings(".description")
if image.length > 0
image.on "resize:description", ->
if description.length > 0
description.innerWidth(image.width())
if description.is(":hidden")
description.fadeIn()
$(".display").imagesLoaded ->
image.trigger "resize:description"
$(window).resize ->
image.trigger "resize:description"
| $(document).ready ->
# Photo grid
photoGrid = $(".photo-grid")
photoGrid.on "reload:grid", ->
opts = wookmarkOptions(calculateGridWidth())
photoGrid.find(".photo, .user-block").wookmark(opts)
photoGrid.imagesLoaded ->
photoGrid.trigger "reload:grid"
$(window).resize ->
photoGrid.trigger "reload:grid"
# Description size tweaking on photo show
image = $(".display .image img")
description = image.siblings(".description")
if image.length > 0
image.on "resize:description", ->
if description.length > 0
description.innerWidth(image.width())
if description.is(":hidden")
description.fadeIn()
$(".display").imagesLoaded ->
image.trigger "resize:description"
$(window).resize ->
image.trigger "resize:description"
| Fix for photo grid overlap | Fix for photo grid overlap
| CoffeeScript | mit | laputaer/photographer-io,arnkorty/photographer-io,wangjun/photographer-io,damoguyan8844/photographer-io,arnkorty/photographer-io,xuewenfei/photographer-io,damoguyan8844/photographer-io,robotmay/photographer-io,robotmay/photographer-io,xuewenfei/photographer-io,wangjun/photographer-io,wangjun/photographer-io,damoguyan8844/photographer-io,xuewenfei/photographer-io,robotmay/photographer-io,laputaer/photographer-io,arnkorty/photographer-io,laputaer/photographer-io | coffeescript | ## Code Before:
$(document).ready ->
# Photo grid
photoGrid = $(".photo-grid")
photoGrid.on "reload:grid", ->
opts = wookmarkOptions(calculateGridWidth())
photoGrid.find(".photo, .user-block").wookmark(opts)
photoGrid.trigger "reload:grid"
$(window).resize ->
photoGrid.trigger "reload:grid"
# Description size tweaking on photo show
image = $(".display .image img")
description = image.siblings(".description")
if image.length > 0
image.on "resize:description", ->
if description.length > 0
description.innerWidth(image.width())
if description.is(":hidden")
description.fadeIn()
$(".display").imagesLoaded ->
image.trigger "resize:description"
$(window).resize ->
image.trigger "resize:description"
## Instruction:
Fix for photo grid overlap
## Code After:
$(document).ready ->
# Photo grid
photoGrid = $(".photo-grid")
photoGrid.on "reload:grid", ->
opts = wookmarkOptions(calculateGridWidth())
photoGrid.find(".photo, .user-block").wookmark(opts)
photoGrid.imagesLoaded ->
photoGrid.trigger "reload:grid"
$(window).resize ->
photoGrid.trigger "reload:grid"
# Description size tweaking on photo show
image = $(".display .image img")
description = image.siblings(".description")
if image.length > 0
image.on "resize:description", ->
if description.length > 0
description.innerWidth(image.width())
if description.is(":hidden")
description.fadeIn()
$(".display").imagesLoaded ->
image.trigger "resize:description"
$(window).resize ->
image.trigger "resize:description"
|
2c69c82222a6ba070b1c78a68f5ee10682bd3dc6 | src/_common/PurchaseConfirmation.js | src/_common/PurchaseConfirmation.js | import React, { PropTypes } from 'react';
import { FormattedTime } from 'react-intl';
import { epochToDate } from '../_utils/DateUtils';
import { M } from '../_common';
const PurchaseConfirmation = ({ receipt }) => (
<div>
<table>
<tbody>
<tr>
<td colSpan="2">
{receipt.longcode}
</td>
</tr>
<tr>
<td><M m="Purchase Price" /></td>
<td>{receipt.buy_price}</td>
</tr>
<tr>
<td><M m="Purchase Time" /></td>
<td>
<FormattedTime value={epochToDate(receipt.purchase_time)} format="full" />
</td>
</tr>
<tr>
<td><M m="Balance" /></td>
<td>{receipt.balance_after}</td>
</tr>
</tbody>
</table>
<br/>
<button><M m="Back" /></button>
</div>
);
PurchaseConfirmation.propTypes = {
proposal: PropTypes.object,
};
export default PurchaseConfirmation;
| import React, { PropTypes } from 'react';
import { FormattedTime } from 'react-intl';
import { epochToDate } from '../_utils/DateUtils';
import { M, NumberPlain } from '../_common';
const PurchaseConfirmation = ({ receipt }) => (
<div>
<table>
<thead>
<th colSpan="2">{`Contract Ref. ${receipt.contract_id}`}</th>
</thead>
<tbody>
<tr>
<td colSpan="2">
{receipt.longcode}
</td>
</tr>
<tr>
<td><M m="Purchase Price" /></td>
<td>{receipt.buy_price}</td>
</tr>
<tr>
<td><M m="Purchase Time" /></td>
<td>
<FormattedTime value={epochToDate(receipt.purchase_time)} format="full" />
</td>
</tr>
<tr>
<td><M m="Balance" /></td>
<td>
<NumberPlain value={receipt.balance_after} />
</td>
</tr>
</tbody>
</table>
<br/>
<button><M m="Back" /></button>
</div>
);
PurchaseConfirmation.propTypes = {
proposal: PropTypes.object,
};
export default PurchaseConfirmation;
| Fix purchase confirmation decimal points | Fix purchase confirmation decimal points
| JavaScript | mit | binary-com/binary-next-gen,qingweibinary/binary-next-gen,nazaninreihani/binary-next-gen,nuruddeensalihu/binary-next-gen,nazaninreihani/binary-next-gen,nuruddeensalihu/binary-next-gen,qingweibinary/binary-next-gen,nuruddeensalihu/binary-next-gen,qingweibinary/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen | javascript | ## Code Before:
import React, { PropTypes } from 'react';
import { FormattedTime } from 'react-intl';
import { epochToDate } from '../_utils/DateUtils';
import { M } from '../_common';
const PurchaseConfirmation = ({ receipt }) => (
<div>
<table>
<tbody>
<tr>
<td colSpan="2">
{receipt.longcode}
</td>
</tr>
<tr>
<td><M m="Purchase Price" /></td>
<td>{receipt.buy_price}</td>
</tr>
<tr>
<td><M m="Purchase Time" /></td>
<td>
<FormattedTime value={epochToDate(receipt.purchase_time)} format="full" />
</td>
</tr>
<tr>
<td><M m="Balance" /></td>
<td>{receipt.balance_after}</td>
</tr>
</tbody>
</table>
<br/>
<button><M m="Back" /></button>
</div>
);
PurchaseConfirmation.propTypes = {
proposal: PropTypes.object,
};
export default PurchaseConfirmation;
## Instruction:
Fix purchase confirmation decimal points
## Code After:
import React, { PropTypes } from 'react';
import { FormattedTime } from 'react-intl';
import { epochToDate } from '../_utils/DateUtils';
import { M, NumberPlain } from '../_common';
const PurchaseConfirmation = ({ receipt }) => (
<div>
<table>
<thead>
<th colSpan="2">{`Contract Ref. ${receipt.contract_id}`}</th>
</thead>
<tbody>
<tr>
<td colSpan="2">
{receipt.longcode}
</td>
</tr>
<tr>
<td><M m="Purchase Price" /></td>
<td>{receipt.buy_price}</td>
</tr>
<tr>
<td><M m="Purchase Time" /></td>
<td>
<FormattedTime value={epochToDate(receipt.purchase_time)} format="full" />
</td>
</tr>
<tr>
<td><M m="Balance" /></td>
<td>
<NumberPlain value={receipt.balance_after} />
</td>
</tr>
</tbody>
</table>
<br/>
<button><M m="Back" /></button>
</div>
);
PurchaseConfirmation.propTypes = {
proposal: PropTypes.object,
};
export default PurchaseConfirmation;
|
e1d5631d9d2d10edf0ddcbc924c6651a98697073 | src/munger.rb | src/munger.rb |
require 'rdf'
require 'rdf/ntriples'
class Munger
model = null
def initialize ()
get_new_model
end
def create_new_model ()
if (model == null)
graph = RDF::Graph.new
end
else
STDOUT.puts "Attempted to initialize model, but a pre-existing model was found"
end
def get_model ()
graph.dump(:ntriples)
end
end |
require 'rdf'
require 'rdf/ntriples'
require 'test-unit'
class Munger
model = nil
def initialize ()
get_new_model
end
def create_new_model ()
if (model == null)
graph = RDF::Graph.new
else
STDOUT.puts "Attempted to initialize model, but a pre-existing model was found"
end
end
def get_model ()
graph.dump(:ntriples)
end
end | Add something that works…rebase brain from Java | Add something that works…rebase brain from Java
| Ruby | mit | brinxmat/gunnbib-scripts | ruby | ## Code Before:
require 'rdf'
require 'rdf/ntriples'
class Munger
model = null
def initialize ()
get_new_model
end
def create_new_model ()
if (model == null)
graph = RDF::Graph.new
end
else
STDOUT.puts "Attempted to initialize model, but a pre-existing model was found"
end
def get_model ()
graph.dump(:ntriples)
end
end
## Instruction:
Add something that works…rebase brain from Java
## Code After:
require 'rdf'
require 'rdf/ntriples'
require 'test-unit'
class Munger
model = nil
def initialize ()
get_new_model
end
def create_new_model ()
if (model == null)
graph = RDF::Graph.new
else
STDOUT.puts "Attempted to initialize model, but a pre-existing model was found"
end
end
def get_model ()
graph.dump(:ntriples)
end
end |
3d139d5a93b83dc69e13d6fcc7ae0c8ef9d39be5 | backend/app/assets/stylesheets/spree/backend/shared/_layout.scss | backend/app/assets/stylesheets/spree/backend/shared/_layout.scss | html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
| html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
overflow-x: hidden; // makes sure that the tabs are able to resize
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
| Make sure tabs condense in the new layout | Make sure tabs condense in the new layout
Without this the tabs would never collapse into the dropdown. Because
the tabs are checking for `offsetWidth`, if you let it overflow it would
always think that there was enough space.
| SCSS | bsd-3-clause | jordan-brough/solidus,pervino/solidus,pervino/solidus,Arpsara/solidus,pervino/solidus,jordan-brough/solidus,Arpsara/solidus,pervino/solidus,Arpsara/solidus,Arpsara/solidus,jordan-brough/solidus,jordan-brough/solidus | scss | ## Code Before:
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
## Instruction:
Make sure tabs condense in the new layout
Without this the tabs would never collapse into the dropdown. Because
the tabs are checking for `offsetWidth`, if you let it overflow it would
always think that there was enough space.
## Code After:
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
overflow-x: hidden; // makes sure that the tabs are able to resize
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
|
401ad02cd043d16196cd12b0bc26a383fed701c2 | tests/common_check.pri | tests/common_check.pri | QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET
QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET
# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
isEqual(OPTION, on){
QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
LIBS += -lgcov
}
}
QMAKE_CLEAN += *.gcno *.gcda
| QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET
QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET
# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
isEqual(OPTION, on){
QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
LIBS += -lgcov
}
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda
| Clean gcov files from right subdir | Clean gcov files from right subdir
RevBy: Rakesh Cherian
The *.gcov and *.gcda files are created in $$OBJECTS_DIR and need to be
deleted from there on make clean. Fix the QMAKE_CLEAN rule for that.
Full, original commit at 73cff7eba24a010e56baeea2df6e1ff51a40ed0e in maliit-framework
| QMake | lgpl-2.1 | maliit/inputcontext-gtk,maliit/inputcontext-gtk | qmake | ## Code Before:
QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET
QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET
# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
isEqual(OPTION, on){
QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
LIBS += -lgcov
}
}
QMAKE_CLEAN += *.gcno *.gcda
## Instruction:
Clean gcov files from right subdir
RevBy: Rakesh Cherian
The *.gcov and *.gcda files are created in $$OBJECTS_DIR and need to be
deleted from there on make clean. Fix the QMAKE_CLEAN rule for that.
Full, original commit at 73cff7eba24a010e56baeea2df6e1ff51a40ed0e in maliit-framework
## Code After:
QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET
QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET
# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
isEqual(OPTION, on){
QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
LIBS += -lgcov
}
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda
|
a549e6988de5071dbbf397c5fd1f894f5ad0a8f7 | assets/js/util/tracking/createDataLayerPush.js | assets/js/util/tracking/createDataLayerPush.js |
/**
* Internal dependencies
*/
import { DATA_LAYER } from './index.private';
/**
* Returns a function which, when invoked will initialize the dataLayer and push data onto it.
*
* @param {Object} target Object to enhance with dataLayer data.
* @return {Function} Function that pushes data onto the dataLayer.
*/
export default function createDataLayerPush( target ) {
/**
* Pushes data onto the data layer.
*
* @param {...any} args Arguments to push onto the data layer.
*/
return function dataLayerPush( ...args ) {
target[ DATA_LAYER ] = target[ DATA_LAYER ] || [];
target[ DATA_LAYER ].push( args );
};
}
|
/**
* Internal dependencies
*/
import { DATA_LAYER } from './index.private';
/**
* Returns a function which, when invoked will initialize the dataLayer and push data onto it.
*
* @param {Object} target Object to enhance with dataLayer data.
* @return {Function} Function that pushes data onto the dataLayer.
*/
export default function createDataLayerPush( target ) {
/**
* Pushes data onto the data layer.
* Must use `arguments` internally.
*/
return function dataLayerPush() {
target[ DATA_LAYER ] = target[ DATA_LAYER ] || [];
target[ DATA_LAYER ].push( arguments );
};
}
| Refactor dataLayerPush to use func.arguments. | Refactor dataLayerPush to use func.arguments.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | javascript | ## Code Before:
/**
* Internal dependencies
*/
import { DATA_LAYER } from './index.private';
/**
* Returns a function which, when invoked will initialize the dataLayer and push data onto it.
*
* @param {Object} target Object to enhance with dataLayer data.
* @return {Function} Function that pushes data onto the dataLayer.
*/
export default function createDataLayerPush( target ) {
/**
* Pushes data onto the data layer.
*
* @param {...any} args Arguments to push onto the data layer.
*/
return function dataLayerPush( ...args ) {
target[ DATA_LAYER ] = target[ DATA_LAYER ] || [];
target[ DATA_LAYER ].push( args );
};
}
## Instruction:
Refactor dataLayerPush to use func.arguments.
## Code After:
/**
* Internal dependencies
*/
import { DATA_LAYER } from './index.private';
/**
* Returns a function which, when invoked will initialize the dataLayer and push data onto it.
*
* @param {Object} target Object to enhance with dataLayer data.
* @return {Function} Function that pushes data onto the dataLayer.
*/
export default function createDataLayerPush( target ) {
/**
* Pushes data onto the data layer.
* Must use `arguments` internally.
*/
return function dataLayerPush() {
target[ DATA_LAYER ] = target[ DATA_LAYER ] || [];
target[ DATA_LAYER ].push( arguments );
};
}
|
9e1f4a9400944377cd38fb8d21d862681581fb64 | ginisdk/src/main/java/net/gini/android/authorization/requests/BearerJsonObjectRequest.java | ginisdk/src/main/java/net/gini/android/authorization/requests/BearerJsonObjectRequest.java | package net.gini.android.authorization.requests;
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import net.gini.android.MediaTypes;
import net.gini.android.authorization.Session;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class BearerJsonObjectRequest extends JsonObjectRequest {
final private Session mSession;
public BearerJsonObjectRequest(int method, String url, JSONObject jsonRequest, Session session, Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) {
super(method, url, jsonRequest, listener, errorListener);
mSession = session;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Accept", String.format("%s, %s", MediaTypes.APPLICATION_JSON, MediaTypes.GINI_JSON_V1));
headers.put("Authorization", "BEARER " + mSession.getAccessToken());
return headers;
}
}
| package net.gini.android.authorization.requests;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Response;
import com.android.volley.toolbox.HttpHeaderParser;
import com.android.volley.toolbox.JsonObjectRequest;
import net.gini.android.MediaTypes;
import net.gini.android.authorization.Session;
import org.apache.http.protocol.HTTP;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
public class BearerJsonObjectRequest extends JsonObjectRequest {
final private Session mSession;
public BearerJsonObjectRequest(int method, String url, JSONObject jsonRequest, Session session, Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) {
super(method, url, jsonRequest, listener, errorListener);
mSession = session;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Accept", String.format("%s, %s", MediaTypes.APPLICATION_JSON, MediaTypes.GINI_JSON_V1));
headers.put("Authorization", "BEARER " + mSession.getAccessToken());
return headers;
}
@Override
protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {
try {
// The Gini API always uses UTF-8.
final String jsonString = new String(response.data, HTTP.UTF_8);
return Response.success(new JSONObject(jsonString),
HttpHeaderParser.parseCacheHeaders(response));
} catch (UnsupportedEncodingException e) {
return Response.error(new ParseError(e));
} catch (JSONException je) {
return Response.error(new ParseError(je));
}
}
}
| Fix the encoding of API responses. | Fix the encoding of API responses.
| Java | mit | gini/gini-sdk-android,gini/gini-sdk-android,gini/gini-sdk-android | java | ## Code Before:
package net.gini.android.authorization.requests;
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import net.gini.android.MediaTypes;
import net.gini.android.authorization.Session;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class BearerJsonObjectRequest extends JsonObjectRequest {
final private Session mSession;
public BearerJsonObjectRequest(int method, String url, JSONObject jsonRequest, Session session, Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) {
super(method, url, jsonRequest, listener, errorListener);
mSession = session;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Accept", String.format("%s, %s", MediaTypes.APPLICATION_JSON, MediaTypes.GINI_JSON_V1));
headers.put("Authorization", "BEARER " + mSession.getAccessToken());
return headers;
}
}
## Instruction:
Fix the encoding of API responses.
## Code After:
package net.gini.android.authorization.requests;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Response;
import com.android.volley.toolbox.HttpHeaderParser;
import com.android.volley.toolbox.JsonObjectRequest;
import net.gini.android.MediaTypes;
import net.gini.android.authorization.Session;
import org.apache.http.protocol.HTTP;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
public class BearerJsonObjectRequest extends JsonObjectRequest {
final private Session mSession;
public BearerJsonObjectRequest(int method, String url, JSONObject jsonRequest, Session session, Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) {
super(method, url, jsonRequest, listener, errorListener);
mSession = session;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Accept", String.format("%s, %s", MediaTypes.APPLICATION_JSON, MediaTypes.GINI_JSON_V1));
headers.put("Authorization", "BEARER " + mSession.getAccessToken());
return headers;
}
@Override
protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {
try {
// The Gini API always uses UTF-8.
final String jsonString = new String(response.data, HTTP.UTF_8);
return Response.success(new JSONObject(jsonString),
HttpHeaderParser.parseCacheHeaders(response));
} catch (UnsupportedEncodingException e) {
return Response.error(new ParseError(e));
} catch (JSONException je) {
return Response.error(new ParseError(je));
}
}
}
|
63a000594131de28d7128bedf2fef80d91dffd7f | README.md | README.md |
Extension to Amazon Cloud Watch Scripts that adds logical volume metrics found here: [http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html)
Adds the following metrics:
* `lv-space-util`
* `lv-space-used`
* `lv-space-avail`
NOTE: These metrics requires the script to be run by root or a user with `lvdisplay` permissions.
|
Extension to Amazon Cloud Watch Scripts that adds logical volume metrics found here: [http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html)
This addresses the issue of not being able to create metrics for Logical Volumes.
Using these scripts you now gain:
* `lv-space-util` [Shows percentage free space in a Logical Volume]
* `lv-space-used` [Shows gigabytes used space in a Logical Volume]
* `lv-space-avail` [Shows gigabytes free space in a Logical Volume]
Which can be used to set up metrics and alarms in CloudWatch.
Note:
* These scripts does not currently check if the Logical Volume can grow inside the Logical Group, hence it might show less space free than there actually is available to the volume if it's expanded in the Logical Group.
* These metrics requires the script to be run by root or a user with `lvdisplay` permissions.
| Clarify the uses of these scripts. | Clarify the uses of these scripts. | Markdown | apache-2.0 | alexanderbh/ExtendedCloudWatchScripts | markdown | ## Code Before:
Extension to Amazon Cloud Watch Scripts that adds logical volume metrics found here: [http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html)
Adds the following metrics:
* `lv-space-util`
* `lv-space-used`
* `lv-space-avail`
NOTE: These metrics requires the script to be run by root or a user with `lvdisplay` permissions.
## Instruction:
Clarify the uses of these scripts.
## Code After:
Extension to Amazon Cloud Watch Scripts that adds logical volume metrics found here: [http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts.html)
This addresses the issue of not being able to create metrics for Logical Volumes.
Using these scripts you now gain:
* `lv-space-util` [Shows percentage free space in a Logical Volume]
* `lv-space-used` [Shows gigabytes used space in a Logical Volume]
* `lv-space-avail` [Shows gigabytes free space in a Logical Volume]
Which can be used to set up metrics and alarms in CloudWatch.
Note:
* These scripts does not currently check if the Logical Volume can grow inside the Logical Group, hence it might show less space free than there actually is available to the volume if it's expanded in the Logical Group.
* These metrics requires the script to be run by root or a user with `lvdisplay` permissions.
|
c5d68ebc5eb4f8c5de938777d9a21127bfb0a76d | geotrek/feedback/fixtures/management_workflow.json | geotrek/feedback/fixtures/management_workflow.json | [
{
"model": "feedback.reportstatus",
"fields": {
"label": "Programm\u00e9",
"label_en": "Programm\u00e9",
"label_fr": "Programmed",
"suricate_id": "programmed"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention en retard",
"label_en": "Late intervention",
"label_fr": "Intervention en retard",
"suricate_id": "intervention_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solution en retard",
"label_en": "Late resolution",
"label_fr": "R\u00e9solution en retard",
"suricate_id": "resolution_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention termin\u00e9e",
"label_en": "Resolved intervention",
"label_fr": "Intervention termin\u00e9e",
"suricate_id": "intervention_solved"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solu",
"label_en": "Resolved",
"label_fr": "R\u00e9solu",
"suricate_id": "resolved"
}
}
] | [
{
"model": "feedback.reportstatus",
"fields": {
"label": "Programm\u00e9",
"label_en": "Programmed",
"label_fr": "Programm\u00e9",
"suricate_id": "programmed"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention en retard",
"label_en": "Late intervention",
"label_fr": "Intervention en retard",
"suricate_id": "intervention_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solution en retard",
"label_en": "Late resolution",
"label_fr": "R\u00e9solution en retard",
"suricate_id": "resolution_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention termin\u00e9e",
"label_en": "Resolved intervention",
"label_fr": "Intervention termin\u00e9e",
"suricate_id": "intervention_solved"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solu",
"label_en": "Resolved",
"label_fr": "R\u00e9solu",
"suricate_id": "resolved"
}
}
] | Switch wrong translations in fixtures | Switch wrong translations in fixtures
| JSON | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin | json | ## Code Before:
[
{
"model": "feedback.reportstatus",
"fields": {
"label": "Programm\u00e9",
"label_en": "Programm\u00e9",
"label_fr": "Programmed",
"suricate_id": "programmed"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention en retard",
"label_en": "Late intervention",
"label_fr": "Intervention en retard",
"suricate_id": "intervention_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solution en retard",
"label_en": "Late resolution",
"label_fr": "R\u00e9solution en retard",
"suricate_id": "resolution_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention termin\u00e9e",
"label_en": "Resolved intervention",
"label_fr": "Intervention termin\u00e9e",
"suricate_id": "intervention_solved"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solu",
"label_en": "Resolved",
"label_fr": "R\u00e9solu",
"suricate_id": "resolved"
}
}
]
## Instruction:
Switch wrong translations in fixtures
## Code After:
[
{
"model": "feedback.reportstatus",
"fields": {
"label": "Programm\u00e9",
"label_en": "Programmed",
"label_fr": "Programm\u00e9",
"suricate_id": "programmed"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention en retard",
"label_en": "Late intervention",
"label_fr": "Intervention en retard",
"suricate_id": "intervention_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solution en retard",
"label_en": "Late resolution",
"label_fr": "R\u00e9solution en retard",
"suricate_id": "resolution_late"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "Intervention termin\u00e9e",
"label_en": "Resolved intervention",
"label_fr": "Intervention termin\u00e9e",
"suricate_id": "intervention_solved"
}
},
{
"model": "feedback.reportstatus",
"fields": {
"label": "R\u00e9solu",
"label_en": "Resolved",
"label_fr": "R\u00e9solu",
"suricate_id": "resolved"
}
}
] |
637953efa1f71b123bb28c8404b79219a6bd6b3e | fablab-businessplan.py | fablab-businessplan.py |
import xlsxwriter
# Create the file
workbook = xlsxwriter.Workbook('FabLab-BusinessPlan.xlsx')
# Create the worksheets
expenses = workbook.add_worksheet('Expenses')
activities = workbook.add_worksheet('Activities')
membership = workbook.add_worksheet('Membership')
total = workbook.add_worksheet('Total')
# Add content to the Expenses worksheet
expenses.write('A1', 'Hello world')
# Save and close the file
workbook.close() |
import xlsxwriter
# Create document -------------------------------------------------------------
# Create the file
workbook = xlsxwriter.Workbook('FabLab-BusinessPlan.xlsx')
# Create the worksheets
expenses = workbook.add_worksheet('Expenses')
activities = workbook.add_worksheet('Activities')
membership = workbook.add_worksheet('Membership')
total = workbook.add_worksheet('Total')
# Create styles -------------------------------------------------------------
# Add a bold style to highlight heading cells
bold_style = workbook.add_format()
bold_style.set_font_color('white')
bold_style.set_bg_color('F56A2F')
bold_style.set_bold()
# Add a total style to highlight total cells
total_style = workbook.add_format()
total_style.set_font_color('red')
total_style.set_bg_color('FAECC5')
total_style.set_bold()
# Add a style for money
money_style = workbook.add_format({'num_format': u'€#,##0'})
# Add green/red color for positive/negative numbers
#money_style.set_num_format('[Green]General;[Red]-General;General')
# Add a number format for cells with money
#money_style.set_num_format('0 "dollar and" .00 "cents"')
# Add content -------------------------------------------------------------
# Add content to the Expenses worksheet
expenses.write('A1', 'Hello world', bold_style)
expenses.write('A2', '12.33', money_style)
expenses.write('A3', 'Total', total_style)
# Save document -------------------------------------------------------------
# Save and close the file
workbook.close() | Add structure and first styles | Add structure and first styles
| Python | mit | openp2pdesign/FabLab-BusinessPlan | python | ## Code Before:
import xlsxwriter
# Create the file
workbook = xlsxwriter.Workbook('FabLab-BusinessPlan.xlsx')
# Create the worksheets
expenses = workbook.add_worksheet('Expenses')
activities = workbook.add_worksheet('Activities')
membership = workbook.add_worksheet('Membership')
total = workbook.add_worksheet('Total')
# Add content to the Expenses worksheet
expenses.write('A1', 'Hello world')
# Save and close the file
workbook.close()
## Instruction:
Add structure and first styles
## Code After:
import xlsxwriter
# Create document -------------------------------------------------------------
# Create the file
workbook = xlsxwriter.Workbook('FabLab-BusinessPlan.xlsx')
# Create the worksheets
expenses = workbook.add_worksheet('Expenses')
activities = workbook.add_worksheet('Activities')
membership = workbook.add_worksheet('Membership')
total = workbook.add_worksheet('Total')
# Create styles -------------------------------------------------------------
# Add a bold style to highlight heading cells
bold_style = workbook.add_format()
bold_style.set_font_color('white')
bold_style.set_bg_color('F56A2F')
bold_style.set_bold()
# Add a total style to highlight total cells
total_style = workbook.add_format()
total_style.set_font_color('red')
total_style.set_bg_color('FAECC5')
total_style.set_bold()
# Add a style for money
money_style = workbook.add_format({'num_format': u'€#,##0'})
# Add green/red color for positive/negative numbers
#money_style.set_num_format('[Green]General;[Red]-General;General')
# Add a number format for cells with money
#money_style.set_num_format('0 "dollar and" .00 "cents"')
# Add content -------------------------------------------------------------
# Add content to the Expenses worksheet
expenses.write('A1', 'Hello world', bold_style)
expenses.write('A2', '12.33', money_style)
expenses.write('A3', 'Total', total_style)
# Save document -------------------------------------------------------------
# Save and close the file
workbook.close() |
4e2d7b33310a31338472f413435e6e468404dda1 | scripts/build-git-lib.sh | scripts/build-git-lib.sh |
if [ $# -lt 1 ]; then
echo "\nUsage: $0 <giturl> [<refspec>]\n"
exit 1
fi
REPO_NAME=`basename "${1%.*}"`
if [ ! -z $LD_INSTALL_PREFIX ]; then
CONFIGURE_ARGS=--prefix=$LD_INSTALL_PREFIX
else
CONFIGURE_ARGS=
fi
if [ ! -z $2 ]; then
REFSPEC=$2
else
REFSPEC=origin/master
fi
if [ ! -d "$REPO_NAME" ]; then
echo "Repository $REPO_NAME not cloned. Cloning..."
git clone $1
cd $REPO_NAME
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
else
echo "Found repository $REPO_NAME."
cd $REPO_NAME
git fetch
if [ `git rev-parse HEAD` != `git rev-parse $REFSPEC` ]; then
echo "Local hash `git rev-parse HEAD` and Remote hash `git rev-parse $REFSPEC` differ. Rebuilding..."
git clean -fxd
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
fi
fi
cd ..
|
if [ $# -lt 1 ]; then
echo "\nUsage: $0 <giturl> [<refspec>]\n"
exit 1
fi
REPO_NAME=`basename "${1%.*}"`
if [ ! -z $LD_INSTALL_PREFIX ]; then
CONFIGURE_ARGS=--prefix=$LD_INSTALL_PREFIX
else
CONFIGURE_ARGS=
fi
if [ ! -z $2 ]; then
REFSPEC=$2
else
REFSPEC=origin/master
fi
if [ ! -d "$REPO_NAME" ]; then
echo "Repository $REPO_NAME not cloned. Cloning..."
git clone $1
cd $REPO_NAME
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
else
echo "Found repository $REPO_NAME."
cd $REPO_NAME
git fetch
LOCAL_HASH=`git rev-parse HEAD`
REMOTE_HASH=`git rev-list -n 1 $REFSPEC`
if [ $LOCAL_HASH != $REMOTE_HASH ]; then
echo "Local hash $LOCAL_HASH and remote hash $REMOTE_HASH differ. Rebuilding..."
git clean -fxd
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
fi
fi
cd ..
| Fix incorrect commit hash when building deps | Fix incorrect commit hash when building deps
| Shell | apache-2.0 | rickmak/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,rickmak/skygear-server,rickmak/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | shell | ## Code Before:
if [ $# -lt 1 ]; then
echo "\nUsage: $0 <giturl> [<refspec>]\n"
exit 1
fi
REPO_NAME=`basename "${1%.*}"`
if [ ! -z $LD_INSTALL_PREFIX ]; then
CONFIGURE_ARGS=--prefix=$LD_INSTALL_PREFIX
else
CONFIGURE_ARGS=
fi
if [ ! -z $2 ]; then
REFSPEC=$2
else
REFSPEC=origin/master
fi
if [ ! -d "$REPO_NAME" ]; then
echo "Repository $REPO_NAME not cloned. Cloning..."
git clone $1
cd $REPO_NAME
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
else
echo "Found repository $REPO_NAME."
cd $REPO_NAME
git fetch
if [ `git rev-parse HEAD` != `git rev-parse $REFSPEC` ]; then
echo "Local hash `git rev-parse HEAD` and Remote hash `git rev-parse $REFSPEC` differ. Rebuilding..."
git clean -fxd
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
fi
fi
cd ..
## Instruction:
Fix incorrect commit hash when building deps
## Code After:
if [ $# -lt 1 ]; then
echo "\nUsage: $0 <giturl> [<refspec>]\n"
exit 1
fi
REPO_NAME=`basename "${1%.*}"`
if [ ! -z $LD_INSTALL_PREFIX ]; then
CONFIGURE_ARGS=--prefix=$LD_INSTALL_PREFIX
else
CONFIGURE_ARGS=
fi
if [ ! -z $2 ]; then
REFSPEC=$2
else
REFSPEC=origin/master
fi
if [ ! -d "$REPO_NAME" ]; then
echo "Repository $REPO_NAME not cloned. Cloning..."
git clone $1
cd $REPO_NAME
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
else
echo "Found repository $REPO_NAME."
cd $REPO_NAME
git fetch
LOCAL_HASH=`git rev-parse HEAD`
REMOTE_HASH=`git rev-list -n 1 $REFSPEC`
if [ $LOCAL_HASH != $REMOTE_HASH ]; then
echo "Local hash $LOCAL_HASH and remote hash $REMOTE_HASH differ. Rebuilding..."
git clean -fxd
git checkout $REFSPEC
./autogen.sh
./configure $CONFIGURE_ARGS
make check
make install
fi
fi
cd ..
|
66ce8257b0164f8618b53d2fbe15bda4fa73fb33 | src/prototype/off.js | src/prototype/off.js | define([
'jquery',
'var/eventStorage',
'prototype/var/EmojioneArea'
],
function($, eventStorage, EmojioneArea) {
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i, event) {
if (eventStorage[id][event] && !/^@/.test(event)) {
if (handler) {
$.each(eventStorage[id][event], function(j, fn) {
if (fn === handler) {
eventStorage[id][event] = eventStorage[id][event].splice(j, 1);
}
});
} else {
eventStorage[id][event] = [];
}
}
});
}
return this;
};
}); | define([
'jquery',
'var/eventStorage',
'prototype/var/EmojioneArea'
],
function($, eventStorage, EmojioneArea) {
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i, event) {
if (eventStorage[id][event] && !/^@/.test(event)) {
if (handler) {
$.each(eventStorage[id][event], function(j, fn) {
if (fn === handler) {
eventStorage[id][event].splice(j, 1);
}
});
} else {
eventStorage[id][event] = [];
}
}
});
}
return this;
};
}); | Fix typo which causes memory leak. | Fix typo which causes memory leak.
| JavaScript | mit | mervick/emojionearea | javascript | ## Code Before:
define([
'jquery',
'var/eventStorage',
'prototype/var/EmojioneArea'
],
function($, eventStorage, EmojioneArea) {
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i, event) {
if (eventStorage[id][event] && !/^@/.test(event)) {
if (handler) {
$.each(eventStorage[id][event], function(j, fn) {
if (fn === handler) {
eventStorage[id][event] = eventStorage[id][event].splice(j, 1);
}
});
} else {
eventStorage[id][event] = [];
}
}
});
}
return this;
};
});
## Instruction:
Fix typo which causes memory leak.
## Code After:
define([
'jquery',
'var/eventStorage',
'prototype/var/EmojioneArea'
],
function($, eventStorage, EmojioneArea) {
EmojioneArea.prototype.off = function(events, handler) {
if (events) {
var id = this.id;
$.each(events.toLowerCase().replace(/_/g, '.').split(' '), function(i, event) {
if (eventStorage[id][event] && !/^@/.test(event)) {
if (handler) {
$.each(eventStorage[id][event], function(j, fn) {
if (fn === handler) {
eventStorage[id][event].splice(j, 1);
}
});
} else {
eventStorage[id][event] = [];
}
}
});
}
return this;
};
}); |
e87fc9172b9d56fe9d64cfda2fb36a3f71e69e70 | tests/test_utils.py | tests/test_utils.py |
import re
from jenkins_autojobs import main
def test_filter_jobs():
class Job:
def __init__(self, name):
self.name = name
class jenkins:
pass
names = ['feature-one', 'feature-two', 'release-one', 'release-two']
jenkins.jobs = [Job(i) for i in names]
filter_jobs = lambda **kw: {i.name for i in main.filter_jobs(jenkins, **kw)}
#-------------------------------------------------------------------------
assert filter_jobs() == {'feature-one', 'feature-two', 'release-one', 'release-two'}
res = filter_jobs(by_name_regex=[re.compile('feature-')])
assert res == {'feature-one', 'feature-two'}
res = filter_jobs(by_name_regex=[re.compile('.*one'), re.compile('.*two')])
assert res == {'feature-one', 'feature-two', 'release-one', 'release-two'}
#-------------------------------------------------------------------------
view_jobs = {
'v1': [Job('scratch-one'), Job('scratch-two')],
'v2': [Job('release-one'), Job('maintenance-three')]
}
jenkins.view_jobs = lambda x: view_jobs[x]
res = filter_jobs(by_views=['v1'])
assert res == {'scratch-one', 'scratch-two'}
res = filter_jobs(by_views=['v1', 'v2'])
assert res == {'scratch-one', 'scratch-two', 'release-one', 'maintenance-three'}
|
import re
from jenkins_autojobs import main
def test_filter_jobs():
class Job:
def __init__(self, name):
self.name = name
class jenkins:
@staticmethod
def view_jobs(x):
return {
'v1': [Job('scratch-one'), Job('scratch-two')],
'v2': [Job('release-one'), Job('maintenance-three')]
}[x]
names = ['feature-one', 'feature-two', 'release-one', 'release-two']
jenkins.jobs = [Job(i) for i in names]
filter_jobs = lambda **kw: {i.name for i in main.filter_jobs(jenkins, **kw)}
#-------------------------------------------------------------------------
assert filter_jobs() == {'feature-one', 'feature-two', 'release-one', 'release-two'}
res = filter_jobs(by_name_regex=[re.compile('feature-')])
assert res == {'feature-one', 'feature-two'}
res = filter_jobs(by_name_regex=[re.compile('.*one'), re.compile('.*two')])
assert res == {'feature-one', 'feature-two', 'release-one', 'release-two'}
#-------------------------------------------------------------------------
res = filter_jobs(by_views=['v1'])
assert res == {'scratch-one', 'scratch-two'}
res = filter_jobs(by_views=['v1', 'v2'])
assert res == {'scratch-one', 'scratch-two', 'release-one', 'maintenance-three'}
| Fix tests on Python 2 | Fix tests on Python 2
| Python | bsd-3-clause | gvalkov/jenkins-autojobs,gvalkov/jenkins-autojobs | python | ## Code Before:
import re
from jenkins_autojobs import main
def test_filter_jobs():
class Job:
def __init__(self, name):
self.name = name
class jenkins:
pass
names = ['feature-one', 'feature-two', 'release-one', 'release-two']
jenkins.jobs = [Job(i) for i in names]
filter_jobs = lambda **kw: {i.name for i in main.filter_jobs(jenkins, **kw)}
#-------------------------------------------------------------------------
assert filter_jobs() == {'feature-one', 'feature-two', 'release-one', 'release-two'}
res = filter_jobs(by_name_regex=[re.compile('feature-')])
assert res == {'feature-one', 'feature-two'}
res = filter_jobs(by_name_regex=[re.compile('.*one'), re.compile('.*two')])
assert res == {'feature-one', 'feature-two', 'release-one', 'release-two'}
#-------------------------------------------------------------------------
view_jobs = {
'v1': [Job('scratch-one'), Job('scratch-two')],
'v2': [Job('release-one'), Job('maintenance-three')]
}
jenkins.view_jobs = lambda x: view_jobs[x]
res = filter_jobs(by_views=['v1'])
assert res == {'scratch-one', 'scratch-two'}
res = filter_jobs(by_views=['v1', 'v2'])
assert res == {'scratch-one', 'scratch-two', 'release-one', 'maintenance-three'}
## Instruction:
Fix tests on Python 2
## Code After:
import re
from jenkins_autojobs import main
def test_filter_jobs():
class Job:
def __init__(self, name):
self.name = name
class jenkins:
@staticmethod
def view_jobs(x):
return {
'v1': [Job('scratch-one'), Job('scratch-two')],
'v2': [Job('release-one'), Job('maintenance-three')]
}[x]
names = ['feature-one', 'feature-two', 'release-one', 'release-two']
jenkins.jobs = [Job(i) for i in names]
filter_jobs = lambda **kw: {i.name for i in main.filter_jobs(jenkins, **kw)}
#-------------------------------------------------------------------------
assert filter_jobs() == {'feature-one', 'feature-two', 'release-one', 'release-two'}
res = filter_jobs(by_name_regex=[re.compile('feature-')])
assert res == {'feature-one', 'feature-two'}
res = filter_jobs(by_name_regex=[re.compile('.*one'), re.compile('.*two')])
assert res == {'feature-one', 'feature-two', 'release-one', 'release-two'}
#-------------------------------------------------------------------------
res = filter_jobs(by_views=['v1'])
assert res == {'scratch-one', 'scratch-two'}
res = filter_jobs(by_views=['v1', 'v2'])
assert res == {'scratch-one', 'scratch-two', 'release-one', 'maintenance-three'}
|
fb56a25808a44bd6b34fb216f8efa06b60e5293f | README.md | README.md | Mobile first, lightweight and responsive grid system
| A mobile first, lightweight and responsive grid system.
##Inspiration
In order to make this grid system I was inspired in a the tutorial "Creating Your Own CSS Grid System" by Jan Drewniak.
| Add thanks to section in the readme | Add thanks to section in the readme
| Markdown | apache-2.0 | jaumecapdevila/inthebones,jaumecapdevila/inthebones | markdown | ## Code Before:
Mobile first, lightweight and responsive grid system
## Instruction:
Add thanks to section in the readme
## Code After:
A mobile first, lightweight and responsive grid system.
##Inspiration
In order to make this grid system I was inspired in a the tutorial "Creating Your Own CSS Grid System" by Jan Drewniak.
|
08a48989fafffc5286b26752ad1d1a2922d74e25 | app/views/images/new.html.erb | app/views/images/new.html.erb | <!-- this is a partial, a box that pops up over an album -->
<!-- can pick img on device or upload from url -->
<!-- can select multiple images -->
<!-- can X out of this partial to cancel uploading images to this album -->
| <!-- this is a partial, a box that pops up over an album -->
<!-- can pick img on device or upload from url -->
<!-- can select multiple images -->
<!-- can X out of this partial to cancel uploading images to this album -->
<%= cloudinary_js_config %>
<%= form_for :image, url: image_path do |f| %>
<%= render "shared/errors" %>
<%= f.label :file %>
<%= f.hidden_field(:file_cache) %>
<%= f.file_field(:file) %>
<%= f.label :caption %>
<%= f.text_field :caption %>
<%= f.submit "Upload" %>
<% end %>
| Update image upload form to include cloudinary | Update image upload form to include cloudinary
| HTML+ERB | mit | chi-fiddler-crabs-2015/Photo-Plop,chi-fiddler-crabs-2015/Photo-Plop,chi-fiddler-crabs-2015/Photo-Plop | html+erb | ## Code Before:
<!-- this is a partial, a box that pops up over an album -->
<!-- can pick img on device or upload from url -->
<!-- can select multiple images -->
<!-- can X out of this partial to cancel uploading images to this album -->
## Instruction:
Update image upload form to include cloudinary
## Code After:
<!-- this is a partial, a box that pops up over an album -->
<!-- can pick img on device or upload from url -->
<!-- can select multiple images -->
<!-- can X out of this partial to cancel uploading images to this album -->
<%= cloudinary_js_config %>
<%= form_for :image, url: image_path do |f| %>
<%= render "shared/errors" %>
<%= f.label :file %>
<%= f.hidden_field(:file_cache) %>
<%= f.file_field(:file) %>
<%= f.label :caption %>
<%= f.text_field :caption %>
<%= f.submit "Upload" %>
<% end %>
|
073b55113ac91b2f6fcfbebe9550f0740f8149d4 | jxaas/utils.py | jxaas/utils.py | import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
| import logging
import os
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
url = os.getenv('JXAAS_URL', "http://127.0.0.1:8080/xaas")
client = jujuxaas.client.Client(url=url, tenant=tenant, username=username, password=password)
return client
| Allow JXAAS_URL to be configured as an env var | Allow JXAAS_URL to be configured as an env var
| Python | apache-2.0 | jxaas/cli | python | ## Code Before:
import logging
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
client = jujuxaas.client.Client(url="http://127.0.0.1:8080/xaas", tenant=tenant, username=username, password=password)
return client
## Instruction:
Allow JXAAS_URL to be configured as an env var
## Code After:
import logging
import os
from cliff.command import Command
import jujuxaas.client
def get_jxaas_client(command):
tenant = 'abcdef'
username = '123'
password= '123'
url = os.getenv('JXAAS_URL', "http://127.0.0.1:8080/xaas")
client = jujuxaas.client.Client(url=url, tenant=tenant, username=username, password=password)
return client
|
0e9e68232687b34b75e4d29e5540e57ad6bd21ab | tests/integration/components/progress-bar/component-test.js | tests/integration/components/progress-bar/component-test.js | import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('progress-bar', 'Integration | Component | progress bar', {
integration: true
});
test('it renders with correct width', function(assert) {
this.set('pageNumber', 1);
this.render(hbs`{{progress-bar pageNumber=pageNumber}}`);
var width = (1 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${width}%;`);
});
| import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('progress-bar', 'Integration | Component | progress bar', {
integration: true
});
test('it renders with correct width', function(assert) {
this.set('pageNumber', 1);
this.render(hbs`{{progress-bar pageNumber=pageNumber}}`);
var width = (1 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${width}%;`);
});
test('it changes width when pageNumber changes', function(assert) {
this.set('pageNumber', 2);
this.render(hbs`{{progress-bar pageNumber=pageNumber}}`);
var width = (2 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${width}%;`);
this.set('pageNumber', 3);
var newWidth = (3 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${newWidth}%;`);
});
| Test progress bar width changes on page change | Test progress bar width changes on page change
| JavaScript | apache-2.0 | CenterForOpenScience/isp,CenterForOpenScience/isp,CenterForOpenScience/isp | javascript | ## Code Before:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('progress-bar', 'Integration | Component | progress bar', {
integration: true
});
test('it renders with correct width', function(assert) {
this.set('pageNumber', 1);
this.render(hbs`{{progress-bar pageNumber=pageNumber}}`);
var width = (1 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${width}%;`);
});
## Instruction:
Test progress bar width changes on page change
## Code After:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('progress-bar', 'Integration | Component | progress bar', {
integration: true
});
test('it renders with correct width', function(assert) {
this.set('pageNumber', 1);
this.render(hbs`{{progress-bar pageNumber=pageNumber}}`);
var width = (1 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${width}%;`);
});
test('it changes width when pageNumber changes', function(assert) {
this.set('pageNumber', 2);
this.render(hbs`{{progress-bar pageNumber=pageNumber}}`);
var width = (2 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${width}%;`);
this.set('pageNumber', 3);
var newWidth = (3 / 11) * 100;
assert.equal(this.$('.progress-bar').attr('style'), `width: ${newWidth}%;`);
});
|
59cb26bd500b5832b31534de436a606245589a6d | benchmark/src/test/scala/japgolly/scalajs/benchmark/engine/TimeUtilTest.scala | benchmark/src/test/scala/japgolly/scalajs/benchmark/engine/TimeUtilTest.scala | package japgolly.scalajs.benchmark.engine
import japgolly.microlibs.testutil.TestUtil._
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.{FiniteDuration, TimeUnit}
import sourcecode.Line
import utest._
object TimeUtilTest extends TestSuite {
override def tests = Tests {
"getUnitsFromMs" - {
def test(t: TimeUnit)(implicit l: Line): Unit = {
val one = FiniteDuration(1, t)
assertEq(TimeUtil.getUnitsFromMs(t)(TimeUtil.toMs(one)), 1)
}
"NANOSECONDS" - test(TimeUnit.NANOSECONDS)
"MICROSECONDS" - test(TimeUnit.MICROSECONDS)
"MILLISECONDS" - test(TimeUnit.MILLISECONDS)
"SECONDS" - test(TimeUnit.SECONDS)
"MINUTES" - test(TimeUnit.MINUTES)
"HOURS" - test(TimeUnit.HOURS)
"DAYS" - test(TimeUnit.DAYS)
}
}
}
| package japgolly.scalajs.benchmark.engine
import japgolly.microlibs.testutil.TestUtil._
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.{FiniteDuration, TimeUnit}
import sourcecode.Line
import utest._
object TimeUtilTest extends TestSuite {
override def tests = Tests {
"getUnitsFromMs" - {
def test(t: TimeUnit)(implicit l: Line): Unit = {
val oneAsMs = TimeUtil.toMs(FiniteDuration(1, t))
assertEq(TimeUtil.getUnitsFromMs(t)(oneAsMs), 1)
}
"NANOSECONDS" - test(TimeUnit.NANOSECONDS)
"MICROSECONDS" - test(TimeUnit.MICROSECONDS)
"MILLISECONDS" - test(TimeUnit.MILLISECONDS)
"SECONDS" - test(TimeUnit.SECONDS)
"MINUTES" - test(TimeUnit.MINUTES)
"HOURS" - test(TimeUnit.HOURS)
"DAYS" - test(TimeUnit.DAYS)
}
}
}
| Make test a bit clearer | Make test a bit clearer
| Scala | apache-2.0 | japgolly/scalajs-benchmark,japgolly/scalajs-benchmark | scala | ## Code Before:
package japgolly.scalajs.benchmark.engine
import japgolly.microlibs.testutil.TestUtil._
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.{FiniteDuration, TimeUnit}
import sourcecode.Line
import utest._
object TimeUtilTest extends TestSuite {
override def tests = Tests {
"getUnitsFromMs" - {
def test(t: TimeUnit)(implicit l: Line): Unit = {
val one = FiniteDuration(1, t)
assertEq(TimeUtil.getUnitsFromMs(t)(TimeUtil.toMs(one)), 1)
}
"NANOSECONDS" - test(TimeUnit.NANOSECONDS)
"MICROSECONDS" - test(TimeUnit.MICROSECONDS)
"MILLISECONDS" - test(TimeUnit.MILLISECONDS)
"SECONDS" - test(TimeUnit.SECONDS)
"MINUTES" - test(TimeUnit.MINUTES)
"HOURS" - test(TimeUnit.HOURS)
"DAYS" - test(TimeUnit.DAYS)
}
}
}
## Instruction:
Make test a bit clearer
## Code After:
package japgolly.scalajs.benchmark.engine
import japgolly.microlibs.testutil.TestUtil._
import java.util.concurrent.TimeUnit
import scala.concurrent.duration.{FiniteDuration, TimeUnit}
import sourcecode.Line
import utest._
object TimeUtilTest extends TestSuite {
override def tests = Tests {
"getUnitsFromMs" - {
def test(t: TimeUnit)(implicit l: Line): Unit = {
val oneAsMs = TimeUtil.toMs(FiniteDuration(1, t))
assertEq(TimeUtil.getUnitsFromMs(t)(oneAsMs), 1)
}
"NANOSECONDS" - test(TimeUnit.NANOSECONDS)
"MICROSECONDS" - test(TimeUnit.MICROSECONDS)
"MILLISECONDS" - test(TimeUnit.MILLISECONDS)
"SECONDS" - test(TimeUnit.SECONDS)
"MINUTES" - test(TimeUnit.MINUTES)
"HOURS" - test(TimeUnit.HOURS)
"DAYS" - test(TimeUnit.DAYS)
}
}
}
|
d8c2b7367e9530f0876673c39dcc3dc858cda689 | src/sass/Fabric.Components.scss | src/sass/Fabric.Components.scss | @import 'Fabric.Common';
@import '../components/Breadcrumb/Breadcrumb';
@import '../components/Button/Button';
@import '../components/Callout/Callout';
@import '../components/ChoiceField/ChoiceField';
@import '../components/CommandBar/CommandBar';
@import '../components/ContextualMenu/ContextualMenu';
@import '../components/DatePicker/DatePicker';
@import '../components/Dialog/Dialog';
@import '../components/Dropdown/Dropdown';
@import '../components/Label/Label';
@import '../components/Link/Link';
@import '../components/List/List';
@import '../components/ListItem/ListItem';
@import '../components/MessageBanner/MessageBanner';
@import '../components/NavBar/NavBar';
@import '../components/OrgChart/OrgChart';
@import '../components/Overlay/Overlay';
@import '../components/Panel/Panel';
@import '../components/PeoplePicker/PeoplePicker';
@import '../components/Persona/Persona';
@import '../components/PersonaCard/PersonaCard';
@import '../components/Pivot/Pivot';
@import '../components/ProgressIndicator/ProgressIndicator';
@import '../components/SearchBox/SearchBox';
@import '../components/Spinner/Spinner';
@import '../components/Table/Table';
@import '../components/TextField/TextField';
@import '../components/Toggle/Toggle';
| @import 'Fabric.Common';
@import '../components/Breadcrumb/Breadcrumb';
@import '../components/Button/Button';
@import '../components/Callout/Callout';
@import '../components/ChoiceField/ChoiceField';
@import '../components/CommandBar/CommandBar';
@import '../components/ContextualMenu/ContextualMenu';
@import '../components/DatePicker/DatePicker';
@import '../components/Dialog/Dialog';
@import '../components/Dropdown/Dropdown';
@import '../components/Facepile/Facepile';
@import '../components/Label/Label';
@import '../components/Link/Link';
@import '../components/List/List';
@import '../components/ListItem/ListItem';
@import '../components/MessageBanner/MessageBanner';
@import '../components/NavBar/NavBar';
@import '../components/OrgChart/OrgChart';
@import '../components/Overlay/Overlay';
@import '../components/Panel/Panel';
@import '../components/PeoplePicker/PeoplePicker';
@import '../components/Persona/Persona';
@import '../components/PersonaCard/PersonaCard';
@import '../components/Pivot/Pivot';
@import '../components/ProgressIndicator/ProgressIndicator';
@import '../components/SearchBox/SearchBox';
@import '../components/Spinner/Spinner';
@import '../components/Table/Table';
@import '../components/TextField/TextField';
@import '../components/Toggle/Toggle';
| Add Facepile component back to Fabric components | Add Facepile component back to Fabric components
| SCSS | mit | zkoehne/Office-UI-Fabric,zkoehne/Office-UI-Fabric,waldekmastykarz/Office-UI-Fabric,OfficeDev/Office-UI-Fabric,OfficeDev/Office-UI-Fabric,waldekmastykarz/Office-UI-Fabric | scss | ## Code Before:
@import 'Fabric.Common';
@import '../components/Breadcrumb/Breadcrumb';
@import '../components/Button/Button';
@import '../components/Callout/Callout';
@import '../components/ChoiceField/ChoiceField';
@import '../components/CommandBar/CommandBar';
@import '../components/ContextualMenu/ContextualMenu';
@import '../components/DatePicker/DatePicker';
@import '../components/Dialog/Dialog';
@import '../components/Dropdown/Dropdown';
@import '../components/Label/Label';
@import '../components/Link/Link';
@import '../components/List/List';
@import '../components/ListItem/ListItem';
@import '../components/MessageBanner/MessageBanner';
@import '../components/NavBar/NavBar';
@import '../components/OrgChart/OrgChart';
@import '../components/Overlay/Overlay';
@import '../components/Panel/Panel';
@import '../components/PeoplePicker/PeoplePicker';
@import '../components/Persona/Persona';
@import '../components/PersonaCard/PersonaCard';
@import '../components/Pivot/Pivot';
@import '../components/ProgressIndicator/ProgressIndicator';
@import '../components/SearchBox/SearchBox';
@import '../components/Spinner/Spinner';
@import '../components/Table/Table';
@import '../components/TextField/TextField';
@import '../components/Toggle/Toggle';
## Instruction:
Add Facepile component back to Fabric components
## Code After:
@import 'Fabric.Common';
@import '../components/Breadcrumb/Breadcrumb';
@import '../components/Button/Button';
@import '../components/Callout/Callout';
@import '../components/ChoiceField/ChoiceField';
@import '../components/CommandBar/CommandBar';
@import '../components/ContextualMenu/ContextualMenu';
@import '../components/DatePicker/DatePicker';
@import '../components/Dialog/Dialog';
@import '../components/Dropdown/Dropdown';
@import '../components/Facepile/Facepile';
@import '../components/Label/Label';
@import '../components/Link/Link';
@import '../components/List/List';
@import '../components/ListItem/ListItem';
@import '../components/MessageBanner/MessageBanner';
@import '../components/NavBar/NavBar';
@import '../components/OrgChart/OrgChart';
@import '../components/Overlay/Overlay';
@import '../components/Panel/Panel';
@import '../components/PeoplePicker/PeoplePicker';
@import '../components/Persona/Persona';
@import '../components/PersonaCard/PersonaCard';
@import '../components/Pivot/Pivot';
@import '../components/ProgressIndicator/ProgressIndicator';
@import '../components/SearchBox/SearchBox';
@import '../components/Spinner/Spinner';
@import '../components/Table/Table';
@import '../components/TextField/TextField';
@import '../components/Toggle/Toggle';
|
6db8ae678752d563ee7f1aa5a9232de26a9d480a | resources/flyingSnake2d_cuibm_anush/timeAveragedLiftDragCoefficientsCuIBMAnush.txt | resources/flyingSnake2d_cuibm_anush/timeAveragedLiftDragCoefficientsCuIBMAnush.txt | 1000 25 0.9428 1.5376 0.3925
1000 30 1.0519 1.7068 0.3728
1000 35 1.2086 1.8759 0.3541
1000 40 1.4882 1.8410 0
2000 25 0.889 1.415
2000 30 0.967 1.532
2000 35 1.316 2.147
2000 40 1.707 1.862
| 1000 25 0.9428 1.5376 0.3925
1000 30 1.0519 1.7068 0.3728
1000 35 1.2086 1.8759 0.3541
1000 40 1.4882 1.8410 0
2000 25 0.8889 1.4148 0.3622
2000 30 0.9674 1.5324 0.3360
2000 35 1.3162 2.1471 0.3845
2000 40 1.7074 1.8617 0
| Update time-averaged coefficients and add Strouhal number | Update time-averaged coefficients and add Strouhal number
| Text | mit | mesnardo/snake | text | ## Code Before:
1000 25 0.9428 1.5376 0.3925
1000 30 1.0519 1.7068 0.3728
1000 35 1.2086 1.8759 0.3541
1000 40 1.4882 1.8410 0
2000 25 0.889 1.415
2000 30 0.967 1.532
2000 35 1.316 2.147
2000 40 1.707 1.862
## Instruction:
Update time-averaged coefficients and add Strouhal number
## Code After:
1000 25 0.9428 1.5376 0.3925
1000 30 1.0519 1.7068 0.3728
1000 35 1.2086 1.8759 0.3541
1000 40 1.4882 1.8410 0
2000 25 0.8889 1.4148 0.3622
2000 30 0.9674 1.5324 0.3360
2000 35 1.3162 2.1471 0.3845
2000 40 1.7074 1.8617 0
|
53ade6629935c05653eb9dc35237597602ef061d | gulp/tasks/browserSync.js | gulp/tasks/browserSync.js | 'use strict';
import config from '../config';
import url from 'url';
import browserSync from 'browser-sync';
import gulp from 'gulp';
gulp.task('browserSync', function() {
const DEFAULT_FILE = 'index.html';
const ASSET_EXTENSIONS = ['js', 'css', 'png', 'jpg', 'jpeg', 'gif'];
browserSync.init({
server: {
baseDir: config.buildDir,
middleware: function(req, res, next) {
let fileHrefArray = url.parse(req.url).href.split('.');
let fileExtension = fileHrefArray[fileHrefArray.length - 1];
if ( ASSET_EXTENSIONS.indexOf(fileExtension) === -1 ) {
req.url = '/' + DEFAULT_FILE;
}
return next();
}
},
port: config.browserPort,
ui: {
port: config.UIPort
},
ghostMode: {
links: false
}
});
});
| 'use strict';
import config from '../config';
import url from 'url';
import browserSync from 'browser-sync';
import gulp from 'gulp';
gulp.task('browserSync', function() {
const DEFAULT_FILE = 'index.html';
const ASSET_EXTENSION_REGEX = /\b(?!\?)\.(js|css|png|jpe?g|gif|svg|eot|otf|ttc|ttf|woff2?)(?!\.)/i;
browserSync.init({
server: {
baseDir: config.buildDir,
middleware: function(req, res, next) {
let fileHref = url.parse(req.url).href;
if ( !ASSET_EXTENSION_REGEX.test(fileHref) ) {
req.url = '/' + DEFAULT_FILE;
}
return next();
}
},
port: config.browserPort,
ui: {
port: config.UIPort
},
ghostMode: {
links: false
}
});
});
| Fix not being able to serve fonts and other assets using query string cache busters. | Fix not being able to serve fonts and other assets using query string cache busters.
| JavaScript | mit | StrikeForceZero/angularjs-ionic-gulp-browserify-boilerplate,tungptvn/tungpts-ng-blog,adamcolejenkins/dotcom,henrymyers/quotes,cshaver/angularjs-gulp-browserify-boilerplate,dnaloco/digitala,cshaver/angularjs-gulp-browserify-boilerplate,dnaloco/digitala,Deftunk/TestCircleCi,StrikeForceZero/angularjs-ionic-gulp-browserify-boilerplate,ropollock/eve-opportunity-ui,henrymyers/quotes,jakemmarsh/angularjs-gulp-browserify-boilerplate,Mojility/angularjs-gulp-browserify-boilerplate,Cogniance/angular1-boilerplate,Deftunk/TestCircleCi,ray-mash/sbsa-assessment,jakemmarsh/angularjs-gulp-browserify-boilerplate,adamcolejenkins/dotcom,Mojility/angularjs-gulp-browserify-boilerplate,dnaloco/digitala,bnmnjohnson/brandnewmedia-au,dkim-95112/infosys,DrewML/angularjs-gulp-browserify-boilerplate,mjpoteet/youtubeapi,ropollock/eve-opportunity-ui,bnmnjohnson/brandnewmedia-au,aneeshd16/Sachin-Sachin,dkim-95112/infosys,tungptvn/tungpts-ng-blog,bnmnjohnson/brandnewmedia-au,aneeshd16/Sachin-Sachin,mjpoteet/youtubeapi,DrewML/angularjs-gulp-browserify-boilerplate,jfarribillaga/angular16,jfarribillaga/angular16,ray-mash/sbsa-assessment,tungptvn/tungpts-ng-blog,Cogniance/angular1-boilerplate,dnaloco/digitala | javascript | ## Code Before:
'use strict';
import config from '../config';
import url from 'url';
import browserSync from 'browser-sync';
import gulp from 'gulp';
gulp.task('browserSync', function() {
const DEFAULT_FILE = 'index.html';
const ASSET_EXTENSIONS = ['js', 'css', 'png', 'jpg', 'jpeg', 'gif'];
browserSync.init({
server: {
baseDir: config.buildDir,
middleware: function(req, res, next) {
let fileHrefArray = url.parse(req.url).href.split('.');
let fileExtension = fileHrefArray[fileHrefArray.length - 1];
if ( ASSET_EXTENSIONS.indexOf(fileExtension) === -1 ) {
req.url = '/' + DEFAULT_FILE;
}
return next();
}
},
port: config.browserPort,
ui: {
port: config.UIPort
},
ghostMode: {
links: false
}
});
});
## Instruction:
Fix not being able to serve fonts and other assets using query string cache busters.
## Code After:
'use strict';
import config from '../config';
import url from 'url';
import browserSync from 'browser-sync';
import gulp from 'gulp';
gulp.task('browserSync', function() {
const DEFAULT_FILE = 'index.html';
const ASSET_EXTENSION_REGEX = /\b(?!\?)\.(js|css|png|jpe?g|gif|svg|eot|otf|ttc|ttf|woff2?)(?!\.)/i;
browserSync.init({
server: {
baseDir: config.buildDir,
middleware: function(req, res, next) {
let fileHref = url.parse(req.url).href;
if ( !ASSET_EXTENSION_REGEX.test(fileHref) ) {
req.url = '/' + DEFAULT_FILE;
}
return next();
}
},
port: config.browserPort,
ui: {
port: config.UIPort
},
ghostMode: {
links: false
}
});
});
|
5ba0fb8687bbd176f8fdc22864cc60aeb3b8976e | tools/perf/page_sets/pica.json | tools/perf/page_sets/pica.json | {
"description": "Pica demo app for the Polymer UI toolkit",
"archive_data_file": "../data/pica.json",
"pages": [
{ "url": "http://www.polymer-project.org/polymer-all/projects/pica/index.html",
"script_to_evaluate_on_commit":
"document.addEventListener('WebComponentsReady', function(){var unused = document.body.offsetHeight; window.__pica_load_time = performance.now(); setTimeout(function(){window.__web_components_ready=true}, 1000)})",
"navigate_steps" : [
{ "action": "navigate" },
{ "action": "wait", "javascript": "window.__web_components_ready" }
],
"smoothness": {
"action": "tap_element",
"find_element_expression": "document.querySelector('pi-app').$.Topics.$.topics.$.container.querySelector('.item > .card')",
"wait_for_event": "g-panels-select"
}
}
]
}
| {
"description": "Pica demo app for the Polymer UI toolkit",
"archive_data_file": "../data/pica.json",
"pages": [
{ "url": "http://localhost/polymer/projects/pica/",
"script_to_evaluate_on_commit":
"document.addEventListener('WebComponentsReady', function(){var unused = document.body.offsetHeight; window.__pica_load_time = performance.now(); setTimeout(function(){window.__web_components_ready=true}, 1000)})",
"navigate_steps" : [
{ "action": "navigate" },
{ "action": "wait", "javascript": "window.__web_components_ready" }
],
"smoothness": {
"action": "tap_element",
"find_element_expression": "document.querySelector('pi-app').$.Topics.$.topics.$.container.querySelector('.item > .card')",
"wait_for_event": "g-panels-select"
}
}
]
}
| Move to localhost-based URL for Pica benchmark | Move to localhost-based URL for Pica benchmark
Will update data to match (including both new and old URLs) before landing.
R=tonyg@chromium.org
Review URL: https://codereview.chromium.org/23450024
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@221743 0039d316-1c4b-4281-b951-d872f2087c98
| JSON | bsd-3-clause | ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,dednal/chromium.src,M4sse/chromium.src,dednal/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,jaruba/chromium.src,littlstar/chromium.src,Just-D/chromium-1,markYoungH/chromium.src,dednal/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,dednal/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,patrickm/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,anirudhSK/chromium,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,patrickm/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,Just-D/chromium-1,anirudhSK/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,M4sse/chromium.src,dednal/chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,patrickm/chromium.src,M4sse/chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,anirudhSK/chromium,bright-sparks/chromium-spacewalk,Just-D/chromium-1,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,ChromiumWebApps/chromium,markYoungH/chromium.src,Just-D/chromium-1,littlstar/chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,M4sse/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,ltilve/chromium,ltilve/chromium,ondra-novak/chromium.src,dushu1203/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,ondra-novak/chromium.src,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,dushu1203/chromium.src,jaruba/chromium.src,dednal/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,ltilve/chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,jaruba/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,anirudhSK/chromium,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,littlstar/chromium.src,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,Chilledheart/chromium,ltilve/chromium,ChromiumWebApps/chromium,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,ltilve/chromium,Jonekee/chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,jaruba/chromium.src,littlstar/chromium.src,Chilledheart/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,littlstar/chromium.src,anirudhSK/chromium,patrickm/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,Just-D/chromium-1 | json | ## Code Before:
{
"description": "Pica demo app for the Polymer UI toolkit",
"archive_data_file": "../data/pica.json",
"pages": [
{ "url": "http://www.polymer-project.org/polymer-all/projects/pica/index.html",
"script_to_evaluate_on_commit":
"document.addEventListener('WebComponentsReady', function(){var unused = document.body.offsetHeight; window.__pica_load_time = performance.now(); setTimeout(function(){window.__web_components_ready=true}, 1000)})",
"navigate_steps" : [
{ "action": "navigate" },
{ "action": "wait", "javascript": "window.__web_components_ready" }
],
"smoothness": {
"action": "tap_element",
"find_element_expression": "document.querySelector('pi-app').$.Topics.$.topics.$.container.querySelector('.item > .card')",
"wait_for_event": "g-panels-select"
}
}
]
}
## Instruction:
Move to localhost-based URL for Pica benchmark
Will update data to match (including both new and old URLs) before landing.
R=tonyg@chromium.org
Review URL: https://codereview.chromium.org/23450024
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@221743 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
{
"description": "Pica demo app for the Polymer UI toolkit",
"archive_data_file": "../data/pica.json",
"pages": [
{ "url": "http://localhost/polymer/projects/pica/",
"script_to_evaluate_on_commit":
"document.addEventListener('WebComponentsReady', function(){var unused = document.body.offsetHeight; window.__pica_load_time = performance.now(); setTimeout(function(){window.__web_components_ready=true}, 1000)})",
"navigate_steps" : [
{ "action": "navigate" },
{ "action": "wait", "javascript": "window.__web_components_ready" }
],
"smoothness": {
"action": "tap_element",
"find_element_expression": "document.querySelector('pi-app').$.Topics.$.topics.$.container.querySelector('.item > .card')",
"wait_for_event": "g-panels-select"
}
}
]
}
|
2917e089734ace4fd212ef9a16e8adf71d671312 | test/partial_double_test.py | test/partial_double_test.py | from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return('Bob')
assert user.get_name() == 'Bob'
def test_restores_original(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return('Bob')
teardown()
assert user.get_name() == 'Alice'
| from doubles import allow, teardown
class User(object):
def __init__(self, name, age):
self.name = name
self._age = age
@property
def age(self):
return self._age
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice', 25)
allow(user).to_receive('get_name').and_return('Bob')
assert user.get_name() == 'Bob'
def test_restores_original(self):
user = User('Alice', 25)
allow(user).to_receive('get_name').and_return('Bob')
teardown()
assert user.get_name() == 'Alice'
def test_only_affects_stubbed_method(self):
user = User('Alice', 25)
allow(user).to_receive('get_name').and_return('Bob')
assert user.age == 25
| Test that only stubbed methods are altered on partial doubles. | Test that only stubbed methods are altered on partial doubles.
| Python | mit | uber/doubles | python | ## Code Before:
from doubles import allow, teardown
class User(object):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return('Bob')
assert user.get_name() == 'Bob'
def test_restores_original(self):
user = User('Alice')
allow(user).to_receive('get_name').and_return('Bob')
teardown()
assert user.get_name() == 'Alice'
## Instruction:
Test that only stubbed methods are altered on partial doubles.
## Code After:
from doubles import allow, teardown
class User(object):
def __init__(self, name, age):
self.name = name
self._age = age
@property
def age(self):
return self._age
def get_name(self):
return self.name
class TestPartialDouble(object):
def test_stubs_real_object(self):
user = User('Alice', 25)
allow(user).to_receive('get_name').and_return('Bob')
assert user.get_name() == 'Bob'
def test_restores_original(self):
user = User('Alice', 25)
allow(user).to_receive('get_name').and_return('Bob')
teardown()
assert user.get_name() == 'Alice'
def test_only_affects_stubbed_method(self):
user = User('Alice', 25)
allow(user).to_receive('get_name').and_return('Bob')
assert user.age == 25
|
77b25dae8340823d68f5ec3b4daaf3789d2c35f6 | .travis.yml | .travis.yml | osx_image: xcode7.3
dist: trusty
sudo: false
language: c
git:
submodules: false
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
cache:
directories:
- node_modules
- $HOME/.electron
- $HOME/.cache
addons:
apt:
packages:
- libgnome-keyring-dev
- libsecret-1-dev
- icnsutils
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.5.5/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.5.5.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
install:
- nvm install 7
- yarn install
script:
- yarn run dist
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/" | osx_image: xcode7.3
dist: trusty
sudo: false
language: c
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
cache:
directories:
- node_modules
- $HOME/.electron
- $HOME/.cache
addons:
apt:
packages:
- libgnome-keyring-dev
- libsecret-1-dev
- icnsutils
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.5.5/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.5.5.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- brew update
- brew install wine --without-x11
- brew install mono
- brew install gnu-tar graphicsmagick xz
install:
- nvm install 7
- yarn install
script:
- yarn run dist
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/" | Add installation of multi-platform dependencies in Travis file | Add installation of multi-platform dependencies in Travis file
| YAML | bsd-3-clause | menpo/landmarker-app,menpo/landmarker-app,menpo/landmarker-app,menpo/landmarker.app,menpo/landmarker.app | yaml | ## Code Before:
osx_image: xcode7.3
dist: trusty
sudo: false
language: c
git:
submodules: false
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
cache:
directories:
- node_modules
- $HOME/.electron
- $HOME/.cache
addons:
apt:
packages:
- libgnome-keyring-dev
- libsecret-1-dev
- icnsutils
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.5.5/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.5.5.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
install:
- nvm install 7
- yarn install
script:
- yarn run dist
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/"
## Instruction:
Add installation of multi-platform dependencies in Travis file
## Code After:
osx_image: xcode7.3
dist: trusty
sudo: false
language: c
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
cache:
directories:
- node_modules
- $HOME/.electron
- $HOME/.cache
addons:
apt:
packages:
- libgnome-keyring-dev
- libsecret-1-dev
- icnsutils
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.5.5/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.5.5.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- brew update
- brew install wine --without-x11
- brew install mono
- brew install gnu-tar graphicsmagick xz
install:
- nvm install 7
- yarn install
script:
- yarn run dist
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/" |
2f29388c299130c2aedfb8403033b07269b7f7c0 | src/index.coffee | src/index.coffee | minimatch = require 'minimatch'
module.exports = (env, callback) ->
filter = (contents, pattern) ->
list(contents).filter (entry) ->
if pattern? then minimatch(entry.filename, pattern) else true
list = (contents) ->
entries = []
for key, value of contents._
switch key
when 'directories'
subcontents = value.map (directory) -> list directory
entries = [].concat.apply entries, subcontents
else
entries = entries.concat value
entries.sort (a, b) -> a.filename.localeCompare b.filename
env.helpers.contents =
filter: filter
list: list
callback()
| minimatch = require 'minimatch'
module.exports = (env, callback) ->
filter = (contents, pattern) ->
list(contents).filter (entry) ->
minimatch(entry.filename, pattern)
list = (contents) ->
entries = []
for key, value of contents._
switch key
when 'directories'
subcontents = value.map (directory) -> list directory
entries = [].concat.apply entries, subcontents
else
entries = entries.concat value
entries.sort (a, b) -> a.filename.localeCompare b.filename
env.helpers.contents =
filter: filter
list: list
callback()
| Remove non-mandatory check from filter function | Remove non-mandatory check from filter function
| CoffeeScript | mit | xavierdutreilh/wintersmith-contents,xavierdutreilh/wintersmith-contents | coffeescript | ## Code Before:
minimatch = require 'minimatch'
module.exports = (env, callback) ->
filter = (contents, pattern) ->
list(contents).filter (entry) ->
if pattern? then minimatch(entry.filename, pattern) else true
list = (contents) ->
entries = []
for key, value of contents._
switch key
when 'directories'
subcontents = value.map (directory) -> list directory
entries = [].concat.apply entries, subcontents
else
entries = entries.concat value
entries.sort (a, b) -> a.filename.localeCompare b.filename
env.helpers.contents =
filter: filter
list: list
callback()
## Instruction:
Remove non-mandatory check from filter function
## Code After:
minimatch = require 'minimatch'
module.exports = (env, callback) ->
filter = (contents, pattern) ->
list(contents).filter (entry) ->
minimatch(entry.filename, pattern)
list = (contents) ->
entries = []
for key, value of contents._
switch key
when 'directories'
subcontents = value.map (directory) -> list directory
entries = [].concat.apply entries, subcontents
else
entries = entries.concat value
entries.sort (a, b) -> a.filename.localeCompare b.filename
env.helpers.contents =
filter: filter
list: list
callback()
|
686395eaa0edb541677a98a0d0be38b257559225 | addon/components/bricks-grid/image.js | addon/components/bricks-grid/image.js | import Ember from 'ember';
import layout from '../../templates/components/bricks-grid/item';
const { Component, on } = Ember;
export default Component.extend({
layout,
sendRepackOnInit: on('didInsertElement', function() {
const img = this.$('img');
img.on('load', () => {
if (!this.get('isDestroyed')) {
this.sendAction('repack');
}
});
this.sendAction('repack');
}),
});
|
import Ember from 'ember';
import Item from './item';
const { on } = Ember;
export default Item.extend({
sendRepackOnInit: on('didInsertElement', function() {
const img = this.$('img');
img.on('load', () => {
if (!this.get('isDestroyed')) {
this.sendAction('repack');
}
});
this.sendAction('repack');
}),
});
| Add Inherit Image type element from item | [Fix] Add Inherit Image type element from item
| JavaScript | mit | Rastopyr/ember-cli-bricks,Rastopyr/ember-cli-bricks | javascript | ## Code Before:
import Ember from 'ember';
import layout from '../../templates/components/bricks-grid/item';
const { Component, on } = Ember;
export default Component.extend({
layout,
sendRepackOnInit: on('didInsertElement', function() {
const img = this.$('img');
img.on('load', () => {
if (!this.get('isDestroyed')) {
this.sendAction('repack');
}
});
this.sendAction('repack');
}),
});
## Instruction:
[Fix] Add Inherit Image type element from item
## Code After:
import Ember from 'ember';
import Item from './item';
const { on } = Ember;
export default Item.extend({
sendRepackOnInit: on('didInsertElement', function() {
const img = this.$('img');
img.on('load', () => {
if (!this.get('isDestroyed')) {
this.sendAction('repack');
}
});
this.sendAction('repack');
}),
});
|
f9a99cf53d4e1557bbf7974eb6dfdee3e6dbd56f | server.js | server.js | 'use strict';
var Hapi = require('hapi');
var server = new Hapi.Server();
if( process.env.PORT ) {
server.connection({ port: process.env.PORT });
}
else {
server.connection({ port: 1337 });
}
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
});
server.route({
method: 'GET',
path: '/{name}',
handler: function (request, reply) {
reply('Hello, ' + encodeURIComponent(request.params.name) + '!');
}
});
server.start(function () {
console.log('Server running at:', server.info.uri);
});
| 'use strict';
var Hapi = require('hapi');
var server = new Hapi.Server();
if( process.env.PORT ) {
server.connection({ port: process.env.PORT });
}
else {
server.connection({ port: 1337 });
}
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
});
server.route({
method: 'GET',
path: '/{name}',
handler: function (request, reply) {
reply('Hello, ' + encodeURIComponent(request.params.name) + '!');
}
});
server.route({
method : "GET",
path : '/assets/{param*}',
handler : {
directory : {
path : 'bower_components',
listing : true
}
}
});
server.start(function () {
console.log('Server running at:', server.info.uri);
});
| Add hapi route to bower packages. | Add hapi route to bower packages.
| JavaScript | mit | rmarteleto/CloudTutorial,rmarteleto/CloudTutorial,rmarteleto/CloudTutorial | javascript | ## Code Before:
'use strict';
var Hapi = require('hapi');
var server = new Hapi.Server();
if( process.env.PORT ) {
server.connection({ port: process.env.PORT });
}
else {
server.connection({ port: 1337 });
}
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
});
server.route({
method: 'GET',
path: '/{name}',
handler: function (request, reply) {
reply('Hello, ' + encodeURIComponent(request.params.name) + '!');
}
});
server.start(function () {
console.log('Server running at:', server.info.uri);
});
## Instruction:
Add hapi route to bower packages.
## Code After:
'use strict';
var Hapi = require('hapi');
var server = new Hapi.Server();
if( process.env.PORT ) {
server.connection({ port: process.env.PORT });
}
else {
server.connection({ port: 1337 });
}
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('Hello, world!');
}
});
server.route({
method: 'GET',
path: '/{name}',
handler: function (request, reply) {
reply('Hello, ' + encodeURIComponent(request.params.name) + '!');
}
});
server.route({
method : "GET",
path : '/assets/{param*}',
handler : {
directory : {
path : 'bower_components',
listing : true
}
}
});
server.start(function () {
console.log('Server running at:', server.info.uri);
});
|
28d41c138efa92f942b8057d4c5bffd18d47142c | mod_admin_web/admin_web/get_deps.sh | mod_admin_web/admin_web/get_deps.sh | cd www_files/js
test -e jquery-1.4.4.min.js || wget http://code.jquery.com/jquery-1.4.4.min.js
test -e adhoc.js || wget http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js
test -e strophe.js || (wget --no-check-certificate https://github.com/metajack/strophejs/tarball/release-1.0.1 && \
tar xzf *.tar.gz && rm *.tar.gz && cd metajack-strophejs* && make strophe.js && cp strophe.js ../strophe.js && \
cd .. && rm -rf metajack-strophejs*)
| cd www_files/js
test -e jquery-1.4.4.min.js || wget http://code.jquery.com/jquery-1.4.4.min.js
test -e adhoc.js || wget http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js
test -e strophe.js || (wget --no-check-certificate -O strophe.tar.gz https://github.com/metajack/strophejs/tarball/release-1.0.1 && \
tar xzf strophe.tar.gz && rm strophe.tar.gz && cd metajack-strophejs-*/ && make strophe.js && cp strophe.js ../strophe.js && \
cd .. && rm -rf metajack-strophejs*)
| Make dependency fetching more reliable | mod_admin_web: Make dependency fetching more reliable
| Shell | mit | prosody-modules/import2,prosody-modules/import2,prosody-modules/import2,prosody-modules/import2,prosody-modules/import2 | shell | ## Code Before:
cd www_files/js
test -e jquery-1.4.4.min.js || wget http://code.jquery.com/jquery-1.4.4.min.js
test -e adhoc.js || wget http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js
test -e strophe.js || (wget --no-check-certificate https://github.com/metajack/strophejs/tarball/release-1.0.1 && \
tar xzf *.tar.gz && rm *.tar.gz && cd metajack-strophejs* && make strophe.js && cp strophe.js ../strophe.js && \
cd .. && rm -rf metajack-strophejs*)
## Instruction:
mod_admin_web: Make dependency fetching more reliable
## Code After:
cd www_files/js
test -e jquery-1.4.4.min.js || wget http://code.jquery.com/jquery-1.4.4.min.js
test -e adhoc.js || wget http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js
test -e strophe.js || (wget --no-check-certificate -O strophe.tar.gz https://github.com/metajack/strophejs/tarball/release-1.0.1 && \
tar xzf strophe.tar.gz && rm strophe.tar.gz && cd metajack-strophejs-*/ && make strophe.js && cp strophe.js ../strophe.js && \
cd .. && rm -rf metajack-strophejs*)
|
27f169eda977ab9256fb3765a011efab2f9322b4 | map.js | map.js | (function(N) {
N.Map = function(opts) {
self = this;
self.directionsService = new google.maps.DirectionsService();
self.directionsDisplay = new google.maps.DirectionsRenderer();
var mapOptions = {
center: new google.maps.LatLng(39.875, -75.238),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),mapOptions),
traffic = new google.maps.TrafficLayer();
traffic.setMap(map);
self.directionsDisplay.setMap(map);
// Update the travel times ever minute
setInterval(self.calculateRoute, 60 * 1000);
};
N.Map.prototype.calculateRoute = function() {
var self = this,
start = $('#addr').val(),
end = "Philadelphia International Airport",
request = {
origin: start,
destination: end,
travelMode: google.maps.TravelMode.DRIVING
};
self.directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
self.directionsDisplay.setDirections(result);
self.trigger('route-time-update', result.routes[0].legs[0]);
}
});
};
_.extend(N.Map.prototype, Backbone.Events);
}(this));
| (function(N) {
N.Map = function(opts) {
self = this;
self.directionsService = new google.maps.DirectionsService();
self.directionsDisplay = new google.maps.DirectionsRenderer();
var mapOptions = {
center: new google.maps.LatLng(39.875, -75.238),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),mapOptions),
traffic = new google.maps.TrafficLayer();
traffic.setMap(map);
self.directionsDisplay.setMap(map);
// Update the travel times ever minute
setInterval($.proxy(self.calculateRoute,self), 60 * 1000);
};
N.Map.prototype.calculateRoute = function() {
var self = this,
start = $('#addr').val(),
end = "Philadelphia International Airport",
request = {
origin: start,
destination: end,
travelMode: google.maps.TravelMode.DRIVING
};
self.directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
self.directionsDisplay.setDirections(result);
self.trigger('route-time-update', result.routes[0].legs[0]);
}
});
};
_.extend(N.Map.prototype, Backbone.Events);
}(this));
| Update the driving time periodically | Update the driving time periodically
| JavaScript | mit | mmcfarland/phl-ready | javascript | ## Code Before:
(function(N) {
N.Map = function(opts) {
self = this;
self.directionsService = new google.maps.DirectionsService();
self.directionsDisplay = new google.maps.DirectionsRenderer();
var mapOptions = {
center: new google.maps.LatLng(39.875, -75.238),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),mapOptions),
traffic = new google.maps.TrafficLayer();
traffic.setMap(map);
self.directionsDisplay.setMap(map);
// Update the travel times ever minute
setInterval(self.calculateRoute, 60 * 1000);
};
N.Map.prototype.calculateRoute = function() {
var self = this,
start = $('#addr').val(),
end = "Philadelphia International Airport",
request = {
origin: start,
destination: end,
travelMode: google.maps.TravelMode.DRIVING
};
self.directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
self.directionsDisplay.setDirections(result);
self.trigger('route-time-update', result.routes[0].legs[0]);
}
});
};
_.extend(N.Map.prototype, Backbone.Events);
}(this));
## Instruction:
Update the driving time periodically
## Code After:
(function(N) {
N.Map = function(opts) {
self = this;
self.directionsService = new google.maps.DirectionsService();
self.directionsDisplay = new google.maps.DirectionsRenderer();
var mapOptions = {
center: new google.maps.LatLng(39.875, -75.238),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),mapOptions),
traffic = new google.maps.TrafficLayer();
traffic.setMap(map);
self.directionsDisplay.setMap(map);
// Update the travel times ever minute
setInterval($.proxy(self.calculateRoute,self), 60 * 1000);
};
N.Map.prototype.calculateRoute = function() {
var self = this,
start = $('#addr').val(),
end = "Philadelphia International Airport",
request = {
origin: start,
destination: end,
travelMode: google.maps.TravelMode.DRIVING
};
self.directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
self.directionsDisplay.setDirections(result);
self.trigger('route-time-update', result.routes[0].legs[0]);
}
});
};
_.extend(N.Map.prototype, Backbone.Events);
}(this));
|
52df7be94a4758c1792c39b0e852ab3031b61268 | Casks/skitch.rb | Casks/skitch.rb | class Skitch < Cask
url 'http://cdn1.evernote.com/skitch/mac/release/Skitch-2.0.5.zip'
homepage 'http://evernote.com/skitch/'
version '2.0.5'
sha1 '64d61e76eb8bd2540f84b5d21ee1ac5f93c74a61'
link 'Skitch.app'
end
| class Skitch < Cask
url 'http://cdn1.evernote.com/skitch/mac/release/Skitch-2.5.2.zip'
homepage 'http://evernote.com/skitch/'
version '2.5.2'
sha1 '2c4dd590d70759ff69f293e1ae00a4b55cca9e37'
link 'Skitch.app'
end
| Update Skitch to v. 2.5.2 | Update Skitch to v. 2.5.2
| Ruby | bsd-2-clause | 3van/homebrew-cask,Bombenleger/homebrew-cask,sgnh/homebrew-cask,13k/homebrew-cask,ky0615/homebrew-cask-1,kassi/homebrew-cask,mingzhi22/homebrew-cask,Keloran/homebrew-cask,y00rb/homebrew-cask,Philosoft/homebrew-cask,andyshinn/homebrew-cask,usami-k/homebrew-cask,gustavoavellar/homebrew-cask,mathbunnyru/homebrew-cask,ingorichter/homebrew-cask,michelegera/homebrew-cask,kronicd/homebrew-cask,wesen/homebrew-cask,blogabe/homebrew-cask,yurikoles/homebrew-cask,rkJun/homebrew-cask,shanonvl/homebrew-cask,Ephemera/homebrew-cask,sysbot/homebrew-cask,nathansgreen/homebrew-cask,gabrielizaias/homebrew-cask,hovancik/homebrew-cask,zmwangx/homebrew-cask,segiddins/homebrew-cask,yumitsu/homebrew-cask,jspahrsummers/homebrew-cask,deanmorin/homebrew-cask,tmoreira2020/homebrew,Ibuprofen/homebrew-cask,imgarylai/homebrew-cask,0rax/homebrew-cask,bkono/homebrew-cask,joshka/homebrew-cask,jellyfishcoder/homebrew-cask,vigosan/homebrew-cask,Keloran/homebrew-cask,guerrero/homebrew-cask,MoOx/homebrew-cask,colindean/homebrew-cask,a1russell/homebrew-cask,koenrh/homebrew-cask,nathancahill/homebrew-cask,puffdad/homebrew-cask,malford/homebrew-cask,KosherBacon/homebrew-cask,adelinofaria/homebrew-cask,ayohrling/homebrew-cask,ky0615/homebrew-cask-1,deizel/homebrew-cask,m3nu/homebrew-cask,ahbeng/homebrew-cask,d/homebrew-cask,pgr0ss/homebrew-cask,MerelyAPseudonym/homebrew-cask,BahtiyarB/homebrew-cask,caskroom/homebrew-cask,gregkare/homebrew-cask,FranklinChen/homebrew-cask,zorosteven/homebrew-cask,ptb/homebrew-cask,dwihn0r/homebrew-cask,victorpopkov/homebrew-cask,inta/homebrew-cask,xtian/homebrew-cask,slnovak/homebrew-cask,iamso/homebrew-cask,shoichiaizawa/homebrew-cask,sparrc/homebrew-cask,chrisfinazzo/homebrew-cask,slack4u/homebrew-cask,xcezx/homebrew-cask,jmeridth/homebrew-cask,gilesdring/homebrew-cask,SentinelWarren/homebrew-cask,joaoponceleao/homebrew-cask,pgr0ss/homebrew-cask,santoshsahoo/homebrew-cask,jedahan/homebrew-cask,SamiHiltunen/homebrew-cask,onlynone/homebrew-cask,nelsonjchen/homebrew-cask,troyxmccall/homebrew-cask,bric3/homebrew-cask,lieuwex/homebrew-cask,sachin21/homebrew-cask,chrisfinazzo/homebrew-cask,coeligena/homebrew-customized,epardee/homebrew-cask,ebraminio/homebrew-cask,coeligena/homebrew-customized,mazehall/homebrew-cask,jppelteret/homebrew-cask,vmrob/homebrew-cask,malford/homebrew-cask,coneman/homebrew-cask,KosherBacon/homebrew-cask,vitorgalvao/homebrew-cask,mathbunnyru/homebrew-cask,samshadwell/homebrew-cask,mattrobenolt/homebrew-cask,gyndav/homebrew-cask,lolgear/homebrew-cask,greg5green/homebrew-cask,crmne/homebrew-cask,athrunsun/homebrew-cask,diguage/homebrew-cask,chrisRidgers/homebrew-cask,hovancik/homebrew-cask,yurikoles/homebrew-cask,dunn/homebrew-cask,optikfluffel/homebrew-cask,nickpellant/homebrew-cask,scw/homebrew-cask,yuhki50/homebrew-cask,mahori/homebrew-cask,wizonesolutions/homebrew-cask,nathancahill/homebrew-cask,sohtsuka/homebrew-cask,Hywan/homebrew-cask,joschi/homebrew-cask,schneidmaster/homebrew-cask,dwihn0r/homebrew-cask,cclauss/homebrew-cask,xakraz/homebrew-cask,skyyuan/homebrew-cask,shonjir/homebrew-cask,yumitsu/homebrew-cask,robbiethegeek/homebrew-cask,jasmas/homebrew-cask,MisumiRize/homebrew-cask,segiddins/homebrew-cask,gguillotte/homebrew-cask,renaudguerin/homebrew-cask,janlugt/homebrew-cask,antogg/homebrew-cask,underyx/homebrew-cask,anbotero/homebrew-cask,casidiablo/homebrew-cask,napaxton/homebrew-cask,nshemonsky/homebrew-cask,Saklad5/homebrew-cask,gibsjose/homebrew-cask,blainesch/homebrew-cask,colindean/homebrew-cask,lukeadams/homebrew-cask,psibre/homebrew-cask,arranubels/homebrew-cask,inz/homebrew-cask,jonathanwiesel/homebrew-cask,ywfwj2008/homebrew-cask,tedbundyjr/homebrew-cask,bric3/homebrew-cask,perfide/homebrew-cask,ksato9700/homebrew-cask,samdoran/homebrew-cask,sideci-sample/sideci-sample-homebrew-cask,nicholsn/homebrew-cask,ahundt/homebrew-cask,kevyau/homebrew-cask,hristozov/homebrew-cask,jen20/homebrew-cask,yurikoles/homebrew-cask,gabrielizaias/homebrew-cask,mariusbutuc/homebrew-cask,guylabs/homebrew-cask,spruceb/homebrew-cask,jeroenseegers/homebrew-cask,JosephViolago/homebrew-cask,epmatsw/homebrew-cask,kiliankoe/homebrew-cask,tonyseek/homebrew-cask,crmne/homebrew-cask,scribblemaniac/homebrew-cask,kTitan/homebrew-cask,lieuwex/homebrew-cask,enriclluelles/homebrew-cask,tjt263/homebrew-cask,Philosoft/homebrew-cask,Saklad5/homebrew-cask,jhowtan/homebrew-cask,elseym/homebrew-cask,andyshinn/homebrew-cask,elyscape/homebrew-cask,kesara/homebrew-cask,esebastian/homebrew-cask,gwaldo/homebrew-cask,donbobka/homebrew-cask,RogerThiede/homebrew-cask,chrisopedia/homebrew-cask,mjdescy/homebrew-cask,diguage/homebrew-cask,xiongchiamiov/homebrew-cask,lvicentesanchez/homebrew-cask,kuno/homebrew-cask,stonehippo/homebrew-cask,samnung/homebrew-cask,paour/homebrew-cask,kingthorin/homebrew-cask,dlovitch/homebrew-cask,paulbreslin/homebrew-cask,tangestani/homebrew-cask,mwek/homebrew-cask,janlugt/homebrew-cask,cprecioso/homebrew-cask,dieterdemeyer/homebrew-cask,johan/homebrew-cask,stephenwade/homebrew-cask,dictcp/homebrew-cask,inz/homebrew-cask,ksato9700/homebrew-cask,jmeridth/homebrew-cask,jtriley/homebrew-cask,opsdev-ws/homebrew-cask,gurghet/homebrew-cask,bgandon/homebrew-cask,mattrobenolt/homebrew-cask,joaoponceleao/homebrew-cask,reitermarkus/homebrew-cask,jppelteret/homebrew-cask,a-x-/homebrew-cask,scw/homebrew-cask,y00rb/homebrew-cask,leipert/homebrew-cask,morganestes/homebrew-cask,bcaceiro/homebrew-cask,garborg/homebrew-cask,bosr/homebrew-cask,tangestani/homebrew-cask,jacobbednarz/homebrew-cask,tsparber/homebrew-cask,hanxue/caskroom,bchatard/homebrew-cask,catap/homebrew-cask,shonjir/homebrew-cask,JosephViolago/homebrew-cask,shanonvl/homebrew-cask,morsdyce/homebrew-cask,reitermarkus/homebrew-cask,lalyos/homebrew-cask,josa42/homebrew-cask,forevergenin/homebrew-cask,jpodlech/homebrew-cask,n8henrie/homebrew-cask,catap/homebrew-cask,athrunsun/homebrew-cask,chuanxd/homebrew-cask,thehunmonkgroup/homebrew-cask,RogerThiede/homebrew-cask,unasuke/homebrew-cask,hellosky806/homebrew-cask,mAAdhaTTah/homebrew-cask,mwek/homebrew-cask,gmkey/homebrew-cask,chino/homebrew-cask,CameronGarrett/homebrew-cask,gilesdring/homebrew-cask,kongslund/homebrew-cask,frapposelli/homebrew-cask,samnung/homebrew-cask,royalwang/homebrew-cask,amatos/homebrew-cask,jconley/homebrew-cask,toonetown/homebrew-cask,colindunn/homebrew-cask,hackhandslabs/homebrew-cask,scottsuch/homebrew-cask,MisumiRize/homebrew-cask,antogg/homebrew-cask,Whoaa512/homebrew-cask,AnastasiaSulyagina/homebrew-cask,coneman/homebrew-cask,danielbayley/homebrew-cask,tan9/homebrew-cask,fanquake/homebrew-cask,rhendric/homebrew-cask,kteru/homebrew-cask,MatzFan/homebrew-cask,tedski/homebrew-cask,phpwutz/homebrew-cask,xalep/homebrew-cask,tonyseek/homebrew-cask,jellyfishcoder/homebrew-cask,theoriginalgri/homebrew-cask,thii/homebrew-cask,ahundt/homebrew-cask,mAAdhaTTah/homebrew-cask,johndbritton/homebrew-cask,zhuzihhhh/homebrew-cask,bcomnes/homebrew-cask,tarwich/homebrew-cask,freeslugs/homebrew-cask,RJHsiao/homebrew-cask,adrianchia/homebrew-cask,kirikiriyamama/homebrew-cask,josa42/homebrew-cask,uetchy/homebrew-cask,sysbot/homebrew-cask,blainesch/homebrew-cask,jalaziz/homebrew-cask,helloIAmPau/homebrew-cask,syscrusher/homebrew-cask,gyndav/homebrew-cask,neverfox/homebrew-cask,reelsense/homebrew-cask,dspeckhard/homebrew-cask,nysthee/homebrew-cask,wesen/homebrew-cask,BahtiyarB/homebrew-cask,moogar0880/homebrew-cask,tjnycum/homebrew-cask,dieterdemeyer/homebrew-cask,meduz/homebrew-cask,guerrero/homebrew-cask,boydj/homebrew-cask,jangalinski/homebrew-cask,miguelfrde/homebrew-cask,moonboots/homebrew-cask,wmorin/homebrew-cask,ashishb/homebrew-cask,kteru/homebrew-cask,tyage/homebrew-cask,bric3/homebrew-cask,hackhandslabs/homebrew-cask,scottsuch/homebrew-cask,feigaochn/homebrew-cask,MichaelPei/homebrew-cask,m3nu/homebrew-cask,pinut/homebrew-cask,Labutin/homebrew-cask,adriweb/homebrew-cask,kronicd/homebrew-cask,alexg0/homebrew-cask,taherio/homebrew-cask,cliffcotino/homebrew-cask,gyugyu/homebrew-cask,guylabs/homebrew-cask,optikfluffel/homebrew-cask,fengb/homebrew-cask,mwilmer/homebrew-cask,christer155/homebrew-cask,retrography/homebrew-cask,mathbunnyru/homebrew-cask,sachin21/homebrew-cask,johnjelinek/homebrew-cask,norio-nomura/homebrew-cask,gerrypower/homebrew-cask,chadcatlett/caskroom-homebrew-cask,askl56/homebrew-cask,daften/homebrew-cask,barravi/homebrew-cask,jacobdam/homebrew-cask,mattrobenolt/homebrew-cask,sgnh/homebrew-cask,rednoah/homebrew-cask,FinalDes/homebrew-cask,markthetech/homebrew-cask,jedahan/homebrew-cask,FinalDes/homebrew-cask,fwiesel/homebrew-cask,mauricerkelly/homebrew-cask,leonmachadowilcox/homebrew-cask,axodys/homebrew-cask,dlovitch/homebrew-cask,decrement/homebrew-cask,carlmod/homebrew-cask,williamboman/homebrew-cask,FranklinChen/homebrew-cask,chadcatlett/caskroom-homebrew-cask,napaxton/homebrew-cask,otzy007/homebrew-cask,forevergenin/homebrew-cask,winkelsdorf/homebrew-cask,riyad/homebrew-cask,JikkuJose/homebrew-cask,xyb/homebrew-cask,andrewschleifer/homebrew-cask,ninjahoahong/homebrew-cask,albertico/homebrew-cask,deizel/homebrew-cask,pinut/homebrew-cask,cprecioso/homebrew-cask,Whoaa512/homebrew-cask,tjnycum/homebrew-cask,claui/homebrew-cask,casidiablo/homebrew-cask,retrography/homebrew-cask,theoriginalgri/homebrew-cask,bosr/homebrew-cask,6uclz1/homebrew-cask,deanmorin/homebrew-cask,Ketouem/homebrew-cask,BenjaminHCCarr/homebrew-cask,paulbreslin/homebrew-cask,aguynamedryan/homebrew-cask,claui/homebrew-cask,zerrot/homebrew-cask,mokagio/homebrew-cask,joshka/homebrew-cask,nanoxd/homebrew-cask,leonmachadowilcox/homebrew-cask,ericbn/homebrew-cask,drostron/homebrew-cask,cedwardsmedia/homebrew-cask,doits/homebrew-cask,otaran/homebrew-cask,jacobdam/homebrew-cask,zchee/homebrew-cask,kievechua/homebrew-cask,muescha/homebrew-cask,ctrevino/homebrew-cask,Dremora/homebrew-cask,wastrachan/homebrew-cask,mgryszko/homebrew-cask,zmwangx/homebrew-cask,fkrone/homebrew-cask,vin047/homebrew-cask,chrisfinazzo/homebrew-cask,gguillotte/homebrew-cask,linc01n/homebrew-cask,buo/homebrew-cask,stephenwade/homebrew-cask,adrianchia/homebrew-cask,goxberry/homebrew-cask,mgryszko/homebrew-cask,jeanregisser/homebrew-cask,MicTech/homebrew-cask,enriclluelles/homebrew-cask,codeurge/homebrew-cask,jgarber623/homebrew-cask,michelegera/homebrew-cask,cblecker/homebrew-cask,thehunmonkgroup/homebrew-cask,ywfwj2008/homebrew-cask,mlocher/homebrew-cask,AdamCmiel/homebrew-cask,aktau/homebrew-cask,yutarody/homebrew-cask,xalep/homebrew-cask,winkelsdorf/homebrew-cask,kamilboratynski/homebrew-cask,joschi/homebrew-cask,0rax/homebrew-cask,renaudguerin/homebrew-cask,githubutilities/homebrew-cask,zeusdeux/homebrew-cask,stonehippo/homebrew-cask,sohtsuka/homebrew-cask,markhuber/homebrew-cask,aki77/homebrew-cask,adrianchia/homebrew-cask,singingwolfboy/homebrew-cask,djmonta/homebrew-cask,axodys/homebrew-cask,jaredsampson/homebrew-cask,santoshsahoo/homebrew-cask,stonehippo/homebrew-cask,anbotero/homebrew-cask,jgarber623/homebrew-cask,seanzxx/homebrew-cask,brianshumate/homebrew-cask,haha1903/homebrew-cask,gyugyu/homebrew-cask,shishi/homebrew-cask,boecko/homebrew-cask,dspeckhard/homebrew-cask,nrlquaker/homebrew-cask,cobyism/homebrew-cask,mhubig/homebrew-cask,j13k/homebrew-cask,tolbkni/homebrew-cask,lolgear/homebrew-cask,afdnlw/homebrew-cask,xight/homebrew-cask,josa42/homebrew-cask,jawshooah/homebrew-cask,mattfelsen/homebrew-cask,tjnycum/homebrew-cask,larseggert/homebrew-cask,lvicentesanchez/homebrew-cask,koenrh/homebrew-cask,LaurentFough/homebrew-cask,samdoran/homebrew-cask,hakamadare/homebrew-cask,psibre/homebrew-cask,0xadada/homebrew-cask,ohammersmith/homebrew-cask,tsparber/homebrew-cask,singingwolfboy/homebrew-cask,goxberry/homebrew-cask,zchee/homebrew-cask,ericbn/homebrew-cask,af/homebrew-cask,L2G/homebrew-cask,mokagio/homebrew-cask,elyscape/homebrew-cask,Dremora/homebrew-cask,prime8/homebrew-cask,Ibuprofen/homebrew-cask,haha1903/homebrew-cask,perfide/homebrew-cask,christer155/homebrew-cask,kpearson/homebrew-cask,n8henrie/homebrew-cask,kiliankoe/homebrew-cask,mfpierre/homebrew-cask,julienlavergne/homebrew-cask,JacopKane/homebrew-cask,julionc/homebrew-cask,fharbe/homebrew-cask,fwiesel/homebrew-cask,ingorichter/homebrew-cask,nathansgreen/homebrew-cask,yuhki50/homebrew-cask,cliffcotino/homebrew-cask,tangestani/homebrew-cask,yutarody/homebrew-cask,nshemonsky/homebrew-cask,zerrot/homebrew-cask,fazo96/homebrew-cask,ponychicken/homebrew-customcask,flaviocamilo/homebrew-cask,diogodamiani/homebrew-cask,sjackman/homebrew-cask,seanorama/homebrew-cask,miccal/homebrew-cask,maxnordlund/homebrew-cask,fazo96/homebrew-cask,ohammersmith/homebrew-cask,giannitm/homebrew-cask,lumaxis/homebrew-cask,amatos/homebrew-cask,bgandon/homebrew-cask,unasuke/homebrew-cask,flaviocamilo/homebrew-cask,xight/homebrew-cask,okket/homebrew-cask,robertgzr/homebrew-cask,robbiethegeek/homebrew-cask,andyli/homebrew-cask,ctrevino/homebrew-cask,JacopKane/homebrew-cask,uetchy/homebrew-cask,christophermanning/homebrew-cask,retbrown/homebrew-cask,devmynd/homebrew-cask,jspahrsummers/homebrew-cask,tranc99/homebrew-cask,andyli/homebrew-cask,kolomiichenko/homebrew-cask,helloIAmPau/homebrew-cask,danielgomezrico/homebrew-cask,kesara/homebrew-cask,timsutton/homebrew-cask,chuanxd/homebrew-cask,flada-auxv/homebrew-cask,arranubels/homebrew-cask,vin047/homebrew-cask,astorije/homebrew-cask,sanyer/homebrew-cask,corbt/homebrew-cask,patresi/homebrew-cask,m3nu/homebrew-cask,zorosteven/homebrew-cask,MircoT/homebrew-cask,faun/homebrew-cask,AnastasiaSulyagina/homebrew-cask,rajiv/homebrew-cask,delphinus35/homebrew-cask,BenjaminHCCarr/homebrew-cask,wmorin/homebrew-cask,ninjahoahong/homebrew-cask,3van/homebrew-cask,wizonesolutions/homebrew-cask,andrewdisley/homebrew-cask,iAmGhost/homebrew-cask,sosedoff/homebrew-cask,nathanielvarona/homebrew-cask,winkelsdorf/homebrew-cask,zeusdeux/homebrew-cask,otzy007/homebrew-cask,neil-ca-moore/homebrew-cask,shorshe/homebrew-cask,rajiv/homebrew-cask,robertgzr/homebrew-cask,skyyuan/homebrew-cask,dlackty/homebrew-cask,kirikiriyamama/homebrew-cask,JosephViolago/homebrew-cask,gmkey/homebrew-cask,lalyos/homebrew-cask,dictcp/homebrew-cask,bdhess/homebrew-cask,danielgomezrico/homebrew-cask,jhowtan/homebrew-cask,paulombcosta/homebrew-cask,nivanchikov/homebrew-cask,a1russell/homebrew-cask,renard/homebrew-cask,wolflee/homebrew-cask,nathanielvarona/homebrew-cask,timsutton/homebrew-cask,genewoo/homebrew-cask,akiomik/homebrew-cask,kevyau/homebrew-cask,epardee/homebrew-cask,jtriley/homebrew-cask,lucasmezencio/homebrew-cask,okket/homebrew-cask,atsuyim/homebrew-cask,freeslugs/homebrew-cask,djmonta/homebrew-cask,sirodoht/homebrew-cask,barravi/homebrew-cask,mkozjak/homebrew-cask,sebcode/homebrew-cask,artdevjs/homebrew-cask,sscotth/homebrew-cask,farmerchris/homebrew-cask,gustavoavellar/homebrew-cask,paour/homebrew-cask,qnm/homebrew-cask,scribblemaniac/homebrew-cask,L2G/homebrew-cask,kamilboratynski/homebrew-cask,pkq/homebrew-cask,ahvigil/homebrew-cask,scottsuch/homebrew-cask,hyuna917/homebrew-cask,zhuzihhhh/homebrew-cask,alloy/homebrew-cask,wickles/homebrew-cask,lumaxis/homebrew-cask,atsuyim/homebrew-cask,danielbayley/homebrew-cask,farmerchris/homebrew-cask,franklouwers/homebrew-cask,nelsonjchen/homebrew-cask,tan9/homebrew-cask,j13k/homebrew-cask,My2ndAngelic/homebrew-cask,royalwang/homebrew-cask,shorshe/homebrew-cask,moimikey/homebrew-cask,johnjelinek/homebrew-cask,AndreTheHunter/homebrew-cask,Hywan/homebrew-cask,adriweb/homebrew-cask,dlackty/homebrew-cask,mrmachine/homebrew-cask,jawshooah/homebrew-cask,miguelfrde/homebrew-cask,rcuza/homebrew-cask,johnste/homebrew-cask,christophermanning/homebrew-cask,katoquro/homebrew-cask,ebraminio/homebrew-cask,bcaceiro/homebrew-cask,jayshao/homebrew-cask,asins/homebrew-cask,nightscape/homebrew-cask,leipert/homebrew-cask,kostasdizas/homebrew-cask,tolbkni/homebrew-cask,chrisopedia/homebrew-cask,MerelyAPseudonym/homebrew-cask,wuman/homebrew-cask,feigaochn/homebrew-cask,bsiddiqui/homebrew-cask,RickWong/homebrew-cask,kryhear/homebrew-cask,cobyism/homebrew-cask,crzrcn/homebrew-cask,fharbe/homebrew-cask,jangalinski/homebrew-cask,dvdoliveira/homebrew-cask,arronmabrey/homebrew-cask,johan/homebrew-cask,andrewdisley/homebrew-cask,sanyer/homebrew-cask,neverfox/homebrew-cask,qbmiller/homebrew-cask,andersonba/homebrew-cask,larseggert/homebrew-cask,mfpierre/homebrew-cask,shoichiaizawa/homebrew-cask,sscotth/homebrew-cask,astorije/homebrew-cask,lucasmezencio/homebrew-cask,jamesmlees/homebrew-cask,johndbritton/homebrew-cask,ayohrling/homebrew-cask,sideci-sample/sideci-sample-homebrew-cask,samshadwell/homebrew-cask,gurghet/homebrew-cask,illusionfield/homebrew-cask,hvisage/homebrew-cask,cfillion/homebrew-cask,RickWong/homebrew-cask,afh/homebrew-cask,garborg/homebrew-cask,paulombcosta/homebrew-cask,andrewdisley/homebrew-cask,hakamadare/homebrew-cask,mishari/homebrew-cask,esebastian/homebrew-cask,lukasbestle/homebrew-cask,blogabe/homebrew-cask,thii/homebrew-cask,asbachb/homebrew-cask,crzrcn/homebrew-cask,diogodamiani/homebrew-cask,af/homebrew-cask,cohei/homebrew-cask,johntrandall/homebrew-cask,hswong3i/homebrew-cask,afh/homebrew-cask,JikkuJose/homebrew-cask,miccal/homebrew-cask,jconley/homebrew-cask,Amorymeltzer/homebrew-cask,ianyh/homebrew-cask,jasmas/homebrew-cask,lantrix/homebrew-cask,toonetown/homebrew-cask,alloy/homebrew-cask,mindriot101/homebrew-cask,blogabe/homebrew-cask,kassi/homebrew-cask,hristozov/homebrew-cask,hanxue/caskroom,nivanchikov/homebrew-cask,MicTech/homebrew-cask,nicholsn/homebrew-cask,ahbeng/homebrew-cask,taherio/homebrew-cask,sebcode/homebrew-cask,JoelLarson/homebrew-cask,sirodoht/homebrew-cask,rogeriopradoj/homebrew-cask,lifepillar/homebrew-cask,wayou/homebrew-cask,stevehedrick/homebrew-cask,cclauss/homebrew-cask,underyx/homebrew-cask,gibsjose/homebrew-cask,alebcay/homebrew-cask,Gasol/homebrew-cask,moimikey/homebrew-cask,elnappo/homebrew-cask,lifepillar/homebrew-cask,jiashuw/homebrew-cask,tedski/homebrew-cask,nrlquaker/homebrew-cask,qbmiller/homebrew-cask,kuno/homebrew-cask,alexg0/homebrew-cask,bsiddiqui/homebrew-cask,yurrriq/homebrew-cask,imgarylai/homebrew-cask,xcezx/homebrew-cask,jpodlech/homebrew-cask,nicolas-brousse/homebrew-cask,remko/homebrew-cask,iamso/homebrew-cask,csmith-palantir/homebrew-cask,Fedalto/homebrew-cask,rhendric/homebrew-cask,usami-k/homebrew-cask,mindriot101/homebrew-cask,jeroenj/homebrew-cask,vuquoctuan/homebrew-cask,kongslund/homebrew-cask,gregkare/homebrew-cask,norio-nomura/homebrew-cask,mikem/homebrew-cask,malob/homebrew-cask,petmoo/homebrew-cask,jbeagley52/homebrew-cask,joschi/homebrew-cask,jacobbednarz/homebrew-cask,ericbn/homebrew-cask,Gasol/homebrew-cask,Amorymeltzer/homebrew-cask,howie/homebrew-cask,rajiv/homebrew-cask,supriyantomaftuh/homebrew-cask,mariusbutuc/homebrew-cask,cfillion/homebrew-cask,pacav69/homebrew-cask,dvdoliveira/homebrew-cask,mingzhi22/homebrew-cask,mchlrmrz/homebrew-cask,illusionfield/homebrew-cask,rcuza/homebrew-cask,otaran/homebrew-cask,rickychilcott/homebrew-cask,albertico/homebrew-cask,jalaziz/homebrew-cask,alebcay/homebrew-cask,gwaldo/homebrew-cask,tranc99/homebrew-cask,csmith-palantir/homebrew-cask,miku/homebrew-cask,lukeadams/homebrew-cask,mattfelsen/homebrew-cask,prime8/homebrew-cask,dcondrey/homebrew-cask,shoichiaizawa/homebrew-cask,aktau/homebrew-cask,huanzhang/homebrew-cask,spruceb/homebrew-cask,wastrachan/homebrew-cask,mjgardner/homebrew-cask,cblecker/homebrew-cask,kievechua/homebrew-cask,seanorama/homebrew-cask,0xadada/homebrew-cask,joaocc/homebrew-cask,ddm/homebrew-cask,skatsuta/homebrew-cask,schneidmaster/homebrew-cask,williamboman/homebrew-cask,tedbundyjr/homebrew-cask,johntrandall/homebrew-cask,andrewschleifer/homebrew-cask,hyuna917/homebrew-cask,rickychilcott/homebrew-cask,kkdd/homebrew-cask,MichaelPei/homebrew-cask,mwean/homebrew-cask,mchlrmrz/homebrew-cask,kei-yamazaki/homebrew-cask,deiga/homebrew-cask,slnovak/homebrew-cask,cohei/homebrew-cask,petmoo/homebrew-cask,bkono/homebrew-cask,dwkns/homebrew-cask,BenjaminHCCarr/homebrew-cask,miccal/homebrew-cask,puffdad/homebrew-cask,rednoah/homebrew-cask,Ephemera/homebrew-cask,exherb/homebrew-cask,jrwesolo/homebrew-cask,moogar0880/homebrew-cask,gord1anknot/homebrew-cask,reelsense/homebrew-cask,bendoerr/homebrew-cask,devmynd/homebrew-cask,hvisage/homebrew-cask,dezon/homebrew-cask,ksylvan/homebrew-cask,iAmGhost/homebrew-cask,Nitecon/homebrew-cask,wickedsp1d3r/homebrew-cask,julienlavergne/homebrew-cask,jeanregisser/homebrew-cask,mhubig/homebrew-cask,kevinoconnor7/homebrew-cask,giannitm/homebrew-cask,inta/homebrew-cask,decrement/homebrew-cask,sanchezm/homebrew-cask,MatzFan/homebrew-cask,elnappo/homebrew-cask,nathanielvarona/homebrew-cask,englishm/homebrew-cask,coeligena/homebrew-customized,klane/homebrew-cask,stevenmaguire/homebrew-cask,tarwich/homebrew-cask,bchatard/homebrew-cask,mwilmer/homebrew-cask,shonjir/homebrew-cask,Nitecon/homebrew-cask,cobyism/homebrew-cask,brianshumate/homebrew-cask,kolomiichenko/homebrew-cask,slack4u/homebrew-cask,epmatsw/homebrew-cask,adelinofaria/homebrew-cask,qnm/homebrew-cask,julionc/homebrew-cask,FredLackeyOfficial/homebrew-cask,xiongchiamiov/homebrew-cask,cedwardsmedia/homebrew-cask,jrwesolo/homebrew-cask,jpmat296/homebrew-cask,SentinelWarren/homebrew-cask,arronmabrey/homebrew-cask,maxnordlund/homebrew-cask,seanzxx/homebrew-cask,faun/homebrew-cask,bendoerr/homebrew-cask,lcasey001/homebrew-cask,jamesmlees/homebrew-cask,daften/homebrew-cask,asbachb/homebrew-cask,lcasey001/homebrew-cask,d/homebrew-cask,antogg/homebrew-cask,jaredsampson/homebrew-cask,corbt/homebrew-cask,artdevjs/homebrew-cask,jgarber623/homebrew-cask,phpwutz/homebrew-cask,sparrc/homebrew-cask,squid314/homebrew-cask,Labutin/homebrew-cask,retbrown/homebrew-cask,claui/homebrew-cask,alexg0/homebrew-cask,vigosan/homebrew-cask,jalaziz/homebrew-cask,esebastian/homebrew-cask,gerrymiller/homebrew-cask,dustinblackman/homebrew-cask,dustinblackman/homebrew-cask,mjdescy/homebrew-cask,kTitan/homebrew-cask,JoelLarson/homebrew-cask,malob/homebrew-cask,LaurentFough/homebrew-cask,stigkj/homebrew-caskroom-cask,tdsmith/homebrew-cask,doits/homebrew-cask,jiashuw/homebrew-cask,jonathanwiesel/homebrew-cask,remko/homebrew-cask,flada-auxv/homebrew-cask,ch3n2k/homebrew-cask,gord1anknot/homebrew-cask,xight/homebrew-cask,Ngrd/homebrew-cask,ponychicken/homebrew-customcask,pkq/homebrew-cask,alebcay/homebrew-cask,sjackman/homebrew-cask,wickles/homebrew-cask,dwkns/homebrew-cask,englishm/homebrew-cask,Ephemera/homebrew-cask,bdhess/homebrew-cask,joshka/homebrew-cask,6uclz1/homebrew-cask,mrmachine/homebrew-cask,ftiff/homebrew-cask,chrisRidgers/homebrew-cask,djakarta-trap/homebrew-myCask,elseym/homebrew-cask,miku/homebrew-cask,jeroenseegers/homebrew-cask,gerrymiller/homebrew-cask,Bombenleger/homebrew-cask,onlynone/homebrew-cask,skatsuta/homebrew-cask,rogeriopradoj/homebrew-cask,chino/homebrew-cask,MoOx/homebrew-cask,malob/homebrew-cask,mazehall/homebrew-cask,lauantai/homebrew-cask,klane/homebrew-cask,xyb/homebrew-cask,stephenwade/homebrew-cask,lantrix/homebrew-cask,fanquake/homebrew-cask,imgarylai/homebrew-cask,ksylvan/homebrew-cask,SamiHiltunen/homebrew-cask,xyb/homebrew-cask,colindunn/homebrew-cask,githubutilities/homebrew-cask,mlocher/homebrew-cask,wKovacs64/homebrew-cask,pkq/homebrew-cask,ftiff/homebrew-cask,moimikey/homebrew-cask,mishari/homebrew-cask,gerrypower/homebrew-cask,syscrusher/homebrew-cask,ptb/homebrew-cask,dunn/homebrew-cask,JacopKane/homebrew-cask,wolflee/homebrew-cask,mchlrmrz/homebrew-cask,paour/homebrew-cask,morsdyce/homebrew-cask,caskroom/homebrew-cask,nightscape/homebrew-cask,dcondrey/homebrew-cask,buo/homebrew-cask,lukasbestle/homebrew-cask,kingthorin/homebrew-cask,timsutton/homebrew-cask,fly19890211/homebrew-cask,mikem/homebrew-cask,AdamCmiel/homebrew-cask,CameronGarrett/homebrew-cask,sanyer/homebrew-cask,ch3n2k/homebrew-cask,kkdd/homebrew-cask,yutarody/homebrew-cask,tdsmith/homebrew-cask,stevenmaguire/homebrew-cask,FredLackeyOfficial/homebrew-cask,cblecker/homebrew-cask,kpearson/homebrew-cask,stigkj/homebrew-caskroom-cask,lauantai/homebrew-cask,hanxue/caskroom,genewoo/homebrew-cask,optikfluffel/homebrew-cask,akiomik/homebrew-cask,My2ndAngelic/homebrew-cask,Cottser/homebrew-cask,mjgardner/homebrew-cask,kei-yamazaki/homebrew-cask,nrlquaker/homebrew-cask,deiga/homebrew-cask,AndreTheHunter/homebrew-cask,thomanq/homebrew-cask,bcomnes/homebrew-cask,valepert/homebrew-cask,askl56/homebrew-cask,neil-ca-moore/homebrew-cask,howie/homebrew-cask,jeroenj/homebrew-cask,katoquro/homebrew-cask,ddm/homebrew-cask,aki77/homebrew-cask,jbeagley52/homebrew-cask,nicolas-brousse/homebrew-cask,singingwolfboy/homebrew-cask,valepert/homebrew-cask,rkJun/homebrew-cask,yurrriq/homebrew-cask,stevehedrick/homebrew-cask,supriyantomaftuh/homebrew-cask,linc01n/homebrew-cask,nysthee/homebrew-cask,jen20/homebrew-cask,delphinus35/homebrew-cask,rubenerd/homebrew-cask,greg5green/homebrew-cask,codeurge/homebrew-cask,kevinoconnor7/homebrew-cask,n0ts/homebrew-cask,wuman/homebrew-cask,patresi/homebrew-cask,mkozjak/homebrew-cask,uetchy/homebrew-cask,Fedalto/homebrew-cask,ianyh/homebrew-cask,RJHsiao/homebrew-cask,a-x-/homebrew-cask,markthetech/homebrew-cask,franklouwers/homebrew-cask,markhuber/homebrew-cask,Cottser/homebrew-cask,jayshao/homebrew-cask,mahori/homebrew-cask,riyad/homebrew-cask,rogeriopradoj/homebrew-cask,dictcp/homebrew-cask,vmrob/homebrew-cask,wayou/homebrew-cask,sanchezm/homebrew-cask,kryhear/homebrew-cask,troyxmccall/homebrew-cask,pablote/homebrew-cask,wKovacs64/homebrew-cask,n0ts/homebrew-cask,johnste/homebrew-cask,joaocc/homebrew-cask,mjgardner/homebrew-cask,xakraz/homebrew-cask,exherb/homebrew-cask,moonboots/homebrew-cask,thomanq/homebrew-cask,13k/homebrew-cask,deiga/homebrew-cask,feniix/homebrew-cask,rubenerd/homebrew-cask,mwean/homebrew-cask,renard/homebrew-cask,feniix/homebrew-cask,huanzhang/homebrew-cask,xtian/homebrew-cask,muan/homebrew-cask,nanoxd/homebrew-cask,pablote/homebrew-cask,aguynamedryan/homebrew-cask,squid314/homebrew-cask,tyage/homebrew-cask,andersonba/homebrew-cask,nickpellant/homebrew-cask,carlmod/homebrew-cask,wickedsp1d3r/homebrew-cask,MircoT/homebrew-cask,tmoreira2020/homebrew,morganestes/homebrew-cask,scribblemaniac/homebrew-cask,ashishb/homebrew-cask,boydj/homebrew-cask,ajbw/homebrew-cask,victorpopkov/homebrew-cask,a1russell/homebrew-cask,kostasdizas/homebrew-cask,donbobka/homebrew-cask,pacav69/homebrew-cask,sosedoff/homebrew-cask,wmorin/homebrew-cask,ldong/homebrew-cask,boecko/homebrew-cask,djakarta-trap/homebrew-myCask,Ngrd/homebrew-cask,shishi/homebrew-cask,mauricerkelly/homebrew-cask,kingthorin/homebrew-cask,ldong/homebrew-cask,leoj3n/homebrew-cask,hswong3i/homebrew-cask,frapposelli/homebrew-cask,neverfox/homebrew-cask,danielbayley/homebrew-cask,reitermarkus/homebrew-cask,sscotth/homebrew-cask,Ketouem/homebrew-cask,vuquoctuan/homebrew-cask,tjt263/homebrew-cask,drostron/homebrew-cask,dezon/homebrew-cask,muan/homebrew-cask,hellosky806/homebrew-cask,fly19890211/homebrew-cask,julionc/homebrew-cask,kesara/homebrew-cask,asins/homebrew-cask,opsdev-ws/homebrew-cask,Amorymeltzer/homebrew-cask,jpmat296/homebrew-cask,vitorgalvao/homebrew-cask,afdnlw/homebrew-cask,ajbw/homebrew-cask,niksy/homebrew-cask,fkrone/homebrew-cask,gyndav/homebrew-cask,ahvigil/homebrew-cask,mahori/homebrew-cask | ruby | ## Code Before:
class Skitch < Cask
url 'http://cdn1.evernote.com/skitch/mac/release/Skitch-2.0.5.zip'
homepage 'http://evernote.com/skitch/'
version '2.0.5'
sha1 '64d61e76eb8bd2540f84b5d21ee1ac5f93c74a61'
link 'Skitch.app'
end
## Instruction:
Update Skitch to v. 2.5.2
## Code After:
class Skitch < Cask
url 'http://cdn1.evernote.com/skitch/mac/release/Skitch-2.5.2.zip'
homepage 'http://evernote.com/skitch/'
version '2.5.2'
sha1 '2c4dd590d70759ff69f293e1ae00a4b55cca9e37'
link 'Skitch.app'
end
|
c736de66508c3172b28524c1f746c6d04c58ae55 | tests/docker/pg-12/docker-compose.yml | tests/docker/pg-12/docker-compose.yml | version: '3'
services:
postgres:
build:
dockerfile: ./tests/docker/pg-12/Dockerfile
image: pg-es-fdw:pg-12-es-${ES_VERSION}
container_name: pg-12
| version: '3'
services:
postgres:
build:
dockerfile: ./tests/docker/pg-12/Dockerfile
image: pg-es-fdw:pg-12-es-${ES_VERSION}
container_name: pg-12
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
| Address authentication requirements for pg-12 | Address authentication requirements for pg-12
| YAML | mit | matthewfranglen/postgres-elasticsearch-fdw | yaml | ## Code Before:
version: '3'
services:
postgres:
build:
dockerfile: ./tests/docker/pg-12/Dockerfile
image: pg-es-fdw:pg-12-es-${ES_VERSION}
container_name: pg-12
## Instruction:
Address authentication requirements for pg-12
## Code After:
version: '3'
services:
postgres:
build:
dockerfile: ./tests/docker/pg-12/Dockerfile
image: pg-es-fdw:pg-12-es-${ES_VERSION}
container_name: pg-12
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
|
3e416853b30f17c70f477ea103c92a8023ad4923 | src/terminal_logger.erl | src/terminal_logger.erl | %%%-------------------------------------------------------------------
%%% File : terminal_logger.erl
%%% Author : Nicolas R Dufour <nrdufour@gmail.com>
%%% Created : 2009/06/01
%%% Description :
%%% Simple terminal logger from the erlang documentation.
%%%
%%% Copyright 2009 Nicolas R Dufour <nrdufour@gmail.com>
%%%
%%% This software is licensed as described in the file LICENSE, which
%%% you should have received as part of this distribution.
%%%-------------------------------------------------------------------
-module(terminal_logger).
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
%% trace is enabled by default
init(_Args) ->
{ok, true}.
%% activate or not the trace
handle_event({trace, Trace}, _State) ->
{ok, Trace};
%% display the message
handle_event(Msg, State) ->
if
State ->
io:format(" -> ~p~n", [Msg]);
true ->
true
end,
{ok, State}.
terminate(_Args, _State) ->
ok.
%%% END
| %%%-------------------------------------------------------------------
%%% File : terminal_logger.erl
%%% Author : Nicolas R Dufour <nrdufour@gmail.com>
%%% Created : 2009/06/01
%%% Description :
%%% Simple terminal logger from the erlang documentation.
%%%
%%% Copyright 2009 Nicolas R Dufour <nrdufour@gmail.com>
%%%
%%% This software is licensed as described in the file LICENSE, which
%%% you should have received as part of this distribution.
%%%-------------------------------------------------------------------
-module(terminal_logger).
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
%% trace is enabled by default
init(_Args) ->
{ok, true}.
%% activate or not the trace
handle_event({trace, Trace}, _State) ->
{ok, Trace};
%% display a simple message
handle_event({Msg, Args}, State) ->
if
State ->
Format = string:concat(Msg, "~n"),
io:format(Format, Args);
true ->
true
end,
{ok, State}.
terminate(_Args, _State) ->
ok.
%%% END
| Add a better logger with io:format capabilities. | Add a better logger with io:format capabilities.
| Erlang | mit | nrdufour/similar | erlang | ## Code Before:
%%%-------------------------------------------------------------------
%%% File : terminal_logger.erl
%%% Author : Nicolas R Dufour <nrdufour@gmail.com>
%%% Created : 2009/06/01
%%% Description :
%%% Simple terminal logger from the erlang documentation.
%%%
%%% Copyright 2009 Nicolas R Dufour <nrdufour@gmail.com>
%%%
%%% This software is licensed as described in the file LICENSE, which
%%% you should have received as part of this distribution.
%%%-------------------------------------------------------------------
-module(terminal_logger).
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
%% trace is enabled by default
init(_Args) ->
{ok, true}.
%% activate or not the trace
handle_event({trace, Trace}, _State) ->
{ok, Trace};
%% display the message
handle_event(Msg, State) ->
if
State ->
io:format(" -> ~p~n", [Msg]);
true ->
true
end,
{ok, State}.
terminate(_Args, _State) ->
ok.
%%% END
## Instruction:
Add a better logger with io:format capabilities.
## Code After:
%%%-------------------------------------------------------------------
%%% File : terminal_logger.erl
%%% Author : Nicolas R Dufour <nrdufour@gmail.com>
%%% Created : 2009/06/01
%%% Description :
%%% Simple terminal logger from the erlang documentation.
%%%
%%% Copyright 2009 Nicolas R Dufour <nrdufour@gmail.com>
%%%
%%% This software is licensed as described in the file LICENSE, which
%%% you should have received as part of this distribution.
%%%-------------------------------------------------------------------
-module(terminal_logger).
-behaviour(gen_event).
-export([init/1, handle_event/2, terminate/2]).
%% trace is enabled by default
init(_Args) ->
{ok, true}.
%% activate or not the trace
handle_event({trace, Trace}, _State) ->
{ok, Trace};
%% display a simple message
handle_event({Msg, Args}, State) ->
if
State ->
Format = string:concat(Msg, "~n"),
io:format(Format, Args);
true ->
true
end,
{ok, State}.
terminate(_Args, _State) ->
ok.
%%% END
|
e573fc29d75a8056dea413f84dad6e576b1c1342 | gradle.properties | gradle.properties |
GROUP=com.segment.analytics.android
VERSION_CODE=300
VERSION_NAME=3.0.0-SNAPSHOT
POM_NAME=Segment for Android
POM_DESCRIPTION=The hassle-free way to add analytics to your Android app.
POM_URL=http://github.com/segmentio/analytics-android
POM_SCM_URL=http://github.com/segmentio/analytics-android
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/analytics-android.git
POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=http://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=segmentio
POM_DEVELOPER_NAME=Segment, Inc.
org.gradle.jvmargs=-XX:MaxPermSize=512M |
GROUP=com.segment.analytics.android
VERSION_CODE=300
VERSION_NAME=3.0.0-SNAPSHOT
POM_NAME=Segment for Android
POM_DESCRIPTION=The hassle-free way to add analytics to your Android app.
POM_URL=http://github.com/segmentio/analytics-android
POM_SCM_URL=http://github.com/segmentio/analytics-android
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/analytics-android.git
POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=http://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=segmentio
POM_DEVELOPER_NAME=Segment, Inc.
org.gradle.jvmargs=-XX:MaxPermSize=512M
org.gradle.parallel=true | Enable parallel builds for project | Enable parallel builds for project
| INI | mit | jmgamboa/analytics-android,jtomson-mdsol/analytics-android,rayleeriver/analytics-android,palaniyappanBala/analytics-android,graingert/analytics-android,TorreyKahuna/analytics-android,jmgamboa/analytics-android,amplitude/analytics-android,graingert/analytics-android,segmentio/analytics-android,happysir/analytics-android,happysir/analytics-android,segmentio/analytics-android,TorreyKahuna/analytics-android,palaniyappanBala/analytics-android,jtomson-mdsol/analytics-android,amplitude/analytics-android,rayleeriver/analytics-android,segmentio/analytics-android | ini | ## Code Before:
GROUP=com.segment.analytics.android
VERSION_CODE=300
VERSION_NAME=3.0.0-SNAPSHOT
POM_NAME=Segment for Android
POM_DESCRIPTION=The hassle-free way to add analytics to your Android app.
POM_URL=http://github.com/segmentio/analytics-android
POM_SCM_URL=http://github.com/segmentio/analytics-android
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/analytics-android.git
POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=http://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=segmentio
POM_DEVELOPER_NAME=Segment, Inc.
org.gradle.jvmargs=-XX:MaxPermSize=512M
## Instruction:
Enable parallel builds for project
## Code After:
GROUP=com.segment.analytics.android
VERSION_CODE=300
VERSION_NAME=3.0.0-SNAPSHOT
POM_NAME=Segment for Android
POM_DESCRIPTION=The hassle-free way to add analytics to your Android app.
POM_URL=http://github.com/segmentio/analytics-android
POM_SCM_URL=http://github.com/segmentio/analytics-android
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/analytics-android.git
POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=http://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=segmentio
POM_DEVELOPER_NAME=Segment, Inc.
org.gradle.jvmargs=-XX:MaxPermSize=512M
org.gradle.parallel=true |
4d1ca02d2454bc58dc747b4476ad42cdc3ebdaf4 | readme.md | readme.md |
Just a toy project to learn Rust |
Just a toy project to learn Rust
### personal note:
Hexgem is a typical match 3 game, but with an hexagonal board instead of a rectengular one.
The underlying datastructure is a simple Vec<T>. T here would be a struct representing Gems.
What I would like to do was to add some iterator for this Vec, like a ring or straight lines in x y or z axis. So I could modify T while iterating over my board.
At first, I tried to implement an iter_mut(), but it appear that it's not realy doable without unsafe code.
The fisrt solution was hard to find for me, but quite easy to implement. Just wrap T in RefCell. After that, my Vec can be immutable, and T mutable. There is no need for mut_iter. RefCell have a runtime cost though (it verify ownership at runtime)
The second solution is similar, but use Cell to encapsulate mutable property inside T ()here, a Gem structure). I prefer this one since my property are not big (C like Enum, integer...). Cell don't have runtime cost.
| Add some note on my experimentation with rust. | Add some note on my experimentation with rust.
| Markdown | mit | pepone42/HexGemRust | markdown | ## Code Before:
Just a toy project to learn Rust
## Instruction:
Add some note on my experimentation with rust.
## Code After:
Just a toy project to learn Rust
### personal note:
Hexgem is a typical match 3 game, but with an hexagonal board instead of a rectengular one.
The underlying datastructure is a simple Vec<T>. T here would be a struct representing Gems.
What I would like to do was to add some iterator for this Vec, like a ring or straight lines in x y or z axis. So I could modify T while iterating over my board.
At first, I tried to implement an iter_mut(), but it appear that it's not realy doable without unsafe code.
The fisrt solution was hard to find for me, but quite easy to implement. Just wrap T in RefCell. After that, my Vec can be immutable, and T mutable. There is no need for mut_iter. RefCell have a runtime cost though (it verify ownership at runtime)
The second solution is similar, but use Cell to encapsulate mutable property inside T ()here, a Gem structure). I prefer this one since my property are not big (C like Enum, integer...). Cell don't have runtime cost.
|
c3b6928b7abd44c7dc6f63a3b23ce709c9464a08 | src/client/gral/constants.js | src/client/gral/constants.js | // @flow
import tinycolor from 'tinycolor2';
const BASE_COLOR = tinycolor('aliceblue')
.spin(40)
.toHexString();
const BASE_COLOR2 = tinycolor('aliceblue')
.spin(10)
.toHexString();
const COLORS = {
light: BASE_COLOR,
lightAlt: BASE_COLOR2,
medium: tinycolor(BASE_COLOR)
.darken(5)
.toHexString(),
mediumAlt: tinycolor(BASE_COLOR2)
.darken(5)
.toHexString(),
dark: tinycolor(BASE_COLOR)
.darken(10)
.toHexString(),
darkest: tinycolor(BASE_COLOR)
.darken(65)
.toHexString(),
dim: '#999',
accent: 'darkred',
};
const LANG_OPTIONS = [
{ value: 'en', label: 'English' },
{ value: 'es', label: 'Español' },
{ value: 'ca', label: 'Català' },
];
// ==========================================
// Public API
// ==========================================
export { COLORS, LANG_OPTIONS };
| // @flow
/* eslint-env browser */
import tinycolor from 'tinycolor2';
// Detect theme
let THEME;
try {
THEME = new URL(document.location).searchParams.get('theme');
} catch (err) {
/* ignore */
}
const BASE_COLOR = tinycolor('aliceblue')
.spin(40)
.toHexString();
const BASE_COLOR2 = tinycolor('aliceblue')
.spin(10)
.toHexString();
const COLORS =
THEME === 'embedded'
? {
light: undefined,
lightAlt: BASE_COLOR2,
medium: '#f0f0f0',
mediumAlt: '#f8f8f8',
dark: '#e0e0e0',
darkest: '#888',
dim: '#999',
accent: 'darkred',
}
: {
light: BASE_COLOR,
lightAlt: BASE_COLOR2,
medium: tinycolor(BASE_COLOR)
.darken(5)
.toHexString(),
mediumAlt: tinycolor(BASE_COLOR2)
.darken(5)
.toHexString(),
dark: tinycolor(BASE_COLOR)
.darken(10)
.toHexString(),
darkest: tinycolor(BASE_COLOR)
.darken(65)
.toHexString(),
dim: '#999',
accent: 'darkred',
};
const LANG_OPTIONS = [
{ value: 'en', label: 'English' },
{ value: 'es', label: 'Español' },
{ value: 'ca', label: 'Català' },
];
// ==========================================
// Public API
// ==========================================
export { THEME, COLORS, LANG_OPTIONS };
| Allow some theming via URL | Allow some theming via URL
| JavaScript | mit | guigrpa/mady,guigrpa/mady,guigrpa/mady | javascript | ## Code Before:
// @flow
import tinycolor from 'tinycolor2';
const BASE_COLOR = tinycolor('aliceblue')
.spin(40)
.toHexString();
const BASE_COLOR2 = tinycolor('aliceblue')
.spin(10)
.toHexString();
const COLORS = {
light: BASE_COLOR,
lightAlt: BASE_COLOR2,
medium: tinycolor(BASE_COLOR)
.darken(5)
.toHexString(),
mediumAlt: tinycolor(BASE_COLOR2)
.darken(5)
.toHexString(),
dark: tinycolor(BASE_COLOR)
.darken(10)
.toHexString(),
darkest: tinycolor(BASE_COLOR)
.darken(65)
.toHexString(),
dim: '#999',
accent: 'darkred',
};
const LANG_OPTIONS = [
{ value: 'en', label: 'English' },
{ value: 'es', label: 'Español' },
{ value: 'ca', label: 'Català' },
];
// ==========================================
// Public API
// ==========================================
export { COLORS, LANG_OPTIONS };
## Instruction:
Allow some theming via URL
## Code After:
// @flow
/* eslint-env browser */
import tinycolor from 'tinycolor2';
// Detect theme
let THEME;
try {
THEME = new URL(document.location).searchParams.get('theme');
} catch (err) {
/* ignore */
}
const BASE_COLOR = tinycolor('aliceblue')
.spin(40)
.toHexString();
const BASE_COLOR2 = tinycolor('aliceblue')
.spin(10)
.toHexString();
const COLORS =
THEME === 'embedded'
? {
light: undefined,
lightAlt: BASE_COLOR2,
medium: '#f0f0f0',
mediumAlt: '#f8f8f8',
dark: '#e0e0e0',
darkest: '#888',
dim: '#999',
accent: 'darkred',
}
: {
light: BASE_COLOR,
lightAlt: BASE_COLOR2,
medium: tinycolor(BASE_COLOR)
.darken(5)
.toHexString(),
mediumAlt: tinycolor(BASE_COLOR2)
.darken(5)
.toHexString(),
dark: tinycolor(BASE_COLOR)
.darken(10)
.toHexString(),
darkest: tinycolor(BASE_COLOR)
.darken(65)
.toHexString(),
dim: '#999',
accent: 'darkred',
};
const LANG_OPTIONS = [
{ value: 'en', label: 'English' },
{ value: 'es', label: 'Español' },
{ value: 'ca', label: 'Català' },
];
// ==========================================
// Public API
// ==========================================
export { THEME, COLORS, LANG_OPTIONS };
|
bc2d220d6bfee96599ea43f67d9011b3c933b8b4 | romana-install/roles/os-common/tasks/ubuntu_ssh.yml | romana-install/roles/os-common/tasks/ubuntu_ssh.yml | ---
# These keys are installed so that the EC2 instance can access
# the github repositories of the user doing the installation.
# This is necessary for accessing the (currently) private repositories
# that contain Romana software.
- name: Install private key for ubuntu user
copy: src="~/.ssh/id_rsa" dest="~/.ssh/id_rsa" mode=0600
- name: Install public key for ubuntu user
copy: src="~/.ssh/id_rsa.pub" dest="~/.ssh/id_rsa.pub" mode=0644
- name: Add public key to authorised keys
authorized_key: user=ubuntu key="{{ item }}" state=present
with_file:
- "~/.ssh/id_rsa.pub"
- name: Install known hosts for ubuntu user (github ssh)
copy: src="known_hosts" dest="~/.ssh/known_hosts" mode=0644
| ---
- name: Install private key for ubuntu user
copy: src="romana_id_rsa" dest="~/.ssh/id_rsa" mode=0600
- name: Install public key for ubuntu user
copy: src="romana_id_rsa.pub" dest="~/.ssh/id_rsa.pub" mode=0644
- name: Add public key to authorised keys
authorized_key: user=ubuntu key="{{ item }}" state=present
with_file:
- "romana_id_rsa.pub"
| Copy generated key to hosts | Copy generated key to hosts
| YAML | apache-2.0 | mortensteenrasmussen/romana,mortensteenrasmussen/romana,romana/romana,romana/romana,mortensteenrasmussen/romana | yaml | ## Code Before:
---
# These keys are installed so that the EC2 instance can access
# the github repositories of the user doing the installation.
# This is necessary for accessing the (currently) private repositories
# that contain Romana software.
- name: Install private key for ubuntu user
copy: src="~/.ssh/id_rsa" dest="~/.ssh/id_rsa" mode=0600
- name: Install public key for ubuntu user
copy: src="~/.ssh/id_rsa.pub" dest="~/.ssh/id_rsa.pub" mode=0644
- name: Add public key to authorised keys
authorized_key: user=ubuntu key="{{ item }}" state=present
with_file:
- "~/.ssh/id_rsa.pub"
- name: Install known hosts for ubuntu user (github ssh)
copy: src="known_hosts" dest="~/.ssh/known_hosts" mode=0644
## Instruction:
Copy generated key to hosts
## Code After:
---
- name: Install private key for ubuntu user
copy: src="romana_id_rsa" dest="~/.ssh/id_rsa" mode=0600
- name: Install public key for ubuntu user
copy: src="romana_id_rsa.pub" dest="~/.ssh/id_rsa.pub" mode=0644
- name: Add public key to authorised keys
authorized_key: user=ubuntu key="{{ item }}" state=present
with_file:
- "romana_id_rsa.pub"
|
4d13390be887109113d45c2a52cbb32464608b0b | Casks/royal-tsx-beta.rb | Casks/royal-tsx-beta.rb | cask 'royal-tsx-beta' do
version '2.2.3.1000'
sha256 '601ada5103428f2bca12941e68be90c5089c4c7b4e2f5a5eef62273f256df19a'
url "http://v2.royaltsx.com/updates/royaltsx_#{version}.dmg"
appcast 'http://v2.royaltsx.com/updates_beta.php',
checkpoint: '125af2862030f363930af28d816cdfa4ff45e9a201107ee7506f18b841bd332e'
name 'Royal TSX'
homepage 'http://www.royaltsx.com'
license :freemium
app 'Royal TSX.app'
end
| cask 'royal-tsx-beta' do
version '3.0.0.3'
sha256 'b775b83d5decc39a6af31c52eaea9ee4f76089e44a0df3484e6838c20dc0a427'
# royalapplications.com was verified as official when first introduced to the cask
url "https://royaltsx-v#{version.major}.royalapplications.com/updates/royaltsx_#{version}.dmg"
appcast "http://v#{version.major}.royaltsx.com/updates_beta.php",
checkpoint: '4de03fb7793f10e27e42bcadfd8b0459eab4ac2a6913a4806ae829dd0428a329'
name 'Royal TSX'
homepage 'http://www.royaltsx.com'
license :freemium
app 'Royal TSX.app'
end
| Update Royal TSX Beta to 3.0.0.3 | Update Royal TSX Beta to 3.0.0.3
| Ruby | bsd-2-clause | caskroom/homebrew-versions,stigkj/homebrew-caskroom-versions,peterjosling/homebrew-versions,toonetown/homebrew-cask-versions,stigkj/homebrew-caskroom-versions,hugoboos/homebrew-versions,RJHsiao/homebrew-versions,cprecioso/homebrew-versions,hubwub/homebrew-versions,FinalDes/homebrew-versions,yurikoles/homebrew-versions,pkq/homebrew-versions,victorpopkov/homebrew-versions,bey2lah/homebrew-versions,danielbayley/homebrew-versions,wickedsp1d3r/homebrew-versions,mahori/homebrew-cask-versions,pkq/homebrew-versions,zerrot/homebrew-versions,victorpopkov/homebrew-versions,404NetworkError/homebrew-versions,toonetown/homebrew-cask-versions,mahori/homebrew-versions,lantrix/homebrew-versions,rogeriopradoj/homebrew-versions,yurikoles/homebrew-versions,Ngrd/homebrew-versions,peterjosling/homebrew-versions,hubwub/homebrew-versions,bey2lah/homebrew-versions,mauricerkelly/homebrew-versions,Ngrd/homebrew-versions,hugoboos/homebrew-versions,rogeriopradoj/homebrew-versions,lantrix/homebrew-versions,danielbayley/homebrew-versions,FinalDes/homebrew-versions,cprecioso/homebrew-versions,RJHsiao/homebrew-versions,404NetworkError/homebrew-versions,wickedsp1d3r/homebrew-versions,caskroom/homebrew-versions,mauricerkelly/homebrew-versions | ruby | ## Code Before:
cask 'royal-tsx-beta' do
version '2.2.3.1000'
sha256 '601ada5103428f2bca12941e68be90c5089c4c7b4e2f5a5eef62273f256df19a'
url "http://v2.royaltsx.com/updates/royaltsx_#{version}.dmg"
appcast 'http://v2.royaltsx.com/updates_beta.php',
checkpoint: '125af2862030f363930af28d816cdfa4ff45e9a201107ee7506f18b841bd332e'
name 'Royal TSX'
homepage 'http://www.royaltsx.com'
license :freemium
app 'Royal TSX.app'
end
## Instruction:
Update Royal TSX Beta to 3.0.0.3
## Code After:
cask 'royal-tsx-beta' do
version '3.0.0.3'
sha256 'b775b83d5decc39a6af31c52eaea9ee4f76089e44a0df3484e6838c20dc0a427'
# royalapplications.com was verified as official when first introduced to the cask
url "https://royaltsx-v#{version.major}.royalapplications.com/updates/royaltsx_#{version}.dmg"
appcast "http://v#{version.major}.royaltsx.com/updates_beta.php",
checkpoint: '4de03fb7793f10e27e42bcadfd8b0459eab4ac2a6913a4806ae829dd0428a329'
name 'Royal TSX'
homepage 'http://www.royaltsx.com'
license :freemium
app 'Royal TSX.app'
end
|
efe046a91f563dcf2ef114f088385e82c6f08a55 | web/locales/fy-NL/cross-locale.ftl | web/locales/fy-NL/cross-locale.ftl |
get-involved-button = Meiwurkje
get-involved-cancel = Ofslute
get-involved-title = Oan { $lang } meiwurkje
get-involved-form-title = Skriuw jo yn foar nijs oer it { $lang }:
get-involved-email =
.label = E-mailadres
get-involved-opt-in = Ja, ik wol graach e-mailberjochten ûntfange. Ik wol graach op 'e hichte bliuwe fan de fuortgong fan dizze taal op Common Voice.
|
get-involved-button = Meiwurkje
get-involved-cancel = Ofslute
get-involved-title = Oan { $lang } meiwurkje
get-involved-text =
Tank foar jo ynteresse om mei te wurkje oan it { $lang }. Wy wurkje der hurd oan om elke taal foar de lansearring ree te krijen en hâlde
de teams fia e-mail op 'e hichte. As jo meiwurkje wolle, folje hjirûnder dan jo e-mailadres yn.
get-involved-form-title = Skriuw jo yn foar nijs oer it { $lang }:
get-involved-email =
.label = E-mailadres
get-involved-opt-in = Ja, ik wol graach e-mailberjochten ûntfange. Ik wol graach op 'e hichte bliuwe fan de fuortgong fan dizze taal op Common Voice.
| Update Frisian (fy-NL) localization of Common Voice | Pontoon: Update Frisian (fy-NL) localization of Common Voice
Localization authors:
- Fjoerfoks <fryskefirefox@gmail.com>
| FreeMarker | mpl-2.0 | gozer/voice-web,gozer/voice-web,gozer/voice-web,gozer/voice-web,gozer/voice-web,common-voice/common-voice,gozer/voice-web,common-voice/common-voice,common-voice/common-voice,gozer/voice-web,common-voice/common-voice | freemarker | ## Code Before:
get-involved-button = Meiwurkje
get-involved-cancel = Ofslute
get-involved-title = Oan { $lang } meiwurkje
get-involved-form-title = Skriuw jo yn foar nijs oer it { $lang }:
get-involved-email =
.label = E-mailadres
get-involved-opt-in = Ja, ik wol graach e-mailberjochten ûntfange. Ik wol graach op 'e hichte bliuwe fan de fuortgong fan dizze taal op Common Voice.
## Instruction:
Pontoon: Update Frisian (fy-NL) localization of Common Voice
Localization authors:
- Fjoerfoks <fryskefirefox@gmail.com>
## Code After:
get-involved-button = Meiwurkje
get-involved-cancel = Ofslute
get-involved-title = Oan { $lang } meiwurkje
get-involved-text =
Tank foar jo ynteresse om mei te wurkje oan it { $lang }. Wy wurkje der hurd oan om elke taal foar de lansearring ree te krijen en hâlde
de teams fia e-mail op 'e hichte. As jo meiwurkje wolle, folje hjirûnder dan jo e-mailadres yn.
get-involved-form-title = Skriuw jo yn foar nijs oer it { $lang }:
get-involved-email =
.label = E-mailadres
get-involved-opt-in = Ja, ik wol graach e-mailberjochten ûntfange. Ik wol graach op 'e hichte bliuwe fan de fuortgong fan dizze taal op Common Voice.
|
63b7fd5045af97ffc30d5e6e6aa164d319e2bcf4 | tsconfig.json | tsconfig.json | {
"extends": "@tsconfig/create-react-app/tsconfig.json",
"compilerOptions": {
"importsNotUsedAsValues": "error",
"outDir": "dist",
"sourceMap": true
},
"include": [
"./gulpfile.ts",
"./dev/**/*",
"./gulp/**/*",
"./src/**/*"
],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}
}
| {
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"target": "es6",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"outDir": "dist",
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
},
"include": [
"./gulpfile.ts",
"./dev/**/*",
"./gulp/**/*",
"./src/**/*"
],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}
}
| Copy the create-react-app template config in and remove "noEmit: true". | Copy the create-react-app template config in and remove "noEmit: true".
| JSON | mit | oxyno-zeta/react-editable-json-tree,oxyno-zeta/react-editable-json-tree,oxyno-zeta/react-editable-json-tree | json | ## Code Before:
{
"extends": "@tsconfig/create-react-app/tsconfig.json",
"compilerOptions": {
"importsNotUsedAsValues": "error",
"outDir": "dist",
"sourceMap": true
},
"include": [
"./gulpfile.ts",
"./dev/**/*",
"./gulp/**/*",
"./src/**/*"
],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}
}
## Instruction:
Copy the create-react-app template config in and remove "noEmit: true".
## Code After:
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"target": "es6",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"jsx": "react-jsx",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"outDir": "dist",
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
},
"include": [
"./gulpfile.ts",
"./dev/**/*",
"./gulp/**/*",
"./src/**/*"
],
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}
}
|
5251c24bb6e189eac36bf4bdff2a64824bc7bb18 | Rulers/View/RulerWindow.swift | Rulers/View/RulerWindow.swift | /*
To achieve a borderless, transparent, colored, rounded window **with** shadow:
- Alpha is set on the window
- Window's background color is clear
- Window is opaque and borderless
- The actual color and corner radius are drawn in the content view
The window will then automatically apply a shadow
See also Apple's `RoundTransparentWindow` example where they do just that:
https://developer.apple.com/library/content/samplecode/RoundTransparentWindow
Alternatives (e.g. using the content view's layer properties or colors with alpha
baked in) don't seem to work as reliably or are more complex (drawing the shadow
manually).
*/
import Cocoa
/// Intented to be used with `RulerView` as content view.
final class RulerWindow: NSWindow {
var rulerView: RulerView {
return contentView as! RulerView
}
override var canBecomeKey: Bool {
return false
}
override var canBecomeMain: Bool {
return false
}
override init(contentRect: NSRect,
styleMask style: NSWindowStyleMask,
backing bufferingType: NSBackingStoreType,
defer flag: Bool) {
super.init(contentRect: contentRect,
styleMask: .borderless, // borderless
backing: bufferingType,
defer: flag)
backgroundColor = .clear
isOpaque = false
}
}
| /*
To achieve a borderless, transparent, colored, rounded window **with** shadow:
- Alpha is set on the window
- Window's background color is clear
- Window is opaque and borderless
- The actual color and corner radius are drawn in the content view
The window will then automatically apply a shadow
See also Apple's `RoundTransparentWindow` example where they do just that:
https://developer.apple.com/library/content/samplecode/RoundTransparentWindow
Alternatives (e.g. using the content view's layer properties or colors with alpha
baked in) don't seem to work as reliably or are more complex (drawing the shadow
manually).
*/
import Cocoa
/// Intented to be used with `RulerView` as content view.
final class RulerWindow: NSPanel {
var rulerView: RulerView {
return contentView as! RulerView
}
override var canBecomeKey: Bool {
return false
}
override var canBecomeMain: Bool {
return false
}
override init(contentRect: NSRect,
styleMask style: NSWindowStyleMask,
backing bufferingType: NSBackingStoreType,
defer flag: Bool) {
super.init(contentRect: contentRect,
styleMask: [.borderless, .nonactivatingPanel],
backing: bufferingType,
defer: flag)
backgroundColor = .clear
isOpaque = false
}
}
| Make ruler a non-activating panel. | Make ruler a non-activating panel.
This avoids deactivating other applications in favor of ours in some circumstances.
| Swift | mit | arthurhammer/Rulers | swift | ## Code Before:
/*
To achieve a borderless, transparent, colored, rounded window **with** shadow:
- Alpha is set on the window
- Window's background color is clear
- Window is opaque and borderless
- The actual color and corner radius are drawn in the content view
The window will then automatically apply a shadow
See also Apple's `RoundTransparentWindow` example where they do just that:
https://developer.apple.com/library/content/samplecode/RoundTransparentWindow
Alternatives (e.g. using the content view's layer properties or colors with alpha
baked in) don't seem to work as reliably or are more complex (drawing the shadow
manually).
*/
import Cocoa
/// Intented to be used with `RulerView` as content view.
final class RulerWindow: NSWindow {
var rulerView: RulerView {
return contentView as! RulerView
}
override var canBecomeKey: Bool {
return false
}
override var canBecomeMain: Bool {
return false
}
override init(contentRect: NSRect,
styleMask style: NSWindowStyleMask,
backing bufferingType: NSBackingStoreType,
defer flag: Bool) {
super.init(contentRect: contentRect,
styleMask: .borderless, // borderless
backing: bufferingType,
defer: flag)
backgroundColor = .clear
isOpaque = false
}
}
## Instruction:
Make ruler a non-activating panel.
This avoids deactivating other applications in favor of ours in some circumstances.
## Code After:
/*
To achieve a borderless, transparent, colored, rounded window **with** shadow:
- Alpha is set on the window
- Window's background color is clear
- Window is opaque and borderless
- The actual color and corner radius are drawn in the content view
The window will then automatically apply a shadow
See also Apple's `RoundTransparentWindow` example where they do just that:
https://developer.apple.com/library/content/samplecode/RoundTransparentWindow
Alternatives (e.g. using the content view's layer properties or colors with alpha
baked in) don't seem to work as reliably or are more complex (drawing the shadow
manually).
*/
import Cocoa
/// Intented to be used with `RulerView` as content view.
final class RulerWindow: NSPanel {
var rulerView: RulerView {
return contentView as! RulerView
}
override var canBecomeKey: Bool {
return false
}
override var canBecomeMain: Bool {
return false
}
override init(contentRect: NSRect,
styleMask style: NSWindowStyleMask,
backing bufferingType: NSBackingStoreType,
defer flag: Bool) {
super.init(contentRect: contentRect,
styleMask: [.borderless, .nonactivatingPanel],
backing: bufferingType,
defer: flag)
backgroundColor = .clear
isOpaque = false
}
}
|
b812843f03fd0da920872c109132aee7fae82b3a | tests/instancing_tests/NonterminalsTest.py | tests/instancing_tests/NonterminalsTest.py |
from unittest import TestCase, main
from grammpy import *
from grammpy.exceptions import TreeDeletedException
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): pass
class From(Rule): rule = ([C], [A, B])
class To(Rule): rule = ([A], [B, C])
class NonterminalsTest(TestCase):
def test_correctChild(self):
a = A()
t = To()
a._set_to_rule(t)
self.assertEqual(a.to_rule, t)
def test_correctParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
def test_deleteParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
del f
with self.assertRaises(TreeDeletedException):
a.from_rule
if __name__ == '__main__':
main()
|
from unittest import TestCase, main
from grammpy import *
from grammpy.exceptions import TreeDeletedException
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): pass
class From(Rule): rule = ([C], [A, B])
class To(Rule): rule = ([A], [B, C])
class NonterminalsTest(TestCase):
def test_correctChild(self):
a = A()
t = To()
a._set_to_rule(t)
self.assertEqual(a.to_rule, t)
def test_correctParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
def test_deleteParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
del f
with self.assertRaises(TreeDeletedException):
a.from_rule
def test_shouldNotDeleteChild(self):
a = A()
t = To()
a._set_to_rule(t)
del t
a.to_rule
if __name__ == '__main__':
main()
| Add test of deleteing child for nonterminal | Add test of deleteing child for nonterminal
| Python | mit | PatrikValkovic/grammpy | python | ## Code Before:
from unittest import TestCase, main
from grammpy import *
from grammpy.exceptions import TreeDeletedException
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): pass
class From(Rule): rule = ([C], [A, B])
class To(Rule): rule = ([A], [B, C])
class NonterminalsTest(TestCase):
def test_correctChild(self):
a = A()
t = To()
a._set_to_rule(t)
self.assertEqual(a.to_rule, t)
def test_correctParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
def test_deleteParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
del f
with self.assertRaises(TreeDeletedException):
a.from_rule
if __name__ == '__main__':
main()
## Instruction:
Add test of deleteing child for nonterminal
## Code After:
from unittest import TestCase, main
from grammpy import *
from grammpy.exceptions import TreeDeletedException
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): pass
class From(Rule): rule = ([C], [A, B])
class To(Rule): rule = ([A], [B, C])
class NonterminalsTest(TestCase):
def test_correctChild(self):
a = A()
t = To()
a._set_to_rule(t)
self.assertEqual(a.to_rule, t)
def test_correctParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
def test_deleteParent(self):
a = A()
f = From()
a._set_from_rule(f)
self.assertEqual(a.from_rule, f)
del f
with self.assertRaises(TreeDeletedException):
a.from_rule
def test_shouldNotDeleteChild(self):
a = A()
t = To()
a._set_to_rule(t)
del t
a.to_rule
if __name__ == '__main__':
main()
|
d0c0f5c44a52e3dd5bd8ee438d613504d0d0a454 | tox.ini | tox.ini | [tox]
envlist = py27,py33,py34,py35,py36,py37,py38
[testenv]
deps=pytest
mock
commands=pytest
passenv=SALESFORCE_BULK_TEST_*
| [tox]
envlist = py35,py36,py37,py38
[testenv]
deps=pytest
mock
commands=pytest
passenv=SALESFORCE_BULK_TEST_*
| Remove old python versions from tests | Remove old python versions from tests
| INI | mit | heroku/salesforce-bulk | ini | ## Code Before:
[tox]
envlist = py27,py33,py34,py35,py36,py37,py38
[testenv]
deps=pytest
mock
commands=pytest
passenv=SALESFORCE_BULK_TEST_*
## Instruction:
Remove old python versions from tests
## Code After:
[tox]
envlist = py35,py36,py37,py38
[testenv]
deps=pytest
mock
commands=pytest
passenv=SALESFORCE_BULK_TEST_*
|
01b261dc54580851181efdf7f08fadfd73d58fc5 | db/migrate/20170814214010_add_description_to_issues.rb | db/migrate/20170814214010_add_description_to_issues.rb |
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
Issue.update_all(description_translations: { "en": "Description", "es": "Descripción" })
end
end
|
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
end
end
| Remove old model from migration | Remove old model from migration
| Ruby | agpl-3.0 | PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto | ruby | ## Code Before:
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
Issue.update_all(description_translations: { "en": "Description", "es": "Descripción" })
end
end
## Instruction:
Remove old model from migration
## Code After:
class AddDescriptionToIssues < ActiveRecord::Migration[5.1]
def change
add_column :issues, :description_translations, :jsonb
end
end
|
06b03b18117ff7993c4ea86cfbbd8e03ba6c4bbf | .travis.yml | .travis.yml | language: ruby
script: "bundle exec rake test:units"
sudo: false
cache: bundler
rvm:
- 2.1
- 2.2.3
- 2.3.3
gemfile:
- Gemfile.rails32
- Gemfile.rails40
- Gemfile.rails41
- Gemfile.rails42
- Gemfile.rails5
matrix:
exclude:
- rvm: 2.1
gemfile: Gemfile.rails5
notifications:
email:
- nathaniel@talbott.ws
| language: ruby
script: "bundle exec rake test:units"
sudo: false
cache: bundler
rvm:
- 2.1
- 2.2.3
- 2.3.3
gemfile:
- Gemfile.rails32
- Gemfile.rails40
- Gemfile.rails41
- Gemfile.rails42
- Gemfile.rails5
matrix:
exclude:
- rvm: 2.1
gemfile: Gemfile.rails5
notifications:
email:
on_success: never
on_failure: always
| Set Travis notifications to email committers on build failure | Set Travis notifications to email committers on build failure
| YAML | mit | HealthWave/active_merchant,tangosource/active_merchant,customerlobby/active_merchant,reinteractive/active_merchant,omise/active_merchant,taf2/active_merchant,alexandremcosta/active_merchant,QuickPay/active_merchant,fabiokr/active_merchant,Simplero/active_merchant,curiousepic/active_merchant,activemerchant/active_merchant,InfraRuby/active_merchant,3dna/active_merchant,jameswritescode/active_merchant,samuelgiles/active_merchant,varyonic/active_merchant,elevation/active_merchant,spreedly/active_merchant,waysact/active_merchant,camelmasa/active_merchant,atxwebs/active_merchant,weblinc/active_merchant,djsmentya/active_merchant,vampirechicken/active_merchant,dlehren/active_merchant,nagash/active_merchant,miyazawadegica/active_merchant,rwdaigle/active_merchant,davidsantoso/active_merchant,pinpayments/active_merchant,appfolio/active_merchant,jayfredlund/active_merchant,llopez/active_merchant,Shopify/active_merchant,pacso/active_merchant,planetargon/active_merchant,vanboom/active_merchant,BaseCampOps/active_merchant,ammoready/active_merchant,itransact/active_merchant,joshnuss/active_merchant,Trexle/active_merchant,waysact/active_merchant,lcn-com-dev/active_merchant,getaroom/active_merchant,buttercloud/active_merchant,cyanna/active_merchant,rubemz/active_merchant,whitby3001/active_merchant,veracross/active_merchant | yaml | ## Code Before:
language: ruby
script: "bundle exec rake test:units"
sudo: false
cache: bundler
rvm:
- 2.1
- 2.2.3
- 2.3.3
gemfile:
- Gemfile.rails32
- Gemfile.rails40
- Gemfile.rails41
- Gemfile.rails42
- Gemfile.rails5
matrix:
exclude:
- rvm: 2.1
gemfile: Gemfile.rails5
notifications:
email:
- nathaniel@talbott.ws
## Instruction:
Set Travis notifications to email committers on build failure
## Code After:
language: ruby
script: "bundle exec rake test:units"
sudo: false
cache: bundler
rvm:
- 2.1
- 2.2.3
- 2.3.3
gemfile:
- Gemfile.rails32
- Gemfile.rails40
- Gemfile.rails41
- Gemfile.rails42
- Gemfile.rails5
matrix:
exclude:
- rvm: 2.1
gemfile: Gemfile.rails5
notifications:
email:
on_success: never
on_failure: always
|
368241313dff3de5d0ce41d663fc5414ed27c918 | src/main/java/j2html/tags/InlineStaticResource.java | src/main/java/j2html/tags/InlineStaticResource.java | package j2html.tags;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import j2html.Config;
import j2html.utils.CSSMin;
import j2html.utils.JSMin;
import static j2html.TagCreator.*;
public class InlineStaticResource {
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
public static ContainerTag get(String path, TargetFormat format) {
String fileString = getFileAsString(path);
switch (format) {
case CSS_MIN : return style().with(rawHtml(Config.cssMinifier.minify(fileString)));
case JS_MIN : return script().with(rawHtml(Config.jsMinifier.minify((fileString))));
case CSS : return style().with(rawHtml(fileString));
case JS : return script().with(rawHtml(fileString));
default : throw new RuntimeException("Invalid target format");
}
}
public static String getFileAsString(String path) {
try {
return readFileAsString(InlineStaticResource.class.getResource(path).getPath());
} catch (Exception e1) {
try {
return readFileAsString(path);
} catch (Exception e2) {
throw new RuntimeException("Couldn't find file with path='" + path + "'");
}
}
}
/**
* @author kjheimark <3
*/
private static String readFileAsString(String path) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new FileReader(path));
StringBuilder sb = new StringBuilder();
int c;
while ((c = bufferedReader.read()) >= 0 && c >= 0) {
sb.append((char) c);
}
return sb.toString();
}
}
| package j2html.tags;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;
import j2html.Config;
import static j2html.TagCreator.*;
public class InlineStaticResource {
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
public static ContainerTag get(String path, TargetFormat format) {
String fileString = getFileAsString(path);
switch (format) {
case CSS_MIN : return style().with(rawHtml(Config.cssMinifier.minify(fileString)));
case JS_MIN : return script().with(rawHtml(Config.jsMinifier.minify((fileString))));
case CSS : return style().with(rawHtml(fileString));
case JS : return script().with(rawHtml(fileString));
default : throw new RuntimeException("Invalid target format");
}
}
public static String getFileAsString(String path) {
try {
return streamToString(InlineStaticResource.class.getResourceAsStream(path));
} catch (Exception expected) { // we don't ask users to specify classpath or file-system
try {
return streamToString(new FileInputStream(path));
} catch (Exception exception) {
throw new RuntimeException("Couldn't find file with path='" + path + "'");
}
}
}
private static String streamToString(InputStream inputStream) {
Scanner s = new Scanner(inputStream).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}
}
| Allow reading static resources from jars | Allow reading static resources from jars
| Java | apache-2.0 | tipsy/j2html,tipsy/j2html,tipsy/j2html | java | ## Code Before:
package j2html.tags;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import j2html.Config;
import j2html.utils.CSSMin;
import j2html.utils.JSMin;
import static j2html.TagCreator.*;
public class InlineStaticResource {
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
public static ContainerTag get(String path, TargetFormat format) {
String fileString = getFileAsString(path);
switch (format) {
case CSS_MIN : return style().with(rawHtml(Config.cssMinifier.minify(fileString)));
case JS_MIN : return script().with(rawHtml(Config.jsMinifier.minify((fileString))));
case CSS : return style().with(rawHtml(fileString));
case JS : return script().with(rawHtml(fileString));
default : throw new RuntimeException("Invalid target format");
}
}
public static String getFileAsString(String path) {
try {
return readFileAsString(InlineStaticResource.class.getResource(path).getPath());
} catch (Exception e1) {
try {
return readFileAsString(path);
} catch (Exception e2) {
throw new RuntimeException("Couldn't find file with path='" + path + "'");
}
}
}
/**
* @author kjheimark <3
*/
private static String readFileAsString(String path) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new FileReader(path));
StringBuilder sb = new StringBuilder();
int c;
while ((c = bufferedReader.read()) >= 0 && c >= 0) {
sb.append((char) c);
}
return sb.toString();
}
}
## Instruction:
Allow reading static resources from jars
## Code After:
package j2html.tags;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;
import j2html.Config;
import static j2html.TagCreator.*;
public class InlineStaticResource {
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
public static ContainerTag get(String path, TargetFormat format) {
String fileString = getFileAsString(path);
switch (format) {
case CSS_MIN : return style().with(rawHtml(Config.cssMinifier.minify(fileString)));
case JS_MIN : return script().with(rawHtml(Config.jsMinifier.minify((fileString))));
case CSS : return style().with(rawHtml(fileString));
case JS : return script().with(rawHtml(fileString));
default : throw new RuntimeException("Invalid target format");
}
}
public static String getFileAsString(String path) {
try {
return streamToString(InlineStaticResource.class.getResourceAsStream(path));
} catch (Exception expected) { // we don't ask users to specify classpath or file-system
try {
return streamToString(new FileInputStream(path));
} catch (Exception exception) {
throw new RuntimeException("Couldn't find file with path='" + path + "'");
}
}
}
private static String streamToString(InputStream inputStream) {
Scanner s = new Scanner(inputStream).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}
}
|
027d4ba159b1b849eb326178e592656e363c655d | project.clj | project.clj | (defproject exegesis "0.2.0-SNAPSHOT"
:description "Simplify reflection of annotations on Java types."
:url "http://github.com/tobyclemson/exegesis"
:license {:name "The MIT License"
:url "https://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:source-paths ["src/clojure"]
:test-paths ["test/clojure"]
:java-source-paths ["src/java" "test/java"])
| (defproject exegesis "0.2.0-SNAPSHOT"
:description "Simplify reflection of annotations on Java types."
:url "http://github.com/tobyclemson/exegesis"
:license {:name "The MIT License"
:url "https://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:source-paths ["src/clojure"]
:test-paths ["test/clojure"]
:java-source-paths ["src/java" "test/java"]
:deploy-repositories [["releases" {:url "https://clojars.org/repo/"
:creds :gpg}]])
| Use GPG lookup for clojars credentials. | Use GPG lookup for clojars credentials.
| Clojure | mit | tobyclemson/exegesis | clojure | ## Code Before:
(defproject exegesis "0.2.0-SNAPSHOT"
:description "Simplify reflection of annotations on Java types."
:url "http://github.com/tobyclemson/exegesis"
:license {:name "The MIT License"
:url "https://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:source-paths ["src/clojure"]
:test-paths ["test/clojure"]
:java-source-paths ["src/java" "test/java"])
## Instruction:
Use GPG lookup for clojars credentials.
## Code After:
(defproject exegesis "0.2.0-SNAPSHOT"
:description "Simplify reflection of annotations on Java types."
:url "http://github.com/tobyclemson/exegesis"
:license {:name "The MIT License"
:url "https://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:source-paths ["src/clojure"]
:test-paths ["test/clojure"]
:java-source-paths ["src/java" "test/java"]
:deploy-repositories [["releases" {:url "https://clojars.org/repo/"
:creds :gpg}]])
|
5fe37488e554f9f915319c36aa28adc82b8b3c0a | README.md | README.md | telegraphjs
========
A simple JavaScript example to demonstrate communicating state between the parent window and an iframe
| TelegraphJS
========
A simple JavaScript example to demonstrate communicating state between the parent window and an iframe
TelegraphJS provides a convenient method to communicate, via callbacks,
between a parent window and windows contained in iframes by allowing
the caller to create events (messages) that are sent via postMessage
and associating these events with callbacks in the current window.
Typically you would include TelegraphJS in both the parent window
and the iframe though it will respond to any messages sent via postMessage.
TelegraphJS supports all the security features of postMessage allowing
you to specify the origin (URL) of the target and filter any received messages
by origin using a regular expression match for the URL of the sending
window.
| Update read me with more description of the purpose of the module. | Update read me with more description of the purpose of the module.
| Markdown | mit | tvanfosson/telegraphjs,tvanfosson/telegraphjs | markdown | ## Code Before:
telegraphjs
========
A simple JavaScript example to demonstrate communicating state between the parent window and an iframe
## Instruction:
Update read me with more description of the purpose of the module.
## Code After:
TelegraphJS
========
A simple JavaScript example to demonstrate communicating state between the parent window and an iframe
TelegraphJS provides a convenient method to communicate, via callbacks,
between a parent window and windows contained in iframes by allowing
the caller to create events (messages) that are sent via postMessage
and associating these events with callbacks in the current window.
Typically you would include TelegraphJS in both the parent window
and the iframe though it will respond to any messages sent via postMessage.
TelegraphJS supports all the security features of postMessage allowing
you to specify the origin (URL) of the target and filter any received messages
by origin using a regular expression match for the URL of the sending
window.
|
822e6123cc598b4f6a0eafedfb2f0d0cbfba5f37 | currencies/migrations/0003_auto_20151216_1906.py | currencies/migrations/0003_auto_20151216_1906.py | from __future__ import unicode_literals
from django.db import migrations
from extra_countries.models import ExtraCountry
def add_currencies_with_countries(apps, schema_editor):
# We can't import the model directly as it may be a newer
# version than this migration expects. We use the historical version.
Currency = apps.get_model("currencies", "Currency")
for extra_country in ExtraCountry.objects.all():
print("seeding currency for county: %s" % extra_country.country.name)
# trying to find a currency with the same code first
try:
currency = Currency.objects.get(code=extra_country.country.currency)
except Currency.DoesNotExist: # no such currency yet
currency = Currency(code=extra_country.country.currency,
name=extra_country.country.currency_name)
currency.save()
currency.countries.add(extra_country.pk)
def reverse_data(apps, schema_editor):
Currency = apps.get_model("currencies", "Currency")
Currency.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('currencies', '0002_currency_countries'),
]
operations = [
migrations.RunPython(add_currencies_with_countries, reverse_data)
]
| from __future__ import unicode_literals
from django.db import migrations
from extra_countries.models import ExtraCountry
def add_currencies_with_countries(apps, schema_editor):
# We can't import the model directly as it may be a newer
# version than this migration expects. We use the historical version.
Currency = apps.get_model("currencies", "Currency")
for extra_country in ExtraCountry.objects.all():
print("seeding currency for county: %s" % extra_country.country.name)
# trying to find a currency with the same code first
try:
currency = Currency.objects.get(code=extra_country.country.currency)
except Currency.DoesNotExist: # no such currency yet
currency = Currency(code=extra_country.country.currency,
name=extra_country.country.currency_name)
if (str(extra_country.country.currency) == '') or (str(extra_country.country.currency_name) == ''):
pass
else:
currency.save()
currency.countries.add(extra_country.pk)
def reverse_data(apps, schema_editor):
Currency = apps.get_model("currencies", "Currency")
Currency.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('currencies', '0002_currency_countries'),
]
operations = [
migrations.RunPython(add_currencies_with_countries, reverse_data)
]
| Fix currencies seeding, so it won't have empty currencies | Fix currencies seeding, so it won't have empty currencies
| Python | mit | openspending/cosmopolitan,kiote/cosmopolitan | python | ## Code Before:
from __future__ import unicode_literals
from django.db import migrations
from extra_countries.models import ExtraCountry
def add_currencies_with_countries(apps, schema_editor):
# We can't import the model directly as it may be a newer
# version than this migration expects. We use the historical version.
Currency = apps.get_model("currencies", "Currency")
for extra_country in ExtraCountry.objects.all():
print("seeding currency for county: %s" % extra_country.country.name)
# trying to find a currency with the same code first
try:
currency = Currency.objects.get(code=extra_country.country.currency)
except Currency.DoesNotExist: # no such currency yet
currency = Currency(code=extra_country.country.currency,
name=extra_country.country.currency_name)
currency.save()
currency.countries.add(extra_country.pk)
def reverse_data(apps, schema_editor):
Currency = apps.get_model("currencies", "Currency")
Currency.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('currencies', '0002_currency_countries'),
]
operations = [
migrations.RunPython(add_currencies_with_countries, reverse_data)
]
## Instruction:
Fix currencies seeding, so it won't have empty currencies
## Code After:
from __future__ import unicode_literals
from django.db import migrations
from extra_countries.models import ExtraCountry
def add_currencies_with_countries(apps, schema_editor):
# We can't import the model directly as it may be a newer
# version than this migration expects. We use the historical version.
Currency = apps.get_model("currencies", "Currency")
for extra_country in ExtraCountry.objects.all():
print("seeding currency for county: %s" % extra_country.country.name)
# trying to find a currency with the same code first
try:
currency = Currency.objects.get(code=extra_country.country.currency)
except Currency.DoesNotExist: # no such currency yet
currency = Currency(code=extra_country.country.currency,
name=extra_country.country.currency_name)
if (str(extra_country.country.currency) == '') or (str(extra_country.country.currency_name) == ''):
pass
else:
currency.save()
currency.countries.add(extra_country.pk)
def reverse_data(apps, schema_editor):
Currency = apps.get_model("currencies", "Currency")
Currency.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('currencies', '0002_currency_countries'),
]
operations = [
migrations.RunPython(add_currencies_with_countries, reverse_data)
]
|
25ac6c78271d734772ed59058b9d29b5c6b08ddf | src/compat/posix/include/posix_errno.h | src/compat/posix/include/posix_errno.h | /**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.06.2012
*/
#ifndef COMPAT_POSIX_POSIX_ERRNO_H_
#define COMPAT_POSIX_POSIX_ERRNO_H_
#include <kernel/task/resource/errno.h>
#define errno (*task_self_resource_errno())
#define SET_ERRNO(e) \
({ errno = e; -1; /* to let 'return SET_ERRNO(...)' */ })
#endif /* COMPAT_POSIX_POSIX_ERRNO_H_ */
| /**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.06.2012
*/
#ifndef COMPAT_POSIX_POSIX_ERRNO_H_
#define COMPAT_POSIX_POSIX_ERRNO_H_
#include <kernel/task/resource/errno.h>
#include <compiler.h>
#define errno (*task_self_resource_errno())
static inline int SET_ERRNO(int err) {
errno = err;
return -1;
}
#endif /* COMPAT_POSIX_POSIX_ERRNO_H_ */
| Change SET_ERRNO to be inline function | Change SET_ERRNO to be inline function
| C | bsd-2-clause | mike2390/embox,mike2390/embox,Kefir0192/embox,gzoom13/embox,Kakadu/embox,embox/embox,Kakadu/embox,gzoom13/embox,Kakadu/embox,Kefir0192/embox,embox/embox,Kefir0192/embox,mike2390/embox,Kefir0192/embox,gzoom13/embox,mike2390/embox,Kakadu/embox,embox/embox,Kefir0192/embox,gzoom13/embox,mike2390/embox,gzoom13/embox,Kakadu/embox,mike2390/embox,Kakadu/embox,Kefir0192/embox,gzoom13/embox,Kefir0192/embox,mike2390/embox,embox/embox,Kakadu/embox,embox/embox,embox/embox,gzoom13/embox | c | ## Code Before:
/**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.06.2012
*/
#ifndef COMPAT_POSIX_POSIX_ERRNO_H_
#define COMPAT_POSIX_POSIX_ERRNO_H_
#include <kernel/task/resource/errno.h>
#define errno (*task_self_resource_errno())
#define SET_ERRNO(e) \
({ errno = e; -1; /* to let 'return SET_ERRNO(...)' */ })
#endif /* COMPAT_POSIX_POSIX_ERRNO_H_ */
## Instruction:
Change SET_ERRNO to be inline function
## Code After:
/**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.06.2012
*/
#ifndef COMPAT_POSIX_POSIX_ERRNO_H_
#define COMPAT_POSIX_POSIX_ERRNO_H_
#include <kernel/task/resource/errno.h>
#include <compiler.h>
#define errno (*task_self_resource_errno())
static inline int SET_ERRNO(int err) {
errno = err;
return -1;
}
#endif /* COMPAT_POSIX_POSIX_ERRNO_H_ */
|
acb638e335182e6285c5c927f1d93f0dc743c0bc | client/app/lib/util/getMessageOwner.coffee | client/app/lib/util/getMessageOwner.coffee | remote = require('../remote').getInstance()
module.exports = (message, callback) ->
{constructorName, _id} = message.account
remote.cacheable constructorName, _id, (err, owner) ->
return callback err if err
return callback { message: "Account not found", name: "NotFound" } unless owner
callback null, owner
| remote = require('../remote').getInstance()
fetchAccount = require './fetchAccount'
module.exports = (message, callback) ->
fetchAccount message.account, (err, owner) ->
return callback err if err
return callback { message: "Account not found", name: "NotFound" } unless owner
callback null, owner
| Use fetchAccount util for getting message owner | app: Use fetchAccount util for getting message owner
| CoffeeScript | agpl-3.0 | rjeczalik/koding,sinan/koding,sinan/koding,usirin/koding,koding/koding,gokmen/koding,kwagdy/koding-1,cihangir/koding,usirin/koding,acbodine/koding,cihangir/koding,rjeczalik/koding,cihangir/koding,rjeczalik/koding,koding/koding,usirin/koding,jack89129/koding,alex-ionochkin/koding,usirin/koding,gokmen/koding,alex-ionochkin/koding,rjeczalik/koding,mertaytore/koding,mertaytore/koding,gokmen/koding,szkl/koding,koding/koding,kwagdy/koding-1,andrewjcasal/koding,alex-ionochkin/koding,jack89129/koding,andrewjcasal/koding,sinan/koding,drewsetski/koding,sinan/koding,drewsetski/koding,acbodine/koding,cihangir/koding,alex-ionochkin/koding,drewsetski/koding,alex-ionochkin/koding,koding/koding,koding/koding,koding/koding,rjeczalik/koding,koding/koding,andrewjcasal/koding,acbodine/koding,usirin/koding,szkl/koding,mertaytore/koding,jack89129/koding,rjeczalik/koding,acbodine/koding,gokmen/koding,rjeczalik/koding,cihangir/koding,acbodine/koding,acbodine/koding,jack89129/koding,drewsetski/koding,andrewjcasal/koding,drewsetski/koding,sinan/koding,mertaytore/koding,acbodine/koding,andrewjcasal/koding,kwagdy/koding-1,cihangir/koding,jack89129/koding,drewsetski/koding,szkl/koding,alex-ionochkin/koding,sinan/koding,szkl/koding,gokmen/koding,mertaytore/koding,szkl/koding,acbodine/koding,usirin/koding,drewsetski/koding,kwagdy/koding-1,jack89129/koding,andrewjcasal/koding,gokmen/koding,cihangir/koding,kwagdy/koding-1,sinan/koding,alex-ionochkin/koding,kwagdy/koding-1,andrewjcasal/koding,usirin/koding,jack89129/koding,drewsetski/koding,kwagdy/koding-1,koding/koding,sinan/koding,szkl/koding,jack89129/koding,kwagdy/koding-1,rjeczalik/koding,szkl/koding,mertaytore/koding,alex-ionochkin/koding,andrewjcasal/koding,mertaytore/koding,gokmen/koding,cihangir/koding,gokmen/koding,mertaytore/koding,usirin/koding,szkl/koding | coffeescript | ## Code Before:
remote = require('../remote').getInstance()
module.exports = (message, callback) ->
{constructorName, _id} = message.account
remote.cacheable constructorName, _id, (err, owner) ->
return callback err if err
return callback { message: "Account not found", name: "NotFound" } unless owner
callback null, owner
## Instruction:
app: Use fetchAccount util for getting message owner
## Code After:
remote = require('../remote').getInstance()
fetchAccount = require './fetchAccount'
module.exports = (message, callback) ->
fetchAccount message.account, (err, owner) ->
return callback err if err
return callback { message: "Account not found", name: "NotFound" } unless owner
callback null, owner
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.