commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
5
4.84k
subject
stringlengths
15
778
message
stringlengths
16
6.86k
lang
stringlengths
1
30
license
stringclasses
13 values
repos
stringlengths
5
116k
config
stringlengths
1
30
content
stringlengths
105
8.72k
49bc83b4ffb8007dd98caf210b802192c489d599
build/app/js/subjectsCtrl.js
build/app/js/subjectsCtrl.js
angular.module("mirmindr") .controller("subjectsCtrl", function($rootScope, $scope){ $scope.newSub = {}; $scope.addSub = function(form) { if(form.$valid) { $scope.userRef.child("subjects").push($scope.newSub); $scope.newSub = {}; } else { $scope.showActionToast("Missing Something?"); } } $scope.deleteSubject = function(sub) { var deleteConfirm = confirm("Are you sure you want to delete the subject? This will delete all tasks under this subject."); if (deleteConfirm) { $scope.subjects.$remove(sub); } }; });
angular.module("mirmindr") .controller("subjectsCtrl", function($rootScope, $scope, $mdDialog){ $scope.newSub = {}; $scope.addSub = function(form) { if(form.$valid) { $scope.userRef.child("subjects").push($scope.newSub); $scope.newSub = {}; } else { $scope.showActionToast("Missing Something?"); } } // $scope.deleteSubject = function(sub) { // var deleteConfirm = confirm("Are you sure you want to delete the subject? This will delete all tasks under this subject."); // if (deleteConfirm) { // $scope.subjects.$remove(sub); // } // }; // }); $scope.deleteSubject = function(sub) { var confirm = $mdDialog.confirm() .title('Are you sure you want to delete the subject?') .textContent('This will also delete all tasks under this subject.\nThis cannot be undone.') .ok('Yes') .cancel('No'); $mdDialog.show(confirm).then(function() { $scope.subjects.$remove(sub); }, function() { }); }; });
Delete subject dialog is now an mdDialog
Delete subject dialog is now an mdDialog
JavaScript
mit
mirman-school/mirmindr,mirman-school/mirmindr
javascript
## Code Before: angular.module("mirmindr") .controller("subjectsCtrl", function($rootScope, $scope){ $scope.newSub = {}; $scope.addSub = function(form) { if(form.$valid) { $scope.userRef.child("subjects").push($scope.newSub); $scope.newSub = {}; } else { $scope.showActionToast("Missing Something?"); } } $scope.deleteSubject = function(sub) { var deleteConfirm = confirm("Are you sure you want to delete the subject? This will delete all tasks under this subject."); if (deleteConfirm) { $scope.subjects.$remove(sub); } }; }); ## Instruction: Delete subject dialog is now an mdDialog ## Code After: angular.module("mirmindr") .controller("subjectsCtrl", function($rootScope, $scope, $mdDialog){ $scope.newSub = {}; $scope.addSub = function(form) { if(form.$valid) { $scope.userRef.child("subjects").push($scope.newSub); $scope.newSub = {}; } else { $scope.showActionToast("Missing Something?"); } } // $scope.deleteSubject = function(sub) { // var deleteConfirm = confirm("Are you sure you want to delete the subject? This will delete all tasks under this subject."); // if (deleteConfirm) { // $scope.subjects.$remove(sub); // } // }; // }); $scope.deleteSubject = function(sub) { var confirm = $mdDialog.confirm() .title('Are you sure you want to delete the subject?') .textContent('This will also delete all tasks under this subject.\nThis cannot be undone.') .ok('Yes') .cancel('No'); $mdDialog.show(confirm).then(function() { $scope.subjects.$remove(sub); }, function() { }); }; });
fd6ef73d3774901d76601a4be0a88522e6eb500a
.travis.yml
.travis.yml
language: java jdk: - oraclejdk7 - oraclejdk8 branches: only: - master - /^feature\/.*$/ - /^hotfix\/.*$/ - /^release\/.*$/ script: mvn test sudo: false cache: directories: - $HOME/.m2
language: java # Run it on precise, until we figure out how to make jdk7 work (or no longer support jdk7). dist: precise jdk: - oraclejdk7 - oraclejdk8 branches: only: - master - /^feature\/.*$/ - /^hotfix\/.*$/ - /^release\/.*$/ script: mvn test sudo: false cache: directories: - $HOME/.m2
Fix Travis build for Oracle JDK 7
Fix Travis build for Oracle JDK 7 This closes #51 from GitHub. Signed-off-by: anew <[email protected]>
YAML
apache-2.0
poornachandra/incubator-tephra,gokulavasan/incubator-tephra,gokulavasan/incubator-tephra,poornachandra/incubator-tephra,poornachandra/incubator-tephra,gokulavasan/incubator-tephra
yaml
## Code Before: language: java jdk: - oraclejdk7 - oraclejdk8 branches: only: - master - /^feature\/.*$/ - /^hotfix\/.*$/ - /^release\/.*$/ script: mvn test sudo: false cache: directories: - $HOME/.m2 ## Instruction: Fix Travis build for Oracle JDK 7 This closes #51 from GitHub. Signed-off-by: anew <[email protected]> ## Code After: language: java # Run it on precise, until we figure out how to make jdk7 work (or no longer support jdk7). dist: precise jdk: - oraclejdk7 - oraclejdk8 branches: only: - master - /^feature\/.*$/ - /^hotfix\/.*$/ - /^release\/.*$/ script: mvn test sudo: false cache: directories: - $HOME/.m2
e035be090423b8601e1376e20d23b7bf070f4b67
pwwka.gemspec
pwwka.gemspec
$:.push File.expand_path("../lib", __FILE__) require 'pwwka/version' Gem::Specification.new do |s| s.name = "pwwka" s.version = Pwwka::VERSION s.platform = Gem::Platform::RUBY s.authors = ['Stitch Fix Engineering'] s.email = ['[email protected]'] s.homepage = "http://www.stitchfix.com" s.summary = "Send and receive messages via RabbitMQ" s.description = "The purpose of this gem is to normalise the sending and receiving of messages between Rails apps using the shared RabbitMQ message bus" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.add_dependency("bunny") s.add_dependency("activesupport") s.add_dependency("activemodel") s.add_dependency("mono_logger") s.add_development_dependency("rake") s.add_development_dependency("rspec") s.add_development_dependency("resque") end
$:.push File.expand_path("../lib", __FILE__) require 'pwwka/version' Gem::Specification.new do |s| s.name = "pwwka" s.version = Pwwka::VERSION s.platform = Gem::Platform::RUBY s.authors = ['Stitch Fix Engineering'] s.email = ['[email protected]'] s.homepage = "https://github.com/stitchfix/pwwka" s.summary = "Send and receive messages via RabbitMQ" s.description = "The purpose of this gem is to normalise the sending and receiving of messages between Rails apps using the shared RabbitMQ message bus" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.add_dependency("bunny") s.add_dependency("activesupport") s.add_dependency("activemodel") s.add_dependency("mono_logger") s.add_development_dependency("rake") s.add_development_dependency("rspec") s.add_development_dependency("resque") end
Make homepage GitHub repo, so gem information is easily accessible
Make homepage GitHub repo, so gem information is easily accessible
Ruby
mit
stitchfix/pwwka
ruby
## Code Before: $:.push File.expand_path("../lib", __FILE__) require 'pwwka/version' Gem::Specification.new do |s| s.name = "pwwka" s.version = Pwwka::VERSION s.platform = Gem::Platform::RUBY s.authors = ['Stitch Fix Engineering'] s.email = ['[email protected]'] s.homepage = "http://www.stitchfix.com" s.summary = "Send and receive messages via RabbitMQ" s.description = "The purpose of this gem is to normalise the sending and receiving of messages between Rails apps using the shared RabbitMQ message bus" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.add_dependency("bunny") s.add_dependency("activesupport") s.add_dependency("activemodel") s.add_dependency("mono_logger") s.add_development_dependency("rake") s.add_development_dependency("rspec") s.add_development_dependency("resque") end ## Instruction: Make homepage GitHub repo, so gem information is easily accessible ## Code After: $:.push File.expand_path("../lib", __FILE__) require 'pwwka/version' Gem::Specification.new do |s| s.name = "pwwka" s.version = Pwwka::VERSION s.platform = Gem::Platform::RUBY s.authors = ['Stitch Fix Engineering'] s.email = ['[email protected]'] s.homepage = "https://github.com/stitchfix/pwwka" s.summary = "Send and receive messages via RabbitMQ" s.description = "The purpose of this gem is to normalise the sending and receiving of messages between Rails apps using the shared RabbitMQ message bus" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.add_dependency("bunny") s.add_dependency("activesupport") s.add_dependency("activemodel") s.add_dependency("mono_logger") s.add_development_dependency("rake") s.add_development_dependency("rspec") s.add_development_dependency("resque") end
1598c699dc6bdf5d6edd700b70e11df207412dcd
hackernews.py
hackernews.py
import requests class HackerNews(): def __init__(self): self.url = 'https://hacker-news.firebaseio.com/v0/{uri}' def request(self, method, uri): url = self.url.format(uri=uri) return requests.request(method, url) def item(self, item_id): r = self.request('GET', 'item/{item_id}.json'.format(item_id=item_id)) return r.json() def user(self, user_id): r = self.request('GET', 'user/{user_id}.json'.format(user_id=user_id)) return r.json() def top_stories(self): r = self.request('GET', 'topstories.json') return r.json() def max_item(self): r = self.request('GET', 'maxitem.json') return r.json() def updates(self): r = self.request('GET', 'updates.json') return r.json()
from datetime import datetime import requests class HackerNews(): def __init__(self, timeout=5): self.url = 'https://hacker-news.firebaseio.com/v0/{uri}' self.timeout = timeout def request(self, method, uri): url = self.url.format(uri=uri) return requests.request(method, url, timeout=self.timeout) def item(self, item_id): r = self.request('GET', 'item/{item_id}.json'.format(item_id=item_id)) item = r.json() item['time'] = datetime.fromtimestamp(item['time']) return item def user(self, user_id): r = self.request('GET', 'user/{user_id}.json'.format(user_id=user_id)) user = r.json() user['created'] = datetime.fromtimestamp(user['created']) return user def top_stories(self): r = self.request('GET', 'topstories.json') return r.json() def max_item(self): r = self.request('GET', 'maxitem.json') return r.json() def updates(self): r = self.request('GET', 'updates.json') return r.json()
Convert timestamps to native datetime objects (breaking change)
Convert timestamps to native datetime objects (breaking change)
Python
mit
abrinsmead/hackernews-python
python
## Code Before: import requests class HackerNews(): def __init__(self): self.url = 'https://hacker-news.firebaseio.com/v0/{uri}' def request(self, method, uri): url = self.url.format(uri=uri) return requests.request(method, url) def item(self, item_id): r = self.request('GET', 'item/{item_id}.json'.format(item_id=item_id)) return r.json() def user(self, user_id): r = self.request('GET', 'user/{user_id}.json'.format(user_id=user_id)) return r.json() def top_stories(self): r = self.request('GET', 'topstories.json') return r.json() def max_item(self): r = self.request('GET', 'maxitem.json') return r.json() def updates(self): r = self.request('GET', 'updates.json') return r.json() ## Instruction: Convert timestamps to native datetime objects (breaking change) ## Code After: from datetime import datetime import requests class HackerNews(): def __init__(self, timeout=5): self.url = 'https://hacker-news.firebaseio.com/v0/{uri}' self.timeout = timeout def request(self, method, uri): url = self.url.format(uri=uri) return requests.request(method, url, timeout=self.timeout) def item(self, item_id): r = self.request('GET', 'item/{item_id}.json'.format(item_id=item_id)) item = r.json() item['time'] = datetime.fromtimestamp(item['time']) return item def user(self, user_id): r = self.request('GET', 'user/{user_id}.json'.format(user_id=user_id)) user = r.json() user['created'] = datetime.fromtimestamp(user['created']) return user def top_stories(self): r = self.request('GET', 'topstories.json') return r.json() def max_item(self): r = self.request('GET', 'maxitem.json') return r.json() def updates(self): r = self.request('GET', 'updates.json') return r.json()
e806fadb56ec1ead5fc93f5c94a9c511069cf9f7
relative-grades-fenix-IST.js
relative-grades-fenix-IST.js
var myId = data["student"]["id"]; var myGrade; var finalGrades; data["evaluations"].forEach(function(grades) { if(grades["name"] === "Pauta Final") { finalGrades = grades; } }); finalGrades["grades"].forEach(function(element) { if(element["id"] === myId) { myGrade = element["grade"] } }); var total = finalGrades["grades"].length; var above = 0; var same = 0; finalGrades["grades"].forEach(function(element) { if(!isNaN(element["grade"]) && element["grade"] > myGrade) { above += 1; } if(element["grade"] === myGrade) { same += 1; } }); console.log("total: ", total); console.log("above: ", above); console.log("same: ", same); console.log("below: ", total-above-same); console.log("you're in the top ", (above+1)/total, "%"); console.log(data["name"], '\t', myGrade, '\t', above, '\t', same, '\t', total-above-same)
function stats(data) { var myId = data["student"]["id"]; var myGrade; var finalGrades; data["evaluations"].forEach(function(grades) { if(grades["name"] === "Pauta Final") { finalGrades = grades; } }); finalGrades["grades"].forEach(function(element) { if(element["id"] === myId) { myGrade = element["grade"] } }); var total = finalGrades["grades"].length; var above = 0; var same = 0; finalGrades["grades"].forEach(function(element) { if(!isNaN(element["grade"]) && element["grade"] > myGrade) { above += 1; } if(element["grade"] === myGrade) { same += 1; } }); console.log("total: ", total); console.log("above: ", above); console.log("same: ", same); console.log("below: ", total-above-same); console.log("you're in the top ", (above+1)/total, "%"); console.log(data["name"], '\t', myGrade, '\t', above, '\t', same, '\t', total-above-same) }
Refactor previous code into a function
Refactor previous code into a function
JavaScript
apache-2.0
ric2b/relative-grades-fenix-IST
javascript
## Code Before: var myId = data["student"]["id"]; var myGrade; var finalGrades; data["evaluations"].forEach(function(grades) { if(grades["name"] === "Pauta Final") { finalGrades = grades; } }); finalGrades["grades"].forEach(function(element) { if(element["id"] === myId) { myGrade = element["grade"] } }); var total = finalGrades["grades"].length; var above = 0; var same = 0; finalGrades["grades"].forEach(function(element) { if(!isNaN(element["grade"]) && element["grade"] > myGrade) { above += 1; } if(element["grade"] === myGrade) { same += 1; } }); console.log("total: ", total); console.log("above: ", above); console.log("same: ", same); console.log("below: ", total-above-same); console.log("you're in the top ", (above+1)/total, "%"); console.log(data["name"], '\t', myGrade, '\t', above, '\t', same, '\t', total-above-same) ## Instruction: Refactor previous code into a function ## Code After: function stats(data) { var myId = data["student"]["id"]; var myGrade; var finalGrades; data["evaluations"].forEach(function(grades) { if(grades["name"] === "Pauta Final") { finalGrades = grades; } }); finalGrades["grades"].forEach(function(element) { if(element["id"] === myId) { myGrade = element["grade"] } }); var total = finalGrades["grades"].length; var above = 0; var same = 0; finalGrades["grades"].forEach(function(element) { if(!isNaN(element["grade"]) && element["grade"] > myGrade) { above += 1; } if(element["grade"] === myGrade) { same += 1; } }); console.log("total: ", total); console.log("above: ", above); console.log("same: ", same); console.log("below: ", total-above-same); console.log("you're in the top ", (above+1)/total, "%"); console.log(data["name"], '\t', myGrade, '\t', above, '\t', same, '\t', total-above-same) }
fdbdbf24a6b706b04b6cbe97c0d74df6f0b57022
README.md
README.md
gerber-tools ============ ![Travis CI Build Status](https://travis-ci.org/hamiltonkibbe/gerber-tools.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/hamiltonkibbe/gerber-tools/badge.png?branch=master)](https://coveralls.io/r/hamiltonkibbe/gerber-tools?branch=master) Tools to handle Gerber and Excellon files in Python. Useage Example: --------------- import gerber from gerber.render import GerberSvgContext # Read gerber and Excellon files top_copper = gerber.read('example.GTL') nc_drill = gerber.read('example.txt') # Rendering context ctx = GerberSvgContext() # Create SVG image top_copper.render(ctx) nc_drill.render(ctx, 'composite.svg') Rendering Examples: ------------------- ###Top Composite rendering ![Composite Top Image](examples/composite_top.png) ###Bottom Composite rendering ![Composite Bottom Image](examples/composite_bottom.png)
gerber-tools ============ ![Travis CI Build Status](https://travis-ci.org/curtacircuitos/pcb-tools.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/curtacircuitos/pcb-tools/badge.png?branch=master)](https://coveralls.io/r/curtacircuitos/pcb-tools?branch=master) Tools to handle Gerber and Excellon files in Python. Useage Example: --------------- import gerber from gerber.render import GerberSvgContext # Read gerber and Excellon files top_copper = gerber.read('example.GTL') nc_drill = gerber.read('example.txt') # Rendering context ctx = GerberSvgContext() # Create SVG image top_copper.render(ctx) nc_drill.render(ctx, 'composite.svg') Rendering Examples: ------------------- ###Top Composite rendering ![Composite Top Image](examples/composite_top.png) ###Bottom Composite rendering ![Composite Bottom Image](examples/composite_bottom.png)
Change coveralls and travis badges
Change coveralls and travis badges
Markdown
apache-2.0
curtacircuitos/pcb-tools,smitec/pcb-tools
markdown
## Code Before: gerber-tools ============ ![Travis CI Build Status](https://travis-ci.org/hamiltonkibbe/gerber-tools.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/hamiltonkibbe/gerber-tools/badge.png?branch=master)](https://coveralls.io/r/hamiltonkibbe/gerber-tools?branch=master) Tools to handle Gerber and Excellon files in Python. Useage Example: --------------- import gerber from gerber.render import GerberSvgContext # Read gerber and Excellon files top_copper = gerber.read('example.GTL') nc_drill = gerber.read('example.txt') # Rendering context ctx = GerberSvgContext() # Create SVG image top_copper.render(ctx) nc_drill.render(ctx, 'composite.svg') Rendering Examples: ------------------- ###Top Composite rendering ![Composite Top Image](examples/composite_top.png) ###Bottom Composite rendering ![Composite Bottom Image](examples/composite_bottom.png) ## Instruction: Change coveralls and travis badges ## Code After: gerber-tools ============ ![Travis CI Build Status](https://travis-ci.org/curtacircuitos/pcb-tools.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/curtacircuitos/pcb-tools/badge.png?branch=master)](https://coveralls.io/r/curtacircuitos/pcb-tools?branch=master) Tools to handle Gerber and Excellon files in Python. Useage Example: --------------- import gerber from gerber.render import GerberSvgContext # Read gerber and Excellon files top_copper = gerber.read('example.GTL') nc_drill = gerber.read('example.txt') # Rendering context ctx = GerberSvgContext() # Create SVG image top_copper.render(ctx) nc_drill.render(ctx, 'composite.svg') Rendering Examples: ------------------- ###Top Composite rendering ![Composite Top Image](examples/composite_top.png) ###Bottom Composite rendering ![Composite Bottom Image](examples/composite_bottom.png)
e764f4a65315478b54297a117fec508fc4abab62
paloma.gemspec
paloma.gemspec
Gem::Specification.new do |s| s.name = 'paloma' s.version = '1.2.4' s.summary = "a sexy way to organize javascript files using Rails` asset pipeline" s.description = "a sexy way to organize javascript files using Rails` asset pipeline" s.authors = ["Karl Paragua", "Bia Esmero"] s.email = '[email protected]' s.files = `git ls-files`.split("\n") s.homepage = 'https://github.com/kbparagua/paloma' s.add_dependency 'jquery-rails' s.add_development_dependency 'rails', ['>= 3.1.0'] s.add_development_dependency 'rake', ['>= 0'] s.add_development_dependency 'sqlite3', ['>= 0'] s.add_development_dependency 'rspec', ['>= 0'] s.add_development_dependency 'rspec-rails', ['~> 2.0'] s.add_development_dependency 'generator_spec', ['~> 0.8.7'] s.add_development_dependency 'capybara', ['>= 1.0'] s.add_development_dependency 'database_cleaner', ['>= 0'] end
Gem::Specification.new do |s| s.name = 'paloma' s.version = '1.2.5' s.summary = "Provides an easy way to execute page-specific javascript for Rails." s.description = "Page-specific javascript for Rails done right" s.authors = ["Karl Paragua", "Bia Esmero"] s.email = '[email protected]' s.files = `git ls-files`.split("\n") s.homepage = 'https://github.com/kbparagua/paloma' s.add_dependency 'jquery-rails' s.add_development_dependency 'rails', ['>= 3.1.0'] s.add_development_dependency 'rake', ['>= 0'] s.add_development_dependency 'sqlite3', ['>= 0'] s.add_development_dependency 'rspec', ['>= 0'] s.add_development_dependency 'rspec-rails', ['~> 2.0'] s.add_development_dependency 'generator_spec', ['~> 0.8.7'] s.add_development_dependency 'capybara', ['>= 1.0'] s.add_development_dependency 'database_cleaner', ['>= 0'] end
Change gem description and summary
Change gem description and summary
Ruby
mit
kbparagua/paloma,pietrop/paloma,kbparagua/paloma,mikeki/paloma,kbparagua/paloma,pietrop/paloma,mikeki/paloma,munirent/paloma,pietrop/paloma,munirent/paloma,mikeki/paloma
ruby
## Code Before: Gem::Specification.new do |s| s.name = 'paloma' s.version = '1.2.4' s.summary = "a sexy way to organize javascript files using Rails` asset pipeline" s.description = "a sexy way to organize javascript files using Rails` asset pipeline" s.authors = ["Karl Paragua", "Bia Esmero"] s.email = '[email protected]' s.files = `git ls-files`.split("\n") s.homepage = 'https://github.com/kbparagua/paloma' s.add_dependency 'jquery-rails' s.add_development_dependency 'rails', ['>= 3.1.0'] s.add_development_dependency 'rake', ['>= 0'] s.add_development_dependency 'sqlite3', ['>= 0'] s.add_development_dependency 'rspec', ['>= 0'] s.add_development_dependency 'rspec-rails', ['~> 2.0'] s.add_development_dependency 'generator_spec', ['~> 0.8.7'] s.add_development_dependency 'capybara', ['>= 1.0'] s.add_development_dependency 'database_cleaner', ['>= 0'] end ## Instruction: Change gem description and summary ## Code After: Gem::Specification.new do |s| s.name = 'paloma' s.version = '1.2.5' s.summary = "Provides an easy way to execute page-specific javascript for Rails." s.description = "Page-specific javascript for Rails done right" s.authors = ["Karl Paragua", "Bia Esmero"] s.email = '[email protected]' s.files = `git ls-files`.split("\n") s.homepage = 'https://github.com/kbparagua/paloma' s.add_dependency 'jquery-rails' s.add_development_dependency 'rails', ['>= 3.1.0'] s.add_development_dependency 'rake', ['>= 0'] s.add_development_dependency 'sqlite3', ['>= 0'] s.add_development_dependency 'rspec', ['>= 0'] s.add_development_dependency 'rspec-rails', ['~> 2.0'] s.add_development_dependency 'generator_spec', ['~> 0.8.7'] s.add_development_dependency 'capybara', ['>= 1.0'] s.add_development_dependency 'database_cleaner', ['>= 0'] end
90eb9249ed074bf6c0b5fdd3fa8583ff8092a73d
.storybook/preview.js
.storybook/preview.js
import './global.css'; import './fonts.css';
import { addParameters } from '@storybook/react'; import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'; import './global.css'; import './fonts.css'; addParameters({ viewport: { viewports: INITIAL_VIEWPORTS, }, });
Use more granular list of devices in viewports addon
[WEB-589] Storybook: Use more granular list of devices in viewports addon
JavaScript
bsd-2-clause
tidepool-org/blip,tidepool-org/blip,tidepool-org/blip
javascript
## Code Before: import './global.css'; import './fonts.css'; ## Instruction: [WEB-589] Storybook: Use more granular list of devices in viewports addon ## Code After: import { addParameters } from '@storybook/react'; import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'; import './global.css'; import './fonts.css'; addParameters({ viewport: { viewports: INITIAL_VIEWPORTS, }, });
3de1b4e121d0ac5113e263c05cf95ea03cfa9a3b
spec/cli_spec.rb
spec/cli_spec.rb
require "spec_helper" require "bower2gem/cli" describe Bower2Gem::CLI do it "does something useful" do expect { Bower2Gem::CLI.new }.to output("dist/rome.js\n").to_stdout end end
require "spec_helper" require "bower2gem/cli" describe Bower2Gem::CLI do it "downloads javascript file" do Bower2Gem::CLI.new expect(File).to exist("vendor/assets/rome.js") end end
Update test for File Downloader
Update test for File Downloader
Ruby
mit
cllns/npm2gem,cllns/npm2gem
ruby
## Code Before: require "spec_helper" require "bower2gem/cli" describe Bower2Gem::CLI do it "does something useful" do expect { Bower2Gem::CLI.new }.to output("dist/rome.js\n").to_stdout end end ## Instruction: Update test for File Downloader ## Code After: require "spec_helper" require "bower2gem/cli" describe Bower2Gem::CLI do it "downloads javascript file" do Bower2Gem::CLI.new expect(File).to exist("vendor/assets/rome.js") end end
e5878f347022b2a679307e126c5c761a3d46efe1
cmake/upload_if_exe_found.sh
cmake/upload_if_exe_found.sh
EXE_PATH="build/current/Hypersomnia" if [ -f "$EXE_PATH" ]; then echo "Exe found. Uploading." API_KEY=$1 PLATFORM=Linux COMMIT_HASH=$(git rev-parse HEAD) COMMIT_NUMBER=$(git rev-list --count master) VERSION="1.0.$COMMIT_NUMBER" FILE_PATH="Hypersomnia-for-$PLATFORM.sfx" UPLOAD_URL="https://hypersomnia.xyz/upload_artifact.php" . cmake/linux_launcher_install.sh cp build/current/Hypersomnia hypersomnia/.Hypersomnia pushd hypersomnia rm -r cache popd 7z a -sfx $FILE_PATH hypersomnia curl -F "key=$API_KEY" -F "platform=$PLATFORM" -F "commit_hash=$COMMIT_HASH" -F "version=$VERSION" -F "artifact=@$FILE_PATH" $UPLOAD_URL else echo "No exe found. Not uploading." fi
EXE_PATH="build/current/Hypersomnia" if [ -f "$EXE_PATH" ]; then echo "Exe found. Uploading." API_KEY=$1 PLATFORM=Linux COMMIT_HASH=$(git rev-parse HEAD) COMMIT_NUMBER=$(git rev-list --count master) VERSION="1.0.$COMMIT_NUMBER" FILE_PATH="Hypersomnia-for-$PLATFORM.sfx" UPLOAD_URL="https://hypersomnia.xyz/upload_artifact.php" . cmake/linux_launcher_install.sh cp build/current/Hypersomnia hypersomnia/.Hypersomnia pushd hypersomnia rm -r cache, logs, user, demos popd 7z a -sfx $FILE_PATH hypersomnia curl -F "key=$API_KEY" -F "platform=$PLATFORM" -F "commit_hash=$COMMIT_HASH" -F "version=$VERSION" -F "artifact=@$FILE_PATH" $UPLOAD_URL else echo "No exe found. Not uploading." fi
Remove unnecessary folders prior to packaging
Remove unnecessary folders prior to packaging
Shell
agpl-3.0
TeamHypersomnia/Hypersomnia,TeamHypersomnia/Hypersomnia,TeamHypersomnia/Hypersomnia,TeamHypersomnia/Hypersomnia,TeamHypersomnia/Hypersomnia,TeamHypersomnia/Augmentations,TeamHypersomnia/Augmentations
shell
## Code Before: EXE_PATH="build/current/Hypersomnia" if [ -f "$EXE_PATH" ]; then echo "Exe found. Uploading." API_KEY=$1 PLATFORM=Linux COMMIT_HASH=$(git rev-parse HEAD) COMMIT_NUMBER=$(git rev-list --count master) VERSION="1.0.$COMMIT_NUMBER" FILE_PATH="Hypersomnia-for-$PLATFORM.sfx" UPLOAD_URL="https://hypersomnia.xyz/upload_artifact.php" . cmake/linux_launcher_install.sh cp build/current/Hypersomnia hypersomnia/.Hypersomnia pushd hypersomnia rm -r cache popd 7z a -sfx $FILE_PATH hypersomnia curl -F "key=$API_KEY" -F "platform=$PLATFORM" -F "commit_hash=$COMMIT_HASH" -F "version=$VERSION" -F "artifact=@$FILE_PATH" $UPLOAD_URL else echo "No exe found. Not uploading." fi ## Instruction: Remove unnecessary folders prior to packaging ## Code After: EXE_PATH="build/current/Hypersomnia" if [ -f "$EXE_PATH" ]; then echo "Exe found. Uploading." API_KEY=$1 PLATFORM=Linux COMMIT_HASH=$(git rev-parse HEAD) COMMIT_NUMBER=$(git rev-list --count master) VERSION="1.0.$COMMIT_NUMBER" FILE_PATH="Hypersomnia-for-$PLATFORM.sfx" UPLOAD_URL="https://hypersomnia.xyz/upload_artifact.php" . cmake/linux_launcher_install.sh cp build/current/Hypersomnia hypersomnia/.Hypersomnia pushd hypersomnia rm -r cache, logs, user, demos popd 7z a -sfx $FILE_PATH hypersomnia curl -F "key=$API_KEY" -F "platform=$PLATFORM" -F "commit_hash=$COMMIT_HASH" -F "version=$VERSION" -F "artifact=@$FILE_PATH" $UPLOAD_URL else echo "No exe found. Not uploading." fi
ad72f07de65148da99e3b2836a7d81b7a3185d56
requirements.txt
requirements.txt
dj-database-url==0.4.1 Django==1.9.8 psycopg2==2.6.2 whitenoise==3.2
dj-database-url==0.4.1 Django==1.9.8 psycopg2==2.6.2 whitenoise==3.2 requests=2.10
Add requirement for requests module
Add requirement for requests module
Text
mit
niteshpatel/habitica-slack
text
## Code Before: dj-database-url==0.4.1 Django==1.9.8 psycopg2==2.6.2 whitenoise==3.2 ## Instruction: Add requirement for requests module ## Code After: dj-database-url==0.4.1 Django==1.9.8 psycopg2==2.6.2 whitenoise==3.2 requests=2.10
980b17b33c32250b6b175cd66d733abd9017b8f0
test/test-functional.js
test/test-functional.js
// These tests are run with two different test runners which work a bit // differently. Runners are Testem and Karma. Read more about them in // CONTRIBUTING.md // Supporting both has lead to some compromises. var expect = require('expect.js'); var utils = require('./utils'); var ProgressBar = require("../progressbar"); describe('ProgressBar', function() { it('animate should change SVG path stroke-dashoffset property', function(done) { // Append progress bar to body since adding a custom HTML and div // with Karma was not that trivial compared to Testem var line = new ProgressBar.Line('body'); var offset = utils.getComputedStyle(line.path, 'stroke-dashoffset'); line.animate(1, {duration: 1000}); setTimeout(function checkOffsetHasChanged() { var offsetMiddleOfAnimation = utils.getComputedStyle( line.path, 'stroke-dashoffset' ); expect(offset).not.to.be(offsetMiddleOfAnimation); done(); }, 100); }); });
// These tests are run with two different test runners which work a bit // differently. Runners are Testem and Karma. Read more about them in // CONTRIBUTING.md // Supporting both has lead to some compromises. var expect = require('expect.js'); var utils = require('./utils'); var ProgressBar = require("../progressbar"); describe('ProgressBar', function() { it('animate should change SVG path stroke-dashoffset property', function(done) { // Append progress bar to body since adding a custom HTML and div // with Karma was not that trivial compared to Testem var line = new ProgressBar.Line('body'); var offset = utils.getComputedStyle(line.path, 'stroke-dashoffset'); line.animate(1, {duration: 1000}); setTimeout(function checkOffsetHasChanged() { var offsetMiddleOfAnimation = utils.getComputedStyle( line.path, 'stroke-dashoffset' ); expect(offset).not.to.be(offsetMiddleOfAnimation); done(); }, 100); }); it('set should change value', function() { var line = new ProgressBar.Line('body'); var offset = utils.getComputedStyle(line.path, 'stroke-dashoffset'); expect(line.value()).to.be(0); line.set(1); expect(line.value()).to.be(1); }); });
Add test for value() method
Add test for value() method
JavaScript
mit
loki315zx/progressbar.js,arielshad/progressbar.js,Keystion/progressbar.js,renekaigen/progressbar.js,GerHobbelt/progressbar.js,arielshad/progressbar.js,Hkmu/progressbar.js,marcomatteocci/progressbar.js,GerHobbelt/progressbar.js,elbernante/progressbar.js,imZack/progressbar.js,prepare/progressbar.js,halilertekin/progressbar.js,kimmobrunfeldt/progressbar.js,halilertekin/progressbar.js,imZack/progressbar.js,Keystion/progressbar.js,marcomatteocci/progressbar.js,elbernante/progressbar.js,bukalov/progressbar.js,soulosoul/progressbar.js,prepare/progressbar.js,kimmobrunfeldt/progressbar.js,renekaigen/progressbar.js,kimmobrunfeldt/progressbar.js,soulosoul/progressbar.js,bukalov/progressbar.js,Hkmu/progressbar.js
javascript
## Code Before: // These tests are run with two different test runners which work a bit // differently. Runners are Testem and Karma. Read more about them in // CONTRIBUTING.md // Supporting both has lead to some compromises. var expect = require('expect.js'); var utils = require('./utils'); var ProgressBar = require("../progressbar"); describe('ProgressBar', function() { it('animate should change SVG path stroke-dashoffset property', function(done) { // Append progress bar to body since adding a custom HTML and div // with Karma was not that trivial compared to Testem var line = new ProgressBar.Line('body'); var offset = utils.getComputedStyle(line.path, 'stroke-dashoffset'); line.animate(1, {duration: 1000}); setTimeout(function checkOffsetHasChanged() { var offsetMiddleOfAnimation = utils.getComputedStyle( line.path, 'stroke-dashoffset' ); expect(offset).not.to.be(offsetMiddleOfAnimation); done(); }, 100); }); }); ## Instruction: Add test for value() method ## Code After: // These tests are run with two different test runners which work a bit // differently. Runners are Testem and Karma. Read more about them in // CONTRIBUTING.md // Supporting both has lead to some compromises. var expect = require('expect.js'); var utils = require('./utils'); var ProgressBar = require("../progressbar"); describe('ProgressBar', function() { it('animate should change SVG path stroke-dashoffset property', function(done) { // Append progress bar to body since adding a custom HTML and div // with Karma was not that trivial compared to Testem var line = new ProgressBar.Line('body'); var offset = utils.getComputedStyle(line.path, 'stroke-dashoffset'); line.animate(1, {duration: 1000}); setTimeout(function checkOffsetHasChanged() { var offsetMiddleOfAnimation = utils.getComputedStyle( line.path, 'stroke-dashoffset' ); expect(offset).not.to.be(offsetMiddleOfAnimation); done(); }, 100); }); it('set should change value', function() { var line = new ProgressBar.Line('body'); var offset = utils.getComputedStyle(line.path, 'stroke-dashoffset'); expect(line.value()).to.be(0); line.set(1); expect(line.value()).to.be(1); }); });
11d3d71732908c131cf545a8799180610afc489e
init/command_t.vim
init/command_t.vim
" Small default height for CommandT let g:CommandTMaxHeight=20 let g:CommandTMaxFiles=20000
" Small default height for CommandT let g:CommandTMaxHeight=20 let g:CommandTMaxFiles=20000 " Make ESC work in CommandT while in terminal Vim if &term =~ "xterm" || &term =~ "screen" let g:CommandTCancelMap=['<ESC>'] end
Fix ESC in CommandT while in terminal Vim not working
Fix ESC in CommandT while in terminal Vim not working
VimL
mit
danfinnie/vim-config,austenito/vim-config,buildgroundwork/vim-config,RetSKU-development/vim-config,brittlewis12/vim-config,evandrewry/.vim,kmarter/vim-config,brittlewis12/vim-config,abhisharma2/vim-config,kmarter/vim-config,jgeiger/vim-config,brittlewis12/vim-config,mntj/vim,benliscio/vim,brittlewis12/vim-config,gust/vim-config,kmarter/vim-config,evandrewry/vim-config,benliscio/vim,pivotalcommon/vim-config,krishicks/casecommons-vim-config,genagain/vim-config,micahyoung/vim-config,davgomgar/vim-config,Casecommons/vim-config,miketierney/vim-config,wenzowski/vim-config,LaunchAcademy/vim-config,miketierney/vim-config,mntj/vim,compozed/vim-config,diegodesouza/dotfiles
viml
## Code Before: " Small default height for CommandT let g:CommandTMaxHeight=20 let g:CommandTMaxFiles=20000 ## Instruction: Fix ESC in CommandT while in terminal Vim not working ## Code After: " Small default height for CommandT let g:CommandTMaxHeight=20 let g:CommandTMaxFiles=20000 " Make ESC work in CommandT while in terminal Vim if &term =~ "xterm" || &term =~ "screen" let g:CommandTCancelMap=['<ESC>'] end
d857d4b6a2018a73b0d92f5483e3224421fa09f0
taglibs/async/raptor-taglib.json
taglibs/async/raptor-taglib.json
{ "tags": { "async-fragment": { "renderer": "./async-fragment-tag", "attributes": { "data-provider": { "type": "string" }, "arg": { "type": "expression", "preserve-name": true }, "arg-*": { "pattern": true, "type": "string", "preserve-name": true }, "var": { "type": "identifier" }, "timeout": { "type": "integer" } }, "vars": [ "context", { "name-from-attribute": "var OR dependency OR data-provider|keep" } ], "transformer": "./AsyncFragmentTagTransformer" } } }
{ "tags": { "async-fragment": { "renderer": "./async-fragment-tag", "attributes": { "data-provider": { "type": "string" }, "arg": { "type": "expression", "preserve-name": true }, "arg-*": { "pattern": true, "type": "string", "preserve-name": true }, "var": { "type": "identifier" }, "timeout": { "type": "integer" }, "method": { "type": "string" } }, "vars": [ "context", { "name-from-attribute": "var OR dependency OR data-provider|keep" } ], "transformer": "./AsyncFragmentTagTransformer" } } }
Allow "method" to be set for a data provider to maintain "this"
Allow "method" to be set for a data provider to maintain "this"
JSON
mit
marko-js/marko,marko-js/marko
json
## Code Before: { "tags": { "async-fragment": { "renderer": "./async-fragment-tag", "attributes": { "data-provider": { "type": "string" }, "arg": { "type": "expression", "preserve-name": true }, "arg-*": { "pattern": true, "type": "string", "preserve-name": true }, "var": { "type": "identifier" }, "timeout": { "type": "integer" } }, "vars": [ "context", { "name-from-attribute": "var OR dependency OR data-provider|keep" } ], "transformer": "./AsyncFragmentTagTransformer" } } } ## Instruction: Allow "method" to be set for a data provider to maintain "this" ## Code After: { "tags": { "async-fragment": { "renderer": "./async-fragment-tag", "attributes": { "data-provider": { "type": "string" }, "arg": { "type": "expression", "preserve-name": true }, "arg-*": { "pattern": true, "type": "string", "preserve-name": true }, "var": { "type": "identifier" }, "timeout": { "type": "integer" }, "method": { "type": "string" } }, "vars": [ "context", { "name-from-attribute": "var OR dependency OR data-provider|keep" } ], "transformer": "./AsyncFragmentTagTransformer" } } }
29b9477221e0af09d9b0abb55f35aa040e0d3c35
catalog/Web_Apps_Services_Interaction/Web_Content_Scrapers.yml
catalog/Web_Apps_Services_Interaction/Web_Content_Scrapers.yml
name: Web Content Scrapers description: projects: - anemone - arachnid2 - boilerpipe-ruby - cobweb - data_miner - docparser - fletcher - horsefield - link_thumbnailer - metainspector - pismo - sinew - url_scraper - wiki-api - wombat
name: Web Content Scrapers description: projects: - anemone - arachnid2 - boilerpipe-ruby - cobweb - data_miner - docparser - fletcher - horsefield - kimurai - link_thumbnailer - metainspector - pismo - sinew - url_scraper - wiki-api - wombat
Add Kimurai framework for scraping
Add Kimurai framework for scraping Kimurai is a full scraping framework, similar to Scrapy in Python. It's currently under active development and is of high quality. I was surprised to not see it, and hope it gets added!
YAML
mit
rubytoolbox/catalog
yaml
## Code Before: name: Web Content Scrapers description: projects: - anemone - arachnid2 - boilerpipe-ruby - cobweb - data_miner - docparser - fletcher - horsefield - link_thumbnailer - metainspector - pismo - sinew - url_scraper - wiki-api - wombat ## Instruction: Add Kimurai framework for scraping Kimurai is a full scraping framework, similar to Scrapy in Python. It's currently under active development and is of high quality. I was surprised to not see it, and hope it gets added! ## Code After: name: Web Content Scrapers description: projects: - anemone - arachnid2 - boilerpipe-ruby - cobweb - data_miner - docparser - fletcher - horsefield - kimurai - link_thumbnailer - metainspector - pismo - sinew - url_scraper - wiki-api - wombat
b8b48fe8b426ee35a4c8821a7f52189f389b084e
org.spoofax.meta.runtime.libraries/build.nix
org.spoofax.meta.runtime.libraries/build.nix
{ nixpkgs ? ../../nixpkgs , runtime-libraries ? ../../runtime-libraries , strategoxt ? ../../strategoxt , strj ? ../../strategoxt.jar } : let pkgs = import nixpkgs {}; jobs = { build = pkgs.releaseTools.antBuild { name = "runtime-libraries"; src = runtime-libraries; buildInputs = with pkgs; [ ecj openjdk ]; postUnpack = '' cp ${strategoxt}/strategoxt/ant-contrib/strategoxt-antlib.xml runtime-libraries/org.spoofax.meta.runtime.libraries/ ''; preConfigure = '' cd org.spoofax.meta.runtime.libraries ''; antTargets = ["all" "install"]; antProperties = [ { name = "eclipse.spoofaximp.strategojar"; value = strj; } { name = "output"; value = "$out"; } ]; antBuildInputs = [ pkgs.ecj strategoxt strj ]; ANT_OPTS="-Xss8m -Xmx1024m"; dontInstall = true; }; }; in jobs
{ nixpkgs ? ../../nixpkgs , runtime-libraries ? ../../runtime-libraries , strategoxt ? ../../strategoxt , strj ? ../../strategoxt.jar } : let pkgs = import nixpkgs {}; jobs = { build = pkgs.releaseTools.antBuild { name = "runtime-libraries"; src = runtime-libraries; buildInputs = with pkgs; [ ecj openjdk ]; preConfigure = '' cd org.spoofax.meta.runtime.libraries cp ${strategoxt}/strategoxt/ant-contrib/strategoxt-antlib.xml . ''; antTargets = ["all" "install"]; antProperties = [ { name = "eclipse.spoofaximp.strategojar"; value = strj; } { name = "output"; value = "$out"; } ]; antBuildInputs = [ pkgs.ecj strategoxt strj ]; ANT_OPTS="-Xss8m -Xmx1024m"; dontInstall = true; }; }; in jobs
Move copying of strategoxt-antlib.xml into preConfigure.
Move copying of strategoxt-antlib.xml into preConfigure.
Nix
apache-2.0
metaborg/runtime-libraries
nix
## Code Before: { nixpkgs ? ../../nixpkgs , runtime-libraries ? ../../runtime-libraries , strategoxt ? ../../strategoxt , strj ? ../../strategoxt.jar } : let pkgs = import nixpkgs {}; jobs = { build = pkgs.releaseTools.antBuild { name = "runtime-libraries"; src = runtime-libraries; buildInputs = with pkgs; [ ecj openjdk ]; postUnpack = '' cp ${strategoxt}/strategoxt/ant-contrib/strategoxt-antlib.xml runtime-libraries/org.spoofax.meta.runtime.libraries/ ''; preConfigure = '' cd org.spoofax.meta.runtime.libraries ''; antTargets = ["all" "install"]; antProperties = [ { name = "eclipse.spoofaximp.strategojar"; value = strj; } { name = "output"; value = "$out"; } ]; antBuildInputs = [ pkgs.ecj strategoxt strj ]; ANT_OPTS="-Xss8m -Xmx1024m"; dontInstall = true; }; }; in jobs ## Instruction: Move copying of strategoxt-antlib.xml into preConfigure. ## Code After: { nixpkgs ? ../../nixpkgs , runtime-libraries ? ../../runtime-libraries , strategoxt ? ../../strategoxt , strj ? ../../strategoxt.jar } : let pkgs = import nixpkgs {}; jobs = { build = pkgs.releaseTools.antBuild { name = "runtime-libraries"; src = runtime-libraries; buildInputs = with pkgs; [ ecj openjdk ]; preConfigure = '' cd org.spoofax.meta.runtime.libraries cp ${strategoxt}/strategoxt/ant-contrib/strategoxt-antlib.xml . ''; antTargets = ["all" "install"]; antProperties = [ { name = "eclipse.spoofaximp.strategojar"; value = strj; } { name = "output"; value = "$out"; } ]; antBuildInputs = [ pkgs.ecj strategoxt strj ]; ANT_OPTS="-Xss8m -Xmx1024m"; dontInstall = true; }; }; in jobs
24c5497b0c91ce032fb4cf99e79fffc5fa27cb84
push/management/commands/startbatches.py
push/management/commands/startbatches.py
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from push.models import DeviceTokenModel, NotificationModel from datetime import datetime import push_notification class Command(BaseCommand): def __init__(self, *args, **kwargs): super(Command, self).__init__(*args, **kwargs) def handle(self, *args, **kwargs): now = '{0:%Y/%m/%d %H:%M}'.format(datetime.now()) notifications = NotificationModel.objects.filter(execute_datetime = now) for notification in notifications: device_tokens = DeviceTokenModel.objects.filter(os_version__gte = notification.os_version, username = notification.username) self.prepare_push_notification(notification, device_tokens) def prepare_push_notification(self, notification, device_tokens): device_token_lists = [] for item in device_tokens: device_token_lists.append(item.device_token) push_notification.execute(device_token_lists, notification)
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from push.models import DeviceTokenModel, NotificationModel from datetime import datetime import push_notification class Command(BaseCommand): def __init__(self, *args, **kwargs): super(Command, self).__init__(*args, **kwargs) def handle(self, *args, **kwargs): now = '{0:%Y/%m/%d %H:%M}'.format(datetime.now()) notifications = NotificationModel.objects.filter(execute_datetime = now, is_sent = False) for notification in notifications: device_tokens = DeviceTokenModel.objects.filter(os_version__gte = notification.os_version, username = notification.username) self.prepare_push_notification(notification, device_tokens) def prepare_push_notification(self, notification, device_tokens): device_token_lists = [] for item in device_tokens: device_token_lists.append(item.device_token) push_notification.execute(device_token_lists, notification)
Update batch execute for conditions
Update batch execute for conditions
Python
apache-2.0
nnsnodnb/django-mbaas,nnsnodnb/django-mbaas,nnsnodnb/django-mbaas
python
## Code Before: from django.conf import settings from django.core.management.base import BaseCommand, CommandError from push.models import DeviceTokenModel, NotificationModel from datetime import datetime import push_notification class Command(BaseCommand): def __init__(self, *args, **kwargs): super(Command, self).__init__(*args, **kwargs) def handle(self, *args, **kwargs): now = '{0:%Y/%m/%d %H:%M}'.format(datetime.now()) notifications = NotificationModel.objects.filter(execute_datetime = now) for notification in notifications: device_tokens = DeviceTokenModel.objects.filter(os_version__gte = notification.os_version, username = notification.username) self.prepare_push_notification(notification, device_tokens) def prepare_push_notification(self, notification, device_tokens): device_token_lists = [] for item in device_tokens: device_token_lists.append(item.device_token) push_notification.execute(device_token_lists, notification) ## Instruction: Update batch execute for conditions ## Code After: from django.conf import settings from django.core.management.base import BaseCommand, CommandError from push.models import DeviceTokenModel, NotificationModel from datetime import datetime import push_notification class Command(BaseCommand): def __init__(self, *args, **kwargs): super(Command, self).__init__(*args, **kwargs) def handle(self, *args, **kwargs): now = '{0:%Y/%m/%d %H:%M}'.format(datetime.now()) notifications = NotificationModel.objects.filter(execute_datetime = now, is_sent = False) for notification in notifications: device_tokens = DeviceTokenModel.objects.filter(os_version__gte = notification.os_version, username = notification.username) self.prepare_push_notification(notification, device_tokens) def prepare_push_notification(self, notification, device_tokens): device_token_lists = [] for item in device_tokens: device_token_lists.append(item.device_token) push_notification.execute(device_token_lists, notification)
a5b2b56c52161d152b62d2fff84fe5089cb5099f
tracks/segmentfns_test.go
tracks/segmentfns_test.go
package tracks
package tracks import "testing" func elem(s SegmentType) Element { return Element{ Segment: TS_MAP[s], } } func TestNotPossible(t *testing.T) { testCases := []struct { input Element notPossibility Element }{ {elem(ELEM_FLAT_TO_25_DEG_UP), elem(ELEM_LEFT_QUARTER_TURN_5_TILES)}, } for _, tt := range testCases { possibilities := tt.input.Possibilities() for _, poss := range possibilities { if poss.Segment.Type == tt.notPossibility.Segment.Type { t.Errorf("expected %s to not be a possibility for %s, but was", poss.Segment.String(), tt.notPossibility.Segment.String()) } } } }
Add basic test for generated track
Add basic test for generated track We generated a track that had 25_DEG_UP followed by 3 tile flat left turn, which shouldn't be possible. Adds a test that rules out that possibility in one place in the codebase.
Go
mit
kevinburke/rct,kevinburke/rct,kevinburke/rct,kevinburke/rct
go
## Code Before: package tracks ## Instruction: Add basic test for generated track We generated a track that had 25_DEG_UP followed by 3 tile flat left turn, which shouldn't be possible. Adds a test that rules out that possibility in one place in the codebase. ## Code After: package tracks import "testing" func elem(s SegmentType) Element { return Element{ Segment: TS_MAP[s], } } func TestNotPossible(t *testing.T) { testCases := []struct { input Element notPossibility Element }{ {elem(ELEM_FLAT_TO_25_DEG_UP), elem(ELEM_LEFT_QUARTER_TURN_5_TILES)}, } for _, tt := range testCases { possibilities := tt.input.Possibilities() for _, poss := range possibilities { if poss.Segment.Type == tt.notPossibility.Segment.Type { t.Errorf("expected %s to not be a possibility for %s, but was", poss.Segment.String(), tt.notPossibility.Segment.String()) } } } }
e6642dcbf2ddb60d45dcc43aadd4fe2031668a41
lib/assets/javascripts/builder/components/table/body/table-body-cell.tpl
lib/assets/javascripts/builder/components/table/body/table-body-cell.tpl
<!-- .fs-hide class excludes the contents of this cell, which might contain sensitive data, from FullStory recordings. More info: https://help.fullstory.com/technical-questions/exclude-elements --> <td class="Table-cellItem fs-hide" data-attribute="<%- columnName %>" title="<%- value %>" data-clipboard-text='<%- value %>'> <div class=" Table-cell u-flex u-justifySpace <%- columnName === 'cartodb_id' || (type === 'geometry' && geometry !== 'point') ? 'Table-cell--short' : '' %> "> <p class=" CDB-Text CDB-Size-medium u-ellipsis u-rSpace--xl <%- type === 'number' && columnName !== 'cartodb_id' ? 'is-number' : '' %> <%- value === null ? 'is-null' : '' %> <%- columnName === 'cartodb_id' ? 'is-cartodbId' : '' %> js-value "> <%- value === null ? 'null' : formattedValue %> </p> <% if (columnName !== 'cartodb_id') { %> <button class="CDB-Shape-threePoints is-blue is-small Table-cellItemOptions js-cellOptions"> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> </button> <% } %> </div> </td>
<td class="Table-cellItem" data-attribute="<%- columnName %>" title="<%- value %>" data-clipboard-text='<%- value %>'> <div class=" Table-cell u-flex u-justifySpace <%- columnName === 'cartodb_id' || (type === 'geometry' && geometry !== 'point') ? 'Table-cell--short' : '' %> "> <!-- WARNING: .fs-hide class excludes this element, which might contain sensitive data, from FullStory recordings. Do not remove it unless we are no longer using FullStory! More info: https://help.fullstory.com/technical-questions/exclude-elements --> <p class=" fs-hide CDB-Text CDB-Size-medium u-ellipsis u-rSpace--xl <%- type === 'number' && columnName !== 'cartodb_id' ? 'is-number' : '' %> <%- value === null ? 'is-null' : '' %> <%- columnName === 'cartodb_id' ? 'is-cartodbId' : '' %> js-value "> <%- value === null ? 'null' : formattedValue %> </p> <% if (columnName !== 'cartodb_id') { %> <button class="CDB-Shape-threePoints is-blue is-small Table-cellItemOptions js-cellOptions"> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> </button> <% } %> </div> </td>
Exclude cell's paragraph from FullStory
Exclude cell's paragraph from FullStory
Smarty
bsd-3-clause
CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb
smarty
## Code Before: <!-- .fs-hide class excludes the contents of this cell, which might contain sensitive data, from FullStory recordings. More info: https://help.fullstory.com/technical-questions/exclude-elements --> <td class="Table-cellItem fs-hide" data-attribute="<%- columnName %>" title="<%- value %>" data-clipboard-text='<%- value %>'> <div class=" Table-cell u-flex u-justifySpace <%- columnName === 'cartodb_id' || (type === 'geometry' && geometry !== 'point') ? 'Table-cell--short' : '' %> "> <p class=" CDB-Text CDB-Size-medium u-ellipsis u-rSpace--xl <%- type === 'number' && columnName !== 'cartodb_id' ? 'is-number' : '' %> <%- value === null ? 'is-null' : '' %> <%- columnName === 'cartodb_id' ? 'is-cartodbId' : '' %> js-value "> <%- value === null ? 'null' : formattedValue %> </p> <% if (columnName !== 'cartodb_id') { %> <button class="CDB-Shape-threePoints is-blue is-small Table-cellItemOptions js-cellOptions"> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> </button> <% } %> </div> </td> ## Instruction: Exclude cell's paragraph from FullStory ## Code After: <td class="Table-cellItem" data-attribute="<%- columnName %>" title="<%- value %>" data-clipboard-text='<%- value %>'> <div class=" Table-cell u-flex u-justifySpace <%- columnName === 'cartodb_id' || (type === 'geometry' && geometry !== 'point') ? 'Table-cell--short' : '' %> "> <!-- WARNING: .fs-hide class excludes this element, which might contain sensitive data, from FullStory recordings. Do not remove it unless we are no longer using FullStory! More info: https://help.fullstory.com/technical-questions/exclude-elements --> <p class=" fs-hide CDB-Text CDB-Size-medium u-ellipsis u-rSpace--xl <%- type === 'number' && columnName !== 'cartodb_id' ? 'is-number' : '' %> <%- value === null ? 'is-null' : '' %> <%- columnName === 'cartodb_id' ? 'is-cartodbId' : '' %> js-value "> <%- value === null ? 'null' : formattedValue %> </p> <% if (columnName !== 'cartodb_id') { %> <button class="CDB-Shape-threePoints is-blue is-small Table-cellItemOptions js-cellOptions"> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> <div class="CDB-Shape-threePointsItem"></div> </button> <% } %> </div> </td>
97f346c585a727806718db2b02bed6a9ca5ec5c9
src/js/cordova.js
src/js/cordova.js
'use strict'; // Load only within android app: cordova=android if (window.location.search.search('cordova') > 0) { (function(d, script) { script = d.createElement('script'); script.type = 'text/javascript'; script.src = 'js/cordova/cordova.js'; d.getElementsByTagName('head')[0].appendChild(script); }(document)); }
'use strict'; // Load only within android app: cordova=android if (window.location.search.search('cordova') > 0) { (function(d, script) { // When cordova is loaded function onLoad() { d.addEventListener('deviceready', onDeviceReady, false); } // Device APIs are available function onDeviceReady() { d.addEventListener('resume', onResume, false); } // When device comes to foreground function onResume() { if (window.applicationCache) { window.applicationCache.update(); } } script = d.createElement('script'); script.onload = onLoad; script.type = 'text/javascript'; script.src = 'js/cordova/cordova.js'; d.getElementsByTagName('head')[0].appendChild(script); }(document)); }
Update application cache on device resume
Update application cache on device resume
JavaScript
agpl-3.0
P2Pvalue/teem,P2Pvalue/pear2pear,Grasia/teem,P2Pvalue/teem,Grasia/teem,Grasia/teem,P2Pvalue/teem,P2Pvalue/pear2pear
javascript
## Code Before: 'use strict'; // Load only within android app: cordova=android if (window.location.search.search('cordova') > 0) { (function(d, script) { script = d.createElement('script'); script.type = 'text/javascript'; script.src = 'js/cordova/cordova.js'; d.getElementsByTagName('head')[0].appendChild(script); }(document)); } ## Instruction: Update application cache on device resume ## Code After: 'use strict'; // Load only within android app: cordova=android if (window.location.search.search('cordova') > 0) { (function(d, script) { // When cordova is loaded function onLoad() { d.addEventListener('deviceready', onDeviceReady, false); } // Device APIs are available function onDeviceReady() { d.addEventListener('resume', onResume, false); } // When device comes to foreground function onResume() { if (window.applicationCache) { window.applicationCache.update(); } } script = d.createElement('script'); script.onload = onLoad; script.type = 'text/javascript'; script.src = 'js/cordova/cordova.js'; d.getElementsByTagName('head')[0].appendChild(script); }(document)); }
1661ff9ceb95fda9598e48f6dad605706cc5018f
buildscripts/build.js
buildscripts/build.js
var fs = require('fs'); var copy = { 'app/main.js': 'dist/main.js', 'node_modules/p5/lib/p5.min.js' : 'dist/p5.min.js', 'node_modules/p5/lib/addons/p5.dom.js' : 'dist/p5.dom.js', }; Object.keys(copy).forEach(key => { fs.createReadStream(key).pipe(fs.createWriteStream(copy[key])); });
var fs = require('fs'); var copy = { 'app/main.js': 'dist/main.js', 'node_modules/p5/lib/p5.min.js' : 'dist/p5.min.js', 'node_modules/p5/lib/addons/p5.dom.js' : 'dist/p5.dom.js', }; if (!fs.existsSync('dist')) { fs.mkdirSync('dist'); } Object.keys(copy).forEach(key => { fs.createReadStream(key).pipe(fs.createWriteStream(copy[key])); });
Create the dist dir if not exists
Create the dist dir if not exists
JavaScript
mit
nemesv/playfive,nemesv/playfive
javascript
## Code Before: var fs = require('fs'); var copy = { 'app/main.js': 'dist/main.js', 'node_modules/p5/lib/p5.min.js' : 'dist/p5.min.js', 'node_modules/p5/lib/addons/p5.dom.js' : 'dist/p5.dom.js', }; Object.keys(copy).forEach(key => { fs.createReadStream(key).pipe(fs.createWriteStream(copy[key])); }); ## Instruction: Create the dist dir if not exists ## Code After: var fs = require('fs'); var copy = { 'app/main.js': 'dist/main.js', 'node_modules/p5/lib/p5.min.js' : 'dist/p5.min.js', 'node_modules/p5/lib/addons/p5.dom.js' : 'dist/p5.dom.js', }; if (!fs.existsSync('dist')) { fs.mkdirSync('dist'); } Object.keys(copy).forEach(key => { fs.createReadStream(key).pipe(fs.createWriteStream(copy[key])); });
2140ef54e80c39102a0df6679daa1c61435f23f3
lib/android/src/main/res/layout/fragment_react_native.xml
lib/android/src/main/res/layout/fragment_react_native.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" /> <com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup android:id="@+id/content_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar"> <ViewStub android:id="@+id/react_root_view_stub" android:layout_width="match_parent" android:layout_height="match_parent" android:layout="@layout/react_root_view" /> <View android:id="@+id/loading_view" android:layout_width="42dp" android:layout_height="18dp" android:layout_gravity="center" /> </com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup> <View android:id="@+id/toolbar_shadow" android:layout_width="match_parent" android:layout_height="4dp" android:layout_below="@+id/toolbar" android:background="@drawable/toolbar_dropshadow" /> </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone"/> <com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup android:id="@+id/content_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar"> <ViewStub android:id="@+id/react_root_view_stub" android:layout_width="match_parent" android:layout_height="match_parent" android:layout="@layout/react_root_view" /> <View android:id="@+id/loading_view" android:layout_width="42dp" android:layout_height="18dp" android:layout_gravity="center" /> </com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup> <View android:id="@+id/toolbar_shadow" android:layout_width="match_parent" android:layout_height="4dp" android:layout_below="@+id/toolbar" android:visibility="gone" android:background="@drawable/toolbar_dropshadow" /> </RelativeLayout>
Allow no toolbar for android
Allow no toolbar for android
XML
mit
travelbird/react-native-navigation,travelbird/react-native-navigation,travelbird/react-native-navigation,travelbird/react-native-navigation
xml
## Code Before: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" /> <com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup android:id="@+id/content_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar"> <ViewStub android:id="@+id/react_root_view_stub" android:layout_width="match_parent" android:layout_height="match_parent" android:layout="@layout/react_root_view" /> <View android:id="@+id/loading_view" android:layout_width="42dp" android:layout_height="18dp" android:layout_gravity="center" /> </com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup> <View android:id="@+id/toolbar_shadow" android:layout_width="match_parent" android:layout_height="4dp" android:layout_below="@+id/toolbar" android:background="@drawable/toolbar_dropshadow" /> </RelativeLayout> ## Instruction: Allow no toolbar for android ## Code After: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone"/> <com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup android:id="@+id/content_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/toolbar"> <ViewStub android:id="@+id/react_root_view_stub" android:layout_width="match_parent" android:layout_height="match_parent" android:layout="@layout/react_root_view" /> <View android:id="@+id/loading_view" android:layout_width="42dp" android:layout_height="18dp" android:layout_gravity="center" /> </com.airbnb.android.react.navigation.ReactNativeFragmentViewGroup> <View android:id="@+id/toolbar_shadow" android:layout_width="match_parent" android:layout_height="4dp" android:layout_below="@+id/toolbar" android:visibility="gone" android:background="@drawable/toolbar_dropshadow" /> </RelativeLayout>
bbdd404546afd0b31b2ed96b7692a0363b0647cf
src/buildviz/main.clj
src/buildviz/main.clj
(ns buildviz.main (:require [buildviz.build-results :as results] [buildviz.handler :as handler] [buildviz.http :as http] [buildviz.storage :as storage])) (def jobs-filename "buildviz_jobs") (def tests-filename "buildviz_tests") (defn- persist-jobs! [build-data] (storage/store! build-data jobs-filename)) (defn- persist-tests! [tests-data] (storage/store! tests-data tests-filename)) (def app (let [builds (storage/load-from-file jobs-filename) tests (storage/load-from-file tests-filename)] (-> (handler/create-app (results/build-results builds tests) persist-jobs! persist-tests!) http/wrap-log-request http/wrap-log-errors)))
(ns buildviz.main (:require [buildviz.build-results :as results] [buildviz.handler :as handler] [buildviz.http :as http] [buildviz.storage :as storage] [clojure.java.io :as io] [clojure.string :as str])) (defn- path-for [file-name] (if-let [data-dir (System/getenv "BUILDVIZ_DATA_DIR")] (.getPath (io/file data-dir file-name)) file-name)) (def jobs-filename (path-for "buildviz_jobs")) (def tests-filename (path-for "buildviz_tests")) (defn- persist-jobs! [build-data] (storage/store! build-data jobs-filename)) (defn- persist-tests! [tests-data] (storage/store! tests-data tests-filename)) (def app (let [builds (storage/load-from-file jobs-filename) tests (storage/load-from-file tests-filename)] (-> (handler/create-app (results/build-results builds tests) persist-jobs! persist-tests!) http/wrap-log-request http/wrap-log-errors)))
Allow to configure the data directory
Allow to configure the data directory
Clojure
bsd-2-clause
cburgmer/buildviz,cburgmer/buildviz,cburgmer/buildviz
clojure
## Code Before: (ns buildviz.main (:require [buildviz.build-results :as results] [buildviz.handler :as handler] [buildviz.http :as http] [buildviz.storage :as storage])) (def jobs-filename "buildviz_jobs") (def tests-filename "buildviz_tests") (defn- persist-jobs! [build-data] (storage/store! build-data jobs-filename)) (defn- persist-tests! [tests-data] (storage/store! tests-data tests-filename)) (def app (let [builds (storage/load-from-file jobs-filename) tests (storage/load-from-file tests-filename)] (-> (handler/create-app (results/build-results builds tests) persist-jobs! persist-tests!) http/wrap-log-request http/wrap-log-errors))) ## Instruction: Allow to configure the data directory ## Code After: (ns buildviz.main (:require [buildviz.build-results :as results] [buildviz.handler :as handler] [buildviz.http :as http] [buildviz.storage :as storage] [clojure.java.io :as io] [clojure.string :as str])) (defn- path-for [file-name] (if-let [data-dir (System/getenv "BUILDVIZ_DATA_DIR")] (.getPath (io/file data-dir file-name)) file-name)) (def jobs-filename (path-for "buildviz_jobs")) (def tests-filename (path-for "buildviz_tests")) (defn- persist-jobs! [build-data] (storage/store! build-data jobs-filename)) (defn- persist-tests! [tests-data] (storage/store! tests-data tests-filename)) (def app (let [builds (storage/load-from-file jobs-filename) tests (storage/load-from-file tests-filename)] (-> (handler/create-app (results/build-results builds tests) persist-jobs! persist-tests!) http/wrap-log-request http/wrap-log-errors)))
343a8f6bd8534792e246ae6c705a5f1b2d581199
README.md
README.md
An open-source developer site using React. [Find me on Twitter!](https://twitter.com/dentemple) [Find me on LinkedIn!](https://www.linkedin.com/in/dentemple/) ## Technology ## Try It Out * Requirements * [Node](https://nodejs.org/en/download/) (Recommended v6.0+) * [yarn](https://yarnpkg.com/en/docs/install) * A command line interface (such as [Git Bash](https://git-scm.com/downloads) for Windows) * Install - ([How to clone a repository](https://help.github.com/articles/cloning-a-repository/)) * `git clone [email protected]:dentemple/my-developer-site.git` * `cd my-developer-site` * `yarn` * Run * `yarn start` * Navigate to the development environment here: [http://localhost:3000/](http://localhost:3000/) * Test Suite * `yarn test` * `yarn coverage` for a coverage report ## Images ## License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
An open-source developer site using React. [(Link to older version)](https://dentemple-31337.firebaseapp.com/) [Find me on Twitter!](https://twitter.com/dentemple) [Find me on LinkedIn!](https://www.linkedin.com/in/dentemple/) ## Technology ## Try It Out * Requirements * [Node](https://nodejs.org/en/download/) (Recommended v6.0+) * [yarn](https://yarnpkg.com/en/docs/install) * A command line interface (such as [Git Bash](https://git-scm.com/downloads) for Windows) * Install - ([How to clone a repository](https://help.github.com/articles/cloning-a-repository/)) * `git clone [email protected]:dentemple/my-developer-site.git` * `cd my-developer-site` * `yarn` * Run * `yarn start` * Navigate to the development environment here: [http://localhost:3000/](http://localhost:3000/) * Test Suite * `yarn test` * `yarn coverage` for a coverage report ## Images ## License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Add link to older version of site
Add link to older version of site
Markdown
mit
dentemple/my-developer-site,dentemple/my-developer-site
markdown
## Code Before: An open-source developer site using React. [Find me on Twitter!](https://twitter.com/dentemple) [Find me on LinkedIn!](https://www.linkedin.com/in/dentemple/) ## Technology ## Try It Out * Requirements * [Node](https://nodejs.org/en/download/) (Recommended v6.0+) * [yarn](https://yarnpkg.com/en/docs/install) * A command line interface (such as [Git Bash](https://git-scm.com/downloads) for Windows) * Install - ([How to clone a repository](https://help.github.com/articles/cloning-a-repository/)) * `git clone [email protected]:dentemple/my-developer-site.git` * `cd my-developer-site` * `yarn` * Run * `yarn start` * Navigate to the development environment here: [http://localhost:3000/](http://localhost:3000/) * Test Suite * `yarn test` * `yarn coverage` for a coverage report ## Images ## License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ## Instruction: Add link to older version of site ## Code After: An open-source developer site using React. [(Link to older version)](https://dentemple-31337.firebaseapp.com/) [Find me on Twitter!](https://twitter.com/dentemple) [Find me on LinkedIn!](https://www.linkedin.com/in/dentemple/) ## Technology ## Try It Out * Requirements * [Node](https://nodejs.org/en/download/) (Recommended v6.0+) * [yarn](https://yarnpkg.com/en/docs/install) * A command line interface (such as [Git Bash](https://git-scm.com/downloads) for Windows) * Install - ([How to clone a repository](https://help.github.com/articles/cloning-a-repository/)) * `git clone [email protected]:dentemple/my-developer-site.git` * `cd my-developer-site` * `yarn` * Run * `yarn start` * Navigate to the development environment here: [http://localhost:3000/](http://localhost:3000/) * Test Suite * `yarn test` * `yarn coverage` for a coverage report ## Images ## License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
0c04f830cf2b4aa5ba85712b78fc9dcea94b9ab0
src/main/java/se/kits/gakusei/content/repository/GrammarTextRepository.java
src/main/java/se/kits/gakusei/content/repository/GrammarTextRepository.java
package se.kits.gakusei.content.repository; import org.springframework.data.repository.CrudRepository; import se.kits.gakusei.content.model.GrammarText; public interface GrammarTextRepository extends CrudRepository<GrammarText, String> { }
package se.kits.gakusei.content.repository; import org.springframework.data.repository.CrudRepository; import se.kits.gakusei.content.model.GrammarText; import java.util.List; public interface GrammarTextRepository extends CrudRepository<GrammarText, String> { List<GrammarText> findByInflectionMethod(String inflectionMethod); }
Add method for finding grammarText using inflectionMethod
Add method for finding grammarText using inflectionMethod
Java
mit
kits-ab/gakusei,kits-ab/gakusei,kits-ab/gakusei
java
## Code Before: package se.kits.gakusei.content.repository; import org.springframework.data.repository.CrudRepository; import se.kits.gakusei.content.model.GrammarText; public interface GrammarTextRepository extends CrudRepository<GrammarText, String> { } ## Instruction: Add method for finding grammarText using inflectionMethod ## Code After: package se.kits.gakusei.content.repository; import org.springframework.data.repository.CrudRepository; import se.kits.gakusei.content.model.GrammarText; import java.util.List; public interface GrammarTextRepository extends CrudRepository<GrammarText, String> { List<GrammarText> findByInflectionMethod(String inflectionMethod); }
149054e5f6acff0807da5fc3b50c8583bc48e957
source/WebApp/.storybook/preview.js
source/WebApp/.storybook/preview.js
import '../less/app.less'; export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" }, controls: { matchers: { color: /(background|color)$/i, date: /Date$/, }, }, }
import '../less/app.less'; export const loaders = [ () => document.fonts.ready ]; export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" }, controls: { matchers: { color: /(background|color)$/i, date: /Date$/, }, }, }
Add font load dependency to Storybook
Add font load dependency to Storybook
JavaScript
bsd-2-clause
ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab,ashmind/SharpLab
javascript
## Code Before: import '../less/app.less'; export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" }, controls: { matchers: { color: /(background|color)$/i, date: /Date$/, }, }, } ## Instruction: Add font load dependency to Storybook ## Code After: import '../less/app.less'; export const loaders = [ () => document.fonts.ready ]; export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" }, controls: { matchers: { color: /(background|color)$/i, date: /Date$/, }, }, }
776686594b89fc30f8d5e0915628bc85b7d28b92
.travis.yml
.travis.yml
branches: only: - master language: php php: - 5.3 before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit --bootstrap tests/bootstrap.example.php tests/ notifications: irc: - "irc.freenode.org#fluxbb"
branches: only: - master language: php php: - 5.3 env: - DB_MYSQL_DBNAME=fluxbb_test - DB_MYSQL_HOST=0.0.0.0 - DB_MYSQL_USER= - DB_MYSQL_PASSWD= - DB_SQLITE_DBNAME=:memory: - DB_PGSQL_DBNAME=fluxbb_test - DB_PGSQL_HOST=127.0.0.1 - DB_PGSQL_USER=postgres - DB_PGSQL_PASSWD= before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit tests/ notifications: irc: - "irc.freenode.org#fluxbb"
Add environment variables to build script (which means we don't need a bootstrap file anymore).
Add environment variables to build script (which means we don't need a bootstrap file anymore).
YAML
lgpl-2.1
fluxbb/database
yaml
## Code Before: branches: only: - master language: php php: - 5.3 before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit --bootstrap tests/bootstrap.example.php tests/ notifications: irc: - "irc.freenode.org#fluxbb" ## Instruction: Add environment variables to build script (which means we don't need a bootstrap file anymore). ## Code After: branches: only: - master language: php php: - 5.3 env: - DB_MYSQL_DBNAME=fluxbb_test - DB_MYSQL_HOST=0.0.0.0 - DB_MYSQL_USER= - DB_MYSQL_PASSWD= - DB_SQLITE_DBNAME=:memory: - DB_PGSQL_DBNAME=fluxbb_test - DB_PGSQL_HOST=127.0.0.1 - DB_PGSQL_USER=postgres - DB_PGSQL_PASSWD= before_script: - "mysql -e 'create database fluxbb__test;'" - "psql -c 'create database fluxbb__test;' -U postgres" script: phpunit tests/ notifications: irc: - "irc.freenode.org#fluxbb"
6cf117fbdecaef72406b1d42bf7dc04c6da10654
src/redux/modules/user/reducer.js
src/redux/modules/user/reducer.js
import { asImmutable } from '../../../helper/immutableHelper'; import * as actions from './actions'; const initialState = asImmutable({}); export const reducer = (state = initialState, { type, payload }) => { switch (type) { case actions.FETCH_USER.SUCCEEDED: return state.merge(payload.data || {}); case actions.FETCH_USER_NOTES.SUCCEEDED: return state.merge({ notes: payload.data || [] }); case actions.STORE_USER_NOTE.SUCCEEDED: return state.mergeIn(['notes'], [payload.data]); case actions.FETCH_REPOSITORIES.SUCCEEDED: return state.merge({ repositories: payload.data || [] }); default: return state; } }; export default reducer;
import { asImmutable } from '../../../helper/immutableHelper'; import * as actions from './actions'; const initialState = asImmutable({}); export const reducer = (state = initialState, { type, payload }) => { switch (type) { case actions.FETCH_USER.SUCCEEDED: return state.merge(payload.data || {}); case actions.FETCH_USER_NOTES.SUCCEEDED: return state.merge({ notes: payload.data || [] }); case actions.STORE_USER_NOTE.SUCCEEDED: return state.set('notes', state.get('notes').push(asImmutable(payload.data))); case actions.FETCH_REPOSITORIES.SUCCEEDED: return state.merge({ repositories: payload.data || [] }); default: return state; } }; export default reducer;
Fix problem of note replacement
Fix problem of note replacement
JavaScript
apache-2.0
carloseduardosx/github-profile-search,carloseduardosx/github-profile-search,carloseduardosx/github-profile-search
javascript
## Code Before: import { asImmutable } from '../../../helper/immutableHelper'; import * as actions from './actions'; const initialState = asImmutable({}); export const reducer = (state = initialState, { type, payload }) => { switch (type) { case actions.FETCH_USER.SUCCEEDED: return state.merge(payload.data || {}); case actions.FETCH_USER_NOTES.SUCCEEDED: return state.merge({ notes: payload.data || [] }); case actions.STORE_USER_NOTE.SUCCEEDED: return state.mergeIn(['notes'], [payload.data]); case actions.FETCH_REPOSITORIES.SUCCEEDED: return state.merge({ repositories: payload.data || [] }); default: return state; } }; export default reducer; ## Instruction: Fix problem of note replacement ## Code After: import { asImmutable } from '../../../helper/immutableHelper'; import * as actions from './actions'; const initialState = asImmutable({}); export const reducer = (state = initialState, { type, payload }) => { switch (type) { case actions.FETCH_USER.SUCCEEDED: return state.merge(payload.data || {}); case actions.FETCH_USER_NOTES.SUCCEEDED: return state.merge({ notes: payload.data || [] }); case actions.STORE_USER_NOTE.SUCCEEDED: return state.set('notes', state.get('notes').push(asImmutable(payload.data))); case actions.FETCH_REPOSITORIES.SUCCEEDED: return state.merge({ repositories: payload.data || [] }); default: return state; } }; export default reducer;
0ffef8c45a7dc5df291dd27de25022b9075422df
lib/ansible/transmit.rb
lib/ansible/transmit.rb
module Ansible module Transmit def self.extended(base) base.class_eval do def self._beacons @_beacons ||= [] end before_filter :alert_beacons, only: @_beacons # Figure out a sane filter end end def transmit(name) _beacons << :"#{name}_ansible_beacon" define_method "#{name}_ansible_beacon" do raise NotImplementedError end end end end
module Ansible module Transmit def self.extended(base) base.class_eval do include ActionController::Live def self._beacons @_beacons ||= [] end before_filter :alert_beacons, only: @_beacons # Figure out a sane filter end end def transmit(name) _beacons << :"#{name}_ansible_beacon" define_method "#{name}_ansible_beacon" do raise NotImplementedError end end end end
Add in ActionController::Live in class_eval
Add in ActionController::Live in class_eval
Ruby
mit
derekparker/transmitter
ruby
## Code Before: module Ansible module Transmit def self.extended(base) base.class_eval do def self._beacons @_beacons ||= [] end before_filter :alert_beacons, only: @_beacons # Figure out a sane filter end end def transmit(name) _beacons << :"#{name}_ansible_beacon" define_method "#{name}_ansible_beacon" do raise NotImplementedError end end end end ## Instruction: Add in ActionController::Live in class_eval ## Code After: module Ansible module Transmit def self.extended(base) base.class_eval do include ActionController::Live def self._beacons @_beacons ||= [] end before_filter :alert_beacons, only: @_beacons # Figure out a sane filter end end def transmit(name) _beacons << :"#{name}_ansible_beacon" define_method "#{name}_ansible_beacon" do raise NotImplementedError end end end end
d3acb346f9cfbc2fa7ba0ecfd832e23a6faacc2b
.kitchen.yml
.kitchen.yml
driver: name: vagrant provisioner: name: chef_zero product_name: chef product_version: <%= ENV['CHEF_VERSION'] || 'latest' %> install_strategy: once deprecations_as_errors: true verifier: name: inspec platforms: - name: centos-6 - name: centos-7 - name: debian-8 - name: ubuntu-14.04 run_list: apt::default - name: ubuntu-16.04 run_list: apt::default suites: - name: default run_list: - recipe[snort] - recipe[pulledpork] attributes: pulledpork: rule_url_array: - 'https://snort.org/downloads/community/|community-rules.tar.gz|Community'
driver: name: vagrant provisioner: name: chef_zero product_name: chef product_version: <%= ENV['CHEF_VERSION'] || 'latest' %> install_strategy: once deprecations_as_errors: true verifier: name: inspec platforms: - name: centos-6 - name: centos-7 - name: debian-8 - name: ubuntu-14.04 - name: ubuntu-16.04 suites: - name: default run_list: - recipe[test::default] attributes: pulledpork: rule_url_array: - 'https://snort.org/downloads/community/|community-rules.tar.gz|Community'
Use the test recipe in Test Kitchen
Use the test recipe in Test Kitchen Signed-off-by: Tim Smith <[email protected]>
YAML
apache-2.0
tas50/chef-pulledpork,tas50/chef-pulledpork
yaml
## Code Before: driver: name: vagrant provisioner: name: chef_zero product_name: chef product_version: <%= ENV['CHEF_VERSION'] || 'latest' %> install_strategy: once deprecations_as_errors: true verifier: name: inspec platforms: - name: centos-6 - name: centos-7 - name: debian-8 - name: ubuntu-14.04 run_list: apt::default - name: ubuntu-16.04 run_list: apt::default suites: - name: default run_list: - recipe[snort] - recipe[pulledpork] attributes: pulledpork: rule_url_array: - 'https://snort.org/downloads/community/|community-rules.tar.gz|Community' ## Instruction: Use the test recipe in Test Kitchen Signed-off-by: Tim Smith <[email protected]> ## Code After: driver: name: vagrant provisioner: name: chef_zero product_name: chef product_version: <%= ENV['CHEF_VERSION'] || 'latest' %> install_strategy: once deprecations_as_errors: true verifier: name: inspec platforms: - name: centos-6 - name: centos-7 - name: debian-8 - name: ubuntu-14.04 - name: ubuntu-16.04 suites: - name: default run_list: - recipe[test::default] attributes: pulledpork: rule_url_array: - 'https://snort.org/downloads/community/|community-rules.tar.gz|Community'
88fbd428ceb79d6e176ff235256c8e5951815085
inspector/inspector/urls.py
inspector/inspector/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name='base.html'), name='home'), url(r'^admin/', include(admin.site.urls)), url(r'^class/', include('cbv.urls')), ) urlpatterns += staticfiles_urlpatterns() + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name='base.html'), name='home'), url(r'^projects/', include('cbv.urls')), url(r'^admin/', include(admin.site.urls)), ) urlpatterns += staticfiles_urlpatterns() + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Make the url structure a bit more sensible.
Make the url structure a bit more sensible.
Python
bsd-2-clause
refreshoxford/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector,refreshoxford/django-cbv-inspector,abhijo89/django-cbv-inspector,abhijo89/django-cbv-inspector
python
## Code Before: from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name='base.html'), name='home'), url(r'^admin/', include(admin.site.urls)), url(r'^class/', include('cbv.urls')), ) urlpatterns += staticfiles_urlpatterns() + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ## Instruction: Make the url structure a bit more sensible. ## Code After: from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name='base.html'), name='home'), url(r'^projects/', include('cbv.urls')), url(r'^admin/', include(admin.site.urls)), ) urlpatterns += staticfiles_urlpatterns() + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
da031e71f80beb7a42807a55c3e29c0064bdd9b2
lib/pesapal.rb
lib/pesapal.rb
require 'net/http' require 'pesapal/merchant' require 'pesapal/merchant/details' require 'pesapal/merchant/post' require 'pesapal/merchant/status' require 'pesapal/oauth' require 'pesapal/version' require 'pesapal/railtie' if defined?(Rails)
require 'htmlentities' require 'net/http' require 'pesapal/merchant' require 'pesapal/merchant/details' require 'pesapal/merchant/post' require 'pesapal/merchant/status' require 'pesapal/oauth' require 'pesapal/version' require 'pesapal/railtie' if defined?(Rails)
Fix error cause by missing htmlentities
Fix error cause by missing htmlentities
Ruby
mit
itsmrwave/pesapal-gem
ruby
## Code Before: require 'net/http' require 'pesapal/merchant' require 'pesapal/merchant/details' require 'pesapal/merchant/post' require 'pesapal/merchant/status' require 'pesapal/oauth' require 'pesapal/version' require 'pesapal/railtie' if defined?(Rails) ## Instruction: Fix error cause by missing htmlentities ## Code After: require 'htmlentities' require 'net/http' require 'pesapal/merchant' require 'pesapal/merchant/details' require 'pesapal/merchant/post' require 'pesapal/merchant/status' require 'pesapal/oauth' require 'pesapal/version' require 'pesapal/railtie' if defined?(Rails)
6c469cb65b8a1dd6ae99a2bec4f98451d94e8070
db/seeds.rb
db/seeds.rb
User.create(first_name: 'Admin', last_name: 'User', email: '[email protected]', access_level: Constants.get_access_id(:admin), password: 'password', password_confirmation: 'password') # Create a default category Category.create(name: 'Default')
User.create(first_name: 'Admin', last_name: 'User', email: '[email protected]', access_level: Constants.get_access_id(:admin), password: 'password', password_confirmation: 'password') Boss.create(boss_id: 1, employee_id: 1) # Create a default category Category.create(name: 'Default')
Add a boss/employee relationship for admin to itself in db:seed
Add a boss/employee relationship for admin to itself in db:seed
Ruby
mit
rnelson/bossfight,rnelson/bossfight,rnelson/bossfight
ruby
## Code Before: User.create(first_name: 'Admin', last_name: 'User', email: '[email protected]', access_level: Constants.get_access_id(:admin), password: 'password', password_confirmation: 'password') # Create a default category Category.create(name: 'Default') ## Instruction: Add a boss/employee relationship for admin to itself in db:seed ## Code After: User.create(first_name: 'Admin', last_name: 'User', email: '[email protected]', access_level: Constants.get_access_id(:admin), password: 'password', password_confirmation: 'password') Boss.create(boss_id: 1, employee_id: 1) # Create a default category Category.create(name: 'Default')
d46af8a66b07502862a3bba663975de2d4dd9278
vim/mod/set.vim
vim/mod/set.vim
set shell=sh set shortmess+=I set runtimepath+=$GOROOT/misc/vim set backup set backupdir=~/.cache/vim set undofile set undodir=~/.cache/vim set ai smartindent set hlsearch set ignorecase set smartcase set showmatch let c_space_errors=1 if v:version >= 704 set cryptmethod=blowfish2 else " unsecure, but Debian likes it set cryptmethod=blowfish endif set exrc set secure set vb set modeline set noexpandtab set shiftwidth=8 set tabstop=8 set t_Co=256 set wildmenu set lazyredraw set history=1000 set autoread if exists('$DISPLAY') let &t_SI .= "\<Esc>[5 q" let &t_EI .= "\<Esc>[2 q" endif " Spelling support set nospell spelllang=en_us,de set spellfile=~/.vim/spell/spellfile.add helptags ~/.vim/pack syntax on filetype plugin indent on
set shell=sh set shortmess+=I set runtimepath+=$GOROOT/misc/vim set backup set backupdir=~/.cache/vim set undofile set undodir=~/.cache/vim set ai smartindent set hlsearch set ignorecase set smartcase set showmatch let c_space_errors=1 if v:version >= 704 set cryptmethod=blowfish2 else " unsecure, but Debian likes it set cryptmethod=blowfish endif set exrc set secure set vb set modeline set noexpandtab set shiftwidth=8 set tabstop=8 set t_Co=256 set wildmenu set lazyredraw set history=1000 set autoread if exists('$DISPLAY') let &t_SI .= "\<Esc>[5 q" let &t_EI .= "\<Esc>[2 q" endif " Spelling support set nospell spelllang=en_us,de set spellfile=~/.vim/spell/spellfile.add for s:v in split(glob("~/.vim/pack/vim/start/*/doc")) execute "helptags" s:v endfor syntax on filetype plugin indent on
Fix doc paths for plugins
Fix doc paths for plugins
VimL
bsd-2-clause
nakal/shell-setup,nakal/shell-setup
viml
## Code Before: set shell=sh set shortmess+=I set runtimepath+=$GOROOT/misc/vim set backup set backupdir=~/.cache/vim set undofile set undodir=~/.cache/vim set ai smartindent set hlsearch set ignorecase set smartcase set showmatch let c_space_errors=1 if v:version >= 704 set cryptmethod=blowfish2 else " unsecure, but Debian likes it set cryptmethod=blowfish endif set exrc set secure set vb set modeline set noexpandtab set shiftwidth=8 set tabstop=8 set t_Co=256 set wildmenu set lazyredraw set history=1000 set autoread if exists('$DISPLAY') let &t_SI .= "\<Esc>[5 q" let &t_EI .= "\<Esc>[2 q" endif " Spelling support set nospell spelllang=en_us,de set spellfile=~/.vim/spell/spellfile.add helptags ~/.vim/pack syntax on filetype plugin indent on ## Instruction: Fix doc paths for plugins ## Code After: set shell=sh set shortmess+=I set runtimepath+=$GOROOT/misc/vim set backup set backupdir=~/.cache/vim set undofile set undodir=~/.cache/vim set ai smartindent set hlsearch set ignorecase set smartcase set showmatch let c_space_errors=1 if v:version >= 704 set cryptmethod=blowfish2 else " unsecure, but Debian likes it set cryptmethod=blowfish endif set exrc set secure set vb set modeline set noexpandtab set shiftwidth=8 set tabstop=8 set t_Co=256 set wildmenu set lazyredraw set history=1000 set autoread if exists('$DISPLAY') let &t_SI .= "\<Esc>[5 q" let &t_EI .= "\<Esc>[2 q" endif " Spelling support set nospell spelllang=en_us,de set spellfile=~/.vim/spell/spellfile.add for s:v in split(glob("~/.vim/pack/vim/start/*/doc")) execute "helptags" s:v endfor syntax on filetype plugin indent on
ca106043fc655a1c51332aedf9b001a512269550
local-cli/wrong-react-native.js
local-cli/wrong-react-native.js
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ var script = process.argv[1]; var installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1; if (installedGlobally) { const chalk = require('chalk'); console.error([ chalk.red('Looks like you installed react-native globally, maybe you meant react-native-cli?'), chalk.red('To fix the issue, run:'), 'npm uninstall -g react-native', 'npm install -g react-native-cli' ].join('\n')); process.exit(1); } else { require('./cli').run(); }
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ const isWindows = process.platform === 'win32'; var installedGlobally; if (isWindows) { const fs = require('fs'); const path = require('path'); // On Windows, assume we are installed globally if we can't find a package.json above node_modules. installedGlobally = !(fs.existsSync(path.join(__dirname, '../../../package.json'))); } else { // On non-windows, assume we are installed globally if we are called from outside of the node_mobules/.bin/react-native executable. var script = process.argv[1]; installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1; } if (installedGlobally) { const chalk = require('chalk'); console.error([ chalk.red('Looks like you installed react-native globally, maybe you meant react-native-cli?'), chalk.red('To fix the issue, run:'), 'npm uninstall -g react-native', 'npm install -g react-native-cli' ].join('\n')); process.exit(1); } else { require('./cli').run(); }
Fix local-cli's installedGlobally check to work on Windows platforms
Fix local-cli's installedGlobally check to work on Windows platforms Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> The react-native local-cli does a check to see if it is being run from a global install or not. If running from a global install, an error is printed and the CLI exits. This check for a global install does not work on Windows. The check of `process.argv` does not contain the expected `node_modules/.bin/react-native`. It instead contains a direct path to the `wrong-react-native.js` file, as determined by the `node_modules/.bin/react-native.cmd` entry point. This update will, on Windows platforms, do a global check by instead looking for the existence of a package.json above the node_modules. If not found, we assume a global install and print the error. In a react-native project, I originally tried running the local react-native cli: ``` > yarn react-native --version yarn run v1.3.2 $ E:\myproject\node_modules\.bin\react-native --version Looks like you installed react-native globally, maybe you meant react-native-cli? To fix the issue, run: npm uninstall -g react-native npm install -g react-native-cli error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` I replaced the `wrong-react-native.js` with the modified version and reran the command: ``` > yarn react-native --version yarn run v1.3.2 $ E:\myproject\node_modules\.bin\react-native --version Scanning folders for symlinks in E:\myproject\node_modules (93ms) 0.50.3 Done in 1.86s. ``` <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> [CLI] [BUGFIX] [local-cli/wrong-react-native.js] - Updated local-cli on Windows to check for the absence of a package.json file to determine if being run from a global installation or not. Closes https://github.com/facebook/react-native/pull/17036 Differential Revision: D6471925 Pulled By: TheSavior fbshipit-source-id: cc5560d1c102d05f378e5ae537f13d31b5343045
JavaScript
mit
facebook/react-native,dikaiosune/react-native,hammerandchisel/react-native,myntra/react-native,jevakallio/react-native,ptmt/react-native-macos,hammerandchisel/react-native,Bhullnatik/react-native,javache/react-native,hammerandchisel/react-native,hoastoolshop/react-native,hammerandchisel/react-native,myntra/react-native,Bhullnatik/react-native,exponent/react-native,hoastoolshop/react-native,pandiaraj44/react-native,jevakallio/react-native,hammerandchisel/react-native,facebook/react-native,pandiaraj44/react-native,exponentjs/react-native,facebook/react-native,hoastoolshop/react-native,hoastoolshop/react-native,myntra/react-native,facebook/react-native,hoangpham95/react-native,hoangpham95/react-native,hammerandchisel/react-native,rickbeerendonk/react-native,myntra/react-native,myntra/react-native,exponent/react-native,ptmt/react-native-macos,exponentjs/react-native,dikaiosune/react-native,hoastoolshop/react-native,javache/react-native,exponent/react-native,janicduplessis/react-native,Bhullnatik/react-native,hoangpham95/react-native,javache/react-native,ptmt/react-native-macos,pandiaraj44/react-native,myntra/react-native,javache/react-native,jevakallio/react-native,janicduplessis/react-native,rickbeerendonk/react-native,arthuralee/react-native,hoastoolshop/react-native,facebook/react-native,Bhullnatik/react-native,exponentjs/react-native,rickbeerendonk/react-native,rickbeerendonk/react-native,exponentjs/react-native,rickbeerendonk/react-native,janicduplessis/react-native,exponent/react-native,janicduplessis/react-native,dikaiosune/react-native,arthuralee/react-native,hoangpham95/react-native,jevakallio/react-native,arthuralee/react-native,exponent/react-native,Bhullnatik/react-native,facebook/react-native,javache/react-native,hoastoolshop/react-native,hoangpham95/react-native,jevakallio/react-native,facebook/react-native,dikaiosune/react-native,facebook/react-native,pandiaraj44/react-native,exponentjs/react-native,dikaiosune/react-native,rickbeerendonk/react-native,exponent/react-native,javache/react-native,exponentjs/react-native,hoangpham95/react-native,hoangpham95/react-native,myntra/react-native,ptmt/react-native-macos,Bhullnatik/react-native,jevakallio/react-native,jevakallio/react-native,exponentjs/react-native,javache/react-native,hammerandchisel/react-native,ptmt/react-native-macos,javache/react-native,janicduplessis/react-native,jevakallio/react-native,janicduplessis/react-native,javache/react-native,Bhullnatik/react-native,hammerandchisel/react-native,exponentjs/react-native,pandiaraj44/react-native,jevakallio/react-native,pandiaraj44/react-native,arthuralee/react-native,myntra/react-native,arthuralee/react-native,pandiaraj44/react-native,dikaiosune/react-native,ptmt/react-native-macos,facebook/react-native,hoangpham95/react-native,exponent/react-native,exponent/react-native,rickbeerendonk/react-native,ptmt/react-native-macos,rickbeerendonk/react-native,janicduplessis/react-native,hoastoolshop/react-native,Bhullnatik/react-native,rickbeerendonk/react-native,pandiaraj44/react-native,dikaiosune/react-native,myntra/react-native,ptmt/react-native-macos,dikaiosune/react-native,janicduplessis/react-native
javascript
## Code Before: /** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ var script = process.argv[1]; var installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1; if (installedGlobally) { const chalk = require('chalk'); console.error([ chalk.red('Looks like you installed react-native globally, maybe you meant react-native-cli?'), chalk.red('To fix the issue, run:'), 'npm uninstall -g react-native', 'npm install -g react-native-cli' ].join('\n')); process.exit(1); } else { require('./cli').run(); } ## Instruction: Fix local-cli's installedGlobally check to work on Windows platforms Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> The react-native local-cli does a check to see if it is being run from a global install or not. If running from a global install, an error is printed and the CLI exits. This check for a global install does not work on Windows. The check of `process.argv` does not contain the expected `node_modules/.bin/react-native`. It instead contains a direct path to the `wrong-react-native.js` file, as determined by the `node_modules/.bin/react-native.cmd` entry point. This update will, on Windows platforms, do a global check by instead looking for the existence of a package.json above the node_modules. If not found, we assume a global install and print the error. In a react-native project, I originally tried running the local react-native cli: ``` > yarn react-native --version yarn run v1.3.2 $ E:\myproject\node_modules\.bin\react-native --version Looks like you installed react-native globally, maybe you meant react-native-cli? To fix the issue, run: npm uninstall -g react-native npm install -g react-native-cli error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` I replaced the `wrong-react-native.js` with the modified version and reran the command: ``` > yarn react-native --version yarn run v1.3.2 $ E:\myproject\node_modules\.bin\react-native --version Scanning folders for symlinks in E:\myproject\node_modules (93ms) 0.50.3 Done in 1.86s. ``` <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> [CLI] [BUGFIX] [local-cli/wrong-react-native.js] - Updated local-cli on Windows to check for the absence of a package.json file to determine if being run from a global installation or not. Closes https://github.com/facebook/react-native/pull/17036 Differential Revision: D6471925 Pulled By: TheSavior fbshipit-source-id: cc5560d1c102d05f378e5ae537f13d31b5343045 ## Code After: /** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ const isWindows = process.platform === 'win32'; var installedGlobally; if (isWindows) { const fs = require('fs'); const path = require('path'); // On Windows, assume we are installed globally if we can't find a package.json above node_modules. installedGlobally = !(fs.existsSync(path.join(__dirname, '../../../package.json'))); } else { // On non-windows, assume we are installed globally if we are called from outside of the node_mobules/.bin/react-native executable. var script = process.argv[1]; installedGlobally = script.indexOf('node_modules/.bin/react-native') === -1; } if (installedGlobally) { const chalk = require('chalk'); console.error([ chalk.red('Looks like you installed react-native globally, maybe you meant react-native-cli?'), chalk.red('To fix the issue, run:'), 'npm uninstall -g react-native', 'npm install -g react-native-cli' ].join('\n')); process.exit(1); } else { require('./cli').run(); }
c0ee940a1de0ce38d504a55abca5050618ae945d
data/script.js
data/script.js
function replace_t_co_links() { $('.twitter-timeline-link').each(function(){ if (!$(this).attr('data-url-expanded')) { data_expanded_url = $(this).attr('data-expanded-url'); if (data_expanded_url) { $(this).attr('href', data_expanded_url); $(this).attr('data-url-expanded', '1'); $('> .js-display-url', this).html(data_expanded_url); }} }); } $(document).ready(function(){ replace_t_co_links(); console.error("Voila"); var observer = new MutationObserver(function(mutations){ replace_t_co_links(); }); var config = { attributes: true, childList: true, characterData: true, subtree: true }; observer.observe(document.body, config); });
function replace_t_co_links() { $('.twitter-timeline-link').each(function(){ if (!$(this).attr('data-url-expanded')) { data_expanded_url = $(this).attr('data-expanded-url'); if (data_expanded_url) { $(this).attr('href', data_expanded_url); $(this).attr('data-url-expanded', '1'); $('> .js-display-url', this).html(data_expanded_url); }} }); } $(document).ready(function(){ replace_t_co_links(); var observer = new MutationObserver(function(mutations){ replace_t_co_links(); }); var config = { attributes: true, childList: true, characterData: true, subtree: true }; observer.observe(document.body, config); });
Remove a debug console error statement
Remove a debug console error statement
JavaScript
agpl-3.0
lgp171188/auto-expand-twitter-shortlinks
javascript
## Code Before: function replace_t_co_links() { $('.twitter-timeline-link').each(function(){ if (!$(this).attr('data-url-expanded')) { data_expanded_url = $(this).attr('data-expanded-url'); if (data_expanded_url) { $(this).attr('href', data_expanded_url); $(this).attr('data-url-expanded', '1'); $('> .js-display-url', this).html(data_expanded_url); }} }); } $(document).ready(function(){ replace_t_co_links(); console.error("Voila"); var observer = new MutationObserver(function(mutations){ replace_t_co_links(); }); var config = { attributes: true, childList: true, characterData: true, subtree: true }; observer.observe(document.body, config); }); ## Instruction: Remove a debug console error statement ## Code After: function replace_t_co_links() { $('.twitter-timeline-link').each(function(){ if (!$(this).attr('data-url-expanded')) { data_expanded_url = $(this).attr('data-expanded-url'); if (data_expanded_url) { $(this).attr('href', data_expanded_url); $(this).attr('data-url-expanded', '1'); $('> .js-display-url', this).html(data_expanded_url); }} }); } $(document).ready(function(){ replace_t_co_links(); var observer = new MutationObserver(function(mutations){ replace_t_co_links(); }); var config = { attributes: true, childList: true, characterData: true, subtree: true }; observer.observe(document.body, config); });
627ceda6471671cc39da28ec99f2280660cf4b1a
README.md
README.md
Library that will abstract away the process of associating a phone with an Android Auto head unit. Once associated, a device will gain the ability to unlock the head unit via BLE. The library supports both iOS and Android, the code for which is contained with the `ios` and `android` directories respectively. For usage instructions, follow the [Phone SDK Integration Guide](https://docs.partner.android.com/gas/integrate/companion_app/cd_phone_sdk).
Library that will abstract away the process of associating a phone with an Android Auto head unit. Once associated, a device will gain the ability to unlock the head unit via BLE. The library supports both iOS and Android, the code for which is contained with the `ios` and `android` directories respectively. For usage instructions, follow the [Phone SDK Integration Guide](https://docs.partner.android.com/automotive/integrate/companion_app/cd_phone_sdk).
Update the link to integration guide.
Update the link to integration guide.
Markdown
apache-2.0
google/android-auto-companion-android,google/android-auto-companion-android
markdown
## Code Before: Library that will abstract away the process of associating a phone with an Android Auto head unit. Once associated, a device will gain the ability to unlock the head unit via BLE. The library supports both iOS and Android, the code for which is contained with the `ios` and `android` directories respectively. For usage instructions, follow the [Phone SDK Integration Guide](https://docs.partner.android.com/gas/integrate/companion_app/cd_phone_sdk). ## Instruction: Update the link to integration guide. ## Code After: Library that will abstract away the process of associating a phone with an Android Auto head unit. Once associated, a device will gain the ability to unlock the head unit via BLE. The library supports both iOS and Android, the code for which is contained with the `ios` and `android` directories respectively. For usage instructions, follow the [Phone SDK Integration Guide](https://docs.partner.android.com/automotive/integrate/companion_app/cd_phone_sdk).
c10655e3f2f56199fee6cae8136f831719320d3d
src/main/resources/examples/customized/spells.yml
src/main/resources/examples/customized/spells.yml
nuke: enabled: false # Increase the cooldown for Magic Missile missile: parameters: cooldown: 10000 # Change the costs of blink blink: costs: mana: 100 # Add a new version of blink superblink: inherit: blink parameters: range: 512
nuke: enabled: false # Increase the cooldown for Magic Missile missile: parameters: cooldown: 10000 # Change the costs of blink blink: costs: mana: 100 # Add a new version of blink superblink: inherit: blink parameters: range: 512 # Make it so Torch doesn't level up torch: upgrade_required_casts: 0 # Make it so Toss will auto-undo toss: parameters: undo: 5000
Add a few more examples to the customized example config
Add a few more examples to the customized example config
YAML
mit
elBukkit/MagicPlugin,elBukkit/MagicPlugin,elBukkit/MagicPlugin
yaml
## Code Before: nuke: enabled: false # Increase the cooldown for Magic Missile missile: parameters: cooldown: 10000 # Change the costs of blink blink: costs: mana: 100 # Add a new version of blink superblink: inherit: blink parameters: range: 512 ## Instruction: Add a few more examples to the customized example config ## Code After: nuke: enabled: false # Increase the cooldown for Magic Missile missile: parameters: cooldown: 10000 # Change the costs of blink blink: costs: mana: 100 # Add a new version of blink superblink: inherit: blink parameters: range: 512 # Make it so Torch doesn't level up torch: upgrade_required_casts: 0 # Make it so Toss will auto-undo toss: parameters: undo: 5000
66a8752afa4e275e7fcd238d56d6ecdf26143b59
createUser.php
createUser.php
<?php $cid = $_POST["username"]; $old_passwd = $_POST["password"]; $email = $_POST["email"]; $nick = $_POST["nick"]; $new_passwd = $_POST["new_password"]; $redirect = $_GET["redirect_to"]; require("ldap.php"); require("auth.php"); $ldap = new ldap($cid); $auth = new auth(); if ($ldap->askChalmers() && $ldap->authChalmers($old_passwd)) { $error = $ldap->addUser($email, $nick, $new_passwd); if ($error) throw new Exception("didnt work"); $auth->addToken($cid); if (!empty($redirect)) { header("Location: ".$redirect); } }
<?php $cid = $_POST["username"]; $old_passwd = $_POST["password"]; $email = $_POST["email"]; $nick = $_POST["nick"]; $new_passwd = $_POST["new_password"]; $redirect = $_GET["redirect_to"]; require("ldap.php"); require("auth.php"); $ldap = new ldap($cid); $auth = new auth(); if (($ldap->askChalmers(true) || $ldap->askChalmers(false) && $auth->isWhitelisted($cid)) && $ldap->authChalmers($old_passwd)) { $error = $ldap->addUser($email, $nick, $new_passwd); if ($error) throw new Exception("didnt work"); $auth->addToken($cid); if (!empty($redirect)) { header("Location: ".$redirect); } }
Use whitelist when creating account
Use whitelist when creating account
PHP
mit
cthit/auth,cthit/auth
php
## Code Before: <?php $cid = $_POST["username"]; $old_passwd = $_POST["password"]; $email = $_POST["email"]; $nick = $_POST["nick"]; $new_passwd = $_POST["new_password"]; $redirect = $_GET["redirect_to"]; require("ldap.php"); require("auth.php"); $ldap = new ldap($cid); $auth = new auth(); if ($ldap->askChalmers() && $ldap->authChalmers($old_passwd)) { $error = $ldap->addUser($email, $nick, $new_passwd); if ($error) throw new Exception("didnt work"); $auth->addToken($cid); if (!empty($redirect)) { header("Location: ".$redirect); } } ## Instruction: Use whitelist when creating account ## Code After: <?php $cid = $_POST["username"]; $old_passwd = $_POST["password"]; $email = $_POST["email"]; $nick = $_POST["nick"]; $new_passwd = $_POST["new_password"]; $redirect = $_GET["redirect_to"]; require("ldap.php"); require("auth.php"); $ldap = new ldap($cid); $auth = new auth(); if (($ldap->askChalmers(true) || $ldap->askChalmers(false) && $auth->isWhitelisted($cid)) && $ldap->authChalmers($old_passwd)) { $error = $ldap->addUser($email, $nick, $new_passwd); if ($error) throw new Exception("didnt work"); $auth->addToken($cid); if (!empty($redirect)) { header("Location: ".$redirect); } }
04efe5ced34803c4d6a6663800611039194cfefd
openflow/of10/match.go
openflow/of10/match.go
package of10 import "net" type Match struct { Wildcards uint32 InPort PortNumber EthSrc net.HardwareAddr EthDst net.HardwareAddr VlanId VlanId VlanPriority VlanPriority pad1 [1]uint8 EtherType EtherType IpTos Dscp IpProtocol ProtocolNumber pad2 [2]uint8 IpSrc net.IP IpDst net.IP NetworkSrc NetworkPort NetworkDst NetworkPort } type VlanId uint16 type VlanPriority uint8 type EtherType uint16 type Dscp uint8 type ProtocolNumber uint8 type NetworkPort uint16
package of10 import "net" type Match struct { Wildcards Wildcard InPort PortNumber EthSrc net.HardwareAddr EthDst net.HardwareAddr VlanId VlanId VlanPriority VlanPriority pad1 [1]uint8 EtherType EtherType IpTos Dscp IpProtocol ProtocolNumber pad2 [2]uint8 IpSrc net.IP IpDst net.IP NetworkSrc NetworkPort NetworkDst NetworkPort } type Wildcard uint32 type VlanId uint16 type VlanPriority uint8 type EtherType uint16 type Dscp uint8 type ProtocolNumber uint8 type NetworkPort uint16 const ( OFPFW_IN_PORT Wildcard = 1 << iota OFPFW_DL_VLAN OFPFW_DL_SRC OFPFW_DL_DST OFPFW_DL_TYPE OFPFW_NW_PROTO OFPFW_TP_SRC OFPFW_TP_DST OFPFW_NW_SRC_SHIFT Wildcard = 8 OFPFW_NW_SRC_BITS Wildcard = 6 OFPFW_NW_SRC_MASK Wildcard = ((1 << OFPFW_NW_SRC_BITS) - 1) << OFPFW_NW_SRC_SHIFT OFPFW_NW_DST_SHIFT Wildcard = 16 OFPFW_NW_DST_BITS Wildcard = 6 OFPFW_NW_DST_MASK Wildcard = ((1 << OFPFW_NW_DST_BITS) - 1) << OFPFW_NW_DST_SHIFT OFPFW_NW_DST_ALL Wildcard = 32 << OFPFW_NW_DST_SHIFT OFPFW_DL_VLAN_PCP Wildcard = 1 << 20 OFPFW_NW_TOS Wildcard = 1 << 21 OFPFW_ALL Wildcard = ((1 << 22) - 1) )
Declare constant related to wildcard
Declare constant related to wildcard
Go
mit
oshothebig/goflow
go
## Code Before: package of10 import "net" type Match struct { Wildcards uint32 InPort PortNumber EthSrc net.HardwareAddr EthDst net.HardwareAddr VlanId VlanId VlanPriority VlanPriority pad1 [1]uint8 EtherType EtherType IpTos Dscp IpProtocol ProtocolNumber pad2 [2]uint8 IpSrc net.IP IpDst net.IP NetworkSrc NetworkPort NetworkDst NetworkPort } type VlanId uint16 type VlanPriority uint8 type EtherType uint16 type Dscp uint8 type ProtocolNumber uint8 type NetworkPort uint16 ## Instruction: Declare constant related to wildcard ## Code After: package of10 import "net" type Match struct { Wildcards Wildcard InPort PortNumber EthSrc net.HardwareAddr EthDst net.HardwareAddr VlanId VlanId VlanPriority VlanPriority pad1 [1]uint8 EtherType EtherType IpTos Dscp IpProtocol ProtocolNumber pad2 [2]uint8 IpSrc net.IP IpDst net.IP NetworkSrc NetworkPort NetworkDst NetworkPort } type Wildcard uint32 type VlanId uint16 type VlanPriority uint8 type EtherType uint16 type Dscp uint8 type ProtocolNumber uint8 type NetworkPort uint16 const ( OFPFW_IN_PORT Wildcard = 1 << iota OFPFW_DL_VLAN OFPFW_DL_SRC OFPFW_DL_DST OFPFW_DL_TYPE OFPFW_NW_PROTO OFPFW_TP_SRC OFPFW_TP_DST OFPFW_NW_SRC_SHIFT Wildcard = 8 OFPFW_NW_SRC_BITS Wildcard = 6 OFPFW_NW_SRC_MASK Wildcard = ((1 << OFPFW_NW_SRC_BITS) - 1) << OFPFW_NW_SRC_SHIFT OFPFW_NW_DST_SHIFT Wildcard = 16 OFPFW_NW_DST_BITS Wildcard = 6 OFPFW_NW_DST_MASK Wildcard = ((1 << OFPFW_NW_DST_BITS) - 1) << OFPFW_NW_DST_SHIFT OFPFW_NW_DST_ALL Wildcard = 32 << OFPFW_NW_DST_SHIFT OFPFW_DL_VLAN_PCP Wildcard = 1 << 20 OFPFW_NW_TOS Wildcard = 1 << 21 OFPFW_ALL Wildcard = ((1 << 22) - 1) )
4e4e510833e3a45d7628af23f45d55917a2e358c
spec-nylas/stores/namespace-store-spec.coffee
spec-nylas/stores/namespace-store-spec.coffee
_ = require 'underscore' NamespaceStore = require '../../src/flux/stores/namespace-store' describe "NamespaceStore", -> beforeEach -> @constructor = NamespaceStore.constructor it "should initialize current() using data saved in config", -> state = "id": "123", "email_address":"[email protected]", "object":"namespace" "organization_unit": "label" spyOn(atom.config, 'get').andCallFake -> state instance = new @constructor expect(instance.current().id).toEqual(state['id']) expect(instance.current().emailAddress).toEqual(state['email_address']) it "should initialize current() to null if data is not present", -> spyOn(atom.config, 'get').andCallFake -> null instance = new @constructor expect(instance.current()).toEqual(null) it "should initialize current() to null if data is invalid", -> spyOn(atom.config, 'get').andCallFake -> "this isn't an object" instance = new @constructor expect(instance.current()).toEqual(null)
_ = require 'underscore' NamespaceStore = require '../../src/flux/stores/namespace-store' describe "NamespaceStore", -> beforeEach -> @instance = null @constructor = NamespaceStore.constructor afterEach -> @instance.stopListeningToAll() it "should initialize current() using data saved in config", -> state = "id": "123", "email_address":"[email protected]", "object":"namespace" "organization_unit": "label" spyOn(atom.config, 'get').andCallFake -> state @instance = new @constructor expect(@instance.current().id).toEqual(state['id']) expect(@instance.current().emailAddress).toEqual(state['email_address']) it "should initialize current() to null if data is not present", -> spyOn(atom.config, 'get').andCallFake -> null @instance = new @constructor expect(@instance.current()).toEqual(null) it "should initialize current() to null if data is invalid", -> spyOn(atom.config, 'get').andCallFake -> "this isn't an object" @instance = new @constructor expect(@instance.current()).toEqual(null)
Fix memory leak in NamespaceStoreSpec
fix(spec): Fix memory leak in NamespaceStoreSpec
CoffeeScript
mit
nirmit/nylas-mail,simonft/nylas-mail,nirmit/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,nirmit/nylas-mail,simonft/nylas-mail,nylas-mail-lives/nylas-mail,nylas/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,nylas-mail-lives/nylas-mail,simonft/nylas-mail,nirmit/nylas-mail,nylas/nylas-mail,nirmit/nylas-mail,nylas/nylas-mail,simonft/nylas-mail,simonft/nylas-mail,nylas-mail-lives/nylas-mail
coffeescript
## Code Before: _ = require 'underscore' NamespaceStore = require '../../src/flux/stores/namespace-store' describe "NamespaceStore", -> beforeEach -> @constructor = NamespaceStore.constructor it "should initialize current() using data saved in config", -> state = "id": "123", "email_address":"[email protected]", "object":"namespace" "organization_unit": "label" spyOn(atom.config, 'get').andCallFake -> state instance = new @constructor expect(instance.current().id).toEqual(state['id']) expect(instance.current().emailAddress).toEqual(state['email_address']) it "should initialize current() to null if data is not present", -> spyOn(atom.config, 'get').andCallFake -> null instance = new @constructor expect(instance.current()).toEqual(null) it "should initialize current() to null if data is invalid", -> spyOn(atom.config, 'get').andCallFake -> "this isn't an object" instance = new @constructor expect(instance.current()).toEqual(null) ## Instruction: fix(spec): Fix memory leak in NamespaceStoreSpec ## Code After: _ = require 'underscore' NamespaceStore = require '../../src/flux/stores/namespace-store' describe "NamespaceStore", -> beforeEach -> @instance = null @constructor = NamespaceStore.constructor afterEach -> @instance.stopListeningToAll() it "should initialize current() using data saved in config", -> state = "id": "123", "email_address":"[email protected]", "object":"namespace" "organization_unit": "label" spyOn(atom.config, 'get').andCallFake -> state @instance = new @constructor expect(@instance.current().id).toEqual(state['id']) expect(@instance.current().emailAddress).toEqual(state['email_address']) it "should initialize current() to null if data is not present", -> spyOn(atom.config, 'get').andCallFake -> null @instance = new @constructor expect(@instance.current()).toEqual(null) it "should initialize current() to null if data is invalid", -> spyOn(atom.config, 'get').andCallFake -> "this isn't an object" @instance = new @constructor expect(@instance.current()).toEqual(null)
7f88db085a6a63106969e63a7fa1552dcb0e95de
lib/slack_trello/copy_cards.rb
lib/slack_trello/copy_cards.rb
module SlackTrello; class CopyCards attr_reader :source_board, :source_list, :destination_board, :destination_list def initialize(source_board, source_list, destination_board, destination_list) @source_board = source_board @source_list = source_list @destination_board = destination_board @destination_list = destination_list end def run source_cards.each do |source_card| creator = CreateTrelloCard.new(destination_board, destination_list, source_card.name) creator.card end end def source_cards l = TrelloLookup.list(source_board, source_list) l.cards end end; end
module SlackTrello; class CopyCards attr_reader :source_board, :source_list, :destination_board, :destination_list def initialize(source_board, source_list, destination_board, destination_list) @source_board = source_board @source_list = source_list @destination_board = destination_board @destination_list = destination_list end def run source_cards.each do |source_card| creator = CreateTrelloCard.new(board_name: destination_board, list_name: destination_list, card_name: source_card.name) creator.card end end def source_cards l = TrelloLookup.list(source_board, source_list) l.cards end end; end
Fix a bug in the CopyCards class
Fix a bug in the CopyCards class
Ruby
mit
MrPowers/slack_trello,MrPowers/slack_trello
ruby
## Code Before: module SlackTrello; class CopyCards attr_reader :source_board, :source_list, :destination_board, :destination_list def initialize(source_board, source_list, destination_board, destination_list) @source_board = source_board @source_list = source_list @destination_board = destination_board @destination_list = destination_list end def run source_cards.each do |source_card| creator = CreateTrelloCard.new(destination_board, destination_list, source_card.name) creator.card end end def source_cards l = TrelloLookup.list(source_board, source_list) l.cards end end; end ## Instruction: Fix a bug in the CopyCards class ## Code After: module SlackTrello; class CopyCards attr_reader :source_board, :source_list, :destination_board, :destination_list def initialize(source_board, source_list, destination_board, destination_list) @source_board = source_board @source_list = source_list @destination_board = destination_board @destination_list = destination_list end def run source_cards.each do |source_card| creator = CreateTrelloCard.new(board_name: destination_board, list_name: destination_list, card_name: source_card.name) creator.card end end def source_cards l = TrelloLookup.list(source_board, source_list) l.cards end end; end
a6e333d5038a571d1ca001c1d1a1f6c0fcfaafff
README.md
README.md
userscripts that work with websites from the kiss family. ### Available Scripts - kiss-statistics - a script that adds a statistics button to the bookmark sites - kiss-simple-infobox-hider - hides the infobox on Kiss player sites.
userscripts that work with websites from the kiss family. ### Install guide - Chrome: Install [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=de) - Firefox: Install [Scriptish](https://addons.mozilla.org/de/firefox/addon/scriptish/) or [Greasemonkey](https://addons.mozilla.org/de/firefox/addon/greasemonkey/) - Both: Check out the folders. Click there on the *.js file and then on the 'Raw' button. Tampermonkey / Scriptish / Greasemonkey should prompt you to install the script. ### Available Scripts - kiss-statistics - a script that adds a statistics button to the bookmark sites - kiss-simple-infobox-hider - hides the infobox on Kiss player sites. ### License All scripts are licensed under the [MIT License](./LICENSE)
Add Install guide and License sections
Add Install guide and License sections
Markdown
mit
Playacem/KissScripts
markdown
## Code Before: userscripts that work with websites from the kiss family. ### Available Scripts - kiss-statistics - a script that adds a statistics button to the bookmark sites - kiss-simple-infobox-hider - hides the infobox on Kiss player sites. ## Instruction: Add Install guide and License sections ## Code After: userscripts that work with websites from the kiss family. ### Install guide - Chrome: Install [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=de) - Firefox: Install [Scriptish](https://addons.mozilla.org/de/firefox/addon/scriptish/) or [Greasemonkey](https://addons.mozilla.org/de/firefox/addon/greasemonkey/) - Both: Check out the folders. Click there on the *.js file and then on the 'Raw' button. Tampermonkey / Scriptish / Greasemonkey should prompt you to install the script. ### Available Scripts - kiss-statistics - a script that adds a statistics button to the bookmark sites - kiss-simple-infobox-hider - hides the infobox on Kiss player sites. ### License All scripts are licensed under the [MIT License](./LICENSE)
f23ff7fc541991ceb63b73ddbf67dc3d04a2cb38
packages/components/components/modalTwo/useModalState.ts
packages/components/components/modalTwo/useModalState.ts
import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const handleClose = () => { setOpen(false); onClose?.(); }; const handleExit = () => { setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, setOpen] as const; }; export default useModalState;
import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const [render, setRender] = useState(open); const handleSetOpen = (newValue: boolean) => { if (newValue) { setOpen(true); setRender(true); } else { setOpen(false); } }; const handleClose = () => { handleSetOpen(false); onClose?.(); }; const handleExit = () => { setRender(false); setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, handleSetOpen, render] as const; }; export default useModalState;
Add mechanism to conditionally render modal
Add mechanism to conditionally render modal
TypeScript
mit
ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient
typescript
## Code Before: import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const handleClose = () => { setOpen(false); onClose?.(); }; const handleExit = () => { setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, setOpen] as const; }; export default useModalState; ## Instruction: Add mechanism to conditionally render modal ## Code After: import { useState } from 'react'; import { generateUID } from '../../helpers'; import { useControlled } from '../../hooks'; const useModalState = (options?: { open?: boolean; onClose?: () => void; onExit?: () => void }) => { const { open: controlledOpen, onClose, onExit } = options || {}; const [key, setKey] = useState(() => generateUID()); const [open, setOpen] = useControlled(controlledOpen); const [render, setRender] = useState(open); const handleSetOpen = (newValue: boolean) => { if (newValue) { setOpen(true); setRender(true); } else { setOpen(false); } }; const handleClose = () => { handleSetOpen(false); onClose?.(); }; const handleExit = () => { setRender(false); setKey(generateUID()); onExit?.(); }; const modalProps = { key, open, onClose: handleClose, onExit: handleExit, }; return [modalProps, handleSetOpen, render] as const; }; export default useModalState;
fe5e4e70cdfb31602c7930c0c46f4d15db9429a7
docker-for-ibm-cloud.md
docker-for-ibm-cloud.md
--- title: Docker for IBM Cloud description: Docker for IBM Cloud has been deprecated. Check Docker Certified Infrastructure redirect_from: - /docker-for-ibm-cloud/administering-swarms/ - /docker-for-ibm-cloud/binding-services/ - /docker-for-ibm-cloud/cli-ref/ - /docker-for-ibm-cloud/deploy/ - /docker-for-ibm-cloud/dtr-ibm-cos/ - /docker-for-ibm-cloud/faqs/ - /docker-for-ibm-cloud/ibm-registry/ - /docker-for-ibm-cloud/index/ - /docker-for-ibm-cloud/load-balancer/ - /docker-for-ibm-cloud/logging/ - /docker-for-ibm-cloud/opensource/ - /docker-for-ibm-cloud/persistent-data-volumes/ - /docker-for-ibm-cloud/quickstart/ - /docker-for-ibm-cloud/registry/ - /docker-for-ibm-cloud/release-notes/ - /docker-for-ibm-cloud/scaling/ - /docker-for-ibm-cloud/why/ --- Docker for IBM Cloud has been replaced by [Docker Certified Infrastructure](/ee/supported-platforms.md).
--- title: Docker for IBM Cloud description: Docker for IBM Cloud has been deprecated. Check Docker Certified Infrastructure redirect_from: - /docker-for-ibm-cloud/administering-swarms/ - /docker-for-ibm-cloud/binding-services/ - /docker-for-ibm-cloud/cli-ref/ - /docker-for-ibm-cloud/deploy/ - /docker-for-ibm-cloud/dtr-ibm-cos/ - /docker-for-ibm-cloud/faqs/ - /docker-for-ibm-cloud/ibm-registry/ - /docker-for-ibm-cloud/index/ - /docker-for-ibm-cloud/load-balancer/ - /docker-for-ibm-cloud/logging/ - /docker-for-ibm-cloud/opensource/ - /docker-for-ibm-cloud/persistent-data-volumes/ - /docker-for-ibm-cloud/quickstart/ - /docker-for-ibm-cloud/registry/ - /docker-for-ibm-cloud/release-notes/ - /docker-for-ibm-cloud/scaling/ - /docker-for-ibm-cloud/why/ - /v17.12/docker-for-ibm-cloud/quickstart/ --- Docker for IBM Cloud has been replaced by [Docker Certified Infrastructure](/ee/supported-platforms.md).
Add redirect from v17.12 version of page since the product has been EOL'ed last year
Add redirect from v17.12 version of page since the product has been EOL'ed last year
Markdown
apache-2.0
docker/docker.github.io,thaJeztah/docker.github.io,thaJeztah/docker.github.io,docker/docker.github.io,londoncalling/docker.github.io,londoncalling/docker.github.io,londoncalling/docker.github.io,thaJeztah/docker.github.io,thaJeztah/docker.github.io,londoncalling/docker.github.io,docker/docker.github.io,docker/docker.github.io,londoncalling/docker.github.io,thaJeztah/docker.github.io,docker/docker.github.io
markdown
## Code Before: --- title: Docker for IBM Cloud description: Docker for IBM Cloud has been deprecated. Check Docker Certified Infrastructure redirect_from: - /docker-for-ibm-cloud/administering-swarms/ - /docker-for-ibm-cloud/binding-services/ - /docker-for-ibm-cloud/cli-ref/ - /docker-for-ibm-cloud/deploy/ - /docker-for-ibm-cloud/dtr-ibm-cos/ - /docker-for-ibm-cloud/faqs/ - /docker-for-ibm-cloud/ibm-registry/ - /docker-for-ibm-cloud/index/ - /docker-for-ibm-cloud/load-balancer/ - /docker-for-ibm-cloud/logging/ - /docker-for-ibm-cloud/opensource/ - /docker-for-ibm-cloud/persistent-data-volumes/ - /docker-for-ibm-cloud/quickstart/ - /docker-for-ibm-cloud/registry/ - /docker-for-ibm-cloud/release-notes/ - /docker-for-ibm-cloud/scaling/ - /docker-for-ibm-cloud/why/ --- Docker for IBM Cloud has been replaced by [Docker Certified Infrastructure](/ee/supported-platforms.md). ## Instruction: Add redirect from v17.12 version of page since the product has been EOL'ed last year ## Code After: --- title: Docker for IBM Cloud description: Docker for IBM Cloud has been deprecated. Check Docker Certified Infrastructure redirect_from: - /docker-for-ibm-cloud/administering-swarms/ - /docker-for-ibm-cloud/binding-services/ - /docker-for-ibm-cloud/cli-ref/ - /docker-for-ibm-cloud/deploy/ - /docker-for-ibm-cloud/dtr-ibm-cos/ - /docker-for-ibm-cloud/faqs/ - /docker-for-ibm-cloud/ibm-registry/ - /docker-for-ibm-cloud/index/ - /docker-for-ibm-cloud/load-balancer/ - /docker-for-ibm-cloud/logging/ - /docker-for-ibm-cloud/opensource/ - /docker-for-ibm-cloud/persistent-data-volumes/ - /docker-for-ibm-cloud/quickstart/ - /docker-for-ibm-cloud/registry/ - /docker-for-ibm-cloud/release-notes/ - /docker-for-ibm-cloud/scaling/ - /docker-for-ibm-cloud/why/ - /v17.12/docker-for-ibm-cloud/quickstart/ --- Docker for IBM Cloud has been replaced by [Docker Certified Infrastructure](/ee/supported-platforms.md).
4c4a932b0147cba3e4de2fa677d1256c1603d249
device-manager-socket-client.coffee
device-manager-socket-client.coffee
uuid = require 'node-uuid' WebSocket = require 'ws' class DeviceManagerSocketClient constructor: (@options={}) -> @messageCallbacks = {} connect: (callback=->) => @connection = new WebSocket "ws://#{@options.host}:#{@options.port}" if @connection.on? @connection.on 'open', callback @connection.on 'error', console.error @connection.on 'message', @onMessage else @connection.onopen = callback @connection.onerror = => console.error 'connection error', arguments @connection.onmessage = @onMessage addDevice: (data, callback=->) => @sendMessage 'addDevice', data, callback removeDevice: => @sendMessage 'removeDevice', data, callback startDevice: => @sendMessage 'startDevice', data, callback stopDevice: => @sendMessage 'stopDevice', data, callback onMessage: (message) => message = JSON.parse message @messageCallbacks[message.id]?(message.error, message.data) delete @messageCallbacks[message.id] sendMessage: (action, data, callback=->) => message = {action: action, id: uuid.v4(), data: data} @connection.send JSON.stringify message @messageCallbacks[message.id] = callback module.exports = DeviceManagerSocketClient
uuid = require 'node-uuid' WebSocket = require 'ws' class DeviceManagerSocketClient constructor: (@options={}) -> @messageCallbacks = {} connect: (callback=->) => @connection = new WebSocket "ws://#{@options.host}:#{@options.port}" if @connection.on? @connection.on 'open', callback @connection.on 'error', console.error @connection.on 'message', @onMessage else @connection.onopen = callback @connection.onerror = => console.error 'connection error', arguments @connection.onmessage = @onMessage addDevice: (data, callback=->) => @sendMessage 'addDevice', data, callback removeDevice: (data, callback=->) => @sendMessage 'removeDevice', data, callback startDevice: (data, callback=->) => @sendMessage 'startDevice', data, callback stopDevice: (data, callback=->) => @sendMessage 'stopDevice', data, callback onMessage: (wholeMessage) => message = JSON.parse wholeMessage.data @messageCallbacks[message.id]?(message.error, message.data) delete @messageCallbacks[message.id] sendMessage: (action, data, callback=->) => message = {action: action, id: uuid.v4(), data: data} @connection.send JSON.stringify message @messageCallbacks[message.id] = callback module.exports = DeviceManagerSocketClient
Add params to other methods
Add params to other methods
CoffeeScript
mit
octoblu/gateblu-websocket
coffeescript
## Code Before: uuid = require 'node-uuid' WebSocket = require 'ws' class DeviceManagerSocketClient constructor: (@options={}) -> @messageCallbacks = {} connect: (callback=->) => @connection = new WebSocket "ws://#{@options.host}:#{@options.port}" if @connection.on? @connection.on 'open', callback @connection.on 'error', console.error @connection.on 'message', @onMessage else @connection.onopen = callback @connection.onerror = => console.error 'connection error', arguments @connection.onmessage = @onMessage addDevice: (data, callback=->) => @sendMessage 'addDevice', data, callback removeDevice: => @sendMessage 'removeDevice', data, callback startDevice: => @sendMessage 'startDevice', data, callback stopDevice: => @sendMessage 'stopDevice', data, callback onMessage: (message) => message = JSON.parse message @messageCallbacks[message.id]?(message.error, message.data) delete @messageCallbacks[message.id] sendMessage: (action, data, callback=->) => message = {action: action, id: uuid.v4(), data: data} @connection.send JSON.stringify message @messageCallbacks[message.id] = callback module.exports = DeviceManagerSocketClient ## Instruction: Add params to other methods ## Code After: uuid = require 'node-uuid' WebSocket = require 'ws' class DeviceManagerSocketClient constructor: (@options={}) -> @messageCallbacks = {} connect: (callback=->) => @connection = new WebSocket "ws://#{@options.host}:#{@options.port}" if @connection.on? @connection.on 'open', callback @connection.on 'error', console.error @connection.on 'message', @onMessage else @connection.onopen = callback @connection.onerror = => console.error 'connection error', arguments @connection.onmessage = @onMessage addDevice: (data, callback=->) => @sendMessage 'addDevice', data, callback removeDevice: (data, callback=->) => @sendMessage 'removeDevice', data, callback startDevice: (data, callback=->) => @sendMessage 'startDevice', data, callback stopDevice: (data, callback=->) => @sendMessage 'stopDevice', data, callback onMessage: (wholeMessage) => message = JSON.parse wholeMessage.data @messageCallbacks[message.id]?(message.error, message.data) delete @messageCallbacks[message.id] sendMessage: (action, data, callback=->) => message = {action: action, id: uuid.v4(), data: data} @connection.send JSON.stringify message @messageCallbacks[message.id] = callback module.exports = DeviceManagerSocketClient
616cbaf25086ddf063a0dfdc21ed427663295cad
app/components/services/userService.js
app/components/services/userService.js
(function () { 'use strict'; angular .module('scrum_retroboard') .service('userService', ['$http', 'sessionService', userService]); function userService($http, sessionService) { var userApiUrl = ""; var username = ""; function addUserToSession(username, sessionId) { var user = { session_id: sessionId, username: username }; return $http .post(userApiUrl, user) .success(successCallback) .error(errorCallback); function successCallback(response) { return response.data; } function errorCallback(response) { console.log(response.data); } } function setUsername(_username) { username = _username; } function getUsername() { return username; } } })();
(function () { 'use strict'; angular .module('scrum_retroboard') .service('userService', ['$http', 'sessionService', userService]); function userService($http, sessionService) { var userApiUrl = ""; var username = ""; this.addUserToSession = addUserToSession; this.setUsername = setUsername; this.getUsername = getUsername; function addUserToSession(username, sessionId) { var user = { session_id: sessionId, username: username }; return $http .post(userApiUrl, user) .success(successCallback) .error(errorCallback); function successCallback(response) { return response.data; } function errorCallback(response) { console.log(response.data); } } function setUsername(_username) { username = _username; } function getUsername() { return username; } } })();
Fix Ljubomir screwing up services
Fix Ljubomir screwing up services
JavaScript
mit
Endava-Interns/ScrumRetroBoardFrontEnd,Endava-Interns/ScrumRetroBoardFrontEnd
javascript
## Code Before: (function () { 'use strict'; angular .module('scrum_retroboard') .service('userService', ['$http', 'sessionService', userService]); function userService($http, sessionService) { var userApiUrl = ""; var username = ""; function addUserToSession(username, sessionId) { var user = { session_id: sessionId, username: username }; return $http .post(userApiUrl, user) .success(successCallback) .error(errorCallback); function successCallback(response) { return response.data; } function errorCallback(response) { console.log(response.data); } } function setUsername(_username) { username = _username; } function getUsername() { return username; } } })(); ## Instruction: Fix Ljubomir screwing up services ## Code After: (function () { 'use strict'; angular .module('scrum_retroboard') .service('userService', ['$http', 'sessionService', userService]); function userService($http, sessionService) { var userApiUrl = ""; var username = ""; this.addUserToSession = addUserToSession; this.setUsername = setUsername; this.getUsername = getUsername; function addUserToSession(username, sessionId) { var user = { session_id: sessionId, username: username }; return $http .post(userApiUrl, user) .success(successCallback) .error(errorCallback); function successCallback(response) { return response.data; } function errorCallback(response) { console.log(response.data); } } function setUsername(_username) { username = _username; } function getUsername() { return username; } } })();
42ffe540e2948b3f7e2f2f52aa9cc34847223c7f
test/regression/forNameTest.java
test/regression/forNameTest.java
class forNameTest { public static void main(String argv[]) { try { Class.forName("loadThis"); Class c = Class.forName("loadThis", false, new ClassLoader() { public Class loadClass(String n, boolean resolve) throws ClassNotFoundException { Class cl = findSystemClass(n); if (resolve) { resolveClass(cl); } return cl; } }); System.out.println("constructor not called"); c.newInstance(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } } class loadThis { static { try { new loadThis(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } public loadThis() { System.out.println("constructor called"); } } /* Expected Output: constructor called constructor not called constructor called */
class forNameTest { public static void main(String argv[]) { try { Class.forName("loadThis"); Class c = Class.forName("loadThis", false, new ClassLoader() { public Class loadClass(String n) throws ClassNotFoundException { return findSystemClass(n); } }); System.out.println("constructor not called"); c.newInstance(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } } class loadThis { static { try { new loadThis(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } public loadThis() { System.out.println("constructor called"); } } /* Expected Output: constructor called constructor not called constructor called */
Revert to previous version.. it should still work.
Revert to previous version.. it should still work.
Java
lgpl-2.1
kaffe/kaffe,kaffe/kaffe,kaffe/kaffe,kaffe/kaffe,kaffe/kaffe
java
## Code Before: class forNameTest { public static void main(String argv[]) { try { Class.forName("loadThis"); Class c = Class.forName("loadThis", false, new ClassLoader() { public Class loadClass(String n, boolean resolve) throws ClassNotFoundException { Class cl = findSystemClass(n); if (resolve) { resolveClass(cl); } return cl; } }); System.out.println("constructor not called"); c.newInstance(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } } class loadThis { static { try { new loadThis(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } public loadThis() { System.out.println("constructor called"); } } /* Expected Output: constructor called constructor not called constructor called */ ## Instruction: Revert to previous version.. it should still work. ## Code After: class forNameTest { public static void main(String argv[]) { try { Class.forName("loadThis"); Class c = Class.forName("loadThis", false, new ClassLoader() { public Class loadClass(String n) throws ClassNotFoundException { return findSystemClass(n); } }); System.out.println("constructor not called"); c.newInstance(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } } class loadThis { static { try { new loadThis(); } catch( Exception e ) { System.out.println(e.getMessage()); e.printStackTrace(); } } public loadThis() { System.out.println("constructor called"); } } /* Expected Output: constructor called constructor not called constructor called */
4e2118b89ef6d5532da121af1b75e120f6abd57d
examples/experimental/single_test_suite/svunit_main.sv
examples/experimental/single_test_suite/svunit_main.sv
module svunit_main; initial svunit::run_all_tests(); endmodule
module svunit_main; import factorial_test::*; initial svunit::run_all_tests(); endmodule
Make sure test code is elaborated
Make sure test code is elaborated It's kind of annoying to have to force the user to write the extra import statement. Let's see if we can do better.
SystemVerilog
apache-2.0
svunit/svunit,svunit/svunit,svunit/svunit
systemverilog
## Code Before: module svunit_main; initial svunit::run_all_tests(); endmodule ## Instruction: Make sure test code is elaborated It's kind of annoying to have to force the user to write the extra import statement. Let's see if we can do better. ## Code After: module svunit_main; import factorial_test::*; initial svunit::run_all_tests(); endmodule
54ac1bf24fd22d7b3a208f3eabdeba5903857d20
bin/sync_all.dart
bin/sync_all.dart
import 'dart:async'; import 'dart_doc_syncer.dart' as syncer; final examplesToSync = <List<String>>[ <String>[ 'public/docs/_examples/template-syntax/dart', 'https://github.com/angular-examples/template-syntax' ] ]; /// Syncs all angular.io example applications. Future main(List<String> args) async { for (List<String> example in examplesToSync) { await syncer.main(example..addAll(args)); } }
import 'dart:async'; import 'dart_doc_syncer.dart' as syncer; final examplesToSync = <List<String>>[ <String>[ 'public/docs/_examples/template-syntax/dart', '[email protected]:angular-examples/template-syntax.git' ] ]; /// Syncs all angular.io example applications. Future main(List<String> args) async { for (List<String> example in examplesToSync) { await syncer.main(example..addAll(args)); } }
Use ssh for github repositories.
Use ssh for github repositories.
Dart
mit
dart-archive/dart-doc-syncer
dart
## Code Before: import 'dart:async'; import 'dart_doc_syncer.dart' as syncer; final examplesToSync = <List<String>>[ <String>[ 'public/docs/_examples/template-syntax/dart', 'https://github.com/angular-examples/template-syntax' ] ]; /// Syncs all angular.io example applications. Future main(List<String> args) async { for (List<String> example in examplesToSync) { await syncer.main(example..addAll(args)); } } ## Instruction: Use ssh for github repositories. ## Code After: import 'dart:async'; import 'dart_doc_syncer.dart' as syncer; final examplesToSync = <List<String>>[ <String>[ 'public/docs/_examples/template-syntax/dart', '[email protected]:angular-examples/template-syntax.git' ] ]; /// Syncs all angular.io example applications. Future main(List<String> args) async { for (List<String> example in examplesToSync) { await syncer.main(example..addAll(args)); } }
ba7e770faaa459ac276edadcdcfa59ae9a297ae9
deployment/docker-prod/REQUIREMENTS.txt
deployment/docker-prod/REQUIREMENTS.txt
Django>=1.7,<1.8 psycopg2 pytz django-braces django-model-utils django-pipeline>1.4 nodeenv raven django-forms-bootstrap # Django rest framework support djangorestframework==2.4.4 markdown django-filter Pillow django-sms-gateway
Django>=1.7,<1.8 psycopg2 pytz django-braces django-model-utils django-pipeline>1.4 nodeenv raven django-forms-bootstrap # Django rest framework support djangorestframework==2.4.4 markdown django-filter Pillow # django-sms-gateway # Use this again once we can work with custom users
Update requirements due to custom sms module
Update requirements due to custom sms module
Text
bsd-2-clause
cchristelis/watchkeeper,kartoza/watchkeeper,timlinux/watchkeeper,timlinux/watchkeeper,ismailsunni/watchkeeper,MariaSolovyeva/watchkeeper,timlinux/watchkeeper,cchristelis/watchkeeper,MariaSolovyeva/watchkeeper,cchristelis/watchkeeper,kartoza/watchkeeper,kartoza/watchkeeper,cchristelis/watchkeeper,ismailsunni/watchkeeper,kartoza/watchkeeper,ismailsunni/watchkeeper,timlinux/watchkeeper,MariaSolovyeva/watchkeeper,MariaSolovyeva/watchkeeper,ismailsunni/watchkeeper
text
## Code Before: Django>=1.7,<1.8 psycopg2 pytz django-braces django-model-utils django-pipeline>1.4 nodeenv raven django-forms-bootstrap # Django rest framework support djangorestframework==2.4.4 markdown django-filter Pillow django-sms-gateway ## Instruction: Update requirements due to custom sms module ## Code After: Django>=1.7,<1.8 psycopg2 pytz django-braces django-model-utils django-pipeline>1.4 nodeenv raven django-forms-bootstrap # Django rest framework support djangorestframework==2.4.4 markdown django-filter Pillow # django-sms-gateway # Use this again once we can work with custom users
e9a71f62a6d88a13d8be3435e970814b6087bd3e
app/components/layer-info/component.js
app/components/layer-info/component.js
import Ember from 'ember'; import loadAll from 'ember-osf/utils/load-relationship'; export default Ember.Component.extend({ users: Ember.A(), bibliographicUsers: Ember.A(), institutions: Ember.A(), getAuthors: function() { // Cannot be called until node has loaded! const node = this.get('node'); if (!node) { return }; if(this.get('users').length > 0 || this.get('bibliographicUsers').length > 0) { return; } const contributors = Ember.A(); loadAll(node, 'contributors', contributors).then(() => { contributors.forEach((item) => { this.get('users').pushObject(item.get('users')); if(item.get('bibliographic')){ this.get('bibliographicUsers').pushObject(item.get('users')); } }) }); }, getAffiliatedInst: function (){ const node = this.get('node'); if (!node) { return }; const institutions = Ember.A(); loadAll(node, 'affiliatedInstitutions', institutions).then(() => { institutions.forEach((item) => { this.get('institutions').pushObject(item); }) }); }, didReceiveAttrs() { this._super(...arguments); this.getAuthors(); this.getAffiliatedInst(); } });
import Ember from 'ember'; import loadAll from 'ember-osf/utils/load-relationship'; export default Ember.Component.extend({ users: Ember.A(), bibliographicUsers: Ember.A(), institutions: Ember.A(), getAuthors: function() { // Cannot be called until node has loaded! const node = this.get('node'); if (!node) { return }; if(this.get('users').length > 0 || this.get('bibliographicUsers').length > 0) { return; } const contributors = Ember.A(); loadAll(node, 'contributors', contributors).then(() => { contributors.forEach((item) => { this.get('users').pushObject(item.get('users')); if(item.get('bibliographic')){ this.get('bibliographicUsers').pushObject(item.get('users')); } }) }); }, getAffiliatedInst: function (){ const node = this.get('node'); if (!node) { return }; if(this.get('institutions').length > 0) { return; } const institutions = Ember.A(); loadAll(node, 'affiliatedInstitutions', institutions).then(() => { institutions.forEach((item) => { this.get('institutions').pushObject(item); }) }); }, didReceiveAttrs() { this._super(...arguments); this.getAuthors(); this.getAffiliatedInst(); } });
Fix affiliated institutions multiplying at every render
Fix affiliated institutions multiplying at every render
JavaScript
apache-2.0
Rytiggy/osfpages,caneruguz/osfpages,caneruguz/osfpages,Rytiggy/osfpages
javascript
## Code Before: import Ember from 'ember'; import loadAll from 'ember-osf/utils/load-relationship'; export default Ember.Component.extend({ users: Ember.A(), bibliographicUsers: Ember.A(), institutions: Ember.A(), getAuthors: function() { // Cannot be called until node has loaded! const node = this.get('node'); if (!node) { return }; if(this.get('users').length > 0 || this.get('bibliographicUsers').length > 0) { return; } const contributors = Ember.A(); loadAll(node, 'contributors', contributors).then(() => { contributors.forEach((item) => { this.get('users').pushObject(item.get('users')); if(item.get('bibliographic')){ this.get('bibliographicUsers').pushObject(item.get('users')); } }) }); }, getAffiliatedInst: function (){ const node = this.get('node'); if (!node) { return }; const institutions = Ember.A(); loadAll(node, 'affiliatedInstitutions', institutions).then(() => { institutions.forEach((item) => { this.get('institutions').pushObject(item); }) }); }, didReceiveAttrs() { this._super(...arguments); this.getAuthors(); this.getAffiliatedInst(); } }); ## Instruction: Fix affiliated institutions multiplying at every render ## Code After: import Ember from 'ember'; import loadAll from 'ember-osf/utils/load-relationship'; export default Ember.Component.extend({ users: Ember.A(), bibliographicUsers: Ember.A(), institutions: Ember.A(), getAuthors: function() { // Cannot be called until node has loaded! const node = this.get('node'); if (!node) { return }; if(this.get('users').length > 0 || this.get('bibliographicUsers').length > 0) { return; } const contributors = Ember.A(); loadAll(node, 'contributors', contributors).then(() => { contributors.forEach((item) => { this.get('users').pushObject(item.get('users')); if(item.get('bibliographic')){ this.get('bibliographicUsers').pushObject(item.get('users')); } }) }); }, getAffiliatedInst: function (){ const node = this.get('node'); if (!node) { return }; if(this.get('institutions').length > 0) { return; } const institutions = Ember.A(); loadAll(node, 'affiliatedInstitutions', institutions).then(() => { institutions.forEach((item) => { this.get('institutions').pushObject(item); }) }); }, didReceiveAttrs() { this._super(...arguments); this.getAuthors(); this.getAffiliatedInst(); } });
5170227ba25737096e33e87e1b82acbc1844a641
diversity.md
diversity.md
--- layout: post title: Diversity permalink: /diversity/ isStaticPost: true --- ##### DevFest Berlin supports diversity in technology We recognize the current status of our industry and we want to change it. Our goal is to enable everybody to learn and teach programming. As such, we want to enable underrepresented groups in technology to feel welcomed and help increase the diversity in technology and science. To this end, we have have a couple of ways to support our mission: - we will have a number of tickets for which only underrepresented groups can apply - we will have a mentorship program for new developers The mentorship program will pair an awardee with a developer mentor to help familiarize the awardee with the conference. We believe creating a dialogue between developers at different levels will yield a great value both to the mentor and the awardee and hope everyone will have a great opportunity to learn from it. <img class="img-responsive feature-image" src="{{ site.baseurl }}/img/posts/cod.jpg" style="display:none">
--- layout: post title: Diversity permalink: /diversity/ isStaticPost: true --- ##### DevFest Berlin supports diversity in technology We recognize the current status of our industry and we want to change it. Our goal is to enable everybody to learn and teach programming. As such, we want to enable underrepresented groups in technology to feel welcomed and help increase the diversity in technology and science. To this end, we have have a couple of ways to support our mission: - we will have a number of tickets for which only underrepresented groups can apply - we will have a mentorship program for new developers The mentorship program will pair an awardee with a developer mentor to help familiarize the awardee with the conference. We believe creating a dialogue between developers at different levels will yield a great value both to the mentor and the awardee and hope everyone will have a great opportunity to learn from it. <img class="img-responsive feature-image" src="{{ site.baseurl }}/img/posts/cod.jpg" style="display:none"> <div class="text-center"> <p> <a class="btn btn-primary waves-effect waves-button waves-light waves-float" href="https://docs.google.com/forms/d/e/1FAIpQLSfAPUf1lxG8b6fb1hc_MqLxGoM2HiTZ0UOXAShg5_PhonQ6mQ/viewform?c=0&w=1"> Apply for the mentorship program! </a> </p> </div>
Apply for mentorship form button
Apply for mentorship form button
Markdown
mit
devfest-berlin/2016.devfest-berlin.de,devfest-berlin/2016.devfest-berlin.de,devfest-berlin/2016.devfest-berlin.de
markdown
## Code Before: --- layout: post title: Diversity permalink: /diversity/ isStaticPost: true --- ##### DevFest Berlin supports diversity in technology We recognize the current status of our industry and we want to change it. Our goal is to enable everybody to learn and teach programming. As such, we want to enable underrepresented groups in technology to feel welcomed and help increase the diversity in technology and science. To this end, we have have a couple of ways to support our mission: - we will have a number of tickets for which only underrepresented groups can apply - we will have a mentorship program for new developers The mentorship program will pair an awardee with a developer mentor to help familiarize the awardee with the conference. We believe creating a dialogue between developers at different levels will yield a great value both to the mentor and the awardee and hope everyone will have a great opportunity to learn from it. <img class="img-responsive feature-image" src="{{ site.baseurl }}/img/posts/cod.jpg" style="display:none"> ## Instruction: Apply for mentorship form button ## Code After: --- layout: post title: Diversity permalink: /diversity/ isStaticPost: true --- ##### DevFest Berlin supports diversity in technology We recognize the current status of our industry and we want to change it. Our goal is to enable everybody to learn and teach programming. As such, we want to enable underrepresented groups in technology to feel welcomed and help increase the diversity in technology and science. To this end, we have have a couple of ways to support our mission: - we will have a number of tickets for which only underrepresented groups can apply - we will have a mentorship program for new developers The mentorship program will pair an awardee with a developer mentor to help familiarize the awardee with the conference. We believe creating a dialogue between developers at different levels will yield a great value both to the mentor and the awardee and hope everyone will have a great opportunity to learn from it. <img class="img-responsive feature-image" src="{{ site.baseurl }}/img/posts/cod.jpg" style="display:none"> <div class="text-center"> <p> <a class="btn btn-primary waves-effect waves-button waves-light waves-float" href="https://docs.google.com/forms/d/e/1FAIpQLSfAPUf1lxG8b6fb1hc_MqLxGoM2HiTZ0UOXAShg5_PhonQ6mQ/viewform?c=0&w=1"> Apply for the mentorship program! </a> </p> </div>
229af6102f49022f1a23837a8d0b37441dbad138
src/test/scala/com/high-performance-spark-examples/native/NativeExample.scala
src/test/scala/com/high-performance-spark-examples/native/NativeExample.scala
/** * Test our simple JNI */ package com.highperformancespark.examples.ffi import com.holdenkarau.spark.testing._ import org.scalacheck.{Arbitrary, Gen} import org.scalacheck.Prop.forAll import org.scalatest.FunSuite import org.scalatest.prop.Checkers import org.scalatest.Matchers._ class NativeExampleSuite extends FunSuite with SharedSparkContext with Checkers { test("local sum") { //def magic2() { val input = Array(1, 2, 3) val sumMagic = new SumJNI() val result = sumMagic.sum(input) val expected = 6 result === expected } // test("super simple test") { def magic() { val input = sc.parallelize(List(("hi", Array(1, 2, 3)))) val result = NativeExample.jniSum(input).collect() val expected = List(("hi", 6)) result === expected } test("native call should find sum correctly") { val property = forAll(RDDGenerator.genRDD[(String, Array[Int])](sc)) { rdd => rdd.mapValues(_.sum).collect() === NativeExample.jniSum(rdd) } //check(property) } }
/** * Test our simple JNI */ package com.highperformancespark.examples.ffi import com.holdenkarau.spark.testing._ import org.scalacheck.{Arbitrary, Gen} import org.scalacheck.Prop.forAll import org.scalatest.FunSuite import org.scalatest.prop.Checkers import org.scalatest.Matchers._ class NativeExampleSuite extends FunSuite with SharedSparkContext with Checkers { test("local sum") { //def magic2() { val input = Array(1, 2, 3) val sumMagic = new SumJNI() val result = sumMagic.sum(input) val expected = 6 result === expected } // test("super simple test") { def magic() { val input = sc.parallelize(List(("hi", Array(1, 2, 3)))) val result = NativeExample.jniSum(input).collect() val expected = List(("hi", 6)) result === expected } test("native call should find sum correctly") { val property = forAll(RDDGenerator.genRDD(sc)(Arbitrary.arbitrary[(String, Array[Int])])) { rdd => rdd.mapValues(_.sum).collect() === NativeExample.jniSum(rdd) } //check(property) } }
Update to new Arbitraryt generator
Update to new Arbitraryt generator
Scala
apache-2.0
mahmoudhanafy/high-performance-spark-examples
scala
## Code Before: /** * Test our simple JNI */ package com.highperformancespark.examples.ffi import com.holdenkarau.spark.testing._ import org.scalacheck.{Arbitrary, Gen} import org.scalacheck.Prop.forAll import org.scalatest.FunSuite import org.scalatest.prop.Checkers import org.scalatest.Matchers._ class NativeExampleSuite extends FunSuite with SharedSparkContext with Checkers { test("local sum") { //def magic2() { val input = Array(1, 2, 3) val sumMagic = new SumJNI() val result = sumMagic.sum(input) val expected = 6 result === expected } // test("super simple test") { def magic() { val input = sc.parallelize(List(("hi", Array(1, 2, 3)))) val result = NativeExample.jniSum(input).collect() val expected = List(("hi", 6)) result === expected } test("native call should find sum correctly") { val property = forAll(RDDGenerator.genRDD[(String, Array[Int])](sc)) { rdd => rdd.mapValues(_.sum).collect() === NativeExample.jniSum(rdd) } //check(property) } } ## Instruction: Update to new Arbitraryt generator ## Code After: /** * Test our simple JNI */ package com.highperformancespark.examples.ffi import com.holdenkarau.spark.testing._ import org.scalacheck.{Arbitrary, Gen} import org.scalacheck.Prop.forAll import org.scalatest.FunSuite import org.scalatest.prop.Checkers import org.scalatest.Matchers._ class NativeExampleSuite extends FunSuite with SharedSparkContext with Checkers { test("local sum") { //def magic2() { val input = Array(1, 2, 3) val sumMagic = new SumJNI() val result = sumMagic.sum(input) val expected = 6 result === expected } // test("super simple test") { def magic() { val input = sc.parallelize(List(("hi", Array(1, 2, 3)))) val result = NativeExample.jniSum(input).collect() val expected = List(("hi", 6)) result === expected } test("native call should find sum correctly") { val property = forAll(RDDGenerator.genRDD(sc)(Arbitrary.arbitrary[(String, Array[Int])])) { rdd => rdd.mapValues(_.sum).collect() === NativeExample.jniSum(rdd) } //check(property) } }
cb45cb0417a1938201772064945a375f6954502d
app/jobs/autobot_campaign.rb
app/jobs/autobot_campaign.rb
module Jobs class AutobotCampaign < Jobs::Base attr_accessor :campaign sidekiq_options retry: false def last_polled_at campaign["last_polled_at"] end def perform(*args) opts = args.extract_options!.with_indifferent_access @id = opts[:campaign_id] @campaign = Autobot::Campaign.find(@id) super @campaign["last_polled_at"] = Time.now Autobot::Campaign.update(@campaign) end end end
module Jobs class AutobotCampaign < Jobs::Base attr_accessor :campaign def last_polled_at campaign["last_polled_at"] end def perform(*args) opts = args.extract_options!.with_indifferent_access @id = opts[:campaign_id] @campaign = Autobot::Campaign.find(@id) super @campaign["last_polled_at"] = Time.now Autobot::Campaign.update(@campaign) end end end
Allow sidekiq retry for Campaign polling jobs
Allow sidekiq retry for Campaign polling jobs
Ruby
mit
vinkashq/discourse-autobot,vinkashq/discourse-autobot,vinkashq/discourse-autobot
ruby
## Code Before: module Jobs class AutobotCampaign < Jobs::Base attr_accessor :campaign sidekiq_options retry: false def last_polled_at campaign["last_polled_at"] end def perform(*args) opts = args.extract_options!.with_indifferent_access @id = opts[:campaign_id] @campaign = Autobot::Campaign.find(@id) super @campaign["last_polled_at"] = Time.now Autobot::Campaign.update(@campaign) end end end ## Instruction: Allow sidekiq retry for Campaign polling jobs ## Code After: module Jobs class AutobotCampaign < Jobs::Base attr_accessor :campaign def last_polled_at campaign["last_polled_at"] end def perform(*args) opts = args.extract_options!.with_indifferent_access @id = opts[:campaign_id] @campaign = Autobot::Campaign.find(@id) super @campaign["last_polled_at"] = Time.now Autobot::Campaign.update(@campaign) end end end
fd8b0c82349599b7c3c78f2774bdb08963092115
src/main/scala/intellij/haskell/psi/impl/HaskellStringLiteralManipulator.scala
src/main/scala/intellij/haskell/psi/impl/HaskellStringLiteralManipulator.scala
package intellij.haskell.psi.impl import com.intellij.openapi.util.TextRange import com.intellij.psi.{AbstractElementManipulator, PsiFileFactory} import com.intellij.util.IncorrectOperationException import intellij.haskell.HaskellLanguage import org.jetbrains.annotations.Nullable /** * @author ice1000 */ class HaskellStringLiteralManipulator extends AbstractElementManipulator[HaskellStringLiteralElementImpl] { @Nullable @throws[IncorrectOperationException] override def handleContentChange(psi: HaskellStringLiteralElementImpl, range: TextRange, newContent: String): HaskellStringLiteralElementImpl = { val newElement = PsiFileFactory .getInstance(psi.getProject) .createFileFromText("a.hs", HaskellLanguage.Instance, newContent, false, false) psi.replace(newElement).asInstanceOf[HaskellStringLiteralElementImpl] } override def getRangeInElement(element: HaskellStringLiteralElementImpl): TextRange = { new TextRange(1, element.getTextLength - 1) } }
package intellij.haskell.psi.impl import com.intellij.openapi.util.TextRange import com.intellij.psi.{AbstractElementManipulator, PsiFileFactory} import com.intellij.util.IncorrectOperationException import intellij.haskell.HaskellLanguage import org.jetbrains.annotations.Nullable /** * @author ice1000 */ class HaskellStringLiteralManipulator extends AbstractElementManipulator[HaskellStringLiteralElementImpl] { @Nullable @throws[IncorrectOperationException] override def handleContentChange(psi: HaskellStringLiteralElementImpl, range: TextRange, newContent: String): HaskellStringLiteralElementImpl = { val oldText = psi.getText val newText = oldText.substring(0, range.getStartOffset) + newContent + oldText.substring(range.getEndOffset) val newElement = PsiFileFactory .getInstance(psi.getProject) .createFileFromText("a.hs", HaskellLanguage.Instance, newText, false, false) .getLastChild .getLastChild psi.replace(newElement).asInstanceOf[HaskellStringLiteralElementImpl] } override def getRangeInElement(element: HaskellStringLiteralElementImpl): TextRange = { new TextRange(1, element.getTextLength - 1) } }
Fix a bug mentioned in the previous PR
Fix a bug mentioned in the previous PR
Scala
apache-2.0
rikvdkleij/intellij-haskell,rikvdkleij/intellij-haskell
scala
## Code Before: package intellij.haskell.psi.impl import com.intellij.openapi.util.TextRange import com.intellij.psi.{AbstractElementManipulator, PsiFileFactory} import com.intellij.util.IncorrectOperationException import intellij.haskell.HaskellLanguage import org.jetbrains.annotations.Nullable /** * @author ice1000 */ class HaskellStringLiteralManipulator extends AbstractElementManipulator[HaskellStringLiteralElementImpl] { @Nullable @throws[IncorrectOperationException] override def handleContentChange(psi: HaskellStringLiteralElementImpl, range: TextRange, newContent: String): HaskellStringLiteralElementImpl = { val newElement = PsiFileFactory .getInstance(psi.getProject) .createFileFromText("a.hs", HaskellLanguage.Instance, newContent, false, false) psi.replace(newElement).asInstanceOf[HaskellStringLiteralElementImpl] } override def getRangeInElement(element: HaskellStringLiteralElementImpl): TextRange = { new TextRange(1, element.getTextLength - 1) } } ## Instruction: Fix a bug mentioned in the previous PR ## Code After: package intellij.haskell.psi.impl import com.intellij.openapi.util.TextRange import com.intellij.psi.{AbstractElementManipulator, PsiFileFactory} import com.intellij.util.IncorrectOperationException import intellij.haskell.HaskellLanguage import org.jetbrains.annotations.Nullable /** * @author ice1000 */ class HaskellStringLiteralManipulator extends AbstractElementManipulator[HaskellStringLiteralElementImpl] { @Nullable @throws[IncorrectOperationException] override def handleContentChange(psi: HaskellStringLiteralElementImpl, range: TextRange, newContent: String): HaskellStringLiteralElementImpl = { val oldText = psi.getText val newText = oldText.substring(0, range.getStartOffset) + newContent + oldText.substring(range.getEndOffset) val newElement = PsiFileFactory .getInstance(psi.getProject) .createFileFromText("a.hs", HaskellLanguage.Instance, newText, false, false) .getLastChild .getLastChild psi.replace(newElement).asInstanceOf[HaskellStringLiteralElementImpl] } override def getRangeInElement(element: HaskellStringLiteralElementImpl): TextRange = { new TextRange(1, element.getTextLength - 1) } }
985c2767d6e65eed358d5a4c6f203069cb560bab
requirements.txt
requirements.txt
vstutils[rpc,ldap,doc,coreapi,prod]==1.1.7 pyyaml docutils==0.14 markdown2==2.3.5 # API jsonfield==2.0.2 uWSGI==2.0.17 # Repo types gitpython==2.1.10 # Hooks requests==2.19.1 # Ansible required packages ansible>=2.1, <=2.5.4 paramiko<=2.4.0 pywinrm[kerberos]==0.3.0 github3.py==1.0.0a4
vstutils[rpc,ldap,doc,coreapi,prod]==1.1.7 pyyaml==3.12 --global-option="--with-libyaml" docutils==0.14 markdown2==2.3.5 # API jsonfield==2.0.2 uWSGI==2.0.17 # Repo types gitpython==2.1.10 # Hooks requests==2.19.1 # Ansible required packages ansible>=2.1, <=2.5.4 paramiko<=2.4.0 pywinrm[kerberos]==0.3.0 github3.py==1.0.0a4
Edit dependence PyYAML Record version of PyYAML Add option to install PyYAML only when have libyaml-dev
Edit dependence PyYAML [ci skip] Record version of PyYAML Add option to install PyYAML only when have libyaml-dev
Text
agpl-3.0
vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch
text
## Code Before: vstutils[rpc,ldap,doc,coreapi,prod]==1.1.7 pyyaml docutils==0.14 markdown2==2.3.5 # API jsonfield==2.0.2 uWSGI==2.0.17 # Repo types gitpython==2.1.10 # Hooks requests==2.19.1 # Ansible required packages ansible>=2.1, <=2.5.4 paramiko<=2.4.0 pywinrm[kerberos]==0.3.0 github3.py==1.0.0a4 ## Instruction: Edit dependence PyYAML [ci skip] Record version of PyYAML Add option to install PyYAML only when have libyaml-dev ## Code After: vstutils[rpc,ldap,doc,coreapi,prod]==1.1.7 pyyaml==3.12 --global-option="--with-libyaml" docutils==0.14 markdown2==2.3.5 # API jsonfield==2.0.2 uWSGI==2.0.17 # Repo types gitpython==2.1.10 # Hooks requests==2.19.1 # Ansible required packages ansible>=2.1, <=2.5.4 paramiko<=2.4.0 pywinrm[kerberos]==0.3.0 github3.py==1.0.0a4
19c763268bd25eabd42be07324444c89be0b59bd
before_script.sh
before_script.sh
sudo apt-get install -y libevent-dev if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "\$(php --re libevent | grep 'does not exist')" != "" ]; then wget http://pecl.php.net/get/libevent-0.0.5.tgz; tar -xzf libevent-0.0.5.tgz; cd libevent-0.0.5 && phpize && ./configure && make && sudo make install; echo "extension=libevent.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi composer self-update composer install --dev --prefer-source
sudo apt-get install -y libevent-dev if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "\$(php --re libevent | grep 'does not exist')" != "" ]; then wget http://pecl.php.net/get/libevent-0.0.5.tgz; tar -xzf libevent-0.0.5.tgz; cd libevent-0.0.5 && phpize && ./configure && make && sudo make install && cd ../; echo "extension=libevent.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi composer self-update composer install --dev --prefer-source
Return to the correct directory after compiling ext
Return to the correct directory after compiling ext
Shell
mit
krageon/react,ympons/react,cesarmarinhorj/react,cesarmarinhorj/react,sachintaware/react,dagopoot/react,naroga/react,ympons/react,ericariyanto/react,reactphp/react,cystbear/react,nemurici/react,nemurici/react,sachintaware/react,naroga/react,krageon/react,dagopoot/react,cystbear/react,ericariyanto/react
shell
## Code Before: sudo apt-get install -y libevent-dev if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "\$(php --re libevent | grep 'does not exist')" != "" ]; then wget http://pecl.php.net/get/libevent-0.0.5.tgz; tar -xzf libevent-0.0.5.tgz; cd libevent-0.0.5 && phpize && ./configure && make && sudo make install; echo "extension=libevent.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi composer self-update composer install --dev --prefer-source ## Instruction: Return to the correct directory after compiling ext ## Code After: sudo apt-get install -y libevent-dev if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "\$(php --re libevent | grep 'does not exist')" != "" ]; then wget http://pecl.php.net/get/libevent-0.0.5.tgz; tar -xzf libevent-0.0.5.tgz; cd libevent-0.0.5 && phpize && ./configure && make && sudo make install && cd ../; echo "extension=libevent.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi composer self-update composer install --dev --prefer-source
d1f58987df6cdd22ffb788bcc7e44a7801e48815
tests/README.md
tests/README.md
Tests ===== Because it is not a Test-driven Development project, we intentionally don't do any unit tests. In contrast, we use integration tests to avoir regression. Consequently, Travis-CI has been configured in order to do all these integration tests. Coverage is then updated in [sonarqube.com](https://sonarqube.com/component_measures/metric/coverage/list?id=armadito%3Aglpi%3ADEV%3ADEV)
Tests ===== > It’s overwhelmingly easy to write bad unit tests that add very little value to a project while inflating the cost of code changes astronomically. Steve Sanderson. Thus, and because it is not a Test-driven Development project, we intentionally don't do any unit tests. In contrast, we use integration tests to avoir regression. Consequently, Travis-CI has been configured in order to do all these integration tests. Coverage is then updated in [sonarqube.com](https://sonarqube.com/component_measures/metric/coverage/list?id=armadito%3Aglpi%3ADEV%3ADEV)
Add more explanation on why we don't do any unit tests
Add more explanation on why we don't do any unit tests
Markdown
agpl-3.0
armadito/armadito-glpi,armadito/armadito-glpi,armadito/armadito-glpi
markdown
## Code Before: Tests ===== Because it is not a Test-driven Development project, we intentionally don't do any unit tests. In contrast, we use integration tests to avoir regression. Consequently, Travis-CI has been configured in order to do all these integration tests. Coverage is then updated in [sonarqube.com](https://sonarqube.com/component_measures/metric/coverage/list?id=armadito%3Aglpi%3ADEV%3ADEV) ## Instruction: Add more explanation on why we don't do any unit tests ## Code After: Tests ===== > It’s overwhelmingly easy to write bad unit tests that add very little value to a project while inflating the cost of code changes astronomically. Steve Sanderson. Thus, and because it is not a Test-driven Development project, we intentionally don't do any unit tests. In contrast, we use integration tests to avoir regression. Consequently, Travis-CI has been configured in order to do all these integration tests. Coverage is then updated in [sonarqube.com](https://sonarqube.com/component_measures/metric/coverage/list?id=armadito%3Aglpi%3ADEV%3ADEV)
4c0cdf3347fc55cc45e6262f44575960380367cb
.travis.yml
.travis.yml
sudo: false language: python python: - 2.6 - 2.7 - pypy install: - make redis - pip install redis --use-mirrors env: - REDIS_VERSION=3.0.7 - REDIS_VERSION=3.2.8 script: make test
sudo: false language: python python: - 2.6 - 2.7 - pypy install: - make redis - pip install redis env: - REDIS_VERSION=3.0.7 - REDIS_VERSION=3.2.8 script: make test
Drop no longer supported --use-mirrors flag.
Drop no longer supported --use-mirrors flag.
YAML
mit
seomoz/qless-core,seomoz/qless-core
yaml
## Code Before: sudo: false language: python python: - 2.6 - 2.7 - pypy install: - make redis - pip install redis --use-mirrors env: - REDIS_VERSION=3.0.7 - REDIS_VERSION=3.2.8 script: make test ## Instruction: Drop no longer supported --use-mirrors flag. ## Code After: sudo: false language: python python: - 2.6 - 2.7 - pypy install: - make redis - pip install redis env: - REDIS_VERSION=3.0.7 - REDIS_VERSION=3.2.8 script: make test
3ca3f9473d7031ef9536f56c253ba0a4b7e1ee6e
test/unit/ggrc/converters/test_query_helper.py
test/unit/ggrc/converters/test_query_helper.py
import unittest import mock from ggrc.converters import query_helper class TestQueryHelper(unittest.TestCase): def test_expression_keys(self): """ test expression keys function Make sure it works with: empty query simple query complex query invalid complex query """ query = mock.MagicMock() helper = query_helper.QueryHelper(query) expressions = [ (set(), {}), (set(["key_1"]), { "left": "key_1", "op": {"name": "="}, "right": "", }), (set(["key_1", "key_2"]), { "left": { "left": "key_2", "op": {"name": "="}, "right": "", }, "op": {"name": "AND"}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), (set(), { "left": { "left": "5", "op": {"name": "="}, "right": "", }, "op": {"name": "="}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), ] for expected_result, expression in expressions: self.assertEqual(expected_result, helper.expression_keys(expression))
import unittest import mock from ggrc.converters import query_helper class TestQueryHelper(unittest.TestCase): def test_expression_keys(self): """ test expression keys function Make sure it works with: empty query simple query complex query invalid complex query """ # pylint: disable=protected-access # needed for testing protected function inside the query helper query = mock.MagicMock() helper = query_helper.QueryHelper(query) expressions = [ (set(), {}), (set(["key_1"]), { "left": "key_1", "op": {"name": "="}, "right": "", }), (set(["key_1", "key_2"]), { "left": { "left": "key_2", "op": {"name": "="}, "right": "", }, "op": {"name": "AND"}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), (set(), { "left": { "left": "5", "op": {"name": "="}, "right": "", }, "op": {"name": "="}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), ] for expected_result, expression in expressions: self.assertEqual(expected_result, helper._expression_keys(expression))
Update unit tests with new query helper names
Update unit tests with new query helper names
Python
apache-2.0
j0gurt/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,edofic/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core
python
## Code Before: import unittest import mock from ggrc.converters import query_helper class TestQueryHelper(unittest.TestCase): def test_expression_keys(self): """ test expression keys function Make sure it works with: empty query simple query complex query invalid complex query """ query = mock.MagicMock() helper = query_helper.QueryHelper(query) expressions = [ (set(), {}), (set(["key_1"]), { "left": "key_1", "op": {"name": "="}, "right": "", }), (set(["key_1", "key_2"]), { "left": { "left": "key_2", "op": {"name": "="}, "right": "", }, "op": {"name": "AND"}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), (set(), { "left": { "left": "5", "op": {"name": "="}, "right": "", }, "op": {"name": "="}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), ] for expected_result, expression in expressions: self.assertEqual(expected_result, helper.expression_keys(expression)) ## Instruction: Update unit tests with new query helper names ## Code After: import unittest import mock from ggrc.converters import query_helper class TestQueryHelper(unittest.TestCase): def test_expression_keys(self): """ test expression keys function Make sure it works with: empty query simple query complex query invalid complex query """ # pylint: disable=protected-access # needed for testing protected function inside the query helper query = mock.MagicMock() helper = query_helper.QueryHelper(query) expressions = [ (set(), {}), (set(["key_1"]), { "left": "key_1", "op": {"name": "="}, "right": "", }), (set(["key_1", "key_2"]), { "left": { "left": "key_2", "op": {"name": "="}, "right": "", }, "op": {"name": "AND"}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), (set(), { "left": { "left": "5", "op": {"name": "="}, "right": "", }, "op": {"name": "="}, "right": { "left": "key_1", "op": {"name": "!="}, "right": "", }, }), ] for expected_result, expression in expressions: self.assertEqual(expected_result, helper._expression_keys(expression))
31233079a8703766984af353085a3890a3f3ac61
tests/sparkqmltests/qmltests/tst_QmlFileListModel.qml
tests/sparkqmltests/qmltests/tst_QmlFileListModel.qml
import QtQuick 2.0 import QtTest 1.0 import Spark.sys 1.0 import QUIKit 1.0 import Spark.views.components 1.0 import "../sample/rectanlges" TestCase { name: "QmlFileListModel" when: windowShown TestUtils { id: utils } Component { id: creator QmlFileListModel { } } function test_options() { var model = creator.createObject(); model.folder = Qt.resolvedUrl("../sample/rectanlges/"); model.options = { "Blue100x50": { color: "green" } } utils.waitUntil(function() { return model.count > 0; }, 1000) var item = model.get(0); compare(item.title, "Blue100x50"); compare(item.properties.color, "green"); } }
import QtQuick 2.0 import QtTest 1.0 import Spark.sys 1.0 import QUIKit 1.0 import Spark.views.components 1.0 import "../sample/rectanlges" TestCase { name: "QmlFileListModel" TestUtils { id: utils } Component { id: creator QmlFileListModel { } } function test_options() { console.log("test_options"); var model = creator.createObject(); model.folder = Qt.resolvedUrl("../sample/rectanlges/"); model.options = { "Blue100x50": { color: "green" } } utils.waitUntil(function() { return model.count > 0; }, 1000) var item = model.get(0); compare(item.title, "Blue100x50"); compare(item.properties.color, "green"); } }
Fix test case time out issue
Fix test case time out issue
QML
apache-2.0
benlau/sparkqml,benlau/sparkqml,benlau/sparkqml
qml
## Code Before: import QtQuick 2.0 import QtTest 1.0 import Spark.sys 1.0 import QUIKit 1.0 import Spark.views.components 1.0 import "../sample/rectanlges" TestCase { name: "QmlFileListModel" when: windowShown TestUtils { id: utils } Component { id: creator QmlFileListModel { } } function test_options() { var model = creator.createObject(); model.folder = Qt.resolvedUrl("../sample/rectanlges/"); model.options = { "Blue100x50": { color: "green" } } utils.waitUntil(function() { return model.count > 0; }, 1000) var item = model.get(0); compare(item.title, "Blue100x50"); compare(item.properties.color, "green"); } } ## Instruction: Fix test case time out issue ## Code After: import QtQuick 2.0 import QtTest 1.0 import Spark.sys 1.0 import QUIKit 1.0 import Spark.views.components 1.0 import "../sample/rectanlges" TestCase { name: "QmlFileListModel" TestUtils { id: utils } Component { id: creator QmlFileListModel { } } function test_options() { console.log("test_options"); var model = creator.createObject(); model.folder = Qt.resolvedUrl("../sample/rectanlges/"); model.options = { "Blue100x50": { color: "green" } } utils.waitUntil(function() { return model.count > 0; }, 1000) var item = model.get(0); compare(item.title, "Blue100x50"); compare(item.properties.color, "green"); } }
584a35aee0cea57e939e83fd86b5a58240c15846
models/src/main/java/com/vimeo/networking2/FeaturesConfiguration.kt
models/src/main/java/com/vimeo/networking2/FeaturesConfiguration.kt
package com.vimeo.networking2 /** * Based on CAPABILITY_PLATFORM_CONFIGS_OTA_FEATURES. */ data class FeaturesConfiguration( /** * The Chromecast receiver app ID. */ val chromecastAppId: String?, /** * Is Comscore enabled for iOS? */ val comscore: Boolean?, /** * Does the user reside within a GDPR-compliant country? */ val gdprEnabled: Boolean? )
package com.vimeo.networking2 /** * Based on CAPABILITY_PLATFORM_CONFIGS_OTA_FEATURES. */ data class FeaturesConfiguration( /** * The Chromecast receiver app ID. */ val chromecastAppId: String?, /** * Is Comscore enabled? */ val comscore: Boolean?, /** * Does the user reside within a GDPR-compliant country? */ val gdprEnabled: Boolean?, /** * Is play tracking enabled? */ val playTracking: Boolean? )
Add play tracking enabled field to feature config
Add play tracking enabled field to feature config
Kotlin
mit
vimeo/vimeo-networking-java,vimeo/vimeo-networking-java,vimeo/vimeo-networking-java
kotlin
## Code Before: package com.vimeo.networking2 /** * Based on CAPABILITY_PLATFORM_CONFIGS_OTA_FEATURES. */ data class FeaturesConfiguration( /** * The Chromecast receiver app ID. */ val chromecastAppId: String?, /** * Is Comscore enabled for iOS? */ val comscore: Boolean?, /** * Does the user reside within a GDPR-compliant country? */ val gdprEnabled: Boolean? ) ## Instruction: Add play tracking enabled field to feature config ## Code After: package com.vimeo.networking2 /** * Based on CAPABILITY_PLATFORM_CONFIGS_OTA_FEATURES. */ data class FeaturesConfiguration( /** * The Chromecast receiver app ID. */ val chromecastAppId: String?, /** * Is Comscore enabled? */ val comscore: Boolean?, /** * Does the user reside within a GDPR-compliant country? */ val gdprEnabled: Boolean?, /** * Is play tracking enabled? */ val playTracking: Boolean? )
b9b81b5b11a5d6a6e0d343cf1060da6b18732209
android/CouchbaseLite/src/ce/java/com/couchbase/lite/Replicator.java
android/CouchbaseLite/src/ce/java/com/couchbase/lite/Replicator.java
package com.couchbase.lite; import android.support.annotation.NonNull; import com.couchbase.lite.internal.replicator.CBLWebSocket; import com.couchbase.litecore.C4Socket; public final class Replicator extends AbstractReplicator { /** * Initializes a replicator with the given configuration. * * @param config */ public Replicator(@NonNull ReplicatorConfiguration config) { super(config); } @Override void initC4Socket(int hash) { C4Socket.socketFactory.put(hash, CBLWebSocket.class); } @Override int framing() { return C4Socket.kC4NoFraming; } @Override String schema() { return null; } }
package com.couchbase.lite; import android.support.annotation.NonNull; import com.couchbase.lite.internal.replicator.CBLWebSocket; import com.couchbase.litecore.C4Socket; public final class Replicator extends AbstractReplicator { /** * Initializes a replicator with the given configuration. * * @param config */ public Replicator(@NonNull ReplicatorConfiguration config) { super(config); } @Override void initSocketFactory(Object socketFactoryContext) { C4Socket.socketFactory.put(socketFactoryContext, CBLWebSocket.class); } @Override int framing() { return C4Socket.kC4NoFraming; } @Override String schema() { return null; } }
Fix Replication compilation error (CE)
Fix Replication compilation error (CE) We have changed an abstact method initC4Socket(int) to initSocketFactory(Object). The implmenation change has been made to the EE version. The CE version of the Replicator class needs to follow.
Java
apache-2.0
couchbase/couchbase-lite-android,couchbase/couchbase-lite-android
java
## Code Before: package com.couchbase.lite; import android.support.annotation.NonNull; import com.couchbase.lite.internal.replicator.CBLWebSocket; import com.couchbase.litecore.C4Socket; public final class Replicator extends AbstractReplicator { /** * Initializes a replicator with the given configuration. * * @param config */ public Replicator(@NonNull ReplicatorConfiguration config) { super(config); } @Override void initC4Socket(int hash) { C4Socket.socketFactory.put(hash, CBLWebSocket.class); } @Override int framing() { return C4Socket.kC4NoFraming; } @Override String schema() { return null; } } ## Instruction: Fix Replication compilation error (CE) We have changed an abstact method initC4Socket(int) to initSocketFactory(Object). The implmenation change has been made to the EE version. The CE version of the Replicator class needs to follow. ## Code After: package com.couchbase.lite; import android.support.annotation.NonNull; import com.couchbase.lite.internal.replicator.CBLWebSocket; import com.couchbase.litecore.C4Socket; public final class Replicator extends AbstractReplicator { /** * Initializes a replicator with the given configuration. * * @param config */ public Replicator(@NonNull ReplicatorConfiguration config) { super(config); } @Override void initSocketFactory(Object socketFactoryContext) { C4Socket.socketFactory.put(socketFactoryContext, CBLWebSocket.class); } @Override int framing() { return C4Socket.kC4NoFraming; } @Override String schema() { return null; } }
2f1244881d6b61e023585c20a2f3b9edffa246c3
spec/models/renalware/medication_spec.rb
spec/models/renalware/medication_spec.rb
require 'rails_helper' require './spec/support/login_macros' module Renalware RSpec.describe Medication, :type => :model do it { should belong_to(:patient) } it { should belong_to(:treatable) } it { should belong_to(:medication_route) } it { should validate_presence_of :patient } it { should validate_presence_of(:drug) } it { should validate_presence_of(:dose) } it { should validate_presence_of(:medication_route_id) } it { should validate_presence_of(:frequency) } it { should validate_presence_of(:start_date) } it { should validate_presence_of(:provider) } describe 'self.peritonitis' do it "should set 'treatable_type' as 'PeritonitisEpisode' for a medication relating to peritonitis" do expect(Medication.peritonitis.treatable_type).to eq('Renalware::PeritonitisEpisode') end end describe 'self.exit_site' do it "should set 'treatable_type' as 'ExitSiteInfection' for a medication relating to exit site" do expect(Medication.exit_site.treatable_type).to eq('Renalware::ExitSiteInfection') end end end end
require 'rails_helper' require './spec/support/login_macros' module Renalware RSpec.describe Medication, :type => :model do it { should validate_presence_of :patient } it { should validate_presence_of(:drug) } it { should validate_presence_of(:dose) } it { should validate_presence_of(:medication_route_id) } it { should validate_presence_of(:frequency) } it { should validate_presence_of(:start_date) } it { should validate_presence_of(:provider) } end end
Remove low-value specs from medication model
Remove low-value specs from medication model - we don’t test associations - we don’t test polymorphic associations
Ruby
mit
airslie/renalware-core,airslie/renalware-core,airslie/renalware-core,airslie/renalware-core
ruby
## Code Before: require 'rails_helper' require './spec/support/login_macros' module Renalware RSpec.describe Medication, :type => :model do it { should belong_to(:patient) } it { should belong_to(:treatable) } it { should belong_to(:medication_route) } it { should validate_presence_of :patient } it { should validate_presence_of(:drug) } it { should validate_presence_of(:dose) } it { should validate_presence_of(:medication_route_id) } it { should validate_presence_of(:frequency) } it { should validate_presence_of(:start_date) } it { should validate_presence_of(:provider) } describe 'self.peritonitis' do it "should set 'treatable_type' as 'PeritonitisEpisode' for a medication relating to peritonitis" do expect(Medication.peritonitis.treatable_type).to eq('Renalware::PeritonitisEpisode') end end describe 'self.exit_site' do it "should set 'treatable_type' as 'ExitSiteInfection' for a medication relating to exit site" do expect(Medication.exit_site.treatable_type).to eq('Renalware::ExitSiteInfection') end end end end ## Instruction: Remove low-value specs from medication model - we don’t test associations - we don’t test polymorphic associations ## Code After: require 'rails_helper' require './spec/support/login_macros' module Renalware RSpec.describe Medication, :type => :model do it { should validate_presence_of :patient } it { should validate_presence_of(:drug) } it { should validate_presence_of(:dose) } it { should validate_presence_of(:medication_route_id) } it { should validate_presence_of(:frequency) } it { should validate_presence_of(:start_date) } it { should validate_presence_of(:provider) } end end
d643b37ec079ab8ac429cb1f256413d2a29c24cc
tasks/gulp/clean-pre.js
tasks/gulp/clean-pre.js
(function(){ 'use strict'; var gulp = require('gulp'); var paths = require('./_paths'); var ignore = require('gulp-ignore'); var rimraf = require('gulp-rimraf'); // clean out assets folder gulp.task('clean-pre', function() { return gulp .src([paths.dest, paths.tmp], {read: false}) .pipe(ignore('node_modules/**')) .pipe(rimraf()); }); })();
(function(){ 'use strict'; var gulp = require('gulp'); var paths = require('./_paths'); var ignore = require('gulp-ignore'); var rimraf = require('gulp-rimraf'); // clean out assets folder gulp.task('clean-pre', function() { return gulp .src([paths.dest, paths.tmp, 'reports/protractor-e2e/screenshots/'], {read: false}) .pipe(ignore('node_modules/**')) .pipe(rimraf()); }); })();
Clean out screenshots on gulp build
Clean out screenshots on gulp build
JavaScript
mit
ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend
javascript
## Code Before: (function(){ 'use strict'; var gulp = require('gulp'); var paths = require('./_paths'); var ignore = require('gulp-ignore'); var rimraf = require('gulp-rimraf'); // clean out assets folder gulp.task('clean-pre', function() { return gulp .src([paths.dest, paths.tmp], {read: false}) .pipe(ignore('node_modules/**')) .pipe(rimraf()); }); })(); ## Instruction: Clean out screenshots on gulp build ## Code After: (function(){ 'use strict'; var gulp = require('gulp'); var paths = require('./_paths'); var ignore = require('gulp-ignore'); var rimraf = require('gulp-rimraf'); // clean out assets folder gulp.task('clean-pre', function() { return gulp .src([paths.dest, paths.tmp, 'reports/protractor-e2e/screenshots/'], {read: false}) .pipe(ignore('node_modules/**')) .pipe(rimraf()); }); })();
456a22f4f9d6de6acd0d4083adcbc89b5256fbe4
README.md
README.md
[![Code Climate](https://codeclimate.com/github/archdragon/loot_system/badges/gpa.svg)](https://codeclimate.com/github/archdragon/loot_system) [![Build Status](https://travis-ci.org/archdragon/loot_system.svg?branch=master)](https://travis-ci.org/archdragon/loot_system) [![Coverage Status](https://coveralls.io/repos/archdragon/loot_system/badge.svg?branch=master)](https://coveralls.io/r/archdragon/loot_system?branch=master) # Loot System: Quick and simple loot table creation. ## Examples: First, create a chest - a container for your drops chest = LootSystem::Chest.new Initlialize your item It can be anything - Drop class will accept any object first_drop = LootSystem::Drop.new({item: your_item, chance: 0.25}) second_drop = LootSystem::Drop.new({item: your_item2, chance: 0.95}) Now we can add the drops to our container: chest.add(first_drop) chest.add(second_drop) And use get_drops method to get a list of all the that we managed to find: chest.get_drops
[![Code Climate](https://codeclimate.com/github/archdragon/loot_system/badges/gpa.svg)](https://codeclimate.com/github/archdragon/loot_system) [![Build Status](https://travis-ci.org/archdragon/loot_system.svg?branch=master)](https://travis-ci.org/archdragon/loot_system) [![Coverage Status](https://coveralls.io/repos/archdragon/loot_system/badge.svg?branch=master)](https://coveralls.io/r/archdragon/loot_system?branch=master) # Loot System: Quick and simple loot table creation. ## Examples: First, create a chest - a container for your drops chest = LootSystem::Chest.new Now we can add the items to our container: chest.add({item: common_item_object, chance: 0.9}) chest.add({item: rare_item_object, chance: 0.01}) And use items_found method to get a list of all item that we managed to find: chest.item_found
Change examples to use the updated methods
Change examples to use the updated methods
Markdown
mit
archdragon/loot_system
markdown
## Code Before: [![Code Climate](https://codeclimate.com/github/archdragon/loot_system/badges/gpa.svg)](https://codeclimate.com/github/archdragon/loot_system) [![Build Status](https://travis-ci.org/archdragon/loot_system.svg?branch=master)](https://travis-ci.org/archdragon/loot_system) [![Coverage Status](https://coveralls.io/repos/archdragon/loot_system/badge.svg?branch=master)](https://coveralls.io/r/archdragon/loot_system?branch=master) # Loot System: Quick and simple loot table creation. ## Examples: First, create a chest - a container for your drops chest = LootSystem::Chest.new Initlialize your item It can be anything - Drop class will accept any object first_drop = LootSystem::Drop.new({item: your_item, chance: 0.25}) second_drop = LootSystem::Drop.new({item: your_item2, chance: 0.95}) Now we can add the drops to our container: chest.add(first_drop) chest.add(second_drop) And use get_drops method to get a list of all the that we managed to find: chest.get_drops ## Instruction: Change examples to use the updated methods ## Code After: [![Code Climate](https://codeclimate.com/github/archdragon/loot_system/badges/gpa.svg)](https://codeclimate.com/github/archdragon/loot_system) [![Build Status](https://travis-ci.org/archdragon/loot_system.svg?branch=master)](https://travis-ci.org/archdragon/loot_system) [![Coverage Status](https://coveralls.io/repos/archdragon/loot_system/badge.svg?branch=master)](https://coveralls.io/r/archdragon/loot_system?branch=master) # Loot System: Quick and simple loot table creation. ## Examples: First, create a chest - a container for your drops chest = LootSystem::Chest.new Now we can add the items to our container: chest.add({item: common_item_object, chance: 0.9}) chest.add({item: rare_item_object, chance: 0.01}) And use items_found method to get a list of all item that we managed to find: chest.item_found
53a8882a38b0eff60e1dd3ec1e070d86ad5a2370
.travis.yml
.travis.yml
language: csharp mono: none dotnet: 3.1.101 dist: xenial script: - dotnet build - dotnet test Google.Api.Generator.Tests
language: csharp mono: none dotnet: 3.1.101 dist: xenial script: - dotnet build - dotnet test Google.Api.Generator.Tests --logger:"console;noprogress=true"
Disable progress when running tests
Disable progress when running tests
YAML
apache-2.0
googleapis/gapic-generator-csharp,googleapis/gapic-generator-csharp
yaml
## Code Before: language: csharp mono: none dotnet: 3.1.101 dist: xenial script: - dotnet build - dotnet test Google.Api.Generator.Tests ## Instruction: Disable progress when running tests ## Code After: language: csharp mono: none dotnet: 3.1.101 dist: xenial script: - dotnet build - dotnet test Google.Api.Generator.Tests --logger:"console;noprogress=true"
77704e80a32fbb2f4c9533778565a92dbb346ab6
highlander/highlander.py
highlander/highlander.py
from functools import wraps from logging import getLogger from os import getcwd, unlink from os.path import join, realpath, isfile from psutil import Process logger = getLogger(__name__) def one(f): @wraps(f) def decorator(): pid_file = realpath(join(getcwd(), '.pid')) if _is_running(pid_file): exit(0) _set_running(pid_file) try: f() finally: unlink(pid_file) return decorator def _is_running(): pass def _read_pid_file(filename): with open(filename, 'r') as f: pid, create_time = f.read().split(',') return Process(int(pid)) def _set_running(filename): p = Process() with open(filename, 'w') as f: f.write('{},{}'.format(p.pid, p.create_time())) def _unlink_pid_file(f): unlink(f)
from functools import wraps from logging import getLogger from os import getcwd, unlink from os.path import join, realpath, isfile from psutil import Process logger = getLogger(__name__) def one(f): @wraps(f) def decorator(): pid_file = realpath(join(getcwd(), '.pid')) if _is_running(pid_file): exit(0) _set_running(pid_file) try: f() finally: unlink(pid_file) return decorator def _is_running(): pass def _read_pid_file(filename): if not isfile(str(filename)): return None with open(filename, 'r') as f: pid, create_time = f.read().split(',') return Process(int(pid)) def _set_running(filename): p = Process() with open(filename, 'w') as f: f.write('{},{}'.format(p.pid, p.create_time())) def _unlink_pid_file(f): unlink(f)
Make sure filename is a string.
Make sure filename is a string.
Python
mit
chriscannon/highlander
python
## Code Before: from functools import wraps from logging import getLogger from os import getcwd, unlink from os.path import join, realpath, isfile from psutil import Process logger = getLogger(__name__) def one(f): @wraps(f) def decorator(): pid_file = realpath(join(getcwd(), '.pid')) if _is_running(pid_file): exit(0) _set_running(pid_file) try: f() finally: unlink(pid_file) return decorator def _is_running(): pass def _read_pid_file(filename): with open(filename, 'r') as f: pid, create_time = f.read().split(',') return Process(int(pid)) def _set_running(filename): p = Process() with open(filename, 'w') as f: f.write('{},{}'.format(p.pid, p.create_time())) def _unlink_pid_file(f): unlink(f) ## Instruction: Make sure filename is a string. ## Code After: from functools import wraps from logging import getLogger from os import getcwd, unlink from os.path import join, realpath, isfile from psutil import Process logger = getLogger(__name__) def one(f): @wraps(f) def decorator(): pid_file = realpath(join(getcwd(), '.pid')) if _is_running(pid_file): exit(0) _set_running(pid_file) try: f() finally: unlink(pid_file) return decorator def _is_running(): pass def _read_pid_file(filename): if not isfile(str(filename)): return None with open(filename, 'r') as f: pid, create_time = f.read().split(',') return Process(int(pid)) def _set_running(filename): p = Process() with open(filename, 'w') as f: f.write('{},{}'.format(p.pid, p.create_time())) def _unlink_pid_file(f): unlink(f)
8ead0aa7cc7c5963a0896ed33b5157715c06bb80
MOLAuthenticatingURLSession.podspec
MOLAuthenticatingURLSession.podspec
Pod::Spec.new do |s| s.name = 'MOLAuthenticatingURLSession' s.version = '2.2' s.platform = :osx s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } s.homepage = 'https://github.com/google/macops-molauthenticatingurlsession' s.authors = { 'Google Macops' => '[email protected]' } s.summary = 'An NSURLSession wrapper that handles certificate validation nicely' s.source = { :git => 'https://github.com/google/macops-molauthenticatingurlsession.git', :tag => "v#{s.version}" } s.source_files = 'Source/*.{h,m}' s.framework = 'Security' s.dependency 'MOLCertificate', '~> 1.5' end
Pod::Spec.new do |s| s.name = 'MOLAuthenticatingURLSession' s.version = '2.2' s.platform = :osx s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } s.homepage = 'https://github.com/google/macops-MOLAuthenticatingURLSession' s.authors = { 'Google Macops' => '[email protected]' } s.summary = 'An NSURLSession wrapper that handles certificate validation nicely' s.source = { :git => 'https://github.com/google/macops-MOLAuthenticatingURLSession.git', :tag => "v#{s.version}" } s.source_files = 'Source/*.{h,m}' s.framework = 'Security' s.dependency 'MOLCertificate', '~> 1.5' end
Update Podspec, someone has become case-sensitive.
Update Podspec, someone has become case-sensitive. Cloning the URL in Cocoapods no longer seems to work properly
Ruby
apache-2.0
russellhancox/macops-MOLAuthenticatingURLSession,google/macops-MOLAuthenticatingURLSession,russellhancox/macops-MOLAuthenticatingURLSession
ruby
## Code Before: Pod::Spec.new do |s| s.name = 'MOLAuthenticatingURLSession' s.version = '2.2' s.platform = :osx s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } s.homepage = 'https://github.com/google/macops-molauthenticatingurlsession' s.authors = { 'Google Macops' => '[email protected]' } s.summary = 'An NSURLSession wrapper that handles certificate validation nicely' s.source = { :git => 'https://github.com/google/macops-molauthenticatingurlsession.git', :tag => "v#{s.version}" } s.source_files = 'Source/*.{h,m}' s.framework = 'Security' s.dependency 'MOLCertificate', '~> 1.5' end ## Instruction: Update Podspec, someone has become case-sensitive. Cloning the URL in Cocoapods no longer seems to work properly ## Code After: Pod::Spec.new do |s| s.name = 'MOLAuthenticatingURLSession' s.version = '2.2' s.platform = :osx s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } s.homepage = 'https://github.com/google/macops-MOLAuthenticatingURLSession' s.authors = { 'Google Macops' => '[email protected]' } s.summary = 'An NSURLSession wrapper that handles certificate validation nicely' s.source = { :git => 'https://github.com/google/macops-MOLAuthenticatingURLSession.git', :tag => "v#{s.version}" } s.source_files = 'Source/*.{h,m}' s.framework = 'Security' s.dependency 'MOLCertificate', '~> 1.5' end
b353aa7fe0add0ef501988077a3976ed3be30645
index.html
index.html
<!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <script src="js/jquery-1.11.3.js"></script> <script src="js/scripts.js"></script> <title>Title</title> </head> <body> </html>
<!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <script src="js/jquery-1.11.3.js"></script> <script src="js/scripts.js"></script> <title>Address Book</title> </head> <body> <div class="containter"> <h1>Address Book</h1> <div class="row"> <div class="col-md-6"> <h2>Add a contact:</h2> <form id="new-contact"> <div class="form-group"> <label for="new-first-name">First name</label> <input type="text" ckass="form-control" id="new-first-name"> </div> <div class="form-group"> <label for="new-last-name">Last Name</label> <input type="text" class="form-control" id="new-last-name"> </div> <button type="submit" class="btn btn-info">Add</button> </form> <h2>Contacts:</h2> <ul id="contacts"> </ul> </div> </div> </div> </body> </html>
Add html to the main page.
Add html to the main page.
HTML
mit
kcmdouglas/address_book_js,kcmdouglas/address_book_js
html
## Code Before: <!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <script src="js/jquery-1.11.3.js"></script> <script src="js/scripts.js"></script> <title>Title</title> </head> <body> </html> ## Instruction: Add html to the main page. ## Code After: <!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <script src="js/jquery-1.11.3.js"></script> <script src="js/scripts.js"></script> <title>Address Book</title> </head> <body> <div class="containter"> <h1>Address Book</h1> <div class="row"> <div class="col-md-6"> <h2>Add a contact:</h2> <form id="new-contact"> <div class="form-group"> <label for="new-first-name">First name</label> <input type="text" ckass="form-control" id="new-first-name"> </div> <div class="form-group"> <label for="new-last-name">Last Name</label> <input type="text" class="form-control" id="new-last-name"> </div> <button type="submit" class="btn btn-info">Add</button> </form> <h2>Contacts:</h2> <ul id="contacts"> </ul> </div> </div> </div> </body> </html>
c4b83a12f9765d068056286f35122ae592b77af4
plugins.md
plugins.md
--- title: Plugins layout: page --- ## Reference plugins The reference plugins are provided by the Maliit project in the plugins repository. ### Maliit Keyboard [More information](/plugins/maliit-keyboard/) ### Nemo Keyboard [More information](/plugins/nemo-keyboard/) ## 3rd party Plugins These plugins are not distributed with the Maliit releases, but they can be used with Maliit. ### Ubuntu Keyboard [See project page (Launchpad)](https://launchpad.net/ubuntu-keyboard) ### Sailfish Virtual Keyboard [Sailfish OS](https://sailfishos.org/) ### webos-keyboard [See webos-keyboard GitHub page](https://github.com/webOS-ports/webos-keyboard) ## Outdated plugins This plugins might not be from much direct use anymore. But they might help to create features for current plugins. ### Meego Keyboard The keyboard used in the Nokia N9 and Nokia 950. It requires libmeegotouch. It can be extended to support new languages through input method engines and layout files. [More information](/plugins/meego-keyboard/) ### Cute Input Method Chinese keyboard [See project on Github](https://github.com/foolegg/cute-input-method) ### Maliit Plugin JP Japanese keyboard [See project on code google](http://code.google.com/p/maliit-plugin-jp/)
--- title: Plugins layout: page --- ## Reference plugins The reference plugins are provided by the Maliit project in the plugins repository. ### Maliit Keyboard [More information](/plugins/maliit-keyboard/) ### Nemo Keyboard [More information](/plugins/nemo-keyboard/) ## 3rd party Plugins These plugins are not distributed with the Maliit releases, but they can be used with Maliit. ### Ubuntu Keyboard [See project page (Launchpad)](https://launchpad.net/ubuntu-keyboard) ### Sailfish Virtual Keyboard [Sailfish OS](https://sailfishos.org/) ### LuneOS Keyboard [See LuneOS Keyboard GitHub page](https://github.com/webOS-ports/webos-keyboard) ## Outdated plugins This plugins might not be from much direct use anymore. But they might help to create features for current plugins. ### Meego Keyboard The keyboard used in the Nokia N9 and Nokia 950. It requires libmeegotouch. It can be extended to support new languages through input method engines and layout files. [More information](/plugins/meego-keyboard/) ### Cute Input Method Chinese keyboard [See project on Github](https://github.com/foolegg/cute-input-method) ### Maliit Plugin JP Japanese keyboard [See project on code google](http://code.google.com/p/maliit-plugin-jp/)
Call it properly LuneOS Keyboard
Call it properly LuneOS Keyboard
Markdown
mit
maliit/maliit.github.io,maliit/maliit.github.io
markdown
## Code Before: --- title: Plugins layout: page --- ## Reference plugins The reference plugins are provided by the Maliit project in the plugins repository. ### Maliit Keyboard [More information](/plugins/maliit-keyboard/) ### Nemo Keyboard [More information](/plugins/nemo-keyboard/) ## 3rd party Plugins These plugins are not distributed with the Maliit releases, but they can be used with Maliit. ### Ubuntu Keyboard [See project page (Launchpad)](https://launchpad.net/ubuntu-keyboard) ### Sailfish Virtual Keyboard [Sailfish OS](https://sailfishos.org/) ### webos-keyboard [See webos-keyboard GitHub page](https://github.com/webOS-ports/webos-keyboard) ## Outdated plugins This plugins might not be from much direct use anymore. But they might help to create features for current plugins. ### Meego Keyboard The keyboard used in the Nokia N9 and Nokia 950. It requires libmeegotouch. It can be extended to support new languages through input method engines and layout files. [More information](/plugins/meego-keyboard/) ### Cute Input Method Chinese keyboard [See project on Github](https://github.com/foolegg/cute-input-method) ### Maliit Plugin JP Japanese keyboard [See project on code google](http://code.google.com/p/maliit-plugin-jp/) ## Instruction: Call it properly LuneOS Keyboard ## Code After: --- title: Plugins layout: page --- ## Reference plugins The reference plugins are provided by the Maliit project in the plugins repository. ### Maliit Keyboard [More information](/plugins/maliit-keyboard/) ### Nemo Keyboard [More information](/plugins/nemo-keyboard/) ## 3rd party Plugins These plugins are not distributed with the Maliit releases, but they can be used with Maliit. ### Ubuntu Keyboard [See project page (Launchpad)](https://launchpad.net/ubuntu-keyboard) ### Sailfish Virtual Keyboard [Sailfish OS](https://sailfishos.org/) ### LuneOS Keyboard [See LuneOS Keyboard GitHub page](https://github.com/webOS-ports/webos-keyboard) ## Outdated plugins This plugins might not be from much direct use anymore. But they might help to create features for current plugins. ### Meego Keyboard The keyboard used in the Nokia N9 and Nokia 950. It requires libmeegotouch. It can be extended to support new languages through input method engines and layout files. [More information](/plugins/meego-keyboard/) ### Cute Input Method Chinese keyboard [See project on Github](https://github.com/foolegg/cute-input-method) ### Maliit Plugin JP Japanese keyboard [See project on code google](http://code.google.com/p/maliit-plugin-jp/)
a02d9115f26320ce23b88da9645a9f118b79556e
tests/AppBundle/Native/InsertTest.php
tests/AppBundle/Native/InsertTest.php
<?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
<?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Sky'); "); $this->assertSame(1, $response); $this->assertSame('3', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
INSERT IGONRE `last insert id` after success insert
INSERT IGONRE `last insert id` after success insert
PHP
mit
SkyStudy/MySQLStudy
php
## Code Before: <?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } } ## Instruction: INSERT IGONRE `last insert id` after success insert ## Code After: <?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Sky'); "); $this->assertSame(1, $response); $this->assertSame('3', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
8a468026da9e915188151e8f3ca71da4f582709b
src/render.js
src/render.js
var fs = require('fs'); var path = require('path'); var handlebars = require('handlebars'); function compileTemplate(hbsFile) { var src = fs.readFileSync(path.join(__dirname, '..', 'templates', hbsFile)); return handlebars.compile(src.toString()); } var galleryTemplate = compileTemplate('gallery.hbs'); exports.gallery = function(list, active, title, css) { var links = list.map(function(item) { return { name: item.name, url: item.name + '.html', active: (item === active) }; }); var titleParts = title.split(' '); return galleryTemplate({ css: css, links: links, gallery: active, title: titleParts[0], subtitle: titleParts.slice(1) }); };
var fs = require('fs'); var path = require('path'); var handlebars = require('handlebars'); function compileTemplate(hbsFile) { var src = fs.readFileSync(path.join(__dirname, '..', 'templates', hbsFile)); return handlebars.compile(src.toString()); } var galleryTemplate = compileTemplate('gallery.hbs'); exports.gallery = function(list, active, title, css) { var links = list.map(function(item) { return { name: item.name, url: item.name + '.html', active: (item === active) }; }); var titleParts = title.split(' '); return galleryTemplate({ css: css, links: links, gallery: active, title: titleParts[0], subtitle: titleParts.slice(1).join(' ') }); };
Fix "split" title when it's more than 2 words
Fix "split" title when it's more than 2 words
JavaScript
mit
kremlinkev/thumbsup,thumbsup/node-thumbsup,dravenst/thumbsup,rprieto/thumbsup,thumbsup/thumbsup,rprieto/thumbsup,thumbsup/node-thumbsup,thumbsup/node-thumbsup,kremlinkev/thumbsup,thumbsup/thumbsup,dravenst/thumbsup
javascript
## Code Before: var fs = require('fs'); var path = require('path'); var handlebars = require('handlebars'); function compileTemplate(hbsFile) { var src = fs.readFileSync(path.join(__dirname, '..', 'templates', hbsFile)); return handlebars.compile(src.toString()); } var galleryTemplate = compileTemplate('gallery.hbs'); exports.gallery = function(list, active, title, css) { var links = list.map(function(item) { return { name: item.name, url: item.name + '.html', active: (item === active) }; }); var titleParts = title.split(' '); return galleryTemplate({ css: css, links: links, gallery: active, title: titleParts[0], subtitle: titleParts.slice(1) }); }; ## Instruction: Fix "split" title when it's more than 2 words ## Code After: var fs = require('fs'); var path = require('path'); var handlebars = require('handlebars'); function compileTemplate(hbsFile) { var src = fs.readFileSync(path.join(__dirname, '..', 'templates', hbsFile)); return handlebars.compile(src.toString()); } var galleryTemplate = compileTemplate('gallery.hbs'); exports.gallery = function(list, active, title, css) { var links = list.map(function(item) { return { name: item.name, url: item.name + '.html', active: (item === active) }; }); var titleParts = title.split(' '); return galleryTemplate({ css: css, links: links, gallery: active, title: titleParts[0], subtitle: titleParts.slice(1).join(' ') }); };
fb1bfd522816ecb918c5703e0c4fd04d111b14e2
README.md
README.md
Manage cell phone forwarding for a support team ## What is it for? The SupportManager allows you and your team to setup forwarding of phone calls from one support phone attached to the computer running the SupportManager to individual phone numbers. It's possible to manually pick a team member to forward to, or to schedule forwarding at a later time. It will even detect if you manually change the forwarding state on the phone (polled once a minute). ## Who is it for? Someone with .NET experience. Right now it will only suit developers and even then it probably won't work out of the box. ## What doesn't it do? A lot. Authentication is not enforced, authorization is not implemented (although some minor preparations have been made). Theoretically it also supports multiple teams, however the web interface lacks team separation in some places. ## But it does actually work? Yes! We've been using it for a while, mainly with scheduled forwarding. It works so well that development has somewhat stalled and that's why the code is here in it's current state. ## What's next? * Changing the web project to ASP.NET Core to allow self-hosting * Enforcing authentication * Implementing authorization * Implementing a public status page * User registration
Manage cell phone forwarding for a support team ## What is it for? The SupportManager allows you and your team to setup forwarding of phone calls from one support phone attached to the computer running the SupportManager to individual phone numbers. It's possible to manually pick a team member to forward to, or to schedule forwarding at a later time. It will even detect if you manually change the forwarding state on the phone (polled once a minute). ## Who is it for? Someone with .NET experience. Right now it will only suit developers and even then it probably won't work out of the box. ## What doesn't it do? A lot. Authentication is not enforced, authorization is not implemented (although some minor preparations have been made). Theoretically it also supports multiple teams, however the web interface lacks team separation in some places. ## But it does actually work? Yes! We've been using it for a while, mainly with scheduled forwarding. It works so well that development has somewhat stalled and that's why the code is here in it's current state. ## What's next? * Try to (self-)host the web project in the service * Enforcing authentication * Implementing authorization * Implementing a public status page * User registration
Update Readme with regards to Web project
Update Readme with regards to Web project
Markdown
mit
mycroes/SupportManager,mycroes/SupportManager,mycroes/SupportManager
markdown
## Code Before: Manage cell phone forwarding for a support team ## What is it for? The SupportManager allows you and your team to setup forwarding of phone calls from one support phone attached to the computer running the SupportManager to individual phone numbers. It's possible to manually pick a team member to forward to, or to schedule forwarding at a later time. It will even detect if you manually change the forwarding state on the phone (polled once a minute). ## Who is it for? Someone with .NET experience. Right now it will only suit developers and even then it probably won't work out of the box. ## What doesn't it do? A lot. Authentication is not enforced, authorization is not implemented (although some minor preparations have been made). Theoretically it also supports multiple teams, however the web interface lacks team separation in some places. ## But it does actually work? Yes! We've been using it for a while, mainly with scheduled forwarding. It works so well that development has somewhat stalled and that's why the code is here in it's current state. ## What's next? * Changing the web project to ASP.NET Core to allow self-hosting * Enforcing authentication * Implementing authorization * Implementing a public status page * User registration ## Instruction: Update Readme with regards to Web project ## Code After: Manage cell phone forwarding for a support team ## What is it for? The SupportManager allows you and your team to setup forwarding of phone calls from one support phone attached to the computer running the SupportManager to individual phone numbers. It's possible to manually pick a team member to forward to, or to schedule forwarding at a later time. It will even detect if you manually change the forwarding state on the phone (polled once a minute). ## Who is it for? Someone with .NET experience. Right now it will only suit developers and even then it probably won't work out of the box. ## What doesn't it do? A lot. Authentication is not enforced, authorization is not implemented (although some minor preparations have been made). Theoretically it also supports multiple teams, however the web interface lacks team separation in some places. ## But it does actually work? Yes! We've been using it for a while, mainly with scheduled forwarding. It works so well that development has somewhat stalled and that's why the code is here in it's current state. ## What's next? * Try to (self-)host the web project in the service * Enforcing authentication * Implementing authorization * Implementing a public status page * User registration
1285af873673d8c980ea705d15cdccc48bd6c442
source/_svg-logo.html.haml
source/_svg-logo.html.haml
%svg{width: width, height: height, viewBox: "0 0 134 48", xmlns: "http://www.w3.org/2000/svg"} %g{stroke: "none", "stroke-width": 1, fill: "none", "fill-rule": "evenodd"} %path{d: "M2.43359375,44.9980469 L18.9335938,29.4980469 L34.9335938,42.4980469 L53.9335938,20.4980469 L74.4335938,31.4980469 L95.9335938,4.99804688 L130.933594,33.9980469", stroke: strokeColor, "stroke-width": "7"}
%svg{width: width, height: height, viewBox: "0 0 134 48", xmlns: "http://www.w3.org/2000/svg"} %g{stroke: "none", :"stroke-width" => 1, fill: "none", :"fill-rule" => "evenodd"} %path{d: "M2.43359375,44.9980469 L18.9335938,29.4980469 L34.9335938,42.4980469 L53.9335938,20.4980469 L74.4335938,31.4980469 L95.9335938,4.99804688 L130.933594,33.9980469", stroke: strokeColor, :"stroke-width" => "7"}
Fix svg logo for Ruby 2.1
Fix svg logo for Ruby 2.1
Haml
mit
lilfaf/website,alpinelab/website,alpinelab/website,lilfaf/website,alpinelab/website
haml
## Code Before: %svg{width: width, height: height, viewBox: "0 0 134 48", xmlns: "http://www.w3.org/2000/svg"} %g{stroke: "none", "stroke-width": 1, fill: "none", "fill-rule": "evenodd"} %path{d: "M2.43359375,44.9980469 L18.9335938,29.4980469 L34.9335938,42.4980469 L53.9335938,20.4980469 L74.4335938,31.4980469 L95.9335938,4.99804688 L130.933594,33.9980469", stroke: strokeColor, "stroke-width": "7"} ## Instruction: Fix svg logo for Ruby 2.1 ## Code After: %svg{width: width, height: height, viewBox: "0 0 134 48", xmlns: "http://www.w3.org/2000/svg"} %g{stroke: "none", :"stroke-width" => 1, fill: "none", :"fill-rule" => "evenodd"} %path{d: "M2.43359375,44.9980469 L18.9335938,29.4980469 L34.9335938,42.4980469 L53.9335938,20.4980469 L74.4335938,31.4980469 L95.9335938,4.99804688 L130.933594,33.9980469", stroke: strokeColor, :"stroke-width" => "7"}
6d5ce6164c4406be66b787c84de64f6919a6246d
changes/jobs/sync_build.py
changes/jobs/sync_build.py
from flask import current_app from changes.config import queue from changes.backends.jenkins.builder import JenkinsBuilder from changes.constants import Status from changes.models.build import Build @queue.job def sync_build(build_id): try: build = Build.query.get(build_id) if build.status == Status.finished: return builder = JenkinsBuilder( app=current_app, base_uri=current_app.config['JENKINS_URL'], ) builder.sync_build(build) if build.status != Status.finished: sync_build.delay( build_id=build.id, ) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure sync_build.delay( build_id=build.id, ) raise
from flask import current_app from changes.config import queue, db from changes.backends.jenkins.builder import JenkinsBuilder from changes.constants import Status from changes.models.build import Build @queue.job def sync_build(build_id): try: build = Build.query.get(build_id) if build.status == Status.finished: return builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) db.session.commit() if build.status != Status.finished: sync_build.delay( build_id=build.id, ) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure sync_build.delay( build_id=build.id, ) raise
Correct base_url usage, and force commit
Correct base_url usage, and force commit
Python
apache-2.0
dropbox/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes,wfxiang08/changes
python
## Code Before: from flask import current_app from changes.config import queue from changes.backends.jenkins.builder import JenkinsBuilder from changes.constants import Status from changes.models.build import Build @queue.job def sync_build(build_id): try: build = Build.query.get(build_id) if build.status == Status.finished: return builder = JenkinsBuilder( app=current_app, base_uri=current_app.config['JENKINS_URL'], ) builder.sync_build(build) if build.status != Status.finished: sync_build.delay( build_id=build.id, ) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure sync_build.delay( build_id=build.id, ) raise ## Instruction: Correct base_url usage, and force commit ## Code After: from flask import current_app from changes.config import queue, db from changes.backends.jenkins.builder import JenkinsBuilder from changes.constants import Status from changes.models.build import Build @queue.job def sync_build(build_id): try: build = Build.query.get(build_id) if build.status == Status.finished: return builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) db.session.commit() if build.status != Status.finished: sync_build.delay( build_id=build.id, ) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure sync_build.delay( build_id=build.id, ) raise
2f9a0a8a5c34791c0fd5a0675f1777b8659b1cfc
packages/pr/proto-lens-arbitrary.yaml
packages/pr/proto-lens-arbitrary.yaml
homepage: https://github.com/google/proto-lens changelog-type: '' hash: bc363750bf27256415e1185002d90237e380aeabc69d74b35914e945a470923e test-bench-deps: {} maintainer: [email protected] synopsis: Arbitrary instances for proto-lens. changelog: '' basic-deps: bytestring: ==0.10.* lens-family: ==1.2.* base: ! '>=4.8 && <4.10' text: ==1.2.* containers: ==0.5.* proto-lens: ! '>=0.1 && <0.3' QuickCheck: ! '>=2.8 && <2.11' all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' - '0.1.0.3' author: Aden Grue latest: '0.1.0.3' description-type: haddock description: ! 'The proto-lens-arbitrary allows generating arbitrary messages for use with QuickCheck.' license-name: BSD3
homepage: https://github.com/google/proto-lens changelog-type: '' hash: 900549a6a4f54f2e924f9ef402b6e1b73ceeba6707552d004d42b1225536319c test-bench-deps: {} maintainer: [email protected] synopsis: Arbitrary instances for proto-lens. changelog: '' basic-deps: bytestring: ==0.10.* lens-family: ==1.2.* base: ! '>=4.8 && <4.10' text: ==1.2.* containers: ==0.5.* proto-lens: ! '>=0.1 && <0.3' QuickCheck: ! '>=2.8 && <2.11' all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' - '0.1.0.3' - '0.1.1.0' author: Aden Grue latest: '0.1.1.0' description-type: haddock description: ! 'The proto-lens-arbitrary allows generating arbitrary messages for use with QuickCheck.' license-name: BSD3
Update from Hackage at 2017-07-24T16:51:16Z
Update from Hackage at 2017-07-24T16:51:16Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/google/proto-lens changelog-type: '' hash: bc363750bf27256415e1185002d90237e380aeabc69d74b35914e945a470923e test-bench-deps: {} maintainer: [email protected] synopsis: Arbitrary instances for proto-lens. changelog: '' basic-deps: bytestring: ==0.10.* lens-family: ==1.2.* base: ! '>=4.8 && <4.10' text: ==1.2.* containers: ==0.5.* proto-lens: ! '>=0.1 && <0.3' QuickCheck: ! '>=2.8 && <2.11' all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' - '0.1.0.3' author: Aden Grue latest: '0.1.0.3' description-type: haddock description: ! 'The proto-lens-arbitrary allows generating arbitrary messages for use with QuickCheck.' license-name: BSD3 ## Instruction: Update from Hackage at 2017-07-24T16:51:16Z ## Code After: homepage: https://github.com/google/proto-lens changelog-type: '' hash: 900549a6a4f54f2e924f9ef402b6e1b73ceeba6707552d004d42b1225536319c test-bench-deps: {} maintainer: [email protected] synopsis: Arbitrary instances for proto-lens. changelog: '' basic-deps: bytestring: ==0.10.* lens-family: ==1.2.* base: ! '>=4.8 && <4.10' text: ==1.2.* containers: ==0.5.* proto-lens: ! '>=0.1 && <0.3' QuickCheck: ! '>=2.8 && <2.11' all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' - '0.1.0.3' - '0.1.1.0' author: Aden Grue latest: '0.1.1.0' description-type: haddock description: ! 'The proto-lens-arbitrary allows generating arbitrary messages for use with QuickCheck.' license-name: BSD3
f72449c67b4e3fd90be4fdc1c821b98c937c91b9
.circleci/config.yml
.circleci/config.yml
version: 2 jobs: jdk6: docker: - image: openjdk:6-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk7: docker: - image: openjdk:7-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava7 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk8: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk8: docker: - image: openjdk:9.0.4-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava9 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' coverage: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw jacoco:prepare-agent test jacoco:report coveralls:report -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -DrepoToken=$COVERALLS_REPO_TOKEN -pl '!byte-buddy-gradle-plugin' workflows: version: 2 build_all: jobs: - jdk6 - jdk7 - jdk8 - coverage: requires: - jdk6 - jdk7 - jdk8
version: 2 jobs: jdk6: docker: - image: openjdk:6-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk7: docker: - image: openjdk:7-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava7 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk8: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' coverage: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw jacoco:prepare-agent test jacoco:report coveralls:report -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -DrepoToken=$COVERALLS_REPO_TOKEN -pl '!byte-buddy-gradle-plugin' workflows: version: 2 build_all: jobs: - jdk6 - jdk7 - jdk8 - coverage: requires: - jdk6 - jdk7 - jdk8
Remove JDK 9 build from Circle due to Docker image problems.
Remove JDK 9 build from Circle due to Docker image problems.
YAML
apache-2.0
raphw/byte-buddy,DALDEI/byte-buddy,raphw/byte-buddy,raphw/byte-buddy,CodingFabian/byte-buddy
yaml
## Code Before: version: 2 jobs: jdk6: docker: - image: openjdk:6-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk7: docker: - image: openjdk:7-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava7 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk8: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk8: docker: - image: openjdk:9.0.4-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava9 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' coverage: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw jacoco:prepare-agent test jacoco:report coveralls:report -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -DrepoToken=$COVERALLS_REPO_TOKEN -pl '!byte-buddy-gradle-plugin' workflows: version: 2 build_all: jobs: - jdk6 - jdk7 - jdk8 - coverage: requires: - jdk6 - jdk7 - jdk8 ## Instruction: Remove JDK 9 build from Circle due to Docker image problems. ## Code After: version: 2 jobs: jdk6: docker: - image: openjdk:6-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk7: docker: - image: openjdk:7-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava7 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' jdk8: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw verify -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -pl '!byte-buddy-gradle-plugin' coverage: docker: - image: openjdk:8-jdk steps: - checkout - run: ./mvnw jacoco:prepare-agent test jacoco:report coveralls:report -Pintegration -Pjava8 -Dnet.bytebuddy.test.ci=true -DrepoToken=$COVERALLS_REPO_TOKEN -pl '!byte-buddy-gradle-plugin' workflows: version: 2 build_all: jobs: - jdk6 - jdk7 - jdk8 - coverage: requires: - jdk6 - jdk7 - jdk8
3e8643dcddca6e4d3370ea7fe0bbdbebaaedd0e6
test/fixtures/cookbooks/install_varnish/recipes/full_stack.rb
test/fixtures/cookbooks/install_varnish/recipes/full_stack.rb
apt_update include_recipe 'yum-epel' include_recipe 'varnish::default' # Set up nginx first since it likes to start listening on port 80 during install include_recipe "#{cookbook_name}::_nginx" package 'varnish' service 'varnish' do action [:enable, :start] end varnish_config 'default' do listen_address '0.0.0.0' listen_port 80 storage 'malloc' malloc_percent 33 end vcl_template 'default.vcl' do source 'default.vcl.erb' variables( config: { backend_host: '127.0.0.1', backend_port: '8080', } ) end
apt_update 'full_stack' include_recipe 'yum-epel' include_recipe 'varnish::default' # Set up nginx first since it likes to start listening on port 80 during install include_recipe "#{cookbook_name}::_nginx" package 'varnish' service 'varnish' do action [:enable, :start] end varnish_config 'default' do listen_address '0.0.0.0' listen_port 80 storage 'malloc' malloc_percent 33 end vcl_template 'default.vcl' do source 'default.vcl.erb' variables( config: { backend_host: '127.0.0.1', backend_port: '8080', } ) end
Fix tests for apt platforms
Fix tests for apt platforms
Ruby
apache-2.0
rackspace-cookbooks/varnish,rackspace-cookbooks/varnish,rackspace-cookbooks/varnish
ruby
## Code Before: apt_update include_recipe 'yum-epel' include_recipe 'varnish::default' # Set up nginx first since it likes to start listening on port 80 during install include_recipe "#{cookbook_name}::_nginx" package 'varnish' service 'varnish' do action [:enable, :start] end varnish_config 'default' do listen_address '0.0.0.0' listen_port 80 storage 'malloc' malloc_percent 33 end vcl_template 'default.vcl' do source 'default.vcl.erb' variables( config: { backend_host: '127.0.0.1', backend_port: '8080', } ) end ## Instruction: Fix tests for apt platforms ## Code After: apt_update 'full_stack' include_recipe 'yum-epel' include_recipe 'varnish::default' # Set up nginx first since it likes to start listening on port 80 during install include_recipe "#{cookbook_name}::_nginx" package 'varnish' service 'varnish' do action [:enable, :start] end varnish_config 'default' do listen_address '0.0.0.0' listen_port 80 storage 'malloc' malloc_percent 33 end vcl_template 'default.vcl' do source 'default.vcl.erb' variables( config: { backend_host: '127.0.0.1', backend_port: '8080', } ) end
ed8045280f410332c71e47a831965a8c66f6921d
docs/BETA_CHANGELOG.md
docs/BETA_CHANGELOG.md
* Ensure that tapping /sign_up or /log_in from a webview doesn't push a new webview. - 1aurabrown * Make registration for push notifications work on iOS 8 and up and save devices of both trial and registered users on the server. - alloy * Tapping bid button on an artwork uses new /auctions/ route - orta * Ensure consistent access to the keychain throughout the ARUserManager - orta * Fair Artists links in Martsy outside of a fair will resolve correctly to their fair - orta * Fix crash log breadcrumb logging. - alloy * Zoom artwork to fullscreen when changing orientation on iPad from portrait to landscape. - alloy
* Use App ID Prefix for keychain access group. - alloy ## 2.0.1 (2015.06.25) * Ensure that tapping /sign_up or /log_in from a webview doesn't push a new webview. - 1aurabrown * Make registration for push notifications work on iOS 8 and up and save devices of both trial and registered users on the server. - alloy * Tapping bid button on an artwork uses new /auctions/ route - orta * Ensure consistent access to the keychain throughout the ARUserManager - orta * Fair Artists links in Martsy outside of a fair will resolve correctly to their fair - orta * Fix crash log breadcrumb logging. - alloy * Zoom artwork to fullscreen when changing orientation on iPad from portrait to landscape. - alloy
Document App ID Prefix for keychain access group.
[CHANGELOG] Document App ID Prefix for keychain access group.
Markdown
mit
ichu501/eigen,mbogh/eigen,zhuzhengwei/eigen,orta/eigen,ppamorim/eigen,gaurav1981/eigen,liduanw/eigen,ACChe/eigen,artsy/eigen,Shawn-WangDapeng/eigen,liduanw/eigen,mbogh/eigen,neonichu/eigen,TribeMedia/eigen,xxclouddd/eigen,Havi4/eigen,ACChe/eigen,TribeMedia/eigen,artsy/eigen,neonichu/eigen,foxsofter/eigen,ashkan18/eigen,artsy/eigen,Havi4/eigen,srrvnn/eigen,foxsofter/eigen,xxclouddd/eigen,ACChe/eigen,xxclouddd/eigen,ppamorim/eigen,srrvnn/eigen,foxsofter/eigen,ichu501/eigen,srrvnn/eigen,liduanw/eigen,artsy/eigen,TribeMedia/eigen,ayunav/eigen,orta/eigen,ayunav/eigen,Havi4/eigen,Shawn-WangDapeng/eigen,xxclouddd/eigen,zhuzhengwei/eigen,TribeMedia/eigen,gaurav1981/eigen,zhuzhengwei/eigen,zhuzhengwei/eigen,ichu501/eigen,foxsofter/eigen,ayunav/eigen,artsy/eigen,mbogh/eigen,xxclouddd/eigen,liduanw/eigen,Shawn-WangDapeng/eigen,TribeMedia/eigen,orta/eigen,orta/eigen,ppamorim/eigen,ashkan18/eigen,ACChe/eigen,Shawn-WangDapeng/eigen,srrvnn/eigen,Shawn-WangDapeng/eigen,ppamorim/eigen,Havi4/eigen,ichu501/eigen,gaurav1981/eigen,neonichu/eigen,foxsofter/eigen,artsy/eigen,ashkan18/eigen,gaurav1981/eigen,neonichu/eigen,liduanw/eigen,ayunav/eigen,ACChe/eigen,ashkan18/eigen,gaurav1981/eigen,ichu501/eigen,srrvnn/eigen,artsy/eigen,ashkan18/eigen,neonichu/eigen,ayunav/eigen,mbogh/eigen
markdown
## Code Before: * Ensure that tapping /sign_up or /log_in from a webview doesn't push a new webview. - 1aurabrown * Make registration for push notifications work on iOS 8 and up and save devices of both trial and registered users on the server. - alloy * Tapping bid button on an artwork uses new /auctions/ route - orta * Ensure consistent access to the keychain throughout the ARUserManager - orta * Fair Artists links in Martsy outside of a fair will resolve correctly to their fair - orta * Fix crash log breadcrumb logging. - alloy * Zoom artwork to fullscreen when changing orientation on iPad from portrait to landscape. - alloy ## Instruction: [CHANGELOG] Document App ID Prefix for keychain access group. ## Code After: * Use App ID Prefix for keychain access group. - alloy ## 2.0.1 (2015.06.25) * Ensure that tapping /sign_up or /log_in from a webview doesn't push a new webview. - 1aurabrown * Make registration for push notifications work on iOS 8 and up and save devices of both trial and registered users on the server. - alloy * Tapping bid button on an artwork uses new /auctions/ route - orta * Ensure consistent access to the keychain throughout the ARUserManager - orta * Fair Artists links in Martsy outside of a fair will resolve correctly to their fair - orta * Fix crash log breadcrumb logging. - alloy * Zoom artwork to fullscreen when changing orientation on iPad from portrait to landscape. - alloy
dea751ad7529ea196099ec86632968aff1f4e368
README.md
README.md
```bash git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . ./fits/build.rb ./interactive/build.rb hem server open http://localhost:9294/ ``` ### Bootstrapping an Ubuntu machine from scratch ##### Install Node.js ```bash sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update && sudo apt-get dist-upgrade -y sudo apt-get install curl git python-software-properties python build-essential -y sudo apt-get install nodejs -y ``` ##### Install Ruby ```bash curl -L https://get.rvm.io | bash source ~/.bash_profile rvm install 1.9.3 && source ~/.bash_profile && rvm use 1.9.3 --default ``` ##### Setup Galaxy Zoo ```bash echo 'PATH="./node_modules/.bin:${PATH}"' >> ~/.bash_profile echo 'export PATH' >> ~/.bash_profile source ~/.bash_profile git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . hem server open http://localhost:9294 ``` Depending on your browser, you may have to confirm a security exception to allow a self-signed SSL certificate for dev.zooniverse.org
```bash git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . ./fits/build.rb ./interactive/build.rb hem server open http://localhost:9294/ ``` ### Bootstrapping an Ubuntu machine from scratch ##### Install Node.js ```bash sudo apt-get install curl git python-software-properties python build-essential -y sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update && sudo apt-get dist-upgrade -y sudo apt-get install nodejs -y ``` ##### Install Ruby ```bash curl -L https://get.rvm.io | bash source ~/.bash_profile rvm install 1.9.3 && source ~/.bash_profile && rvm use 1.9.3 --default ``` ##### Setup Galaxy Zoo ```bash echo 'PATH="./node_modules/.bin:${PATH}"' >> ~/.bash_profile echo 'export PATH' >> ~/.bash_profile source ~/.bash_profile git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . hem server open http://localhost:9294 ``` Depending on your browser, you may have to confirm a security exception to allow a self-signed SSL certificate for dev.zooniverse.org
Fix Error in Ubuntu Setup Instructions
Fix Error in Ubuntu Setup Instructions
Markdown
apache-2.0
alexbfree/Galaxy-Zoo,murraycu/Galaxy-Zoo,zooniverse/Galaxy-Zoo,zooniverse/Galaxy-Zoo,murraycu/Galaxy-Zoo,willettk/Galaxy-Zoo,willettk/Galaxy-Zoo,alexbfree/Galaxy-Zoo,zooniverse/Galaxy-Zoo,willettk/Galaxy-Zoo,murraycu/Galaxy-Zoo,alexbfree/Galaxy-Zoo
markdown
## Code Before: ```bash git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . ./fits/build.rb ./interactive/build.rb hem server open http://localhost:9294/ ``` ### Bootstrapping an Ubuntu machine from scratch ##### Install Node.js ```bash sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update && sudo apt-get dist-upgrade -y sudo apt-get install curl git python-software-properties python build-essential -y sudo apt-get install nodejs -y ``` ##### Install Ruby ```bash curl -L https://get.rvm.io | bash source ~/.bash_profile rvm install 1.9.3 && source ~/.bash_profile && rvm use 1.9.3 --default ``` ##### Setup Galaxy Zoo ```bash echo 'PATH="./node_modules/.bin:${PATH}"' >> ~/.bash_profile echo 'export PATH' >> ~/.bash_profile source ~/.bash_profile git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . hem server open http://localhost:9294 ``` Depending on your browser, you may have to confirm a security exception to allow a self-signed SSL certificate for dev.zooniverse.org ## Instruction: Fix Error in Ubuntu Setup Instructions ## Code After: ```bash git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . ./fits/build.rb ./interactive/build.rb hem server open http://localhost:9294/ ``` ### Bootstrapping an Ubuntu machine from scratch ##### Install Node.js ```bash sudo apt-get install curl git python-software-properties python build-essential -y sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update && sudo apt-get dist-upgrade -y sudo apt-get install nodejs -y ``` ##### Install Ruby ```bash curl -L https://get.rvm.io | bash source ~/.bash_profile rvm install 1.9.3 && source ~/.bash_profile && rvm use 1.9.3 --default ``` ##### Setup Galaxy Zoo ```bash echo 'PATH="./node_modules/.bin:${PATH}"' >> ~/.bash_profile echo 'export PATH' >> ~/.bash_profile source ~/.bash_profile git clone https://github.com/zooniverse/Galaxy-Zoo.git cd Galaxy-Zoo npm install . hem server open http://localhost:9294 ``` Depending on your browser, you may have to confirm a security exception to allow a self-signed SSL certificate for dev.zooniverse.org
b6d25525ade998e7dab256dbf576fc04e2f0bcba
README.md
README.md
rnacentral-webcode ================== Django code powering the RNAcentral portal
rnacentral-webcode ================== Django code powering the RNAcentral portal [![Build Status](https://travis-ci.org/RNAcentral/rnacentral-webcode.svg?branch=django)](https://travis-ci.org/RNAcentral/rnacentral-webcode)
Add Travis badge to Readme
Add Travis badge to Readme
Markdown
apache-2.0
RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode
markdown
## Code Before: rnacentral-webcode ================== Django code powering the RNAcentral portal ## Instruction: Add Travis badge to Readme ## Code After: rnacentral-webcode ================== Django code powering the RNAcentral portal [![Build Status](https://travis-ci.org/RNAcentral/rnacentral-webcode.svg?branch=django)](https://travis-ci.org/RNAcentral/rnacentral-webcode)
2f2ebdffa25eca60540de6e15500ae99c4900526
comparison/src/c_xxhash.rs
comparison/src/c_xxhash.rs
mod ffi { use libc::{c_void, size_t, uint32_t, uint64_t}; #[allow(non_camel_case_types)] type XXH32_hash_t = uint32_t; #[allow(non_camel_case_types)] type XXH64_hash_t = uint64_t; extern "C" { pub fn XXH32(input: *const c_void, length: size_t, seed: uint32_t) -> XXH32_hash_t; pub fn XXH64(input: *const c_void, length: size_t, seed: uint64_t) -> XXH64_hash_t; } } pub fn hash32(data: &[u8], seed: u32) -> u32 { unsafe { ffi::XXH32(data.as_ptr() as *const libc::c_void, data.len(), seed) } } pub fn hash64(data: &[u8], seed: u64) -> u64 { unsafe { ffi::XXH64(data.as_ptr() as *const libc::c_void, data.len(), seed) } }
mod ffi { use libc::{c_void, size_t}; #[allow(non_camel_case_types)] type XXH32_hash_t = u32; #[allow(non_camel_case_types)] type XXH64_hash_t = u64; extern "C" { pub fn XXH32(input: *const c_void, length: size_t, seed: u32) -> XXH32_hash_t; pub fn XXH64(input: *const c_void, length: size_t, seed: u64) -> XXH64_hash_t; } } pub fn hash32(data: &[u8], seed: u32) -> u32 { unsafe { ffi::XXH32(data.as_ptr() as *const libc::c_void, data.len(), seed) } } pub fn hash64(data: &[u8], seed: u64) -> u64 { unsafe { ffi::XXH64(data.as_ptr() as *const libc::c_void, data.len(), seed) } }
Remove usages of deprecated libc types
Remove usages of deprecated libc types
Rust
mit
shepmaster/twox-hash
rust
## Code Before: mod ffi { use libc::{c_void, size_t, uint32_t, uint64_t}; #[allow(non_camel_case_types)] type XXH32_hash_t = uint32_t; #[allow(non_camel_case_types)] type XXH64_hash_t = uint64_t; extern "C" { pub fn XXH32(input: *const c_void, length: size_t, seed: uint32_t) -> XXH32_hash_t; pub fn XXH64(input: *const c_void, length: size_t, seed: uint64_t) -> XXH64_hash_t; } } pub fn hash32(data: &[u8], seed: u32) -> u32 { unsafe { ffi::XXH32(data.as_ptr() as *const libc::c_void, data.len(), seed) } } pub fn hash64(data: &[u8], seed: u64) -> u64 { unsafe { ffi::XXH64(data.as_ptr() as *const libc::c_void, data.len(), seed) } } ## Instruction: Remove usages of deprecated libc types ## Code After: mod ffi { use libc::{c_void, size_t}; #[allow(non_camel_case_types)] type XXH32_hash_t = u32; #[allow(non_camel_case_types)] type XXH64_hash_t = u64; extern "C" { pub fn XXH32(input: *const c_void, length: size_t, seed: u32) -> XXH32_hash_t; pub fn XXH64(input: *const c_void, length: size_t, seed: u64) -> XXH64_hash_t; } } pub fn hash32(data: &[u8], seed: u32) -> u32 { unsafe { ffi::XXH32(data.as_ptr() as *const libc::c_void, data.len(), seed) } } pub fn hash64(data: &[u8], seed: u64) -> u64 { unsafe { ffi::XXH64(data.as_ptr() as *const libc::c_void, data.len(), seed) } }
d386274a06fca7326caa64c567b031d62662cf91
lab_members/templates/lab_members/scientist_list.html
lab_members/templates/lab_members/scientist_list.html
{% extends CMS|yesno:"base.html,lab_members/base.html,lab_members/base.html" %} {% load sekizai_tags staticfiles %} {% block content %} {% addtoblock "css" strip %} <link rel="stylesheet" type="text/css" href="{% static 'lab_members/app.css' %}"> {% endaddtoblock %} <div class="container"> <h1 class="text-center gallery-heading">Lab Members</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in current_list %} {% include "lab_members/_scientist_list_item.html" %} {% empty %} <p>Need to add lab members!</p> {% endfor %} </div> </div> <hr> {% if alumni_list %} <h1 class="text-center">Lab Alumni</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in alumni_list %} {% include "lab_members/_scientist_list_item.html" %} {% endfor %} </div> </div> {% endif %} </div> {% endblock content %}
{% extends CMS|yesno:"base.html,lab_members/base.html,lab_members/base.html" %} {% load sekizai_tags staticfiles %} {% block content %} {% addtoblock "css" strip %} <link rel="stylesheet" type="text/css" href="{% static 'lab_members/app.css' %}"> {% endaddtoblock %} <div class="container"> <h1 class="text-center gallery-heading">Lab Members</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in current_list %} {% include "lab_members/_scientist_list_item.html" %} {% empty %} <p>Need to add lab members!</p> {% endfor %} </div> </div> <hr> {% if alumni_list %} <h1 class="text-center gallery-heading">Lab Alumni</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in alumni_list %} {% include "lab_members/_scientist_list_item.html" %} {% endfor %} </div> </div> {% endif %} </div> {% endblock content %}
Increase margin at bottom of Lab Alumni gallery heading
Increase margin at bottom of Lab Alumni gallery heading
HTML
bsd-3-clause
mfcovington/django-lab-members,mfcovington/django-lab-members,mfcovington/django-lab-members
html
## Code Before: {% extends CMS|yesno:"base.html,lab_members/base.html,lab_members/base.html" %} {% load sekizai_tags staticfiles %} {% block content %} {% addtoblock "css" strip %} <link rel="stylesheet" type="text/css" href="{% static 'lab_members/app.css' %}"> {% endaddtoblock %} <div class="container"> <h1 class="text-center gallery-heading">Lab Members</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in current_list %} {% include "lab_members/_scientist_list_item.html" %} {% empty %} <p>Need to add lab members!</p> {% endfor %} </div> </div> <hr> {% if alumni_list %} <h1 class="text-center">Lab Alumni</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in alumni_list %} {% include "lab_members/_scientist_list_item.html" %} {% endfor %} </div> </div> {% endif %} </div> {% endblock content %} ## Instruction: Increase margin at bottom of Lab Alumni gallery heading ## Code After: {% extends CMS|yesno:"base.html,lab_members/base.html,lab_members/base.html" %} {% load sekizai_tags staticfiles %} {% block content %} {% addtoblock "css" strip %} <link rel="stylesheet" type="text/css" href="{% static 'lab_members/app.css' %}"> {% endaddtoblock %} <div class="container"> <h1 class="text-center gallery-heading">Lab Members</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in current_list %} {% include "lab_members/_scientist_list_item.html" %} {% empty %} <p>Need to add lab members!</p> {% endfor %} </div> </div> <hr> {% if alumni_list %} <h1 class="text-center gallery-heading">Lab Alumni</h1> <div class="container-fluid"> <div id="lab-members" class="row"> {% for scientist in alumni_list %} {% include "lab_members/_scientist_list_item.html" %} {% endfor %} </div> </div> {% endif %} </div> {% endblock content %}
b43f8e8427a9e71012260d82f7cc05d63809bcf9
OrcTests/test_data/performance/distrib/vertex/experimental-conditions.csv
OrcTests/test_data/performance/distrib/vertex/experimental-conditions.csv
Number of vertices [numVertices],Probability of edge [probEdge],Cluster size [dOrcNumRuntimes] 12,0.33,1
Number of vertices [numVertices],Probability of edge [probEdge],Cluster size [dOrcNumRuntimes] 120,0.33,28 120,0.33,24 120,0.33,20 120,0.33,16 120,0.33,11 120,0.33,6 120,0.33,4 120,0.33,1
Add more test conditions for vertex tests
Add more test conditions for vertex tests
CSV
bsd-3-clause
orc-lang/orc,orc-lang/orc,orc-lang/orc,orc-lang/orc,orc-lang/orc
csv
## Code Before: Number of vertices [numVertices],Probability of edge [probEdge],Cluster size [dOrcNumRuntimes] 12,0.33,1 ## Instruction: Add more test conditions for vertex tests ## Code After: Number of vertices [numVertices],Probability of edge [probEdge],Cluster size [dOrcNumRuntimes] 120,0.33,28 120,0.33,24 120,0.33,20 120,0.33,16 120,0.33,11 120,0.33,6 120,0.33,4 120,0.33,1
e1ebeba3881444331e3e509e4f9c6d22a3277fda
app/controllers/questions_controller.rb
app/controllers/questions_controller.rb
class QuestionsController < ApplicationController def create @topic = Topic.find(params[:topic_id]) @question = @topic.questions.build(question_params) respond_to do |format| if @question.save format.js format.html { redirect_to topic_path(@topic)} else format.js { render "create_errors.js"} format.html { redirect_to topic_path(@topic), notice: "question cannot be blank" } end end end def update @question = Question.find(params[:id]) @topic = @question.topic respond_to do |format| if @question.update_attributes(question_params) format.js {render "answer.js"} format.html { redirect_to topic_path(@topic)} else format.js{ render :_question} format.html { render :_question} end end end def destroy @question = Question.find(params[:id]) @topic = @question.topic @question.destroy @questions = @topic.questions @creator = true respond_to do |format| format.js format.html {redirect_to topic_path(@topic)} end end private def question_params params.require(:question).permit(:content, :answer) end end
class QuestionsController < ApplicationController def create @topic = Topic.find(params[:topic_id]) @question = @topic.questions.build(question_params) respond_to do |format| if @question.save format.js format.html { redirect_to topic_path(@topic)} else format.js { render "create_errors.js"} format.html { redirect_to topic_path(@topic), notice: "question cannot be blank" } end end end def update @question = Question.find(params[:id]) @topic = @question.topic respond_to do |format| if @question.update_attributes(question_params) format.js {render "answer.js"} format.html { redirect_to topic_path(@topic)} else format.js{ render :_question} format.html { render :_question} end end end def destroy @question = Question.find(params[:id]) @topic = @question.topic @question.destroy @questions = @topic.questions @creator = true respond_to do |format| format.js format.html {redirect_to topic_path(@topic)} end end def upvote @question = Question.find(params[:id]) @user = current_user if @user.voted_for? @question @question.unliked_by @user else @question.liked_by @user end redirect_to @question.topic end private def question_params params.require(:question).permit(:content, :answer) end end
Add upvote action to questions controller
Add upvote action to questions controller
Ruby
mit
chi-dragonflies-2015/FAQrator,chi-dragonflies-2015/FAQrator,chi-dragonflies-2015/FAQrator
ruby
## Code Before: class QuestionsController < ApplicationController def create @topic = Topic.find(params[:topic_id]) @question = @topic.questions.build(question_params) respond_to do |format| if @question.save format.js format.html { redirect_to topic_path(@topic)} else format.js { render "create_errors.js"} format.html { redirect_to topic_path(@topic), notice: "question cannot be blank" } end end end def update @question = Question.find(params[:id]) @topic = @question.topic respond_to do |format| if @question.update_attributes(question_params) format.js {render "answer.js"} format.html { redirect_to topic_path(@topic)} else format.js{ render :_question} format.html { render :_question} end end end def destroy @question = Question.find(params[:id]) @topic = @question.topic @question.destroy @questions = @topic.questions @creator = true respond_to do |format| format.js format.html {redirect_to topic_path(@topic)} end end private def question_params params.require(:question).permit(:content, :answer) end end ## Instruction: Add upvote action to questions controller ## Code After: class QuestionsController < ApplicationController def create @topic = Topic.find(params[:topic_id]) @question = @topic.questions.build(question_params) respond_to do |format| if @question.save format.js format.html { redirect_to topic_path(@topic)} else format.js { render "create_errors.js"} format.html { redirect_to topic_path(@topic), notice: "question cannot be blank" } end end end def update @question = Question.find(params[:id]) @topic = @question.topic respond_to do |format| if @question.update_attributes(question_params) format.js {render "answer.js"} format.html { redirect_to topic_path(@topic)} else format.js{ render :_question} format.html { render :_question} end end end def destroy @question = Question.find(params[:id]) @topic = @question.topic @question.destroy @questions = @topic.questions @creator = true respond_to do |format| format.js format.html {redirect_to topic_path(@topic)} end end def upvote @question = Question.find(params[:id]) @user = current_user if @user.voted_for? @question @question.unliked_by @user else @question.liked_by @user end redirect_to @question.topic end private def question_params params.require(:question).permit(:content, :answer) end end
96c9f29da989bc28da1993ca10ea4f6e7be8a66f
README.md
README.md
Idk. Let [this page](http://shannoncrabill.com/how-many-days-until-halloween/) do the counting for you! ![Boo!](/img/screenshot.png) ## Contributing To keep in the spirit of [Hacktoberfest](https://hacktoberfest.digitalocean.com/) I'm opening this up to the Github community. See a [list of current issues](https://github.com/scrabill/how-many-days-until-halloween/issues) or suggest your own!
Idk. Let [this page](http://shannoncrabill.com/how-many-days-until-halloween/) do the counting for you! ![Boo!](/img/screenshot.png) ## Update 10/17 Wow! I'm happy to see all the pull requests that are waiting for me to review. I'm working on reviewing all of them, merging where appropriate and providing feedback. I'll keep chugging away and will plan to have all changes push lived by the end of the week. In the meantime... ## Contributing To keep in the spirit of [Hacktoberfest](https://hacktoberfest.digitalocean.com/) I'm opening this up to the Github community. See a [list of current issues](https://github.com/scrabill/how-many-days-until-halloween/issues) or suggest your own!
Add update message to readme
Add update message to readme
Markdown
mit
KevinBruland/how-many-days-until-halloween,scrabill/how-many-days-until-halloween,scrabill/how-many-days-until-halloween,KevinBruland/how-many-days-until-halloween
markdown
## Code Before: Idk. Let [this page](http://shannoncrabill.com/how-many-days-until-halloween/) do the counting for you! ![Boo!](/img/screenshot.png) ## Contributing To keep in the spirit of [Hacktoberfest](https://hacktoberfest.digitalocean.com/) I'm opening this up to the Github community. See a [list of current issues](https://github.com/scrabill/how-many-days-until-halloween/issues) or suggest your own! ## Instruction: Add update message to readme ## Code After: Idk. Let [this page](http://shannoncrabill.com/how-many-days-until-halloween/) do the counting for you! ![Boo!](/img/screenshot.png) ## Update 10/17 Wow! I'm happy to see all the pull requests that are waiting for me to review. I'm working on reviewing all of them, merging where appropriate and providing feedback. I'll keep chugging away and will plan to have all changes push lived by the end of the week. In the meantime... ## Contributing To keep in the spirit of [Hacktoberfest](https://hacktoberfest.digitalocean.com/) I'm opening this up to the Github community. See a [list of current issues](https://github.com/scrabill/how-many-days-until-halloween/issues) or suggest your own!
8eeaa69574ee723a4e3d435140814c5776e97055
trunk/metpy/bl/sim/mos.py
trunk/metpy/bl/sim/mos.py
import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(vw,2),0.25) return us def theta_star(u,v,w,T): ''' Compute the friction temperature, theta_star, from the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' from metpy.bl.turb.fluxes import turb_covar as TC ts = -TC(w,T)/u_star(u,v,w) return ts def obu_length(u,v,w,T): ''' Compute the Obukhov Length, L, using the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' L = N.power(u_star(u,v,w),2)*N.average(T)/(0.4*9.81*theta_star(u,v,w,T)) return L
import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(vw,2),0.25) return us def theta_star(u,v,w,T): ''' Compute the friction temperature, theta_star, from the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' from metpy.bl.turb.fluxes import turb_covar as TC ts = -TC(w,T)/u_star(u,v,w) return ts def obu_length(u,v,w,T): ''' Compute the Obukhov Length, L, using the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' from metpy.constants import g L = N.power(u_star(u,v,w),2)*N.average(T)/(0.4*g*theta_star(u,v,w,T)) return L
Change to import gravity constant from constants file.
Change to import gravity constant from constants file. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@23 150532fb-1d5b-0410-a8ab-efec50f980d4
Python
bsd-3-clause
Unidata/MetPy,dopplershift/MetPy,jrleeman/MetPy,ahaberlie/MetPy,ShawnMurd/MetPy,Unidata/MetPy,ahaberlie/MetPy,deeplycloudy/MetPy,jrleeman/MetPy,ahill818/MetPy,dopplershift/MetPy
python
## Code Before: import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(vw,2),0.25) return us def theta_star(u,v,w,T): ''' Compute the friction temperature, theta_star, from the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' from metpy.bl.turb.fluxes import turb_covar as TC ts = -TC(w,T)/u_star(u,v,w) return ts def obu_length(u,v,w,T): ''' Compute the Obukhov Length, L, using the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' L = N.power(u_star(u,v,w),2)*N.average(T)/(0.4*9.81*theta_star(u,v,w,T)) return L ## Instruction: Change to import gravity constant from constants file. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@23 150532fb-1d5b-0410-a8ab-efec50f980d4 ## Code After: import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(vw,2),0.25) return us def theta_star(u,v,w,T): ''' Compute the friction temperature, theta_star, from the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' from metpy.bl.turb.fluxes import turb_covar as TC ts = -TC(w,T)/u_star(u,v,w) return ts def obu_length(u,v,w,T): ''' Compute the Obukhov Length, L, using the timeseries of the velocity \ components u, v, and w, and temperature (an nD array) ''' from metpy.constants import g L = N.power(u_star(u,v,w),2)*N.average(T)/(0.4*g*theta_star(u,v,w,T)) return L
64c58a0c3f2733d6d35dab50299ddf33a52c8f1c
Tests/Recurly/Resource_Test.php
Tests/Recurly/Resource_Test.php
<?php require_once(__DIR__ . '/../test_helpers.php'); class Recource_Mock_Resource extends Recurly_Resource { protected function getNodeName() { return 'mock'; } protected function getWriteableAttributes() { return array('date', 'bool', 'number', 'array', 'nil', 'string'); } protected function getRequiredAttributes() { return array('required'); } } class Recurly_ResourceTest extends Recurly_TestCase { public function testXml() { $resource = new Recource_Mock_Resource(); $resource->date = new DateTime("@1384202874"); $resource->bool = true; $resource->number = 34; $resource->array = array( 'int' => 1, 'string' => 'foo', ); $resource->nil = null; $resource->string = "Foo & Bar"; $this->assertEquals( "<?xml version=\"1.0\"?>\n<mock><date>2013-11-11T20:47:54+00:00</date><bool>true</bool><number>34</number><array><int>1</int><string>foo</string></array><nil nil=\"nil\"></nil><string>Foo &amp; Bar</string></mock>\n", $resource->xml() ); } }
<?php require_once(__DIR__ . '/../test_helpers.php'); class Mock_Resource extends Recurly_Resource { protected function getNodeName() { return 'mock'; } protected function getWriteableAttributes() { return array('date', 'bool', 'number', 'array', 'nil', 'string'); } protected function getRequiredAttributes() { return array('required'); } } class Recurly_ResourceTest extends Recurly_TestCase { public function testXml() { $resource = new Mock_Resource(); $resource->date = new DateTime("@1384202874"); $resource->bool = true; $resource->number = 34; $resource->array = array( 'int' => 1, 'string' => 'foo', ); $resource->nil = null; $resource->string = "Foo & Bar"; $this->assertEquals( "<?xml version=\"1.0\"?>\n<mock><date>2013-11-11T20:47:54+00:00</date><bool>true</bool><number>34</number><array><int>1</int><string>foo</string></array><nil nil=\"nil\"></nil><string>Foo &amp; Bar</string></mock>\n", $resource->xml() ); } }
Fix the spelling of the class name
Fix the spelling of the class name
PHP
mit
cgerrior/recurly-client-php,phpdave/recurly-client-php,developer-devPHP/recurly-client-php,developer-devPHP/recurly-client-php
php
## Code Before: <?php require_once(__DIR__ . '/../test_helpers.php'); class Recource_Mock_Resource extends Recurly_Resource { protected function getNodeName() { return 'mock'; } protected function getWriteableAttributes() { return array('date', 'bool', 'number', 'array', 'nil', 'string'); } protected function getRequiredAttributes() { return array('required'); } } class Recurly_ResourceTest extends Recurly_TestCase { public function testXml() { $resource = new Recource_Mock_Resource(); $resource->date = new DateTime("@1384202874"); $resource->bool = true; $resource->number = 34; $resource->array = array( 'int' => 1, 'string' => 'foo', ); $resource->nil = null; $resource->string = "Foo & Bar"; $this->assertEquals( "<?xml version=\"1.0\"?>\n<mock><date>2013-11-11T20:47:54+00:00</date><bool>true</bool><number>34</number><array><int>1</int><string>foo</string></array><nil nil=\"nil\"></nil><string>Foo &amp; Bar</string></mock>\n", $resource->xml() ); } } ## Instruction: Fix the spelling of the class name ## Code After: <?php require_once(__DIR__ . '/../test_helpers.php'); class Mock_Resource extends Recurly_Resource { protected function getNodeName() { return 'mock'; } protected function getWriteableAttributes() { return array('date', 'bool', 'number', 'array', 'nil', 'string'); } protected function getRequiredAttributes() { return array('required'); } } class Recurly_ResourceTest extends Recurly_TestCase { public function testXml() { $resource = new Mock_Resource(); $resource->date = new DateTime("@1384202874"); $resource->bool = true; $resource->number = 34; $resource->array = array( 'int' => 1, 'string' => 'foo', ); $resource->nil = null; $resource->string = "Foo & Bar"; $this->assertEquals( "<?xml version=\"1.0\"?>\n<mock><date>2013-11-11T20:47:54+00:00</date><bool>true</bool><number>34</number><array><int>1</int><string>foo</string></array><nil nil=\"nil\"></nil><string>Foo &amp; Bar</string></mock>\n", $resource->xml() ); } }
4b57fbee2dac791f023bc474594245a725366405
.travis.yml
.travis.yml
language: ruby rvm: - 1.9.3 - 2.0.0 - 2.1 env: global: - CODECLIMATE_REPO_TOKEN=b815025e22a9280228206c24a7f8edb076bac1f7889bc1f394669dc908d6b298 matrix: - - CAP_VERSION=3.0 script: "bundle exec rake spec" branches: only: - master
language: ruby rvm: - 1.9.3 - 2.0.0 - 2.1 env: global: - CODECLIMATE_REPO_TOKEN=0aa39b8485a9dd2aa62dbb77b02c90d1b58fa8f62a2dc03f26a304993b5908ae matrix: - - CAP_VERSION=3.0 script: "bundle exec rake spec" branches: only: - master
Update the code climate token
Update the code climate token
YAML
mit
kaizenplatform/capistrano-db-mirror
yaml
## Code Before: language: ruby rvm: - 1.9.3 - 2.0.0 - 2.1 env: global: - CODECLIMATE_REPO_TOKEN=b815025e22a9280228206c24a7f8edb076bac1f7889bc1f394669dc908d6b298 matrix: - - CAP_VERSION=3.0 script: "bundle exec rake spec" branches: only: - master ## Instruction: Update the code climate token ## Code After: language: ruby rvm: - 1.9.3 - 2.0.0 - 2.1 env: global: - CODECLIMATE_REPO_TOKEN=0aa39b8485a9dd2aa62dbb77b02c90d1b58fa8f62a2dc03f26a304993b5908ae matrix: - - CAP_VERSION=3.0 script: "bundle exec rake spec" branches: only: - master
b404b12011dae2933664f5d89018cfb3fd51eebf
app/views/drawings/_drawing.html.haml
app/views/drawings/_drawing.html.haml
.drawings-wrapper{ class: drawings_class } .drawing .image.center-block = link_to (image_tag drawing.image.url(:medium), class:'img-responsive'), drawing_path(drawing) .drawing-bottom .caption .caption-content .drawing-description = drawing.description .user-name Uploaded by: = drawing.user.email .time-ago uploaded = time_ago_in_words drawing.created_at ago .country - if drawing.country.present? drawn in = ISO3166::Country.find_country_by_alpha2(drawing.country).name .drawing-status-pending = drawing.status.upcase
.drawings-wrapper{ class: drawings_class } .drawing .image.center-block = link_to (image_tag drawing.image.url(:medium), class:'img-responsive'), drawing_path(drawing) .drawing-bottom .caption .caption-content .drawing-row %strong = drawing.description .drawing-row %em Uploaded by .user-name = drawing.user.email .drawing-row.time-ago %em Created = time_ago_in_words drawing.created_at ago .drawing-row.time-ago %em Updated = time_ago_in_words drawing.updated_at ago .drawing-row.drawing-status-pending = drawing.status.upcase .drawing-details %h3 Details of Drawing .drawing-row %strong Country Drawn In: - if drawing.country.present? = ISO3166::Country.find_country_by_alpha2(drawing.country).name - else n/a .drawing-row %strong Subject Matter: = drawing.subject_matter .drawing-row %strong Mood Rating: = drawing.mood_rating .artist-details %h3 Details of Artist .drawing-row %strong Age: = drawing.age .drawing-row %strong Gender: = drawing.gender.humanize .drawing-row %strong Context / Story: = drawing.story
Add all form info into view page. Whole page needs UX input but getting the data in there at least.
Add all form info into view page. Whole page needs UX input but getting the data in there at least.
Haml
mit
empowerhack/DrawMyLife-Service,empowerhack/DrawMyLife-Service,empowerhack/DrawMyLife-Service
haml
## Code Before: .drawings-wrapper{ class: drawings_class } .drawing .image.center-block = link_to (image_tag drawing.image.url(:medium), class:'img-responsive'), drawing_path(drawing) .drawing-bottom .caption .caption-content .drawing-description = drawing.description .user-name Uploaded by: = drawing.user.email .time-ago uploaded = time_ago_in_words drawing.created_at ago .country - if drawing.country.present? drawn in = ISO3166::Country.find_country_by_alpha2(drawing.country).name .drawing-status-pending = drawing.status.upcase ## Instruction: Add all form info into view page. Whole page needs UX input but getting the data in there at least. ## Code After: .drawings-wrapper{ class: drawings_class } .drawing .image.center-block = link_to (image_tag drawing.image.url(:medium), class:'img-responsive'), drawing_path(drawing) .drawing-bottom .caption .caption-content .drawing-row %strong = drawing.description .drawing-row %em Uploaded by .user-name = drawing.user.email .drawing-row.time-ago %em Created = time_ago_in_words drawing.created_at ago .drawing-row.time-ago %em Updated = time_ago_in_words drawing.updated_at ago .drawing-row.drawing-status-pending = drawing.status.upcase .drawing-details %h3 Details of Drawing .drawing-row %strong Country Drawn In: - if drawing.country.present? = ISO3166::Country.find_country_by_alpha2(drawing.country).name - else n/a .drawing-row %strong Subject Matter: = drawing.subject_matter .drawing-row %strong Mood Rating: = drawing.mood_rating .artist-details %h3 Details of Artist .drawing-row %strong Age: = drawing.age .drawing-row %strong Gender: = drawing.gender.humanize .drawing-row %strong Context / Story: = drawing.story
b75b35c2e3bf2cf0e23d3e9f9d4af74863643749
packages/de/decimal-literals.yaml
packages/de/decimal-literals.yaml
homepage: https://github.com/leftaroundabout/decimal-literals changelog-type: markdown hash: ab66d26304cb74296ca1f11f05006771efee8c1a7885d2d9e22922101080e62d test-bench-deps: base: ! '>=4 && <5' decimal-literals: -any tasty-hunit: -any tasty: ! '>=0.7' maintainer: (@) jsagemue $ uni-koeln.de synopsis: Preprocessing decimal literals more or less as they are (instead of via fractions) changelog: | # Revision history for decimal-literals ## 0.1.0.0 -- YYYY-mm-dd * First version. Released on an unsuspecting world. basic-deps: base: ! '>=4.8 && <4.12' all-versions: - 0.1.0.0 author: Justus Sagemüller latest: 0.1.0.0 description-type: haddock description: '' license-name: GPL-3.0-only
homepage: https://github.com/leftaroundabout/decimal-literals changelog-type: markdown hash: 4beaadce57285d466570f06989c15ae1da1858eeff7de43e94d015272c8fa36c test-bench-deps: base: ! '>=4 && <5' decimal-literals: -any tasty-hunit: -any tasty: ! '>=0.7' maintainer: (@) jsagemue $ uni-koeln.de synopsis: Preprocessing decimal literals more or less as they are (instead of via fractions) changelog: | # Revision history for decimal-literals ## 0.1.0.0 -- YYYY-mm-dd * First version. Released on an unsuspecting world. basic-deps: base: ! '>=4.8 && <4.14' all-versions: - 0.1.0.0 author: Justus Sagemüller latest: 0.1.0.0 description-type: haddock description: '' license-name: GPL-3.0-only
Update from Hackage at 2019-02-12T19:58:22Z
Update from Hackage at 2019-02-12T19:58:22Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/leftaroundabout/decimal-literals changelog-type: markdown hash: ab66d26304cb74296ca1f11f05006771efee8c1a7885d2d9e22922101080e62d test-bench-deps: base: ! '>=4 && <5' decimal-literals: -any tasty-hunit: -any tasty: ! '>=0.7' maintainer: (@) jsagemue $ uni-koeln.de synopsis: Preprocessing decimal literals more or less as they are (instead of via fractions) changelog: | # Revision history for decimal-literals ## 0.1.0.0 -- YYYY-mm-dd * First version. Released on an unsuspecting world. basic-deps: base: ! '>=4.8 && <4.12' all-versions: - 0.1.0.0 author: Justus Sagemüller latest: 0.1.0.0 description-type: haddock description: '' license-name: GPL-3.0-only ## Instruction: Update from Hackage at 2019-02-12T19:58:22Z ## Code After: homepage: https://github.com/leftaroundabout/decimal-literals changelog-type: markdown hash: 4beaadce57285d466570f06989c15ae1da1858eeff7de43e94d015272c8fa36c test-bench-deps: base: ! '>=4 && <5' decimal-literals: -any tasty-hunit: -any tasty: ! '>=0.7' maintainer: (@) jsagemue $ uni-koeln.de synopsis: Preprocessing decimal literals more or less as they are (instead of via fractions) changelog: | # Revision history for decimal-literals ## 0.1.0.0 -- YYYY-mm-dd * First version. Released on an unsuspecting world. basic-deps: base: ! '>=4.8 && <4.14' all-versions: - 0.1.0.0 author: Justus Sagemüller latest: 0.1.0.0 description-type: haddock description: '' license-name: GPL-3.0-only
96355a918a22e53d0c2ae369aae77b2c7b4b276e
third_party/widevine/cdm/android/widevine_cdm_version.h
third_party/widevine/cdm/android/widevine_cdm_version.h
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Widevine CDM is available. #define WIDEVINE_CDM_AVAILABLE // Indicates that AVC1 decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE // Indicates that AAC decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE #endif // WIDEVINE_CDM_VERSION_H_
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Widevine CDM is available. #define WIDEVINE_CDM_AVAILABLE #endif // WIDEVINE_CDM_VERSION_H_
Remove obsolete defines from Android CDM file.
Remove obsolete defines from Android CDM file. BUG=349185 Review URL: https://codereview.chromium.org/1000863003 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#321407}
C
bsd-3-clause
ltilve/chromium,Chilledheart/chromium,Chilledheart/chromium,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,Fireblend/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,Just-D/chromium-1,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,ltilve/chromium,ltilve/chromium,Just-D/chromium-1,ltilve/chromium,Chilledheart/chromium,Fireblend/chromium-crosswalk
c
## Code Before: // Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Widevine CDM is available. #define WIDEVINE_CDM_AVAILABLE // Indicates that AVC1 decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE // Indicates that AAC decoding is available for ISO BMFF CENC. #define WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE #endif // WIDEVINE_CDM_VERSION_H_ ## Instruction: Remove obsolete defines from Android CDM file. BUG=349185 Review URL: https://codereview.chromium.org/1000863003 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#321407} ## Code After: // Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Widevine CDM is available. #define WIDEVINE_CDM_AVAILABLE #endif // WIDEVINE_CDM_VERSION_H_
91ade227c9c26e788946167b773d87b63f359413
spec/cloudflare/dns_spec.rb
spec/cloudflare/dns_spec.rb
require 'cloudflare/rspec/connection' RSpec.describe Cloudflare::DNS, order: :defined, timeout: 30 do include_context Cloudflare::Zone let(:subdomain) {"dyndns#{Time.now.to_i}"} let(:record) {@record = zone.dns_records.create("A", subdomain, "1.2.3.4")} after do if defined? @record expect(@record.delete).to be_success end end it "can create dns record" do expect(record.type).to be == "A" expect(record.name).to be_start_with subdomain expect(record.content).to be == "1.2.3.4" end context "with existing record" do it "can update dns content" do record.update_content("4.3.2.1") expect(record.content).to be == "4.3.2.1" fetched_record = zone.dns_records.find_by_name(record.name) expect(fetched_record.content).to be == record.content end end end
require 'cloudflare/rspec/connection' RSpec.describe Cloudflare::DNS, order: :defined, timeout: 30 do include_context Cloudflare::Zone let(:subdomain) {"www#{ENV['TRAVIS_JOB_ID']}"} let(:record) {@record = zone.dns_records.create("A", subdomain, "1.2.3.4")} after do if defined? @record expect(@record.delete).to be_success end end it "can create dns record" do expect(record.type).to be == "A" expect(record.name).to be_start_with subdomain expect(record.content).to be == "1.2.3.4" end context "with existing record" do it "can update dns content" do record.update_content("4.3.2.1") expect(record.content).to be == "4.3.2.1" fetched_record = zone.dns_records.find_by_name(record.name) expect(fetched_record.content).to be == record.content end end end
Use TRAVIS_JOB_ID as part of subdomain.
Use TRAVIS_JOB_ID as part of subdomain.
Ruby
mit
b4k3r/cloudflare
ruby
## Code Before: require 'cloudflare/rspec/connection' RSpec.describe Cloudflare::DNS, order: :defined, timeout: 30 do include_context Cloudflare::Zone let(:subdomain) {"dyndns#{Time.now.to_i}"} let(:record) {@record = zone.dns_records.create("A", subdomain, "1.2.3.4")} after do if defined? @record expect(@record.delete).to be_success end end it "can create dns record" do expect(record.type).to be == "A" expect(record.name).to be_start_with subdomain expect(record.content).to be == "1.2.3.4" end context "with existing record" do it "can update dns content" do record.update_content("4.3.2.1") expect(record.content).to be == "4.3.2.1" fetched_record = zone.dns_records.find_by_name(record.name) expect(fetched_record.content).to be == record.content end end end ## Instruction: Use TRAVIS_JOB_ID as part of subdomain. ## Code After: require 'cloudflare/rspec/connection' RSpec.describe Cloudflare::DNS, order: :defined, timeout: 30 do include_context Cloudflare::Zone let(:subdomain) {"www#{ENV['TRAVIS_JOB_ID']}"} let(:record) {@record = zone.dns_records.create("A", subdomain, "1.2.3.4")} after do if defined? @record expect(@record.delete).to be_success end end it "can create dns record" do expect(record.type).to be == "A" expect(record.name).to be_start_with subdomain expect(record.content).to be == "1.2.3.4" end context "with existing record" do it "can update dns content" do record.update_content("4.3.2.1") expect(record.content).to be == "4.3.2.1" fetched_record = zone.dns_records.find_by_name(record.name) expect(fetched_record.content).to be == record.content end end end
c4758430ac815de983cfd350dcabe2fa2a5c7d1a
.travis.yml
.travis.yml
language: python python: - "2.7" - "3.2" - "3.3" before_install: - sudo apt-get install -qq python-pyside - sudo apt-get install -qq python-qt4 - sudo apt-get install -qq python3-pyside - sudo apt-get install -qq python3-pyqt4 - export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.7/dist-packages/" - sudo python setup.py install - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: - python test.py --PyQt - python test.py --PySide
language: python python: - "2.7" - "3.2" - "3.3" before_install: - sudo apt-get install -qq python-pyside - sudo apt-get install -qq python-qt4 - sudo apt-get install -qq python3-pyside - sudo apt-get install -qq python3-pyqt4 - sudo pip-2.7 install pygments - sudo pip-3.2 install pygments - sudo pip-3.3 install pygments - export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.7/dist-packages/:/usr/lib/python3.3/dist-packages/:/usr/lib/python3.2/dist-packages/" - sudo python setup.py install - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: - python test.py --PyQt - python test.py --PySide
Add python 3.2 and 3.3 to python path. Install pygments foreach interpreter
Add python 3.2 and 3.3 to python path. Install pygments foreach interpreter
YAML
mit
zwadar/pyqode.core,pyQode/pyqode.core,pyQode/pyqode.core
yaml
## Code Before: language: python python: - "2.7" - "3.2" - "3.3" before_install: - sudo apt-get install -qq python-pyside - sudo apt-get install -qq python-qt4 - sudo apt-get install -qq python3-pyside - sudo apt-get install -qq python3-pyqt4 - export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.7/dist-packages/" - sudo python setup.py install - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: - python test.py --PyQt - python test.py --PySide ## Instruction: Add python 3.2 and 3.3 to python path. Install pygments foreach interpreter ## Code After: language: python python: - "2.7" - "3.2" - "3.3" before_install: - sudo apt-get install -qq python-pyside - sudo apt-get install -qq python-qt4 - sudo apt-get install -qq python3-pyside - sudo apt-get install -qq python3-pyqt4 - sudo pip-2.7 install pygments - sudo pip-3.2 install pygments - sudo pip-3.3 install pygments - export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.7/dist-packages/:/usr/lib/python3.3/dist-packages/:/usr/lib/python3.2/dist-packages/" - sudo python setup.py install - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: - python test.py --PyQt - python test.py --PySide
4b54d1472a57ad4d45293ec7bdce9a0ed9746bde
ideasbox/mixins.py
ideasbox/mixins.py
from django.views.generic import ListView class ByTagListView(ListView): def get_queryset(self): qs = super(ByTagListView, self).get_queryset() if 'tag' in self.kwargs: qs = qs.filter(tags__slug__in=[self.kwargs['tag']]) return qs def get_context_data(self, **kwargs): context = super(ByTagListView, self).get_context_data(**kwargs) context['tag'] = self.kwargs.get('tag') return context
from django.views.generic import ListView from taggit.models import Tag class ByTagListView(ListView): def get_queryset(self): qs = super(ByTagListView, self).get_queryset() if 'tag' in self.kwargs: qs = qs.filter(tags__slug__in=[self.kwargs['tag']]) return qs def get_context_data(self, **kwargs): context = super(ByTagListView, self).get_context_data(**kwargs) context['tag'] = Tag.objects.get(slug=self.kwargs.get('tag')) return context
Use tag name not slug in tag page title
Use tag name not slug in tag page title
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan,Lcaracol/ideasbox.lan,Lcaracol/ideasbox.lan,ideascube/ideascube
python
## Code Before: from django.views.generic import ListView class ByTagListView(ListView): def get_queryset(self): qs = super(ByTagListView, self).get_queryset() if 'tag' in self.kwargs: qs = qs.filter(tags__slug__in=[self.kwargs['tag']]) return qs def get_context_data(self, **kwargs): context = super(ByTagListView, self).get_context_data(**kwargs) context['tag'] = self.kwargs.get('tag') return context ## Instruction: Use tag name not slug in tag page title ## Code After: from django.views.generic import ListView from taggit.models import Tag class ByTagListView(ListView): def get_queryset(self): qs = super(ByTagListView, self).get_queryset() if 'tag' in self.kwargs: qs = qs.filter(tags__slug__in=[self.kwargs['tag']]) return qs def get_context_data(self, **kwargs): context = super(ByTagListView, self).get_context_data(**kwargs) context['tag'] = Tag.objects.get(slug=self.kwargs.get('tag')) return context
13b43dbe2c43ef73bb222887b18ac74a2b63fa9b
SplitView/SplitViewController.swift
SplitView/SplitViewController.swift
// // SplitViewController.swift // SplitView // // Created by phatblat on 9/4/14. // Copyright (c) 2014 phatblat. All rights reserved. // import UIKit class SplitViewController: UISplitViewController { override func viewDidLoad() { super.viewDidLoad() } }
// // SplitViewController.swift // SplitView // // Created by phatblat on 9/4/14. // Copyright (c) 2014 phatblat. All rights reserved. // import UIKit class SplitViewController: UISplitViewController { override func viewDidLoad() { super.viewDidLoad() delegate = self } } // MARK: - SplitViewControllerDelegate extension SplitViewController: UISplitViewControllerDelegate { func splitViewControllerSupportedInterfaceOrientations(splitViewController: UISplitViewController) -> UIInterfaceOrientationMask { return .All } }
Allow portrait upside down orientation on phones
Allow portrait upside down orientation on phones
Swift
mit
phatblat/SplitView
swift
## Code Before: // // SplitViewController.swift // SplitView // // Created by phatblat on 9/4/14. // Copyright (c) 2014 phatblat. All rights reserved. // import UIKit class SplitViewController: UISplitViewController { override func viewDidLoad() { super.viewDidLoad() } } ## Instruction: Allow portrait upside down orientation on phones ## Code After: // // SplitViewController.swift // SplitView // // Created by phatblat on 9/4/14. // Copyright (c) 2014 phatblat. All rights reserved. // import UIKit class SplitViewController: UISplitViewController { override func viewDidLoad() { super.viewDidLoad() delegate = self } } // MARK: - SplitViewControllerDelegate extension SplitViewController: UISplitViewControllerDelegate { func splitViewControllerSupportedInterfaceOrientations(splitViewController: UISplitViewController) -> UIInterfaceOrientationMask { return .All } }
3ef54dbcad8bd84b2c0f7203f4d6436ac751e214
module/Album/Module.php
module/Album/Module.php
<?php namespace Album; use Zend\Db\Adapter\Adapter; use Zend\Db\ResultSet\ResultSet; use Zend\Db\TableGateway\TableGateway; use Zend\ModuleManager\Feature\ConfigProviderInterface; class Module implements ConfigProviderInterface { public function getConfig() { return include __DIR__ . '/config/module.config.php'; } public function getServiceConfig() { return [ 'factories' => [ Model\AlbumTable::class => function ($container) { $tableGateway = $container->get(Model\AlbumTableGateway::class); return new Model\AlbumTable($tableGateway); }, Model\AlbumTableGateway::class => function ($container) { $dbAdapter = $container->get(AdapterInterface::class); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Model\Album()); return new TableGateway('album', $dbAdapter, null, $resultSetPrototype); }, ], ]; } public function getControllerConfig() { return [ 'factories' => [ Controller\AlbumController::class => function ($container) { return new Controller\AlbumController( $container->get(Model\AlbumTable::class) ); }, ], ]; } }
<?php namespace Album; use Zend\Db\Adapter\Adapter; use Zend\Db\Adapter\AdapterInterface; use Zend\Db\ResultSet\ResultSet; use Zend\Db\TableGateway\TableGateway; use Zend\ModuleManager\Feature\ConfigProviderInterface; class Module implements ConfigProviderInterface { public function getConfig() { return include __DIR__ . '/config/module.config.php'; } public function getServiceConfig() { return [ 'factories' => [ Model\AlbumTable::class => function ($container) { $tableGateway = $container->get('Model\AlbumTableGateway'); return new Model\AlbumTable($tableGateway); }, 'Model\AlbumTableGateway' => function ($container) { $dbAdapter = $container->get(AdapterInterface::class); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Model\Album()); return new TableGateway('album', $dbAdapter, null, $resultSetPrototype); }, ], ]; } public function getControllerConfig() { return [ 'factories' => [ Controller\AlbumController::class => function ($container) { return new Controller\AlbumController( $container->get(Model\AlbumTable::class) ); }, ], ]; } }
Fix non existing Model\AlbumTableGateway::class FQN
Fix non existing Model\AlbumTableGateway::class FQN
PHP
bsd-3-clause
fallout1986/zf3-album-pipeline,fallout1986/zf3-album-pipeline
php
## Code Before: <?php namespace Album; use Zend\Db\Adapter\Adapter; use Zend\Db\ResultSet\ResultSet; use Zend\Db\TableGateway\TableGateway; use Zend\ModuleManager\Feature\ConfigProviderInterface; class Module implements ConfigProviderInterface { public function getConfig() { return include __DIR__ . '/config/module.config.php'; } public function getServiceConfig() { return [ 'factories' => [ Model\AlbumTable::class => function ($container) { $tableGateway = $container->get(Model\AlbumTableGateway::class); return new Model\AlbumTable($tableGateway); }, Model\AlbumTableGateway::class => function ($container) { $dbAdapter = $container->get(AdapterInterface::class); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Model\Album()); return new TableGateway('album', $dbAdapter, null, $resultSetPrototype); }, ], ]; } public function getControllerConfig() { return [ 'factories' => [ Controller\AlbumController::class => function ($container) { return new Controller\AlbumController( $container->get(Model\AlbumTable::class) ); }, ], ]; } } ## Instruction: Fix non existing Model\AlbumTableGateway::class FQN ## Code After: <?php namespace Album; use Zend\Db\Adapter\Adapter; use Zend\Db\Adapter\AdapterInterface; use Zend\Db\ResultSet\ResultSet; use Zend\Db\TableGateway\TableGateway; use Zend\ModuleManager\Feature\ConfigProviderInterface; class Module implements ConfigProviderInterface { public function getConfig() { return include __DIR__ . '/config/module.config.php'; } public function getServiceConfig() { return [ 'factories' => [ Model\AlbumTable::class => function ($container) { $tableGateway = $container->get('Model\AlbumTableGateway'); return new Model\AlbumTable($tableGateway); }, 'Model\AlbumTableGateway' => function ($container) { $dbAdapter = $container->get(AdapterInterface::class); $resultSetPrototype = new ResultSet(); $resultSetPrototype->setArrayObjectPrototype(new Model\Album()); return new TableGateway('album', $dbAdapter, null, $resultSetPrototype); }, ], ]; } public function getControllerConfig() { return [ 'factories' => [ Controller\AlbumController::class => function ($container) { return new Controller\AlbumController( $container->get(Model\AlbumTable::class) ); }, ], ]; } }
3387ee5f00f7886266c32b12c2bc1b5bcd52d47c
public/stylesheets/v2/ui/tables.css
public/stylesheets/v2/ui/tables.css
.table { width: 100%; border-collapse: collapse; } .table > thead > tr > th, .table > tbody > tr > th { font-weight: 700; } .table > thead > tr > th { text-transform: uppercase; font-size: 0.8em; } .table th, .table td { padding: 0.25em; } .table > thead > tr > th { border-bottom: 1px solid rgb(127, 127, 127); } .table .center { text-align: center; } .table .right { text-align: right; } .table .td-yes { text-align: center; background-color: #87d37c; color: white; border: 1px solid white; } .table .td-yes::before { content: "✓ "; } .table .td-no { text-align: center; background-color: #df5454; color: white; border: 1px solid white; } .table .td-no::before { content: "✘ "; }
.table { width: 100%; border-collapse: collapse; } .table-zebra > tbody > tr:nth-child(even) { background-color: transparent; } .table-zebra > tbody > tr:nth-child(odd) { background-color: #f5f5f5; } .table > thead > tr > th, .table > tbody > tr > th { font-weight: 700; } .table > thead > tr > th { text-transform: uppercase; font-size: 0.8em; } .table th, .table td { padding: 0.25em; } .table > thead > tr > th { border-bottom: 1px solid rgb(127, 127, 127); } .table .center { text-align: center; } .table .right { text-align: right; } .table .td-yes { text-align: center; background-color: #87d37c; color: white; border: 1px solid white; } .table .td-yes::before { content: "✓ "; } .table .td-no { text-align: center; background-color: #df5454; color: white; border: 1px solid white; } .table .td-no::before { content: "✘ "; } .table .tr-empty td { background-color: #eee; color: #666; text-align: center; font-style: italic; padding: 1em; }
Add a few table styles for BPCS
Add a few table styles for BPCS
CSS
mit
documentcloud/documentcloud,documentcloud/documentcloud,documentcloud/documentcloud,documentcloud/documentcloud
css
## Code Before: .table { width: 100%; border-collapse: collapse; } .table > thead > tr > th, .table > tbody > tr > th { font-weight: 700; } .table > thead > tr > th { text-transform: uppercase; font-size: 0.8em; } .table th, .table td { padding: 0.25em; } .table > thead > tr > th { border-bottom: 1px solid rgb(127, 127, 127); } .table .center { text-align: center; } .table .right { text-align: right; } .table .td-yes { text-align: center; background-color: #87d37c; color: white; border: 1px solid white; } .table .td-yes::before { content: "✓ "; } .table .td-no { text-align: center; background-color: #df5454; color: white; border: 1px solid white; } .table .td-no::before { content: "✘ "; } ## Instruction: Add a few table styles for BPCS ## Code After: .table { width: 100%; border-collapse: collapse; } .table-zebra > tbody > tr:nth-child(even) { background-color: transparent; } .table-zebra > tbody > tr:nth-child(odd) { background-color: #f5f5f5; } .table > thead > tr > th, .table > tbody > tr > th { font-weight: 700; } .table > thead > tr > th { text-transform: uppercase; font-size: 0.8em; } .table th, .table td { padding: 0.25em; } .table > thead > tr > th { border-bottom: 1px solid rgb(127, 127, 127); } .table .center { text-align: center; } .table .right { text-align: right; } .table .td-yes { text-align: center; background-color: #87d37c; color: white; border: 1px solid white; } .table .td-yes::before { content: "✓ "; } .table .td-no { text-align: center; background-color: #df5454; color: white; border: 1px solid white; } .table .td-no::before { content: "✘ "; } .table .tr-empty td { background-color: #eee; color: #666; text-align: center; font-style: italic; padding: 1em; }