commit
stringlengths
40
40
old_file
stringlengths
4
184
new_file
stringlengths
4
184
old_contents
stringlengths
1
3.6k
new_contents
stringlengths
5
3.38k
subject
stringlengths
15
778
message
stringlengths
16
6.74k
lang
stringclasses
201 values
license
stringclasses
13 values
repos
stringlengths
6
116k
config
stringclasses
201 values
content
stringlengths
137
7.24k
diff
stringlengths
26
5.55k
diff_length
int64
1
123
relative_diff_length
float64
0.01
89
n_lines_added
int64
0
108
n_lines_deleted
int64
0
106
f8a17af1840cc25dd4c388fa14dfb87cbe022b36
doc/README.md
doc/README.md
- [Intro to the whole stack](stack.md) - [Setup develop environment]
- [Intro to the whole stack](stack.md) - [Setup develop environment](setup.md) ## Test - `composer test`
Update doc to trigger travis build
Update doc to trigger travis build
Markdown
apache-2.0
at15/bform,at15/bform
markdown
## Code Before: - [Intro to the whole stack](stack.md) - [Setup develop environment] ## Instruction: Update doc to trigger travis build ## Code After: - [Intro to the whole stack](stack.md) - [Setup develop environment](setup.md) ## Test - `composer test`
- [Intro to the whole stack](stack.md) - - [Setup develop environment] + - [Setup develop environment](setup.md) ? ++++++++++ + + ## Test + + - `composer test`
6
2
5
1
88f5a6e7cfec26894094bb849e14c56555a763d2
lib/youtube-dl/output.rb
lib/youtube-dl/output.rb
module YoutubeDL # A class of voodoo methods for parsing youtube-dl output class Output < Struct.new(:output) # Takes the output of '--list-formats' # # @return [Array] Array of supported formats def supported_formats # WARNING: This shit won't be documented or even properly tested. It's almost 3 in the morning and I have no idea what I'm doing. formats = [] output.slice(output.index('format code')..-1).split("\n").each do |line| format = {} format[:format_code], format[:extension], format[:resolution], format[:note] = line.scan(/\A(\d+)\s+(\w+)\s+(\S+)\s(.*)/)[0] formats.push format end formats.shift # The first line is just headers formats.map { |format| format[:note].strip!; format } # Get rid of any trailing whitespace on the note. end # Takes the output of a download # # @return [String] filename saved def filename # Check to see if file was already downloaded if already_downloaded? output.scan(/\[download\]\s(.*)\shas already been downloaded and merged/)[0][0] else output.scan(/Merging formats into \"(.*)\"/)[0][0] end end # Takes the output of a download # # @return [Boolean] Has the file already been downloaded? def already_downloaded? output.include? 'has already been downloaded and merged' end end end
module YoutubeDL # A class of voodoo methods for parsing youtube-dl output class Output < Struct.new(:output) # Takes the output of '--list-formats' # # @return [Array] Array of supported formats def supported_formats # WARNING: This shit won't be documented or even properly tested. It's almost 3 in the morning and I have no idea what I'm doing. formats = [] output.slice(output.index('format code')..-1).split("\n").each do |line| format = {} format[:format_code], format[:extension], format[:resolution], format[:note] = line.scan(/\A(\d+)\s+(\w+)\s+(\S+)\s(.*)/)[0] formats.push format end formats.shift # The first line is just headers formats.map { |format| format[:note].strip!; format } # Get rid of any trailing whitespace on the note. end # Takes the output of a download # # @return [String] filename saved def filename # Check to see if file was already downloaded if already_downloaded? output.scan(/\[download\]\s(.*)\shas already been downloaded and merged/)[0][0] else output.scan(/Merging formats into \"(.*)\"/)[0][0] end rescue NoMethodError nil end # Takes the output of a download # # @return [Boolean] Has the file already been downloaded? def already_downloaded? output.include? 'has already been downloaded and merged' end end end
Return nil if there is no match on Output
Return nil if there is no match on Output
Ruby
mit
sapslaj/youtube-dl.rb,layer8x/youtube-dl.rb
ruby
## Code Before: module YoutubeDL # A class of voodoo methods for parsing youtube-dl output class Output < Struct.new(:output) # Takes the output of '--list-formats' # # @return [Array] Array of supported formats def supported_formats # WARNING: This shit won't be documented or even properly tested. It's almost 3 in the morning and I have no idea what I'm doing. formats = [] output.slice(output.index('format code')..-1).split("\n").each do |line| format = {} format[:format_code], format[:extension], format[:resolution], format[:note] = line.scan(/\A(\d+)\s+(\w+)\s+(\S+)\s(.*)/)[0] formats.push format end formats.shift # The first line is just headers formats.map { |format| format[:note].strip!; format } # Get rid of any trailing whitespace on the note. end # Takes the output of a download # # @return [String] filename saved def filename # Check to see if file was already downloaded if already_downloaded? output.scan(/\[download\]\s(.*)\shas already been downloaded and merged/)[0][0] else output.scan(/Merging formats into \"(.*)\"/)[0][0] end end # Takes the output of a download # # @return [Boolean] Has the file already been downloaded? def already_downloaded? output.include? 'has already been downloaded and merged' end end end ## Instruction: Return nil if there is no match on Output ## Code After: module YoutubeDL # A class of voodoo methods for parsing youtube-dl output class Output < Struct.new(:output) # Takes the output of '--list-formats' # # @return [Array] Array of supported formats def supported_formats # WARNING: This shit won't be documented or even properly tested. It's almost 3 in the morning and I have no idea what I'm doing. formats = [] output.slice(output.index('format code')..-1).split("\n").each do |line| format = {} format[:format_code], format[:extension], format[:resolution], format[:note] = line.scan(/\A(\d+)\s+(\w+)\s+(\S+)\s(.*)/)[0] formats.push format end formats.shift # The first line is just headers formats.map { |format| format[:note].strip!; format } # Get rid of any trailing whitespace on the note. end # Takes the output of a download # # @return [String] filename saved def filename # Check to see if file was already downloaded if already_downloaded? output.scan(/\[download\]\s(.*)\shas already been downloaded and merged/)[0][0] else output.scan(/Merging formats into \"(.*)\"/)[0][0] end rescue NoMethodError nil end # Takes the output of a download # # @return [Boolean] Has the file already been downloaded? def already_downloaded? output.include? 'has already been downloaded and merged' end end end
module YoutubeDL # A class of voodoo methods for parsing youtube-dl output class Output < Struct.new(:output) # Takes the output of '--list-formats' # # @return [Array] Array of supported formats def supported_formats # WARNING: This shit won't be documented or even properly tested. It's almost 3 in the morning and I have no idea what I'm doing. formats = [] output.slice(output.index('format code')..-1).split("\n").each do |line| format = {} format[:format_code], format[:extension], format[:resolution], format[:note] = line.scan(/\A(\d+)\s+(\w+)\s+(\S+)\s(.*)/)[0] formats.push format end formats.shift # The first line is just headers formats.map { |format| format[:note].strip!; format } # Get rid of any trailing whitespace on the note. end # Takes the output of a download # # @return [String] filename saved def filename # Check to see if file was already downloaded if already_downloaded? output.scan(/\[download\]\s(.*)\shas already been downloaded and merged/)[0][0] else output.scan(/Merging formats into \"(.*)\"/)[0][0] end + rescue NoMethodError + nil end # Takes the output of a download # # @return [Boolean] Has the file already been downloaded? def already_downloaded? output.include? 'has already been downloaded and merged' end end end
2
0.052632
2
0
03919a008bb63ef307ea91cf09eac544d8259d5a
search_amazon.rb
search_amazon.rb
require 'mechanize' require 'uri' class Mechanize module AmazonSearch class Client AMAZON_JP_URL = 'http://www.amazon.co.jp'.freeze SEARCH_URL = "#{AMAZON_JP_URL}/gp/search?field-keywords=".freeze def initialize(limit = 10) raise 'Not a correct number (n < 0)' if limit.to_i < 0 @limit = (0..limit).to_a @mechanize = Mechanize.new end def search(key_word) @search_result = @mechanize.get("#{SEARCH_URL}#{URI.escape(key_word)}")) private def title(search_result) search_result.css('h2').first.text end def href(search_result) product_code = search_result.css('a.s-access-detail-page') .first .attributes['href'] .value .match(%r{/dp/\d+}) .to_s "#{AMAZON_JP_URL}#{product_code}" end def price(search_result) search_result.css('span.s-price') .first .text .gsub(/[¥,]/, '') .strip .to_i end end end end
require 'mechanize' require 'uri' class Mechanize module AmazonSearch class Client AMAZON_JP_URL = 'http://www.amazon.co.jp'.freeze SEARCH_URL = "#{AMAZON_JP_URL}/gp/search?field-keywords=".freeze def initialize(limit = 10) raise 'Not a correct number (n < 0)' if limit.to_i < 0 @limit = (0..limit).to_a @mechanize = Mechanize.new end def search(key_word) @search_result = @mechanize.get("#{SEARCH_URL}#{URI.escape(key_word)}")) @search_result = @limit.map do |i| product = search_result.css("li#result_#{i}") { title: title(product), price: price(product), href: href(product) } end end private def title(search_result) search_result.css('h2').first.text end def href(search_result) product_code = search_result.css('a.s-access-detail-page') .first .attributes['href'] .value .match(%r{/dp/\d+}) .to_s "#{AMAZON_JP_URL}#{product_code}" end def price(search_result) search_result.css('span.s-price') .first .text .gsub(/[¥,]/, '') .strip .to_i end end end end
Add scrape from search result
Add scrape from search result and regained an end
Ruby
mit
gouf/mechanize-search-amazon
ruby
## Code Before: require 'mechanize' require 'uri' class Mechanize module AmazonSearch class Client AMAZON_JP_URL = 'http://www.amazon.co.jp'.freeze SEARCH_URL = "#{AMAZON_JP_URL}/gp/search?field-keywords=".freeze def initialize(limit = 10) raise 'Not a correct number (n < 0)' if limit.to_i < 0 @limit = (0..limit).to_a @mechanize = Mechanize.new end def search(key_word) @search_result = @mechanize.get("#{SEARCH_URL}#{URI.escape(key_word)}")) private def title(search_result) search_result.css('h2').first.text end def href(search_result) product_code = search_result.css('a.s-access-detail-page') .first .attributes['href'] .value .match(%r{/dp/\d+}) .to_s "#{AMAZON_JP_URL}#{product_code}" end def price(search_result) search_result.css('span.s-price') .first .text .gsub(/[¥,]/, '') .strip .to_i end end end end ## Instruction: Add scrape from search result and regained an end ## Code After: require 'mechanize' require 'uri' class Mechanize module AmazonSearch class Client AMAZON_JP_URL = 'http://www.amazon.co.jp'.freeze SEARCH_URL = "#{AMAZON_JP_URL}/gp/search?field-keywords=".freeze def initialize(limit = 10) raise 'Not a correct number (n < 0)' if limit.to_i < 0 @limit = (0..limit).to_a @mechanize = Mechanize.new end def search(key_word) @search_result = @mechanize.get("#{SEARCH_URL}#{URI.escape(key_word)}")) @search_result = @limit.map do |i| product = search_result.css("li#result_#{i}") { title: title(product), price: price(product), href: href(product) } end end private def title(search_result) search_result.css('h2').first.text end def href(search_result) product_code = search_result.css('a.s-access-detail-page') .first .attributes['href'] .value .match(%r{/dp/\d+}) .to_s "#{AMAZON_JP_URL}#{product_code}" end def price(search_result) search_result.css('span.s-price') .first .text .gsub(/[¥,]/, '') .strip .to_i end end end end
require 'mechanize' require 'uri' class Mechanize module AmazonSearch class Client AMAZON_JP_URL = 'http://www.amazon.co.jp'.freeze SEARCH_URL = "#{AMAZON_JP_URL}/gp/search?field-keywords=".freeze def initialize(limit = 10) raise 'Not a correct number (n < 0)' if limit.to_i < 0 @limit = (0..limit).to_a @mechanize = Mechanize.new end def search(key_word) @search_result = @mechanize.get("#{SEARCH_URL}#{URI.escape(key_word)}")) + + @search_result = @limit.map do |i| + product = search_result.css("li#result_#{i}") + + { + title: title(product), + price: price(product), + href: href(product) + } + end + end private def title(search_result) search_result.css('h2').first.text end def href(search_result) product_code = search_result.css('a.s-access-detail-page') .first .attributes['href'] .value .match(%r{/dp/\d+}) .to_s "#{AMAZON_JP_URL}#{product_code}" end def price(search_result) search_result.css('span.s-price') .first .text .gsub(/[¥,]/, '') .strip .to_i end end end end
11
0.244444
11
0
99470c7874a65ccf73693624454db8c4b20d59e1
alerts/cloudtrail_public_bucket.py
alerts/cloudtrail_public_bucket.py
from lib.alerttask import AlertTask from mozdef_util.query_models import SearchQuery, TermMatch, ExistsMatch class AlertCloudtrailPublicBucket(AlertTask): def main(self): search_query = SearchQuery(minutes=20) search_query.add_must([ TermMatch('source', 'cloudtrail'), TermMatch('details.eventname', 'CreateBucket'), TermMatch('details.requestparameters.x-amz-acl', 'public-read-write'), ]) self.filtersManual(search_query) self.searchEventsSimple() self.walkEvents() # Set alert properties def onEvent(self, event): request_parameters = event['_source']['details']['requestparameters'] category = 'access' tags = ['cloudtrail'] severity = 'INFO' bucket_name = 'Unknown' if 'bucketname' in request_parameters: bucket_name = request_parameters['bucketname'] summary = "The s3 bucket {0} is listed as public".format(bucket_name) return self.createAlertDict(summary, category, tags, [event], severity)
from lib.alerttask import AlertTask from mozdef_util.query_models import SearchQuery, TermMatch class AlertCloudtrailPublicBucket(AlertTask): def main(self): search_query = SearchQuery(minutes=20) search_query.add_must([ TermMatch('source', 'cloudtrail'), TermMatch('details.eventname', 'CreateBucket'), TermMatch('details.requestparameters.x-amz-acl', 'public-read-write'), ]) self.filtersManual(search_query) self.searchEventsSimple() self.walkEvents() # Set alert properties def onEvent(self, event): request_parameters = event['_source']['details']['requestparameters'] category = 'access' tags = ['cloudtrail'] severity = 'INFO' bucket_name = 'Unknown' if 'bucketname' in request_parameters: bucket_name = request_parameters['bucketname'] summary = "The s3 bucket {0} is listed as public".format(bucket_name) return self.createAlertDict(summary, category, tags, [event], severity)
Remove unused import from cloudtrail public bucket alert
Remove unused import from cloudtrail public bucket alert
Python
mpl-2.0
mpurzynski/MozDef,mozilla/MozDef,mpurzynski/MozDef,mpurzynski/MozDef,mozilla/MozDef,jeffbryner/MozDef,jeffbryner/MozDef,mozilla/MozDef,mozilla/MozDef,jeffbryner/MozDef,mpurzynski/MozDef,jeffbryner/MozDef
python
## Code Before: from lib.alerttask import AlertTask from mozdef_util.query_models import SearchQuery, TermMatch, ExistsMatch class AlertCloudtrailPublicBucket(AlertTask): def main(self): search_query = SearchQuery(minutes=20) search_query.add_must([ TermMatch('source', 'cloudtrail'), TermMatch('details.eventname', 'CreateBucket'), TermMatch('details.requestparameters.x-amz-acl', 'public-read-write'), ]) self.filtersManual(search_query) self.searchEventsSimple() self.walkEvents() # Set alert properties def onEvent(self, event): request_parameters = event['_source']['details']['requestparameters'] category = 'access' tags = ['cloudtrail'] severity = 'INFO' bucket_name = 'Unknown' if 'bucketname' in request_parameters: bucket_name = request_parameters['bucketname'] summary = "The s3 bucket {0} is listed as public".format(bucket_name) return self.createAlertDict(summary, category, tags, [event], severity) ## Instruction: Remove unused import from cloudtrail public bucket alert ## Code After: from lib.alerttask import AlertTask from mozdef_util.query_models import SearchQuery, TermMatch class AlertCloudtrailPublicBucket(AlertTask): def main(self): search_query = SearchQuery(minutes=20) search_query.add_must([ TermMatch('source', 'cloudtrail'), TermMatch('details.eventname', 'CreateBucket'), TermMatch('details.requestparameters.x-amz-acl', 'public-read-write'), ]) self.filtersManual(search_query) self.searchEventsSimple() self.walkEvents() # Set alert properties def onEvent(self, event): request_parameters = event['_source']['details']['requestparameters'] category = 'access' tags = ['cloudtrail'] severity = 'INFO' bucket_name = 'Unknown' if 'bucketname' in request_parameters: bucket_name = request_parameters['bucketname'] summary = "The s3 bucket {0} is listed as public".format(bucket_name) return self.createAlertDict(summary, category, tags, [event], severity)
from lib.alerttask import AlertTask - from mozdef_util.query_models import SearchQuery, TermMatch, ExistsMatch ? ------------- + from mozdef_util.query_models import SearchQuery, TermMatch class AlertCloudtrailPublicBucket(AlertTask): def main(self): search_query = SearchQuery(minutes=20) search_query.add_must([ TermMatch('source', 'cloudtrail'), TermMatch('details.eventname', 'CreateBucket'), TermMatch('details.requestparameters.x-amz-acl', 'public-read-write'), ]) self.filtersManual(search_query) self.searchEventsSimple() self.walkEvents() # Set alert properties def onEvent(self, event): request_parameters = event['_source']['details']['requestparameters'] category = 'access' tags = ['cloudtrail'] severity = 'INFO' bucket_name = 'Unknown' if 'bucketname' in request_parameters: bucket_name = request_parameters['bucketname'] summary = "The s3 bucket {0} is listed as public".format(bucket_name) return self.createAlertDict(summary, category, tags, [event], severity)
2
0.060606
1
1
9cbfd6551710ac96e81f76aec5b2862a8fe01741
packages/po/polysemy-path.yaml
packages/po/polysemy-path.yaml
homepage: '' changelog-type: markdown hash: d985ebbceda2032428656e066ac2caf9c25fd3efb12bc3f7c5164e42494e7675 test-bench-deps: {} maintainer: dan.firth@homotopic.tech synopsis: Polysemy versions of Path functions. changelog: | # Changelog for polysemy-path ## v0.0.1.0 * Add polysemy versions of parsing functions and `stripProperPrefix`. basic-deps: polysemy-plugin: -any path: -any base: '>=4.7 && <5' polysemy-zoo: -any polysemy: -any all-versions: - 0.0.1.0 author: Daniel Firth latest: 0.0.1.0 description-type: markdown description: | # polysemy-path Polysemy-ready versions of functions from the `path` library. license-name: MIT
homepage: '' changelog-type: markdown hash: aebad3d8a49af1d8b1191a8f02b93c936c2f639b8491edaf33d6368dbb3477fe test-bench-deps: {} maintainer: dan.firth@homotopic.tech synopsis: Polysemy versions of Path functions. changelog: | # Changelog for polysemy-path ## v0.1.0.0 * Make functions sign `PathException` rather than `SomeException`. ## v0.0.1.0 * Add polysemy versions of parsing functions and `stripProperPrefix`. basic-deps: polysemy-plugin: -any polysemy-extra: '>=0.1.7.0 && <0.2.0.0' path: -any base: '>=4.7 && <5' polysemy: -any all-versions: - 0.0.1.0 - 0.1.0.0 author: Daniel Firth latest: 0.1.0.0 description-type: markdown description: | # polysemy-path Polysemy-ready versions of functions from the `path` library. license-name: MIT
Update from Hackage at 2020-11-30T02:42:39Z
Update from Hackage at 2020-11-30T02:42:39Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: '' changelog-type: markdown hash: d985ebbceda2032428656e066ac2caf9c25fd3efb12bc3f7c5164e42494e7675 test-bench-deps: {} maintainer: dan.firth@homotopic.tech synopsis: Polysemy versions of Path functions. changelog: | # Changelog for polysemy-path ## v0.0.1.0 * Add polysemy versions of parsing functions and `stripProperPrefix`. basic-deps: polysemy-plugin: -any path: -any base: '>=4.7 && <5' polysemy-zoo: -any polysemy: -any all-versions: - 0.0.1.0 author: Daniel Firth latest: 0.0.1.0 description-type: markdown description: | # polysemy-path Polysemy-ready versions of functions from the `path` library. license-name: MIT ## Instruction: Update from Hackage at 2020-11-30T02:42:39Z ## Code After: homepage: '' changelog-type: markdown hash: aebad3d8a49af1d8b1191a8f02b93c936c2f639b8491edaf33d6368dbb3477fe test-bench-deps: {} maintainer: dan.firth@homotopic.tech synopsis: Polysemy versions of Path functions. changelog: | # Changelog for polysemy-path ## v0.1.0.0 * Make functions sign `PathException` rather than `SomeException`. ## v0.0.1.0 * Add polysemy versions of parsing functions and `stripProperPrefix`. basic-deps: polysemy-plugin: -any polysemy-extra: '>=0.1.7.0 && <0.2.0.0' path: -any base: '>=4.7 && <5' polysemy: -any all-versions: - 0.0.1.0 - 0.1.0.0 author: Daniel Firth latest: 0.1.0.0 description-type: markdown description: | # polysemy-path Polysemy-ready versions of functions from the `path` library. license-name: MIT
homepage: '' changelog-type: markdown - hash: d985ebbceda2032428656e066ac2caf9c25fd3efb12bc3f7c5164e42494e7675 + hash: aebad3d8a49af1d8b1191a8f02b93c936c2f639b8491edaf33d6368dbb3477fe test-bench-deps: {} maintainer: dan.firth@homotopic.tech synopsis: Polysemy versions of Path functions. changelog: | # Changelog for polysemy-path + ## v0.1.0.0 + + * Make functions sign `PathException` rather than `SomeException`. + ## v0.0.1.0 * Add polysemy versions of parsing functions and `stripProperPrefix`. basic-deps: polysemy-plugin: -any + polysemy-extra: '>=0.1.7.0 && <0.2.0.0' path: -any base: '>=4.7 && <5' - polysemy-zoo: -any polysemy: -any all-versions: - 0.0.1.0 + - 0.1.0.0 author: Daniel Firth - latest: 0.0.1.0 ? -- + latest: 0.1.0.0 ? ++ description-type: markdown description: | # polysemy-path Polysemy-ready versions of functions from the `path` library. license-name: MIT
11
0.392857
8
3
33ab3db66a6f37f0e8c8f48a19035464fea358c1
index.js
index.js
import { Kefir as K } from "kefir"; const NEVER = K.never(); const ZERO = K.constant(0); const ADD1 = (x) => x + 1; const SUBTRACT1 = (x) => x - 1; const ALWAYS = (x) => () => x; const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i); function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = {}, slides) { const length = slides.length; const nextT = advance.map(() => ADD1); const previousT = recede.map(() => SUBTRACT1); const indexT = index.map(ALWAYS); const transformations = K.merge([ nextT, previousT, indexT ]); const currentIndex = transformations .scan((i, transform) => transform(i), 0) .map((i) => (i + length) % length); const current = currentIndex.map((i) => slides[i]); const previousIndex = delay(1, currentIndex); const previous = delay(1, current); return { current, currentIndex, previous, previousIndex } } module.exports = galvo;
import { Kefir as K } from "kefir"; const NEVER = K.never(); const ZERO = K.constant(0); const ADD1 = (x) => x + 1; const SUBTRACT1 = (x) => x - 1; const ALWAYS = (x) => () => x; const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i); function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = {}, collection) { const length = collection.length; const nextT = advance.map(() => ADD1); const previousT = recede.map(() => SUBTRACT1); const indexT = index.map(ALWAYS); const transformations = K.merge([ nextT, previousT, indexT ]); const currentIndex = transformations .scan((i, transform) => transform(i), 0) .map((i) => (i + length) % length); const current = currentIndex.map((i) => collection[i]); const previousIndex = delay(1, currentIndex); const previous = delay(1, current); return { current, currentIndex, previous, previousIndex } } module.exports = galvo;
Change slides variable to collection
Change slides variable to collection
JavaScript
mit
standard-library/galvo
javascript
## Code Before: import { Kefir as K } from "kefir"; const NEVER = K.never(); const ZERO = K.constant(0); const ADD1 = (x) => x + 1; const SUBTRACT1 = (x) => x - 1; const ALWAYS = (x) => () => x; const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i); function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = {}, slides) { const length = slides.length; const nextT = advance.map(() => ADD1); const previousT = recede.map(() => SUBTRACT1); const indexT = index.map(ALWAYS); const transformations = K.merge([ nextT, previousT, indexT ]); const currentIndex = transformations .scan((i, transform) => transform(i), 0) .map((i) => (i + length) % length); const current = currentIndex.map((i) => slides[i]); const previousIndex = delay(1, currentIndex); const previous = delay(1, current); return { current, currentIndex, previous, previousIndex } } module.exports = galvo; ## Instruction: Change slides variable to collection ## Code After: import { Kefir as K } from "kefir"; const NEVER = K.never(); const ZERO = K.constant(0); const ADD1 = (x) => x + 1; const SUBTRACT1 = (x) => x - 1; const ALWAYS = (x) => () => x; const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i); function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = {}, collection) { const length = collection.length; const nextT = advance.map(() => ADD1); const previousT = recede.map(() => SUBTRACT1); const indexT = index.map(ALWAYS); const transformations = K.merge([ nextT, previousT, indexT ]); const currentIndex = transformations .scan((i, transform) => transform(i), 0) .map((i) => (i + length) % length); const current = currentIndex.map((i) => collection[i]); const previousIndex = delay(1, currentIndex); const previous = delay(1, current); return { current, currentIndex, previous, previousIndex } } module.exports = galvo;
import { Kefir as K } from "kefir"; const NEVER = K.never(); const ZERO = K.constant(0); const ADD1 = (x) => x + 1; const SUBTRACT1 = (x) => x - 1; const ALWAYS = (x) => () => x; const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i); - function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = {}, slides) { ? ^ ^^^ + function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = {}, collection) { ? ^^ ++++ ^^ - const length = slides.length; ? ^ ^^^ + const length = collection.length; ? ^^ ++++ ^^ const nextT = advance.map(() => ADD1); const previousT = recede.map(() => SUBTRACT1); const indexT = index.map(ALWAYS); const transformations = K.merge([ nextT, previousT, indexT ]); const currentIndex = transformations .scan((i, transform) => transform(i), 0) .map((i) => (i + length) % length); - const current = currentIndex.map((i) => slides[i]); ? ^ ^^^ + const current = currentIndex.map((i) => collection[i]); ? ^^ ++++ ^^ const previousIndex = delay(1, currentIndex); const previous = delay(1, current); return { current, currentIndex, previous, previousIndex } } module.exports = galvo;
6
0.142857
3
3
c1cbf928b31f7d6f451c389cc04b74687f1c83ce
lib/boot.rb
lib/boot.rb
boot_fail = false ## Configurations #require_relative File.join('..', 'config', 'config') #require_relative File.join('..', 'config', 'constants') ## Libraries require_relative 'command' #require_relative 'app' #require_relative 'asap' #require_relative 'tabix' #require_relative 'tarball' #require_relative 'vcfrow' #require_relative 'trollop' # Built-in gems require 'yaml' # Load configurations CONFIG = YAML.load_file(File.join('config', 'config.yml')) # Verify required utilities are in $PATH utils = ['bcftools', 'tabix', 'bgzip'] utils.each do |util| if `which #{util} 2> /dev/null`.empty? # Print to stderr STDERR.puts "ERROR: #{util} is not in your $PATH, which is required to run this tool" boot_fail = true end end abort if boot_fail
boot_fail = false ## Configurations #require_relative File.join('..', 'config', 'config') #require_relative File.join('..', 'config', 'constants') ## Libraries require_relative 'command' #require_relative 'app' #require_relative 'asap' #require_relative 'tabix' #require_relative 'tarball' #require_relative 'vcfrow' #require_relative 'trollop' # Built-in gems require 'yaml' # Load configurations CONFIG = YAML.load_file(File.join('config', 'config.yml')) # Verify required utilities are in $PATH utils = ['bcftools', 'tabix', 'bgzip', 'sort', 'java'] utils.each do |util| if `which #{util} 2> /dev/null`.empty? # Print to stderr STDERR.puts "ERROR: #{util} is not in your $PATH, which is required to run this tool" boot_fail = true end end abort if boot_fail
Verify 'sort' and 'java' are in $PATH
Verify 'sort' and 'java' are in $PATH
Ruby
mit
clcg/kafeen
ruby
## Code Before: boot_fail = false ## Configurations #require_relative File.join('..', 'config', 'config') #require_relative File.join('..', 'config', 'constants') ## Libraries require_relative 'command' #require_relative 'app' #require_relative 'asap' #require_relative 'tabix' #require_relative 'tarball' #require_relative 'vcfrow' #require_relative 'trollop' # Built-in gems require 'yaml' # Load configurations CONFIG = YAML.load_file(File.join('config', 'config.yml')) # Verify required utilities are in $PATH utils = ['bcftools', 'tabix', 'bgzip'] utils.each do |util| if `which #{util} 2> /dev/null`.empty? # Print to stderr STDERR.puts "ERROR: #{util} is not in your $PATH, which is required to run this tool" boot_fail = true end end abort if boot_fail ## Instruction: Verify 'sort' and 'java' are in $PATH ## Code After: boot_fail = false ## Configurations #require_relative File.join('..', 'config', 'config') #require_relative File.join('..', 'config', 'constants') ## Libraries require_relative 'command' #require_relative 'app' #require_relative 'asap' #require_relative 'tabix' #require_relative 'tarball' #require_relative 'vcfrow' #require_relative 'trollop' # Built-in gems require 'yaml' # Load configurations CONFIG = YAML.load_file(File.join('config', 'config.yml')) # Verify required utilities are in $PATH utils = ['bcftools', 'tabix', 'bgzip', 'sort', 'java'] utils.each do |util| if `which #{util} 2> /dev/null`.empty? # Print to stderr STDERR.puts "ERROR: #{util} is not in your $PATH, which is required to run this tool" boot_fail = true end end abort if boot_fail
boot_fail = false ## Configurations #require_relative File.join('..', 'config', 'config') #require_relative File.join('..', 'config', 'constants') ## Libraries require_relative 'command' #require_relative 'app' #require_relative 'asap' #require_relative 'tabix' #require_relative 'tarball' #require_relative 'vcfrow' #require_relative 'trollop' # Built-in gems require 'yaml' # Load configurations CONFIG = YAML.load_file(File.join('config', 'config.yml')) # Verify required utilities are in $PATH - utils = ['bcftools', 'tabix', 'bgzip'] + utils = ['bcftools', 'tabix', 'bgzip', 'sort', 'java'] ? ++++++++++++++++ utils.each do |util| if `which #{util} 2> /dev/null`.empty? # Print to stderr STDERR.puts "ERROR: #{util} is not in your $PATH, which is required to run this tool" boot_fail = true end end abort if boot_fail
2
0.068966
1
1
637f2a1d5eb591dd2d1170799962bd40569acb80
templates/posts.html
templates/posts.html
{% extends 'index.html' %} {% block main %} <section> <h1>{{ page.title }}</h1> {% for year_month, posts in page.posts|groupby('year_month') %} <section> <h2><i class="geomicon" data-id="calendar"></i> {{ year_month }}</h2> {% for post in posts %} <article itemscope itemtype="http://schema.org/BlogPosting"> <header> <h3 itemprop="name"><a href="{{ route('post', post) }}" itemprop="url">{{ post.title }}</a></h3> </header> <p itemprop="description">{{ post.summary }}</p> </article> {% endfor %} </section> {% endfor %} </section> {% endblock %}
{% extends 'index.html' %} {% block main %} <section> <h1>{{ page.title }}</h1> {% for year_month, posts in page.posts|groupby('year_month') %} <section> <h2><i class="geomicon" data-id="calendar"></i> {{ year_month }}</h2> {% for post in posts %} <article itemscope itemtype="http://schema.org/BlogPosting"> <header> <h3 itemprop="name"><a href="{{ route(routename|default('post'), post) }}" itemprop="url">{{ post.title }}</a></h3> </header> <p itemprop="description">{{ post.summary }}</p> </article> {% endfor %} </section> {% endfor %} </section> {% endblock %}
Use the same convention for all route calls
Use the same convention for all route calls
HTML
mit
erickmerchant/erickmerchant.com-source,erickmerchant/erickmerchant.com-source
html
## Code Before: {% extends 'index.html' %} {% block main %} <section> <h1>{{ page.title }}</h1> {% for year_month, posts in page.posts|groupby('year_month') %} <section> <h2><i class="geomicon" data-id="calendar"></i> {{ year_month }}</h2> {% for post in posts %} <article itemscope itemtype="http://schema.org/BlogPosting"> <header> <h3 itemprop="name"><a href="{{ route('post', post) }}" itemprop="url">{{ post.title }}</a></h3> </header> <p itemprop="description">{{ post.summary }}</p> </article> {% endfor %} </section> {% endfor %} </section> {% endblock %} ## Instruction: Use the same convention for all route calls ## Code After: {% extends 'index.html' %} {% block main %} <section> <h1>{{ page.title }}</h1> {% for year_month, posts in page.posts|groupby('year_month') %} <section> <h2><i class="geomicon" data-id="calendar"></i> {{ year_month }}</h2> {% for post in posts %} <article itemscope itemtype="http://schema.org/BlogPosting"> <header> <h3 itemprop="name"><a href="{{ route(routename|default('post'), post) }}" itemprop="url">{{ post.title }}</a></h3> </header> <p itemprop="description">{{ post.summary }}</p> </article> {% endfor %} </section> {% endfor %} </section> {% endblock %}
{% extends 'index.html' %} {% block main %} <section> <h1>{{ page.title }}</h1> {% for year_month, posts in page.posts|groupby('year_month') %} <section> <h2><i class="geomicon" data-id="calendar"></i> {{ year_month }}</h2> {% for post in posts %} <article itemscope itemtype="http://schema.org/BlogPosting"> <header> - <h3 itemprop="name"><a href="{{ route('post', post) }}" itemprop="url">{{ post.title }}</a></h3> + <h3 itemprop="name"><a href="{{ route(routename|default('post'), post) }}" itemprop="url">{{ post.title }}</a></h3> ? ++++++++++++++++++ + </header> <p itemprop="description">{{ post.summary }}</p> </article> {% endfor %} </section> {% endfor %} </section> {% endblock %}
2
0.1
1
1
78aa6e0fb40c58376105c801c1204b194bc926de
publishing/printview/main.js
publishing/printview/main.js
// convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab define([ 'base/js/namespace', 'jquery', ], function(IPython, $) { "use strict"; if (IPython.version[0] < 3) { console.log("This extension requires IPython 3.x") return } /** * Call nbconvert using the current notebook server profile * */ var nbconvertPrintView = function () { var kernel = IPython.notebook.kernel; var name = IPython.notebook.notebook_name; var command = 'ip=get_ipython(); import os; os.system(\"ipython nbconvert --profile=%s --to html ' + name + '\" % ip.profile)'; function callback(out_type, out_data) { var url = name.split('.ipynb')[0] + '.html'; var win=window.open(url, '_blank'); win.focus(); } kernel.execute(command, { shell: { reply : callback } }); $('#doPrintView').blur() }; IPython.toolbar.add_buttons_group([ { id : 'doPrintView', label : 'Create static print view', icon : 'fa-print', callback : nbconvertPrintView } ]) })
// convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab define([ 'base/js/namespace', 'jquery', ], function(IPython, $) { "use strict"; if (IPython.version[0] < 3) { console.log("This extension requires at least IPython 3.x") return } /** * Call nbconvert using the current notebook server profile * */ var nbconvertPrintView = function () { var name = IPython.notebook.notebook_name; var command = 'ip=get_ipython(); import os; os.system(\"jupyter nbconvert --profile=%s --to html ' + name + '\" % ip.profile)'; callbacks = { iopub : { output : function() { var url = name.split('.ipynb')[0] + '.html'; var win=window.open(url, '_blank'); win.focus(); } } }; IPython.notebook.kernel.execute(command, callbacks); //$('#doPrintView').blur(); }; var load_ipython_extension = function () { IPython.toolbar.add_buttons_group([ { id : 'doPrintView', label : 'Create static print view', icon : 'fa-print', callback : nbconvertPrintView } ]) } return { load_ipython_extension : load_ipython_extension } })
Make printview work with jupyter
Make printview work with jupyter
JavaScript
bsd-3-clause
Konubinix/IPython-notebook-extensions,Konubinix/IPython-notebook-extensions,Konubinix/IPython-notebook-extensions
javascript
## Code Before: // convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab define([ 'base/js/namespace', 'jquery', ], function(IPython, $) { "use strict"; if (IPython.version[0] < 3) { console.log("This extension requires IPython 3.x") return } /** * Call nbconvert using the current notebook server profile * */ var nbconvertPrintView = function () { var kernel = IPython.notebook.kernel; var name = IPython.notebook.notebook_name; var command = 'ip=get_ipython(); import os; os.system(\"ipython nbconvert --profile=%s --to html ' + name + '\" % ip.profile)'; function callback(out_type, out_data) { var url = name.split('.ipynb')[0] + '.html'; var win=window.open(url, '_blank'); win.focus(); } kernel.execute(command, { shell: { reply : callback } }); $('#doPrintView').blur() }; IPython.toolbar.add_buttons_group([ { id : 'doPrintView', label : 'Create static print view', icon : 'fa-print', callback : nbconvertPrintView } ]) }) ## Instruction: Make printview work with jupyter ## Code After: // convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab define([ 'base/js/namespace', 'jquery', ], function(IPython, $) { "use strict"; if (IPython.version[0] < 3) { console.log("This extension requires at least IPython 3.x") return } /** * Call nbconvert using the current notebook server profile * */ var nbconvertPrintView = function () { var name = IPython.notebook.notebook_name; var command = 'ip=get_ipython(); import os; os.system(\"jupyter nbconvert --profile=%s --to html ' + name + '\" % ip.profile)'; callbacks = { iopub : { output : function() { var url = name.split('.ipynb')[0] + '.html'; var win=window.open(url, '_blank'); win.focus(); } } }; IPython.notebook.kernel.execute(command, callbacks); //$('#doPrintView').blur(); }; var load_ipython_extension = function () { IPython.toolbar.add_buttons_group([ { id : 'doPrintView', label : 'Create static print view', icon : 'fa-print', callback : nbconvertPrintView } ]) } return { load_ipython_extension : load_ipython_extension } })
// convert current notebook to html by calling "ipython nbconvert" and open static html file in new tab define([ 'base/js/namespace', 'jquery', ], function(IPython, $) { "use strict"; if (IPython.version[0] < 3) { - console.log("This extension requires IPython 3.x") + console.log("This extension requires at least IPython 3.x") ? +++++++++ return } - + /** * Call nbconvert using the current notebook server profile * */ var nbconvertPrintView = function () { - var kernel = IPython.notebook.kernel; var name = IPython.notebook.notebook_name; - var command = 'ip=get_ipython(); import os; os.system(\"ipython nbconvert --profile=%s --to html ' ? ^ ^^^ + var command = 'ip=get_ipython(); import os; os.system(\"jupyter nbconvert --profile=%s --to html ' ? ^^ ^^ + name + '\" % ip.profile)'; - function callback(out_type, out_data) { + callbacks = { + iopub : { + output : function() { - var url = name.split('.ipynb')[0] + '.html'; + var url = name.split('.ipynb')[0] + '.html'; ? ++ - var win=window.open(url, '_blank'); + var win=window.open(url, '_blank'); ? ++ - win.focus(); + win.focus(); ? ++ + } - } + } ? + - kernel.execute(command, { shell: { reply : callback } }); + }; + IPython.notebook.kernel.execute(command, callbacks); - $('#doPrintView').blur() + //$('#doPrintView').blur(); ? ++ + }; + var load_ipython_extension = function () { - IPython.toolbar.add_buttons_group([ + IPython.toolbar.add_buttons_group([ ? + - { + { ? + - id : 'doPrintView', + id : 'doPrintView', ? ++ - label : 'Create static print view', + label : 'Create static print view', ? ++ - icon : 'fa-print', + icon : 'fa-print', ? ++ - callback : nbconvertPrintView + callback : nbconvertPrintView ? ++ - } + } ? + - ]) + ]) ? + + } + return { + load_ipython_extension : load_ipython_extension + } })
46
1.179487
27
19
f55681bdb56b5d8bd258446bdb6f457e345fdc7f
src/main/java/info/u_team/u_team_core/util/world/WorldUtil.java
src/main/java/info/u_team/u_team_core/util/world/WorldUtil.java
package info.u_team.u_team_core.util.world; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.*; public class WorldUtil { public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range) { return rayTraceServerSide(player, range, RayTraceFluidMode.NEVER, false, true); } public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range, RayTraceFluidMode liquidMode, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) { Vec3d playerVector = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3d lookVector = player.getLookVec(); Vec3d locationVector = playerVector.add(lookVector.x * range, lookVector.y * range, lookVector.z * range); return player.world.rayTraceBlocks(playerVector, locationVector, liquidMode, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } }
package info.u_team.u_team_core.util.world; import java.util.function.Function; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.*; import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.storage.WorldSavedData; public class WorldUtil { public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range) { return rayTraceServerSide(player, range, RayTraceFluidMode.NEVER, false, true); } public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range, RayTraceFluidMode liquidMode, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) { Vec3d playerVector = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3d lookVector = player.getLookVec(); Vec3d locationVector = playerVector.add(lookVector.x * range, lookVector.y * range, lookVector.z * range); return player.world.rayTraceBlocks(playerVector, locationVector, liquidMode, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } public static <T extends WorldSavedData> T getSaveData(World world, String name, Function<String, T> function) { final DimensionType type = world.getDimension().getType(); T instance = world.getSavedData(type, function, name); if (instance == null) { instance = function.apply(name); world.setSavedData(type, name, instance); } return instance; } }
Add a method to get savedata from the world quit easy
Add a method to get savedata from the world quit easy
Java
apache-2.0
MC-U-Team/U-Team-Core,MC-U-Team/U-Team-Core
java
## Code Before: package info.u_team.u_team_core.util.world; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.*; public class WorldUtil { public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range) { return rayTraceServerSide(player, range, RayTraceFluidMode.NEVER, false, true); } public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range, RayTraceFluidMode liquidMode, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) { Vec3d playerVector = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3d lookVector = player.getLookVec(); Vec3d locationVector = playerVector.add(lookVector.x * range, lookVector.y * range, lookVector.z * range); return player.world.rayTraceBlocks(playerVector, locationVector, liquidMode, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } } ## Instruction: Add a method to get savedata from the world quit easy ## Code After: package info.u_team.u_team_core.util.world; import java.util.function.Function; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.*; import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.storage.WorldSavedData; public class WorldUtil { public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range) { return rayTraceServerSide(player, range, RayTraceFluidMode.NEVER, false, true); } public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range, RayTraceFluidMode liquidMode, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) { Vec3d playerVector = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3d lookVector = player.getLookVec(); Vec3d locationVector = playerVector.add(lookVector.x * range, lookVector.y * range, lookVector.z * range); return player.world.rayTraceBlocks(playerVector, locationVector, liquidMode, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } public static <T extends WorldSavedData> T getSaveData(World world, String name, Function<String, T> function) { final DimensionType type = world.getDimension().getType(); T instance = world.getSavedData(type, function, name); if (instance == null) { instance = function.apply(name); world.setSavedData(type, name, instance); } return instance; } }
package info.u_team.u_team_core.util.world; + + import java.util.function.Function; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.*; + import net.minecraft.world.World; + import net.minecraft.world.dimension.DimensionType; + import net.minecraft.world.storage.WorldSavedData; public class WorldUtil { public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range) { return rayTraceServerSide(player, range, RayTraceFluidMode.NEVER, false, true); } public static RayTraceResult rayTraceServerSide(EntityPlayer player, double range, RayTraceFluidMode liquidMode, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock) { Vec3d playerVector = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3d lookVector = player.getLookVec(); Vec3d locationVector = playerVector.add(lookVector.x * range, lookVector.y * range, lookVector.z * range); return player.world.rayTraceBlocks(playerVector, locationVector, liquidMode, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } + + public static <T extends WorldSavedData> T getSaveData(World world, String name, Function<String, T> function) { + final DimensionType type = world.getDimension().getType(); + T instance = world.getSavedData(type, function, name); + if (instance == null) { + instance = function.apply(name); + world.setSavedData(type, name, instance); + } + return instance; + } }
15
0.833333
15
0
5ecf7d195332477bb5b1cfc5ac2418e7ee7ab2e5
DS18B20.pm
DS18B20.pm
package DS18B20; use Moose; use DS18B20::Sensor; has 'Directory' => ( is => 'rw', isa => 'Str', default => '/sys/bus/w1/devices' ); has 'Sensors' => ( is => 'rw', isa => 'ArrayRef', default => sub { my $self = shift; $self->load_modules() unless (-e $self->Directory); my @files = $self->get_sensors($self->Directory); my @sensors; for (@files) { push @sensors, DS18B20::Sensor->new(File => $_); } return \@sensors; } ); sub load_modules { my $self = shift; system("modprobe", "w1-gpio") == 0 or die "Could not load module w1-gpio.\n"; system("modprobe", "w1-therm") == 0 or die "Could not load module w1-therm.\n"; }; sub get_sensors { my $self = shift; my $dir = shift; opendir(my $dh, $dir) or die "Error opening $dir.\n"; my @devices = readdir($dh); closedir($dh); my @files; for my $dev (@devices) { if( $dev =~ m/28.*/ ) { my $file = $dir . '/' . $dev . '/w1_slave'; push @files, $file; } } return @files; } no Moose; __PACKAGE__->meta->make_immutable; 1;
package DS18B20; use Moose; use DS18B20::Sensor; has 'Directory' => ( is => 'rw', isa => 'Str', default => '/sys/bus/w1/devices' ); has 'Sensors' => ( is => 'rw', isa => 'ArrayRef', default => sub { my $self = shift; $self->load_modules() unless (-e $self->Directory); my @files = $self->get_sensors($self->Directory); my @sensors = map { DS18B20::Sensor->new(File => $_) } @files; return \@sensors; } ); sub load_modules { my $self = shift; system("modprobe", "w1-gpio") == 0 or die "Could not load module w1-gpio.\n"; system("modprobe", "w1-therm") == 0 or die "Could not load module w1-therm.\n"; }; sub get_sensors { my $self = shift; my $dir = shift; opendir(my $dh, $dir) or die "Error opening $dir.\n"; my @devices = readdir($dh); closedir($dh); my @files = map { $dir . '/' . $_ . '/w1_slave' } grep { /^28.*/ } @devices; return @files; } no Moose; __PACKAGE__->meta->make_immutable; 1;
Make module more idiomatic using map and grep for list operations.
Make module more idiomatic using map and grep for list operations.
Perl
bsd-3-clause
nornagest/rpi_experiments,nornagest/rpi_experiments,nornagest/rpi_experiments
perl
## Code Before: package DS18B20; use Moose; use DS18B20::Sensor; has 'Directory' => ( is => 'rw', isa => 'Str', default => '/sys/bus/w1/devices' ); has 'Sensors' => ( is => 'rw', isa => 'ArrayRef', default => sub { my $self = shift; $self->load_modules() unless (-e $self->Directory); my @files = $self->get_sensors($self->Directory); my @sensors; for (@files) { push @sensors, DS18B20::Sensor->new(File => $_); } return \@sensors; } ); sub load_modules { my $self = shift; system("modprobe", "w1-gpio") == 0 or die "Could not load module w1-gpio.\n"; system("modprobe", "w1-therm") == 0 or die "Could not load module w1-therm.\n"; }; sub get_sensors { my $self = shift; my $dir = shift; opendir(my $dh, $dir) or die "Error opening $dir.\n"; my @devices = readdir($dh); closedir($dh); my @files; for my $dev (@devices) { if( $dev =~ m/28.*/ ) { my $file = $dir . '/' . $dev . '/w1_slave'; push @files, $file; } } return @files; } no Moose; __PACKAGE__->meta->make_immutable; 1; ## Instruction: Make module more idiomatic using map and grep for list operations. ## Code After: package DS18B20; use Moose; use DS18B20::Sensor; has 'Directory' => ( is => 'rw', isa => 'Str', default => '/sys/bus/w1/devices' ); has 'Sensors' => ( is => 'rw', isa => 'ArrayRef', default => sub { my $self = shift; $self->load_modules() unless (-e $self->Directory); my @files = $self->get_sensors($self->Directory); my @sensors = map { DS18B20::Sensor->new(File => $_) } @files; return \@sensors; } ); sub load_modules { my $self = shift; system("modprobe", "w1-gpio") == 0 or die "Could not load module w1-gpio.\n"; system("modprobe", "w1-therm") == 0 or die "Could not load module w1-therm.\n"; }; sub get_sensors { my $self = shift; my $dir = shift; opendir(my $dh, $dir) or die "Error opening $dir.\n"; my @devices = readdir($dh); closedir($dh); my @files = map { $dir . '/' . $_ . '/w1_slave' } grep { /^28.*/ } @devices; return @files; } no Moose; __PACKAGE__->meta->make_immutable; 1;
package DS18B20; use Moose; use DS18B20::Sensor; has 'Directory' => ( is => 'rw', isa => 'Str', default => '/sys/bus/w1/devices' ); has 'Sensors' => ( is => 'rw', isa => 'ArrayRef', default => sub { my $self = shift; $self->load_modules() unless (-e $self->Directory); my @files = $self->get_sensors($self->Directory); - my @sensors; - for (@files) { - push @sensors, DS18B20::Sensor->new(File => $_); ? ^^^^^^ ^ + my @sensors = map { DS18B20::Sensor->new(File => $_) } @files; ? ^^ ^^^^^^^^ +++++++++ - } return \@sensors; } ); sub load_modules { my $self = shift; system("modprobe", "w1-gpio") == 0 or die "Could not load module w1-gpio.\n"; system("modprobe", "w1-therm") == 0 or die "Could not load module w1-therm.\n"; }; sub get_sensors { my $self = shift; my $dir = shift; opendir(my $dh, $dir) or die "Error opening $dir.\n"; my @devices = readdir($dh); closedir($dh); + my @files = map { $dir . '/' . $_ . '/w1_slave' } grep { /^28.*/ } @devices; - my @files; - for my $dev (@devices) { - if( $dev =~ m/28.*/ ) { - my $file = $dir . '/' . $dev . '/w1_slave'; - push @files, $file; - } - } return @files; } no Moose; __PACKAGE__->meta->make_immutable; 1;
13
0.232143
2
11
c2f69a0dc21f86a058f0b4e428969f2f8194cdd5
js/BarCode.jsx
js/BarCode.jsx
var React = require('react'), ioBarcode = require("io-barcode"); module.exports = React.createClass({ propTypes: { code: React.PropTypes.string.isRequired }, componentDidMount() { var placeholder = React.findDOMNode(this.refs.placeholder); try { var canvas = ioBarcode.CODE128B( this.props.code, { displayValue: true, height: 50, fontSize: 18 } ); placeholder.appendChild(canvas); } catch (e) { console.error(e); placeholder.innerText = "您輸入的字無法編成條碼"; } }, render() { return ( <div ref="placeholder" /> ) } });
var React = require('react'), ioBarcode = require("io-barcode"); module.exports = React.createClass({ propTypes: { code: React.PropTypes.string.isRequired }, componentDidMount() { var img = React.findDOMNode(this.refs.img); try { var canvas = ioBarcode.CODE128B( this.props.code, { displayValue: true, height: 50, fontSize: 18 } ); img.src = canvas.toDataURL(); } catch (e) { console.error(e); img.alt = "您輸入的字無法編成條碼"; } }, render() { // Canvases are not printable, but images are. // return ( <img ref="img" /> ) } });
Use img instead of canvas to make barcodes printable
Use img instead of canvas to make barcodes printable
JSX
mit
MrOrz/cdc-barcode,MrOrz/cdc-barcode
jsx
## Code Before: var React = require('react'), ioBarcode = require("io-barcode"); module.exports = React.createClass({ propTypes: { code: React.PropTypes.string.isRequired }, componentDidMount() { var placeholder = React.findDOMNode(this.refs.placeholder); try { var canvas = ioBarcode.CODE128B( this.props.code, { displayValue: true, height: 50, fontSize: 18 } ); placeholder.appendChild(canvas); } catch (e) { console.error(e); placeholder.innerText = "您輸入的字無法編成條碼"; } }, render() { return ( <div ref="placeholder" /> ) } }); ## Instruction: Use img instead of canvas to make barcodes printable ## Code After: var React = require('react'), ioBarcode = require("io-barcode"); module.exports = React.createClass({ propTypes: { code: React.PropTypes.string.isRequired }, componentDidMount() { var img = React.findDOMNode(this.refs.img); try { var canvas = ioBarcode.CODE128B( this.props.code, { displayValue: true, height: 50, fontSize: 18 } ); img.src = canvas.toDataURL(); } catch (e) { console.error(e); img.alt = "您輸入的字無法編成條碼"; } }, render() { // Canvases are not printable, but images are. // return ( <img ref="img" /> ) } });
var React = require('react'), ioBarcode = require("io-barcode"); module.exports = React.createClass({ propTypes: { code: React.PropTypes.string.isRequired }, componentDidMount() { - var placeholder = React.findDOMNode(this.refs.placeholder); + var img = React.findDOMNode(this.refs.img); try { var canvas = ioBarcode.CODE128B( this.props.code, { displayValue: true, height: 50, fontSize: 18 } ); - placeholder.appendChild(canvas); + img.src = canvas.toDataURL(); } catch (e) { console.error(e); - placeholder.innerText = "您輸入的字無法編成條碼"; + img.alt = "您輸入的字無法編成條碼"; } }, render() { + // Canvases are not printable, but images are. + // return ( - <div ref="placeholder" /> + <img ref="img" /> ) } });
10
0.322581
6
4
cda5fcb56ecdfe5a2f49d0efbf76e853c8c50e6c
migration_scripts/0.3/crypto_util.py
migration_scripts/0.3/crypto_util.py
import random as badrandom nouns = file("nouns.txt").read().split('\n') adjectives = file("adjectives.txt").read().split('\n') def displayid(n): badrandom_value = badrandom.WichmannHill() badrandom_value.seed(n) return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)
import os import random as badrandom # Find the absolute path relative to this file so this script can be run anywhere SRC_DIR = os.path.dirname(os.path.realpath(__file__)) nouns = file(os.path.join(SRC_DIR, "nouns.txt")).read().split('\n') adjectives = file(os.path.join(SRC_DIR, "adjectives.txt")).read().split('\n') def displayid(n): badrandom_value = badrandom.WichmannHill() badrandom_value.seed(n) return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)
Load files from absolute paths so this can be run from anywhere
Load files from absolute paths so this can be run from anywhere
Python
agpl-3.0
mark-in/securedrop-prov-upstream,mark-in/securedrop-prov-upstream,mark-in/securedrop-prov-upstream,mark-in/securedrop-prov-upstream
python
## Code Before: import random as badrandom nouns = file("nouns.txt").read().split('\n') adjectives = file("adjectives.txt").read().split('\n') def displayid(n): badrandom_value = badrandom.WichmannHill() badrandom_value.seed(n) return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns) ## Instruction: Load files from absolute paths so this can be run from anywhere ## Code After: import os import random as badrandom # Find the absolute path relative to this file so this script can be run anywhere SRC_DIR = os.path.dirname(os.path.realpath(__file__)) nouns = file(os.path.join(SRC_DIR, "nouns.txt")).read().split('\n') adjectives = file(os.path.join(SRC_DIR, "adjectives.txt")).read().split('\n') def displayid(n): badrandom_value = badrandom.WichmannHill() badrandom_value.seed(n) return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)
+ import os import random as badrandom + # Find the absolute path relative to this file so this script can be run anywhere + SRC_DIR = os.path.dirname(os.path.realpath(__file__)) + - nouns = file("nouns.txt").read().split('\n') + nouns = file(os.path.join(SRC_DIR, "nouns.txt")).read().split('\n') ? ++++++++++++++++++++++ + - adjectives = file("adjectives.txt").read().split('\n') + adjectives = file(os.path.join(SRC_DIR, "adjectives.txt")).read().split('\n') ? ++++++++++++++++++++++ + def displayid(n): badrandom_value = badrandom.WichmannHill() badrandom_value.seed(n) return badrandom_value.choice(adjectives) + " " + badrandom_value.choice(nouns)
8
0.8
6
2
56e1a8ebaa5cff84c9a188b0d03cea0074d02bab
spec/feedbackSpec.js
spec/feedbackSpec.js
(function() { 'use strict'; describe('angular-feedback', function() { beforeEach(module('angular-feedback')); /* var feedbackProvider; beforeEach(function() { // Here we create a fake module just to intercept and store the provider // when it's injected, i.e. during the config phase. angular .module('fakeModule', function() {}) .config(['feedbackProvider', function(provider) { feedbackProvider = provider; }]); module('angular-feedback', 'fakeModule'); // This actually triggers the injection into fakeModule inject(function(){}); }); */ it('should be inactive by default', inject(function(feedback) { expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); }); })();
(function() { 'use strict'; describe('angular-feedback', function() { beforeEach(module('angular-feedback')); /* var feedbackProvider; beforeEach(function() { // Here we create a fake module just to intercept and store the provider // when it's injected, i.e. during the config phase. angular .module('fakeModule', function() {}) .config(['feedbackProvider', function(provider) { feedbackProvider = provider; }]); module('angular-feedback', 'fakeModule'); // This actually triggers the injection into fakeModule inject(function(){}); }); */ it('should be inactive by default', inject(function(feedback) { expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); it('should set loader', inject(function(feedback) { feedback.load(); expect( feedback.isActive() ).toBeTruthy(); expect( feedback.isLoading() ).toBeTruthy(); })); it('should dismiss loader', inject(function(feedback, $timeout) { feedback.load(); feedback.dismiss(); $timeout.flush(); expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); it('should set default notification to "info"', inject(function(feedback) { var message = 'Notification message'; feedback.notify( message ); expect( feedback.isActive() ).toBeTruthy(); expect( feedback.isLoading() ).toBeFalsy(); // expect( feedback.getType() ).toBe('info'); expect( feedback.getMessage() ).toBe( message); })); }); })();
Add tests: load(), dismiss(), notify()
Add tests: load(), dismiss(), notify()
JavaScript
mit
andreipfeiffer/angular-feedback
javascript
## Code Before: (function() { 'use strict'; describe('angular-feedback', function() { beforeEach(module('angular-feedback')); /* var feedbackProvider; beforeEach(function() { // Here we create a fake module just to intercept and store the provider // when it's injected, i.e. during the config phase. angular .module('fakeModule', function() {}) .config(['feedbackProvider', function(provider) { feedbackProvider = provider; }]); module('angular-feedback', 'fakeModule'); // This actually triggers the injection into fakeModule inject(function(){}); }); */ it('should be inactive by default', inject(function(feedback) { expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); }); })(); ## Instruction: Add tests: load(), dismiss(), notify() ## Code After: (function() { 'use strict'; describe('angular-feedback', function() { beforeEach(module('angular-feedback')); /* var feedbackProvider; beforeEach(function() { // Here we create a fake module just to intercept and store the provider // when it's injected, i.e. during the config phase. angular .module('fakeModule', function() {}) .config(['feedbackProvider', function(provider) { feedbackProvider = provider; }]); module('angular-feedback', 'fakeModule'); // This actually triggers the injection into fakeModule inject(function(){}); }); */ it('should be inactive by default', inject(function(feedback) { expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); it('should set loader', inject(function(feedback) { feedback.load(); expect( feedback.isActive() ).toBeTruthy(); expect( feedback.isLoading() ).toBeTruthy(); })); it('should dismiss loader', inject(function(feedback, $timeout) { feedback.load(); feedback.dismiss(); $timeout.flush(); expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); it('should set default notification to "info"', inject(function(feedback) { var message = 'Notification message'; feedback.notify( message ); expect( feedback.isActive() ).toBeTruthy(); expect( feedback.isLoading() ).toBeFalsy(); // expect( feedback.getType() ).toBe('info'); expect( feedback.getMessage() ).toBe( message); })); }); })();
(function() { 'use strict'; describe('angular-feedback', function() { beforeEach(module('angular-feedback')); /* var feedbackProvider; beforeEach(function() { // Here we create a fake module just to intercept and store the provider // when it's injected, i.e. during the config phase. angular .module('fakeModule', function() {}) .config(['feedbackProvider', function(provider) { feedbackProvider = provider; }]); module('angular-feedback', 'fakeModule'); // This actually triggers the injection into fakeModule inject(function(){}); }); */ it('should be inactive by default', inject(function(feedback) { expect( feedback.isActive() ).toBeFalsy(); expect( feedback.isLoading() ).toBeFalsy(); })); + it('should set loader', inject(function(feedback) { + feedback.load(); + expect( feedback.isActive() ).toBeTruthy(); + expect( feedback.isLoading() ).toBeTruthy(); + })); + + it('should dismiss loader', inject(function(feedback, $timeout) { + feedback.load(); + feedback.dismiss(); + + $timeout.flush(); + + expect( feedback.isActive() ).toBeFalsy(); + expect( feedback.isLoading() ).toBeFalsy(); + })); + + it('should set default notification to "info"', inject(function(feedback) { + var message = 'Notification message'; + feedback.notify( message ); + + expect( feedback.isActive() ).toBeTruthy(); + expect( feedback.isLoading() ).toBeFalsy(); + // expect( feedback.getType() ).toBe('info'); + expect( feedback.getMessage() ).toBe( message); + })); + }); })();
26
0.742857
26
0
0a0eb0858731dc388610a43c7f2d1900dc5f8ea3
lib/launchy/application.rb
lib/launchy/application.rb
require 'set' module Launchy # # Application is the base class of all the application types that launchy may # invoke. It essentially defines the public api of the launchy system. # # Every class that inherits from Application must define: # # 1. A constructor taking no parameters # 2. An instance method 'open' taking a string or URI as the first parameter and a # hash as the second # 3. A class method 'schemes' that returns an array of Strings containing the # schemes that the Application will handle class Application extend DescendantTracker class << self # # The list of all the schems all the applications now # def scheme_list children.collect { |a| a.schemes }.flatten.sort end # # if this application handles the given scheme # def handles?( scheme ) schemes.include?( scheme ) end # # Find the application that handles the given scheme. May take either a # String or something that responds_to?( :scheme ) # def for_scheme( scheme ) if scheme.respond_to?( :scheme ) then scheme = scheme.scheme end klass = children.find { |klass| klass.handles?( scheme ) } return klass if klass raise SchemeNotFoundError, "No application found to handle scheme '#{scheme}'. Known schemes: #{scheme_list.join(", ")}" end end end end
require 'set' module Launchy # # Application is the base class of all the application types that launchy may # invoke. It essentially defines the public api of the launchy system. # # Every class that inherits from Application must define: # # 1. A constructor taking no parameters # 2. An instance method 'open' taking a string or URI as the first parameter and a # hash as the second # 3. A class method 'schemes' that returns an array of Strings containing the # schemes that the Application will handle class Application extend DescendantTracker class << self # # The list of all the schems all the applications now # def scheme_list children.collect { |a| a.schemes }.flatten.sort end # # if this application handles the given scheme # def handles?( scheme ) schemes.include?( scheme ) end # # Find the application that handles the given scheme. May take either a # String or something that responds_to?( :scheme ) # def for_scheme( scheme ) if scheme.respond_to?( :scheme ) then scheme = scheme.scheme end klass = children.find do |klass| Launchy.log( "Seeing if #{klass.name} handles scheme #{scheme}" klass.handles?( scheme ) end if klass then Launchy.log( "#{klass.name} handles #{scheme}" ) return klass end raise SchemeNotFoundError, "No application found to handle scheme '#{scheme}'. Known schemes: #{scheme_list.join(", ")}" end end end end
Add in some debugging for finding the right handler class
Add in some debugging for finding the right handler class
Ruby
isc
wstephenson/launchy,mecampbellsoup/launchy,kapil-utexas/launchy,copiousfreetime/launchy
ruby
## Code Before: require 'set' module Launchy # # Application is the base class of all the application types that launchy may # invoke. It essentially defines the public api of the launchy system. # # Every class that inherits from Application must define: # # 1. A constructor taking no parameters # 2. An instance method 'open' taking a string or URI as the first parameter and a # hash as the second # 3. A class method 'schemes' that returns an array of Strings containing the # schemes that the Application will handle class Application extend DescendantTracker class << self # # The list of all the schems all the applications now # def scheme_list children.collect { |a| a.schemes }.flatten.sort end # # if this application handles the given scheme # def handles?( scheme ) schemes.include?( scheme ) end # # Find the application that handles the given scheme. May take either a # String or something that responds_to?( :scheme ) # def for_scheme( scheme ) if scheme.respond_to?( :scheme ) then scheme = scheme.scheme end klass = children.find { |klass| klass.handles?( scheme ) } return klass if klass raise SchemeNotFoundError, "No application found to handle scheme '#{scheme}'. Known schemes: #{scheme_list.join(", ")}" end end end end ## Instruction: Add in some debugging for finding the right handler class ## Code After: require 'set' module Launchy # # Application is the base class of all the application types that launchy may # invoke. It essentially defines the public api of the launchy system. # # Every class that inherits from Application must define: # # 1. A constructor taking no parameters # 2. An instance method 'open' taking a string or URI as the first parameter and a # hash as the second # 3. A class method 'schemes' that returns an array of Strings containing the # schemes that the Application will handle class Application extend DescendantTracker class << self # # The list of all the schems all the applications now # def scheme_list children.collect { |a| a.schemes }.flatten.sort end # # if this application handles the given scheme # def handles?( scheme ) schemes.include?( scheme ) end # # Find the application that handles the given scheme. May take either a # String or something that responds_to?( :scheme ) # def for_scheme( scheme ) if scheme.respond_to?( :scheme ) then scheme = scheme.scheme end klass = children.find do |klass| Launchy.log( "Seeing if #{klass.name} handles scheme #{scheme}" klass.handles?( scheme ) end if klass then Launchy.log( "#{klass.name} handles #{scheme}" ) return klass end raise SchemeNotFoundError, "No application found to handle scheme '#{scheme}'. Known schemes: #{scheme_list.join(", ")}" end end end end
require 'set' module Launchy # # Application is the base class of all the application types that launchy may # invoke. It essentially defines the public api of the launchy system. # # Every class that inherits from Application must define: # # 1. A constructor taking no parameters # 2. An instance method 'open' taking a string or URI as the first parameter and a # hash as the second # 3. A class method 'schemes' that returns an array of Strings containing the # schemes that the Application will handle class Application extend DescendantTracker class << self # # The list of all the schems all the applications now # def scheme_list children.collect { |a| a.schemes }.flatten.sort end # # if this application handles the given scheme # def handles?( scheme ) schemes.include?( scheme ) end # # Find the application that handles the given scheme. May take either a # String or something that responds_to?( :scheme ) # def for_scheme( scheme ) if scheme.respond_to?( :scheme ) then scheme = scheme.scheme end - klass = children.find { |klass| klass.handles?( scheme ) } + klass = children.find do |klass| + Launchy.log( "Seeing if #{klass.name} handles scheme #{scheme}" + klass.handles?( scheme ) + end + if klass then + Launchy.log( "#{klass.name} handles #{scheme}" ) - return klass if klass ? --------- + return klass ? ++ + end + raise SchemeNotFoundError, "No application found to handle scheme '#{scheme}'. Known schemes: #{scheme_list.join(", ")}" end end end end
11
0.22449
9
2
a51332a7b58530d2e72ebb1ca0bb1e152cf325ee
tox.ini
tox.ini
[tox] envlist = py37, py38, py39, py310 [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 3.10: py310 [testenv] usedevelop = True commands = py.test --tb=native deps = pytest
[tox] envlist = py37, py38, py39, py310 [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 3.10: py310 [testenv] usedevelop = True commands = py.test --tb=native {posargs:parsimonious} deps = pytest
Add ability to run particular tests.
Add ability to run particular tests.
INI
mit
erikrose/parsimonious,lucaswiman/parsimonious
ini
## Code Before: [tox] envlist = py37, py38, py39, py310 [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 3.10: py310 [testenv] usedevelop = True commands = py.test --tb=native deps = pytest ## Instruction: Add ability to run particular tests. ## Code After: [tox] envlist = py37, py38, py39, py310 [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 3.10: py310 [testenv] usedevelop = True commands = py.test --tb=native {posargs:parsimonious} deps = pytest
[tox] envlist = py37, py38, py39, py310 [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 3.10: py310 [testenv] usedevelop = True - commands = py.test --tb=native + commands = py.test --tb=native {posargs:parsimonious} deps = pytest
2
0.133333
1
1
ea7402f0aaa0a1326d32c4e350d5cd361281a31f
src/main/kotlin/org/logout/notifications/telegram/bot/processor/staticProcessors.kt
src/main/kotlin/org/logout/notifications/telegram/bot/processor/staticProcessors.kt
package org.logout.notifications.telegram.bot.processor class HelpProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("/staima, /whatsup and a couple of secret aliases — the closest next event in near future\n" + "/staima today — as much of today's schedule which will fit in 1000 characters. " + "This is going to be changed soon to send the whole day's schedule.\n" + "/staima -v — if you want to see abstracts for the upcoming events" + "Anything else is just gets repeated back at you. Maybe. Or bot could suddenly acquire sentience and look back at you.") } class StartProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Welcome to Infobip DevDays 2017. Send /staima to find out what are the " + "nearest events or /help for more information.") } class DissentProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Sad to hear you are not happy. Grab a coffee?") }
package org.logout.notifications.telegram.bot.processor class HelpProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("/staima, /whatsup and a couple of secret aliases — the closest next event in near future\n" + "/staima today — as much of today's schedule which will fit in 1000 characters. " + "This is going to be changed soon to send the whole day's schedule.\n" + "/staima -v — if you want to see abstracts for the upcoming events.\n" + "/staima now — if you want to see what's going on right now.\n" + "Anything else is just gets repeated back at you. Maybe. Or bot could suddenly acquire sentience and look back at you.") } class StartProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Welcome to Infobip DevDays 2017. Send /staima to find out what are the " + "nearest events or /help for more information.") } class DissentProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Sad to hear you are not happy. Grab a coffee?") }
Update help and announce new feature
Update help and announce new feature
Kotlin
apache-2.0
Sulion/marco-paolo
kotlin
## Code Before: package org.logout.notifications.telegram.bot.processor class HelpProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("/staima, /whatsup and a couple of secret aliases — the closest next event in near future\n" + "/staima today — as much of today's schedule which will fit in 1000 characters. " + "This is going to be changed soon to send the whole day's schedule.\n" + "/staima -v — if you want to see abstracts for the upcoming events" + "Anything else is just gets repeated back at you. Maybe. Or bot could suddenly acquire sentience and look back at you.") } class StartProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Welcome to Infobip DevDays 2017. Send /staima to find out what are the " + "nearest events or /help for more information.") } class DissentProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Sad to hear you are not happy. Grab a coffee?") } ## Instruction: Update help and announce new feature ## Code After: package org.logout.notifications.telegram.bot.processor class HelpProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("/staima, /whatsup and a couple of secret aliases — the closest next event in near future\n" + "/staima today — as much of today's schedule which will fit in 1000 characters. " + "This is going to be changed soon to send the whole day's schedule.\n" + "/staima -v — if you want to see abstracts for the upcoming events.\n" + "/staima now — if you want to see what's going on right now.\n" + "Anything else is just gets repeated back at you. Maybe. Or bot could suddenly acquire sentience and look back at you.") } class StartProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Welcome to Infobip DevDays 2017. Send /staima to find out what are the " + "nearest events or /help for more information.") } class DissentProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Sad to hear you are not happy. Grab a coffee?") }
package org.logout.notifications.telegram.bot.processor class HelpProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("/staima, /whatsup and a couple of secret aliases — the closest next event in near future\n" + "/staima today — as much of today's schedule which will fit in 1000 characters. " + "This is going to be changed soon to send the whole day's schedule.\n" + - "/staima -v — if you want to see abstracts for the upcoming events" + + "/staima -v — if you want to see abstracts for the upcoming events.\n" + ? +++ + "/staima now — if you want to see what's going on right now.\n" + "Anything else is just gets repeated back at you. Maybe. Or bot could suddenly acquire sentience and look back at you.") } class StartProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Welcome to Infobip DevDays 2017. Send /staima to find out what are the " + "nearest events or /help for more information.") } class DissentProcessor : Processor { override fun onMessage(arguments: Array<String>?) = listOf("Sad to hear you are not happy. Grab a coffee?") }
3
0.136364
2
1
6fd2a687067ecbbbce4a708b23cfeec4f168aa2b
package.json
package.json
{ "name": "webmaker.org", "version": "0.0.69", "private": true, "scripts": { "test": "grunt" }, "repository": { "type": "git", "url": "git://github.com/mozilla/webmaker.org.git" }, "license": "MPL-2.0", "dependencies": { "express": "3.2.0", "express-persona": "0.0.7", "habitat": "0.4.1", "helmet": "0.0.9", "less-middleware": "0.1.12", "nunjucks": "0.1.9", "makeapi": "0.1.24", "moment": "~2.0.0", "webmaker-loginapi": "0.1.6", "newrelic": "0.9.22", "webmaker-events": "git://github.com/mozilla/webmaker-events.git" }, "devDependencies": { "grunt": "0.4.1", "grunt-recess": "0.3.3", "grunt-contrib-jshint": "0.4.3" } }
{ "name": "webmaker.org", "version": "0.0.69", "private": true, "scripts": { "test": "grunt" }, "repository": { "type": "git", "url": "git://github.com/mozilla/webmaker.org.git" }, "license": "MPL-2.0", "dependencies": { "express": "3.2.0", "express-persona": "0.0.7", "habitat": "0.4.1", "helmet": "0.0.9", "less-middleware": "0.1.12", "nunjucks": "0.1.9", "makeapi": "0.1.24", "moment": "~2.0.0", "webmaker-loginapi": "0.1.6", "newrelic": "0.9.22", "webmaker-events": "https://github.com/mozilla/webmaker-events/tarball/v0.1.0" }, "devDependencies": { "grunt": "0.4.1", "grunt-recess": "0.3.3", "grunt-contrib-jshint": "0.4.3" } }
Use a tagged version of webmaker-events
Use a tagged version of webmaker-events
JSON
mpl-2.0
cadecairos/webmaker.org,jbuck/webmaker.org,mmmavis/webmaker.org,mmmavis/webmaker.org,mozilla/webmaker.org,cadecairos/webmaker.org,alicoding/webmaker.org,alicoding/webmaker.org,mozilla/webmaker.org
json
## Code Before: { "name": "webmaker.org", "version": "0.0.69", "private": true, "scripts": { "test": "grunt" }, "repository": { "type": "git", "url": "git://github.com/mozilla/webmaker.org.git" }, "license": "MPL-2.0", "dependencies": { "express": "3.2.0", "express-persona": "0.0.7", "habitat": "0.4.1", "helmet": "0.0.9", "less-middleware": "0.1.12", "nunjucks": "0.1.9", "makeapi": "0.1.24", "moment": "~2.0.0", "webmaker-loginapi": "0.1.6", "newrelic": "0.9.22", "webmaker-events": "git://github.com/mozilla/webmaker-events.git" }, "devDependencies": { "grunt": "0.4.1", "grunt-recess": "0.3.3", "grunt-contrib-jshint": "0.4.3" } } ## Instruction: Use a tagged version of webmaker-events ## Code After: { "name": "webmaker.org", "version": "0.0.69", "private": true, "scripts": { "test": "grunt" }, "repository": { "type": "git", "url": "git://github.com/mozilla/webmaker.org.git" }, "license": "MPL-2.0", "dependencies": { "express": "3.2.0", "express-persona": "0.0.7", "habitat": "0.4.1", "helmet": "0.0.9", "less-middleware": "0.1.12", "nunjucks": "0.1.9", "makeapi": "0.1.24", "moment": "~2.0.0", "webmaker-loginapi": "0.1.6", "newrelic": "0.9.22", "webmaker-events": "https://github.com/mozilla/webmaker-events/tarball/v0.1.0" }, "devDependencies": { "grunt": "0.4.1", "grunt-recess": "0.3.3", "grunt-contrib-jshint": "0.4.3" } }
{ "name": "webmaker.org", "version": "0.0.69", "private": true, "scripts": { "test": "grunt" }, "repository": { "type": "git", "url": "git://github.com/mozilla/webmaker.org.git" }, "license": "MPL-2.0", "dependencies": { "express": "3.2.0", "express-persona": "0.0.7", "habitat": "0.4.1", "helmet": "0.0.9", "less-middleware": "0.1.12", "nunjucks": "0.1.9", "makeapi": "0.1.24", "moment": "~2.0.0", "webmaker-loginapi": "0.1.6", "newrelic": "0.9.22", - "webmaker-events": "git://github.com/mozilla/webmaker-events.git" ? ^^ ^^^ + "webmaker-events": "https://github.com/mozilla/webmaker-events/tarball/v0.1.0" ? ^ +++ +++++++++++ ^^^ }, "devDependencies": { "grunt": "0.4.1", "grunt-recess": "0.3.3", "grunt-contrib-jshint": "0.4.3" } }
2
0.064516
1
1
bb2ed07eaec8c785acd525f4c67363d1ef6a4303
src/scripts/modules/media/tabs/toc-partial.html
src/scripts/modules/media/tabs/toc-partial.html
<ul> {{#each this}} <li> <div> {{#is id 'subcol'}} <span class="expand">&#9656;</span> {{/is}} <a href="/content/{{../id}}/{{@index}}"> {{#if @index}} <span class="unit">{{@index}}.</span> {{/if}} <span class="title">{{title}}</span> </a> {{#is id 'subcol'}} {{> modules_media_tabs_toc-partial contents}} {{! Add Recursively }} {{/is}} </div> </li> {{/each}} </ul>
<ul> {{#each this}} <li> <div> {{#is id 'subcol'}} <span class="expand">&#9656;</span> {{/is}} {{#or depth @index}} {{#is depth 2}} <span>-</span> {{else}} {{#if depth}} <span class="unit">{{parent}}-{{add @index 1}}.</span> {{else}} <span class="unit">{{@index}}.</span> {{/if}} {{/is}} {{/or}} <a href="/content/{{../id}}/{{@index}}"> <span class="title">{{title}}</span> </a> </div> {{#is id 'subcol'}} {{#lt depth 3}} {{recursive "modules_media_tabs_toc-partial" contents}} {{/lt}} {{/is}} </li> {{/each}} </ul>
Load toc recursively to a max depth of 3
Load toc recursively to a max depth of 3
HTML
agpl-3.0
Connexions/webview,dak/webview,katalysteducation/webview,carolinelane10/webview,Connexions/webview,katalysteducation/webview,katalysteducation/webview,Connexions/webview,katalysteducation/webview,dak/webview,dak/webview,Connexions/webview
html
## Code Before: <ul> {{#each this}} <li> <div> {{#is id 'subcol'}} <span class="expand">&#9656;</span> {{/is}} <a href="/content/{{../id}}/{{@index}}"> {{#if @index}} <span class="unit">{{@index}}.</span> {{/if}} <span class="title">{{title}}</span> </a> {{#is id 'subcol'}} {{> modules_media_tabs_toc-partial contents}} {{! Add Recursively }} {{/is}} </div> </li> {{/each}} </ul> ## Instruction: Load toc recursively to a max depth of 3 ## Code After: <ul> {{#each this}} <li> <div> {{#is id 'subcol'}} <span class="expand">&#9656;</span> {{/is}} {{#or depth @index}} {{#is depth 2}} <span>-</span> {{else}} {{#if depth}} <span class="unit">{{parent}}-{{add @index 1}}.</span> {{else}} <span class="unit">{{@index}}.</span> {{/if}} {{/is}} {{/or}} <a href="/content/{{../id}}/{{@index}}"> <span class="title">{{title}}</span> </a> </div> {{#is id 'subcol'}} {{#lt depth 3}} {{recursive "modules_media_tabs_toc-partial" contents}} {{/lt}} {{/is}} </li> {{/each}} </ul>
<ul> {{#each this}} <li> <div> {{#is id 'subcol'}} <span class="expand">&#9656;</span> {{/is}} + {{#or depth @index}} + {{#is depth 2}} + <span>-</span> + {{else}} + {{#if depth}} + <span class="unit">{{parent}}-{{add @index 1}}.</span> + {{else}} + <span class="unit">{{@index}}.</span> + {{/if}} + {{/is}} + {{/or}} <a href="/content/{{../id}}/{{@index}}"> - {{#if @index}} - <span class="unit">{{@index}}.</span> - {{/if}} <span class="title">{{title}}</span> </a> - {{#is id 'subcol'}} - {{> modules_media_tabs_toc-partial contents}} {{! Add Recursively }} - {{/is}} </div> + {{#is id 'subcol'}} + {{#lt depth 3}} + {{recursive "modules_media_tabs_toc-partial" contents}} + {{/lt}} + {{/is}} </li> {{/each}} </ul>
22
1.1
16
6
066441324cf8ef51dfb84be68af41dc652e5f48f
PHP/lorify-php/README.md
PHP/lorify-php/README.md
====== Lorify is a utility to generate inline filler text according to parameters provided by the page designer. It is available in Javascript and PHP, with slight differences in handling of style parameters. If the script is included in the header, the lorify function can be called inline with two integers - the first for the number of sentences, the second for number of words per sentence. To simulate titles, if only one sentence is specified, the string is returned in all caps with no final period.
====== Lorify is a utility to generate inline filler text according to parameters provided by the page designer. It is available in Javascript and PHP, with slight differences in handling of style parameters. If the script is included in the header, the lorify function can be called inline with two integers - the first for the number of sentences, the second for number of words per sentence. To simulate titles, if only one sentence is specified, the string is returned in all caps with no final period. See [demo at harperdev.com](http://harperdev.com/code/lorify) Return to [Codelab](https://github.com/michaeltharper/codelab)
Add links to harperdev, codelab home
Add links to harperdev, codelab home
Markdown
apache-2.0
michaeltharper/codelab,michaeltharper/codelab,michaeltharper/codelab
markdown
## Code Before: ====== Lorify is a utility to generate inline filler text according to parameters provided by the page designer. It is available in Javascript and PHP, with slight differences in handling of style parameters. If the script is included in the header, the lorify function can be called inline with two integers - the first for the number of sentences, the second for number of words per sentence. To simulate titles, if only one sentence is specified, the string is returned in all caps with no final period. ## Instruction: Add links to harperdev, codelab home ## Code After: ====== Lorify is a utility to generate inline filler text according to parameters provided by the page designer. It is available in Javascript and PHP, with slight differences in handling of style parameters. If the script is included in the header, the lorify function can be called inline with two integers - the first for the number of sentences, the second for number of words per sentence. To simulate titles, if only one sentence is specified, the string is returned in all caps with no final period. See [demo at harperdev.com](http://harperdev.com/code/lorify) Return to [Codelab](https://github.com/michaeltharper/codelab)
====== Lorify is a utility to generate inline filler text according to parameters provided by the page designer. It is available in Javascript and PHP, with slight differences in handling of style parameters. If the script is included in the header, the lorify function can be called inline with two integers - the first for the number of sentences, the second for number of words per sentence. To simulate titles, if only one sentence is specified, the string is returned in all caps with no final period. + + See [demo at harperdev.com](http://harperdev.com/code/lorify) + + Return to [Codelab](https://github.com/michaeltharper/codelab)
4
1.333333
4
0
6a4dd66035956037d660271f18592af04edab818
read_images.py
read_images.py
import time import cv2 import os import glob # path = 'by_class' path = 'test' t1 = time.time() file_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]')) t2 = time.time() print('Time to list files: ', t2-t1) file_classes=[ele.split('/')[1] for ele in file_names] t3 = time.time() print('Time to list labels: ', t3-t2) # for i in range(len(file_names)): # print(file_names[i], file_classes[i]) images = [cv2.imread(file) for file in file_names] t4 = time.time() print('Time to read images: ',t4-t3)
import time import os import glob import tensorflow as tf # path = 'by_class' path = 'test' t1 = time.time() file_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]')) filename_queue = tf.train.string_input_producer(file_names) t2 = time.time() print('Time to list files: ', t2-t1) file_classes=[int(ele.split('/')[1], base=16) for ele in file_names] try: file_labels = [str(chr(i)) for i in file_classes] #python 3 except: file_labels = [str(unichr(i)) for i in file_classes] #python 2.7 t3 = time.time() print('Time to list labels: ', t3-t2) reader = tf.WholeFileReader() key, value = reader.read(filename_queue) my_img = tf.image.decode_png(value) # use png or jpg decoder based on your files. init_op = tf.initialize_all_variables() sess = tf.Session() sess.run(init_op) # Start populating the filename queue. coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord, sess=sess) for i in range(len(file_classes)): #length of your filename list image = my_img.eval(session = sess) #here is your image Tensor :) coord.request_stop() coord.join(threads) t4 = time.time() print('Time to read images: ',t4-t3)
Read all images using tf itself
Read all images using tf itself
Python
apache-2.0
iitmcvg/OCR-Handwritten-Text,iitmcvg/OCR-Handwritten-Text,iitmcvg/OCR-Handwritten-Text
python
## Code Before: import time import cv2 import os import glob # path = 'by_class' path = 'test' t1 = time.time() file_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]')) t2 = time.time() print('Time to list files: ', t2-t1) file_classes=[ele.split('/')[1] for ele in file_names] t3 = time.time() print('Time to list labels: ', t3-t2) # for i in range(len(file_names)): # print(file_names[i], file_classes[i]) images = [cv2.imread(file) for file in file_names] t4 = time.time() print('Time to read images: ',t4-t3) ## Instruction: Read all images using tf itself ## Code After: import time import os import glob import tensorflow as tf # path = 'by_class' path = 'test' t1 = time.time() file_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]')) filename_queue = tf.train.string_input_producer(file_names) t2 = time.time() print('Time to list files: ', t2-t1) file_classes=[int(ele.split('/')[1], base=16) for ele in file_names] try: file_labels = [str(chr(i)) for i in file_classes] #python 3 except: file_labels = [str(unichr(i)) for i in file_classes] #python 2.7 t3 = time.time() print('Time to list labels: ', t3-t2) reader = tf.WholeFileReader() key, value = reader.read(filename_queue) my_img = tf.image.decode_png(value) # use png or jpg decoder based on your files. init_op = tf.initialize_all_variables() sess = tf.Session() sess.run(init_op) # Start populating the filename queue. coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord, sess=sess) for i in range(len(file_classes)): #length of your filename list image = my_img.eval(session = sess) #here is your image Tensor :) coord.request_stop() coord.join(threads) t4 = time.time() print('Time to read images: ',t4-t3)
import time - import cv2 import os import glob + import tensorflow as tf # path = 'by_class' path = 'test' t1 = time.time() file_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]')) + filename_queue = tf.train.string_input_producer(file_names) t2 = time.time() print('Time to list files: ', t2-t1) - file_classes=[ele.split('/')[1] for ele in file_names] + file_classes=[int(ele.split('/')[1], base=16) for ele in file_names] ? ++++ ++++++++++ + try: + file_labels = [str(chr(i)) for i in file_classes] #python 3 + except: + file_labels = [str(unichr(i)) for i in file_classes] #python 2.7 + + t3 = time.time() print('Time to list labels: ', t3-t2) + reader = tf.WholeFileReader() + key, value = reader.read(filename_queue) + my_img = tf.image.decode_png(value) # use png or jpg decoder based on your files. + init_op = tf.initialize_all_variables() - # for i in range(len(file_names)): - # print(file_names[i], file_classes[i]) - images = [cv2.imread(file) for file in file_names] + sess = tf.Session() + sess.run(init_op) + + # Start populating the filename queue. + + coord = tf.train.Coordinator() + threads = tf.train.start_queue_runners(coord=coord, sess=sess) + + for i in range(len(file_classes)): #length of your filename list + image = my_img.eval(session = sess) #here is your image Tensor :) + + coord.request_stop() + coord.join(threads) t4 = time.time() print('Time to read images: ',t4-t3) -
32
1.28
26
6
a4a635352cd94f0931ae808f872f87fe4b9d2747
app/controllers/status_controller.rb
app/controllers/status_controller.rb
class StatusController < ApplicationController protect_from_forgery :except => [:status_update] before_action :check_if_smokedetector, :only => [:status_update] def index @statuses = SmokeDetector.order('last_ping DESC').all end def status_update @smoke_detector.last_ping = DateTime.now @smoke_detector.location = params[:location] @smoke_detector.is_standby = params[:standby] || false @smoke_detector.save! respond_to do |format| format.json do if @smoke_detector.should_failover @smoke_detector.update(:is_standby => false, :force_failover => false) render :status => 200, :json => { 'failover': true } else render :status => 200, :json => { 'failover': false } end end end end end
class StatusController < ApplicationController protect_from_forgery :except => [:status_update] before_action :check_if_smokedetector, :only => [:status_update] def index @statuses = SmokeDetector.order('last_ping DESC').all end def status_update @smoke_detector.last_ping = DateTime.now @smoke_detector.location = params[:location] @smoke_detector.is_standby = params[:standby] || false # If an instance is manually switched to standby, we # don't want it to immediately kick back new_standby_switch = @smoke_detector.is_standby_changed? and @smoke_detector.is_standby @smoke_detector.save! respond_to do |format| format.json do if @smoke_detector.should_failover and not new_standby_switch @smoke_detector.update(:is_standby => false, :force_failover => false) render :status => 200, :json => { 'failover': true } else head 200, content_type: "text/html" end end end end end
Revert "Revert "Save a few bytes on every ping""
Revert "Revert "Save a few bytes on every ping"" This reverts commit 5ef95920039bb38ae7a6bcb1bf228955ba898085.
Ruby
cc0-1.0
Charcoal-SE/metasmoke,SulphurDioxide/metasmoke,angussidney/metasmoke,j-f1/forked-metasmoke,Charcoal-SE/metasmoke,angussidney/metasmoke,j-f1/forked-metasmoke,j-f1/forked-metasmoke,SulphurDioxide/metasmoke,Charcoal-SE/metasmoke,angussidney/metasmoke,SulphurDioxide/metasmoke,j-f1/forked-metasmoke,Charcoal-SE/metasmoke,angussidney/metasmoke
ruby
## Code Before: class StatusController < ApplicationController protect_from_forgery :except => [:status_update] before_action :check_if_smokedetector, :only => [:status_update] def index @statuses = SmokeDetector.order('last_ping DESC').all end def status_update @smoke_detector.last_ping = DateTime.now @smoke_detector.location = params[:location] @smoke_detector.is_standby = params[:standby] || false @smoke_detector.save! respond_to do |format| format.json do if @smoke_detector.should_failover @smoke_detector.update(:is_standby => false, :force_failover => false) render :status => 200, :json => { 'failover': true } else render :status => 200, :json => { 'failover': false } end end end end end ## Instruction: Revert "Revert "Save a few bytes on every ping"" This reverts commit 5ef95920039bb38ae7a6bcb1bf228955ba898085. ## Code After: class StatusController < ApplicationController protect_from_forgery :except => [:status_update] before_action :check_if_smokedetector, :only => [:status_update] def index @statuses = SmokeDetector.order('last_ping DESC').all end def status_update @smoke_detector.last_ping = DateTime.now @smoke_detector.location = params[:location] @smoke_detector.is_standby = params[:standby] || false # If an instance is manually switched to standby, we # don't want it to immediately kick back new_standby_switch = @smoke_detector.is_standby_changed? and @smoke_detector.is_standby @smoke_detector.save! respond_to do |format| format.json do if @smoke_detector.should_failover and not new_standby_switch @smoke_detector.update(:is_standby => false, :force_failover => false) render :status => 200, :json => { 'failover': true } else head 200, content_type: "text/html" end end end end end
class StatusController < ApplicationController protect_from_forgery :except => [:status_update] before_action :check_if_smokedetector, :only => [:status_update] def index @statuses = SmokeDetector.order('last_ping DESC').all end def status_update @smoke_detector.last_ping = DateTime.now @smoke_detector.location = params[:location] @smoke_detector.is_standby = params[:standby] || false + # If an instance is manually switched to standby, we + # don't want it to immediately kick back + new_standby_switch = @smoke_detector.is_standby_changed? and @smoke_detector.is_standby + @smoke_detector.save! respond_to do |format| format.json do - if @smoke_detector.should_failover + if @smoke_detector.should_failover and not new_standby_switch ? +++++++++++++++++++++++++++ @smoke_detector.update(:is_standby => false, :force_failover => false) render :status => 200, :json => { 'failover': true } else - render :status => 200, :json => { 'failover': false } + head 200, content_type: "text/html" end end end end end
8
0.296296
6
2
c3d223ae6e2a358cf44c33f5fb8ffc63b6cae03f
demo/subscribeOn/subscribeOn.php
demo/subscribeOn/subscribeOn.php
<?php require_once __DIR__ . '/../bootstrap.php'; use React\EventLoop\Factory; use Rx\Disposable\CallbackDisposable; use Rx\ObserverInterface; use Rx\Scheduler\EventLoopScheduler; $loop = Factory::create(); $observable = Rx\Observable::create(function (ObserverInterface $observer) use ($loop) { $handler = function () use ($observer) { $observer->onNext(42); $observer->onCompleted(); }; // Change scheduler for here $timer = $loop->addTimer(0.001, $handler); return new CallbackDisposable(function () use ($timer) { // And change scheduler for here if ($timer) { $timer->cancel(); } }); }); $observable ->subscribeOn(new EventLoopScheduler($loop)) ->subscribe($stdoutObserver); $loop->run(); //Next value: 42 //Complete!
<?php require_once __DIR__ . '/../bootstrap.php'; use React\EventLoop\Factory; use Rx\Disposable\CallbackDisposable; use Rx\ObserverInterface; use Rx\Scheduler\EventLoopScheduler; $loop = Factory::create(); $observable = Rx\Observable::create(function (ObserverInterface $observer) use ($loop) { $handler = function () use ($observer) { $observer->onNext(42); $observer->onCompleted(); }; // Change scheduler for here $timer = $loop->addTimer(0.001, $handler); return new CallbackDisposable(function () use ($loop, $timer) { // And change scheduler for here if ($timer) { $loop->cancelTimer($timer); } }); }); $observable ->subscribeOn(new EventLoopScheduler($loop)) ->subscribe($stdoutObserver); $loop->run(); //Next value: 42 //Complete!
Fix demo that was using Timer::cancel() from old event-loop api
Fix demo that was using Timer::cancel() from old event-loop api
PHP
mit
ReactiveX/RxPHP
php
## Code Before: <?php require_once __DIR__ . '/../bootstrap.php'; use React\EventLoop\Factory; use Rx\Disposable\CallbackDisposable; use Rx\ObserverInterface; use Rx\Scheduler\EventLoopScheduler; $loop = Factory::create(); $observable = Rx\Observable::create(function (ObserverInterface $observer) use ($loop) { $handler = function () use ($observer) { $observer->onNext(42); $observer->onCompleted(); }; // Change scheduler for here $timer = $loop->addTimer(0.001, $handler); return new CallbackDisposable(function () use ($timer) { // And change scheduler for here if ($timer) { $timer->cancel(); } }); }); $observable ->subscribeOn(new EventLoopScheduler($loop)) ->subscribe($stdoutObserver); $loop->run(); //Next value: 42 //Complete! ## Instruction: Fix demo that was using Timer::cancel() from old event-loop api ## Code After: <?php require_once __DIR__ . '/../bootstrap.php'; use React\EventLoop\Factory; use Rx\Disposable\CallbackDisposable; use Rx\ObserverInterface; use Rx\Scheduler\EventLoopScheduler; $loop = Factory::create(); $observable = Rx\Observable::create(function (ObserverInterface $observer) use ($loop) { $handler = function () use ($observer) { $observer->onNext(42); $observer->onCompleted(); }; // Change scheduler for here $timer = $loop->addTimer(0.001, $handler); return new CallbackDisposable(function () use ($loop, $timer) { // And change scheduler for here if ($timer) { $loop->cancelTimer($timer); } }); }); $observable ->subscribeOn(new EventLoopScheduler($loop)) ->subscribe($stdoutObserver); $loop->run(); //Next value: 42 //Complete!
<?php require_once __DIR__ . '/../bootstrap.php'; use React\EventLoop\Factory; use Rx\Disposable\CallbackDisposable; use Rx\ObserverInterface; use Rx\Scheduler\EventLoopScheduler; $loop = Factory::create(); $observable = Rx\Observable::create(function (ObserverInterface $observer) use ($loop) { $handler = function () use ($observer) { $observer->onNext(42); $observer->onCompleted(); }; // Change scheduler for here $timer = $loop->addTimer(0.001, $handler); - return new CallbackDisposable(function () use ($timer) { + return new CallbackDisposable(function () use ($loop, $timer) { ? +++++++ // And change scheduler for here if ($timer) { - $timer->cancel(); + $loop->cancelTimer($timer); } }); }); $observable ->subscribeOn(new EventLoopScheduler($loop)) ->subscribe($stdoutObserver); $loop->run(); //Next value: 42 //Complete!
4
0.111111
2
2
70bf031cbd5399af53859ac37574e76690ce2040
docs/README.md
docs/README.md
This directory contains documentation on installing and using the GsDevKit environment. For installation instructions, see [Installation Overview][1] [1]: installation/README.md
This directory contains documentation on installing and using the GsDevKit environment. For installation instructions, see [Installation Overview][1]. To find out how to upgrade, see [Update and Upgrade][2]. To get started using tODE, see [Getting Started][3], [the tODE Shell][4] and [Projects in tODE][5]. For information on the GemStone server, see [Working with GemStone][6]. [1]: installation/README.md [2]: updateAndUpgrade.md [3]: gettingStartedWithTode.md [4]: todeShell.md [5]: projectsInTode.md [6]: workingWithGemStoneServer.md
Add links to various files
Add links to various files
Markdown
mit
LisaAlmarode/GsDevKit_home,GsDevKit/GsDevKit_home,LisaAlmarode/GsDevKit_home,grype/GsDevKit_home
markdown
## Code Before: This directory contains documentation on installing and using the GsDevKit environment. For installation instructions, see [Installation Overview][1] [1]: installation/README.md ## Instruction: Add links to various files ## Code After: This directory contains documentation on installing and using the GsDevKit environment. For installation instructions, see [Installation Overview][1]. To find out how to upgrade, see [Update and Upgrade][2]. To get started using tODE, see [Getting Started][3], [the tODE Shell][4] and [Projects in tODE][5]. For information on the GemStone server, see [Working with GemStone][6]. [1]: installation/README.md [2]: updateAndUpgrade.md [3]: gettingStartedWithTode.md [4]: todeShell.md [5]: projectsInTode.md [6]: workingWithGemStoneServer.md
This directory contains documentation on installing and using the GsDevKit environment. - For installation instructions, see [Installation Overview][1] + For installation instructions, see [Installation Overview][1]. ? + + + To find out how to upgrade, see [Update and Upgrade][2]. + + To get started using tODE, see [Getting Started][3], [the tODE Shell][4] and [Projects in tODE][5]. + + For information on the GemStone server, see [Working with GemStone][6]. [1]: installation/README.md + + [2]: updateAndUpgrade.md + [3]: gettingStartedWithTode.md + [4]: todeShell.md + [5]: projectsInTode.md + [6]: workingWithGemStoneServer.md + +
16
2.666667
15
1
31c9a8e3915438487f067df3d68420d0b4436a25
lib/puppet/parser/functions/query_nodes.rb
lib/puppet/parser/functions/query_nodes.rb
Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT accepts two arguments, a query used to discover nodes, and a filter used to specify the fact that should be returned. The query specified should conform to the following format: (Type[title] and fact_name<operator>fact_value) or ... Package[mysql-server] and cluster_id=my_first_cluster The filter provided should be a single fact (this argument is optional) EOT ) do |args| require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb')) query, filter = args raise(Puppet::Error, 'Query is a required parameter') unless query PuppetDB.new.query_nodes(:query => query, :filter => filter, :only_active => true) end
Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT accepts two arguments, a query used to discover nodes, and a filter used to specify the fact that should be returned. The query specified should conform to the following format: (Type[title] and fact_name<operator>fact_value) or ... Package[mysql-server] and cluster_id=my_first_cluster The filter provided should be a single fact (this argument is optional) EOT ) do |args| query, filter = args require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb')) raise(Puppet::Error, 'Query is a required parameter') unless query PuppetDB.new.query_nodes(:query => query, :filter => filter) end
Fix query node to remove active only filter.
Fix query node to remove active only filter. Query node should not filter by active_only node.
Ruby
apache-2.0
gwdg/puppet-puppetdbquery,pyther/puppet-puppetdbquery,redhat-cip/puppet-puppetdbquery,gcmalloc/puppet-puppetdbquery,baptistejammet/puppet-puppetdbquery,unki/puppet-puppetdbquery,natemccurdy/puppet-puppetdbquery,danieldreier/puppet-puppetdbquery,MelanieGault/puppet-puppetdbquery,ccin2p3/puppet-puppetdbquery,dalen/puppet-puppetdbquery
ruby
## Code Before: Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT accepts two arguments, a query used to discover nodes, and a filter used to specify the fact that should be returned. The query specified should conform to the following format: (Type[title] and fact_name<operator>fact_value) or ... Package[mysql-server] and cluster_id=my_first_cluster The filter provided should be a single fact (this argument is optional) EOT ) do |args| require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb')) query, filter = args raise(Puppet::Error, 'Query is a required parameter') unless query PuppetDB.new.query_nodes(:query => query, :filter => filter, :only_active => true) end ## Instruction: Fix query node to remove active only filter. Query node should not filter by active_only node. ## Code After: Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT accepts two arguments, a query used to discover nodes, and a filter used to specify the fact that should be returned. The query specified should conform to the following format: (Type[title] and fact_name<operator>fact_value) or ... Package[mysql-server] and cluster_id=my_first_cluster The filter provided should be a single fact (this argument is optional) EOT ) do |args| query, filter = args require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb')) raise(Puppet::Error, 'Query is a required parameter') unless query PuppetDB.new.query_nodes(:query => query, :filter => filter) end
Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT accepts two arguments, a query used to discover nodes, and a filter used to specify the fact that should be returned. The query specified should conform to the following format: (Type[title] and fact_name<operator>fact_value) or ... Package[mysql-server] and cluster_id=my_first_cluster The filter provided should be a single fact (this argument is optional) EOT ) do |args| + query, filter = args require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb')) - query, filter = args raise(Puppet::Error, 'Query is a required parameter') unless query - PuppetDB.new.query_nodes(:query => query, :filter => filter, :only_active => true) ? ---------------------- + PuppetDB.new.query_nodes(:query => query, :filter => filter) end
4
0.222222
2
2
b84a3585b1a4907a86369e40d63d93956a3f3ec9
scripts/overwrite-ts-sources-with-json-logs.sh
scripts/overwrite-ts-sources-with-json-logs.sh
cd `dirname $0`/.. # git clone git@github.com:seratch/seratch-slack-types.git cp -a json-logs/samples/audit/. ../seratch-slack-types/json/audit-api/ cp -a json-logs/samples/api/. ../seratch-slack-types/json/web-api/ cp -a json-logs/samples/events/. ../seratch-slack-types/json/events-api/ cp -a json-logs/samples/rtm/. ../seratch-slack-types/json/rtm-api/ cp -a json-logs/samples/scim/. ../seratch-slack-types/json/scim-api/ cp -a json-logs/samples/app-backend/dialogs/. ../seratch-slack-types/json/app-backend/dialogs/ cp -a json-logs/samples/app-backend/interactive-messages/. ../seratch-slack-types/json/app-backend/interactive-messages/ cp -a json-logs/samples/app-backend/message-actions/. ../seratch-slack-types/json/app-backend/message-actions/ cp -a json-logs/samples/app-backend/slash-commands/. ../seratch-slack-types/json/app-backend/slash-commands/ cp -a json-logs/samples/app-backend/views/. ../seratch-slack-types/json/app-backend/views/ echo "Done!"
cd `dirname $0`/.. # git clone git@github.com:seratch/seratch-slack-types.git cp -a json-logs/samples/audit/. ../seratch-slack-types/json/audit-api/ cp -a json-logs/samples/api/. ../seratch-slack-types/json/web-api/ cp -a json-logs/samples/events/. ../seratch-slack-types/json/events-api/ cp -a json-logs/samples/rtm/. ../seratch-slack-types/json/rtm-api/ cp -a json-logs/samples/scim/. ../seratch-slack-types/json/scim-api/ cp -a json-logs/samples/app-backend/dialogs/. ../seratch-slack-types/json/app-backend/dialogs/ cp -a json-logs/samples/app-backend/interactive-components/. ../seratch-slack-types/json/app-backend/interactive-components/ cp -a json-logs/samples/app-backend/slash-commands/. ../seratch-slack-types/json/app-backend/slash-commands/ cp -a json-logs/samples/app-backend/views/. ../seratch-slack-types/json/app-backend/views/ echo "Done!"
Fix a script for type def generation
Fix a script for type def generation
Shell
mit
seratch/jslack,seratch/jslack,seratch/jslack,seratch/jslack
shell
## Code Before: cd `dirname $0`/.. # git clone git@github.com:seratch/seratch-slack-types.git cp -a json-logs/samples/audit/. ../seratch-slack-types/json/audit-api/ cp -a json-logs/samples/api/. ../seratch-slack-types/json/web-api/ cp -a json-logs/samples/events/. ../seratch-slack-types/json/events-api/ cp -a json-logs/samples/rtm/. ../seratch-slack-types/json/rtm-api/ cp -a json-logs/samples/scim/. ../seratch-slack-types/json/scim-api/ cp -a json-logs/samples/app-backend/dialogs/. ../seratch-slack-types/json/app-backend/dialogs/ cp -a json-logs/samples/app-backend/interactive-messages/. ../seratch-slack-types/json/app-backend/interactive-messages/ cp -a json-logs/samples/app-backend/message-actions/. ../seratch-slack-types/json/app-backend/message-actions/ cp -a json-logs/samples/app-backend/slash-commands/. ../seratch-slack-types/json/app-backend/slash-commands/ cp -a json-logs/samples/app-backend/views/. ../seratch-slack-types/json/app-backend/views/ echo "Done!" ## Instruction: Fix a script for type def generation ## Code After: cd `dirname $0`/.. # git clone git@github.com:seratch/seratch-slack-types.git cp -a json-logs/samples/audit/. ../seratch-slack-types/json/audit-api/ cp -a json-logs/samples/api/. ../seratch-slack-types/json/web-api/ cp -a json-logs/samples/events/. ../seratch-slack-types/json/events-api/ cp -a json-logs/samples/rtm/. ../seratch-slack-types/json/rtm-api/ cp -a json-logs/samples/scim/. ../seratch-slack-types/json/scim-api/ cp -a json-logs/samples/app-backend/dialogs/. ../seratch-slack-types/json/app-backend/dialogs/ cp -a json-logs/samples/app-backend/interactive-components/. ../seratch-slack-types/json/app-backend/interactive-components/ cp -a json-logs/samples/app-backend/slash-commands/. ../seratch-slack-types/json/app-backend/slash-commands/ cp -a json-logs/samples/app-backend/views/. ../seratch-slack-types/json/app-backend/views/ echo "Done!"
cd `dirname $0`/.. # git clone git@github.com:seratch/seratch-slack-types.git cp -a json-logs/samples/audit/. ../seratch-slack-types/json/audit-api/ cp -a json-logs/samples/api/. ../seratch-slack-types/json/web-api/ cp -a json-logs/samples/events/. ../seratch-slack-types/json/events-api/ cp -a json-logs/samples/rtm/. ../seratch-slack-types/json/rtm-api/ cp -a json-logs/samples/scim/. ../seratch-slack-types/json/scim-api/ cp -a json-logs/samples/app-backend/dialogs/. ../seratch-slack-types/json/app-backend/dialogs/ - cp -a json-logs/samples/app-backend/interactive-messages/. ../seratch-slack-types/json/app-backend/interactive-messages/ ? ^^^^^ ^^^^^ + cp -a json-logs/samples/app-backend/interactive-components/. ../seratch-slack-types/json/app-backend/interactive-components/ ? ++ +++ ^^ ++ +++ ^^ - cp -a json-logs/samples/app-backend/message-actions/. ../seratch-slack-types/json/app-backend/message-actions/ cp -a json-logs/samples/app-backend/slash-commands/. ../seratch-slack-types/json/app-backend/slash-commands/ cp -a json-logs/samples/app-backend/views/. ../seratch-slack-types/json/app-backend/views/ echo "Done!"
3
0.214286
1
2
a6e25a855850a326596c41721cfe74b1d0274c88
test/spec/Sandbox/Application_before_chain_spec.rb
test/spec/Sandbox/Application_before_chain_spec.rb
require 'minitest/autorun' require_relative '../../../lib/Sandbox/Application' describe Sandbox::Application do before do @application = Sandbox::Application.new end it 'Invokes before-chain methods in order before Resource methods' do class BeforeChain include Sandbox::Resource::Stateless include Sandbox::Resource::BeforeChain @@before_chain = { all: [ -> (request) { request[:test] << 1 }], get: [ -> (request) { request[:test] << 2 }] } def get(request) request[:test] << 3 end end request = { test: [] } @application.handle_request(:BeforeChain, :get, request) assert_equal [1, 2, 3], request[:test] end end
require 'minitest/autorun' require_relative '../../../lib/Sandbox/Application' describe Sandbox::Application do before do @application = Sandbox::Application.new end it 'Invokes before-chain methods in order before Resource methods' do class BeforeChain include Sandbox::Resource::Stateless include Sandbox::Resource::BeforeChain chain_before :all, -> (request) { request[:test] << 1 } chain_before :get, -> (request) { request[:test] << 2 } def get(request) request[:test] << 3 end end request = { test: [] } @application.handle_request(:BeforeChain, :get, request) assert_equal [1, 2, 3], request[:test] end end
Improve application before chain syntax
Improve application before chain syntax
Ruby
mit
Tomboyo/Hollow
ruby
## Code Before: require 'minitest/autorun' require_relative '../../../lib/Sandbox/Application' describe Sandbox::Application do before do @application = Sandbox::Application.new end it 'Invokes before-chain methods in order before Resource methods' do class BeforeChain include Sandbox::Resource::Stateless include Sandbox::Resource::BeforeChain @@before_chain = { all: [ -> (request) { request[:test] << 1 }], get: [ -> (request) { request[:test] << 2 }] } def get(request) request[:test] << 3 end end request = { test: [] } @application.handle_request(:BeforeChain, :get, request) assert_equal [1, 2, 3], request[:test] end end ## Instruction: Improve application before chain syntax ## Code After: require 'minitest/autorun' require_relative '../../../lib/Sandbox/Application' describe Sandbox::Application do before do @application = Sandbox::Application.new end it 'Invokes before-chain methods in order before Resource methods' do class BeforeChain include Sandbox::Resource::Stateless include Sandbox::Resource::BeforeChain chain_before :all, -> (request) { request[:test] << 1 } chain_before :get, -> (request) { request[:test] << 2 } def get(request) request[:test] << 3 end end request = { test: [] } @application.handle_request(:BeforeChain, :get, request) assert_equal [1, 2, 3], request[:test] end end
require 'minitest/autorun' require_relative '../../../lib/Sandbox/Application' describe Sandbox::Application do before do @application = Sandbox::Application.new end it 'Invokes before-chain methods in order before Resource methods' do class BeforeChain include Sandbox::Resource::Stateless include Sandbox::Resource::BeforeChain - @@before_chain = { - all: [ -> (request) { request[:test] << 1 }], ? ^ ^^^ -- + chain_before :all, -> (request) { request[:test] << 1 } ? ++++++++++++ ^ ^ - get: [ -> (request) { request[:test] << 2 }] ? ^ ^^^ - + chain_before :get, -> (request) { request[:test] << 2 } ? ++++++++++++ ^ ^ - } def get(request) request[:test] << 3 end end request = { test: [] } @application.handle_request(:BeforeChain, :get, request) assert_equal [1, 2, 3], request[:test] end end
6
0.1875
2
4
e4954078963192ccefb402d23011c7ce0225e0b6
process/process.go
process/process.go
// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package process // ComponentName is the name of the Juju component for workload // process management. const ComponentName = "process"
// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. // The process package (and subpackages) contain the implementation of // the charm workload process feature component. The various pieces are // connected to the Juju machinery in component/all/process.go. package process // ComponentName is the name of the Juju component for workload // process management. const ComponentName = "process"
Add a package doc comment.
Add a package doc comment.
Go
agpl-3.0
waigani/juju,macgreagoir/juju,marcmolla/juju,marcmolla/juju,kat-co/juju,bogdanteleaga/juju,kat-co/juju,davecheney/juju,howbazaar/juju,fwereade/juju,macgreagoir/juju,gabriel-samfira/juju,dimitern/juju,mjs/juju,mjs/juju,dooferlad/juju,anastasiamac/juju,dooferlad/juju,howbazaar/juju,alesstimec/juju,makyo/juju,bac/juju,mjs/juju,mjs/juju,wwitzel3/juju,dimitern/juju,frankban/juju,frankban/juju,kat-co/juju,fwereade/juju,marcmolla/juju,bogdanteleaga/juju,ericsnowcurrently/juju,alesstimec/juju,axw/juju,waigani/juju,gabriel-samfira/juju,reedobrien/juju,voidspace/juju,alesstimec/juju,makyo/juju,AdamIsrael/juju,bz2/juju,bz2/juju,waigani/juju,wwitzel3/juju,bogdanteleaga/juju,wwitzel3/juju,macgreagoir/juju,gabriel-samfira/juju,dimitern/juju,marcmolla/juju,davecheney/juju,makyo/juju,kat-co/juju,wwitzel3/juju,perrito666/juju,AdamIsrael/juju,voidspace/juju,kat-co/juju,anastasiamac/juju,axw/juju,howbazaar/juju,dooferlad/juju,dimitern/juju,ericsnowcurrently/juju,bac/juju,reedobrien/juju,axw/juju,waigani/juju,bac/juju,gabriel-samfira/juju,bz2/juju,bac/juju,bac/juju,perrito666/juju,bz2/juju,alesstimec/juju,reedobrien/juju,voidspace/juju,ericsnowcurrently/juju,alesstimec/juju,ericsnowcurrently/juju,mikemccracken/juju,voidspace/juju,macgreagoir/juju,axw/juju,dimitern/juju,dooferlad/juju,anastasiamac/juju,perrito666/juju,howbazaar/juju,gabriel-samfira/juju,macgreagoir/juju,perrito666/juju,mikemccracken/juju,davecheney/juju,ericsnowcurrently/juju,anastasiamac/juju,davecheney/juju,howbazaar/juju,AdamIsrael/juju,mikemccracken/juju,bz2/juju,mjs/juju,anastasiamac/juju,reedobrien/juju,bogdanteleaga/juju,frankban/juju,axw/juju,fwereade/juju,mikemccracken/juju,mikemccracken/juju,mjs/juju,fwereade/juju,reedobrien/juju,dooferlad/juju,mjs/juju,perrito666/juju,AdamIsrael/juju,makyo/juju,frankban/juju,marcmolla/juju,frankban/juju
go
## Code Before: // Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package process // ComponentName is the name of the Juju component for workload // process management. const ComponentName = "process" ## Instruction: Add a package doc comment. ## Code After: // Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. // The process package (and subpackages) contain the implementation of // the charm workload process feature component. The various pieces are // connected to the Juju machinery in component/all/process.go. package process // ComponentName is the name of the Juju component for workload // process management. const ComponentName = "process"
// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. + // The process package (and subpackages) contain the implementation of + // the charm workload process feature component. The various pieces are + // connected to the Juju machinery in component/all/process.go. package process // ComponentName is the name of the Juju component for workload // process management. const ComponentName = "process"
3
0.375
3
0
8d2fb4ff5b3ba444fc44b6deeed1d61d239afc26
tests/FullyBaked/Pslackr/Messages/CustomMessageTest.php
tests/FullyBaked/Pslackr/Messages/CustomMessageTest.php
<?php namespace FullyBaked\Pslackr\Messages; use PHPUnit_Framework_TestCase; use Exception; class CustomMessageTest extends PHPUnit_Framework_TestCase { public function testConstructorSetsTextProperty() { $text = 'This is a test message'; $relection = new \ReflectionClass('FullyBaked\Pslackr\Messages\CustomMessage'); $property = $relection->getProperty('text'); $property->setAccessible(true); $message = $this->getMockBuilder('FullyBaked\Pslackr\Messages\CustomMessage') ->setConstructorArgs([$text]) ->getMock(); $this->assertEquals($text, $property->getValue($message)); } }
<?php namespace FullyBaked\Pslackr\Messages; use PHPUnit_Framework_TestCase; use Exception; class CustomMessageTest extends PHPUnit_Framework_TestCase { public function testConstructorSetsTextProperty() { $text = 'This is a test message'; $relection = new \ReflectionClass('FullyBaked\Pslackr\Messages\CustomMessage'); $property = $relection->getProperty('text'); $property->setAccessible(true); $message = $this->getMockBuilder('FullyBaked\Pslackr\Messages\CustomMessage') ->setConstructorArgs([$text]) ->getMock(); $this->assertEquals($text, $property->getValue($message)); } public function testAsJsonReturnsMinimumJsonRequired() { $text = 'This is a test message'; $message = new CustomMessage($text); $expected = '{"text":"This is a test message"}'; $result = $message->asJson(); $this->assertEquals($result, $expected); } }
Test that asJson returns minimum viable json for slack
Test that asJson returns minimum viable json for slack
PHP
mit
fullybaked/pslackr
php
## Code Before: <?php namespace FullyBaked\Pslackr\Messages; use PHPUnit_Framework_TestCase; use Exception; class CustomMessageTest extends PHPUnit_Framework_TestCase { public function testConstructorSetsTextProperty() { $text = 'This is a test message'; $relection = new \ReflectionClass('FullyBaked\Pslackr\Messages\CustomMessage'); $property = $relection->getProperty('text'); $property->setAccessible(true); $message = $this->getMockBuilder('FullyBaked\Pslackr\Messages\CustomMessage') ->setConstructorArgs([$text]) ->getMock(); $this->assertEquals($text, $property->getValue($message)); } } ## Instruction: Test that asJson returns minimum viable json for slack ## Code After: <?php namespace FullyBaked\Pslackr\Messages; use PHPUnit_Framework_TestCase; use Exception; class CustomMessageTest extends PHPUnit_Framework_TestCase { public function testConstructorSetsTextProperty() { $text = 'This is a test message'; $relection = new \ReflectionClass('FullyBaked\Pslackr\Messages\CustomMessage'); $property = $relection->getProperty('text'); $property->setAccessible(true); $message = $this->getMockBuilder('FullyBaked\Pslackr\Messages\CustomMessage') ->setConstructorArgs([$text]) ->getMock(); $this->assertEquals($text, $property->getValue($message)); } public function testAsJsonReturnsMinimumJsonRequired() { $text = 'This is a test message'; $message = new CustomMessage($text); $expected = '{"text":"This is a test message"}'; $result = $message->asJson(); $this->assertEquals($result, $expected); } }
<?php namespace FullyBaked\Pslackr\Messages; use PHPUnit_Framework_TestCase; use Exception; class CustomMessageTest extends PHPUnit_Framework_TestCase { public function testConstructorSetsTextProperty() { $text = 'This is a test message'; $relection = new \ReflectionClass('FullyBaked\Pslackr\Messages\CustomMessage'); $property = $relection->getProperty('text'); $property->setAccessible(true); $message = $this->getMockBuilder('FullyBaked\Pslackr\Messages\CustomMessage') ->setConstructorArgs([$text]) ->getMock(); $this->assertEquals($text, $property->getValue($message)); } + public function testAsJsonReturnsMinimumJsonRequired() + { + $text = 'This is a test message'; + $message = new CustomMessage($text); + + $expected = '{"text":"This is a test message"}'; + $result = $message->asJson(); + + $this->assertEquals($result, $expected); + } + }
11
0.423077
11
0
c13279f2f0663aed7820bb62ec317086ba984eae
src/test/kotlin/org/rust/ide/annotator/RustHighlightingPerformanceTest.kt
src/test/kotlin/org/rust/ide/annotator/RustHighlightingPerformanceTest.kt
package org.rust.ide.annotator import com.intellij.testFramework.LightProjectDescriptor import org.junit.experimental.categories.Category import org.rust.Performance import org.rust.lang.RustTestCaseBase @Category(Performance::class) class RustHighlightingPerformanceTest : RustTestCaseBase() { override val dataPath = "org/rust/ide/annotator/fixtures/performance" override fun getProjectDescriptor(): LightProjectDescriptor = WithStdlibRustProjectDescriptor() fun testHighlightingWithStdlib() { myFixture.copyDirectoryToProject("", "") myFixture.configureFromTempProjectFile("main.rs") val elapsed = myFixture.checkHighlighting() reportTeamCityMetric(name, elapsed) } }
package org.rust.ide.annotator import com.intellij.psi.stubs.StubUpdatingIndex import com.intellij.testFramework.LightProjectDescriptor import com.intellij.util.indexing.FileBasedIndex import org.junit.experimental.categories.Category import org.rust.Performance import org.rust.lang.RustTestCaseBase @Category(Performance::class) class RustHighlightingPerformanceTest : RustTestCaseBase() { override val dataPath = "org/rust/ide/annotator/fixtures/performance" override fun setUp() { super.setUp() FileBasedIndex.getInstance().requestRebuild(StubUpdatingIndex.INDEX_ID) } override fun getProjectDescriptor(): LightProjectDescriptor = WithStdlibRustProjectDescriptor() fun testHighlightingWithStdlib() { myFixture.copyDirectoryToProject("", "") myFixture.configureFromTempProjectFile("main.rs") val elapsed = myFixture.checkHighlighting() reportTeamCityMetric(name, elapsed) } }
Reset `RustImplIndex` on every test run
(IDX): Reset `RustImplIndex` on every test run
Kotlin
mit
d9n/intellij-rust,himikof/intellij-rust,intellij-rust/intellij-rust,ujpv/intellij-rust,ujpv/intellij-rust,intellij-rust/intellij-rust,anton-okolelov/intellij-rust,anton-okolelov/intellij-rust,d9n/intellij-rust,alygin/intellij-rust,himikof/intellij-rust,Undin/intellij-rust,alygin/intellij-rust,d9n/intellij-rust,Undin/intellij-rust,alygin/intellij-rust,Undin/intellij-rust,ujpv/intellij-rust,d9n/intellij-rust,himikof/intellij-rust,Undin/intellij-rust,alygin/intellij-rust,Undin/intellij-rust,anton-okolelov/intellij-rust,alygin/intellij-rust,intellij-rust/intellij-rust,himikof/intellij-rust,Undin/intellij-rust,ujpv/intellij-rust,intellij-rust/intellij-rust,anton-okolelov/intellij-rust,intellij-rust/intellij-rust,intellij-rust/intellij-rust,anton-okolelov/intellij-rust,ujpv/intellij-rust,himikof/intellij-rust,d9n/intellij-rust
kotlin
## Code Before: package org.rust.ide.annotator import com.intellij.testFramework.LightProjectDescriptor import org.junit.experimental.categories.Category import org.rust.Performance import org.rust.lang.RustTestCaseBase @Category(Performance::class) class RustHighlightingPerformanceTest : RustTestCaseBase() { override val dataPath = "org/rust/ide/annotator/fixtures/performance" override fun getProjectDescriptor(): LightProjectDescriptor = WithStdlibRustProjectDescriptor() fun testHighlightingWithStdlib() { myFixture.copyDirectoryToProject("", "") myFixture.configureFromTempProjectFile("main.rs") val elapsed = myFixture.checkHighlighting() reportTeamCityMetric(name, elapsed) } } ## Instruction: (IDX): Reset `RustImplIndex` on every test run ## Code After: package org.rust.ide.annotator import com.intellij.psi.stubs.StubUpdatingIndex import com.intellij.testFramework.LightProjectDescriptor import com.intellij.util.indexing.FileBasedIndex import org.junit.experimental.categories.Category import org.rust.Performance import org.rust.lang.RustTestCaseBase @Category(Performance::class) class RustHighlightingPerformanceTest : RustTestCaseBase() { override val dataPath = "org/rust/ide/annotator/fixtures/performance" override fun setUp() { super.setUp() FileBasedIndex.getInstance().requestRebuild(StubUpdatingIndex.INDEX_ID) } override fun getProjectDescriptor(): LightProjectDescriptor = WithStdlibRustProjectDescriptor() fun testHighlightingWithStdlib() { myFixture.copyDirectoryToProject("", "") myFixture.configureFromTempProjectFile("main.rs") val elapsed = myFixture.checkHighlighting() reportTeamCityMetric(name, elapsed) } }
package org.rust.ide.annotator + import com.intellij.psi.stubs.StubUpdatingIndex import com.intellij.testFramework.LightProjectDescriptor + import com.intellij.util.indexing.FileBasedIndex import org.junit.experimental.categories.Category import org.rust.Performance import org.rust.lang.RustTestCaseBase @Category(Performance::class) class RustHighlightingPerformanceTest : RustTestCaseBase() { override val dataPath = "org/rust/ide/annotator/fixtures/performance" + + override fun setUp() { + super.setUp() + + FileBasedIndex.getInstance().requestRebuild(StubUpdatingIndex.INDEX_ID) + } override fun getProjectDescriptor(): LightProjectDescriptor = WithStdlibRustProjectDescriptor() fun testHighlightingWithStdlib() { myFixture.copyDirectoryToProject("", "") myFixture.configureFromTempProjectFile("main.rs") val elapsed = myFixture.checkHighlighting() reportTeamCityMetric(name, elapsed) } }
8
0.333333
8
0
76bf96260365cee1954785a334ddb7171d083284
lib/epub/constants.rb
lib/epub/constants.rb
module EPUB module Constants NAMESPACES = { 'dc' => 'http://purl.org/dc/elements/1.1/', 'ocf' => 'urn:oasis:names:tc:opendocument:xmlns:container', 'opf' => 'http://www.idpf.org/2007/opf', 'xhtml' => 'http://www.w3.org/1999/xhtml', 'epub' => 'http://www.idpf.org/2007/ops', 'm' => 'http://www.w3.org/1998/Math/MathML', 'svg' => 'http://www.w3.org/2000/svg' } module MediaType class UnsupportedError < StandardError; end ROOTFILE = 'application/oebps-package+xml' IMAGE = %w[ image/gif image/jpeg image/png image/svg+xml ] APPLICATION = %w[ application/xhtml+xml application/x-dtbncx+xml application/vnd.ms-opentype application/font-woff application/smil+xml application/pls+xml ] AUDIO = %w[ audio/mpeg audio/mp4 ] TEXT = %w[ text/css text/javascript ] CORE = IMAGE + APPLICATION + AUDIO + TEXT end end include Constants end
module EPUB module Constants NAMESPACES = { 'dc' => 'http://purl.org/dc/elements/1.1/', 'ocf' => 'urn:oasis:names:tc:opendocument:xmlns:container', 'opf' => 'http://www.idpf.org/2007/opf', 'xhtml' => 'http://www.w3.org/1999/xhtml', 'epub' => 'http://www.idpf.org/2007/ops', 'm' => 'http://www.w3.org/1998/Math/MathML', 'svg' => 'http://www.w3.org/2000/svg', 'smil' => 'http://www.w3.org/ns/SMIL' } module MediaType class UnsupportedError < StandardError; end ROOTFILE = 'application/oebps-package+xml' IMAGE = %w[ image/gif image/jpeg image/png image/svg+xml ] APPLICATION = %w[ application/xhtml+xml application/x-dtbncx+xml application/vnd.ms-opentype application/font-woff application/smil+xml application/pls+xml ] AUDIO = %w[ audio/mpeg audio/mp4 ] TEXT = %w[ text/css text/javascript ] CORE = IMAGE + APPLICATION + AUDIO + TEXT end end include Constants end
Add XML namespace for SMIL
Add XML namespace for SMIL
Ruby
mit
KitaitiMakoto/epub-parser
ruby
## Code Before: module EPUB module Constants NAMESPACES = { 'dc' => 'http://purl.org/dc/elements/1.1/', 'ocf' => 'urn:oasis:names:tc:opendocument:xmlns:container', 'opf' => 'http://www.idpf.org/2007/opf', 'xhtml' => 'http://www.w3.org/1999/xhtml', 'epub' => 'http://www.idpf.org/2007/ops', 'm' => 'http://www.w3.org/1998/Math/MathML', 'svg' => 'http://www.w3.org/2000/svg' } module MediaType class UnsupportedError < StandardError; end ROOTFILE = 'application/oebps-package+xml' IMAGE = %w[ image/gif image/jpeg image/png image/svg+xml ] APPLICATION = %w[ application/xhtml+xml application/x-dtbncx+xml application/vnd.ms-opentype application/font-woff application/smil+xml application/pls+xml ] AUDIO = %w[ audio/mpeg audio/mp4 ] TEXT = %w[ text/css text/javascript ] CORE = IMAGE + APPLICATION + AUDIO + TEXT end end include Constants end ## Instruction: Add XML namespace for SMIL ## Code After: module EPUB module Constants NAMESPACES = { 'dc' => 'http://purl.org/dc/elements/1.1/', 'ocf' => 'urn:oasis:names:tc:opendocument:xmlns:container', 'opf' => 'http://www.idpf.org/2007/opf', 'xhtml' => 'http://www.w3.org/1999/xhtml', 'epub' => 'http://www.idpf.org/2007/ops', 'm' => 'http://www.w3.org/1998/Math/MathML', 'svg' => 'http://www.w3.org/2000/svg', 'smil' => 'http://www.w3.org/ns/SMIL' } module MediaType class UnsupportedError < StandardError; end ROOTFILE = 'application/oebps-package+xml' IMAGE = %w[ image/gif image/jpeg image/png image/svg+xml ] APPLICATION = %w[ application/xhtml+xml application/x-dtbncx+xml application/vnd.ms-opentype application/font-woff application/smil+xml application/pls+xml ] AUDIO = %w[ audio/mpeg audio/mp4 ] TEXT = %w[ text/css text/javascript ] CORE = IMAGE + APPLICATION + AUDIO + TEXT end end include Constants end
module EPUB module Constants NAMESPACES = { 'dc' => 'http://purl.org/dc/elements/1.1/', 'ocf' => 'urn:oasis:names:tc:opendocument:xmlns:container', 'opf' => 'http://www.idpf.org/2007/opf', 'xhtml' => 'http://www.w3.org/1999/xhtml', 'epub' => 'http://www.idpf.org/2007/ops', 'm' => 'http://www.w3.org/1998/Math/MathML', - 'svg' => 'http://www.w3.org/2000/svg' + 'svg' => 'http://www.w3.org/2000/svg', ? + + 'smil' => 'http://www.w3.org/ns/SMIL' } module MediaType class UnsupportedError < StandardError; end ROOTFILE = 'application/oebps-package+xml' IMAGE = %w[ image/gif image/jpeg image/png image/svg+xml ] APPLICATION = %w[ application/xhtml+xml application/x-dtbncx+xml application/vnd.ms-opentype application/font-woff application/smil+xml application/pls+xml ] AUDIO = %w[ audio/mpeg audio/mp4 ] TEXT = %w[ text/css text/javascript ] CORE = IMAGE + APPLICATION + AUDIO + TEXT end end include Constants end
3
0.068182
2
1
98013f632e7f4becb75c4964f38be9f8a9be0d64
build.rs
build.rs
fn main() { if cfg!(r#static) { println!("cargo:rustc-link-lib=static=odbc"); } if cfg!(target_os = "macos") { // if we're on Mac OS X we'll kindly add DYLD_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_paths) = option_env!("DYLD_LIBRARY_PATH") { print_paths(dyld_paths); } // if we're on Mac OS X we'll kindly add DYLD_FALLBACK_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_fallback_paths) = option_env!("DYLD_FALLBACK_LIBRARY_PATH") { print_paths(dyld_fallback_paths); } } } fn print_paths(paths: &str) { for path in paths.split(':').filter(|x| !x.is_empty()) { println!("cargo:rustc-link-search=native={}", path) } }
fn main() { if cfg!(r#static) { let static_path = std::env::var("ODBC_SYS_STATIC_PATH").unwrap_or("/usr/lib".to_string()); println!("cargo:rerun-if-env-changed=ODBC_SYS_STATIC_PATH"); println!("cargo:rustc-link-search=native={}", static_path); println!("cargo:rustc-link-lib=static=odbc"); } if cfg!(target_os = "macos") { // if we're on Mac OS X we'll kindly add DYLD_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_paths) = option_env!("DYLD_LIBRARY_PATH") { print_paths(dyld_paths); } // if we're on Mac OS X we'll kindly add DYLD_FALLBACK_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_fallback_paths) = option_env!("DYLD_FALLBACK_LIBRARY_PATH") { print_paths(dyld_fallback_paths); } } } fn print_paths(paths: &str) { for path in paths.split(':').filter(|x| !x.is_empty()) { println!("cargo:rustc-link-search=native={}", path) } }
Add optional search path for static linking
Add optional search path for static linking
Rust
mit
pacman82/odbc-sys
rust
## Code Before: fn main() { if cfg!(r#static) { println!("cargo:rustc-link-lib=static=odbc"); } if cfg!(target_os = "macos") { // if we're on Mac OS X we'll kindly add DYLD_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_paths) = option_env!("DYLD_LIBRARY_PATH") { print_paths(dyld_paths); } // if we're on Mac OS X we'll kindly add DYLD_FALLBACK_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_fallback_paths) = option_env!("DYLD_FALLBACK_LIBRARY_PATH") { print_paths(dyld_fallback_paths); } } } fn print_paths(paths: &str) { for path in paths.split(':').filter(|x| !x.is_empty()) { println!("cargo:rustc-link-search=native={}", path) } } ## Instruction: Add optional search path for static linking ## Code After: fn main() { if cfg!(r#static) { let static_path = std::env::var("ODBC_SYS_STATIC_PATH").unwrap_or("/usr/lib".to_string()); println!("cargo:rerun-if-env-changed=ODBC_SYS_STATIC_PATH"); println!("cargo:rustc-link-search=native={}", static_path); println!("cargo:rustc-link-lib=static=odbc"); } if cfg!(target_os = "macos") { // if we're on Mac OS X we'll kindly add DYLD_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_paths) = option_env!("DYLD_LIBRARY_PATH") { print_paths(dyld_paths); } // if we're on Mac OS X we'll kindly add DYLD_FALLBACK_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_fallback_paths) = option_env!("DYLD_FALLBACK_LIBRARY_PATH") { print_paths(dyld_fallback_paths); } } } fn print_paths(paths: &str) { for path in paths.split(':').filter(|x| !x.is_empty()) { println!("cargo:rustc-link-search=native={}", path) } }
fn main() { if cfg!(r#static) { + let static_path = std::env::var("ODBC_SYS_STATIC_PATH").unwrap_or("/usr/lib".to_string()); + println!("cargo:rerun-if-env-changed=ODBC_SYS_STATIC_PATH"); + println!("cargo:rustc-link-search=native={}", static_path); println!("cargo:rustc-link-lib=static=odbc"); } if cfg!(target_os = "macos") { // if we're on Mac OS X we'll kindly add DYLD_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_paths) = option_env!("DYLD_LIBRARY_PATH") { print_paths(dyld_paths); } // if we're on Mac OS X we'll kindly add DYLD_FALLBACK_LIBRARY_PATH to rustc's // linker search path if let Some(dyld_fallback_paths) = option_env!("DYLD_FALLBACK_LIBRARY_PATH") { print_paths(dyld_fallback_paths); } } } fn print_paths(paths: &str) { for path in paths.split(':').filter(|x| !x.is_empty()) { println!("cargo:rustc-link-search=native={}", path) } }
3
0.125
3
0
ec56c9911742e501e9638476f22e0df7dbf94597
app/assets/javascripts/backbone/plugins/user_list.js.coffee
app/assets/javascripts/backbone/plugins/user_list.js.coffee
class Kandan.Plugins.UserList @widget_title: "People" @widget_icon_url: "/assets/people_icon.png" @pluginNamespace: "Kandan.Plugins.UserList" @template: _.template ''' <li class="user" title="<%= name %>"> <img class="avatar" src="<%= avatarUrl %>"/> <%- name %><% if(admin){ %> <span class="badge badge-important">Admin</span><% } %> </li> ''' @render: ($el)-> $users = $("<ul class='user_list'></ul>") $el.next().hide(); for user in Kandan.Data.ActiveUsers.all() displayName = null displayName = user.username # Defaults to username displayName ||= user.email # Revert to user email address if that's all we have isAdmin = user.is_admin $users.append @template({ name: displayName, admin: isAdmin, avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25}) }) $el.html($users) @init: ()-> Kandan.Widgets.register @pluginNamespace Kandan.Data.ActiveUsers.registerCallback "change", ()=> Kandan.Widgets.render @pluginNamespace
class Kandan.Plugins.UserList @widget_title: "People" @widget_icon_url: "/assets/people_icon.png" @pluginNamespace: "Kandan.Plugins.UserList" @template: _.template ''' <li class="user" title="<%= name %>"> <img class="avatar" src="<%= avatarUrl %>"/> <%- name %><% if(admin){ %> <span class="badge badge-important">Admin</span><% } %> </li> ''' @render: ($el)-> $users = $("<ul class='user_list'></ul>") $el.next().hide(); users = _(Kandan.Data.ActiveUsers.all()).chain().sortBy("username").reverse().sortBy("is_admin").reverse().value(); for user in users displayName = null displayName = user.username # Defaults to username displayName ||= user.email # Revert to user email address if that's all we have isAdmin = user.is_admin $users.append @template({ name: displayName, admin: isAdmin, avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25}) }) $el.html($users) @init: ()-> Kandan.Widgets.register @pluginNamespace Kandan.Data.ActiveUsers.registerCallback "change", ()=> Kandan.Widgets.render @pluginNamespace
Sort user list by admin first, then by username
Sort user list by admin first, then by username
CoffeeScript
agpl-3.0
ipmobiletech/kandan,miurahr/kandan,kandanapp/kandan,leohmoraes/kandan,ych06/kandan,yfix/kandan,cloudstead/kandan,Stackato-Apps/kandan,sai43/kandan,miurahr/kandan,kandanapp/kandan,ych06/kandan,kandanapp/kandan,cloudstead/kandan,ych06/kandan,ipmobiletech/kandan,Stackato-Apps/kandan,leohmoraes/kandan,yfix/kandan,Stackato-Apps/kandan,leohmoraes/kandan,sai43/kandan,sai43/kandan,Stackato-Apps/kandan,miurahr/kandan,leohmoraes/kandan,ych06/kandan,ipmobiletech/kandan,kandanapp/kandan,ipmobiletech/kandan,yfix/kandan,cloudstead/kandan,yfix/kandan,cloudstead/kandan,miurahr/kandan,sai43/kandan
coffeescript
## Code Before: class Kandan.Plugins.UserList @widget_title: "People" @widget_icon_url: "/assets/people_icon.png" @pluginNamespace: "Kandan.Plugins.UserList" @template: _.template ''' <li class="user" title="<%= name %>"> <img class="avatar" src="<%= avatarUrl %>"/> <%- name %><% if(admin){ %> <span class="badge badge-important">Admin</span><% } %> </li> ''' @render: ($el)-> $users = $("<ul class='user_list'></ul>") $el.next().hide(); for user in Kandan.Data.ActiveUsers.all() displayName = null displayName = user.username # Defaults to username displayName ||= user.email # Revert to user email address if that's all we have isAdmin = user.is_admin $users.append @template({ name: displayName, admin: isAdmin, avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25}) }) $el.html($users) @init: ()-> Kandan.Widgets.register @pluginNamespace Kandan.Data.ActiveUsers.registerCallback "change", ()=> Kandan.Widgets.render @pluginNamespace ## Instruction: Sort user list by admin first, then by username ## Code After: class Kandan.Plugins.UserList @widget_title: "People" @widget_icon_url: "/assets/people_icon.png" @pluginNamespace: "Kandan.Plugins.UserList" @template: _.template ''' <li class="user" title="<%= name %>"> <img class="avatar" src="<%= avatarUrl %>"/> <%- name %><% if(admin){ %> <span class="badge badge-important">Admin</span><% } %> </li> ''' @render: ($el)-> $users = $("<ul class='user_list'></ul>") $el.next().hide(); users = _(Kandan.Data.ActiveUsers.all()).chain().sortBy("username").reverse().sortBy("is_admin").reverse().value(); for user in users displayName = null displayName = user.username # Defaults to username displayName ||= user.email # Revert to user email address if that's all we have isAdmin = user.is_admin $users.append @template({ name: displayName, admin: isAdmin, avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25}) }) $el.html($users) @init: ()-> Kandan.Widgets.register @pluginNamespace Kandan.Data.ActiveUsers.registerCallback "change", ()=> Kandan.Widgets.render @pluginNamespace
class Kandan.Plugins.UserList @widget_title: "People" @widget_icon_url: "/assets/people_icon.png" @pluginNamespace: "Kandan.Plugins.UserList" @template: _.template ''' <li class="user" title="<%= name %>"> <img class="avatar" src="<%= avatarUrl %>"/> <%- name %><% if(admin){ %> <span class="badge badge-important">Admin</span><% } %> </li> ''' @render: ($el)-> $users = $("<ul class='user_list'></ul>") $el.next().hide(); - for user in Kandan.Data.ActiveUsers.all() + users = _(Kandan.Data.ActiveUsers.all()).chain().sortBy("username").reverse().sortBy("is_admin").reverse().value(); + + for user in users displayName = null displayName = user.username # Defaults to username displayName ||= user.email # Revert to user email address if that's all we have isAdmin = user.is_admin $users.append @template({ name: displayName, admin: isAdmin, avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25}) }) $el.html($users) @init: ()-> Kandan.Widgets.register @pluginNamespace Kandan.Data.ActiveUsers.registerCallback "change", ()=> Kandan.Widgets.render @pluginNamespace
4
0.114286
3
1
136b3f34cf976dc3b0d7035c59a39255d8f37393
client/src/components/SelectInstrument.jsx
client/src/components/SelectInstrument.jsx
import React from 'react'; const SelectInstrument = ({ handleClick, opacity }) => ( <div id="selectInstrumentRoom"> <div> <img id="instLogo" src="../../../style/InstrumentRoomLogo.png" alt="logo" /> </div> <div className={opacity('piano')}> <img id="pianoChoose" src="http://handlinpiano2.codyhandlin.com/wp-content/uploads/2016/06/grandepiano_2.png" alt="piano" onClick={handleClick.bind(null, 'piano')} /> </div> <div className={opacity('drums')}> <img id="drumsChoose" src="http://www.vancouvertop40radio.com/Images/Clip%20Art/drumset.gif" alt="drums" onClick={handleClick.bind(null, 'drums')} /> </div> </div> ); SelectInstrument.propTypes = { handleClick: React.PropTypes.func.isRequired, opacity: React.PropTypes.func }; // SelectInstrument.childContextTypes = { // muiTheme: React.PropTypes.object.isRequired, // }; export default SelectInstrument;
import React from 'react'; const SelectInstrument = ({ handleClick, opacity }) => ( <div id="selectInstrumentRoom"> <div> <img id="instLogo" src="../../../style/InstrumentRoomLogo.png" alt="logo" /> </div> <div className={opacity('piano')}> <img id="pianoChoose" src="http://handlinpiano2.codyhandlin.com/wp-content/uploads/2016/06/grandepiano_2.png" alt="piano" onClick={handleClick.bind(null, 'piano')} /> </div> <div className={opacity('drums')}> <img id="drumsChoose" src="http://www.vancouvertop40radio.com/Images/Clip%20Art/drumset.gif" alt="drums" onClick={handleClick.bind(null, 'drums')} /> </div> <div className={opacity('fry')}> <img id="fryChoose" src="http://i.stack.imgur.com/STEuc.png" alt="fry" onClick={handleClick.bind(null, 'fry')} /> </div> </div> ); SelectInstrument.propTypes = { handleClick: React.PropTypes.func.isRequired, opacity: React.PropTypes.func }; // SelectInstrument.childContextTypes = { // muiTheme: React.PropTypes.object.isRequired, // }; export default SelectInstrument;
Add fry as an instrument
Add fry as an instrument
JSX
mit
NerdDiffer/reprise,NerdDiffer/reprise,NerdDiffer/reprise
jsx
## Code Before: import React from 'react'; const SelectInstrument = ({ handleClick, opacity }) => ( <div id="selectInstrumentRoom"> <div> <img id="instLogo" src="../../../style/InstrumentRoomLogo.png" alt="logo" /> </div> <div className={opacity('piano')}> <img id="pianoChoose" src="http://handlinpiano2.codyhandlin.com/wp-content/uploads/2016/06/grandepiano_2.png" alt="piano" onClick={handleClick.bind(null, 'piano')} /> </div> <div className={opacity('drums')}> <img id="drumsChoose" src="http://www.vancouvertop40radio.com/Images/Clip%20Art/drumset.gif" alt="drums" onClick={handleClick.bind(null, 'drums')} /> </div> </div> ); SelectInstrument.propTypes = { handleClick: React.PropTypes.func.isRequired, opacity: React.PropTypes.func }; // SelectInstrument.childContextTypes = { // muiTheme: React.PropTypes.object.isRequired, // }; export default SelectInstrument; ## Instruction: Add fry as an instrument ## Code After: import React from 'react'; const SelectInstrument = ({ handleClick, opacity }) => ( <div id="selectInstrumentRoom"> <div> <img id="instLogo" src="../../../style/InstrumentRoomLogo.png" alt="logo" /> </div> <div className={opacity('piano')}> <img id="pianoChoose" src="http://handlinpiano2.codyhandlin.com/wp-content/uploads/2016/06/grandepiano_2.png" alt="piano" onClick={handleClick.bind(null, 'piano')} /> </div> <div className={opacity('drums')}> <img id="drumsChoose" src="http://www.vancouvertop40radio.com/Images/Clip%20Art/drumset.gif" alt="drums" onClick={handleClick.bind(null, 'drums')} /> </div> <div className={opacity('fry')}> <img id="fryChoose" src="http://i.stack.imgur.com/STEuc.png" alt="fry" onClick={handleClick.bind(null, 'fry')} /> </div> </div> ); SelectInstrument.propTypes = { handleClick: React.PropTypes.func.isRequired, opacity: React.PropTypes.func }; // SelectInstrument.childContextTypes = { // muiTheme: React.PropTypes.object.isRequired, // }; export default SelectInstrument;
import React from 'react'; const SelectInstrument = ({ handleClick, opacity }) => ( <div id="selectInstrumentRoom"> <div> <img id="instLogo" src="../../../style/InstrumentRoomLogo.png" alt="logo" /> </div> <div className={opacity('piano')}> <img id="pianoChoose" src="http://handlinpiano2.codyhandlin.com/wp-content/uploads/2016/06/grandepiano_2.png" alt="piano" onClick={handleClick.bind(null, 'piano')} /> </div> <div className={opacity('drums')}> <img id="drumsChoose" src="http://www.vancouvertop40radio.com/Images/Clip%20Art/drumset.gif" alt="drums" onClick={handleClick.bind(null, 'drums')} /> </div> + <div className={opacity('fry')}> + <img + id="fryChoose" + src="http://i.stack.imgur.com/STEuc.png" + alt="fry" + onClick={handleClick.bind(null, 'fry')} + /> + </div> </div> ); SelectInstrument.propTypes = { handleClick: React.PropTypes.func.isRequired, opacity: React.PropTypes.func }; // SelectInstrument.childContextTypes = { // muiTheme: React.PropTypes.object.isRequired, // }; export default SelectInstrument;
8
0.2
8
0
672584a82e3dceb3638e256e0bc6ca7209b2f0f2
packages/se/servant-matrix-param.yaml
packages/se/servant-matrix-param.yaml
homepage: '' changelog-type: '' hash: 0a97e54d15072a249e7c11c5cdea3101afdd14106d669bbbb1ad2f69138d9e83 test-bench-deps: base: <5 hspec: -any doctest: -any servant: ==0.5 servant-matrix-param: -any servant-aeson-specs: -any maintainer: soenkehahn@gmail.com synopsis: Matrix parameter combinator for servant changelog: '' basic-deps: base: <5 servant: ==0.5 all-versions: - '0.1' - '0.1.0.1' author: '' latest: '0.1.0.1' description-type: haddock description: Matrix parameter combinator for servant license-name: MIT
homepage: '' changelog-type: '' hash: 6a73121fdd3c23332f066a1ffdec72ab7cf6e91498d3d2e884fdf9f766df272e test-bench-deps: bytestring: -any wai: -any base: <5 hspec: -any text: -any doctest: -any servant-server: -any servant: ==0.5 containers: -any servant-matrix-param: -any wai-extra: -any transformers: -any http-types: -any aeson: -any servant-aeson-specs: -any maintainer: soenkehahn@gmail.com synopsis: Matrix parameter combinator for servant changelog: '' basic-deps: base: <5 servant: ==0.5 all-versions: - '0.1' - '0.1.0.1' - '0.2' author: '' latest: '0.2' description-type: haddock description: Matrix parameter combinator for servant license-name: MIT
Update from Hackage at 2016-08-19T14:51:38+0000
Update from Hackage at 2016-08-19T14:51:38+0000
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: '' changelog-type: '' hash: 0a97e54d15072a249e7c11c5cdea3101afdd14106d669bbbb1ad2f69138d9e83 test-bench-deps: base: <5 hspec: -any doctest: -any servant: ==0.5 servant-matrix-param: -any servant-aeson-specs: -any maintainer: soenkehahn@gmail.com synopsis: Matrix parameter combinator for servant changelog: '' basic-deps: base: <5 servant: ==0.5 all-versions: - '0.1' - '0.1.0.1' author: '' latest: '0.1.0.1' description-type: haddock description: Matrix parameter combinator for servant license-name: MIT ## Instruction: Update from Hackage at 2016-08-19T14:51:38+0000 ## Code After: homepage: '' changelog-type: '' hash: 6a73121fdd3c23332f066a1ffdec72ab7cf6e91498d3d2e884fdf9f766df272e test-bench-deps: bytestring: -any wai: -any base: <5 hspec: -any text: -any doctest: -any servant-server: -any servant: ==0.5 containers: -any servant-matrix-param: -any wai-extra: -any transformers: -any http-types: -any aeson: -any servant-aeson-specs: -any maintainer: soenkehahn@gmail.com synopsis: Matrix parameter combinator for servant changelog: '' basic-deps: base: <5 servant: ==0.5 all-versions: - '0.1' - '0.1.0.1' - '0.2' author: '' latest: '0.2' description-type: haddock description: Matrix parameter combinator for servant license-name: MIT
homepage: '' changelog-type: '' - hash: 0a97e54d15072a249e7c11c5cdea3101afdd14106d669bbbb1ad2f69138d9e83 + hash: 6a73121fdd3c23332f066a1ffdec72ab7cf6e91498d3d2e884fdf9f766df272e test-bench-deps: + bytestring: -any + wai: -any base: <5 hspec: -any + text: -any doctest: -any + servant-server: -any servant: ==0.5 + containers: -any servant-matrix-param: -any + wai-extra: -any + transformers: -any + http-types: -any + aeson: -any servant-aeson-specs: -any maintainer: soenkehahn@gmail.com synopsis: Matrix parameter combinator for servant changelog: '' basic-deps: base: <5 servant: ==0.5 all-versions: - '0.1' - '0.1.0.1' + - '0.2' author: '' - latest: '0.1.0.1' ? ^^^^^ + latest: '0.2' ? ^ description-type: haddock description: Matrix parameter combinator for servant license-name: MIT
14
0.583333
12
2
c6fc4a2fe2115179783d6d8afda79ae27eef20f7
www/styles/site-account-login-page.css
www/styles/site-account-login-page.css
/* Account Login page */ #login_frame { width: 55%; float: left; margin-right: 4%; } #new_customers_frame { width: 38%; float: left; } #new_customers_frame p { margin: 0 0 1em 0; } #login_frame #email_address { width: 98%; } .swat-footer-form-field { clear: left; } #login_frame .swat-footer-form-field .swat-button { vertical-align: middle; }
/* Account Login page */ #login_frame { width: 55%; float: left; display: inline; /* For IE6 */ margin-right: 4%; } #new_customers_frame { width: 38%; float: left; } #new_customers_frame p { margin: 0 0 1em 0; } #login_frame #email_address { width: 98%; } .swat-footer-form-field { clear: left; } #login_frame .swat-footer-form-field .swat-button { vertical-align: middle; }
Fix minor IE6 margin+float bug
Fix minor IE6 margin+float bug svn commit r34585
CSS
lgpl-2.1
silverorange/site,silverorange/site,nburka/site,nburka/site
css
## Code Before: /* Account Login page */ #login_frame { width: 55%; float: left; margin-right: 4%; } #new_customers_frame { width: 38%; float: left; } #new_customers_frame p { margin: 0 0 1em 0; } #login_frame #email_address { width: 98%; } .swat-footer-form-field { clear: left; } #login_frame .swat-footer-form-field .swat-button { vertical-align: middle; } ## Instruction: Fix minor IE6 margin+float bug svn commit r34585 ## Code After: /* Account Login page */ #login_frame { width: 55%; float: left; display: inline; /* For IE6 */ margin-right: 4%; } #new_customers_frame { width: 38%; float: left; } #new_customers_frame p { margin: 0 0 1em 0; } #login_frame #email_address { width: 98%; } .swat-footer-form-field { clear: left; } #login_frame .swat-footer-form-field .swat-button { vertical-align: middle; }
/* Account Login page */ #login_frame { width: 55%; float: left; + display: inline; /* For IE6 */ margin-right: 4%; } #new_customers_frame { width: 38%; float: left; } #new_customers_frame p { margin: 0 0 1em 0; } #login_frame #email_address { width: 98%; } .swat-footer-form-field { clear: left; } #login_frame .swat-footer-form-field .swat-button { vertical-align: middle; }
1
0.035714
1
0
3c62ca41b188d74bfd10c2a203f6a08b35c5866c
lib/yelp/deep_struct.rb
lib/yelp/deep_struct.rb
require 'ostruct' # This is some code to create nested Structs from nested hash tables. # Code written by Andrea Pavoni, more information here: # http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash class DeepStruct < OpenStruct def initialize(hash = nil) @table = {} @hash_table = {} if hash hash.each do |k,v| if v.is_a?(Hash) @table[k.to_sym] = self.class.new(v) elsif v.is_a?(Array) array = [] v.each do |v2| if v2.is_a?(Hash) array << self.class.new(v2) else array << v2 end end @table[k.to_sym] = array else @table[k.to_sym] = v end @hash_table[k.to_sym] = v new_ostruct_member(k) end end end def to_h @hash_table end end
require 'ostruct' # This is some code to create nested Structs from nested hash tables. # Code written by Andrea Pavoni, more information here: # http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash # # This has been slightly modified to work with hashes nested inside of arrays class DeepStruct < OpenStruct def initialize(hash = {}) @table = {} hash.each do |k,v| if v.is_a?(Hash) @table[k.to_sym] = self.class.new(v) elsif v.is_a?(Array) array = [] v.each do |v2| if v2.is_a?(Hash) array << self.class.new(v2) else array << v2 end end @table[k.to_sym] = array else @table[k.to_sym] = v end new_ostruct_member(k) end end end
Clean up DeepStruct a little bit
Clean up DeepStruct a little bit
Ruby
mit
glarson284/yelp-ruby,pducks32/yelp-ruby,thatoddmailbox/yelp-ruby,nickuya/yelp-ruby,Yelp/yelp-ruby
ruby
## Code Before: require 'ostruct' # This is some code to create nested Structs from nested hash tables. # Code written by Andrea Pavoni, more information here: # http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash class DeepStruct < OpenStruct def initialize(hash = nil) @table = {} @hash_table = {} if hash hash.each do |k,v| if v.is_a?(Hash) @table[k.to_sym] = self.class.new(v) elsif v.is_a?(Array) array = [] v.each do |v2| if v2.is_a?(Hash) array << self.class.new(v2) else array << v2 end end @table[k.to_sym] = array else @table[k.to_sym] = v end @hash_table[k.to_sym] = v new_ostruct_member(k) end end end def to_h @hash_table end end ## Instruction: Clean up DeepStruct a little bit ## Code After: require 'ostruct' # This is some code to create nested Structs from nested hash tables. # Code written by Andrea Pavoni, more information here: # http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash # # This has been slightly modified to work with hashes nested inside of arrays class DeepStruct < OpenStruct def initialize(hash = {}) @table = {} hash.each do |k,v| if v.is_a?(Hash) @table[k.to_sym] = self.class.new(v) elsif v.is_a?(Array) array = [] v.each do |v2| if v2.is_a?(Hash) array << self.class.new(v2) else array << v2 end end @table[k.to_sym] = array else @table[k.to_sym] = v end new_ostruct_member(k) end end end
require 'ostruct' # This is some code to create nested Structs from nested hash tables. # Code written by Andrea Pavoni, more information here: # http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash + # + # This has been slightly modified to work with hashes nested inside of arrays class DeepStruct < OpenStruct - def initialize(hash = nil) ? ^^^ + def initialize(hash = {}) ? ^^ @table = {} - @hash_table = {} - if hash - hash.each do |k,v| ? -- + hash.each do |k,v| - if v.is_a?(Hash) ? -- + if v.is_a?(Hash) - @table[k.to_sym] = self.class.new(v) ? -- + @table[k.to_sym] = self.class.new(v) - elsif v.is_a?(Array) ? -- + elsif v.is_a?(Array) - array = [] ? -- + array = [] - v.each do |v2| ? -- + v.each do |v2| - if v2.is_a?(Hash) ? -- + if v2.is_a?(Hash) - array << self.class.new(v2) ? -- + array << self.class.new(v2) - else ? -- + else - array << v2 ? -- + array << v2 - end end - @table[k.to_sym] = array - else - @table[k.to_sym] = v end + @table[k.to_sym] = array + else + @table[k.to_sym] = v + end - @hash_table[k.to_sym] = v - - new_ostruct_member(k) ? -- + new_ostruct_member(k) - end end end - - def to_h - @hash_table - end end
43
1.102564
18
25
ee5a3888608b550b3c60b3bfb8b55812d83117e0
install.sh
install.sh
if [ ! -d "$HOME/repos" ]; then echo 'Creating ~/repos directory' mkdir ~/repos fi cd ~/repos if [ ! -d "$HOME/repos/dotfiles" ]; then echo 'Cloning jimmay5469/dotfiles' git clone git@github.com:jimmay5469/dotfiles.git --origin jimmay5469 fi cd dotfiles source install/everything.sh
if [ ! -d "$HOME/repos" ]; then echo 'Creating ~/repos directory' mkdir ~/repos fi cd ~/repos if [ ! -d "$HOME/repos/dotfiles" ]; then echo 'Cloning jimmay5469/dotfiles' git clone https://github.com/jimmay5469/dotfiles.git --origin jimmay5469 cd dotfiles git remote set-url --push jimmay5469 git@github.com:jimmay5469/dotfiles.git else cd dotfiles fi source install/everything.sh
Use public git url for fetch
Use public git url for fetch
Shell
mit
jimmay5469/dotfiles
shell
## Code Before: if [ ! -d "$HOME/repos" ]; then echo 'Creating ~/repos directory' mkdir ~/repos fi cd ~/repos if [ ! -d "$HOME/repos/dotfiles" ]; then echo 'Cloning jimmay5469/dotfiles' git clone git@github.com:jimmay5469/dotfiles.git --origin jimmay5469 fi cd dotfiles source install/everything.sh ## Instruction: Use public git url for fetch ## Code After: if [ ! -d "$HOME/repos" ]; then echo 'Creating ~/repos directory' mkdir ~/repos fi cd ~/repos if [ ! -d "$HOME/repos/dotfiles" ]; then echo 'Cloning jimmay5469/dotfiles' git clone https://github.com/jimmay5469/dotfiles.git --origin jimmay5469 cd dotfiles git remote set-url --push jimmay5469 git@github.com:jimmay5469/dotfiles.git else cd dotfiles fi source install/everything.sh
if [ ! -d "$HOME/repos" ]; then echo 'Creating ~/repos directory' mkdir ~/repos fi cd ~/repos if [ ! -d "$HOME/repos/dotfiles" ]; then echo 'Cloning jimmay5469/dotfiles' - git clone git@github.com:jimmay5469/dotfiles.git --origin jimmay5469 ? ^^ ^ ^ + git clone https://github.com/jimmay5469/dotfiles.git --origin jimmay5469 ? ^ ^^^^^^ ^ + cd dotfiles + git remote set-url --push jimmay5469 git@github.com:jimmay5469/dotfiles.git + else + cd dotfiles fi - cd dotfiles source install/everything.sh
7
0.5
5
2
b43c6604163e18ae03c6ef206c4892e0beb873f7
django_cradmin/demo/uimock_demo/urls.py
django_cradmin/demo/uimock_demo/urls.py
from django.urls import path from django_cradmin import viewhelpers from .views import overview urlpatterns = [ path('simple/<str:mockname>', viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'), name='cradmin_uimock_demo_simple'), path('', overview.Overview.as_view(), name='cradmin_uimock_demo'), ]
from django.urls import path, re_path from django_cradmin import viewhelpers from .views import overview urlpatterns = [ re_path(r'^simple/(?P<mockname>.+)?$', viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'), name='cradmin_uimock_demo_simple'), path('', overview.Overview.as_view(), name='cradmin_uimock_demo'), ]
Fix url that was wrongly converted to django3.
Fix url that was wrongly converted to django3.
Python
bsd-3-clause
appressoas/django_cradmin,appressoas/django_cradmin,appressoas/django_cradmin
python
## Code Before: from django.urls import path from django_cradmin import viewhelpers from .views import overview urlpatterns = [ path('simple/<str:mockname>', viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'), name='cradmin_uimock_demo_simple'), path('', overview.Overview.as_view(), name='cradmin_uimock_demo'), ] ## Instruction: Fix url that was wrongly converted to django3. ## Code After: from django.urls import path, re_path from django_cradmin import viewhelpers from .views import overview urlpatterns = [ re_path(r'^simple/(?P<mockname>.+)?$', viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'), name='cradmin_uimock_demo_simple'), path('', overview.Overview.as_view(), name='cradmin_uimock_demo'), ]
- from django.urls import path + from django.urls import path, re_path ? +++++++++ from django_cradmin import viewhelpers from .views import overview urlpatterns = [ - path('simple/<str:mockname>', ? ---- + re_path(r'^simple/(?P<mockname>.+)?$', ? +++ + + +++ +++++ - viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'), + viewhelpers.uimock.UiMock.as_view(template_directory='uimock_demo/simple/'), ? +++ - name='cradmin_uimock_demo_simple'), + name='cradmin_uimock_demo_simple'), ? +++ path('', overview.Overview.as_view(), name='cradmin_uimock_demo'), ]
8
0.571429
4
4
7bbf168fedde801be3885b818e3d7c4c5d2deae7
app/connection/ejecter.js
app/connection/ejecter.js
'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); this.currentSeller = {}; this.sellerConnected = false; this.sellerAuth = false; return; } console.info('-> Eject user'); this.currentUser = {}; this.userConnected = false; this.basket = []; this.basketPromotions = []; this.totalCost = 0; this.totalReload = 0; this.detailedReloads = []; this.reloadMethod = 'card'; this.tab = null; } }; return ejecter; });
'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); this.currentSeller = {}; this.sellerConnected = false; this.sellerPasswordInput = ''; this.sellerAuth = false; return; } console.info('-> Eject user'); this.currentUser = {}; this.userConnected = false; this.basket = []; this.basketPromotions = []; this.totalCost = 0; this.totalReload = 0; this.detailedReloads = []; this.reloadMethod = 'card'; this.tab = null; } }; return ejecter; });
Reset seller password when eject
Reset seller password when eject
JavaScript
mit
buckutt/Eve-Client,buckutt/Eve-Client
javascript
## Code Before: 'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); this.currentSeller = {}; this.sellerConnected = false; this.sellerAuth = false; return; } console.info('-> Eject user'); this.currentUser = {}; this.userConnected = false; this.basket = []; this.basketPromotions = []; this.totalCost = 0; this.totalReload = 0; this.detailedReloads = []; this.reloadMethod = 'card'; this.tab = null; } }; return ejecter; }); ## Instruction: Reset seller password when eject ## Code After: 'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); this.currentSeller = {}; this.sellerConnected = false; this.sellerPasswordInput = ''; this.sellerAuth = false; return; } console.info('-> Eject user'); this.currentUser = {}; this.userConnected = false; this.basket = []; this.basketPromotions = []; this.totalCost = 0; this.totalReload = 0; this.detailedReloads = []; this.reloadMethod = 'card'; this.tab = null; } }; return ejecter; });
'use strict'; /* global define */ define('ejecter', () => { let ejecter = {}; ejecter.methods = { /** * Resets variables when user/seller disconnects */ onEject() { if (!this.userConnected) { console.info('-> Eject seller'); - this.currentSeller = {}; + this.currentSeller = {}; ? ++++ - this.sellerConnected = false; + this.sellerConnected = false; ? ++++ + this.sellerPasswordInput = ''; - this.sellerAuth = false; + this.sellerAuth = false; ? ++++ return; } console.info('-> Eject user'); this.currentUser = {}; this.userConnected = false; this.basket = []; this.basketPromotions = []; this.totalCost = 0; this.totalReload = 0; this.detailedReloads = []; this.reloadMethod = 'card'; this.tab = null; } }; return ejecter; });
7
0.194444
4
3
63241b7fb62166f4a31ef7ece38edf8b36129f63
dictionary/management/commands/writeLiblouisTables.py
dictionary/management/commands/writeLiblouisTables.py
from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables from the confirmed words in the dictionary' def handle(self, *args, **options): # write new global white lists if options['verbosity'] >= 2: self.stderr.write('Writing new global white lists...\n') writeWhiteListTables(Word.objects.filter(isConfirmed=True).filter(isLocal=False).order_by('untranslated')) # update local tables if options['verbosity'] >= 2: self.stderr.write('Updating local tables...\n') writeLocalTables(Document.objects.all())
from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables from the confirmed words in the dictionary' def handle(self, *args, **options): # write new global white lists verbosity = int(options['verbosity']) if verbosity >= 2: self.stderr.write('Writing new global white lists...\n') writeWhiteListTables(Word.objects.filter(isConfirmed=True).filter(isLocal=False).order_by('untranslated')) # update local tables if verbosity >= 2: self.stderr.write('Updating local tables...\n') writeLocalTables(Document.objects.all())
Make sure the verbosity stuff actually works
Make sure the verbosity stuff actually works
Python
agpl-3.0
sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer
python
## Code Before: from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables from the confirmed words in the dictionary' def handle(self, *args, **options): # write new global white lists if options['verbosity'] >= 2: self.stderr.write('Writing new global white lists...\n') writeWhiteListTables(Word.objects.filter(isConfirmed=True).filter(isLocal=False).order_by('untranslated')) # update local tables if options['verbosity'] >= 2: self.stderr.write('Updating local tables...\n') writeLocalTables(Document.objects.all()) ## Instruction: Make sure the verbosity stuff actually works ## Code After: from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables from the confirmed words in the dictionary' def handle(self, *args, **options): # write new global white lists verbosity = int(options['verbosity']) if verbosity >= 2: self.stderr.write('Writing new global white lists...\n') writeWhiteListTables(Word.objects.filter(isConfirmed=True).filter(isLocal=False).order_by('untranslated')) # update local tables if verbosity >= 2: self.stderr.write('Updating local tables...\n') writeLocalTables(Document.objects.all())
from daisyproducer.dictionary.brailleTables import writeWhiteListTables, writeLocalTables from daisyproducer.dictionary.models import Word from daisyproducer.documents.models import Document from django.core.management.base import BaseCommand class Command(BaseCommand): args = '' help = 'Write Liblouis tables from the confirmed words in the dictionary' def handle(self, *args, **options): # write new global white lists + verbosity = int(options['verbosity']) - if options['verbosity'] >= 2: ? --------- -- + if verbosity >= 2: self.stderr.write('Writing new global white lists...\n') writeWhiteListTables(Word.objects.filter(isConfirmed=True).filter(isLocal=False).order_by('untranslated')) # update local tables - if options['verbosity'] >= 2: ? --------- -- + if verbosity >= 2: self.stderr.write('Updating local tables...\n') writeLocalTables(Document.objects.all())
5
0.277778
3
2
5a198a270f5ef49e5d31847d15335f7a25c2992f
lib/smart_answer_flows/find-coronavirus-support/questions/need_help_with.erb
lib/smart_answer_flows/find-coronavirus-support/questions/need_help_with.erb
<% hide_caption true %> <% text_for :title do %> What do you need help with because of coronavirus? <% end %> <% text_for :hint do %> Select all that apply <% end %> <% options( "feeling_unsafe": "Feeling unsafe where you live, or what to do if you’re worried about the safety of another adult or child", "paying_bills": "Paying your rent, mortgage, or bills", "getting_food": "Getting food", "being_unemployed": "Being made redundant or unemployed, or not having any work", "going_to_work": "Being worried about working, or off work because you’re self-isolating", "somewhere_to_live": "Having somewhere to live", "mental_health": "Mental health and wellbeing, including information for children", "none": "Not sure", ) %> <% text_for :error_message do %> Select what you need to find help with, or ‘Not sure’ <% end %>
<% hide_caption true %> <% text_for :title do %> What do you need help with because of coronavirus? <% end %> <% text_for :hint do %> Select all that apply <% end %> <% options( "feeling_unsafe": "Feeling unsafe where you live, or what to do if you’re worried about the safety of another adult or child", "paying_bills": "Paying your rent, mortgage, or bills", "getting_food": "Getting food", "being_unemployed": "Being made redundant or unemployed, or not having any work", "going_to_work": "Being worried about working, or off work because you’re self-isolating", "somewhere_to_live": "Having somewhere to live", "mental_health": "Mental health and wellbeing, including information for children", "none": "None of these", ) %> <% text_for :error_message do %> Select what you need to find help with, or ‘None of these’ <% end %>
Change text for question option in find-support flow
Change text for question option in find-support flow This changes `Not sure` to `None of these` in the What do you need help with question. This is to make it quicker for users to reach the results page.
HTML+ERB
mit
alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers
html+erb
## Code Before: <% hide_caption true %> <% text_for :title do %> What do you need help with because of coronavirus? <% end %> <% text_for :hint do %> Select all that apply <% end %> <% options( "feeling_unsafe": "Feeling unsafe where you live, or what to do if you’re worried about the safety of another adult or child", "paying_bills": "Paying your rent, mortgage, or bills", "getting_food": "Getting food", "being_unemployed": "Being made redundant or unemployed, or not having any work", "going_to_work": "Being worried about working, or off work because you’re self-isolating", "somewhere_to_live": "Having somewhere to live", "mental_health": "Mental health and wellbeing, including information for children", "none": "Not sure", ) %> <% text_for :error_message do %> Select what you need to find help with, or ‘Not sure’ <% end %> ## Instruction: Change text for question option in find-support flow This changes `Not sure` to `None of these` in the What do you need help with question. This is to make it quicker for users to reach the results page. ## Code After: <% hide_caption true %> <% text_for :title do %> What do you need help with because of coronavirus? <% end %> <% text_for :hint do %> Select all that apply <% end %> <% options( "feeling_unsafe": "Feeling unsafe where you live, or what to do if you’re worried about the safety of another adult or child", "paying_bills": "Paying your rent, mortgage, or bills", "getting_food": "Getting food", "being_unemployed": "Being made redundant or unemployed, or not having any work", "going_to_work": "Being worried about working, or off work because you’re self-isolating", "somewhere_to_live": "Having somewhere to live", "mental_health": "Mental health and wellbeing, including information for children", "none": "None of these", ) %> <% text_for :error_message do %> Select what you need to find help with, or ‘None of these’ <% end %>
<% hide_caption true %> <% text_for :title do %> What do you need help with because of coronavirus? <% end %> <% text_for :hint do %> Select all that apply <% end %> <% options( "feeling_unsafe": "Feeling unsafe where you live, or what to do if you’re worried about the safety of another adult or child", "paying_bills": "Paying your rent, mortgage, or bills", "getting_food": "Getting food", "being_unemployed": "Being made redundant or unemployed, or not having any work", "going_to_work": "Being worried about working, or off work because you’re self-isolating", "somewhere_to_live": "Having somewhere to live", "mental_health": "Mental health and wellbeing, including information for children", - "none": "Not sure", ? ^ -- + "none": "None of these", ? ++++++ ^^ ) %> <% text_for :error_message do %> - Select what you need to find help with, or ‘Not sure’ ? ^ -- + Select what you need to find help with, or ‘None of these’ ? ++++++ ^^ <% end %>
4
0.166667
2
2
d123a6fae46cedafeae851cea968b2179674d9d4
ReactCommon/hermes/inspector/tools/sandcastle/setup.sh
ReactCommon/hermes/inspector/tools/sandcastle/setup.sh
set -x set -e set -o pipefail THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT_DIR=$(cd "$THIS_DIR" && hg root) # Buck by default uses clang-3.6 from /opt/local/bin. # Override it to use system clang. export PATH="/usr/bin:$PATH" # Enter xplat cd "$ROOT_DIR"/xplat || exit 1 # Setup env export TITLE TITLE=$(hg log -l 1 --template "{desc|strip|firstline}") export REV REV=$(hg log -l 1 --template "{node}") export AUTHOR AUTHOR=$(hg log -l 1 --template "{author|emailuser}") if [ -n "$SANDCASTLE" ]; then source automation/setup_buck.sh fi
set -x set -e set -o pipefail THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT_DIR=$(cd "$THIS_DIR" && hg root) # Enter xplat cd "$ROOT_DIR"/xplat || exit 1 # Setup env export TITLE TITLE=$(hg log -l 1 --template "{desc|strip|firstline}") export REV REV=$(hg log -l 1 --template "{node}") export AUTHOR AUTHOR=$(hg log -l 1 --template "{author|emailuser}") if [ -n "$SANDCASTLE" ]; then source automation/setup_buck.sh fi
Stop forcing /usr/bin to the front of the path
Stop forcing /usr/bin to the front of the path Summary: This messes with python version selection. At least based on the comments, it is no longer needed, as /opt/local/bin appears to be empty on my devserver and on a sandcastle host. D32337004 revealed the problem. T105920600 has some more context. I couldn't repro locally, so D32451858 is a control (which I expect to fail tests) to confirm that this fixes the test failures. #utd-hermes Reviewed By: neildhar Differential Revision: D32451851 fbshipit-source-id: 4c9c04571154d9ce4e5a3059d98e043865b76f78
Shell
mit
facebook/react-native,janicduplessis/react-native,facebook/react-native,janicduplessis/react-native,facebook/react-native,javache/react-native,facebook/react-native,javache/react-native,facebook/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,javache/react-native,javache/react-native,facebook/react-native,javache/react-native,facebook/react-native,javache/react-native,janicduplessis/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,janicduplessis/react-native
shell
## Code Before: set -x set -e set -o pipefail THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT_DIR=$(cd "$THIS_DIR" && hg root) # Buck by default uses clang-3.6 from /opt/local/bin. # Override it to use system clang. export PATH="/usr/bin:$PATH" # Enter xplat cd "$ROOT_DIR"/xplat || exit 1 # Setup env export TITLE TITLE=$(hg log -l 1 --template "{desc|strip|firstline}") export REV REV=$(hg log -l 1 --template "{node}") export AUTHOR AUTHOR=$(hg log -l 1 --template "{author|emailuser}") if [ -n "$SANDCASTLE" ]; then source automation/setup_buck.sh fi ## Instruction: Stop forcing /usr/bin to the front of the path Summary: This messes with python version selection. At least based on the comments, it is no longer needed, as /opt/local/bin appears to be empty on my devserver and on a sandcastle host. D32337004 revealed the problem. T105920600 has some more context. I couldn't repro locally, so D32451858 is a control (which I expect to fail tests) to confirm that this fixes the test failures. #utd-hermes Reviewed By: neildhar Differential Revision: D32451851 fbshipit-source-id: 4c9c04571154d9ce4e5a3059d98e043865b76f78 ## Code After: set -x set -e set -o pipefail THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT_DIR=$(cd "$THIS_DIR" && hg root) # Enter xplat cd "$ROOT_DIR"/xplat || exit 1 # Setup env export TITLE TITLE=$(hg log -l 1 --template "{desc|strip|firstline}") export REV REV=$(hg log -l 1 --template "{node}") export AUTHOR AUTHOR=$(hg log -l 1 --template "{author|emailuser}") if [ -n "$SANDCASTLE" ]; then source automation/setup_buck.sh fi
set -x set -e set -o pipefail THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT_DIR=$(cd "$THIS_DIR" && hg root) - - # Buck by default uses clang-3.6 from /opt/local/bin. - # Override it to use system clang. - export PATH="/usr/bin:$PATH" # Enter xplat cd "$ROOT_DIR"/xplat || exit 1 # Setup env export TITLE TITLE=$(hg log -l 1 --template "{desc|strip|firstline}") export REV REV=$(hg log -l 1 --template "{node}") export AUTHOR AUTHOR=$(hg log -l 1 --template "{author|emailuser}") if [ -n "$SANDCASTLE" ]; then source automation/setup_buck.sh fi
4
0.153846
0
4
42434385fdb195b68b4702bde9ed573c96628685
test/prey_fetcher_test.rb
test/prey_fetcher_test.rb
ENV['RACK_ENV'] = 'test' require File.join(File.dirname(__FILE__), '../', "prey_fetcher.rb") require 'test/unit' require 'rack/test' class PreyFetcherTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_homepage_works_as_anonymous get '/' assert last_response.ok? end def test_account_fails_as_anonymous get '/account' assert !last_response.ok? put '/account' assert !last_response.ok? delete '/account' assert !last_response.ok? put '/lists' assert !last_response.ok? end def test_logout_works flunk 'Test is incomplete (requires sessions).' put '/login', {}, {:oauth_token => 'l9Ep677tgatsLlSc7PcJbMyXR41bVRwSTI1zLSrc', :oauth_verifier => '7T2JZoWeQCDAqiRnPCDuxki2LmsQAiUZ57bTSHaNbY'} assert session[:logged_in] get '/logout' follow_redirect! assert last_response.ok? assert !session[:logged_in] end def test_logout_fails_as_anonymous get '/logout' assert !last_response.ok? end end
ENV['RACK_ENV'] = 'test' require File.join(File.dirname(__FILE__), '../', "web.rb") require 'test/unit' require 'rack/test' class PreyFetcherTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_homepage_works_as_anonymous get '/' assert last_response.ok? end def test_account_fails_as_anonymous get '/account' assert !last_response.ok? put '/account' assert !last_response.ok? delete '/account' assert !last_response.ok? put '/lists' assert !last_response.ok? end def test_logout_fails_as_anonymous get '/logout' assert !last_response.ok? end end
Remove cruddy tests; this needs some love
Remove cruddy tests; this needs some love
Ruby
mit
tofumatt/Prey-Fetcher,tofumatt/Prey-Fetcher
ruby
## Code Before: ENV['RACK_ENV'] = 'test' require File.join(File.dirname(__FILE__), '../', "prey_fetcher.rb") require 'test/unit' require 'rack/test' class PreyFetcherTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_homepage_works_as_anonymous get '/' assert last_response.ok? end def test_account_fails_as_anonymous get '/account' assert !last_response.ok? put '/account' assert !last_response.ok? delete '/account' assert !last_response.ok? put '/lists' assert !last_response.ok? end def test_logout_works flunk 'Test is incomplete (requires sessions).' put '/login', {}, {:oauth_token => 'l9Ep677tgatsLlSc7PcJbMyXR41bVRwSTI1zLSrc', :oauth_verifier => '7T2JZoWeQCDAqiRnPCDuxki2LmsQAiUZ57bTSHaNbY'} assert session[:logged_in] get '/logout' follow_redirect! assert last_response.ok? assert !session[:logged_in] end def test_logout_fails_as_anonymous get '/logout' assert !last_response.ok? end end ## Instruction: Remove cruddy tests; this needs some love ## Code After: ENV['RACK_ENV'] = 'test' require File.join(File.dirname(__FILE__), '../', "web.rb") require 'test/unit' require 'rack/test' class PreyFetcherTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_homepage_works_as_anonymous get '/' assert last_response.ok? end def test_account_fails_as_anonymous get '/account' assert !last_response.ok? put '/account' assert !last_response.ok? delete '/account' assert !last_response.ok? put '/lists' assert !last_response.ok? end def test_logout_fails_as_anonymous get '/logout' assert !last_response.ok? end end
ENV['RACK_ENV'] = 'test' - require File.join(File.dirname(__FILE__), '../', "prey_fetcher.rb") ? ^^ ^^^^^^^^^ + require File.join(File.dirname(__FILE__), '../', "web.rb") ? ^ ^ require 'test/unit' require 'rack/test' class PreyFetcherTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_homepage_works_as_anonymous get '/' assert last_response.ok? end def test_account_fails_as_anonymous get '/account' assert !last_response.ok? put '/account' assert !last_response.ok? delete '/account' assert !last_response.ok? put '/lists' assert !last_response.ok? end - def test_logout_works - flunk 'Test is incomplete (requires sessions).' - - put '/login', {}, {:oauth_token => 'l9Ep677tgatsLlSc7PcJbMyXR41bVRwSTI1zLSrc', :oauth_verifier => '7T2JZoWeQCDAqiRnPCDuxki2LmsQAiUZ57bTSHaNbY'} - - assert session[:logged_in] - - get '/logout' - follow_redirect! - assert last_response.ok? - assert !session[:logged_in] - end - def test_logout_fails_as_anonymous get '/logout' assert !last_response.ok? end end
15
0.3125
1
14
937bbd74f1d31de51c8820962fc8d1fd016e3cbd
db/migrate/20151029211234_create_groups.rb
db/migrate/20151029211234_create_groups.rb
class CreateGroups < ActiveRecord::Migration def change create_table :groups do |t| t.string :number, null: false t.string :street, null: false t.string :city, null: false t.string :zip_code, null: false t.timestamps null: false end end end
class CreateGroups < ActiveRecord::Migration def change create_table :groups do |t| t.string :primary_number, null: false t.string :street_name, null: false t.string :street_suffix, null: false t.string :city_name, null: false t.string :state_abbreviation, null: false t.string :zipcode, null: false t.timestamps null: false end end end
Change the schema for the groups table to conform to the data returned by the Smarty Street API.
Change the schema for the groups table to conform to the data returned by the Smarty Street API.
Ruby
mit
nyc-mud-turtles-2015/nghborly,kimchanyoung/nghborly,nyc-mud-turtles-2015/nghborly,kimchanyoung/nghborly,nyc-mud-turtles-2015/nghborly,kimchanyoung/nghborly
ruby
## Code Before: class CreateGroups < ActiveRecord::Migration def change create_table :groups do |t| t.string :number, null: false t.string :street, null: false t.string :city, null: false t.string :zip_code, null: false t.timestamps null: false end end end ## Instruction: Change the schema for the groups table to conform to the data returned by the Smarty Street API. ## Code After: class CreateGroups < ActiveRecord::Migration def change create_table :groups do |t| t.string :primary_number, null: false t.string :street_name, null: false t.string :street_suffix, null: false t.string :city_name, null: false t.string :state_abbreviation, null: false t.string :zipcode, null: false t.timestamps null: false end end end
class CreateGroups < ActiveRecord::Migration def change create_table :groups do |t| - t.string :number, null: false + t.string :primary_number, null: false ? + ++++++++ ++ - t.string :street, null: false + t.string :street_name, null: false ? +++++ +++++ + t.string :street_suffix, null: false - t.string :city, null: false + t.string :city_name, null: false ? +++++ +++++ + t.string :state_abbreviation, null: false - t.string :zip_code, null: false ? - + t.string :zipcode, null: false ? + +++++++++++ t.timestamps null: false end end end
10
0.833333
6
4
708eae106280b838c8227affc0b01289899b0bdb
src/app/styles/components/layout/_header.scss
src/app/styles/components/layout/_header.scss
.header { // see also .project__description width: 100%; height: $layout-header-height; background: $black-05; position: absolute; } .header__container { position: relative; display: flex; } .header__app-link { display: flex; align-items: center; img { width: 64px; height: 28px; } } .header__team { display: flex; } .header__breadcrumb { svg path { color: $black-54; } } // media page .header--media { .team-header__copy { display: none; } }
.header { // see also .project__description width: 100%; height: $layout-header-height; background: $black-05; position: absolute; } .header__container { position: relative; display: flex; height: 100%; } .header__app-link { display: flex; align-items: center; img { width: 64px; height: 28px; } } .header__team { display: flex; } .header__breadcrumb { svg path { color: $black-54; } } // media page .header--media { .team-header__copy { display: none; } }
Fix style bug in default page header
Fix style bug in default page header
SCSS
mit
meedan/check-web,meedan/check-web,meedan/check-web
scss
## Code Before: .header { // see also .project__description width: 100%; height: $layout-header-height; background: $black-05; position: absolute; } .header__container { position: relative; display: flex; } .header__app-link { display: flex; align-items: center; img { width: 64px; height: 28px; } } .header__team { display: flex; } .header__breadcrumb { svg path { color: $black-54; } } // media page .header--media { .team-header__copy { display: none; } } ## Instruction: Fix style bug in default page header ## Code After: .header { // see also .project__description width: 100%; height: $layout-header-height; background: $black-05; position: absolute; } .header__container { position: relative; display: flex; height: 100%; } .header__app-link { display: flex; align-items: center; img { width: 64px; height: 28px; } } .header__team { display: flex; } .header__breadcrumb { svg path { color: $black-54; } } // media page .header--media { .team-header__copy { display: none; } }
.header { // see also .project__description width: 100%; height: $layout-header-height; background: $black-05; position: absolute; } .header__container { position: relative; display: flex; + height: 100%; } .header__app-link { display: flex; align-items: center; img { width: 64px; height: 28px; } } .header__team { display: flex; } .header__breadcrumb { svg path { color: $black-54; } } // media page .header--media { .team-header__copy { display: none; } }
1
0.026316
1
0
9baae9f7b359c0f5dabbd15b02c87d4571b14adb
.travis.yml
.travis.yml
language: ruby rvm: - 2.1 - 2.2 - 2.3 - 2.4.0 before_install: - gem install bundler install: - bundle install script: - bundle exec rake - bundle exec appraisal install - bundle exec rake appraisal
language: ruby rvm: - 2.1 - 2.2 - 2.3 - 2.4.0 before_install: - gem install bundler install: - bundle install --jobs=3 --retry=3 script: - bundle exec rake - bundle exec appraisal install - bundle exec rake appraisal
Add retry flag to bundle install for Travis
Add retry flag to bundle install for Travis This should make the build more resilient to network timeouts.
YAML
mit
postrank-labs/postrank-uri,swiftype/postrank-uri
yaml
## Code Before: language: ruby rvm: - 2.1 - 2.2 - 2.3 - 2.4.0 before_install: - gem install bundler install: - bundle install script: - bundle exec rake - bundle exec appraisal install - bundle exec rake appraisal ## Instruction: Add retry flag to bundle install for Travis This should make the build more resilient to network timeouts. ## Code After: language: ruby rvm: - 2.1 - 2.2 - 2.3 - 2.4.0 before_install: - gem install bundler install: - bundle install --jobs=3 --retry=3 script: - bundle exec rake - bundle exec appraisal install - bundle exec rake appraisal
language: ruby rvm: - 2.1 - 2.2 - 2.3 - 2.4.0 before_install: - gem install bundler install: - - bundle install + - bundle install --jobs=3 --retry=3 script: - bundle exec rake - bundle exec appraisal install - bundle exec rake appraisal
2
0.142857
1
1
0b1a9f36b9a3ab883fe24e45a4723170f0104888
lib/templates/routes.rb.erb
lib/templates/routes.rb.erb
<%= @name.camelize %>::Application.routes.draw do root to: 'home#index' end
<%= @name.gsub(/-/, '_').camelize %>::Application.routes.draw do root to: 'home#index' end
Fix routes file when using - in app name
Fix routes file when using - in app name refs #9
HTML+ERB
mit
jasnow/highgroove-generator
html+erb
## Code Before: <%= @name.camelize %>::Application.routes.draw do root to: 'home#index' end ## Instruction: Fix routes file when using - in app name refs #9 ## Code After: <%= @name.gsub(/-/, '_').camelize %>::Application.routes.draw do root to: 'home#index' end
- <%= @name.camelize %>::Application.routes.draw do + <%= @name.gsub(/-/, '_').camelize %>::Application.routes.draw do ? +++++++++++++++ root to: 'home#index' end
2
0.666667
1
1
876d08fc3b0b8ca555e2c34bd2a70a5ff69bb365
modules/lang/nix/config.el
modules/lang/nix/config.el
;;; lang/nix/config.el -*- lexical-binding: t; -*- (use-package! nix-mode :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode) :mode "\\.nix\\'" :config (set-repl-handler! 'nix-mode #'+nix/open-repl) (set-company-backend! 'nix-mode 'company-nixos-options) (set-lookup-handlers! 'nix-mode :documentation '(+nix/lookup-option :async t)) (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t) (map! :localleader :map nix-mode-map "f" #'nix-update-fetch "p" #'nix-format-buffer "r" #'nix-repl-show "s" #'nix-shell "b" #'nix-build "u" #'nix-unpack "o" #'+nix/lookup-option)) (use-package! nix-drv-mode :mode "\\.drv\\'") (use-package! nix-update :commands nix-update-fetch) (use-package! nix-repl :commands nix-repl-show)
;;; lang/nix/config.el -*- lexical-binding: t; -*- (after! tramp (add-to-list 'tramp-remote-path "/run/current-system/sw/bin")) ;; ;;; Plugins (use-package! nix-mode :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode) :mode "\\.nix\\'" :config (set-repl-handler! 'nix-mode #'+nix/open-repl) (set-company-backend! 'nix-mode 'company-nixos-options) (set-lookup-handlers! 'nix-mode :documentation '(+nix/lookup-option :async t)) (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t) (map! :localleader :map nix-mode-map "f" #'nix-update-fetch "p" #'nix-format-buffer "r" #'nix-repl-show "s" #'nix-shell "b" #'nix-build "u" #'nix-unpack "o" #'+nix/lookup-option)) (use-package! nix-drv-mode :mode "\\.drv\\'") (use-package! nix-update :commands nix-update-fetch) (use-package! nix-repl :commands nix-repl-show)
Add nix bin path to tramp-remote-path
Add nix bin path to tramp-remote-path
Emacs Lisp
mit
hlissner/.emacs.d,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/.emacs.d,hlissner/.emacs.d,hlissner/.emacs.d,hlissner/doom-emacs,hlissner/doom-emacs
emacs-lisp
## Code Before: ;;; lang/nix/config.el -*- lexical-binding: t; -*- (use-package! nix-mode :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode) :mode "\\.nix\\'" :config (set-repl-handler! 'nix-mode #'+nix/open-repl) (set-company-backend! 'nix-mode 'company-nixos-options) (set-lookup-handlers! 'nix-mode :documentation '(+nix/lookup-option :async t)) (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t) (map! :localleader :map nix-mode-map "f" #'nix-update-fetch "p" #'nix-format-buffer "r" #'nix-repl-show "s" #'nix-shell "b" #'nix-build "u" #'nix-unpack "o" #'+nix/lookup-option)) (use-package! nix-drv-mode :mode "\\.drv\\'") (use-package! nix-update :commands nix-update-fetch) (use-package! nix-repl :commands nix-repl-show) ## Instruction: Add nix bin path to tramp-remote-path ## Code After: ;;; lang/nix/config.el -*- lexical-binding: t; -*- (after! tramp (add-to-list 'tramp-remote-path "/run/current-system/sw/bin")) ;; ;;; Plugins (use-package! nix-mode :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode) :mode "\\.nix\\'" :config (set-repl-handler! 'nix-mode #'+nix/open-repl) (set-company-backend! 'nix-mode 'company-nixos-options) (set-lookup-handlers! 'nix-mode :documentation '(+nix/lookup-option :async t)) (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t) (map! :localleader :map nix-mode-map "f" #'nix-update-fetch "p" #'nix-format-buffer "r" #'nix-repl-show "s" #'nix-shell "b" #'nix-build "u" #'nix-unpack "o" #'+nix/lookup-option)) (use-package! nix-drv-mode :mode "\\.drv\\'") (use-package! nix-update :commands nix-update-fetch) (use-package! nix-repl :commands nix-repl-show)
;;; lang/nix/config.el -*- lexical-binding: t; -*- + + (after! tramp + (add-to-list 'tramp-remote-path "/run/current-system/sw/bin")) + + + ;; + ;;; Plugins (use-package! nix-mode :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode) :mode "\\.nix\\'" :config (set-repl-handler! 'nix-mode #'+nix/open-repl) (set-company-backend! 'nix-mode 'company-nixos-options) (set-lookup-handlers! 'nix-mode :documentation '(+nix/lookup-option :async t)) (set-popup-rule! "^\\*nixos-options-doc\\*$" :ttl 0 :quit t) (map! :localleader :map nix-mode-map "f" #'nix-update-fetch "p" #'nix-format-buffer "r" #'nix-repl-show "s" #'nix-shell "b" #'nix-build "u" #'nix-unpack "o" #'+nix/lookup-option)) (use-package! nix-drv-mode :mode "\\.drv\\'") (use-package! nix-update :commands nix-update-fetch) (use-package! nix-repl :commands nix-repl-show)
7
0.233333
7
0
f6f8d350b4f79739829212b0d29e38036507d370
README.md
README.md
This repository aims to aggregate the most noticeable differences between C, Python and R from the perspective of a student of statistics graduation degree. ### Focusing on a subset from the program of the discipline "Introduction to Computer Science" to statistics * Program structures: - decision - repetition * Modularization programs: - procedures - functions - parameter passing * Simple data types and compounds: - vectors - matrices - strings - records - sets ------------ # Para aprender as diferenças entre C, Python e R Esse repositório visa agregar as diferenças mais notáveis entre C, Python e R da perspectiva de um estudante de graduação em estatística. ### Focando em um subconjunto do programa da disciplina de introdução á Ciência da Computação para estatística * Estruturas de programas: - decisão - repetição * Modularização de programas: - procedimentos - funções - passagem de parâmetros * Tipos de dados simples e compostos: - vetores - matrizes - cadeias de caracteres - Registros - conjuntos
This repository aims to aggregate the most noticeable differences between C, Python and R from the perspective of a student of statistics graduation degree. ### Focusing on a subset from the program of the discipline "Introduction to Computer Science" to statistics * Program structures: - decision - repetition * Modularization programs: - procedures - functions - parameter passing * Simple data types and compounds: - vectors - matrices - strings - records - sets ------------ # Para aprender as diferenças entre C, Python e R Esse repositório visa agregar as diferenças mais notáveis entre C, Python e R da perspectiva de um estudante de graduação em estatística. É assumido conhecimento prévio em qualquer uma das linguagens, preferencialmente C, a ideia não é listar um conteúdo exaustivo, mas sim apenas familiarizar o leitor nos seus primeiros passos no processo de estudo da nova linguagem desejada. ### Focando em um subconjunto do programa da disciplina de introdução á Ciência da Computação para estatística * Estruturas de programas: - decisão - repetição * Modularização de programas: - procedimentos - funções - passagem de parâmetros * Tipos de dados simples e compostos: - vetores - matrizes - cadeias de caracteres - Registros - conjuntos
Add expected knowledge about C/Python or R
Add expected knowledge about C/Python or R [br-only]
Markdown
mit
jhonatancasale/c-python-r-diffs,jhonatancasale/c-python-r-diffs,jhonatancasale/c-python-r-diffs
markdown
## Code Before: This repository aims to aggregate the most noticeable differences between C, Python and R from the perspective of a student of statistics graduation degree. ### Focusing on a subset from the program of the discipline "Introduction to Computer Science" to statistics * Program structures: - decision - repetition * Modularization programs: - procedures - functions - parameter passing * Simple data types and compounds: - vectors - matrices - strings - records - sets ------------ # Para aprender as diferenças entre C, Python e R Esse repositório visa agregar as diferenças mais notáveis entre C, Python e R da perspectiva de um estudante de graduação em estatística. ### Focando em um subconjunto do programa da disciplina de introdução á Ciência da Computação para estatística * Estruturas de programas: - decisão - repetição * Modularização de programas: - procedimentos - funções - passagem de parâmetros * Tipos de dados simples e compostos: - vetores - matrizes - cadeias de caracteres - Registros - conjuntos ## Instruction: Add expected knowledge about C/Python or R [br-only] ## Code After: This repository aims to aggregate the most noticeable differences between C, Python and R from the perspective of a student of statistics graduation degree. ### Focusing on a subset from the program of the discipline "Introduction to Computer Science" to statistics * Program structures: - decision - repetition * Modularization programs: - procedures - functions - parameter passing * Simple data types and compounds: - vectors - matrices - strings - records - sets ------------ # Para aprender as diferenças entre C, Python e R Esse repositório visa agregar as diferenças mais notáveis entre C, Python e R da perspectiva de um estudante de graduação em estatística. É assumido conhecimento prévio em qualquer uma das linguagens, preferencialmente C, a ideia não é listar um conteúdo exaustivo, mas sim apenas familiarizar o leitor nos seus primeiros passos no processo de estudo da nova linguagem desejada. ### Focando em um subconjunto do programa da disciplina de introdução á Ciência da Computação para estatística * Estruturas de programas: - decisão - repetição * Modularização de programas: - procedimentos - funções - passagem de parâmetros * Tipos de dados simples e compostos: - vetores - matrizes - cadeias de caracteres - Registros - conjuntos
This repository aims to aggregate the most noticeable differences between C, Python and R from the perspective of a student of statistics graduation degree. ### Focusing on a subset from the program of the discipline "Introduction to Computer Science" to statistics * Program structures: - decision - repetition * Modularization programs: - procedures - functions - parameter passing * Simple data types and compounds: - vectors - matrices - strings - records - sets ------------ # Para aprender as diferenças entre C, Python e R - Esse repositório visa agregar as diferenças mais notáveis entre C, Python e R da perspectiva de um estudante de graduação em estatística. + Esse repositório visa agregar as diferenças mais notáveis entre C, Python e R + da perspectiva de um estudante de graduação em estatística. + + É assumido conhecimento prévio em qualquer uma das linguagens, + preferencialmente C, a ideia não é listar um conteúdo exaustivo, mas sim apenas + familiarizar o leitor nos seus primeiros passos no processo de estudo da nova + linguagem desejada. ### Focando em um subconjunto do programa da disciplina de introdução á Ciência da Computação para estatística * Estruturas de programas: - decisão - repetição * Modularização de programas: - procedimentos - funções - passagem de parâmetros * Tipos de dados simples e compostos: - vetores - matrizes - cadeias de caracteres - Registros - conjuntos
8
0.222222
7
1
a98475d59063d4c88275265930e8a5d6541d512d
README.md
README.md
coretest_hashes =============== The coretest system combined with cryptographic hash functions.
coretest_hashes =============== The coretest system combined with cryptographic hash functions. ## Introduction ## This is a HW subsystem that includes the coretest module connected to a uart for external access and to hash function cores. The first version includes the SHA-1 and SHA-256 cores. ## Status ## ***(2014-03-07)*** Initial version. Build using Altera Quarus 13.1. In Cyclone5 the design occupys 2847 ALMs and 3665 registers. The design can achieve at least 86 MHz.
Update with info on what the repo contains and some implementation details.
Update with info on what the repo contains and some implementation details.
Markdown
bsd-2-clause
secworks/coretest_hashes,secworks/coretest_hashes
markdown
## Code Before: coretest_hashes =============== The coretest system combined with cryptographic hash functions. ## Instruction: Update with info on what the repo contains and some implementation details. ## Code After: coretest_hashes =============== The coretest system combined with cryptographic hash functions. ## Introduction ## This is a HW subsystem that includes the coretest module connected to a uart for external access and to hash function cores. The first version includes the SHA-1 and SHA-256 cores. ## Status ## ***(2014-03-07)*** Initial version. Build using Altera Quarus 13.1. In Cyclone5 the design occupys 2847 ALMs and 3665 registers. The design can achieve at least 86 MHz.
coretest_hashes =============== The coretest system combined with cryptographic hash functions. + + ## Introduction ## + This is a HW subsystem that includes the coretest module connected to a + uart for external access and to hash function cores. The first version + includes the SHA-1 and SHA-256 cores. + + ## Status ## + ***(2014-03-07)*** + Initial version. Build using Altera Quarus 13.1. + + In Cyclone5 the design occupys 2847 ALMs and 3665 registers. The design + can achieve at least 86 MHz. + +
14
3.5
14
0
5a7d405d3e4a7f771768ff450c55fbb3f2f7b18b
_config.yml
_config.yml
name: Portfolio description: Patrick Cate's Portfolio markdown: kramdown highlighter: pygments relative_permalinks: true doctor: true url: http://portfolio.patrickcate.com timezone: America/New_York source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts include: ['.htaccess'] # Serving port: 3000 host: localhost gems: [ 'jekyll_version_plugin' ] sitemap: file: '/sitemap.xml' picture: markup: 'picture' source: '_source/images' output: 'images' presets: default: ppi: [1, 1.5, 2.0] attr: class: "img" # source_large: # width: '720' # media: '(min-width: 720)' # source_medium: # width: '640' # media: '(min-width: 640px)' source_default: width: '640' collections: - project exclude: [ '*.json', '*.log', '*.map', '*.zip', '*.sublime-project', '*.sublime-workspace', 'config.rb', 'Gemfile', 'Gemfile.lock', 'grunt', 'Gruntfile.js', 'gulpfile.js', 'node_modules', 'sass', ]
name: Portfolio description: Patrick Cate's Portfolio markdown: kramdown highlighter: pygments relative_permalinks: true doctor: true url: http://portfolio.patrickcate.com timezone: America/New_York source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts include: [ '.htaccess', 'jquery-1.11.1.min.js', 'parsley.min.js', 'scripts.min.js', 'respond.min.js' ] # Serving port: 3000 host: localhost gems: [ 'jekyll_version_plugin' ] sitemap: file: '/sitemap.xml' picture: markup: 'picture' source: '_source/images' output: 'images' presets: default: ppi: [1, 1.5, 2.0] attr: class: "img" # source_large: # width: '720' # media: '(min-width: 720)' # source_medium: # width: '640' # media: '(min-width: 640px)' source_default: width: '640' collections: - project exclude: [ '*.json', '*.log', '*.map', '*.zip', 'js/*.js', '*.sublime-project', '*.sublime-workspace', 'config.rb', 'Gemfile', 'Gemfile.lock', 'grunt', 'Gruntfile.js', 'gulpfile.js', 'node_modules', 'sass', ]
Exclude unused js files from jekyll.
Exclude unused js files from jekyll.
YAML
mit
patrickcate/portfolio,patrickcate/portfolio,patrickcate/portfolio
yaml
## Code Before: name: Portfolio description: Patrick Cate's Portfolio markdown: kramdown highlighter: pygments relative_permalinks: true doctor: true url: http://portfolio.patrickcate.com timezone: America/New_York source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts include: ['.htaccess'] # Serving port: 3000 host: localhost gems: [ 'jekyll_version_plugin' ] sitemap: file: '/sitemap.xml' picture: markup: 'picture' source: '_source/images' output: 'images' presets: default: ppi: [1, 1.5, 2.0] attr: class: "img" # source_large: # width: '720' # media: '(min-width: 720)' # source_medium: # width: '640' # media: '(min-width: 640px)' source_default: width: '640' collections: - project exclude: [ '*.json', '*.log', '*.map', '*.zip', '*.sublime-project', '*.sublime-workspace', 'config.rb', 'Gemfile', 'Gemfile.lock', 'grunt', 'Gruntfile.js', 'gulpfile.js', 'node_modules', 'sass', ] ## Instruction: Exclude unused js files from jekyll. ## Code After: name: Portfolio description: Patrick Cate's Portfolio markdown: kramdown highlighter: pygments relative_permalinks: true doctor: true url: http://portfolio.patrickcate.com timezone: America/New_York source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts include: [ '.htaccess', 'jquery-1.11.1.min.js', 'parsley.min.js', 'scripts.min.js', 'respond.min.js' ] # Serving port: 3000 host: localhost gems: [ 'jekyll_version_plugin' ] sitemap: file: '/sitemap.xml' picture: markup: 'picture' source: '_source/images' output: 'images' presets: default: ppi: [1, 1.5, 2.0] attr: class: "img" # source_large: # width: '720' # media: '(min-width: 720)' # source_medium: # width: '640' # media: '(min-width: 640px)' source_default: width: '640' collections: - project exclude: [ '*.json', '*.log', '*.map', '*.zip', 'js/*.js', '*.sublime-project', '*.sublime-workspace', 'config.rb', 'Gemfile', 'Gemfile.lock', 'grunt', 'Gruntfile.js', 'gulpfile.js', 'node_modules', 'sass', ]
name: Portfolio description: Patrick Cate's Portfolio markdown: kramdown highlighter: pygments relative_permalinks: true doctor: true url: http://portfolio.patrickcate.com timezone: America/New_York source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts - include: ['.htaccess'] + include: [ + '.htaccess', + 'jquery-1.11.1.min.js', + 'parsley.min.js', + 'scripts.min.js', + 'respond.min.js' + ] # Serving port: 3000 host: localhost gems: [ 'jekyll_version_plugin' ] sitemap: file: '/sitemap.xml' picture: markup: 'picture' source: '_source/images' output: 'images' presets: default: ppi: [1, 1.5, 2.0] attr: class: "img" # source_large: # width: '720' # media: '(min-width: 720)' # source_medium: # width: '640' # media: '(min-width: 640px)' source_default: width: '640' collections: - project exclude: [ '*.json', '*.log', '*.map', '*.zip', + 'js/*.js', '*.sublime-project', '*.sublime-workspace', 'config.rb', 'Gemfile', 'Gemfile.lock', 'grunt', 'Gruntfile.js', 'gulpfile.js', 'node_modules', 'sass', ]
9
0.142857
8
1
595f10653f46c917ae1b6ff52b4eec668ae023fc
app/views/spree/api/products/show.v1.rabl
app/views/spree/api/products/show.v1.rabl
object @product cache [I18n.locale, @current_user_roles.include?('admin'), current_currency, root_object] attributes *product_attributes node(:display_price) { |p| p.display_price.to_s } node(:strike_price) { |p| p.strike_price.to_s } node(:has_variants) { |p| p.has_variants? } child :master => :master do extends "spree/api/variants/small" end child :variants => :variants do extends "spree/api/variants/small" end child :option_types => :option_types do attributes *option_type_attributes end child :product_properties => :product_properties do attributes *product_property_attributes end
object @product attributes *product_attributes node(:display_price) { |p| p.display_price.to_s } node(:strike_price) { |p| p.strike_price.to_s } node(:has_variants) { |p| p.has_variants? } child :master => :master do extends "spree/api/variants/small" end child :variants => :variants do extends "spree/api/variants/small" end child :option_types => :option_types do attributes *option_type_attributes end child :product_properties => :product_properties do attributes *product_property_attributes end
Remove cache. Fucking stupid implementation of api.
Remove cache. Fucking stupid implementation of api.
Ruby
bsd-3-clause
shoppingin/spree_strike_price
ruby
## Code Before: object @product cache [I18n.locale, @current_user_roles.include?('admin'), current_currency, root_object] attributes *product_attributes node(:display_price) { |p| p.display_price.to_s } node(:strike_price) { |p| p.strike_price.to_s } node(:has_variants) { |p| p.has_variants? } child :master => :master do extends "spree/api/variants/small" end child :variants => :variants do extends "spree/api/variants/small" end child :option_types => :option_types do attributes *option_type_attributes end child :product_properties => :product_properties do attributes *product_property_attributes end ## Instruction: Remove cache. Fucking stupid implementation of api. ## Code After: object @product attributes *product_attributes node(:display_price) { |p| p.display_price.to_s } node(:strike_price) { |p| p.strike_price.to_s } node(:has_variants) { |p| p.has_variants? } child :master => :master do extends "spree/api/variants/small" end child :variants => :variants do extends "spree/api/variants/small" end child :option_types => :option_types do attributes *option_type_attributes end child :product_properties => :product_properties do attributes *product_property_attributes end
object @product - cache [I18n.locale, @current_user_roles.include?('admin'), current_currency, root_object] attributes *product_attributes node(:display_price) { |p| p.display_price.to_s } node(:strike_price) { |p| p.strike_price.to_s } node(:has_variants) { |p| p.has_variants? } child :master => :master do extends "spree/api/variants/small" end child :variants => :variants do extends "spree/api/variants/small" end child :option_types => :option_types do attributes *option_type_attributes end child :product_properties => :product_properties do attributes *product_property_attributes end
1
0.041667
0
1
d539e02004c57f3b470ad795f55277027ac138de
src/site.css
src/site.css
@import 'sanitize.css'; @import 'base.css'; @import 'modules/font-size.css'; @import 'modules/size.css'; @import 'modules/line-height.css'; :root { --main-color: black; --fz1: 1rem; --fz2: 1.25rem; --fz3: 1.5rem; --fz4: 2rem; --fz5: 2.25rem; --fz6: 2.5rem; --fz7: 2.75rem; --fz8: 3rem; }; a, a:link, a:hover, a:active, a:visited { color: var(--main-color); border-bottom: 0.1em solid var(--main-color); }
@import 'sanitize.css'; @import 'base.css'; @import 'modules/font-size.css'; @import 'modules/size.css'; @import 'modules/line-height.css'; :root { --main-color: black; --fz1: 1rem; --fz2: 1.25rem; --fz3: 1.5rem; --fz4: 2rem; --fz5: 2.25rem; --fz6: 2.5rem; --fz7: 2.75rem; --fz8: 3rem; }; body { font-family: 'Open Sans'; } a, a:link, a:hover, a:active, a:visited { color: var(--main-color); border-bottom: 0.1em solid var(--main-color); }
Change font-family to Open Sans
Change font-family to Open Sans
CSS
mit
phatpham9/phatpham9.github.io,phatpham9/onroads.xyz,phatpham9/phatpham9.github.io,phatpham9/onroads.xyz
css
## Code Before: @import 'sanitize.css'; @import 'base.css'; @import 'modules/font-size.css'; @import 'modules/size.css'; @import 'modules/line-height.css'; :root { --main-color: black; --fz1: 1rem; --fz2: 1.25rem; --fz3: 1.5rem; --fz4: 2rem; --fz5: 2.25rem; --fz6: 2.5rem; --fz7: 2.75rem; --fz8: 3rem; }; a, a:link, a:hover, a:active, a:visited { color: var(--main-color); border-bottom: 0.1em solid var(--main-color); } ## Instruction: Change font-family to Open Sans ## Code After: @import 'sanitize.css'; @import 'base.css'; @import 'modules/font-size.css'; @import 'modules/size.css'; @import 'modules/line-height.css'; :root { --main-color: black; --fz1: 1rem; --fz2: 1.25rem; --fz3: 1.5rem; --fz4: 2rem; --fz5: 2.25rem; --fz6: 2.5rem; --fz7: 2.75rem; --fz8: 3rem; }; body { font-family: 'Open Sans'; } a, a:link, a:hover, a:active, a:visited { color: var(--main-color); border-bottom: 0.1em solid var(--main-color); }
@import 'sanitize.css'; @import 'base.css'; @import 'modules/font-size.css'; @import 'modules/size.css'; @import 'modules/line-height.css'; :root { --main-color: black; --fz1: 1rem; --fz2: 1.25rem; --fz3: 1.5rem; --fz4: 2rem; --fz5: 2.25rem; --fz6: 2.5rem; --fz7: 2.75rem; --fz8: 3rem; }; + body { + font-family: 'Open Sans'; + } + a, a:link, a:hover, a:active, a:visited { color: var(--main-color); border-bottom: 0.1em solid var(--main-color); }
4
0.173913
4
0
00792493ef65da150ce5d3e4cc7c15660ce1b54a
tests/run-pass/file_manipulation.rs
tests/run-pass/file_manipulation.rs
// ignore-windows: File handling is not implemented yet // compile-flags: -Zmiri-disable-isolation use std::fs::{File, remove_file}; use std::io::{Read, Write}; fn main() { let path = "./tests/hello.txt"; let bytes = b"Hello, World!\n"; // Test creating, writing and closing a file (closing is tested when `file` is dropped). let mut file = File::create(path).unwrap(); // Writing 0 bytes should not change the file contents. file.write(&mut []).unwrap(); file.write(bytes).unwrap(); // Test opening, reading and closing a file. let mut file = File::open(path).unwrap(); let mut contents = Vec::new(); // Reading 0 bytes should not move the file pointer. file.read(&mut []).unwrap(); // Reading until EOF should get the whole text. file.read_to_end(&mut contents).unwrap(); assert_eq!(bytes, contents.as_slice()); // Removing file should succeed remove_file(path).unwrap(); }
// ignore-windows: File handling is not implemented yet // compile-flags: -Zmiri-disable-isolation use std::fs::{File, remove_file}; use std::io::{Read, Write}; fn main() { let path = "./tests/hello.txt"; let bytes = b"Hello, World!\n"; // Test creating, writing and closing a file (closing is tested when `file` is dropped). let mut file = File::create(path).unwrap(); // Writing 0 bytes should not change the file contents. file.write(&mut []).unwrap(); file.write(bytes).unwrap(); // Test opening, reading and closing a file. let mut file = File::open(path).unwrap(); let mut contents = Vec::new(); // Reading 0 bytes should not move the file pointer. file.read(&mut []).unwrap(); // Reading until EOF should get the whole text. file.read_to_end(&mut contents).unwrap(); assert_eq!(bytes, contents.as_slice()); // Removing file should succeed remove_file(path).unwrap(); // Opening non-existing file should fail assert!(File::open(path).is_err()); // Removing non-existing file should fail assert!(remove_file(path).is_err()); }
Add tests for non-existing files
Add tests for non-existing files
Rust
apache-2.0
rust-lang/miri,rust-lang/miri,rust-lang/miri,rust-lang/miri,tsion/miri
rust
## Code Before: // ignore-windows: File handling is not implemented yet // compile-flags: -Zmiri-disable-isolation use std::fs::{File, remove_file}; use std::io::{Read, Write}; fn main() { let path = "./tests/hello.txt"; let bytes = b"Hello, World!\n"; // Test creating, writing and closing a file (closing is tested when `file` is dropped). let mut file = File::create(path).unwrap(); // Writing 0 bytes should not change the file contents. file.write(&mut []).unwrap(); file.write(bytes).unwrap(); // Test opening, reading and closing a file. let mut file = File::open(path).unwrap(); let mut contents = Vec::new(); // Reading 0 bytes should not move the file pointer. file.read(&mut []).unwrap(); // Reading until EOF should get the whole text. file.read_to_end(&mut contents).unwrap(); assert_eq!(bytes, contents.as_slice()); // Removing file should succeed remove_file(path).unwrap(); } ## Instruction: Add tests for non-existing files ## Code After: // ignore-windows: File handling is not implemented yet // compile-flags: -Zmiri-disable-isolation use std::fs::{File, remove_file}; use std::io::{Read, Write}; fn main() { let path = "./tests/hello.txt"; let bytes = b"Hello, World!\n"; // Test creating, writing and closing a file (closing is tested when `file` is dropped). let mut file = File::create(path).unwrap(); // Writing 0 bytes should not change the file contents. file.write(&mut []).unwrap(); file.write(bytes).unwrap(); // Test opening, reading and closing a file. let mut file = File::open(path).unwrap(); let mut contents = Vec::new(); // Reading 0 bytes should not move the file pointer. file.read(&mut []).unwrap(); // Reading until EOF should get the whole text. file.read_to_end(&mut contents).unwrap(); assert_eq!(bytes, contents.as_slice()); // Removing file should succeed remove_file(path).unwrap(); // Opening non-existing file should fail assert!(File::open(path).is_err()); // Removing non-existing file should fail assert!(remove_file(path).is_err()); }
// ignore-windows: File handling is not implemented yet // compile-flags: -Zmiri-disable-isolation use std::fs::{File, remove_file}; use std::io::{Read, Write}; fn main() { let path = "./tests/hello.txt"; let bytes = b"Hello, World!\n"; // Test creating, writing and closing a file (closing is tested when `file` is dropped). let mut file = File::create(path).unwrap(); // Writing 0 bytes should not change the file contents. file.write(&mut []).unwrap(); file.write(bytes).unwrap(); // Test opening, reading and closing a file. let mut file = File::open(path).unwrap(); let mut contents = Vec::new(); // Reading 0 bytes should not move the file pointer. file.read(&mut []).unwrap(); // Reading until EOF should get the whole text. file.read_to_end(&mut contents).unwrap(); assert_eq!(bytes, contents.as_slice()); // Removing file should succeed remove_file(path).unwrap(); + // Opening non-existing file should fail + assert!(File::open(path).is_err()); + // Removing non-existing file should fail + assert!(remove_file(path).is_err()); }
4
0.153846
4
0
4ee97a6dfd2229ea6dad0a3eda8b6ba10b91268d
tox.ini
tox.ini
[tox] envlist = py{35, 36, 37, 38, py3} [testenv] extras = tests commands = {envpython} -m pytest --cov humanize --cov tests {posargs} [testenv:lint] deps = pre-commit commands = pre-commit run --all-files skip_install = true
[tox] envlist = py{35, 36, 37, 38, py3} [testenv] extras = tests commands = {envpython} -m pytest --cov humanize --cov tests --cov-report xml {posargs} [testenv:lint] deps = pre-commit commands = pre-commit run --all-files skip_install = true
Create coverage XML output for GHA
Create coverage XML output for GHA
INI
mit
jmoiron/humanize,jmoiron/humanize
ini
## Code Before: [tox] envlist = py{35, 36, 37, 38, py3} [testenv] extras = tests commands = {envpython} -m pytest --cov humanize --cov tests {posargs} [testenv:lint] deps = pre-commit commands = pre-commit run --all-files skip_install = true ## Instruction: Create coverage XML output for GHA ## Code After: [tox] envlist = py{35, 36, 37, 38, py3} [testenv] extras = tests commands = {envpython} -m pytest --cov humanize --cov tests --cov-report xml {posargs} [testenv:lint] deps = pre-commit commands = pre-commit run --all-files skip_install = true
[tox] envlist = py{35, 36, 37, 38, py3} [testenv] extras = tests commands = - {envpython} -m pytest --cov humanize --cov tests {posargs} + {envpython} -m pytest --cov humanize --cov tests --cov-report xml {posargs} ? +++++++++++++++++ [testenv:lint] deps = pre-commit commands = pre-commit run --all-files skip_install = true
2
0.142857
1
1
3c0d0248ac6f45bcd2ee552f6c34af285003ad64
index.js
index.js
'use strict'; var babel = require('babel-core'); exports.name = 'babel'; exports.inputFormats = ['es6', 'babel', 'js']; exports.outputFormat = 'js'; /** * Babel's available options. */ var availableOptions = Object.keys(babel.options); exports.render = function(str, options, locals) { // Remove any invalid options. var opts = {}; var name = null; options = options || {}; for (var index = 0; index < availableOptions.length; index++) { name = availableOptions[index]; if (name in options) { opts[name] = options[name]; } } // Process the new options with Babel. return babel.transform(str, opts).code; };
'use strict'; var babel = require('babel-core'); exports.name = 'babel'; exports.inputFormats = ['es6', 'babel', 'js']; exports.outputFormat = 'js'; /** * Babel's available options. */ var availableOptions = Object.keys(babel.options); exports.render = function(str, options, locals) { // Remove any invalid options. var opts = {}; var name = null; options = options || {}; for (var index = 0; index < availableOptions.length; index++) { name = availableOptions[index]; if (name in options) { opts[name] = options[name]; } } ['preset', 'plugin'].forEach(function (opt) { var plural = opt + 's'; if (opts[plural]) { opts[plural] = opts[plural].map(function (mod) { try { return require('babel-' + opt + '-' + mod); } catch (err) { return mod; } }); } }); // Process the new options with Babel. return babel.transform(str, opts).code; };
Add a workaround for requiring presets and options in the browser
Add a workaround for requiring presets and options in the browser
JavaScript
mit
jstransformers/jstransformer-babel
javascript
## Code Before: 'use strict'; var babel = require('babel-core'); exports.name = 'babel'; exports.inputFormats = ['es6', 'babel', 'js']; exports.outputFormat = 'js'; /** * Babel's available options. */ var availableOptions = Object.keys(babel.options); exports.render = function(str, options, locals) { // Remove any invalid options. var opts = {}; var name = null; options = options || {}; for (var index = 0; index < availableOptions.length; index++) { name = availableOptions[index]; if (name in options) { opts[name] = options[name]; } } // Process the new options with Babel. return babel.transform(str, opts).code; }; ## Instruction: Add a workaround for requiring presets and options in the browser ## Code After: 'use strict'; var babel = require('babel-core'); exports.name = 'babel'; exports.inputFormats = ['es6', 'babel', 'js']; exports.outputFormat = 'js'; /** * Babel's available options. */ var availableOptions = Object.keys(babel.options); exports.render = function(str, options, locals) { // Remove any invalid options. var opts = {}; var name = null; options = options || {}; for (var index = 0; index < availableOptions.length; index++) { name = availableOptions[index]; if (name in options) { opts[name] = options[name]; } } ['preset', 'plugin'].forEach(function (opt) { var plural = opt + 's'; if (opts[plural]) { opts[plural] = opts[plural].map(function (mod) { try { return require('babel-' + opt + '-' + mod); } catch (err) { return mod; } }); } }); // Process the new options with Babel. return babel.transform(str, opts).code; };
'use strict'; var babel = require('babel-core'); exports.name = 'babel'; exports.inputFormats = ['es6', 'babel', 'js']; exports.outputFormat = 'js'; /** * Babel's available options. */ var availableOptions = Object.keys(babel.options); exports.render = function(str, options, locals) { // Remove any invalid options. var opts = {}; var name = null; options = options || {}; for (var index = 0; index < availableOptions.length; index++) { name = availableOptions[index]; if (name in options) { opts[name] = options[name]; } } + ['preset', 'plugin'].forEach(function (opt) { + var plural = opt + 's'; + if (opts[plural]) { + opts[plural] = opts[plural].map(function (mod) { + try { + return require('babel-' + opt + '-' + mod); + } catch (err) { + return mod; + } + }); + } + }); + // Process the new options with Babel. return babel.transform(str, opts).code; };
13
0.464286
13
0
8ca94718dcb0afff9a403db675692fee6ea77681
core/src/test/java/net/tomp2p/utils/TestUtils.java
core/src/test/java/net/tomp2p/utils/TestUtils.java
package net.tomp2p.utils; import java.util.ArrayList; import java.util.Collection; import junit.framework.Assert; import org.junit.Test; public class TestUtils { @SuppressWarnings("unchecked") @Test public void testDifference1() { Collection<String> collection1 = new ArrayList<String>(); Collection<String> result = new ArrayList<String>(); Collection<String> collection2 = new ArrayList<String>(); Collection<String> collection3 = new ArrayList<String>(); // collection1.add("hallo"); collection1.add("test"); // collection2.add("test"); collection2.add("hallo"); Utils.difference(collection1, result, collection2, collection3); Assert.assertEquals(0, result.size()); } }
package net.tomp2p.utils; import java.util.ArrayList; import java.util.Collection; import org.junit.Assert; import org.junit.Test; public class TestUtils { @Test public void testDifference1() { Collection<String> collection1 = new ArrayList<String>(); Collection<String> result = new ArrayList<String>(); Collection<String> collection2 = new ArrayList<String>(); Collection<String> collection3 = new ArrayList<String>(); // collection1.add("hallo"); collection1.add("test"); // collection2.add("test"); collection2.add("hallo"); Utils.difference(collection1, result, collection2, collection3); Assert.assertEquals(0, result.size()); } }
Fix warning in core test
Fix warning in core test
Java
apache-2.0
tomp2p/TomP2P,thirdy/TomP2P,tomp2p/TomP2P,jonaswagner/TomP2P,thirdy/TomP2P,jonaswagner/TomP2P,jonaswagner/TomP2P,jonaswagner/TomP2P,jonaswagner/TomP2P,jonaswagner/TomP2P
java
## Code Before: package net.tomp2p.utils; import java.util.ArrayList; import java.util.Collection; import junit.framework.Assert; import org.junit.Test; public class TestUtils { @SuppressWarnings("unchecked") @Test public void testDifference1() { Collection<String> collection1 = new ArrayList<String>(); Collection<String> result = new ArrayList<String>(); Collection<String> collection2 = new ArrayList<String>(); Collection<String> collection3 = new ArrayList<String>(); // collection1.add("hallo"); collection1.add("test"); // collection2.add("test"); collection2.add("hallo"); Utils.difference(collection1, result, collection2, collection3); Assert.assertEquals(0, result.size()); } } ## Instruction: Fix warning in core test ## Code After: package net.tomp2p.utils; import java.util.ArrayList; import java.util.Collection; import org.junit.Assert; import org.junit.Test; public class TestUtils { @Test public void testDifference1() { Collection<String> collection1 = new ArrayList<String>(); Collection<String> result = new ArrayList<String>(); Collection<String> collection2 = new ArrayList<String>(); Collection<String> collection3 = new ArrayList<String>(); // collection1.add("hallo"); collection1.add("test"); // collection2.add("test"); collection2.add("hallo"); Utils.difference(collection1, result, collection2, collection3); Assert.assertEquals(0, result.size()); } }
package net.tomp2p.utils; import java.util.ArrayList; import java.util.Collection; + import org.junit.Assert; - import junit.framework.Assert; - import org.junit.Test; public class TestUtils { - @SuppressWarnings("unchecked") @Test public void testDifference1() { Collection<String> collection1 = new ArrayList<String>(); Collection<String> result = new ArrayList<String>(); Collection<String> collection2 = new ArrayList<String>(); Collection<String> collection3 = new ArrayList<String>(); // collection1.add("hallo"); collection1.add("test"); // collection2.add("test"); collection2.add("hallo"); Utils.difference(collection1, result, collection2, collection3); Assert.assertEquals(0, result.size()); } }
4
0.148148
1
3
c905e81249f3fb8707d7ebafe9cfdebfe51fadc5
compatibility/test-exists-ml-function.sh
compatibility/test-exists-ml-function.sh
set -x FILE="conftest.ml" function cleanup () { PREFILE="${FILE%.ml}" rm -f "$PREFILE.cmi" "$PREFILE.cmo" "$PREFILE.cmx" "$PREFILE.cmxs" "$PREFILE.ml.d" "$PREFILE.o" "$FILE" } trap cleanup EXIT cat > "$FILE" <<EOF let test = $FUNCTION EOF cat "$FILE" "${COQBIN}coq_makefile" "$FILE" -R . Top | make -f - || exit 1 exit 0
set -x FILE="conftest.ml" MAKEFILE="" function cleanup () { PREFILE="${FILE%.ml}" rm -f "$PREFILE.cmi" "$PREFILE.cmo" "$PREFILE.cmx" "$PREFILE.cmxs" "$PREFILE.ml.d" "$PREFILE.o" "$FILE" "$MAKEFILE" } trap cleanup EXIT cat > "$FILE" <<EOF let test = $FUNCTION EOF cat "$FILE" MAKEFILE="$(mktemp)" "${COQBIN}coq_makefile" "$FILE" -R . Top -o "$MAKEFILE" && make -f "$MAKEFILE" || exit 1 exit 0
Use a temporary file for conftest
Use a temporary file for conftest
Shell
mit
JasonGross/coq-scripts,JasonGross/coq-scripts
shell
## Code Before: set -x FILE="conftest.ml" function cleanup () { PREFILE="${FILE%.ml}" rm -f "$PREFILE.cmi" "$PREFILE.cmo" "$PREFILE.cmx" "$PREFILE.cmxs" "$PREFILE.ml.d" "$PREFILE.o" "$FILE" } trap cleanup EXIT cat > "$FILE" <<EOF let test = $FUNCTION EOF cat "$FILE" "${COQBIN}coq_makefile" "$FILE" -R . Top | make -f - || exit 1 exit 0 ## Instruction: Use a temporary file for conftest ## Code After: set -x FILE="conftest.ml" MAKEFILE="" function cleanup () { PREFILE="${FILE%.ml}" rm -f "$PREFILE.cmi" "$PREFILE.cmo" "$PREFILE.cmx" "$PREFILE.cmxs" "$PREFILE.ml.d" "$PREFILE.o" "$FILE" "$MAKEFILE" } trap cleanup EXIT cat > "$FILE" <<EOF let test = $FUNCTION EOF cat "$FILE" MAKEFILE="$(mktemp)" "${COQBIN}coq_makefile" "$FILE" -R . Top -o "$MAKEFILE" && make -f "$MAKEFILE" || exit 1 exit 0
set -x FILE="conftest.ml" + MAKEFILE="" function cleanup () { PREFILE="${FILE%.ml}" - rm -f "$PREFILE.cmi" "$PREFILE.cmo" "$PREFILE.cmx" "$PREFILE.cmxs" "$PREFILE.ml.d" "$PREFILE.o" "$FILE" + rm -f "$PREFILE.cmi" "$PREFILE.cmo" "$PREFILE.cmx" "$PREFILE.cmxs" "$PREFILE.ml.d" "$PREFILE.o" "$FILE" "$MAKEFILE" ? ++++++++++++ } trap cleanup EXIT cat > "$FILE" <<EOF let test = $FUNCTION EOF cat "$FILE" + MAKEFILE="$(mktemp)" - "${COQBIN}coq_makefile" "$FILE" -R . Top | make -f - || exit 1 ? ^ ^ + "${COQBIN}coq_makefile" "$FILE" -R . Top -o "$MAKEFILE" && make -f "$MAKEFILE" || exit 1 ? ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ exit 0
6
0.285714
4
2
4ba6fe48d1730c243423f80a7916fe8b8ee85071
.travis.yml
.travis.yml
language: cpp dist: bionic sudo: true compiler: - clang - gcc # Install GTest properly since it is only available as a static library. install: - mkdir -p ~/gtest_build - pushd ~/gtest_build - cmake /usr/src/gtest -DBUILD_SHARED_LIBS=true - make && sudo make install - popd # Custom directory, for the correct year before_script: - cd 2019 # CMake build script: cmake . && make && make test addons: apt: packages: - libboost-filesystem-dev - libboost-program-options-dev - libgtest-dev cache: directories: - /home/travis/gtest_build
language: cpp dist: bionic sudo: true matrix: include: - addons: apt: sources: - ubuntu-toolchain-r-test - llvm-toolchain-bionic-8 packages: - clang-8 - libc++-8-dev - libc++abi-8-dev - libboost-filesystem-dev - libboost-program-options-dev - libgtest-dev env: - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" before_install: - eval "$MATRIX_EVAL" # Install GTest properly since it is only available as a static library. install: - mkdir -p ~/gtest_build - pushd ~/gtest_build - cmake /usr/src/gtest -DBUILD_SHARED_LIBS=true - make && sudo make install - popd # Custom directory, for the correct year before_script: - cd 2019 # CMake build script: cmake . && make && make test
Use recent GCC and Clang versions.
Use recent GCC and Clang versions.
YAML
mit
bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode,bertptrs/adventofcode
yaml
## Code Before: language: cpp dist: bionic sudo: true compiler: - clang - gcc # Install GTest properly since it is only available as a static library. install: - mkdir -p ~/gtest_build - pushd ~/gtest_build - cmake /usr/src/gtest -DBUILD_SHARED_LIBS=true - make && sudo make install - popd # Custom directory, for the correct year before_script: - cd 2019 # CMake build script: cmake . && make && make test addons: apt: packages: - libboost-filesystem-dev - libboost-program-options-dev - libgtest-dev cache: directories: - /home/travis/gtest_build ## Instruction: Use recent GCC and Clang versions. ## Code After: language: cpp dist: bionic sudo: true matrix: include: - addons: apt: sources: - ubuntu-toolchain-r-test - llvm-toolchain-bionic-8 packages: - clang-8 - libc++-8-dev - libc++abi-8-dev - libboost-filesystem-dev - libboost-program-options-dev - libgtest-dev env: - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" before_install: - eval "$MATRIX_EVAL" # Install GTest properly since it is only available as a static library. install: - mkdir -p ~/gtest_build - pushd ~/gtest_build - cmake /usr/src/gtest -DBUILD_SHARED_LIBS=true - make && sudo make install - popd # Custom directory, for the correct year before_script: - cd 2019 # CMake build script: cmake . && make && make test
language: cpp dist: bionic sudo: true - compiler: - - clang - - gcc + matrix: + include: + - addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-bionic-8 + packages: + - clang-8 + - libc++-8-dev + - libc++abi-8-dev + - libboost-filesystem-dev + - libboost-program-options-dev + - libgtest-dev + env: + - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" + + + before_install: + - eval "$MATRIX_EVAL" # Install GTest properly since it is only available as a static library. install: - mkdir -p ~/gtest_build - pushd ~/gtest_build - cmake /usr/src/gtest -DBUILD_SHARED_LIBS=true - make && sudo make install - popd # Custom directory, for the correct year before_script: - cd 2019 # CMake build script: cmake . && make && make test - - addons: - apt: - packages: - - libboost-filesystem-dev - - libboost-program-options-dev - - libgtest-dev - - cache: - directories: - - /home/travis/gtest_build
34
1.030303
20
14
d52c4340a62802bcd0fcbd68516c5ac66fb10436
ftfy/streamtester/__init__.py
ftfy/streamtester/__init__.py
from __future__ import print_function, unicode_literals from ftfy.fixes import fix_text_encoding from ftfy.chardata import possible_encoding class StreamTester: """ Take in a sequence of texts, and show the ones that will be changed by ftfy. This will also periodically show updates, such as the proportion of texts that changed. """ def __init__(self): self.num_fixed = 0 self.count = 0 def check_ftfy(self, text): """ Given a single text input, check whether `ftfy.fix_text_encoding` would change it. If so, display the change. """ self.count += 1 if not possible_encoding(text, 'ascii'): fixed = fix_text_encoding(text) if text != fixed: # possibly filter common bots before printing print(u'\nText:\t{text}\nFixed:\t{fixed}\n'.format( text=text, fixed=fixed )) self.num_fixed += 1 # Print status updates once in a while if self.count % 100 == 0: print('.', end='', flush=True) if self.count % 10000 == 0: print('\n%d/%d fixed' % (self.num_fixed, self.count))
from __future__ import print_function, unicode_literals from ftfy.fixes import fix_encoding from ftfy.chardata import possible_encoding class StreamTester: """ Take in a sequence of texts, and show the ones that will be changed by ftfy. This will also periodically show updates, such as the proportion of texts that changed. """ def __init__(self): self.num_fixed = 0 self.count = 0 def check_ftfy(self, text): """ Given a single text input, check whether `ftfy.fix_text_encoding` would change it. If so, display the change. """ self.count += 1 if not possible_encoding(text, 'ascii'): fixed = fix_encoding(text) if text != fixed: # possibly filter common bots before printing print(u'\nText:\t{text}\nFixed:\t{fixed}\n'.format( text=text, fixed=fixed )) self.num_fixed += 1 # Print status updates once in a while if self.count % 100 == 0: print('.', end='', flush=True) if self.count % 10000 == 0: print('\n%d/%d fixed' % (self.num_fixed, self.count))
Update function name used in the streamtester
Update function name used in the streamtester
Python
mit
LuminosoInsight/python-ftfy
python
## Code Before: from __future__ import print_function, unicode_literals from ftfy.fixes import fix_text_encoding from ftfy.chardata import possible_encoding class StreamTester: """ Take in a sequence of texts, and show the ones that will be changed by ftfy. This will also periodically show updates, such as the proportion of texts that changed. """ def __init__(self): self.num_fixed = 0 self.count = 0 def check_ftfy(self, text): """ Given a single text input, check whether `ftfy.fix_text_encoding` would change it. If so, display the change. """ self.count += 1 if not possible_encoding(text, 'ascii'): fixed = fix_text_encoding(text) if text != fixed: # possibly filter common bots before printing print(u'\nText:\t{text}\nFixed:\t{fixed}\n'.format( text=text, fixed=fixed )) self.num_fixed += 1 # Print status updates once in a while if self.count % 100 == 0: print('.', end='', flush=True) if self.count % 10000 == 0: print('\n%d/%d fixed' % (self.num_fixed, self.count)) ## Instruction: Update function name used in the streamtester ## Code After: from __future__ import print_function, unicode_literals from ftfy.fixes import fix_encoding from ftfy.chardata import possible_encoding class StreamTester: """ Take in a sequence of texts, and show the ones that will be changed by ftfy. This will also periodically show updates, such as the proportion of texts that changed. """ def __init__(self): self.num_fixed = 0 self.count = 0 def check_ftfy(self, text): """ Given a single text input, check whether `ftfy.fix_text_encoding` would change it. If so, display the change. """ self.count += 1 if not possible_encoding(text, 'ascii'): fixed = fix_encoding(text) if text != fixed: # possibly filter common bots before printing print(u'\nText:\t{text}\nFixed:\t{fixed}\n'.format( text=text, fixed=fixed )) self.num_fixed += 1 # Print status updates once in a while if self.count % 100 == 0: print('.', end='', flush=True) if self.count % 10000 == 0: print('\n%d/%d fixed' % (self.num_fixed, self.count))
from __future__ import print_function, unicode_literals - from ftfy.fixes import fix_text_encoding ? ----- + from ftfy.fixes import fix_encoding from ftfy.chardata import possible_encoding class StreamTester: """ Take in a sequence of texts, and show the ones that will be changed by ftfy. This will also periodically show updates, such as the proportion of texts that changed. """ def __init__(self): self.num_fixed = 0 self.count = 0 def check_ftfy(self, text): """ Given a single text input, check whether `ftfy.fix_text_encoding` would change it. If so, display the change. """ self.count += 1 if not possible_encoding(text, 'ascii'): - fixed = fix_text_encoding(text) ? ----- + fixed = fix_encoding(text) if text != fixed: # possibly filter common bots before printing print(u'\nText:\t{text}\nFixed:\t{fixed}\n'.format( text=text, fixed=fixed )) self.num_fixed += 1 # Print status updates once in a while if self.count % 100 == 0: print('.', end='', flush=True) if self.count % 10000 == 0: print('\n%d/%d fixed' % (self.num_fixed, self.count))
4
0.114286
2
2
8373229b62c7cc1094aa2a69cf655b078017ee1f
.travis.yml
.travis.yml
dist: trusty language: node_js sudo: false node_js: - stable - 12
dist: bionic language: node_js sudo: false node_js: - stable
Update Travis to bionic, and only check stable
Update Travis to bionic, and only check stable
YAML
mit
wub/preact-cli-plugin-typescript
yaml
## Code Before: dist: trusty language: node_js sudo: false node_js: - stable - 12 ## Instruction: Update Travis to bionic, and only check stable ## Code After: dist: bionic language: node_js sudo: false node_js: - stable
- dist: trusty + dist: bionic language: node_js sudo: false node_js: - stable - - 12
3
0.5
1
2
f1dbb9c143471b1c8057b46eab2043fbbe2e2ee0
recipes-openamp/open-amp/open-amp_git.bb
recipes-openamp/open-amp/open-amp_git.bb
SRCBRANCH ?= "master-rel-2021.1" SRCREV = "84041fa84d9bc524357b030ebe9a5174b01377bd" BRANCH = "master-rel-2021.1" LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=0e6d7bfe689fe5b0d0a89b2ccbe053fa" PV = "${SRCBRANCH}+git${SRCPV}" include open-amp.inc
SRCBRANCH ?= "xlnx_rel_v2021.1" SRCREV = "84041fa84d9bc524357b030ebe9a5174b01377bd" BRANCH = "xlnx_rel_v2021.1" LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=0e6d7bfe689fe5b0d0a89b2ccbe053fa" PV = "${SRCBRANCH}+git${SRCPV}" include open-amp.inc
Update branch for 2021.1 release
open-amp: Update branch for 2021.1 release Signed-off-by: Christian Kohn <cddab1f837c400ff9c3b002761e2cb74669ec6d1@xilinx.com> Signed-off-by: Jaewon Lee <1b369288d13b7b5cc9a37dd614e864b90fd18321@xilinx.com>
BitBake
mit
OpenAMP/meta-openamp,OpenAMP/meta-openamp
bitbake
## Code Before: SRCBRANCH ?= "master-rel-2021.1" SRCREV = "84041fa84d9bc524357b030ebe9a5174b01377bd" BRANCH = "master-rel-2021.1" LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=0e6d7bfe689fe5b0d0a89b2ccbe053fa" PV = "${SRCBRANCH}+git${SRCPV}" include open-amp.inc ## Instruction: open-amp: Update branch for 2021.1 release Signed-off-by: Christian Kohn <cddab1f837c400ff9c3b002761e2cb74669ec6d1@xilinx.com> Signed-off-by: Jaewon Lee <1b369288d13b7b5cc9a37dd614e864b90fd18321@xilinx.com> ## Code After: SRCBRANCH ?= "xlnx_rel_v2021.1" SRCREV = "84041fa84d9bc524357b030ebe9a5174b01377bd" BRANCH = "xlnx_rel_v2021.1" LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=0e6d7bfe689fe5b0d0a89b2ccbe053fa" PV = "${SRCBRANCH}+git${SRCPV}" include open-amp.inc
- SRCBRANCH ?= "master-rel-2021.1" ? ^^^^^^^ ^ + SRCBRANCH ?= "xlnx_rel_v2021.1" ? ^^^^^ ^^ SRCREV = "84041fa84d9bc524357b030ebe9a5174b01377bd" - BRANCH = "master-rel-2021.1" + BRANCH = "xlnx_rel_v2021.1" LIC_FILES_CHKSUM ?= "file://LICENSE.md;md5=0e6d7bfe689fe5b0d0a89b2ccbe053fa" PV = "${SRCBRANCH}+git${SRCPV}" include open-amp.inc
4
0.571429
2
2
3b26c3787bc7d5c560565c5c9c36cf2c02934617
app/create-feed-from-gtfs/service.js
app/create-feed-from-gtfs/service.js
import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), feedModel: null, createOrFindFeedModel: function() { if (this.get('feedModel') == null) { var newFeedModel = this.get('store').createRecord('feed', { }); this.set('feedModel', newFeedModel); } return this.get('feedModel'); }, downloadGtfsArchiveAndParseIntoFeedModel: function() { return true; } });
import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), feedModel: null, createOrFindFeedModel: function() { if (this.get('feedModel') == null) { var newFeedModel = this.get('store').createRecord('feed', { }); this.set('feedModel', newFeedModel); } return this.get('feedModel'); }, downloadGtfsArchiveAndParseIntoFeedModel: function() { var feedModel = this.createOrFindFeedModel(); // var url = 'http://www.caltrain.com/Assets/GTFS/caltrain/GTFS-Caltrain-Devs.zip'; var url = feedModel.get('url'); var adapter = this.get('store').adapterFor('fetch_info'); var fetch_info_url = adapter.urlPrefix()+'/fetch_info'; var promise = adapter.ajax(fetch_info_url, 'post', {data:{url:url}}); promise.then(function(response) { response.operators.map(function(operator){ feedModel.addOperator(operator) }); }); return promise } });
Call remote 'fetch_info' on feed, return promise
Call remote 'fetch_info' on feed, return promise
JavaScript
mit
transitland/feed-registry,transitland/feed-registry
javascript
## Code Before: import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), feedModel: null, createOrFindFeedModel: function() { if (this.get('feedModel') == null) { var newFeedModel = this.get('store').createRecord('feed', { }); this.set('feedModel', newFeedModel); } return this.get('feedModel'); }, downloadGtfsArchiveAndParseIntoFeedModel: function() { return true; } }); ## Instruction: Call remote 'fetch_info' on feed, return promise ## Code After: import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), feedModel: null, createOrFindFeedModel: function() { if (this.get('feedModel') == null) { var newFeedModel = this.get('store').createRecord('feed', { }); this.set('feedModel', newFeedModel); } return this.get('feedModel'); }, downloadGtfsArchiveAndParseIntoFeedModel: function() { var feedModel = this.createOrFindFeedModel(); // var url = 'http://www.caltrain.com/Assets/GTFS/caltrain/GTFS-Caltrain-Devs.zip'; var url = feedModel.get('url'); var adapter = this.get('store').adapterFor('fetch_info'); var fetch_info_url = adapter.urlPrefix()+'/fetch_info'; var promise = adapter.ajax(fetch_info_url, 'post', {data:{url:url}}); promise.then(function(response) { response.operators.map(function(operator){ feedModel.addOperator(operator) }); }); return promise } });
import Ember from 'ember'; export default Ember.Service.extend({ store: Ember.inject.service(), feedModel: null, createOrFindFeedModel: function() { if (this.get('feedModel') == null) { var newFeedModel = this.get('store').createRecord('feed', { }); this.set('feedModel', newFeedModel); } return this.get('feedModel'); }, downloadGtfsArchiveAndParseIntoFeedModel: function() { + var feedModel = this.createOrFindFeedModel(); + // var url = 'http://www.caltrain.com/Assets/GTFS/caltrain/GTFS-Caltrain-Devs.zip'; + var url = feedModel.get('url'); + var adapter = this.get('store').adapterFor('fetch_info'); + var fetch_info_url = adapter.urlPrefix()+'/fetch_info'; + var promise = adapter.ajax(fetch_info_url, 'post', {data:{url:url}}); + promise.then(function(response) { + response.operators.map(function(operator){ + feedModel.addOperator(operator) + }); + }); - return true; ? ^ ^ - + return promise ? ^ ^^^^ } });
13
0.8125
12
1
39025988a9157da84dd97144856f05bf0e807764
modules/doc/content/newsletter/2021_10.md
modules/doc/content/newsletter/2021_10.md
The effort to extract the python tools from MOOSE into a more generic set of tools has been halted. If the need for this effort changes it may be considered again in the future.
The effort to extract the python tools from MOOSE into a more generic set of tools has been halted. If the need for this effort changes it may be considered again in the future. ## MOOSE Improvements ## libMesh-level Changes ## Bug Fixes and Minor Enhancements
Add some template structure to October news file
Add some template structure to October news file
Markdown
lgpl-2.1
milljm/moose,milljm/moose,sapitts/moose,sapitts/moose,harterj/moose,sapitts/moose,laagesen/moose,lindsayad/moose,jessecarterMOOSE/moose,nuclear-wizard/moose,sapitts/moose,andrsd/moose,milljm/moose,idaholab/moose,idaholab/moose,harterj/moose,lindsayad/moose,nuclear-wizard/moose,andrsd/moose,nuclear-wizard/moose,harterj/moose,andrsd/moose,andrsd/moose,bwspenc/moose,dschwen/moose,milljm/moose,harterj/moose,dschwen/moose,nuclear-wizard/moose,bwspenc/moose,dschwen/moose,laagesen/moose,bwspenc/moose,laagesen/moose,sapitts/moose,bwspenc/moose,laagesen/moose,jessecarterMOOSE/moose,idaholab/moose,idaholab/moose,andrsd/moose,idaholab/moose,dschwen/moose,lindsayad/moose,jessecarterMOOSE/moose,harterj/moose,laagesen/moose,lindsayad/moose,milljm/moose,bwspenc/moose,jessecarterMOOSE/moose,dschwen/moose,jessecarterMOOSE/moose,lindsayad/moose
markdown
## Code Before: The effort to extract the python tools from MOOSE into a more generic set of tools has been halted. If the need for this effort changes it may be considered again in the future. ## Instruction: Add some template structure to October news file ## Code After: The effort to extract the python tools from MOOSE into a more generic set of tools has been halted. If the need for this effort changes it may be considered again in the future. ## MOOSE Improvements ## libMesh-level Changes ## Bug Fixes and Minor Enhancements
- The effort to extract the python tools from MOOSE into a more generic set of tools has been halted. ? ----------------- + The effort to extract the python tools from MOOSE into a more generic set of tools - If the need for this effort changes it may be considered again in the future. ? --------------- + has been halted. If the need for this effort changes it may be considered again ? +++++++++++++++++ + in the future. + + ## MOOSE Improvements + + ## libMesh-level Changes + + ## Bug Fixes and Minor Enhancements
11
3.666667
9
2
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)
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)
8
0.347826
8
0
c920e49044e1e916972c56b422e543f4ba049542
release-notes/latest.md
release-notes/latest.md
* We've updated the way that hijacked containers get garbage collected We are no longer relying on garden to clean up hijacked containers. Instead, we have implemented this functionality in concourse itself. This makes it much more portable to different container backends. #### <sub><sup><a name="5397" href="#5397">:link:</a></sup></sub> feature, breaking * @pnsantos updated the Material Design icon library version to `5.0.45`. **note:** some icons changed names (e.g. `mdi-github-circle` was changed to `mdi-github`) so after this update you might have to update some `icon:` references
* "Have you tried logging out and logging back in?" - Probably every concourse operator at some point In the old login flow, concourse used to take all your upstream third party info (think github username, teams, etc) figure out what teams you're on, and encode those into your auth token. The problem with this approach is that every time you change your team config, you need to log out and log back in. So now concourse doesn't do this anymore. Now we use a token directly from dex, the out-of-the-box identity provider that ships with concourse. If you're interested in the details you can check out [the issue](https://github.com/concourse/concourse/issues/2936). NOTE: this is a breaking change. You'll neeed to add a couple required flags at startup `CONCOURSE_CLIENT_SECRET` and `CONCOURSE_TSA_CLIENT_SECRET`. And, yes, you will need to log out and log back in one last time. #### <sub><sup><a name="5305" href="#5305">:link:</a></sup></sub> feature * We've updated the way that hijacked containers get garbage collected We are no longer relying on garden to clean up hijacked containers. Instead, we have implemented this functionality in concourse itself. This makes it much more portable to different container backends. #### <sub><sup><a name="5397" href="#5397">:link:</a></sup></sub> feature, breaking * @pnsantos updated the Material Design icon library version to `5.0.45`. **note:** some icons changed names (e.g. `mdi-github-circle` was changed to `mdi-github`) so after this update you might have to update some `icon:` references
Add note about using dex tokens
release-note: Add note about using dex tokens Signed-off-by: Josh Winters <3dd3a5216811ba233723a4612ec3a917850b715d@pivotal.io>
Markdown
apache-2.0
concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse
markdown
## Code Before: * We've updated the way that hijacked containers get garbage collected We are no longer relying on garden to clean up hijacked containers. Instead, we have implemented this functionality in concourse itself. This makes it much more portable to different container backends. #### <sub><sup><a name="5397" href="#5397">:link:</a></sup></sub> feature, breaking * @pnsantos updated the Material Design icon library version to `5.0.45`. **note:** some icons changed names (e.g. `mdi-github-circle` was changed to `mdi-github`) so after this update you might have to update some `icon:` references ## Instruction: release-note: Add note about using dex tokens Signed-off-by: Josh Winters <3dd3a5216811ba233723a4612ec3a917850b715d@pivotal.io> ## Code After: * "Have you tried logging out and logging back in?" - Probably every concourse operator at some point In the old login flow, concourse used to take all your upstream third party info (think github username, teams, etc) figure out what teams you're on, and encode those into your auth token. The problem with this approach is that every time you change your team config, you need to log out and log back in. So now concourse doesn't do this anymore. Now we use a token directly from dex, the out-of-the-box identity provider that ships with concourse. If you're interested in the details you can check out [the issue](https://github.com/concourse/concourse/issues/2936). NOTE: this is a breaking change. You'll neeed to add a couple required flags at startup `CONCOURSE_CLIENT_SECRET` and `CONCOURSE_TSA_CLIENT_SECRET`. And, yes, you will need to log out and log back in one last time. #### <sub><sup><a name="5305" href="#5305">:link:</a></sup></sub> feature * We've updated the way that hijacked containers get garbage collected We are no longer relying on garden to clean up hijacked containers. Instead, we have implemented this functionality in concourse itself. This makes it much more portable to different container backends. #### <sub><sup><a name="5397" href="#5397">:link:</a></sup></sub> feature, breaking * @pnsantos updated the Material Design icon library version to `5.0.45`. **note:** some icons changed names (e.g. `mdi-github-circle` was changed to `mdi-github`) so after this update you might have to update some `icon:` references
+ + * "Have you tried logging out and logging back in?" + - Probably every concourse operator at some point + + In the old login flow, concourse used to take all your upstream third party info (think github username, teams, etc) figure out what teams you're on, and encode those into your auth token. The problem with this approach is that every time you change your team config, you need to log out and log back in. + + So now concourse doesn't do this anymore. Now we use a token directly from dex, the out-of-the-box identity provider that ships with concourse. If you're interested in the details you can check out [the issue](https://github.com/concourse/concourse/issues/2936). + + NOTE: this is a breaking change. You'll neeed to add a couple required flags at startup `CONCOURSE_CLIENT_SECRET` and `CONCOURSE_TSA_CLIENT_SECRET`. And, yes, you will need to log out and log back in one last time. + + #### <sub><sup><a name="5305" href="#5305">:link:</a></sup></sub> feature * We've updated the way that hijacked containers get garbage collected We are no longer relying on garden to clean up hijacked containers. Instead, we have implemented this functionality in concourse itself. This makes it much more portable to different container backends. - #### <sub><sup><a name="5397" href="#5397">:link:</a></sup></sub> feature, breaking * @pnsantos updated the Material Design icon library version to `5.0.45`. **note:** some icons changed names (e.g. `mdi-github-circle` was changed to `mdi-github`) so after this update you might have to update some `icon:` references
12
1.090909
11
1
a9f3f53788799acbec46a79b90eed36ffda30a0e
CONTRIBUTING.rst
CONTRIBUTING.rst
If you would like to contribute to the development of OpenStack, you must follow the steps in the "If you're a developer, start here" section of this page: http://wiki.openstack.org/HowToContribute Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at: http://wiki.openstack.org/GerritWorkflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/delorean
Pull requests submitted through GitHub will be ignored. They should be sent to GerritHub instead, using git-review. Once submitted, they will show up here: https://review.gerrithub.io/#/q/status:open+and+project:openstack-packages/delorean
Correct location to send patches
Correct location to send patches This removes the nonexistent launchpad link as well as no longer listing as an OpenStack project.
reStructuredText
apache-2.0
derekhiggins/delorean_fork,openstack-packages/DLRN,derekhiggins/delorean_fork,openstack-packages/delorean,openstack-packages/delorean,openstack-packages/DLRN,derekhiggins/delorean_fork
restructuredtext
## Code Before: If you would like to contribute to the development of OpenStack, you must follow the steps in the "If you're a developer, start here" section of this page: http://wiki.openstack.org/HowToContribute Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at: http://wiki.openstack.org/GerritWorkflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/delorean ## Instruction: Correct location to send patches This removes the nonexistent launchpad link as well as no longer listing as an OpenStack project. ## Code After: Pull requests submitted through GitHub will be ignored. They should be sent to GerritHub instead, using git-review. Once submitted, they will show up here: https://review.gerrithub.io/#/q/status:open+and+project:openstack-packages/delorean
- If you would like to contribute to the development of OpenStack, - you must follow the steps in the "If you're a developer, start here" - section of this page: + Pull requests submitted through GitHub will be ignored. They should be sent + to GerritHub instead, using git-review. Once submitted, they will show up + here: + https://review.gerrithub.io/#/q/status:open+and+project:openstack-packages/delorean - http://wiki.openstack.org/HowToContribute - - Once those steps have been completed, changes to OpenStack - should be submitted for review via the Gerrit tool, following - the workflow documented at: - - http://wiki.openstack.org/GerritWorkflow - - Pull requests submitted through GitHub will be ignored. - - Bugs should be filed on Launchpad, not GitHub: - - https://bugs.launchpad.net/delorean
20
1.176471
4
16
b8e69f1ddda1ba43b52512687f5185d0f5f7abb3
src/matcher/compound.js
src/matcher/compound.js
'use strict'; module.exports = function ($fs, matchers) { matchers = matchers.map(function (matcher) { return matcher($fs); }); return function (file, code) { var matches = []; matchers.forEach(function (matcher) { matches = matches.concat(matcher(file, code)); }); return matches; }; };
'use strict'; module.exports = function ($fs, matchers) { matchers = matchers.map(function (matcher) { return matcher($fs); }); return function (file, code) { return matchers.reduce(function (arr, matcher) { return arr.concat(matcher(file, code)); }, []); }; };
Use reduce instead of forEach.
Use reduce instead of forEach.
JavaScript
mit
treshugart/galvatron
javascript
## Code Before: 'use strict'; module.exports = function ($fs, matchers) { matchers = matchers.map(function (matcher) { return matcher($fs); }); return function (file, code) { var matches = []; matchers.forEach(function (matcher) { matches = matches.concat(matcher(file, code)); }); return matches; }; }; ## Instruction: Use reduce instead of forEach. ## Code After: 'use strict'; module.exports = function ($fs, matchers) { matchers = matchers.map(function (matcher) { return matcher($fs); }); return function (file, code) { return matchers.reduce(function (arr, matcher) { return arr.concat(matcher(file, code)); }, []); }; };
'use strict'; module.exports = function ($fs, matchers) { matchers = matchers.map(function (matcher) { return matcher($fs); }); return function (file, code) { - var matches = []; - - matchers.forEach(function (matcher) { ? -- ^^ ^ + return matchers.reduce(function (arr, matcher) { ? +++++++ ^^^ ^ +++++ - matches = matches.concat(matcher(file, code)); + return arr.concat(matcher(file, code)); - }); + }, []); ? ++++ - - return matches; }; };
10
0.588235
3
7
c6b6594110bde839527374110a8805b2dab8eadd
recipes/default.rb
recipes/default.rb
if(node[:omnibus_updater][:disabled]) Chef::Log.warn 'Omnibus updater disabled via `disabled` attribute' elsif node[:platform] == "debian" and node[:platform_version].scan("5") Chef::Log.warn 'Omnibus updater does not support Debian 5' else include_recipe 'omnibus_updater::downloader' include_recipe 'omnibus_updater::installer' end if(node[:omnibus_updater][:remove_chef_system_gem]) include_recipe 'omnibus_updater::remove_chef_system_gem' end
if(node[:omnibus_updater][:disabled]) Chef::Log.warn 'Omnibus updater disabled via `disabled` attribute' elsif(node[:platform] == 'debian' && Gem::Version.new(node[:platform_version]) < Gem::Version.new('6.0.0')) Chef::Log.warn 'Omnibus updater does not support Debian 5' else include_recipe 'omnibus_updater::downloader' include_recipe 'omnibus_updater::installer' end if(node[:omnibus_updater][:remove_chef_system_gem]) include_recipe 'omnibus_updater::remove_chef_system_gem' end
Update conditional to use `Gem::Version` instances for version comparison
Update conditional to use `Gem::Version` instances for version comparison
Ruby
apache-2.0
Parametric/chef_omnibus_updater,crap-cookbooks/omnibus_updater,hw-cookbooks/omnibus_updater,tas50/omnibus_updater,Sauraus/omnibus_updater,chef-cookbooks/omnibus_updater
ruby
## Code Before: if(node[:omnibus_updater][:disabled]) Chef::Log.warn 'Omnibus updater disabled via `disabled` attribute' elsif node[:platform] == "debian" and node[:platform_version].scan("5") Chef::Log.warn 'Omnibus updater does not support Debian 5' else include_recipe 'omnibus_updater::downloader' include_recipe 'omnibus_updater::installer' end if(node[:omnibus_updater][:remove_chef_system_gem]) include_recipe 'omnibus_updater::remove_chef_system_gem' end ## Instruction: Update conditional to use `Gem::Version` instances for version comparison ## Code After: if(node[:omnibus_updater][:disabled]) Chef::Log.warn 'Omnibus updater disabled via `disabled` attribute' elsif(node[:platform] == 'debian' && Gem::Version.new(node[:platform_version]) < Gem::Version.new('6.0.0')) Chef::Log.warn 'Omnibus updater does not support Debian 5' else include_recipe 'omnibus_updater::downloader' include_recipe 'omnibus_updater::installer' end if(node[:omnibus_updater][:remove_chef_system_gem]) include_recipe 'omnibus_updater::remove_chef_system_gem' end
if(node[:omnibus_updater][:disabled]) Chef::Log.warn 'Omnibus updater disabled via `disabled` attribute' - elsif node[:platform] == "debian" and node[:platform_version].scan("5") + elsif(node[:platform] == 'debian' && Gem::Version.new(node[:platform_version]) < Gem::Version.new('6.0.0')) Chef::Log.warn 'Omnibus updater does not support Debian 5' else include_recipe 'omnibus_updater::downloader' include_recipe 'omnibus_updater::installer' end if(node[:omnibus_updater][:remove_chef_system_gem]) include_recipe 'omnibus_updater::remove_chef_system_gem' end
2
0.166667
1
1
51d98e70fbc524c38b093058a7ca7b33277b2f46
config.yaml
config.yaml
Type: Jupyter Notebook Extension Name: Snippets Menu Link: readme.md Description: Add customizable menu item to insert code and markdown snippets. Comes with extensive defaults for popular python modules. Main: main.js Compatibility: 4.x # Parameters: # - name: snippets_menu_set_zenmode_on_load # description: Set zenmode on when a notebook opens # input_type: checkbox # default: true # - name: snippets_menu_use_builtin_backgrounds # description: Use builtin backgrounds in addition to any specified by URL # input_type: checkbox # default: true # - name: snippets_menu_backgrounds # description: "Urls to use as backgrounds. Any beginning with # are ignored." # input_type: list # list_element: # input_type: url
Type: Jupyter Notebook Extension Name: Snippets Menu Link: readme.md Description: Add customizable menu item to insert code and markdown snippets. Comes with extensive defaults for popular python modules. Main: main.js Compatibility: 4.x
Remove some old commented yaml
Remove some old commented yaml Originally copied from `zenmode`, these are obviously useless.
YAML
bsd-3-clause
juhasch/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,moble/jupyter_boilerplate,ipython-contrib/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,juhasch/IPython-notebook-extensions
yaml
## Code Before: Type: Jupyter Notebook Extension Name: Snippets Menu Link: readme.md Description: Add customizable menu item to insert code and markdown snippets. Comes with extensive defaults for popular python modules. Main: main.js Compatibility: 4.x # Parameters: # - name: snippets_menu_set_zenmode_on_load # description: Set zenmode on when a notebook opens # input_type: checkbox # default: true # - name: snippets_menu_use_builtin_backgrounds # description: Use builtin backgrounds in addition to any specified by URL # input_type: checkbox # default: true # - name: snippets_menu_backgrounds # description: "Urls to use as backgrounds. Any beginning with # are ignored." # input_type: list # list_element: # input_type: url ## Instruction: Remove some old commented yaml Originally copied from `zenmode`, these are obviously useless. ## Code After: Type: Jupyter Notebook Extension Name: Snippets Menu Link: readme.md Description: Add customizable menu item to insert code and markdown snippets. Comes with extensive defaults for popular python modules. Main: main.js Compatibility: 4.x
Type: Jupyter Notebook Extension Name: Snippets Menu Link: readme.md Description: Add customizable menu item to insert code and markdown snippets. Comes with extensive defaults for popular python modules. Main: main.js Compatibility: 4.x - # Parameters: - # - name: snippets_menu_set_zenmode_on_load - # description: Set zenmode on when a notebook opens - # input_type: checkbox - # default: true - # - name: snippets_menu_use_builtin_backgrounds - # description: Use builtin backgrounds in addition to any specified by URL - # input_type: checkbox - # default: true - # - name: snippets_menu_backgrounds - # description: "Urls to use as backgrounds. Any beginning with # are ignored." - # input_type: list - # list_element: - # input_type: url
14
0.7
0
14
02b36658cf08a87717860f7b7de3f08aad92d364
resources/assets/components/CampaignOverview/index.js
resources/assets/components/CampaignOverview/index.js
import React from 'react'; import { map } from 'lodash'; import CampaignTable from '../CampaignTable'; class CampaignOverview extends React.Component { render() { const causeData = this.props; const causeTables = map(causeData, (data, cause) => ( <CampaignTable key={cause} cause={cause} campaigns={data} causeData={causeData} /> )); return <div className="container">{causeTables}</div>; } } export default CampaignOverview;
import React from 'react'; import { map } from 'lodash'; import CampaignTable from '../CampaignTable'; class CampaignOverview extends React.Component { render() { const causeData = this.props; const causeTables = map(causeData, (data, cause) => ( <CampaignTable key={cause} cause={cause || 'Uncategorized'} campaigns={data} causeData={causeData} /> )); return <div className="container">{causeTables}</div>; } } export default CampaignOverview;
Fix missing heading for cause-less campaigns.
Fix missing heading for cause-less campaigns.
JavaScript
mit
DoSomething/rogue,DoSomething/rogue,DoSomething/rogue
javascript
## Code Before: import React from 'react'; import { map } from 'lodash'; import CampaignTable from '../CampaignTable'; class CampaignOverview extends React.Component { render() { const causeData = this.props; const causeTables = map(causeData, (data, cause) => ( <CampaignTable key={cause} cause={cause} campaigns={data} causeData={causeData} /> )); return <div className="container">{causeTables}</div>; } } export default CampaignOverview; ## Instruction: Fix missing heading for cause-less campaigns. ## Code After: import React from 'react'; import { map } from 'lodash'; import CampaignTable from '../CampaignTable'; class CampaignOverview extends React.Component { render() { const causeData = this.props; const causeTables = map(causeData, (data, cause) => ( <CampaignTable key={cause} cause={cause || 'Uncategorized'} campaigns={data} causeData={causeData} /> )); return <div className="container">{causeTables}</div>; } } export default CampaignOverview;
import React from 'react'; import { map } from 'lodash'; import CampaignTable from '../CampaignTable'; class CampaignOverview extends React.Component { render() { const causeData = this.props; const causeTables = map(causeData, (data, cause) => ( <CampaignTable key={cause} - cause={cause} + cause={cause || 'Uncategorized'} campaigns={data} causeData={causeData} /> )); return <div className="container">{causeTables}</div>; } } export default CampaignOverview;
2
0.086957
1
1
3318165728145a97a1b9b87ac212945d087c1e14
manifests/bin/db-add.py
manifests/bin/db-add.py
import pymysql import os import syslog host = os.environ['DB_HOST'] user = os.environ['DB_USER'] password = os.environ['DB_PASSWORD'] db = os.environ['DB_DATABASE'] syslog.openlog(facility=syslog.LOG_USER) syslog.syslog("Inserting new business data into database.") connection = pymysql.connect(host=host, user=user, password=password, db=db, cursorclass=pymysql.cursors.DictCursor) try: with connection.cursor() as cursor: # Create a new record sql = "CALL insert_data({0})".format(1) cursor.execute(sql) # connection is not autocommit by default. So you must commit to save # your changes. connection.commit() finally: connection.close()
import pymysql import os import syslog host = os.environ['DB_HOST'] user = os.environ['DB_USER'] password = os.environ['DB_PASSWORD'] db = os.environ['DB_DATABASE'] syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER) syslog.syslog("Inserting new business data into database.") connection = pymysql.connect(host=host, user=user, password=password, db=db, cursorclass=pymysql.cursors.DictCursor) try: with connection.cursor() as cursor: # Create a new record sql = "CALL insert_data({0})".format(1) cursor.execute(sql) # connection is not autocommit by default. So you must commit to save # your changes. connection.commit() finally: connection.close()
Set flag to log process id in syslog
Set flag to log process id in syslog
Python
apache-2.0
boundary/tsi-lab,boundary/tsi-lab,jdgwartney/tsi-lab,jdgwartney/tsi-lab,jdgwartney/tsi-lab,boundary/tsi-lab,jdgwartney/tsi-lab,boundary/tsi-lab
python
## Code Before: import pymysql import os import syslog host = os.environ['DB_HOST'] user = os.environ['DB_USER'] password = os.environ['DB_PASSWORD'] db = os.environ['DB_DATABASE'] syslog.openlog(facility=syslog.LOG_USER) syslog.syslog("Inserting new business data into database.") connection = pymysql.connect(host=host, user=user, password=password, db=db, cursorclass=pymysql.cursors.DictCursor) try: with connection.cursor() as cursor: # Create a new record sql = "CALL insert_data({0})".format(1) cursor.execute(sql) # connection is not autocommit by default. So you must commit to save # your changes. connection.commit() finally: connection.close() ## Instruction: Set flag to log process id in syslog ## Code After: import pymysql import os import syslog host = os.environ['DB_HOST'] user = os.environ['DB_USER'] password = os.environ['DB_PASSWORD'] db = os.environ['DB_DATABASE'] syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER) syslog.syslog("Inserting new business data into database.") connection = pymysql.connect(host=host, user=user, password=password, db=db, cursorclass=pymysql.cursors.DictCursor) try: with connection.cursor() as cursor: # Create a new record sql = "CALL insert_data({0})".format(1) cursor.execute(sql) # connection is not autocommit by default. So you must commit to save # your changes. connection.commit() finally: connection.close()
import pymysql import os import syslog host = os.environ['DB_HOST'] user = os.environ['DB_USER'] password = os.environ['DB_PASSWORD'] db = os.environ['DB_DATABASE'] - syslog.openlog(facility=syslog.LOG_USER) + syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER) ? ++++++++++++++++++++++++++ syslog.syslog("Inserting new business data into database.") connection = pymysql.connect(host=host, user=user, password=password, db=db, cursorclass=pymysql.cursors.DictCursor) try: with connection.cursor() as cursor: # Create a new record sql = "CALL insert_data({0})".format(1) cursor.execute(sql) # connection is not autocommit by default. So you must commit to save # your changes. connection.commit() finally: connection.close()
2
0.066667
1
1
28551cb73845ba9c05accc0da874bac428e71d6f
src/LaravelCommentServiceProvider.php
src/LaravelCommentServiceProvider.php
<?php namespace Actuallymab\LaravelComment; use Illuminate\Support\ServiceProvider; class LaravelCommentServiceProvider extends ServiceProvider { protected $defer = false; /** * Perform post-registration booting of services. * * @return void */ public function boot() { $this->publishes([ __DIR__.'/../database/migrations/' => database_path('migrations') ], 'migrations'); } /** * Register package services. * * @return void */ public function register() { } }
<?php namespace Actuallymab\LaravelComment; use Illuminate\Support\ServiceProvider; class LaravelCommentServiceProvider extends ServiceProvider { protected $defer = false; /** * Perform post-registration booting of services. * * @return void */ public function boot() { $timestamp = date('Y_m_d_His', time()); $this->publishes([ __DIR__ . '/../database/migrations/create_comments_table.php.stub' => $this->app->databasePath() . "/migrations/{$timestamp}_create_comments_table.php", ], 'migrations'); } /** * Register package services. * * @return void */ public function register() { } }
Add date generation while publishing migrations
Add date generation while publishing migrations Uses the migration stub and prefixes it with the current timestamp.
PHP
mit
actuallymab/laravel-comment
php
## Code Before: <?php namespace Actuallymab\LaravelComment; use Illuminate\Support\ServiceProvider; class LaravelCommentServiceProvider extends ServiceProvider { protected $defer = false; /** * Perform post-registration booting of services. * * @return void */ public function boot() { $this->publishes([ __DIR__.'/../database/migrations/' => database_path('migrations') ], 'migrations'); } /** * Register package services. * * @return void */ public function register() { } } ## Instruction: Add date generation while publishing migrations Uses the migration stub and prefixes it with the current timestamp. ## Code After: <?php namespace Actuallymab\LaravelComment; use Illuminate\Support\ServiceProvider; class LaravelCommentServiceProvider extends ServiceProvider { protected $defer = false; /** * Perform post-registration booting of services. * * @return void */ public function boot() { $timestamp = date('Y_m_d_His', time()); $this->publishes([ __DIR__ . '/../database/migrations/create_comments_table.php.stub' => $this->app->databasePath() . "/migrations/{$timestamp}_create_comments_table.php", ], 'migrations'); } /** * Register package services. * * @return void */ public function register() { } }
<?php namespace Actuallymab\LaravelComment; use Illuminate\Support\ServiceProvider; class LaravelCommentServiceProvider extends ServiceProvider { protected $defer = false; /** * Perform post-registration booting of services. * * @return void */ public function boot() { + $timestamp = date('Y_m_d_His', time()); + $this->publishes([ - __DIR__.'/../database/migrations/' => database_path('migrations') + __DIR__ . '/../database/migrations/create_comments_table.php.stub' => $this->app->databasePath() + . "/migrations/{$timestamp}_create_comments_table.php", ], 'migrations'); } /** * Register package services. * * @return void */ public function register() { } }
5
0.16129
4
1
cf18968b1115f67dbb48c36834d1ba08e32aeb8d
js/nalyt.js
js/nalyt.js
$(document).ready(function(){ if (analytics) { $('a[target=_blank]').click(function (e) { var url = this.getAttribute("href") || this.getAttribute("xlink:href"); analytics.track("externalLink", {url: url}); }); window.onpopstate = function (event) { analytics.page("Slide", {url: location.href}); } } });
$(document).ready(function(){ if (analytics) { $('a[target=_blank]').click(function (e) { var url = this.getAttribute("href") || this.getAttribute("xlink:href"); analytics.track("Clicked External Link", {url: url}); }); window.onpopstate = function (event) { analytics.page("Slide", {url: location.href}); } } });
Change name of the event
Change name of the event
JavaScript
mit
cyberFund/cyberep.cyber.fund,cyberFund/cyberep.cyber.fund
javascript
## Code Before: $(document).ready(function(){ if (analytics) { $('a[target=_blank]').click(function (e) { var url = this.getAttribute("href") || this.getAttribute("xlink:href"); analytics.track("externalLink", {url: url}); }); window.onpopstate = function (event) { analytics.page("Slide", {url: location.href}); } } }); ## Instruction: Change name of the event ## Code After: $(document).ready(function(){ if (analytics) { $('a[target=_blank]').click(function (e) { var url = this.getAttribute("href") || this.getAttribute("xlink:href"); analytics.track("Clicked External Link", {url: url}); }); window.onpopstate = function (event) { analytics.page("Slide", {url: location.href}); } } });
$(document).ready(function(){ if (analytics) { $('a[target=_blank]').click(function (e) { var url = this.getAttribute("href") || this.getAttribute("xlink:href"); - analytics.track("externalLink", {url: url}); + analytics.track("Clicked External Link", {url: url}); ? +++++ +++ + }); window.onpopstate = function (event) { analytics.page("Slide", {url: location.href}); } } });
2
0.166667
1
1
db3cadcf3baa22efe65495aca2efe5352d5a89a5
nhs/gunicorn_conf.py
nhs/gunicorn_conf.py
bind = "127.0.0.1:4567" logfile = "/usr/local/ohc/log/op.gunicorn.log" workers = 3
bind = "127.0.0.1:4567" logfile = "/usr/local/ohc/log/op.gunicorn.log" workers = 3 timeout = 60
Extend Gunicorn worker timeout for long-running API calls.
Extend Gunicorn worker timeout for long-running API calls.
Python
agpl-3.0
openhealthcare/open-prescribing,openhealthcare/open-prescribing,openhealthcare/open-prescribing
python
## Code Before: bind = "127.0.0.1:4567" logfile = "/usr/local/ohc/log/op.gunicorn.log" workers = 3 ## Instruction: Extend Gunicorn worker timeout for long-running API calls. ## Code After: bind = "127.0.0.1:4567" logfile = "/usr/local/ohc/log/op.gunicorn.log" workers = 3 timeout = 60
bind = "127.0.0.1:4567" logfile = "/usr/local/ohc/log/op.gunicorn.log" workers = 3 + timeout = 60
1
0.333333
1
0
8de3bdb16aa67014e8656d2e4c2d17c230664b9a
test/CodeGen/X86/sse1.ll
test/CodeGen/X86/sse1.ll
; Tests for SSE1 and below, without SSE2+. ; RUN: llc < %s -mcpu=pentium3 -O3 | FileCheck %s define <8 x i16> @test1(<8 x i32> %a) nounwind { ; CHECK: test1 ret <8 x i16> zeroinitializer }
; Tests for SSE1 and below, without SSE2+. ; RUN: llc < %s -march=x86 -mcpu=pentium3 -O3 | FileCheck %s ; RUN: llc < %s -march=x86-64 -mcpu=pentium3 -O3 | FileCheck %s define <8 x i16> @test1(<8 x i32> %a) nounwind { ; CHECK: test1 ret <8 x i16> zeroinitializer }
Make sure this forces the x86 targets
Make sure this forces the x86 targets git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@112169 91177308-0d34-0410-b5e6-96231b3b80d8
LLVM
apache-2.0
llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm
llvm
## Code Before: ; Tests for SSE1 and below, without SSE2+. ; RUN: llc < %s -mcpu=pentium3 -O3 | FileCheck %s define <8 x i16> @test1(<8 x i32> %a) nounwind { ; CHECK: test1 ret <8 x i16> zeroinitializer } ## Instruction: Make sure this forces the x86 targets git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@112169 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: ; Tests for SSE1 and below, without SSE2+. ; RUN: llc < %s -march=x86 -mcpu=pentium3 -O3 | FileCheck %s ; RUN: llc < %s -march=x86-64 -mcpu=pentium3 -O3 | FileCheck %s define <8 x i16> @test1(<8 x i32> %a) nounwind { ; CHECK: test1 ret <8 x i16> zeroinitializer }
; Tests for SSE1 and below, without SSE2+. - ; RUN: llc < %s -mcpu=pentium3 -O3 | FileCheck %s + ; RUN: llc < %s -march=x86 -mcpu=pentium3 -O3 | FileCheck %s ? +++++++++++ + ; RUN: llc < %s -march=x86-64 -mcpu=pentium3 -O3 | FileCheck %s define <8 x i16> @test1(<8 x i32> %a) nounwind { ; CHECK: test1 ret <8 x i16> zeroinitializer }
3
0.428571
2
1
026b66243985a3bb4de37e17d2e6800dbb2e9cc1
{{cookiecutter.project_slug}}/docker-compose.yml
{{cookiecutter.project_slug}}/docker-compose.yml
version: "2" volumes: database_data: {} services: webserver: build: ./config/webserver ports: - "80:80" volumes_from: - application depends_on: - application application: build: context: . dockerfile: ./config/application/Dockerfile user: application depends_on: - database database: image: postgres volumes: - database_data:/var/lib/postgresql/data
version: "2" volumes: database_data: {} services: webserver: build: ./config/webserver ports: - "80:80" volumes_from: - application depends_on: - application application: build: context: . dockerfile: ./config/application/Dockerfile user: application {%- if cookiecutter.database in ['Postgres', 'MySQL/MariaDB'] %} depends_on: - database {% endif %} {%- if cookiecutter.database == 'Postgres' %} database: image: postgres # Make database accessible on localhost during development # # NOTE: on OS X and Windows you need to configure port forwarding in addition, # # ---- if you use VirtualBox and docker-machine; see # # https://jihedamine.github.io/docker-liferay-virtualbox#setup-port-forwarding # # https://docs.docker.com/engine/installation/#/on-macos-and-windows # ports: # - "5432:5432" volumes: - database_data:/var/lib/postgresql/data {%- elif cookiecutter.database == 'MySQL/MariaDB' %} database: image: mysql # Make database accessible on localhost during development # # NOTE: on OS X and Windows you need to configure port forwarding in addition, # # ---- if you use VirtualBox and docker-machine; see # # https://jihedamine.github.io/docker-liferay-virtualbox#setup-port-forwarding # # https://docs.docker.com/engine/installation/#/on-macos-and-windows # ports: # - "3306:3306" volumes: - database_data:/var/lib/mysql/data {%- endif %}
Use appropriate Docker image for database
Use appropriate Docker image for database
YAML
apache-2.0
painless-software/painless-continuous-delivery,painless-software/painless-continuous-delivery,painless-software/painless-continuous-delivery,painless-software/painless-continuous-delivery
yaml
## Code Before: version: "2" volumes: database_data: {} services: webserver: build: ./config/webserver ports: - "80:80" volumes_from: - application depends_on: - application application: build: context: . dockerfile: ./config/application/Dockerfile user: application depends_on: - database database: image: postgres volumes: - database_data:/var/lib/postgresql/data ## Instruction: Use appropriate Docker image for database ## Code After: version: "2" volumes: database_data: {} services: webserver: build: ./config/webserver ports: - "80:80" volumes_from: - application depends_on: - application application: build: context: . dockerfile: ./config/application/Dockerfile user: application {%- if cookiecutter.database in ['Postgres', 'MySQL/MariaDB'] %} depends_on: - database {% endif %} {%- if cookiecutter.database == 'Postgres' %} database: image: postgres # Make database accessible on localhost during development # # NOTE: on OS X and Windows you need to configure port forwarding in addition, # # ---- if you use VirtualBox and docker-machine; see # # https://jihedamine.github.io/docker-liferay-virtualbox#setup-port-forwarding # # https://docs.docker.com/engine/installation/#/on-macos-and-windows # ports: # - "5432:5432" volumes: - database_data:/var/lib/postgresql/data {%- elif cookiecutter.database == 'MySQL/MariaDB' %} database: image: mysql # Make database accessible on localhost during development # # NOTE: on OS X and Windows you need to configure port forwarding in addition, # # ---- if you use VirtualBox and docker-machine; see # # https://jihedamine.github.io/docker-liferay-virtualbox#setup-port-forwarding # # https://docs.docker.com/engine/installation/#/on-macos-and-windows # ports: # - "3306:3306" volumes: - database_data:/var/lib/mysql/data {%- endif %}
version: "2" volumes: database_data: {} services: webserver: build: ./config/webserver ports: - "80:80" volumes_from: - application depends_on: - application application: build: context: . dockerfile: ./config/application/Dockerfile user: application + {%- if cookiecutter.database in ['Postgres', 'MySQL/MariaDB'] %} depends_on: - database + {% endif %} + {%- if cookiecutter.database == 'Postgres' %} database: image: postgres + # Make database accessible on localhost during development + # # NOTE: on OS X and Windows you need to configure port forwarding in addition, + # # ---- if you use VirtualBox and docker-machine; see + # # https://jihedamine.github.io/docker-liferay-virtualbox#setup-port-forwarding + # # https://docs.docker.com/engine/installation/#/on-macos-and-windows + # ports: + # - "5432:5432" volumes: - database_data:/var/lib/postgresql/data + {%- elif cookiecutter.database == 'MySQL/MariaDB' %} + database: + image: mysql + # Make database accessible on localhost during development + # # NOTE: on OS X and Windows you need to configure port forwarding in addition, + # # ---- if you use VirtualBox and docker-machine; see + # # https://jihedamine.github.io/docker-liferay-virtualbox#setup-port-forwarding + # # https://docs.docker.com/engine/installation/#/on-macos-and-windows + # ports: + # - "3306:3306" + volumes: + - database_data:/var/lib/mysql/data + {%- endif %}
23
0.821429
23
0
cab38cbb9ce3eb4af39cdf61c9b2fe062146d09f
src/db-manifest.js
src/db-manifest.js
const path = require('path') const { DAGNode } = require('ipld-dag-pb') // Creates a DB manifest file and saves it in IPFS const createDBManifest = async (ipfs, name, type, accessControllerAddress, onlyHash) => { const manifest = { name: name, type: type, accessController: path.join('/ipfs', accessControllerAddress), } let dag const manifestJSON = JSON.stringify(manifest) if (onlyHash) { dag = await new Promise(resolve => { DAGNode.create(Buffer.from(manifestJSON), (err, n) => { resolve(n) }) }) } else { dag = await ipfs.object.put(Buffer.from(manifestJSON)) } return dag.toJSON().multihash.toString() } module.exports = createDBManifest
const path = require('path') const { DAGNode } = require('ipld-dag-pb') // Creates a DB manifest file and saves it in IPFS const createDBManifest = async (ipfs, name, type, accessControllerAddress, onlyHash) => { const manifest = { name: name, type: type, accessController: path.join('/ipfs', accessControllerAddress), } let dag const manifestJSON = JSON.stringify(manifest) if (onlyHash) { dag = await new Promise(resolve => { DAGNode.create(Buffer.from(manifestJSON), (err, n) => { if (err) { throw err } resolve(n) }) }) } else { dag = await ipfs.object.put(Buffer.from(manifestJSON)) } return dag.toJSON().multihash.toString() } module.exports = createDBManifest
Throw error returned from DAGNode.create
Throw error returned from DAGNode.create
JavaScript
mit
haadcode/orbit-db,haadcode/orbit-db,orbitdb/orbit-db,orbitdb/orbit-db
javascript
## Code Before: const path = require('path') const { DAGNode } = require('ipld-dag-pb') // Creates a DB manifest file and saves it in IPFS const createDBManifest = async (ipfs, name, type, accessControllerAddress, onlyHash) => { const manifest = { name: name, type: type, accessController: path.join('/ipfs', accessControllerAddress), } let dag const manifestJSON = JSON.stringify(manifest) if (onlyHash) { dag = await new Promise(resolve => { DAGNode.create(Buffer.from(manifestJSON), (err, n) => { resolve(n) }) }) } else { dag = await ipfs.object.put(Buffer.from(manifestJSON)) } return dag.toJSON().multihash.toString() } module.exports = createDBManifest ## Instruction: Throw error returned from DAGNode.create ## Code After: const path = require('path') const { DAGNode } = require('ipld-dag-pb') // Creates a DB manifest file and saves it in IPFS const createDBManifest = async (ipfs, name, type, accessControllerAddress, onlyHash) => { const manifest = { name: name, type: type, accessController: path.join('/ipfs', accessControllerAddress), } let dag const manifestJSON = JSON.stringify(manifest) if (onlyHash) { dag = await new Promise(resolve => { DAGNode.create(Buffer.from(manifestJSON), (err, n) => { if (err) { throw err } resolve(n) }) }) } else { dag = await ipfs.object.put(Buffer.from(manifestJSON)) } return dag.toJSON().multihash.toString() } module.exports = createDBManifest
const path = require('path') const { DAGNode } = require('ipld-dag-pb') // Creates a DB manifest file and saves it in IPFS const createDBManifest = async (ipfs, name, type, accessControllerAddress, onlyHash) => { const manifest = { name: name, type: type, accessController: path.join('/ipfs', accessControllerAddress), } let dag const manifestJSON = JSON.stringify(manifest) if (onlyHash) { dag = await new Promise(resolve => { - DAGNode.create(Buffer.from(manifestJSON), (err, n) => { resolve(n) }) ? -------------- + DAGNode.create(Buffer.from(manifestJSON), (err, n) => { + if (err) { + throw err + } + resolve(n) + }) }) } else { dag = await ipfs.object.put(Buffer.from(manifestJSON)) } return dag.toJSON().multihash.toString() } module.exports = createDBManifest
7
0.304348
6
1
149f3b5d110b5f774f39eb8d0c35386aebd1adf8
src/main/java/tv/mapper/roadstuff/network/BrushPacket.java
src/main/java/tv/mapper/roadstuff/network/BrushPacket.java
package tv.mapper.roadstuff.network; import java.util.function.Supplier; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.network.NetworkEvent; import tv.mapper.roadstuff.item.ItemBrush; public class BrushPacket { private int pattern; private int paint; public BrushPacket(int pattern, int paint) { this.pattern = pattern; this.paint = paint; } public static void encode(BrushPacket packet, PacketBuffer buffer) { buffer.writeInt(packet.pattern); buffer.writeInt(packet.paint); } public static BrushPacket decode(PacketBuffer buffer) { int pattern = buffer.readInt(); int paint = buffer.readInt(); BrushPacket instance = new BrushPacket(pattern, paint); return instance; } public static void handle(BrushPacket packet, Supplier<NetworkEvent.Context> context) { context.get().setPacketHandled(true); EntityPlayerMP sender = context.get().getSender(); ItemStack item = sender.getHeldItemMainhand(); if(item.getItem() instanceof ItemBrush) sender.getHeldItemMainhand().getTag().setInt("pattern", packet.pattern); } }
package tv.mapper.roadstuff.network; import java.util.function.Supplier; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.network.NetworkEvent; import tv.mapper.roadstuff.item.ItemBrush; public class BrushPacket { private int pattern; private int paint; public BrushPacket(int pattern, int paint) { this.pattern = pattern; this.paint = paint; } public static void encode(BrushPacket packet, PacketBuffer buffer) { buffer.writeInt(packet.pattern); buffer.writeInt(packet.paint); } public static BrushPacket decode(PacketBuffer buffer) { int pattern = buffer.readInt(); int paint = buffer.readInt(); BrushPacket instance = new BrushPacket(pattern, paint); return instance; } public static void handle(BrushPacket packet, Supplier<NetworkEvent.Context> context) { context.get().setPacketHandled(true); EntityPlayerMP sender = context.get().getSender(); if(sender.getHeldItemMainhand().getItem() instanceof ItemBrush) sender.getHeldItemMainhand().getTag().setInt("pattern", packet.pattern); else if(sender.getHeldItemOffhand().getItem() instanceof ItemBrush) sender.getHeldItemOffhand().getTag().setInt("pattern", packet.pattern); } }
Fix brush settings not saved with offhand.
Fix brush settings not saved with offhand.
Java
mit
KillerMapper/roadstuff
java
## Code Before: package tv.mapper.roadstuff.network; import java.util.function.Supplier; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.network.NetworkEvent; import tv.mapper.roadstuff.item.ItemBrush; public class BrushPacket { private int pattern; private int paint; public BrushPacket(int pattern, int paint) { this.pattern = pattern; this.paint = paint; } public static void encode(BrushPacket packet, PacketBuffer buffer) { buffer.writeInt(packet.pattern); buffer.writeInt(packet.paint); } public static BrushPacket decode(PacketBuffer buffer) { int pattern = buffer.readInt(); int paint = buffer.readInt(); BrushPacket instance = new BrushPacket(pattern, paint); return instance; } public static void handle(BrushPacket packet, Supplier<NetworkEvent.Context> context) { context.get().setPacketHandled(true); EntityPlayerMP sender = context.get().getSender(); ItemStack item = sender.getHeldItemMainhand(); if(item.getItem() instanceof ItemBrush) sender.getHeldItemMainhand().getTag().setInt("pattern", packet.pattern); } } ## Instruction: Fix brush settings not saved with offhand. ## Code After: package tv.mapper.roadstuff.network; import java.util.function.Supplier; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.network.NetworkEvent; import tv.mapper.roadstuff.item.ItemBrush; public class BrushPacket { private int pattern; private int paint; public BrushPacket(int pattern, int paint) { this.pattern = pattern; this.paint = paint; } public static void encode(BrushPacket packet, PacketBuffer buffer) { buffer.writeInt(packet.pattern); buffer.writeInt(packet.paint); } public static BrushPacket decode(PacketBuffer buffer) { int pattern = buffer.readInt(); int paint = buffer.readInt(); BrushPacket instance = new BrushPacket(pattern, paint); return instance; } public static void handle(BrushPacket packet, Supplier<NetworkEvent.Context> context) { context.get().setPacketHandled(true); EntityPlayerMP sender = context.get().getSender(); if(sender.getHeldItemMainhand().getItem() instanceof ItemBrush) sender.getHeldItemMainhand().getTag().setInt("pattern", packet.pattern); else if(sender.getHeldItemOffhand().getItem() instanceof ItemBrush) sender.getHeldItemOffhand().getTag().setInt("pattern", packet.pattern); } }
package tv.mapper.roadstuff.network; import java.util.function.Supplier; import net.minecraft.entity.player.EntityPlayerMP; - import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.network.NetworkEvent; import tv.mapper.roadstuff.item.ItemBrush; public class BrushPacket { private int pattern; private int paint; public BrushPacket(int pattern, int paint) { this.pattern = pattern; this.paint = paint; } public static void encode(BrushPacket packet, PacketBuffer buffer) { buffer.writeInt(packet.pattern); buffer.writeInt(packet.paint); } - + public static BrushPacket decode(PacketBuffer buffer) { int pattern = buffer.readInt(); int paint = buffer.readInt(); BrushPacket instance = new BrushPacket(pattern, paint); return instance; } - + public static void handle(BrushPacket packet, Supplier<NetworkEvent.Context> context) { context.get().setPacketHandled(true); EntityPlayerMP sender = context.get().getSender(); + - ItemStack item = sender.getHeldItemMainhand(); - - if(item.getItem() instanceof ItemBrush) ? ^ + if(sender.getHeldItemMainhand().getItem() instanceof ItemBrush) ? ^^^^^^^^^^^^^^^ ++++++++++ sender.getHeldItemMainhand().getTag().setInt("pattern", packet.pattern); + else if(sender.getHeldItemOffhand().getItem() instanceof ItemBrush) + sender.getHeldItemOffhand().getTag().setInt("pattern", packet.pattern); } }
12
0.266667
6
6
18803808f895cc6776fb5cb0b8e1d22c8a4b9905
src/end.js
src/end.js
})();
/** * This is the default configuration for the layout algorithm. It results in * a grid-like layout. A perfect grid when the number of elements to layout * is a perfect square. Otherwise the last couple of elements will be * stretched. */ var defaultConfig = { itemSize: function(item) { return 1; }, phrase: function() { return d3.layout.phrase.TOP_LEFT_TO_RIGHT; }, recurse: function() { return false; }, score: function(itemCount) { // Grid scoring function var chunkItemCount = 0; var itemCountWithIntSquare = Math.pow(Math.ceil(Math.sqrt(itemCount)), 2); return function(chunk, item) { var score = Math.pow(chunkItemCount, 2) < itemCountWithIntSquare ? 1 : 0; if (score === 1) { chunkItemCount++; } else { chunkItemCount = 0; } return score; } } } d3.treemap = function() { var size = [1, 1]; // width, height, phrase = undefined, itemSize = undefined, order = undefined, recurse = undefined, score = undefined; function _layout(nodes) { var config = {}; config.size = size; config.phrase = phrase ? phrase : defaultConfig.phrase; config.itemSize = itemSize ? itemSize : defaultConfig.itemSize; config.recurse = recurse ? recurse : defaultConfig.recurse; config.score = score ? score : defaultConfig.score(nodes.length); var chunks = layout.apply(config, [order ? order(nodes) : nodes]); return chunks.reduce(function(rects, chunk) { var itemRects = chunk.itemRects().map(function(rect) { return rect.toPojo(); }); return rects.concat(itemRects); }, []); } _layout.size = function(_) { if (!arguments.length) return size; size = _; return _layout; } _layout.itemSize = function(_) { if (!arguments.length) return itemSize; itemSize = _; return _layout; } _layout.phrase = function(_) { if (!arguments.length) return phrase; phrase = _; return _layout; } _layout.order = function(_) { if (!arguments.length) return order; order = _; return _layout; } _layout.recurse = function(_) { if (!arguments.length) return recurse; recurse = _; return _layout; } _layout.score = function(_) { if (!arguments.length) return score; score = _; return _layout; } return _layout; } })();
Add some wrapper code which defines the public API.
Add some wrapper code which defines the public API. * There is now also a default configuration for the algorithm. Which is for now the only one.
JavaScript
mit
bbroeksema/d3-treemap
javascript
## Code Before: })(); ## Instruction: Add some wrapper code which defines the public API. * There is now also a default configuration for the algorithm. Which is for now the only one. ## Code After: /** * This is the default configuration for the layout algorithm. It results in * a grid-like layout. A perfect grid when the number of elements to layout * is a perfect square. Otherwise the last couple of elements will be * stretched. */ var defaultConfig = { itemSize: function(item) { return 1; }, phrase: function() { return d3.layout.phrase.TOP_LEFT_TO_RIGHT; }, recurse: function() { return false; }, score: function(itemCount) { // Grid scoring function var chunkItemCount = 0; var itemCountWithIntSquare = Math.pow(Math.ceil(Math.sqrt(itemCount)), 2); return function(chunk, item) { var score = Math.pow(chunkItemCount, 2) < itemCountWithIntSquare ? 1 : 0; if (score === 1) { chunkItemCount++; } else { chunkItemCount = 0; } return score; } } } d3.treemap = function() { var size = [1, 1]; // width, height, phrase = undefined, itemSize = undefined, order = undefined, recurse = undefined, score = undefined; function _layout(nodes) { var config = {}; config.size = size; config.phrase = phrase ? phrase : defaultConfig.phrase; config.itemSize = itemSize ? itemSize : defaultConfig.itemSize; config.recurse = recurse ? recurse : defaultConfig.recurse; config.score = score ? score : defaultConfig.score(nodes.length); var chunks = layout.apply(config, [order ? order(nodes) : nodes]); return chunks.reduce(function(rects, chunk) { var itemRects = chunk.itemRects().map(function(rect) { return rect.toPojo(); }); return rects.concat(itemRects); }, []); } _layout.size = function(_) { if (!arguments.length) return size; size = _; return _layout; } _layout.itemSize = function(_) { if (!arguments.length) return itemSize; itemSize = _; return _layout; } _layout.phrase = function(_) { if (!arguments.length) return phrase; phrase = _; return _layout; } _layout.order = function(_) { if (!arguments.length) return order; order = _; return _layout; } _layout.recurse = function(_) { if (!arguments.length) return recurse; recurse = _; return _layout; } _layout.score = function(_) { if (!arguments.length) return score; score = _; return _layout; } return _layout; } })();
+ + /** + * This is the default configuration for the layout algorithm. It results in + * a grid-like layout. A perfect grid when the number of elements to layout + * is a perfect square. Otherwise the last couple of elements will be + * stretched. + */ + var defaultConfig = { + itemSize: function(item) { return 1; }, + phrase: function() { return d3.layout.phrase.TOP_LEFT_TO_RIGHT; }, + recurse: function() { return false; }, + score: function(itemCount) { // Grid scoring function + var chunkItemCount = 0; + var itemCountWithIntSquare = Math.pow(Math.ceil(Math.sqrt(itemCount)), 2); + return function(chunk, item) { + var score = Math.pow(chunkItemCount, 2) < itemCountWithIntSquare ? 1 : 0; + if (score === 1) { + chunkItemCount++; + } else { + chunkItemCount = 0; + } + return score; + } + } + } + + d3.treemap = function() { + var size = [1, 1]; // width, height, + phrase = undefined, + itemSize = undefined, + order = undefined, + recurse = undefined, + score = undefined; + + function _layout(nodes) { + var config = {}; + config.size = size; + config.phrase = phrase ? phrase : defaultConfig.phrase; + config.itemSize = itemSize ? itemSize : defaultConfig.itemSize; + config.recurse = recurse ? recurse : defaultConfig.recurse; + config.score = score ? score : defaultConfig.score(nodes.length); + + var chunks = layout.apply(config, [order ? order(nodes) : nodes]); + return chunks.reduce(function(rects, chunk) { + var itemRects = chunk.itemRects().map(function(rect) { return rect.toPojo(); }); + return rects.concat(itemRects); + }, []); + } + + _layout.size = function(_) { + if (!arguments.length) return size; + size = _; + return _layout; + } + + _layout.itemSize = function(_) { + if (!arguments.length) return itemSize; + itemSize = _; + return _layout; + } + + _layout.phrase = function(_) { + if (!arguments.length) return phrase; + phrase = _; + return _layout; + } + + _layout.order = function(_) { + if (!arguments.length) return order; + order = _; + return _layout; + } + + _layout.recurse = function(_) { + if (!arguments.length) return recurse; + recurse = _; + return _layout; + } + + _layout.score = function(_) { + if (!arguments.length) return score; + score = _; + return _layout; + } + + return _layout; + } + })();
88
88
88
0
f2aa3dc3172a44c9420b91efc89c7c932c09ee68
.github/workflows/build-cop-rotation.yml
.github/workflows/build-cop-rotation.yml
name: Build Cop on: schedule: - cron: "*/5 * * * *" # - cron: 0 11 * * MON-FRI jobs: stuff: runs-on: ubuntu-latest steps: #- id: assigned # uses: lee-dohm/last-assigned@master # with: # query: 'label:build-cop-rotation' # token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} - id: rotation uses: lee-dohm/team-rotation@v1 with: teamName: "@spinnaker/build-cops" # last: ${{ steps.assigned.outputs.last }} - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} with: filename: .github/build-cop-template.md assignees: ${{ steps.rotation.outputs.next }}
name: Build Cop on: schedule: - cron: "*/5 * * * *" # - cron: 0 11 * * MON-FRI jobs: stuff: runs-on: ubuntu-latest steps: #- id: assigned # uses: lee-dohm/last-assigned@master # with: # query: 'label:build-cop-rotation' # token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} - id: rotation uses: lee-dohm/team-rotation@v1 with: teamName: "@spinnaker/build-cops" token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} # last: ${{ steps.assigned.outputs.last }} - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} with: filename: .github/build-cop-template.md assignees: ${{ steps.rotation.outputs.next }}
Add token for GH action
chore(buildcop): Add token for GH action
YAML
apache-2.0
spinnaker/spinnaker,spinnaker/spinnaker,spinnaker/spinnaker,spinnaker/spinnaker
yaml
## Code Before: name: Build Cop on: schedule: - cron: "*/5 * * * *" # - cron: 0 11 * * MON-FRI jobs: stuff: runs-on: ubuntu-latest steps: #- id: assigned # uses: lee-dohm/last-assigned@master # with: # query: 'label:build-cop-rotation' # token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} - id: rotation uses: lee-dohm/team-rotation@v1 with: teamName: "@spinnaker/build-cops" # last: ${{ steps.assigned.outputs.last }} - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} with: filename: .github/build-cop-template.md assignees: ${{ steps.rotation.outputs.next }} ## Instruction: chore(buildcop): Add token for GH action ## Code After: name: Build Cop on: schedule: - cron: "*/5 * * * *" # - cron: 0 11 * * MON-FRI jobs: stuff: runs-on: ubuntu-latest steps: #- id: assigned # uses: lee-dohm/last-assigned@master # with: # query: 'label:build-cop-rotation' # token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} - id: rotation uses: lee-dohm/team-rotation@v1 with: teamName: "@spinnaker/build-cops" token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} # last: ${{ steps.assigned.outputs.last }} - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} with: filename: .github/build-cop-template.md assignees: ${{ steps.rotation.outputs.next }}
name: Build Cop - on: ? - + on: schedule: - cron: "*/5 * * * *" # - cron: 0 11 * * MON-FRI jobs: stuff: - runs-on: ubuntu-latest ? ----- + runs-on: ubuntu-latest steps: #- id: assigned # uses: lee-dohm/last-assigned@master # with: # query: 'label:build-cop-rotation' # token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} - id: rotation uses: lee-dohm/team-rotation@v1 with: teamName: "@spinnaker/build-cops" + token: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} # last: ${{ steps.assigned.outputs.last }} - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.SPINNAKERBOT_GHA_BUILD_COP_TOKEN }} with: filename: .github/build-cop-template.md assignees: ${{ steps.rotation.outputs.next }}
5
0.185185
3
2
2ebab9cc919121d668ffad1c70bb5e066d7e363c
helm/nats-operator/templates/secret.yaml
helm/nats-operator/templates/secret.yaml
{{- if .Values.auth.enabled }} apiVersion: v1 kind: Secret metadata: name: {{ template "nats.fullname" . }}-clients-auth namespace: {{ .Release.Namespace }} labels: app: "{{ template "nats.name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" test: "{{ .Values.auth.password }}" type: Opaque data: clients-auth.json: {{ (tpl (.Files.Get "config/client-auth.json") . ) | b64enc }} {{- end }}
{{- if .Values.auth.enabled }} apiVersion: v1 kind: Secret metadata: name: {{ template "nats.fullname" . }}-clients-auth namespace: {{ .Release.Namespace }} labels: app: "{{ template "nats.name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" type: Opaque data: clients-auth.json: {{ (tpl (.Files.Get "config/client-auth.json") . ) | b64enc }} {{- end }}
Remove password from Secret metadata
Remove password from Secret metadata
YAML
apache-2.0
pires/nats-operator,nats-io/nats-operator,nats-io/nats-operator
yaml
## Code Before: {{- if .Values.auth.enabled }} apiVersion: v1 kind: Secret metadata: name: {{ template "nats.fullname" . }}-clients-auth namespace: {{ .Release.Namespace }} labels: app: "{{ template "nats.name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" test: "{{ .Values.auth.password }}" type: Opaque data: clients-auth.json: {{ (tpl (.Files.Get "config/client-auth.json") . ) | b64enc }} {{- end }} ## Instruction: Remove password from Secret metadata ## Code After: {{- if .Values.auth.enabled }} apiVersion: v1 kind: Secret metadata: name: {{ template "nats.fullname" . }}-clients-auth namespace: {{ .Release.Namespace }} labels: app: "{{ template "nats.name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" type: Opaque data: clients-auth.json: {{ (tpl (.Files.Get "config/client-auth.json") . ) | b64enc }} {{- end }}
{{- if .Values.auth.enabled }} apiVersion: v1 kind: Secret metadata: name: {{ template "nats.fullname" . }}-clients-auth namespace: {{ .Release.Namespace }} labels: app: "{{ template "nats.name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - test: "{{ .Values.auth.password }}" type: Opaque data: clients-auth.json: {{ (tpl (.Files.Get "config/client-auth.json") . ) | b64enc }} {{- end }}
1
0.0625
0
1
ace4694db6c9d081e8c3a7434f246de5c76a21b1
config/services_test.yaml
config/services_test.yaml
imports: - { resource: "../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" }
imports: - { resource: "../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } sylius_api: enabled: true
Enable Sylius API in a testing mode
Enable Sylius API in a testing mode
YAML
mit
Sylius/Sylius-Standard,Sylius/Sylius-Standard,Sylius/Sylius-Standard
yaml
## Code Before: imports: - { resource: "../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } ## Instruction: Enable Sylius API in a testing mode ## Code After: imports: - { resource: "../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } sylius_api: enabled: true
imports: - { resource: "../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } + + sylius_api: + enabled: true
3
1.5
3
0
d50212874f972774a3170ecbf3dc2693b4484b75
scripts/ci/create_final_release.drone.yml
scripts/ci/create_final_release.drone.yml
image: cloudfoundry/diego-pipeline env: - GOROOT=/usr/local/go - BOSH_USER={{BOSH_USER}} - BOSH_PASSWORD={{BOSH_PASSWORD}} - BOSH_TARGET={{BOSH_TARGET}} - DEPLOYMENT_NAME={{DEPLOYMENT_NAME}} - GO_PIPELINE_COUNTER={{GO_PIPELINE_COUNTER}} - FINAL_RELEASE_VERSION_OFFSET={{FINAL_RELEASE_VERSION_OFFSET}} script: - ./scripts/ci/create_final_release_inner cache: - /tmp/cache - cf-release/.blobs - output - .blobs
image: cloudfoundry/diego-pipeline env: - GOROOT=/usr/local/go - GO_PIPELINE_COUNTER={{GO_PIPELINE_COUNTER}} - FINAL_RELEASE_VERSION_OFFSET={{FINAL_RELEASE_VERSION_OFFSET}} script: - ./scripts/ci/create_final_release_inner cache: - /tmp/cache - cf-release/.blobs - output - .blobs
Remove unused Bosh/deployment ENV vars for create final release script
Remove unused Bosh/deployment ENV vars for create final release script Signed-off-by: Amit Gupta <535797150de130123ee3ab47e6ea07e409eb6358@pivotal.io>
YAML
apache-2.0
cloudfoundry-incubator/diego-release,cloudfoundry-incubator/diego-release,cloudfoundry-incubator/diego-release,cloudfoundry-incubator/diego-release
yaml
## Code Before: image: cloudfoundry/diego-pipeline env: - GOROOT=/usr/local/go - BOSH_USER={{BOSH_USER}} - BOSH_PASSWORD={{BOSH_PASSWORD}} - BOSH_TARGET={{BOSH_TARGET}} - DEPLOYMENT_NAME={{DEPLOYMENT_NAME}} - GO_PIPELINE_COUNTER={{GO_PIPELINE_COUNTER}} - FINAL_RELEASE_VERSION_OFFSET={{FINAL_RELEASE_VERSION_OFFSET}} script: - ./scripts/ci/create_final_release_inner cache: - /tmp/cache - cf-release/.blobs - output - .blobs ## Instruction: Remove unused Bosh/deployment ENV vars for create final release script Signed-off-by: Amit Gupta <535797150de130123ee3ab47e6ea07e409eb6358@pivotal.io> ## Code After: image: cloudfoundry/diego-pipeline env: - GOROOT=/usr/local/go - GO_PIPELINE_COUNTER={{GO_PIPELINE_COUNTER}} - FINAL_RELEASE_VERSION_OFFSET={{FINAL_RELEASE_VERSION_OFFSET}} script: - ./scripts/ci/create_final_release_inner cache: - /tmp/cache - cf-release/.blobs - output - .blobs
image: cloudfoundry/diego-pipeline env: - GOROOT=/usr/local/go - - BOSH_USER={{BOSH_USER}} - - BOSH_PASSWORD={{BOSH_PASSWORD}} - - BOSH_TARGET={{BOSH_TARGET}} - - DEPLOYMENT_NAME={{DEPLOYMENT_NAME}} - GO_PIPELINE_COUNTER={{GO_PIPELINE_COUNTER}} - FINAL_RELEASE_VERSION_OFFSET={{FINAL_RELEASE_VERSION_OFFSET}} script: - ./scripts/ci/create_final_release_inner cache: - /tmp/cache - cf-release/.blobs - output - .blobs
4
0.210526
0
4
13c35f4ddba9ffbee5c3c522727f0ebe93f42cdb
src/program.rs
src/program.rs
use color::Color; pub struct Program { image: Vec<Vec<Color>>, } impl Program { pub fn get(coords: (usize, usize)) -> Option<Color> { unimplemented!(); } pub fn neighbors(coords: (usize, usize)) -> &[Color] { unimplemented!(); } pub fn neighbors_with_coords(coords: (usize, usize)) -> &[(usize, usize, Color)] { unimplemented!(); } }
use color::Color; pub struct Program { image: Vec<Vec<Color>>, } impl Program { pub fn get(&self, coords: (usize, usize)) -> Option<Color> { unimplemented!(); } pub fn neighbors(&self, coords: (usize, usize)) -> &[Color] { unimplemented!(); } pub fn neighbors_with_coords(&self, coords: (usize, usize)) -> &[(usize, usize, Color)] { unimplemented!(); } }
Add missing `&self` parameters to `Program` methods
Add missing `&self` parameters to `Program` methods D'oh.
Rust
mit
ijks/piet-rs
rust
## Code Before: use color::Color; pub struct Program { image: Vec<Vec<Color>>, } impl Program { pub fn get(coords: (usize, usize)) -> Option<Color> { unimplemented!(); } pub fn neighbors(coords: (usize, usize)) -> &[Color] { unimplemented!(); } pub fn neighbors_with_coords(coords: (usize, usize)) -> &[(usize, usize, Color)] { unimplemented!(); } } ## Instruction: Add missing `&self` parameters to `Program` methods D'oh. ## Code After: use color::Color; pub struct Program { image: Vec<Vec<Color>>, } impl Program { pub fn get(&self, coords: (usize, usize)) -> Option<Color> { unimplemented!(); } pub fn neighbors(&self, coords: (usize, usize)) -> &[Color] { unimplemented!(); } pub fn neighbors_with_coords(&self, coords: (usize, usize)) -> &[(usize, usize, Color)] { unimplemented!(); } }
use color::Color; pub struct Program { image: Vec<Vec<Color>>, } impl Program { - pub fn get(coords: (usize, usize)) -> Option<Color> { + pub fn get(&self, coords: (usize, usize)) -> Option<Color> { ? +++++++ unimplemented!(); } - pub fn neighbors(coords: (usize, usize)) -> &[Color] { + pub fn neighbors(&self, coords: (usize, usize)) -> &[Color] { ? +++++++ unimplemented!(); } - pub fn neighbors_with_coords(coords: (usize, usize)) -> &[(usize, usize, Color)] { + pub fn neighbors_with_coords(&self, coords: (usize, usize)) -> &[(usize, usize, Color)] { ? +++++++ unimplemented!(); } }
6
0.315789
3
3
a61ed50ad071f5c578dc91aab6d9ead53f9af587
README.md
README.md
This repository is the home for the official Ilios Docker images as well as some sample configurations for running these images in concert. If you are attempting to run Ilios from within a container infrastructure we hope the `docker-compose.yml` file will help you understand how these pieces can be fit together. ## Not ready for production These sample files are not quite ready for production use, you will need to customize them for your own environment to ensure you are storing data from MySql and Ilios in a way that will not be lost when the docker containers are removed or replaced. ## How can I try Ilios with these containers? - Clone or [download](https://github.com/ilios/docker/archive/master.zip) this repository - [Install](https://docs.docker.com/compose/install/) docker and docker-compose - run the command `docker-compose -f demo-docker-compose.yml up -d` - After a few moments visit http://localhost:8000 ## Containers for running Ilios These containers are auto built on the docker hub and can be found at https://hub.docker.com/u/ilios/ ### Contains: - php-apache - mysql - mysql-demo - php-apache-dev
This repository is the home for the official Ilios Docker images as well as some sample configurations for running these images in concert. If you are attempting to run Ilios from within a container infrastructure we hope the `docker-compose.yml` file will help you understand how these pieces can be fit together. ## Not ready for production These sample files are not quite ready for production use, you will need to customize them for your own environment to ensure you are storing data from MySql and Ilios in a way that will not be lost when the docker containers are removed or replaced. ## How can I try Ilios with these containers? - Clone or [download](https://github.com/ilios/docker/archive/master.zip) this repository - [Install](https://docs.docker.com/compose/install/) docker and docker-compose - run the command `docker-compose -f demo-docker-compose.yml up -d` - After a few moments visit http://localhost:8000 ## Containers for running Ilios These containers are auto built on the docker hub and can be found at https://hub.docker.com/u/ilios/ ### Contains: - php-apache - mysql - mysql-demo - php-apache-dev - ssh-admin
Add ssh-admin to container list
Add ssh-admin to container list
Markdown
mit
ilios/docker
markdown
## Code Before: This repository is the home for the official Ilios Docker images as well as some sample configurations for running these images in concert. If you are attempting to run Ilios from within a container infrastructure we hope the `docker-compose.yml` file will help you understand how these pieces can be fit together. ## Not ready for production These sample files are not quite ready for production use, you will need to customize them for your own environment to ensure you are storing data from MySql and Ilios in a way that will not be lost when the docker containers are removed or replaced. ## How can I try Ilios with these containers? - Clone or [download](https://github.com/ilios/docker/archive/master.zip) this repository - [Install](https://docs.docker.com/compose/install/) docker and docker-compose - run the command `docker-compose -f demo-docker-compose.yml up -d` - After a few moments visit http://localhost:8000 ## Containers for running Ilios These containers are auto built on the docker hub and can be found at https://hub.docker.com/u/ilios/ ### Contains: - php-apache - mysql - mysql-demo - php-apache-dev ## Instruction: Add ssh-admin to container list ## Code After: This repository is the home for the official Ilios Docker images as well as some sample configurations for running these images in concert. If you are attempting to run Ilios from within a container infrastructure we hope the `docker-compose.yml` file will help you understand how these pieces can be fit together. ## Not ready for production These sample files are not quite ready for production use, you will need to customize them for your own environment to ensure you are storing data from MySql and Ilios in a way that will not be lost when the docker containers are removed or replaced. ## How can I try Ilios with these containers? - Clone or [download](https://github.com/ilios/docker/archive/master.zip) this repository - [Install](https://docs.docker.com/compose/install/) docker and docker-compose - run the command `docker-compose -f demo-docker-compose.yml up -d` - After a few moments visit http://localhost:8000 ## Containers for running Ilios These containers are auto built on the docker hub and can be found at https://hub.docker.com/u/ilios/ ### Contains: - php-apache - mysql - mysql-demo - php-apache-dev - ssh-admin
This repository is the home for the official Ilios Docker images as well as some sample configurations for running these images in concert. If you are attempting to run Ilios from within a container infrastructure we hope the `docker-compose.yml` file will help you understand how these pieces can be fit together. ## Not ready for production These sample files are not quite ready for production use, you will need to customize them for your own environment to ensure you are storing data from MySql and Ilios in a way that will not be lost when the docker containers are removed or replaced. ## How can I try Ilios with these containers? - Clone or [download](https://github.com/ilios/docker/archive/master.zip) this repository - [Install](https://docs.docker.com/compose/install/) docker and docker-compose - run the command `docker-compose -f demo-docker-compose.yml up -d` - After a few moments visit http://localhost:8000 ## Containers for running Ilios These containers are auto built on the docker hub and can be found at https://hub.docker.com/u/ilios/ ### Contains: - php-apache - mysql - mysql-demo - php-apache-dev + - ssh-admin
1
0.043478
1
0
393740f1c350dc7d919df869aa27bbcb33ba8e87
lib/confinicky/commands/set.rb
lib/confinicky/commands/set.rb
command :set do |c| c.syntax = 'cfy set' c.summary = 'Sets an environment variable in your configuration file.' c.description = '' c.example 'description', 'cfy set MY_VAR="some value"' c.action do |args, options| if Confinicky::ShellFile.has_path? say_error "Please set '#{Confinicky::FILE_PATH_VAR}' to point to your local configuration file." puts "Try running 'cfy use' for more info." abort end shell_file = Confinicky::ShellFile.new duplicate_count = shell_file.find_duplicates.length if duplicate_count > 0 say_error "Your configuration cannot be managed because it currently has duplicate export statements." puts "You must run 'cfy clean' before you can manage your configuration." abort end say_error "You must supply an expression such as: MY_VAR=\"some value\"" and about if args.first.nil? if shell_file.set!(args.first) shell_file.write! say_ok "Successfully set '#{args.first}'." puts "Run 'source #{Confinicky::ShellFile.file_path}' or open a new terminal/shell window." else say_error "Could not set '#{args.first}' please double check to ensure you used the appropriate syntax." end end end
command :set do |c| c.syntax = 'cfy set' c.summary = 'Sets an environment variable in your configuration file.' c.description = '' c.example 'Set an environment variable.', 'cfy set export MY_VAR="some value"' c.action do |args, options| # Abort if not yet setup. if !Confinicky::ConfigurationFile.setup? say_error "Confinicky's configuration is not valid or has not been setup." puts "Try running 'cfy setup'." abort end # Abort if missing arguments. if args.length < 2 say_error "You must supply an expression such as: `cfy set export MY_VAR=\"some value\"`" abort end # Use the appropriate command group controller. command, expression = args[0], args[1] command_group = Confinicky::Controllers::Exports.new if command == Confinicky::Arguments::ENVIRONMENT command_group = Confinicky::Controllers::Aliases.new if command == Confinicky::Arguments::ALIAS # Abort if duplicate commands have been found. if command_group.duplicates.length > 0 say_error "Your configuration cannot be managed because it currently has duplicate statements." puts "You must run 'cfy clean' before you can manage your configuration." abort end # Set the variable and save changes to disk. if command_group.set!(expression) and command_group.save! say_ok "Successfully set '#{args.first}'." puts "Open a new terminal/shell window for these changes to take affect." else say_error "Could not set '#{expression}' please double check to ensure you used the appropriate syntax." end end end
Set method now utilizes controllers to interface with shell file.
Set method now utilizes controllers to interface with shell file.
Ruby
mit
jimjeffers/confinicky,jimjeffers/confinicky
ruby
## Code Before: command :set do |c| c.syntax = 'cfy set' c.summary = 'Sets an environment variable in your configuration file.' c.description = '' c.example 'description', 'cfy set MY_VAR="some value"' c.action do |args, options| if Confinicky::ShellFile.has_path? say_error "Please set '#{Confinicky::FILE_PATH_VAR}' to point to your local configuration file." puts "Try running 'cfy use' for more info." abort end shell_file = Confinicky::ShellFile.new duplicate_count = shell_file.find_duplicates.length if duplicate_count > 0 say_error "Your configuration cannot be managed because it currently has duplicate export statements." puts "You must run 'cfy clean' before you can manage your configuration." abort end say_error "You must supply an expression such as: MY_VAR=\"some value\"" and about if args.first.nil? if shell_file.set!(args.first) shell_file.write! say_ok "Successfully set '#{args.first}'." puts "Run 'source #{Confinicky::ShellFile.file_path}' or open a new terminal/shell window." else say_error "Could not set '#{args.first}' please double check to ensure you used the appropriate syntax." end end end ## Instruction: Set method now utilizes controllers to interface with shell file. ## Code After: command :set do |c| c.syntax = 'cfy set' c.summary = 'Sets an environment variable in your configuration file.' c.description = '' c.example 'Set an environment variable.', 'cfy set export MY_VAR="some value"' c.action do |args, options| # Abort if not yet setup. if !Confinicky::ConfigurationFile.setup? say_error "Confinicky's configuration is not valid or has not been setup." puts "Try running 'cfy setup'." abort end # Abort if missing arguments. if args.length < 2 say_error "You must supply an expression such as: `cfy set export MY_VAR=\"some value\"`" abort end # Use the appropriate command group controller. command, expression = args[0], args[1] command_group = Confinicky::Controllers::Exports.new if command == Confinicky::Arguments::ENVIRONMENT command_group = Confinicky::Controllers::Aliases.new if command == Confinicky::Arguments::ALIAS # Abort if duplicate commands have been found. if command_group.duplicates.length > 0 say_error "Your configuration cannot be managed because it currently has duplicate statements." puts "You must run 'cfy clean' before you can manage your configuration." abort end # Set the variable and save changes to disk. if command_group.set!(expression) and command_group.save! say_ok "Successfully set '#{args.first}'." puts "Open a new terminal/shell window for these changes to take affect." else say_error "Could not set '#{expression}' please double check to ensure you used the appropriate syntax." end end end
command :set do |c| c.syntax = 'cfy set' c.summary = 'Sets an environment variable in your configuration file.' c.description = '' - c.example 'description', 'cfy set MY_VAR="some value"' + c.example 'Set an environment variable.', 'cfy set export MY_VAR="some value"' c.action do |args, options| - if Confinicky::ShellFile.has_path? - say_error "Please set '#{Confinicky::FILE_PATH_VAR}' to point to your local configuration file." + + # Abort if not yet setup. + if !Confinicky::ConfigurationFile.setup? + say_error "Confinicky's configuration is not valid or has not been setup." - puts "Try running 'cfy use' for more info." ? - -------------- + puts "Try running 'cfy setup'." ? +++ abort end - shell_file = Confinicky::ShellFile.new + # Abort if missing arguments. + if args.length < 2 + say_error "You must supply an expression such as: `cfy set export MY_VAR=\"some value\"`" + abort + end - duplicate_count = shell_file.find_duplicates.length - if duplicate_count > 0 + # Use the appropriate command group controller. + command, expression = args[0], args[1] + command_group = Confinicky::Controllers::Exports.new if command == Confinicky::Arguments::ENVIRONMENT + command_group = Confinicky::Controllers::Aliases.new if command == Confinicky::Arguments::ALIAS + + # Abort if duplicate commands have been found. + if command_group.duplicates.length > 0 - say_error "Your configuration cannot be managed because it currently has duplicate export statements." ? ------- + say_error "Your configuration cannot be managed because it currently has duplicate statements." puts "You must run 'cfy clean' before you can manage your configuration." abort end - say_error "You must supply an expression such as: MY_VAR=\"some value\"" and about if args.first.nil? + # Set the variable and save changes to disk. + if command_group.set!(expression) and command_group.save! + say_ok "Successfully set '#{args.first}'." + puts "Open a new terminal/shell window for these changes to take affect." + else + say_error "Could not set '#{expression}' please double check to ensure you used the appropriate syntax." + end - if shell_file.set!(args.first) - shell_file.write! - say_ok "Successfully set '#{args.first}'." - puts "Run 'source #{Confinicky::ShellFile.file_path}' or open a new terminal/shell window." - else - say_error "Could not set '#{args.first}' please double check to ensure you used the appropriate syntax." - end end end
42
1.272727
26
16
506b58e0b57a0a2f927234ab4142b8ba15f8dcb0
app/assets/stylesheets/shared/typography.scss
app/assets/stylesheets/shared/typography.scss
.title { color: $very-light-blue; text-align: center; font-size: 350%; font-family: Tahoma, Geneva, sans-serif; } .subtitle { color: $light-blue; text-align: center; font-size: 250%; font-family: Tahoma, Geneva, sans-serif; border-bottom: 3px solid $light-blue; width: 80%; margin: 0 auto 50px; }
.title { color: white; text-align: center; font-size: 450%; font-family: Tahoma, Geneva, sans-serif; } .subtitle { color: $light-blue; text-align: center; font-size: 250%; font-family: Tahoma, Geneva, sans-serif; border-bottom: 3px solid $light-blue; width: 80%; margin: 0 auto 50px; }
Change title size and color
Change title size and color Makes the title stick out more by making it white and increasing the font size.
SCSS
mit
gjh33/SimpleDream,gjh33/SimpleDream,gjh33/SimpleDream
scss
## Code Before: .title { color: $very-light-blue; text-align: center; font-size: 350%; font-family: Tahoma, Geneva, sans-serif; } .subtitle { color: $light-blue; text-align: center; font-size: 250%; font-family: Tahoma, Geneva, sans-serif; border-bottom: 3px solid $light-blue; width: 80%; margin: 0 auto 50px; } ## Instruction: Change title size and color Makes the title stick out more by making it white and increasing the font size. ## Code After: .title { color: white; text-align: center; font-size: 450%; font-family: Tahoma, Geneva, sans-serif; } .subtitle { color: $light-blue; text-align: center; font-size: 250%; font-family: Tahoma, Geneva, sans-serif; border-bottom: 3px solid $light-blue; width: 80%; margin: 0 auto 50px; }
.title { - color: $very-light-blue; + color: white; text-align: center; - font-size: 350%; ? ^ + font-size: 450%; ? ^ font-family: Tahoma, Geneva, sans-serif; } .subtitle { color: $light-blue; text-align: center; font-size: 250%; font-family: Tahoma, Geneva, sans-serif; border-bottom: 3px solid $light-blue; width: 80%; margin: 0 auto 50px; }
4
0.25
2
2
486922db3947f126f0dcd6674eda76779c2a81f5
deploy.sh
deploy.sh
set -e # exit with nonzero exit code if anything fails # check current branch if [ 'master' != $TRAVIS_BRANCH ]; then echo "Deploy only on master branch. Current branch: '$branch'."; exit 0; fi # clear and re-create the dist directory rm -rf dist || exit 0; # Run kotlin application to generate various data ./gradlew --no-daemon --stacktrace run -Dtravis=true # Build React Application npm run pack # sync with remote folder rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/dist/ deploy@kotlin.link:~/files/kotlin.link
set -e # exit with nonzero exit code if anything fails # check current branch if [ 'master' != $TRAVIS_BRANCH ]; then echo "Deploy only on master branch. Current branch: '$branch'."; exit 0; fi # clear and re-create the dist directory rm -rf dist || exit 0; # Run kotlin application to generate various data echo $JAVA_HOME java -version ./gradlew --no-daemon --stacktrace run -Dtravis=true # Build React Application npm run pack # sync with remote folder rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/dist/ deploy@kotlin.link:~/files/kotlin.link
Set java 8 to default.
Set java 8 to default.
Shell
apache-2.0
KotlinBy/awesome-kotlin,KotlinBy/awesome-kotlin,KotlinBy/awesome-kotlin,KotlinBy/awesome-kotlin
shell
## Code Before: set -e # exit with nonzero exit code if anything fails # check current branch if [ 'master' != $TRAVIS_BRANCH ]; then echo "Deploy only on master branch. Current branch: '$branch'."; exit 0; fi # clear and re-create the dist directory rm -rf dist || exit 0; # Run kotlin application to generate various data ./gradlew --no-daemon --stacktrace run -Dtravis=true # Build React Application npm run pack # sync with remote folder rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/dist/ deploy@kotlin.link:~/files/kotlin.link ## Instruction: Set java 8 to default. ## Code After: set -e # exit with nonzero exit code if anything fails # check current branch if [ 'master' != $TRAVIS_BRANCH ]; then echo "Deploy only on master branch. Current branch: '$branch'."; exit 0; fi # clear and re-create the dist directory rm -rf dist || exit 0; # Run kotlin application to generate various data echo $JAVA_HOME java -version ./gradlew --no-daemon --stacktrace run -Dtravis=true # Build React Application npm run pack # sync with remote folder rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/dist/ deploy@kotlin.link:~/files/kotlin.link
set -e # exit with nonzero exit code if anything fails # check current branch if [ 'master' != $TRAVIS_BRANCH ]; then echo "Deploy only on master branch. Current branch: '$branch'."; exit 0; fi # clear and re-create the dist directory rm -rf dist || exit 0; # Run kotlin application to generate various data + echo $JAVA_HOME + java -version ./gradlew --no-daemon --stacktrace run -Dtravis=true # Build React Application npm run pack # sync with remote folder rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/dist/ deploy@kotlin.link:~/files/kotlin.link
2
0.111111
2
0
7d5ed3f8f9086d3c8aa2411ac4f90c00dcc1789e
README.md
README.md
m3da-dissector ============== Wireshark M3DA dissector This is a very first shot at writing an M3DA dissector, partially in Lua, for Wireshark. To use it you need to build it you need to have Lua headers files installed on your machine. On Debian/Ubuntu you can run: > sudo apt-get install build-essential liblua5.1-0-dev Build the dissector: > make Once compiled you can run it by running: > wireshark -X lua_script:dissector.lua test1.pcapng It's licensed under the term of the Eclipse Public License - v 1.0. See the LICENSE file at the root of the repository. The binary deserializer and a couple of Lua utilities where extraced from the Mihini project: http://www.eclipse.org/mihini
m3da-dissector ============== Wireshark M3DA dissector This is a very first shot at writing an M3DA dissector, partially in Lua, for Wireshark. # Linux build isntructions To use it you need to build it you need to have Lua headers files installed on your machine. On Debian/Ubuntu you can run: > sudo apt-get install build-essential liblua5.1-0-dev Build the dissector: > make # Windows builds tips These are just tips since there is not uniform way to build on Window. I did manage to build it on a Widows7+MinGW. Tips: - Use MinGW+MSYS. - Download Lua 5.1 sources and compile it with mingw target (I had to rename the ddl lua51.dll into lua5.1.dll as WireShark use that name) - Build the checks.dll and bysant.dll (need to change the makefile a bit) - Copy the dll into the WireShark directory - Then it worked (for me) If anybody cares to provide cleaner/more detailed instructions for Windows I am happy to take in the changes! # Use the dissector Once compiled you can run it by running: > wireshark -X lua_script:dissector.lua test1.pcapng It's licensed under the term of the Eclipse Public License - v 1.0. See the LICENSE file at the root of the repository. The binary deserializer and a couple of Lua utilities where extraced from the Mihini project: http://www.eclipse.org/mihini
Add build tips for windows
Add build tips for windows
Markdown
epl-1.0
cbugot/m3da-dissector
markdown
## Code Before: m3da-dissector ============== Wireshark M3DA dissector This is a very first shot at writing an M3DA dissector, partially in Lua, for Wireshark. To use it you need to build it you need to have Lua headers files installed on your machine. On Debian/Ubuntu you can run: > sudo apt-get install build-essential liblua5.1-0-dev Build the dissector: > make Once compiled you can run it by running: > wireshark -X lua_script:dissector.lua test1.pcapng It's licensed under the term of the Eclipse Public License - v 1.0. See the LICENSE file at the root of the repository. The binary deserializer and a couple of Lua utilities where extraced from the Mihini project: http://www.eclipse.org/mihini ## Instruction: Add build tips for windows ## Code After: m3da-dissector ============== Wireshark M3DA dissector This is a very first shot at writing an M3DA dissector, partially in Lua, for Wireshark. # Linux build isntructions To use it you need to build it you need to have Lua headers files installed on your machine. On Debian/Ubuntu you can run: > sudo apt-get install build-essential liblua5.1-0-dev Build the dissector: > make # Windows builds tips These are just tips since there is not uniform way to build on Window. I did manage to build it on a Widows7+MinGW. Tips: - Use MinGW+MSYS. - Download Lua 5.1 sources and compile it with mingw target (I had to rename the ddl lua51.dll into lua5.1.dll as WireShark use that name) - Build the checks.dll and bysant.dll (need to change the makefile a bit) - Copy the dll into the WireShark directory - Then it worked (for me) If anybody cares to provide cleaner/more detailed instructions for Windows I am happy to take in the changes! # Use the dissector Once compiled you can run it by running: > wireshark -X lua_script:dissector.lua test1.pcapng It's licensed under the term of the Eclipse Public License - v 1.0. See the LICENSE file at the root of the repository. The binary deserializer and a couple of Lua utilities where extraced from the Mihini project: http://www.eclipse.org/mihini
m3da-dissector ============== Wireshark M3DA dissector This is a very first shot at writing an M3DA dissector, partially in Lua, for Wireshark. + # Linux build isntructions + To use it you need to build it you need to have Lua headers files installed on your machine. On Debian/Ubuntu you can run: > sudo apt-get install build-essential liblua5.1-0-dev Build the dissector: > make + # Windows builds tips + These are just tips since there is not uniform way to build on Window. I did manage to build it + on a Widows7+MinGW. + Tips: + - Use MinGW+MSYS. + - Download Lua 5.1 sources and compile it with mingw target (I had to rename + the ddl lua51.dll into lua5.1.dll as WireShark use that name) + - Build the checks.dll and bysant.dll (need to change the makefile a bit) + - Copy the dll into the WireShark directory + - Then it worked (for me) + If anybody cares to provide cleaner/more detailed instructions for Windows I am happy to take + in the changes! + + + + + # Use the dissector Once compiled you can run it by running: > wireshark -X lua_script:dissector.lua test1.pcapng + + + + It's licensed under the term of the Eclipse Public License - v 1.0. See the LICENSE file at the root of the repository. The binary deserializer and a couple of Lua utilities where extraced from the Mihini project: http://www.eclipse.org/mihini
23
1
23
0
a01cfd0f9593052e89288045a3c3133d3ab2bcfb
.travis.yml
.travis.yml
go_import_path: github.com/cloudflare/unsee jobs: include: - stage: Lint docs language: node_js node_js: "8" cache: directories: - node_modules # install defaults to "npm install", which is done via make install: [] script: make lint-docs - stage: Test Go code language: go go: "1.9.2" before_script: - make mock-assets cache: directories: - vendor script: make test-go - stage: Test JavaScript code language: node_js node_js: "8" env: - NODE_ENV=test cache: directories: - node_modules # install defaults to "npm install", which is done via make install: [] script: make test-js - stage: Lint Go code language: go go: "1.9.2" script: make lint-go - stage: Lint JavaScript code language: node_js node_js: "8" cache: directories: - node_modules # install defaults to "npm install", which is done via make install: [] script: make lint-js - stage: Build Docker image sudo: true addons: apt: packages: - docker-ce script: make docker-image
go_import_path: github.com/cloudflare/unsee defaults_go: &DEFAULTS_GO language: go go: "1.9.2" cache: directories: - vendor defaults_js: &DEFAULTS_JS language: node_js node_js: "8" # install defaults to "npm install", which is done via make install: [] cache: directories: - node_modules jobs: include: - stage: Lint docs <<: *DEFAULTS_JS script: make lint-docs - stage: Test Go code <<: *DEFAULTS_GO before_script: - make mock-assets script: make test-go - stage: Test JavaScript code <<: *DEFAULTS_JS env: - NODE_ENV=test script: make test-js - stage: Lint Go code <<: *DEFAULTS_GO script: make lint-go - stage: Lint JavaScript code <<: *DEFAULTS_JS script: make lint-js - stage: Build Docker image sudo: true addons: apt: packages: - docker-ce script: make docker-image
Use YAML anchors to deduplicate common stage variables
Use YAML anchors to deduplicate common stage variables
YAML
apache-2.0
cloudflare/unsee,cloudflare/unsee,cloudflare/unsee,cloudflare/unsee,cloudflare/unsee
yaml
## Code Before: go_import_path: github.com/cloudflare/unsee jobs: include: - stage: Lint docs language: node_js node_js: "8" cache: directories: - node_modules # install defaults to "npm install", which is done via make install: [] script: make lint-docs - stage: Test Go code language: go go: "1.9.2" before_script: - make mock-assets cache: directories: - vendor script: make test-go - stage: Test JavaScript code language: node_js node_js: "8" env: - NODE_ENV=test cache: directories: - node_modules # install defaults to "npm install", which is done via make install: [] script: make test-js - stage: Lint Go code language: go go: "1.9.2" script: make lint-go - stage: Lint JavaScript code language: node_js node_js: "8" cache: directories: - node_modules # install defaults to "npm install", which is done via make install: [] script: make lint-js - stage: Build Docker image sudo: true addons: apt: packages: - docker-ce script: make docker-image ## Instruction: Use YAML anchors to deduplicate common stage variables ## Code After: go_import_path: github.com/cloudflare/unsee defaults_go: &DEFAULTS_GO language: go go: "1.9.2" cache: directories: - vendor defaults_js: &DEFAULTS_JS language: node_js node_js: "8" # install defaults to "npm install", which is done via make install: [] cache: directories: - node_modules jobs: include: - stage: Lint docs <<: *DEFAULTS_JS script: make lint-docs - stage: Test Go code <<: *DEFAULTS_GO before_script: - make mock-assets script: make test-go - stage: Test JavaScript code <<: *DEFAULTS_JS env: - NODE_ENV=test script: make test-js - stage: Lint Go code <<: *DEFAULTS_GO script: make lint-go - stage: Lint JavaScript code <<: *DEFAULTS_JS script: make lint-js - stage: Build Docker image sudo: true addons: apt: packages: - docker-ce script: make docker-image
go_import_path: github.com/cloudflare/unsee + + defaults_go: &DEFAULTS_GO + language: go + go: "1.9.2" + cache: + directories: + - vendor + + defaults_js: &DEFAULTS_JS + language: node_js + node_js: "8" + # install defaults to "npm install", which is done via make + install: [] + cache: + directories: + - node_modules jobs: include: - stage: Lint docs + <<: *DEFAULTS_JS - language: node_js - node_js: "8" - cache: - directories: - - node_modules - # install defaults to "npm install", which is done via make - install: [] script: make lint-docs - stage: Test Go code + <<: *DEFAULTS_GO - language: go - go: "1.9.2" before_script: - make mock-assets - cache: - directories: - - vendor script: make test-go - stage: Test JavaScript code + <<: *DEFAULTS_JS - language: node_js - node_js: "8" env: - NODE_ENV=test - cache: - directories: - - node_modules - # install defaults to "npm install", which is done via make - install: [] script: make test-js - stage: Lint Go code + <<: *DEFAULTS_GO - language: go - go: "1.9.2" script: make lint-go - stage: Lint JavaScript code + <<: *DEFAULTS_JS - language: node_js - node_js: "8" - cache: - directories: - - node_modules - # install defaults to "npm install", which is done via make - install: [] script: make lint-js - stage: Build Docker image sudo: true addons: apt: packages: - docker-ce script: make docker-image
49
0.844828
21
28
aed2b64aa3afd62059fc667968cce4ed07a9b802
README.md
README.md
[![Build Status](https://travis-ci.org/atsid/breadboard.svg?branch=master)](https://travis-ci.org/atsid/breadboard) [![Code Climate](https://codeclimate.com/github/atsid/breadboard/badges/gpa.svg)](https://codeclimate.com/github/atsid/breadboard) [![Dependency Status](https://david-dm.org/atsid/breadboard.svg)](https://david-dm.org/atsid/breadboard) Breadboard is a rapid-prototyping platform for Node.js applications that include RESTful services with hypermedia. JSON Schema is used to define object models and the possible links associated with them, and then Breadboard auto-generates MongoDB persistence code and Express RESTful service middleware. RQL is used to allow very simple query matchers to determine if a given link should be present on a response object, hence expressing all application state via the responses.
[![Build Status](https://travis-ci.org/atsid/breadboard.svg?branch=master)](https://travis-ci.org/atsid/breadboard) [![Code Climate](https://codeclimate.com/github/atsid/breadboard/badges/gpa.svg)](https://codeclimate.com/github/atsid/breadboard) [![Dependency Status](https://david-dm.org/atsid/breadboard.svg)](https://david-dm.org/atsid/breadboard) [![Dev Dependency Status](https://david-dm.org/atsid/breadboard.svg/devstatus)](https://david-dm.org/atsid/breadboard) Breadboard is a rapid-prototyping platform for Node.js applications that include RESTful services with hypermedia. JSON Schema is used to define object models and the possible links associated with them, and then Breadboard auto-generates MongoDB persistence code and Express RESTful service middleware. RQL is used to allow very simple query matchers to determine if a given link should be present on a response object, hence expressing all application state via the responses.
Add dev dependency status for badger
Add dev dependency status for badger
Markdown
apache-2.0
atsid/breadboard,atsid/breadboard
markdown
## Code Before: [![Build Status](https://travis-ci.org/atsid/breadboard.svg?branch=master)](https://travis-ci.org/atsid/breadboard) [![Code Climate](https://codeclimate.com/github/atsid/breadboard/badges/gpa.svg)](https://codeclimate.com/github/atsid/breadboard) [![Dependency Status](https://david-dm.org/atsid/breadboard.svg)](https://david-dm.org/atsid/breadboard) Breadboard is a rapid-prototyping platform for Node.js applications that include RESTful services with hypermedia. JSON Schema is used to define object models and the possible links associated with them, and then Breadboard auto-generates MongoDB persistence code and Express RESTful service middleware. RQL is used to allow very simple query matchers to determine if a given link should be present on a response object, hence expressing all application state via the responses. ## Instruction: Add dev dependency status for badger ## Code After: [![Build Status](https://travis-ci.org/atsid/breadboard.svg?branch=master)](https://travis-ci.org/atsid/breadboard) [![Code Climate](https://codeclimate.com/github/atsid/breadboard/badges/gpa.svg)](https://codeclimate.com/github/atsid/breadboard) [![Dependency Status](https://david-dm.org/atsid/breadboard.svg)](https://david-dm.org/atsid/breadboard) [![Dev Dependency Status](https://david-dm.org/atsid/breadboard.svg/devstatus)](https://david-dm.org/atsid/breadboard) Breadboard is a rapid-prototyping platform for Node.js applications that include RESTful services with hypermedia. JSON Schema is used to define object models and the possible links associated with them, and then Breadboard auto-generates MongoDB persistence code and Express RESTful service middleware. RQL is used to allow very simple query matchers to determine if a given link should be present on a response object, hence expressing all application state via the responses.
[![Build Status](https://travis-ci.org/atsid/breadboard.svg?branch=master)](https://travis-ci.org/atsid/breadboard) [![Code Climate](https://codeclimate.com/github/atsid/breadboard/badges/gpa.svg)](https://codeclimate.com/github/atsid/breadboard) [![Dependency Status](https://david-dm.org/atsid/breadboard.svg)](https://david-dm.org/atsid/breadboard) + [![Dev Dependency Status](https://david-dm.org/atsid/breadboard.svg/devstatus)](https://david-dm.org/atsid/breadboard) Breadboard is a rapid-prototyping platform for Node.js applications that include RESTful services with hypermedia. JSON Schema is used to define object models and the possible links associated with them, and then Breadboard auto-generates MongoDB persistence code and Express RESTful service middleware. RQL is used to allow very simple query matchers to determine if a given link should be present on a response object, hence expressing all application state via the responses.
1
0.125
1
0
f25cbbb397595e6267b1a1ebcb8204e06ffda708
.appveyor.yml
.appveyor.yml
init: - git config --global core.autocrlf true branches: only: - master - release - dev - /^(.*\/)?ci-.*$/ - /^rel\/.*/ build_script: - ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off os: Visual Studio 2017
init: - git config --global core.autocrlf true branches: only: - master - release - dev - /^(.*\/)?ci-.*$/ - /^rel\/.*/ build_script: - ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off image: Previous Visual Studio 2017
Use previous version of Appveyor image to avoid dotnet bug
Use previous version of Appveyor image to avoid dotnet bug
YAML
apache-2.0
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
yaml
## Code Before: init: - git config --global core.autocrlf true branches: only: - master - release - dev - /^(.*\/)?ci-.*$/ - /^rel\/.*/ build_script: - ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off os: Visual Studio 2017 ## Instruction: Use previous version of Appveyor image to avoid dotnet bug ## Code After: init: - git config --global core.autocrlf true branches: only: - master - release - dev - /^(.*\/)?ci-.*$/ - /^rel\/.*/ build_script: - ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off image: Previous Visual Studio 2017
init: - git config --global core.autocrlf true branches: only: - master - release - dev - /^(.*\/)?ci-.*$/ - /^rel\/.*/ build_script: - ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off - os: Visual Studio 2017 ? - + image: Previous Visual Studio 2017 ? ++++++++++++ +
2
0.105263
1
1
72a7fbe99c2a816d12aa0b2fb5c1fd0a1a850bfb
src/Api/Invoices.php
src/Api/Invoices.php
<?php namespace OpsWay\ZohoBooks\Api; class Invoices extends BaseApi { const API_PATH = 'invoices'; const API_KEY = 'invoice'; public function applyCredits($invoiceId, $data) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/credits', $this->organizationId, $data); return true; } public function markAsSent($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/sent', $this->organizationId); return true; } public function markAsVoid($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/void', $this->organizationId); return true; } }
<?php namespace OpsWay\ZohoBooks\Api; class Invoices extends BaseApi { const API_PATH = 'invoices'; const API_KEY = 'invoice'; public function applyCredits($invoiceId, $data) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/credits', $this->organizationId, $data); return true; } public function markAsSent($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/sent', $this->organizationId); return true; } public function markAsVoid($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/void', $this->organizationId); return true; } /** * Email an invoice to the customer * * @see: https://www.zoho.com/books/api/v3/invoices/#email-an-invoice * * @param string $invoiceId * @param array $data * * @return bool */ public function email($invoiceId, array $data = []) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/email', $this->organizationId, $data); return true; } }
Add "email an invoice" method
Add "email an invoice" method | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a See: https://www.zoho.com/books/api/v3/invoices/#email-an-invoice
PHP
mit
opsway/zohobooks-api
php
## Code Before: <?php namespace OpsWay\ZohoBooks\Api; class Invoices extends BaseApi { const API_PATH = 'invoices'; const API_KEY = 'invoice'; public function applyCredits($invoiceId, $data) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/credits', $this->organizationId, $data); return true; } public function markAsSent($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/sent', $this->organizationId); return true; } public function markAsVoid($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/void', $this->organizationId); return true; } } ## Instruction: Add "email an invoice" method | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a See: https://www.zoho.com/books/api/v3/invoices/#email-an-invoice ## Code After: <?php namespace OpsWay\ZohoBooks\Api; class Invoices extends BaseApi { const API_PATH = 'invoices'; const API_KEY = 'invoice'; public function applyCredits($invoiceId, $data) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/credits', $this->organizationId, $data); return true; } public function markAsSent($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/sent', $this->organizationId); return true; } public function markAsVoid($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/void', $this->organizationId); return true; } /** * Email an invoice to the customer * * @see: https://www.zoho.com/books/api/v3/invoices/#email-an-invoice * * @param string $invoiceId * @param array $data * * @return bool */ public function email($invoiceId, array $data = []) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/email', $this->organizationId, $data); return true; } }
<?php namespace OpsWay\ZohoBooks\Api; class Invoices extends BaseApi { const API_PATH = 'invoices'; const API_KEY = 'invoice'; public function applyCredits($invoiceId, $data) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/credits', $this->organizationId, $data); return true; } public function markAsSent($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/sent', $this->organizationId); return true; } public function markAsVoid($invoiceId) { $this->client->post(static::API_PATH.'/'.$invoiceId.'/status/void', $this->organizationId); return true; } + + /** + * Email an invoice to the customer + * + * @see: https://www.zoho.com/books/api/v3/invoices/#email-an-invoice + * + * @param string $invoiceId + * @param array $data + * + * @return bool + */ + public function email($invoiceId, array $data = []) + { + $this->client->post(static::API_PATH.'/'.$invoiceId.'/email', $this->organizationId, $data); + + return true; + } }
17
0.566667
17
0
8a800542971448bada1cd0482510a5ff5c57aa5b
css/main.css
css/main.css
@import url(uno.css); @import url(monokai.css); /* Modifications */ pre.highlight, .highlight pre { padding: 10px; } pre.highlight code, .highlight pre code { white-space: pre-wrap; } .btn, .navigation__item a { margin: 5px 0; white-space: nowrap; } .pagination__page-number { display: inline-block; padding: 10px; } .categories a, .tags a { border: 1px solid #e25440; border-radius: 20px; color: #e25440; display: inline-block; font-size: 12px; margin: 5px 0; padding: 5px 10px; text-shadow: none; white-space: nowrap; } .post-meta__tags { font-size: 12px; padding: 0 5px; } .footer__copyright { margin: 0 20px 10px; } .user-image { margin-bottom: 1.2em; position: relative; width: 100px; height: 100px; border: 3px solid #fff; border-radius:100%; }
@import url(uno.css); @import url(monokai.css); /* Custom CSS by elmundio87 */ code { color: #FFF; } .highlighter-rouge { background-color: rgba(100,100,100,0.25); color: #444; } /* Modifications */ pre.highlight, .highlight pre { padding: 10px; } pre.highlight code, .highlight pre code { white-space: pre-wrap; } .btn, .navigation__item a { margin: 5px 0; white-space: nowrap; } .pagination__page-number { display: inline-block; padding: 10px; } .categories a, .tags a { border: 1px solid #e25440; border-radius: 20px; color: #e25440; display: inline-block; font-size: 12px; margin: 5px 0; padding: 5px 10px; text-shadow: none; white-space: nowrap; } .post-meta__tags { font-size: 12px; padding: 0 5px; } .footer__copyright { margin: 0 20px 10px; } .user-image { margin-bottom: 1.2em; position: relative; width: 100px; height: 100px; border: 3px solid #fff; border-radius:100%; }
Fix highlighting and the default code colour
Fix highlighting and the default code colour
CSS
mit
elmundio87/elmundio87.github.com,elmundio87/elmundio87.github.com,elmundio87/elmundio87.github.com
css
## Code Before: @import url(uno.css); @import url(monokai.css); /* Modifications */ pre.highlight, .highlight pre { padding: 10px; } pre.highlight code, .highlight pre code { white-space: pre-wrap; } .btn, .navigation__item a { margin: 5px 0; white-space: nowrap; } .pagination__page-number { display: inline-block; padding: 10px; } .categories a, .tags a { border: 1px solid #e25440; border-radius: 20px; color: #e25440; display: inline-block; font-size: 12px; margin: 5px 0; padding: 5px 10px; text-shadow: none; white-space: nowrap; } .post-meta__tags { font-size: 12px; padding: 0 5px; } .footer__copyright { margin: 0 20px 10px; } .user-image { margin-bottom: 1.2em; position: relative; width: 100px; height: 100px; border: 3px solid #fff; border-radius:100%; } ## Instruction: Fix highlighting and the default code colour ## Code After: @import url(uno.css); @import url(monokai.css); /* Custom CSS by elmundio87 */ code { color: #FFF; } .highlighter-rouge { background-color: rgba(100,100,100,0.25); color: #444; } /* Modifications */ pre.highlight, .highlight pre { padding: 10px; } pre.highlight code, .highlight pre code { white-space: pre-wrap; } .btn, .navigation__item a { margin: 5px 0; white-space: nowrap; } .pagination__page-number { display: inline-block; padding: 10px; } .categories a, .tags a { border: 1px solid #e25440; border-radius: 20px; color: #e25440; display: inline-block; font-size: 12px; margin: 5px 0; padding: 5px 10px; text-shadow: none; white-space: nowrap; } .post-meta__tags { font-size: 12px; padding: 0 5px; } .footer__copyright { margin: 0 20px 10px; } .user-image { margin-bottom: 1.2em; position: relative; width: 100px; height: 100px; border: 3px solid #fff; border-radius:100%; }
@import url(uno.css); @import url(monokai.css); + + /* Custom CSS by elmundio87 */ + + code { + color: #FFF; + } + + .highlighter-rouge { + background-color: rgba(100,100,100,0.25); + color: #444; + } /* Modifications */ pre.highlight, .highlight pre { padding: 10px; } pre.highlight code, .highlight pre code { white-space: pre-wrap; } .btn, .navigation__item a { margin: 5px 0; white-space: nowrap; } .pagination__page-number { display: inline-block; padding: 10px; } .categories a, .tags a { border: 1px solid #e25440; border-radius: 20px; color: #e25440; display: inline-block; font-size: 12px; margin: 5px 0; padding: 5px 10px; text-shadow: none; white-space: nowrap; } .post-meta__tags { font-size: 12px; padding: 0 5px; } .footer__copyright { margin: 0 20px 10px; } .user-image { margin-bottom: 1.2em; position: relative; width: 100px; height: 100px; border: 3px solid #fff; border-radius:100%; }
11
0.196429
11
0
0124e35b59c947e7fb7cd77f9913011a93a3ec97
.commitlintrc.json
.commitlintrc.json
{ "extends": ["@commitlint/config-angular"], "rules": { "subject-case": [ 2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] ] } }
{ "extends": ["@commitlint/config-angular"], "rules": { "subject-case": [ 2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] ], "type-enum": [ 2, "always", [ "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "sample" ] ] } }
Add sample as possible type for commit message
ci: Add sample as possible type for commit message
JSON
mit
kamilmysliwiec/nest,kamilmysliwiec/nest
json
## Code Before: { "extends": ["@commitlint/config-angular"], "rules": { "subject-case": [ 2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] ] } } ## Instruction: ci: Add sample as possible type for commit message ## Code After: { "extends": ["@commitlint/config-angular"], "rules": { "subject-case": [ 2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] ], "type-enum": [ 2, "always", [ "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "sample" ] ] } }
{ "extends": ["@commitlint/config-angular"], "rules": { "subject-case": [ 2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"] + ], + "type-enum": [ + 2, + "always", + [ + "build", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "sample" + ] ] } }
17
1.7
17
0
acd21aa9772245401efa95b171de8183ff431a91
requirements.txt
requirements.txt
numpy oslo.config<1.10.0,>=1.9.3 oslo.db>=1.8.0 oslo.log<1.1.0,>=1.0.0 oslo.policy>=0.3.0 oslo.serialization<1.5.0,>=1.4.0 oslo.utils<1.5.0,>=1.4.0 oslosphinx>=2.2.0 # Apache-2.0 pandas pecan>=0.9 python-swiftclient pytimeparse # pytimeparse misses this dep for now future futures requests six sqlalchemy sqlalchemy-utils stevedore tooz>=0.11 voluptuous werkzeug Jinja2 PyYAML sysv_ipc msgpack-python trollius retrying pytz WebOb>=1.4.1 alembic>=0.7.6 psycopg2 pymysql
numpy oslo.config>=1.9.3 oslo.db>=1.8.0 oslo.log>=1.0.0 oslo.policy>=0.3.0 oslo.serialization>=1.4.0 oslo.utils>=1.4.0 oslosphinx>=2.2.0 # Apache-2.0 pandas pecan>=0.9 python-swiftclient pytimeparse # pytimeparse misses this dep for now future futures requests six sqlalchemy sqlalchemy-utils stevedore tooz>=0.11 voluptuous werkzeug Jinja2 PyYAML sysv_ipc msgpack-python trollius retrying pytz WebOb>=1.4.1 alembic>=0.7.6 psycopg2 pymysql
Remove upper cap on oslo libs
Remove upper cap on oslo libs This has been copied from openstack/requirements, but Gnocchi does not have actually any kind of limitations of those so far. Change-Id: I442ef450c8b71846984b295de252dbde6e580686
Text
apache-2.0
leandroreox/gnocchi,sileht/gnocchi,gnocchixyz/gnocchi,leandroreox/gnocchi,sileht/gnocchi,gnocchixyz/gnocchi
text
## Code Before: numpy oslo.config<1.10.0,>=1.9.3 oslo.db>=1.8.0 oslo.log<1.1.0,>=1.0.0 oslo.policy>=0.3.0 oslo.serialization<1.5.0,>=1.4.0 oslo.utils<1.5.0,>=1.4.0 oslosphinx>=2.2.0 # Apache-2.0 pandas pecan>=0.9 python-swiftclient pytimeparse # pytimeparse misses this dep for now future futures requests six sqlalchemy sqlalchemy-utils stevedore tooz>=0.11 voluptuous werkzeug Jinja2 PyYAML sysv_ipc msgpack-python trollius retrying pytz WebOb>=1.4.1 alembic>=0.7.6 psycopg2 pymysql ## Instruction: Remove upper cap on oslo libs This has been copied from openstack/requirements, but Gnocchi does not have actually any kind of limitations of those so far. Change-Id: I442ef450c8b71846984b295de252dbde6e580686 ## Code After: numpy oslo.config>=1.9.3 oslo.db>=1.8.0 oslo.log>=1.0.0 oslo.policy>=0.3.0 oslo.serialization>=1.4.0 oslo.utils>=1.4.0 oslosphinx>=2.2.0 # Apache-2.0 pandas pecan>=0.9 python-swiftclient pytimeparse # pytimeparse misses this dep for now future futures requests six sqlalchemy sqlalchemy-utils stevedore tooz>=0.11 voluptuous werkzeug Jinja2 PyYAML sysv_ipc msgpack-python trollius retrying pytz WebOb>=1.4.1 alembic>=0.7.6 psycopg2 pymysql
numpy - oslo.config<1.10.0,>=1.9.3 ? -------- + oslo.config>=1.9.3 oslo.db>=1.8.0 - oslo.log<1.1.0,>=1.0.0 ? ------- + oslo.log>=1.0.0 oslo.policy>=0.3.0 - oslo.serialization<1.5.0,>=1.4.0 ? ------- + oslo.serialization>=1.4.0 - oslo.utils<1.5.0,>=1.4.0 ? ------- + oslo.utils>=1.4.0 oslosphinx>=2.2.0 # Apache-2.0 pandas pecan>=0.9 python-swiftclient pytimeparse # pytimeparse misses this dep for now future futures requests six sqlalchemy sqlalchemy-utils stevedore tooz>=0.11 voluptuous werkzeug Jinja2 PyYAML sysv_ipc msgpack-python trollius retrying pytz WebOb>=1.4.1 alembic>=0.7.6 psycopg2 pymysql
8
0.235294
4
4
d2cbfdaccf71e39910c08ca4138d17814f753312
src/main/scala-2.11/com/sageserpent/plutonium/Patch.scala
src/main/scala-2.11/com/sageserpent/plutonium/Patch.scala
package com.sageserpent.plutonium import java.lang.reflect.Method import net.sf.cglib.proxy.MethodProxy import scala.reflect.runtime.universe._ import scalaz.{-\/, \/, \/-} /** * Created by Gerard on 23/01/2016. */ class Patch(targetRecorder: Recorder, method: Method, arguments: Array[AnyRef], methodProxy: MethodProxy) extends AbstractPatch(method) { private val targetReconstitutionData = targetRecorder.itemReconstitutionData override val (id, typeTag) = targetReconstitutionData type WrappedArgument = \/[AnyRef, Recorder#ItemReconstitutionData[_ <: Identified]] def reconstitute[Raw <: Identified](identifiedItemAccess: IdentifiedItemAccess)(itemReconstitutionData: Recorder#ItemReconstitutionData[Raw]) = identifiedItemAccess.itemFor(itemReconstitutionData) def wrap(argument: AnyRef): WrappedArgument = argument match { case argumentRecorder: Recorder => \/-(argumentRecorder.itemReconstitutionData) case _ => -\/(argument) } val wrappedArguments = arguments map wrap def unwrap(identifiedItemAccess: IdentifiedItemAccess)(wrappedArgument: WrappedArgument) = wrappedArgument.fold(identity, identifiedItemAccess.itemFor(_)) def apply(identifiedItemAccess: IdentifiedItemAccess): Unit = { methodProxy.invoke(targetRecorder, wrappedArguments map unwrap(identifiedItemAccess)) } def checkInvariant(identifiedItemAccess: IdentifiedItemAccess): Unit = { reconstitute(identifiedItemAccess)(targetReconstitutionData).checkInvariant() } }
package com.sageserpent.plutonium import java.lang.reflect.Method import net.sf.cglib.proxy.MethodProxy import scalaz.{-\/, \/, \/-} /** * Created by Gerard on 23/01/2016. */ class Patch(targetRecorder: Recorder, method: Method, arguments: Array[AnyRef], methodProxy: MethodProxy) extends AbstractPatch(method) { private val targetReconstitutionData = targetRecorder.itemReconstitutionData override val (id, typeTag) = targetReconstitutionData type WrappedArgument = \/[AnyRef, Recorder#ItemReconstitutionData[_ <: Identified]] def wrap(argument: AnyRef): WrappedArgument = argument match { case argumentRecorder: Recorder => \/-(argumentRecorder.itemReconstitutionData) case _ => -\/(argument) } val wrappedArguments = arguments map wrap def unwrap(identifiedItemAccess: IdentifiedItemAccess)(wrappedArgument: WrappedArgument) = wrappedArgument.fold(identity, identifiedItemAccess.itemFor(_)) def apply(identifiedItemAccess: IdentifiedItemAccess): Unit = { methodProxy.invoke(identifiedItemAccess.itemFor(targetReconstitutionData), wrappedArguments map unwrap(identifiedItemAccess)) } def checkInvariant(identifiedItemAccess: IdentifiedItemAccess): Unit = { identifiedItemAccess.itemFor(targetReconstitutionData).checkInvariant() } }
Fix wholesale test failures - was down to a type causing the recorder to be used as a target for patching - corrected to use the actual item instead.
Fix wholesale test failures - was down to a type causing the recorder to be used as a target for patching - corrected to use the actual item instead.
Scala
mit
sageserpent-open/open-plutonium
scala
## Code Before: package com.sageserpent.plutonium import java.lang.reflect.Method import net.sf.cglib.proxy.MethodProxy import scala.reflect.runtime.universe._ import scalaz.{-\/, \/, \/-} /** * Created by Gerard on 23/01/2016. */ class Patch(targetRecorder: Recorder, method: Method, arguments: Array[AnyRef], methodProxy: MethodProxy) extends AbstractPatch(method) { private val targetReconstitutionData = targetRecorder.itemReconstitutionData override val (id, typeTag) = targetReconstitutionData type WrappedArgument = \/[AnyRef, Recorder#ItemReconstitutionData[_ <: Identified]] def reconstitute[Raw <: Identified](identifiedItemAccess: IdentifiedItemAccess)(itemReconstitutionData: Recorder#ItemReconstitutionData[Raw]) = identifiedItemAccess.itemFor(itemReconstitutionData) def wrap(argument: AnyRef): WrappedArgument = argument match { case argumentRecorder: Recorder => \/-(argumentRecorder.itemReconstitutionData) case _ => -\/(argument) } val wrappedArguments = arguments map wrap def unwrap(identifiedItemAccess: IdentifiedItemAccess)(wrappedArgument: WrappedArgument) = wrappedArgument.fold(identity, identifiedItemAccess.itemFor(_)) def apply(identifiedItemAccess: IdentifiedItemAccess): Unit = { methodProxy.invoke(targetRecorder, wrappedArguments map unwrap(identifiedItemAccess)) } def checkInvariant(identifiedItemAccess: IdentifiedItemAccess): Unit = { reconstitute(identifiedItemAccess)(targetReconstitutionData).checkInvariant() } } ## Instruction: Fix wholesale test failures - was down to a type causing the recorder to be used as a target for patching - corrected to use the actual item instead. ## Code After: package com.sageserpent.plutonium import java.lang.reflect.Method import net.sf.cglib.proxy.MethodProxy import scalaz.{-\/, \/, \/-} /** * Created by Gerard on 23/01/2016. */ class Patch(targetRecorder: Recorder, method: Method, arguments: Array[AnyRef], methodProxy: MethodProxy) extends AbstractPatch(method) { private val targetReconstitutionData = targetRecorder.itemReconstitutionData override val (id, typeTag) = targetReconstitutionData type WrappedArgument = \/[AnyRef, Recorder#ItemReconstitutionData[_ <: Identified]] def wrap(argument: AnyRef): WrappedArgument = argument match { case argumentRecorder: Recorder => \/-(argumentRecorder.itemReconstitutionData) case _ => -\/(argument) } val wrappedArguments = arguments map wrap def unwrap(identifiedItemAccess: IdentifiedItemAccess)(wrappedArgument: WrappedArgument) = wrappedArgument.fold(identity, identifiedItemAccess.itemFor(_)) def apply(identifiedItemAccess: IdentifiedItemAccess): Unit = { methodProxy.invoke(identifiedItemAccess.itemFor(targetReconstitutionData), wrappedArguments map unwrap(identifiedItemAccess)) } def checkInvariant(identifiedItemAccess: IdentifiedItemAccess): Unit = { identifiedItemAccess.itemFor(targetReconstitutionData).checkInvariant() } }
package com.sageserpent.plutonium import java.lang.reflect.Method import net.sf.cglib.proxy.MethodProxy - import scala.reflect.runtime.universe._ import scalaz.{-\/, \/, \/-} /** * Created by Gerard on 23/01/2016. */ class Patch(targetRecorder: Recorder, method: Method, arguments: Array[AnyRef], methodProxy: MethodProxy) extends AbstractPatch(method) { private val targetReconstitutionData = targetRecorder.itemReconstitutionData override val (id, typeTag) = targetReconstitutionData type WrappedArgument = \/[AnyRef, Recorder#ItemReconstitutionData[_ <: Identified]] - def reconstitute[Raw <: Identified](identifiedItemAccess: IdentifiedItemAccess)(itemReconstitutionData: Recorder#ItemReconstitutionData[Raw]) = identifiedItemAccess.itemFor(itemReconstitutionData) - def wrap(argument: AnyRef): WrappedArgument = argument match { case argumentRecorder: Recorder => \/-(argumentRecorder.itemReconstitutionData) case _ => -\/(argument) } val wrappedArguments = arguments map wrap def unwrap(identifiedItemAccess: IdentifiedItemAccess)(wrappedArgument: WrappedArgument) = wrappedArgument.fold(identity, identifiedItemAccess.itemFor(_)) def apply(identifiedItemAccess: IdentifiedItemAccess): Unit = { - methodProxy.invoke(targetRecorder, wrappedArguments map unwrap(identifiedItemAccess)) ? ^^^^ + methodProxy.invoke(identifiedItemAccess.itemFor(targetReconstitutionData), wrappedArguments map unwrap(identifiedItemAccess)) ? +++++++++++++++++++++++++++++ ^^^^^^^^^^^^^^^ } def checkInvariant(identifiedItemAccess: IdentifiedItemAccess): Unit = { - reconstitute(identifiedItemAccess)(targetReconstitutionData).checkInvariant() ? ------------- ^ + identifiedItemAccess.itemFor(targetReconstitutionData).checkInvariant() ? ^^^^^^^^ } }
7
0.179487
2
5
304cbd60f2c06ed863ef06ce6bde79b7bb613889
server/src/seeders/20171202141325-existing-memberships.js
server/src/seeders/20171202141325-existing-memberships.js
module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Memberships', [ { id: new Sequelize.UUIDV1(), memberId: '75b936c0-ba72-11e7-84e1-058ffffd96c5', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'admin', createdAt: new Date(), updatedAt: new Date() }, { id: new Sequelize.UUIDV1(), memberId: '9ee489d0-9c6f-11e7-a4d2-3b6a4940d978', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'member', createdAt: new Date(), updatedAt: new Date() } ], {}); }, down: (queryInterface) => { return queryInterface.bulkDelete('Memberships', null, {}); } };
module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Memberships', [ { id: '047fbd50-2d5a-4800-86f0-05583673fd7f', memberId: '75b936c0-ba72-11e7-84e1-058ffffd96c5', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'admin', createdAt: new Date(), updatedAt: new Date() }, { id: '75ba1746-bc81-47e5-b43f-cc1aa304db84', memberId: '9ee489d0-9c6f-11e7-a4d2-3b6a4940d978', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'member', createdAt: new Date(), updatedAt: new Date() } ], {}); }, down: (queryInterface) => { return queryInterface.bulkDelete('Memberships', null, {}); } };
Fix UUID column error in membership seeder
Fix UUID column error in membership seeder
JavaScript
mit
Philipeano/post-it,Philipeano/post-it
javascript
## Code Before: module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Memberships', [ { id: new Sequelize.UUIDV1(), memberId: '75b936c0-ba72-11e7-84e1-058ffffd96c5', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'admin', createdAt: new Date(), updatedAt: new Date() }, { id: new Sequelize.UUIDV1(), memberId: '9ee489d0-9c6f-11e7-a4d2-3b6a4940d978', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'member', createdAt: new Date(), updatedAt: new Date() } ], {}); }, down: (queryInterface) => { return queryInterface.bulkDelete('Memberships', null, {}); } }; ## Instruction: Fix UUID column error in membership seeder ## Code After: module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Memberships', [ { id: '047fbd50-2d5a-4800-86f0-05583673fd7f', memberId: '75b936c0-ba72-11e7-84e1-058ffffd96c5', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'admin', createdAt: new Date(), updatedAt: new Date() }, { id: '75ba1746-bc81-47e5-b43f-cc1aa304db84', memberId: '9ee489d0-9c6f-11e7-a4d2-3b6a4940d978', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'member', createdAt: new Date(), updatedAt: new Date() } ], {}); }, down: (queryInterface) => { return queryInterface.bulkDelete('Memberships', null, {}); } };
module.exports = { up: (queryInterface, Sequelize) => { return queryInterface.bulkInsert('Memberships', [ { - id: new Sequelize.UUIDV1(), + id: '047fbd50-2d5a-4800-86f0-05583673fd7f', memberId: '75b936c0-ba72-11e7-84e1-058ffffd96c5', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'admin', createdAt: new Date(), updatedAt: new Date() }, { - id: new Sequelize.UUIDV1(), + id: '75ba1746-bc81-47e5-b43f-cc1aa304db84', memberId: '9ee489d0-9c6f-11e7-a4d2-3b6a4940d978', groupId: 'c46ebe90-bd68-11e7-922f-4d48c5331440', userRole: 'member', createdAt: new Date(), updatedAt: new Date() } ], {}); }, down: (queryInterface) => { return queryInterface.bulkDelete('Memberships', null, {}); } };
4
0.153846
2
2