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
a3b6cd7af4c5c2b6e4900999af5faa8516e23ac7
README.rst
README.rst
bvg-grabber =========== .. image:: https://secure.travis-ci.org/Markush2010/bvg-grabber.png?branch=master :alt: Build Status :target: http://travis-ci.org/Markush2010/bvg-grabber
bvg-grabber =========== Showing BVG Departures In Your Office +++++++++++++++++++++++++++++++++++++ .. image:: https://secure.travis-ci.org/Markush2010/bvg-grabber.png?branch=master :alt: Build Status :target: http://travis-ci.org/Markush2010/bvg-grabber Blog post: http://markusholtermann.eu/article/showing-bvg-departures-in-your-office/ Slides: http://download.markusholtermann.eu/BVG-Grabber-LightningTalk.pdf Pictures: .. image:: http://media.markusholtermann.eu/img/BVG-Grabber-LightningTalk-installation1.jpg :alt: Installation 1 .. image:: http://media.markusholtermann.eu/img/BVG-Grabber-LightningTalk-installation2.jpg :alt: Installation 2
Add links to blog/slides + pictures to readme
Add links to blog/slides + pictures to readme
reStructuredText
bsd-3-clause
MarkusH/bvg-grabber
restructuredtext
## Code Before: bvg-grabber =========== .. image:: https://secure.travis-ci.org/Markush2010/bvg-grabber.png?branch=master :alt: Build Status :target: http://travis-ci.org/Markush2010/bvg-grabber ## Instruction: Add links to blog/slides + pictures to readme ## Code After: bvg-grabber =========== Showing BVG Departures In Your Office +++++++++++++++++++++++++++++++++++++ .. image:: https://secure.travis-ci.org/Markush2010/bvg-grabber.png?branch=master :alt: Build Status :target: http://travis-ci.org/Markush2010/bvg-grabber Blog post: http://markusholtermann.eu/article/showing-bvg-departures-in-your-office/ Slides: http://download.markusholtermann.eu/BVG-Grabber-LightningTalk.pdf Pictures: .. image:: http://media.markusholtermann.eu/img/BVG-Grabber-LightningTalk-installation1.jpg :alt: Installation 1 .. image:: http://media.markusholtermann.eu/img/BVG-Grabber-LightningTalk-installation2.jpg :alt: Installation 2
4d124fe1c3d2321f945c9f21ebcc321586036902
Medium/078_Subsets.js
Medium/078_Subsets.js
// https://leetcode.com/problems/subsets/description/ /** * @param {number[]} nums * @return {number[][]} */ var subsets = function (nums) { let result = [[]]; for (let num of nums) { let len = result.length; for (let i = 0; i < len; i++) { let temp = [].concat(result[i]); temp.push(num); result.push(temp); } } return result; }; var nums = [1, 2, 3]; console.log(subsets(nums)); var nums = [1, 2, 3, 4]; console.log(subsets(nums));
// https://leetcode.com/problems/subsets/description/ /** * @param {number[]} nums * @return {number[][]} */ var subsets2 = function (nums) { let result = [[]]; for (let num of nums) { let len = result.length; for (let i = 0; i < len; i++) { let temp = [].concat(result[i]); temp.push(num); result.push(temp); } } return result; }; var subsets = function (nums) { let dfs = (tempRes, nums, start) => { if (start === nums.length) return []; let result = []; for (let i = start; i < nums.length; i++) { let temp = [].concat(tempRes); temp.push(nums[i]); result.push(temp); result = result.concat(dfs(temp, nums, i + 1)); } return result; } let result = [[]].concat(dfs([], nums, 0)); return result; }; var nums = [1, 2, 3]; console.log(subsets(nums)); var nums = [1, 2, 3, 4]; console.log(subsets(nums));
Add second solution for subsets
Add second solution for subsets
JavaScript
mit
lon-yang/leetcode,lon-yang/leetcode
javascript
## Code Before: // https://leetcode.com/problems/subsets/description/ /** * @param {number[]} nums * @return {number[][]} */ var subsets = function (nums) { let result = [[]]; for (let num of nums) { let len = result.length; for (let i = 0; i < len; i++) { let temp = [].concat(result[i]); temp.push(num); result.push(temp); } } return result; }; var nums = [1, 2, 3]; console.log(subsets(nums)); var nums = [1, 2, 3, 4]; console.log(subsets(nums)); ## Instruction: Add second solution for subsets ## Code After: // https://leetcode.com/problems/subsets/description/ /** * @param {number[]} nums * @return {number[][]} */ var subsets2 = function (nums) { let result = [[]]; for (let num of nums) { let len = result.length; for (let i = 0; i < len; i++) { let temp = [].concat(result[i]); temp.push(num); result.push(temp); } } return result; }; var subsets = function (nums) { let dfs = (tempRes, nums, start) => { if (start === nums.length) return []; let result = []; for (let i = start; i < nums.length; i++) { let temp = [].concat(tempRes); temp.push(nums[i]); result.push(temp); result = result.concat(dfs(temp, nums, i + 1)); } return result; } let result = [[]].concat(dfs([], nums, 0)); return result; }; var nums = [1, 2, 3]; console.log(subsets(nums)); var nums = [1, 2, 3, 4]; console.log(subsets(nums));
2ab9efeafdce44e7296eb787be36f3b622f43a57
README.md
README.md
ImageManipulator ================= Code which allows importing and manipulating and re-saving of images on the client side.
ImageManipulator ================= Code which allows importing and manipulating and re-saving of images on the client side. Currently the code is structured as a Jade based website initialised by the Harp server. All the javascript (the most important part) is in "scripts.js". I plan to abstract this out into class files with a demo shortly.
Update to readme to explain messy structure.
Update to readme to explain messy structure.
Markdown
mit
andrewbridge/image-manipulator
markdown
## Code Before: ImageManipulator ================= Code which allows importing and manipulating and re-saving of images on the client side. ## Instruction: Update to readme to explain messy structure. ## Code After: ImageManipulator ================= Code which allows importing and manipulating and re-saving of images on the client side. Currently the code is structured as a Jade based website initialised by the Harp server. All the javascript (the most important part) is in "scripts.js". I plan to abstract this out into class files with a demo shortly.
a28eaf9968fe57da4ed3eef11bc05cdfd00e9af4
app/views/documents/_embed_code.html.erb
app/views/documents/_embed_code.html.erb
<% if options[:use_default_container] %> <div id="<%= options[:default_container_id] %>" class="DV-container"></div> <% end %> <script type="text/javascript"> DV.load("<%= options[:resource_js_url] %>", JSON.parse('<%= data.to_json %>')); </script> <% if data[:pdf] %> <noscript> <a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a> <br> <a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a> </noscript> <% end %>
<% if options[:use_default_container] %> <div id="<%= options[:default_container_id] %>" class="DV-container"></div> <% end %> <script type="text/javascript"> DV.load("<%= options[:resource_js_url] %>", <%= data.to_json %>); </script> <% if data[:pdf] %> <noscript> <a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a> <br> <a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a> </noscript> <% end %>
Stop trying to tame JSON
Stop trying to tame JSON Revert 43a2f99624491193be9b220da11c5ba58979e7ee and actually fix things. (We were dumping the Ruby-generated JSON between curly braces, when Ruby was already returning it that way.)
HTML+ERB
mit
ivarvong/documentcloud,moodpo/documentcloud,dannguyen/documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,documentcloud/documentcloud,dannguyen/documentcloud,monofox/documentcloud,gunjanmodi/documentcloud,moodpo/documentcloud,ivarvong/documentcloud,monofox/documentcloud,documentcloud/documentcloud,ivarvong/documentcloud,dannguyen/documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,gunjanmodi/documentcloud,monofox/documentcloud,dannguyen/documentcloud,moodpo/documentcloud,documentcloud/documentcloud,gunjanmodi/documentcloud,gunjanmodi/documentcloud,moodpo/documentcloud,monofox/documentcloud,ivarvong/documentcloud,documentcloud/documentcloud
html+erb
## Code Before: <% if options[:use_default_container] %> <div id="<%= options[:default_container_id] %>" class="DV-container"></div> <% end %> <script type="text/javascript"> DV.load("<%= options[:resource_js_url] %>", JSON.parse('<%= data.to_json %>')); </script> <% if data[:pdf] %> <noscript> <a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a> <br> <a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a> </noscript> <% end %> ## Instruction: Stop trying to tame JSON Revert 43a2f99624491193be9b220da11c5ba58979e7ee and actually fix things. (We were dumping the Ruby-generated JSON between curly braces, when Ruby was already returning it that way.) ## Code After: <% if options[:use_default_container] %> <div id="<%= options[:default_container_id] %>" class="DV-container"></div> <% end %> <script type="text/javascript"> DV.load("<%= options[:resource_js_url] %>", <%= data.to_json %>); </script> <% if data[:pdf] %> <noscript> <a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a> <br> <a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a> </noscript> <% end %>
0f08bdd49437340fd087c753be383f33e70f810a
public/views/content/directives/contentEditRouteModal.tpl.html
public/views/content/directives/contentEditRouteModal.tpl.html
<div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header" ng-show="title"> <button type="button" class="close" ng-click="vm.editRouteModal.closeModal()">&times;</button> <h4 class="modal-title" translate="{{title}}"></h4> </div> <div class="modal-body"> <form name="contentRouteForm" novalidate> <div class="row"> <div class="col-lg-9"> <!-- Title Form input --> <div class="form-group"> <label for="title">{{ 'PERMALINK' | translate }} <strong class="text-danger">*</strong></label> <input id="title" name="title" type="text" class="form-control" required ng-model="vm.contentRoute"> </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-success" ng-click="vm.editRouteModal.closeModal()"> {{ (vm.hideSubmitButton) ? 'OK' : 'CANCEL' | translate }} </button> <button type="button" class="btn btn-primary" ng-click="vm.editRouteModal.saveContentRoute()"> <i class="glyphicon glyphicon-ok-circle"></i> {{ 'SAVE' | translate }} </button> </div> </div> </div> </div>
<div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header" ng-show="title"> <button type="button" class="close" ng-click="vm.editRouteModal.closeModal()">&times;</button> <h4 class="modal-title" translate="{{title}}"></h4> </div> <div class="modal-body"> <form name="contentRouteForm" novalidate> <div class="row"> <div class="col-lg-9"> <!-- Title Form input --> <div class="form-group"> <label for="title">{{ 'PERMALINK' | translate }} <strong class="text-danger">*</strong></label> <input id="title" name="title" type="text" class="form-control" required ng-model="vm.contentRoute"> </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-success" ng-click="vm.editRouteModal.closeModal()"> {{ (vm.hideSubmitButton) ? 'OK' : 'CANCEL' | translate }} </button> <button type="button" class="btn btn-primary" ng-disabled="contentRouteForm.$invalid" ng-click="vm.editRouteModal.saveContentRoute()"> <i class="glyphicon glyphicon-ok-circle"></i> {{ 'SAVE' | translate }} </button> </div> </div> </div> </div>
Edit route modal disable button if form is not valid
Edit route modal disable button if form is not valid
HTML
mit
GrupaZero/admin,GrupaZero/admin,GrupaZero/admin
html
## Code Before: <div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header" ng-show="title"> <button type="button" class="close" ng-click="vm.editRouteModal.closeModal()">&times;</button> <h4 class="modal-title" translate="{{title}}"></h4> </div> <div class="modal-body"> <form name="contentRouteForm" novalidate> <div class="row"> <div class="col-lg-9"> <!-- Title Form input --> <div class="form-group"> <label for="title">{{ 'PERMALINK' | translate }} <strong class="text-danger">*</strong></label> <input id="title" name="title" type="text" class="form-control" required ng-model="vm.contentRoute"> </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-success" ng-click="vm.editRouteModal.closeModal()"> {{ (vm.hideSubmitButton) ? 'OK' : 'CANCEL' | translate }} </button> <button type="button" class="btn btn-primary" ng-click="vm.editRouteModal.saveContentRoute()"> <i class="glyphicon glyphicon-ok-circle"></i> {{ 'SAVE' | translate }} </button> </div> </div> </div> </div> ## Instruction: Edit route modal disable button if form is not valid ## Code After: <div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header" ng-show="title"> <button type="button" class="close" ng-click="vm.editRouteModal.closeModal()">&times;</button> <h4 class="modal-title" translate="{{title}}"></h4> </div> <div class="modal-body"> <form name="contentRouteForm" novalidate> <div class="row"> <div class="col-lg-9"> <!-- Title Form input --> <div class="form-group"> <label for="title">{{ 'PERMALINK' | translate }} <strong class="text-danger">*</strong></label> <input id="title" name="title" type="text" class="form-control" required ng-model="vm.contentRoute"> </div> </div> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-success" ng-click="vm.editRouteModal.closeModal()"> {{ (vm.hideSubmitButton) ? 'OK' : 'CANCEL' | translate }} </button> <button type="button" class="btn btn-primary" ng-disabled="contentRouteForm.$invalid" ng-click="vm.editRouteModal.saveContentRoute()"> <i class="glyphicon glyphicon-ok-circle"></i> {{ 'SAVE' | translate }} </button> </div> </div> </div> </div>
a7c6fd7b2d6674d2e6fddba363e09a1aa5422170
app/controllers/settings_controller.rb
app/controllers/settings_controller.rb
class SettingsController < ApplicationController def install if config.is_ok? render_action 'done' end @fields = Configuration.fields if request.post? Setting.transaction do for field, value in @params["fields"] setting = find_or_create(field) setting.value = value setting.save end end config.reload flash.now['notice'] = 'config updated.' end end private def find_or_create(name) unless setting = Setting.find_by_name(name) setting = Setting.new("name" => name) end setting end end
class SettingsController < ApplicationController def install if config.is_ok? render_action 'done' return end @fields = Configuration.fields if request.post? Setting.transaction do for field, value in @params["fields"] setting = find_or_create(field) setting.value = value setting.save end end config.reload flash.now['notice'] = 'config updated.' end end private def find_or_create(name) unless setting = Setting.find_by_name(name) setting = Setting.new("name" => name) end setting end end
Fix for stupid mistake tobi pointed out.
Fix for stupid mistake tobi pointed out. git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@142 820eb932-12ee-0310-9ca8-eeb645f39767
Ruby
mit
swombat/blog,swombat/blog,swombat/blog,swombat/blog,swombat/blog
ruby
## Code Before: class SettingsController < ApplicationController def install if config.is_ok? render_action 'done' end @fields = Configuration.fields if request.post? Setting.transaction do for field, value in @params["fields"] setting = find_or_create(field) setting.value = value setting.save end end config.reload flash.now['notice'] = 'config updated.' end end private def find_or_create(name) unless setting = Setting.find_by_name(name) setting = Setting.new("name" => name) end setting end end ## Instruction: Fix for stupid mistake tobi pointed out. git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@142 820eb932-12ee-0310-9ca8-eeb645f39767 ## Code After: class SettingsController < ApplicationController def install if config.is_ok? render_action 'done' return end @fields = Configuration.fields if request.post? Setting.transaction do for field, value in @params["fields"] setting = find_or_create(field) setting.value = value setting.save end end config.reload flash.now['notice'] = 'config updated.' end end private def find_or_create(name) unless setting = Setting.find_by_name(name) setting = Setting.new("name" => name) end setting end end
7015b5bf056c1181af65695b5f263aaaaeea61fa
lib/Stripe/Charge.php
lib/Stripe/Charge.php
<?php class Stripe_Charge extends Stripe_ApiResource { public static function constructFrom($values, $apiKey=null) { $class = get_class(); return self::_scopedConstructFrom($class, $values, $apiKey); } public static function retrieve($id, $apiKey=null) { $class = get_class(); return self::_scopedRetrieve($class, $id, $apiKey); } public static function all($params=null, $apiKey=null) { $class = get_class(); return self::_scopedAll($class, $params, $apiKey); } public static function create($params=null, $apiKey=null) { $class = get_class(); return self::_scopedCreate($class, $params, $apiKey); } public function refund() { $requestor = new Stripe_ApiRequestor($this->_apiKey); $url = $this->instanceUrl() . '/refund'; list($response, $apiKey) = $requestor->request('post', $url); $this->refreshFrom($response, $apiKey); return $this; } }
<?php class Stripe_Charge extends Stripe_ApiResource { public static function constructFrom($values, $apiKey=null) { $class = get_class(); return self::_scopedConstructFrom($class, $values, $apiKey); } public static function retrieve($id, $apiKey=null) { $class = get_class(); return self::_scopedRetrieve($class, $id, $apiKey); } public static function all($params=null, $apiKey=null) { $class = get_class(); return self::_scopedAll($class, $params, $apiKey); } public static function create($params=null, $apiKey=null) { $class = get_class(); return self::_scopedCreate($class, $params, $apiKey); } public function refund($params=null) { $requestor = new Stripe_ApiRequestor($this->_apiKey); $url = $this->instanceUrl() . '/refund'; list($response, $apiKey) = $requestor->request('post', $url, $params); $this->refreshFrom($response, $apiKey); return $this; } }
Add optional params to refund
Add optional params to refund
PHP
mit
a-ankitpatel/stripe-php,Nayami/stripe-php,iFixit/stripe-php,matthewarkin/stripe-php,MamunHoque/stripe-php,stripe/stripe-php,5outh/stripe-php,cruisemaniac/laravel-stripe-php-bundle
php
## Code Before: <?php class Stripe_Charge extends Stripe_ApiResource { public static function constructFrom($values, $apiKey=null) { $class = get_class(); return self::_scopedConstructFrom($class, $values, $apiKey); } public static function retrieve($id, $apiKey=null) { $class = get_class(); return self::_scopedRetrieve($class, $id, $apiKey); } public static function all($params=null, $apiKey=null) { $class = get_class(); return self::_scopedAll($class, $params, $apiKey); } public static function create($params=null, $apiKey=null) { $class = get_class(); return self::_scopedCreate($class, $params, $apiKey); } public function refund() { $requestor = new Stripe_ApiRequestor($this->_apiKey); $url = $this->instanceUrl() . '/refund'; list($response, $apiKey) = $requestor->request('post', $url); $this->refreshFrom($response, $apiKey); return $this; } } ## Instruction: Add optional params to refund ## Code After: <?php class Stripe_Charge extends Stripe_ApiResource { public static function constructFrom($values, $apiKey=null) { $class = get_class(); return self::_scopedConstructFrom($class, $values, $apiKey); } public static function retrieve($id, $apiKey=null) { $class = get_class(); return self::_scopedRetrieve($class, $id, $apiKey); } public static function all($params=null, $apiKey=null) { $class = get_class(); return self::_scopedAll($class, $params, $apiKey); } public static function create($params=null, $apiKey=null) { $class = get_class(); return self::_scopedCreate($class, $params, $apiKey); } public function refund($params=null) { $requestor = new Stripe_ApiRequestor($this->_apiKey); $url = $this->instanceUrl() . '/refund'; list($response, $apiKey) = $requestor->request('post', $url, $params); $this->refreshFrom($response, $apiKey); return $this; } }
f0bbaab78aa677d19974087b3b63f817fd442eb9
core/Request.qml
core/Request.qml
///object for handling XML/HTTP requests Object { property bool loading: false; ///< loading flag, is true when request was send and false when answer was recieved or error occured /**@param request:Object request object send request using 'XMLHttpRequest' object*/ ajax(request): { var url = request.url var error = request.error, data = request.data, headers = request.headers, done = request.done, settings = request.settings var xhr = new XMLHttpRequest() var self = this if (error) xhr.addEventListener('error', function(event) { self.loading = false; log("Error"); error(event) }) if (done) xhr.addEventListener('load', function(event) { self.loading = false; done(event) }) xhr.open(request.method || 'GET', url); for (var i in settings) xhr[i] = settings[i] for (var i in headers) xhr.setRequestHeader(i, headers[i]) this.loading = true if (request.data) xhr.send(request.data) else xhr.send() } }
///object for handling XML/HTTP requests Object { property bool loading: false; ///< loading flag, is true when request was send and false when answer was recieved or error occured /**@param request:Object request object send request using 'XMLHttpRequest' object*/ ajax(request): { var url = request.url var error = request.error, headers = request.headers, done = request.done, settings = request.settings var xhr = new XMLHttpRequest() var self = this if (error) xhr.addEventListener('error', function(event) { self.loading = false; log("Error"); error(event) }) if (done) xhr.addEventListener('load', function(event) { self.loading = false; done(event) }) xhr.open(request.method || 'GET', url); for (var i in settings) xhr[i] = settings[i] for (var i in headers) xhr.setRequestHeader(i, headers[i]) this.loading = true if (request.data) xhr.send(request.data) else xhr.send() } }
Fix warning, remove unused variable.
Fix warning, remove unused variable.
QML
mit
pureqml/controls
qml
## Code Before: ///object for handling XML/HTTP requests Object { property bool loading: false; ///< loading flag, is true when request was send and false when answer was recieved or error occured /**@param request:Object request object send request using 'XMLHttpRequest' object*/ ajax(request): { var url = request.url var error = request.error, data = request.data, headers = request.headers, done = request.done, settings = request.settings var xhr = new XMLHttpRequest() var self = this if (error) xhr.addEventListener('error', function(event) { self.loading = false; log("Error"); error(event) }) if (done) xhr.addEventListener('load', function(event) { self.loading = false; done(event) }) xhr.open(request.method || 'GET', url); for (var i in settings) xhr[i] = settings[i] for (var i in headers) xhr.setRequestHeader(i, headers[i]) this.loading = true if (request.data) xhr.send(request.data) else xhr.send() } } ## Instruction: Fix warning, remove unused variable. ## Code After: ///object for handling XML/HTTP requests Object { property bool loading: false; ///< loading flag, is true when request was send and false when answer was recieved or error occured /**@param request:Object request object send request using 'XMLHttpRequest' object*/ ajax(request): { var url = request.url var error = request.error, headers = request.headers, done = request.done, settings = request.settings var xhr = new XMLHttpRequest() var self = this if (error) xhr.addEventListener('error', function(event) { self.loading = false; log("Error"); error(event) }) if (done) xhr.addEventListener('load', function(event) { self.loading = false; done(event) }) xhr.open(request.method || 'GET', url); for (var i in settings) xhr[i] = settings[i] for (var i in headers) xhr.setRequestHeader(i, headers[i]) this.loading = true if (request.data) xhr.send(request.data) else xhr.send() } }
734b31b3d12e986d8de35fdbcf2db54690277074
wal-e-requirements.txt
wal-e-requirements.txt
Babel==1.3 argparse==1.3.0 azure==0.9.0 boto==2.35.2 futures==2.2.0 gevent==1.0.1 greenlet==0.4.5 iso8601==0.1.10 netaddr==0.7.13 netifaces==0.10.4 oslo.config==1.6.0 oslo.i18n==1.3.0 oslo.serialization==1.2.0 oslo.utils==1.2.1 pbr==0.10.7 prettytable==0.7.2 python-dateutil==2.4.0 python-keystoneclient==1.0.0 python-swiftclient==2.3.1 pytz==2014.10 requests==2.5.1 simplejson==3.6.5 six==1.9.0 stevedore==1.2.0 https://github.com/lrowe/wal-e/archive/3b2187ef89.zip wsgiref==0.1.2
Babel==2.2.0 argparse==1.2.1 azure==1.0.3 azure-common==1.0.0 azure-mgmt==0.20.2 azure-mgmt-common==0.20.0 azure-mgmt-compute==0.20.1 azure-mgmt-network==0.20.1 azure-mgmt-nspkg==1.0.0 azure-mgmt-resource==0.20.1 azure-mgmt-storage==0.20.0 azure-nspkg==1.0.0 azure-servicebus==0.20.1 azure-servicemanagement-legacy==0.20.2 azure-storage==0.20.3 boto==2.39.0 debtcollector==1.3.0 funcsigs==0.4 futures==3.0.5 gevent==1.0.2 greenlet==0.4.9 iso8601==0.1.11 keystoneauth1==2.3.0 monotonic==0.6 msgpack-python==0.4.7 netaddr==0.7.18 netifaces==0.10.4 oslo.config==3.9.0 oslo.i18n==3.4.0 oslo.serialization==2.4.0 oslo.utils==3.7.0 pbr==1.8.1 positional==1.0.1 prettytable==0.7.2 python-dateutil==2.4.2 python-keystoneclient==2.3.0 python-swiftclient==2.7.0 pytz==2015.7 requests==2.9.1 six==1.10.0 stevedore==1.12.0 wal-e==0.8.1 wrapt==1.10.6 wsgiref==0.1.2
Update wal-e requirements, don't rely on my fork.
Update wal-e requirements, don't rely on my fork.
Text
mit
hms-dbmi/fourfront,ENCODE-DCC/snovault,4dn-dcic/fourfront,T2DREAM/t2dream-portal,ENCODE-DCC/encoded,ENCODE-DCC/encoded,hms-dbmi/fourfront,4dn-dcic/fourfront,hms-dbmi/fourfront,T2DREAM/t2dream-portal,4dn-dcic/fourfront,ENCODE-DCC/snovault,ENCODE-DCC/snovault,ENCODE-DCC/encoded,4dn-dcic/fourfront,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,T2DREAM/t2dream-portal,ENCODE-DCC/snovault,hms-dbmi/fourfront,ENCODE-DCC/encoded,hms-dbmi/fourfront
text
## Code Before: Babel==1.3 argparse==1.3.0 azure==0.9.0 boto==2.35.2 futures==2.2.0 gevent==1.0.1 greenlet==0.4.5 iso8601==0.1.10 netaddr==0.7.13 netifaces==0.10.4 oslo.config==1.6.0 oslo.i18n==1.3.0 oslo.serialization==1.2.0 oslo.utils==1.2.1 pbr==0.10.7 prettytable==0.7.2 python-dateutil==2.4.0 python-keystoneclient==1.0.0 python-swiftclient==2.3.1 pytz==2014.10 requests==2.5.1 simplejson==3.6.5 six==1.9.0 stevedore==1.2.0 https://github.com/lrowe/wal-e/archive/3b2187ef89.zip wsgiref==0.1.2 ## Instruction: Update wal-e requirements, don't rely on my fork. ## Code After: Babel==2.2.0 argparse==1.2.1 azure==1.0.3 azure-common==1.0.0 azure-mgmt==0.20.2 azure-mgmt-common==0.20.0 azure-mgmt-compute==0.20.1 azure-mgmt-network==0.20.1 azure-mgmt-nspkg==1.0.0 azure-mgmt-resource==0.20.1 azure-mgmt-storage==0.20.0 azure-nspkg==1.0.0 azure-servicebus==0.20.1 azure-servicemanagement-legacy==0.20.2 azure-storage==0.20.3 boto==2.39.0 debtcollector==1.3.0 funcsigs==0.4 futures==3.0.5 gevent==1.0.2 greenlet==0.4.9 iso8601==0.1.11 keystoneauth1==2.3.0 monotonic==0.6 msgpack-python==0.4.7 netaddr==0.7.18 netifaces==0.10.4 oslo.config==3.9.0 oslo.i18n==3.4.0 oslo.serialization==2.4.0 oslo.utils==3.7.0 pbr==1.8.1 positional==1.0.1 prettytable==0.7.2 python-dateutil==2.4.2 python-keystoneclient==2.3.0 python-swiftclient==2.7.0 pytz==2015.7 requests==2.9.1 six==1.10.0 stevedore==1.12.0 wal-e==0.8.1 wrapt==1.10.6 wsgiref==0.1.2
e28da205788cc1f1e81b1b7b9f3f7ee9e204ad03
server/models/applicant.js
server/models/applicant.js
var mongoose = require("mongoose"); var Schema = mongoose.Schema; var applicantSchema = new Schema({ name: { type: String, required: true }, email: { type: String, required: true, lowercase: true }, timeTaken: String }, {timestamps: true}); applicantSchema.pre("save", function (next) { this.setTimeTaken(); next(); }); applicantSchema.methods.setTimeTaken = function () { var applicant = this; var ms = Date.now() - this.createdAt; var x = ms / 1000; var seconds = Math.floor(x % 60); x /= 60; var minutes = Math.floor(x % 60); x /= 60; var hours = Math.floor(x % 24); applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s"; }; module.exports = mongoose.model("Applicant", applicantSchema);
var mongoose = require("mongoose"); var Schema = mongoose.Schema; var applicantSchema = new Schema({ name: { type: String, required: true }, email: { type: String, required: true, lowercase: true }, timeTaken: { type: String, default: "Not yet completed" } }, {timestamps: true}); applicantSchema.pre("save", function (next) { this.setTimeTaken(); next(); }); applicantSchema.methods.setTimeTaken = function () { var applicant = this; var ms = Date.now() - this.createdAt; var x = ms / 1000; var seconds = Math.floor(x % 60); x /= 60; var minutes = Math.floor(x % 60); x /= 60; var hours = Math.floor(x % 24); applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s"; }; module.exports = mongoose.model("Applicant", applicantSchema);
Change timeTaken to default of Not yet completed
Change timeTaken to default of Not yet completed
JavaScript
mit
bobziroll/admissions,bobziroll/admissions
javascript
## Code Before: var mongoose = require("mongoose"); var Schema = mongoose.Schema; var applicantSchema = new Schema({ name: { type: String, required: true }, email: { type: String, required: true, lowercase: true }, timeTaken: String }, {timestamps: true}); applicantSchema.pre("save", function (next) { this.setTimeTaken(); next(); }); applicantSchema.methods.setTimeTaken = function () { var applicant = this; var ms = Date.now() - this.createdAt; var x = ms / 1000; var seconds = Math.floor(x % 60); x /= 60; var minutes = Math.floor(x % 60); x /= 60; var hours = Math.floor(x % 24); applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s"; }; module.exports = mongoose.model("Applicant", applicantSchema); ## Instruction: Change timeTaken to default of Not yet completed ## Code After: var mongoose = require("mongoose"); var Schema = mongoose.Schema; var applicantSchema = new Schema({ name: { type: String, required: true }, email: { type: String, required: true, lowercase: true }, timeTaken: { type: String, default: "Not yet completed" } }, {timestamps: true}); applicantSchema.pre("save", function (next) { this.setTimeTaken(); next(); }); applicantSchema.methods.setTimeTaken = function () { var applicant = this; var ms = Date.now() - this.createdAt; var x = ms / 1000; var seconds = Math.floor(x % 60); x /= 60; var minutes = Math.floor(x % 60); x /= 60; var hours = Math.floor(x % 24); applicant.timeTaken = hours + "h:" + minutes + "m:" + seconds + "s"; }; module.exports = mongoose.model("Applicant", applicantSchema);
d1e93a8645d10b013325b4d78493bde397e905af
spec/unit/result_queue_spec.rb
spec/unit/result_queue_spec.rb
require 'spec_helper' describe Que::ResultQueue do let :result_queue do Que::ResultQueue.new end describe "#push and #clear" do it "should add items and remove all items from the result queue" do ids = (1..100).to_a.shuffle threads = ids.each_slice(25).to_a.map do |id_set| Thread.new do id_set.each do |id| result_queue.push(id) end end end threads.each &:join assert_equal (1..100).to_a, result_queue.clear.sort assert_equal [], result_queue.clear end end end
require 'spec_helper' describe Que::ResultQueue do let :result_queue do Que::ResultQueue.new end describe "#push and #clear" do it "should add items and remove all items from the result queue" do ids = (1..100).to_a.shuffle result_queue # Initialize before it's accessed by different threads. threads = ids.each_slice(25).to_a.map do |id_set| Thread.new do id_set.each do |id| result_queue.push(id) end end end threads.each &:join assert_equal (1..100).to_a, result_queue.clear.sort assert_equal [], result_queue.clear end end end
Fix another intermittent spec failure.
Fix another intermittent spec failure.
Ruby
mit
chanks/que,heroku/que
ruby
## Code Before: require 'spec_helper' describe Que::ResultQueue do let :result_queue do Que::ResultQueue.new end describe "#push and #clear" do it "should add items and remove all items from the result queue" do ids = (1..100).to_a.shuffle threads = ids.each_slice(25).to_a.map do |id_set| Thread.new do id_set.each do |id| result_queue.push(id) end end end threads.each &:join assert_equal (1..100).to_a, result_queue.clear.sort assert_equal [], result_queue.clear end end end ## Instruction: Fix another intermittent spec failure. ## Code After: require 'spec_helper' describe Que::ResultQueue do let :result_queue do Que::ResultQueue.new end describe "#push and #clear" do it "should add items and remove all items from the result queue" do ids = (1..100).to_a.shuffle result_queue # Initialize before it's accessed by different threads. threads = ids.each_slice(25).to_a.map do |id_set| Thread.new do id_set.each do |id| result_queue.push(id) end end end threads.each &:join assert_equal (1..100).to_a, result_queue.clear.sort assert_equal [], result_queue.clear end end end
b674ada8bca18bc2ba0e545d73f79459cc27dd88
src/v2/Apps/ArtistSeries/routes.tsx
src/v2/Apps/ArtistSeries/routes.tsx
import loadable from "@loadable/component" import { graphql } from "react-relay" import { RouteConfig } from "found" // import React from "react" const ArtistSeriesApp = loadable(() => import("./ArtistSeriesApp")) // const ArtistSeriesApp = props => <h1>{props.artistSeries.internalID}</h1> export const routes: RouteConfig[] = [ { path: "/artist-series/:slug", getComponent: () => ArtistSeriesApp, prepare: () => { ArtistSeriesApp.preload() }, query: graphql` query routes_ArtistSeriesQuery($slug: ID!) { artistSeries(id: $slug) { ...ArtistSeriesApp_artistSeries } } `, }, ]
import loadable from "@loadable/component" import { graphql } from "react-relay" import { RouteConfig } from "found" const ArtistSeriesApp = loadable(() => import("./ArtistSeriesApp")) export const routes: RouteConfig[] = [ { path: "/artist-series/:slug", getComponent: () => ArtistSeriesApp, prepare: () => { ArtistSeriesApp.preload() }, query: graphql` query routes_ArtistSeriesQuery($slug: ID!) { artistSeries(id: $slug) { ...ArtistSeriesApp_artistSeries } } `, }, ]
Remove leftover commented out code
Remove leftover commented out code
TypeScript
mit
oxaudo/force,oxaudo/force,oxaudo/force,artsy/force,artsy/force,eessex/force,eessex/force,joeyAghion/force,artsy/force-public,artsy/force-public,eessex/force,joeyAghion/force,joeyAghion/force,joeyAghion/force,oxaudo/force,eessex/force,artsy/force,artsy/force
typescript
## Code Before: import loadable from "@loadable/component" import { graphql } from "react-relay" import { RouteConfig } from "found" // import React from "react" const ArtistSeriesApp = loadable(() => import("./ArtistSeriesApp")) // const ArtistSeriesApp = props => <h1>{props.artistSeries.internalID}</h1> export const routes: RouteConfig[] = [ { path: "/artist-series/:slug", getComponent: () => ArtistSeriesApp, prepare: () => { ArtistSeriesApp.preload() }, query: graphql` query routes_ArtistSeriesQuery($slug: ID!) { artistSeries(id: $slug) { ...ArtistSeriesApp_artistSeries } } `, }, ] ## Instruction: Remove leftover commented out code ## Code After: import loadable from "@loadable/component" import { graphql } from "react-relay" import { RouteConfig } from "found" const ArtistSeriesApp = loadable(() => import("./ArtistSeriesApp")) export const routes: RouteConfig[] = [ { path: "/artist-series/:slug", getComponent: () => ArtistSeriesApp, prepare: () => { ArtistSeriesApp.preload() }, query: graphql` query routes_ArtistSeriesQuery($slug: ID!) { artistSeries(id: $slug) { ...ArtistSeriesApp_artistSeries } } `, }, ]
76dc1e71be25b6a1f654aa71c272b04b3d0ca50b
templates/includes/article_precontent.html
templates/includes/article_precontent.html
{% if article.series %} <p>This post is part ({{ article.series.index }}/{{ article.series.all|count }}) of the "<a href="{{ SITEURL }}/{{ article.series.all[0].url }}">{{ article.series.name }}</a>" series:</p> <ol class="parts"> {% for part_article in article.series.all %} <li {% if part_article == article %}class="active"{% endif %}> <a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a> </li> {% endfor %} </ol> <hr> {% endif %}
{% if article.series %} {% if article.status != "draft" and article.status != "hidden" %} <p>This post is part ({{ article.series.index }}/{{ article.series.all|count }}) of the "<a href="{{ SITEURL }}/{{ article.series.all[0].url }}">{{ article.series.name }}</a>" series:</p> <ol class="parts"> {% for part_article in article.series.all %} <li {% if part_article == article %}class="active"{% endif %}> <a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a> </li> {% endfor %} </ol> <hr> {% endif %} {% endif %}
Add check to limit series to published posts
Add check to limit series to published posts
HTML
mit
sanjayankur31/voidy-bootstrap
html
## Code Before: {% if article.series %} <p>This post is part ({{ article.series.index }}/{{ article.series.all|count }}) of the "<a href="{{ SITEURL }}/{{ article.series.all[0].url }}">{{ article.series.name }}</a>" series:</p> <ol class="parts"> {% for part_article in article.series.all %} <li {% if part_article == article %}class="active"{% endif %}> <a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a> </li> {% endfor %} </ol> <hr> {% endif %} ## Instruction: Add check to limit series to published posts ## Code After: {% if article.series %} {% if article.status != "draft" and article.status != "hidden" %} <p>This post is part ({{ article.series.index }}/{{ article.series.all|count }}) of the "<a href="{{ SITEURL }}/{{ article.series.all[0].url }}">{{ article.series.name }}</a>" series:</p> <ol class="parts"> {% for part_article in article.series.all %} <li {% if part_article == article %}class="active"{% endif %}> <a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a> </li> {% endfor %} </ol> <hr> {% endif %} {% endif %}
834f08110d4c4c0c4e38e2a917c0c774a6c071fa
.travis.yml
.travis.yml
language: php php: - 5.6 services: - redis-server before_script: - mysql -uroot -e 'create database rena;' - wget http://getcomposer.org/composer.phar - php composer.phar install --dev --no-interaction -o - ls -alh - cp tests/config.php config/config.php - cat config/config.php - cp tests/phinx.yml . - cat phinx.yml - phpenv config-add tests/phpsettings.ini - php vendor/bin/phinx migrate - php vendor/bin/phinx status script: - phpunit --coverage-clover=coverage.clover --bootstrap tests/init.php tests/* - php tests/coverage-checker.php coverage.clover 75 after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
sudo: true language: php php: - 5.6 services: - redis-server before_script: - sudo service mysql stop - sudo apt-get install python-software-properties - sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db - sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main' - sudo apt-get update -y - sudo apt-get install mariadb-server -y - mysql -uroot -e 'INSTALL SONAME "ha_tokudb"'; - mysql -uroot -e 'create database rena;' - wget http://getcomposer.org/composer.phar - php composer.phar install --dev --no-interaction -o - ls -alh - cp tests/config.php config/config.php - cat config/config.php - cp tests/phinx.yml . - cat phinx.yml - phpenv config-add tests/phpsettings.ini - php vendor/bin/phinx migrate - php vendor/bin/phinx status script: - phpunit --coverage-clover=coverage.clover --bootstrap tests/init.php tests/* - php tests/coverage-checker.php coverage.clover 75 after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
Add mariadb instead of mysql, also setup tokudb..
Add mariadb instead of mysql, also setup tokudb..
YAML
mit
EVE-KILL/projectRena,EVE-KILL/projectRena,EVE-KILL/projectRena
yaml
## Code Before: language: php php: - 5.6 services: - redis-server before_script: - mysql -uroot -e 'create database rena;' - wget http://getcomposer.org/composer.phar - php composer.phar install --dev --no-interaction -o - ls -alh - cp tests/config.php config/config.php - cat config/config.php - cp tests/phinx.yml . - cat phinx.yml - phpenv config-add tests/phpsettings.ini - php vendor/bin/phinx migrate - php vendor/bin/phinx status script: - phpunit --coverage-clover=coverage.clover --bootstrap tests/init.php tests/* - php tests/coverage-checker.php coverage.clover 75 after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover ## Instruction: Add mariadb instead of mysql, also setup tokudb.. ## Code After: sudo: true language: php php: - 5.6 services: - redis-server before_script: - sudo service mysql stop - sudo apt-get install python-software-properties - sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db - sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main' - sudo apt-get update -y - sudo apt-get install mariadb-server -y - mysql -uroot -e 'INSTALL SONAME "ha_tokudb"'; - mysql -uroot -e 'create database rena;' - wget http://getcomposer.org/composer.phar - php composer.phar install --dev --no-interaction -o - ls -alh - cp tests/config.php config/config.php - cat config/config.php - cp tests/phinx.yml . - cat phinx.yml - phpenv config-add tests/phpsettings.ini - php vendor/bin/phinx migrate - php vendor/bin/phinx status script: - phpunit --coverage-clover=coverage.clover --bootstrap tests/init.php tests/* - php tests/coverage-checker.php coverage.clover 75 after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
e7de2460160568b28ec1b0d7b28290e0983ef799
STYLE-GUIDE.md
STYLE-GUIDE.md
https://github.com/airbnb/javascript
Forked copy of Airbnb style-guide [here](https://github.com/MapReactor/javascript). Use the `javascript/linters/.eslintrc` file as a starting point for your project's .eslintrc.
Add link to forked airbnb style-guide repo.
Add link to forked airbnb style-guide repo.
Markdown
mit
MapReactor/Sonder,MapReactor/Sonder,MapReactor/Sonder,MapReactor/Sonder,MapReactor/Sonder
markdown
## Code Before: https://github.com/airbnb/javascript ## Instruction: Add link to forked airbnb style-guide repo. ## Code After: Forked copy of Airbnb style-guide [here](https://github.com/MapReactor/javascript). Use the `javascript/linters/.eslintrc` file as a starting point for your project's .eslintrc.
578314dfc2eec055f224251577ae05e771f0b736
.travis.yml
.travis.yml
language: dart dart: - dev script: - dartanalyzer --fatal-warnings --fatal-lints --strong . - pub run test
language: dart script: - dartanalyzer --fatal-warnings --fatal-lints . - pub run test
Stop testing with the dev branch of Dart
Stop testing with the dev branch of Dart
YAML
bsd-3-clause
filiph/markov
yaml
## Code Before: language: dart dart: - dev script: - dartanalyzer --fatal-warnings --fatal-lints --strong . - pub run test ## Instruction: Stop testing with the dev branch of Dart ## Code After: language: dart script: - dartanalyzer --fatal-warnings --fatal-lints . - pub run test
aadffa19c05715f281667e6a5fa4945881334978
make.bat
make.bat
@rem if we don't have nmake in the path, we need to run setup where nmake.exe 2> NUL if %ERRORLEVEL% GTR 0 set need_setup=1 @rem if we don't have the include path set, we need to run setup if not defined INCLUDE set need_setup=1 @rem run setup if we need to if %need_setup% == 1 call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 @rem Allow python build to succeed: @rem http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat SET VS90COMNTOOLS=%VS120COMNTOOLS% @rem finally, run make nmake /nologo /s /f winbuild\Makefile %1
@rem if we don't have nmake in the path, we need to run setup where nmake.exe 2> NUL if %ERRORLEVEL% GTR 0 set need_setup=1 @rem if we don't have the include path set, we need to run setup if not defined INCLUDE set need_setup=1 @rem run setup if we need to if %need_setup% == 1 call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 @rem Allow python build to succeed: @rem http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat SET VS90COMNTOOLS=%VS120COMNTOOLS% where python.exe 2> NUL if %ERRORLEVEL% GTR 0 set PATH=c:\Python27;%PATH% where php.exe 2> NUL if %ERRORLEVEL% GTR 0 set PATH=c:\php;%PATH% @rem finally, run make nmake /nologo /s /f winbuild\Makefile %1
Adjust windows build script some more
Adjust windows build script some more Make a guess about php and python locations
Batchfile
mit
wez/watchman,nodakai/watchman,dhruvsinghal/watchman,dhruvsinghal/watchman,kwlzn/watchman,wez/watchman,nodakai/watchman,dhruvsinghal/watchman,kwlzn/watchman,dhruvsinghal/watchman,dhruvsinghal/watchman,dcolascione/laptop-watchman,nodakai/watchman,wez/watchman,kwlzn/watchman,wez/watchman,dcolascione/laptop-watchman,facebook/watchman,wez/watchman,nodakai/watchman,wez/watchman,facebook/watchman,kwlzn/watchman,facebook/watchman,wez/watchman,wez/watchman,facebook/watchman,nodakai/watchman,nodakai/watchman,dcolascione/laptop-watchman,dcolascione/laptop-watchman,dhruvsinghal/watchman,dhruvsinghal/watchman,wez/watchman,dcolascione/laptop-watchman,facebook/watchman,kwlzn/watchman,facebook/watchman,facebook/watchman,facebook/watchman,dcolascione/laptop-watchman,dcolascione/laptop-watchman,facebook/watchman,dhruvsinghal/watchman,nodakai/watchman,dcolascione/laptop-watchman,kwlzn/watchman,kwlzn/watchman,nodakai/watchman,nodakai/watchman
batchfile
## Code Before: @rem if we don't have nmake in the path, we need to run setup where nmake.exe 2> NUL if %ERRORLEVEL% GTR 0 set need_setup=1 @rem if we don't have the include path set, we need to run setup if not defined INCLUDE set need_setup=1 @rem run setup if we need to if %need_setup% == 1 call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 @rem Allow python build to succeed: @rem http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat SET VS90COMNTOOLS=%VS120COMNTOOLS% @rem finally, run make nmake /nologo /s /f winbuild\Makefile %1 ## Instruction: Adjust windows build script some more Make a guess about php and python locations ## Code After: @rem if we don't have nmake in the path, we need to run setup where nmake.exe 2> NUL if %ERRORLEVEL% GTR 0 set need_setup=1 @rem if we don't have the include path set, we need to run setup if not defined INCLUDE set need_setup=1 @rem run setup if we need to if %need_setup% == 1 call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 @rem Allow python build to succeed: @rem http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat SET VS90COMNTOOLS=%VS120COMNTOOLS% where python.exe 2> NUL if %ERRORLEVEL% GTR 0 set PATH=c:\Python27;%PATH% where php.exe 2> NUL if %ERRORLEVEL% GTR 0 set PATH=c:\php;%PATH% @rem finally, run make nmake /nologo /s /f winbuild\Makefile %1
2168a53a5fa4f1d19eafd2cc8a3c8eede9fc3db5
config/environments/development.js
config/environments/development.js
var express = require('express'); module.exports = function() { this.use(express.errorHandler({ dumpExceptions: true, showStack: true })); this.set('db-uri', 'mongodb://localhost/rezerve'); this.set('view options', { pretty: true }); }
var express = require('express'); var utils = require('connect').utils; module.exports = function() { this.set('db-uri', 'mongodb://localhost/rezerve'); this.use(express.errorHandler({ dumpExceptions: true, showStack: true })); // Set pretty prints this.express.locals.pretty = true; };
Add pretty print for Jade HTML output
Add pretty print for Jade HTML output
JavaScript
mit
pblondin/re-zerve,pblondin/re-zerve
javascript
## Code Before: var express = require('express'); module.exports = function() { this.use(express.errorHandler({ dumpExceptions: true, showStack: true })); this.set('db-uri', 'mongodb://localhost/rezerve'); this.set('view options', { pretty: true }); } ## Instruction: Add pretty print for Jade HTML output ## Code After: var express = require('express'); var utils = require('connect').utils; module.exports = function() { this.set('db-uri', 'mongodb://localhost/rezerve'); this.use(express.errorHandler({ dumpExceptions: true, showStack: true })); // Set pretty prints this.express.locals.pretty = true; };
d768f84579e2c426159df0d5725f212b629b03ef
.travis.yml
.travis.yml
language: python sudo: required python: - '2.7' - '3.5' services: - docker before_install: # Set base Python image version (leverages Travis build matrix) - sed -i'' "s/^\(FROM python:\).*/\1${TRAVIS_PYTHON_VERSION}/" Dockerfile install: - docker build --tag betty . script: - docker run betty py.test --cov betty --cov-report term-missing - docker run betty flake8 . after_success: - docker run betty coveralls
language: python sudo: required python: - '2.7' - '3.5' services: - docker before_install: # Set base Python image version (leverages Travis build matrix) - sed -i'' "s/^\(FROM python:\).*/\1${TRAVIS_PYTHON_VERSION}/" Dockerfile install: - docker build --tag betty . script: - docker run betty py.test --cov betty --cov-report term-missing - docker run betty flake8 .
Disable coveralls (not really using it, and harder to integrate with Docker)
Disable coveralls (not really using it, and harder to integrate with Docker)
YAML
mit
theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper
yaml
## Code Before: language: python sudo: required python: - '2.7' - '3.5' services: - docker before_install: # Set base Python image version (leverages Travis build matrix) - sed -i'' "s/^\(FROM python:\).*/\1${TRAVIS_PYTHON_VERSION}/" Dockerfile install: - docker build --tag betty . script: - docker run betty py.test --cov betty --cov-report term-missing - docker run betty flake8 . after_success: - docker run betty coveralls ## Instruction: Disable coveralls (not really using it, and harder to integrate with Docker) ## Code After: language: python sudo: required python: - '2.7' - '3.5' services: - docker before_install: # Set base Python image version (leverages Travis build matrix) - sed -i'' "s/^\(FROM python:\).*/\1${TRAVIS_PYTHON_VERSION}/" Dockerfile install: - docker build --tag betty . script: - docker run betty py.test --cov betty --cov-report term-missing - docker run betty flake8 .
c6f9e33c7bd4ddb8eb20c4d810988345668d01ae
Common/src/main/java/net/darkhax/bookshelf/api/item/ICreativeTabBuilder.java
Common/src/main/java/net/darkhax/bookshelf/api/item/ICreativeTabBuilder.java
package net.darkhax.bookshelf.api.item; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.level.ItemLike; import java.util.List; import java.util.function.Consumer; import java.util.function.Supplier; public interface ICreativeTabBuilder<BT extends ICreativeTabBuilder<BT>> { default BT setIcon(ItemLike icon) { return this.setIcon(new ItemStack(icon)); } default BT setIcon(ItemStack icon) { return setIcon(() -> icon); } BT setIcon(Supplier<ItemStack> iconSupplier); BT setEnchantmentCategories(EnchantmentCategory... categories); default BT setTabContents(List<ItemStack> items) { return setTabContents(tabContents -> tabContents.addAll(items)); } BT setTabContents(Consumer<List<ItemStack>> contentSupplier); CreativeModeTab build(); ResourceLocation getTabId(); }
package net.darkhax.bookshelf.api.item; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.level.ItemLike; import java.util.List; import java.util.function.Consumer; import java.util.function.Supplier; public interface ICreativeTabBuilder<BT extends ICreativeTabBuilder<BT>> { default BT setIcon(ItemLike icon) { return this.setIcon(new ItemStack(icon)); } default BT setIcon(ItemStack icon) { return setIcon(() -> icon); } default BT setIconItem(Supplier<ItemLike> iconSupplier) { return this.setIcon(() -> new ItemStack(iconSupplier.get())); } BT setIcon(Supplier<ItemStack> iconSupplier); BT setEnchantmentCategories(EnchantmentCategory... categories); default BT setTabContents(List<ItemStack> items) { return setTabContents(tabContents -> tabContents.addAll(items)); } BT setTabContents(Consumer<List<ItemStack>> contentSupplier); CreativeModeTab build(); ResourceLocation getTabId(); }
Add support for item tab icon suppliers.
Add support for item tab icon suppliers.
Java
lgpl-2.1
Darkhax-Minecraft/Bookshelf
java
## Code Before: package net.darkhax.bookshelf.api.item; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.level.ItemLike; import java.util.List; import java.util.function.Consumer; import java.util.function.Supplier; public interface ICreativeTabBuilder<BT extends ICreativeTabBuilder<BT>> { default BT setIcon(ItemLike icon) { return this.setIcon(new ItemStack(icon)); } default BT setIcon(ItemStack icon) { return setIcon(() -> icon); } BT setIcon(Supplier<ItemStack> iconSupplier); BT setEnchantmentCategories(EnchantmentCategory... categories); default BT setTabContents(List<ItemStack> items) { return setTabContents(tabContents -> tabContents.addAll(items)); } BT setTabContents(Consumer<List<ItemStack>> contentSupplier); CreativeModeTab build(); ResourceLocation getTabId(); } ## Instruction: Add support for item tab icon suppliers. ## Code After: package net.darkhax.bookshelf.api.item; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.level.ItemLike; import java.util.List; import java.util.function.Consumer; import java.util.function.Supplier; public interface ICreativeTabBuilder<BT extends ICreativeTabBuilder<BT>> { default BT setIcon(ItemLike icon) { return this.setIcon(new ItemStack(icon)); } default BT setIcon(ItemStack icon) { return setIcon(() -> icon); } default BT setIconItem(Supplier<ItemLike> iconSupplier) { return this.setIcon(() -> new ItemStack(iconSupplier.get())); } BT setIcon(Supplier<ItemStack> iconSupplier); BT setEnchantmentCategories(EnchantmentCategory... categories); default BT setTabContents(List<ItemStack> items) { return setTabContents(tabContents -> tabContents.addAll(items)); } BT setTabContents(Consumer<List<ItemStack>> contentSupplier); CreativeModeTab build(); ResourceLocation getTabId(); }
37dd74cc1ba4a08a8d55ae2ea610f7d2ed8b518e
_protected/app/system/modules/payment/inc/class/GroupId.php
_protected/app/system/modules/payment/inc/class/GroupId.php
<?php /** * @author Pierre-Henry Soria <[email protected]> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Payment / Inc / Class */ namespace PH7; use PH7\Framework\Mvc\Model\DbConfig; class GroupId { const UNDELETABLE_GROUP_IDS = [ UserCoreModel::VISITOR_GROUP, UserCoreModel::PENDING_GROUP ]; /** * Checks if a membership group can be deleted or not. * * @param int $iMembershipId * * @return bool */ public static function undeletable($iMembershipId) { $aUndeletableGroups = self::UNDELETABLE_GROUP_IDS; $aUndeletableGroups[] = (int)DbConfig::getSetting('defaultMembershipGroupId'); $iMembershipId = (int)$iMembershipId; return in_array($iMembershipId, $aUndeletableGroups, true); } }
<?php /** * @author Pierre-Henry Soria <[email protected]> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Payment / Inc / Class */ namespace PH7; use PH7\Framework\Mvc\Model\DbConfig; class GroupId { const UNDELETABLE_GROUP_IDS = [ UserCoreModel::VISITOR_GROUP, UserCoreModel::PENDING_GROUP ]; /** * Checks if a membership group can be deleted or not. * * @param int $iMembershipId * @param int|null $iDefaultMembershipId Specify another value than the default membership ID set. Optional. * * @return bool */ public static function undeletable($iMembershipId, $iDefaultMembershipId = null) { if ($iDefaultMembershipId === null) { $iDefaultMembershipId = (int)DbConfig::getSetting('defaultMembershipGroupId'); } $aUndeletableGroups = self::UNDELETABLE_GROUP_IDS; $aUndeletableGroups[] = $iDefaultMembershipId; $iMembershipId = (int)$iMembershipId; return in_array($iMembershipId, $aUndeletableGroups, true); } }
Make Default Membership ID value modifiable from the method
Make Default Membership ID value modifiable from the method
PHP
mit
pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS
php
## Code Before: <?php /** * @author Pierre-Henry Soria <[email protected]> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Payment / Inc / Class */ namespace PH7; use PH7\Framework\Mvc\Model\DbConfig; class GroupId { const UNDELETABLE_GROUP_IDS = [ UserCoreModel::VISITOR_GROUP, UserCoreModel::PENDING_GROUP ]; /** * Checks if a membership group can be deleted or not. * * @param int $iMembershipId * * @return bool */ public static function undeletable($iMembershipId) { $aUndeletableGroups = self::UNDELETABLE_GROUP_IDS; $aUndeletableGroups[] = (int)DbConfig::getSetting('defaultMembershipGroupId'); $iMembershipId = (int)$iMembershipId; return in_array($iMembershipId, $aUndeletableGroups, true); } } ## Instruction: Make Default Membership ID value modifiable from the method ## Code After: <?php /** * @author Pierre-Henry Soria <[email protected]> * @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved. * @license GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. * @package PH7 / App / System / Module / Payment / Inc / Class */ namespace PH7; use PH7\Framework\Mvc\Model\DbConfig; class GroupId { const UNDELETABLE_GROUP_IDS = [ UserCoreModel::VISITOR_GROUP, UserCoreModel::PENDING_GROUP ]; /** * Checks if a membership group can be deleted or not. * * @param int $iMembershipId * @param int|null $iDefaultMembershipId Specify another value than the default membership ID set. Optional. * * @return bool */ public static function undeletable($iMembershipId, $iDefaultMembershipId = null) { if ($iDefaultMembershipId === null) { $iDefaultMembershipId = (int)DbConfig::getSetting('defaultMembershipGroupId'); } $aUndeletableGroups = self::UNDELETABLE_GROUP_IDS; $aUndeletableGroups[] = $iDefaultMembershipId; $iMembershipId = (int)$iMembershipId; return in_array($iMembershipId, $aUndeletableGroups, true); } }
0c4a26f20a9d3add76d208b31d36426ab9baafea
assets/js/effects.js
assets/js/effects.js
'use strict'; /* effects.js Contains the functionality for the scrolling fixed menu and the popup menu toggle */ $(document).ready(function(){ /* Menu Pop up Toggle */ $('#popmenu').click( function(){ $('#popup-menu').toggle('hide'); }); /* Smooth Scrolling */ $(function() { $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); /* Scroll Effect - can elements at different positions */ $(window).on("scroll", function() { //if (window.matchMedia("(min-width: 400px)").matches) { if($(window).scrollTop() > 35) { $('header').css('background-color', '#fff'); } else { $('header').css('background-color', 'transparent'); } //} else { //do nothing //} }); });
'use strict'; /* effects.js Contains the functionality for the scrolling fixed menu and the popup menu toggle */ $(document).ready(function(){ /* Menu Pop up Toggle */ $('#popmenu').click( function(){ $('#popup-menu').toggle('hide'); }); /* Smooth Scrolling */ $(function() { $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); /* Scroll Effect - can elements at different positions */ $(window).on("scroll", function() { if ($(window).scrollTop() > 35) { $('#site-header').addClass('top-bar--opaque'); } else { $('#site-header').removeClass('top-bar--opaque'); } }); });
Improve visibility of nav bar text on page scroll
Improve visibility of nav bar text on page scroll Also matches footer now as well.
JavaScript
mit
DanLaRoche/codeforfoco.github.io,CodeForFoco/codeforfoco.github.io,DanLaRoche/codeforfoco.github.io,CodeForFoco/codeforfoco.github.io,DanLaRoche/codeforfoco.github.io,CodeForFoco/codeforfoco.github.io
javascript
## Code Before: 'use strict'; /* effects.js Contains the functionality for the scrolling fixed menu and the popup menu toggle */ $(document).ready(function(){ /* Menu Pop up Toggle */ $('#popmenu').click( function(){ $('#popup-menu').toggle('hide'); }); /* Smooth Scrolling */ $(function() { $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); /* Scroll Effect - can elements at different positions */ $(window).on("scroll", function() { //if (window.matchMedia("(min-width: 400px)").matches) { if($(window).scrollTop() > 35) { $('header').css('background-color', '#fff'); } else { $('header').css('background-color', 'transparent'); } //} else { //do nothing //} }); }); ## Instruction: Improve visibility of nav bar text on page scroll Also matches footer now as well. ## Code After: 'use strict'; /* effects.js Contains the functionality for the scrolling fixed menu and the popup menu toggle */ $(document).ready(function(){ /* Menu Pop up Toggle */ $('#popmenu').click( function(){ $('#popup-menu').toggle('hide'); }); /* Smooth Scrolling */ $(function() { $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); /* Scroll Effect - can elements at different positions */ $(window).on("scroll", function() { if ($(window).scrollTop() > 35) { $('#site-header').addClass('top-bar--opaque'); } else { $('#site-header').removeClass('top-bar--opaque'); } }); });
18992c0e70e2e9cfc52c3ec5978f6f18754ee820
rails/app/views/policies/index.html.haml
rails/app/views/policies/index.html.haml
- content_for :title, 'Policies' %h1= yield :title %p Policies are stated positions on a particular issue. For example "Process asylum seekers offshore", or "Legalise same sex marriage". Each policy has a definition and a way to vote in relevant divisions in Parliament. %ul %li %a{:href => "account/addpolicy.php"} Make a new policy %p This table summarises all policies, including how many times they have "voted". Click on their name to get a comparison of a policy to all MPs. %b You can get a policy to the top by editing and correcting motion text for its divisions. %table.mps %tr.odd %td{:colspan => "4"} No policies match this person's votes. You can %a{:href => "/policies.php"} edit or make a policy that will appear here. %tr.headings %td Votes %i (unedited) %td Policy = "That makes #{@policies.size} policies which have voted in at least one division."
- content_for :title, 'Policies' %h1= yield :title %p Policies are stated positions on a particular issue. For example "Process asylum seekers offshore", or "Legalise same sex marriage". Each policy has a definition and a way to vote in relevant divisions in Parliament. %ul %li %a{:href => "account/addpolicy.php"} Make a new policy %p This table summarises all policies, including how many times they have "voted". Click on their name to get a comparison of a policy to all MPs. %b You can get a policy to the top by editing and correcting motion text for its divisions. %table.mps %tr.headings %td Votes %i (unedited) %td Policy %tr{:class => cycle('odd', 'even')} %td{:colspan => "4"} No policies match this person's votes. You can %a{:href => "/policies.php"} edit or make a policy that will appear here. = "That makes #{@policies.size} policies which have voted in at least one division."
Tidy up and improve the HTML formatting
Tidy up and improve the HTML formatting
Haml
agpl-3.0
mysociety/publicwhip,mysociety/publicwhip,mysociety/publicwhip
haml
## Code Before: - content_for :title, 'Policies' %h1= yield :title %p Policies are stated positions on a particular issue. For example "Process asylum seekers offshore", or "Legalise same sex marriage". Each policy has a definition and a way to vote in relevant divisions in Parliament. %ul %li %a{:href => "account/addpolicy.php"} Make a new policy %p This table summarises all policies, including how many times they have "voted". Click on their name to get a comparison of a policy to all MPs. %b You can get a policy to the top by editing and correcting motion text for its divisions. %table.mps %tr.odd %td{:colspan => "4"} No policies match this person's votes. You can %a{:href => "/policies.php"} edit or make a policy that will appear here. %tr.headings %td Votes %i (unedited) %td Policy = "That makes #{@policies.size} policies which have voted in at least one division." ## Instruction: Tidy up and improve the HTML formatting ## Code After: - content_for :title, 'Policies' %h1= yield :title %p Policies are stated positions on a particular issue. For example "Process asylum seekers offshore", or "Legalise same sex marriage". Each policy has a definition and a way to vote in relevant divisions in Parliament. %ul %li %a{:href => "account/addpolicy.php"} Make a new policy %p This table summarises all policies, including how many times they have "voted". Click on their name to get a comparison of a policy to all MPs. %b You can get a policy to the top by editing and correcting motion text for its divisions. %table.mps %tr.headings %td Votes %i (unedited) %td Policy %tr{:class => cycle('odd', 'even')} %td{:colspan => "4"} No policies match this person's votes. You can %a{:href => "/policies.php"} edit or make a policy that will appear here. = "That makes #{@policies.size} policies which have voted in at least one division."
062a6493be23522bf363d94486b639be82e07d62
package.json
package.json
{ "name": "asmsimulator", "version": "0.5.1", "description": "Simple 8-bit Assembler Simulator in Javascript", "author": "Marco Schweighauser", "license": "MIT", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-uglify": "~0.2.4", "grunt-contrib-jshint": "~0.7.0", "grunt-contrib-watch": "~0.5.3" } }
{ "name": "asmsimulator", "version": "0.5.1", "description": "Simple 8-bit Assembler Simulator in Javascript", "author": "Marco Schweighauser", "license": "MIT", "devDependencies": { "grunt": "~1.0.1", "grunt-contrib-concat": "~1.0.1", "grunt-contrib-uglify": "~2.3.0", "grunt-contrib-jshint": "~1.1.0", "grunt-contrib-watch": "~1.0.0" } }
Update dependencies to latest version
Update dependencies to latest version
JSON
mit
ihmels/asmsimulator,ihmels/asmsimulator
json
## Code Before: { "name": "asmsimulator", "version": "0.5.1", "description": "Simple 8-bit Assembler Simulator in Javascript", "author": "Marco Schweighauser", "license": "MIT", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-uglify": "~0.2.4", "grunt-contrib-jshint": "~0.7.0", "grunt-contrib-watch": "~0.5.3" } } ## Instruction: Update dependencies to latest version ## Code After: { "name": "asmsimulator", "version": "0.5.1", "description": "Simple 8-bit Assembler Simulator in Javascript", "author": "Marco Schweighauser", "license": "MIT", "devDependencies": { "grunt": "~1.0.1", "grunt-contrib-concat": "~1.0.1", "grunt-contrib-uglify": "~2.3.0", "grunt-contrib-jshint": "~1.1.0", "grunt-contrib-watch": "~1.0.0" } }
b8561df674c6362925a53205d93ca9383fc9bfc6
tests/Timezone/Earth/Antarctica/PalmerTest.php
tests/Timezone/Earth/Antarctica/PalmerTest.php
<?php declare(strict_types = 1); namespace Tests\Innmind\TimeContinuum\Timezone\Earth\Antarctica; use Innmind\TimeContinuum\{ Timezone\Earth\Antarctica\Palmer, TimezoneInterface }; class PalmerTest extends \PHPUnit_Framework_TestCase { public function testInterface() { $zone = new Palmer; $this->assertInstanceOf(TimezoneInterface::class, $zone); $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); return; //seems php doesn't take into account the change of using DST since 2016 if ($zone->daylightSavingTimeApplied()) { $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); } else { $this->assertSame(-4, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-04:00', (string) $zone); } } }
<?php declare(strict_types = 1); namespace Tests\Innmind\TimeContinuum\Timezone\Earth\Antarctica; use Innmind\TimeContinuum\{ Timezone\Earth\Antarctica\Palmer, TimezoneInterface }; class PalmerTest extends \PHPUnit_Framework_TestCase { public function testInterface() { $zone = new Palmer; $this->assertInstanceOf(TimezoneInterface::class, $zone); $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); $this->assertFalse($zone->daylightSavingTimeApplied()); return; //seems php doesn't take into account the change of using DST since 2016 if ($zone->daylightSavingTimeApplied()) { $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); } else { $this->assertSame(-4, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-04:00', (string) $zone); } } }
Revert "do not test the dst for palmer (do not understand php behaviour for this one)"
Revert "do not test the dst for palmer (do not understand php behaviour for this one)" This reverts commit a830d15881d2aafb11357c4591568ea53c60a22b.
PHP
mit
Innmind/TimeContinuum
php
## Code Before: <?php declare(strict_types = 1); namespace Tests\Innmind\TimeContinuum\Timezone\Earth\Antarctica; use Innmind\TimeContinuum\{ Timezone\Earth\Antarctica\Palmer, TimezoneInterface }; class PalmerTest extends \PHPUnit_Framework_TestCase { public function testInterface() { $zone = new Palmer; $this->assertInstanceOf(TimezoneInterface::class, $zone); $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); return; //seems php doesn't take into account the change of using DST since 2016 if ($zone->daylightSavingTimeApplied()) { $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); } else { $this->assertSame(-4, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-04:00', (string) $zone); } } } ## Instruction: Revert "do not test the dst for palmer (do not understand php behaviour for this one)" This reverts commit a830d15881d2aafb11357c4591568ea53c60a22b. ## Code After: <?php declare(strict_types = 1); namespace Tests\Innmind\TimeContinuum\Timezone\Earth\Antarctica; use Innmind\TimeContinuum\{ Timezone\Earth\Antarctica\Palmer, TimezoneInterface }; class PalmerTest extends \PHPUnit_Framework_TestCase { public function testInterface() { $zone = new Palmer; $this->assertInstanceOf(TimezoneInterface::class, $zone); $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); $this->assertFalse($zone->daylightSavingTimeApplied()); return; //seems php doesn't take into account the change of using DST since 2016 if ($zone->daylightSavingTimeApplied()) { $this->assertSame(-3, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-03:00', (string) $zone); } else { $this->assertSame(-4, $zone->hours()); $this->assertSame(0, $zone->minutes()); $this->assertSame('-04:00', (string) $zone); } } }
97c89395eb34093f103cc8816c1d2420e6c8e44d
index.php
index.php
<?php require_once('config.inc.php'); require_once('misc.inc.php'); require_once('db.inc.php'); require_once('html.inc.php'); date_default_timezone_set('Europe/Berlin'); setlocale(LC_TIME, 'de_DE'); session_start(); // Actual content generation: $db = new db(); switch ($_GET['view']) { case 'login': $source = new ovp_login($db); break; case 'print': authenticate(VIEW_PRINT, 'index.php?view=print'); if (isset($_GET['date'])) { $source = new ovp_print($db, $_GET['date']); } else { $source = new ovp_print($db); } break; case 'author': authenticate(VIEW_AUTHOR, 'index.php?view=author'); $source = new ovp_author($db); break; case 'admin': authenticate(VIEW_ADMIN, 'index.php?view=admin'); $source = new ovp_admin($db); break; case 'public': default: authenticate(VIEW_PUBLIC, 'index.php?view=public'); $source = new ovp_public($db); } $page = new ovp_page($source); exit($page->get_html()); ?>
<?php require_once('config.inc.php'); require_once('misc.inc.php'); require_once('db.inc.php'); require_once('html.inc.php'); date_default_timezone_set('Europe/Berlin'); setlocale(LC_TIME, 'de_DE'); session_start(); // Actual content generation: $db = new db(); switch ($_GET['view']) { case 'public': authenticate(VIEW_PUBLIC, 'index.php?view=public'); $source = new ovp_public($db); break; case 'print': authenticate(VIEW_PRINT, 'index.php?view=print'); if (isset($_GET['date'])) { $source = new ovp_print($db, $_GET['date']); } else { $source = new ovp_print($db); } break; case 'author': authenticate(VIEW_AUTHOR, 'index.php?view=author'); $source = new ovp_author($db); break; case 'admin': authenticate(VIEW_ADMIN, 'index.php?view=admin'); $source = new ovp_admin($db); break; case 'login': default: $source = new ovp_login($db); } $page = new ovp_page($source); exit($page->get_html()); ?>
Make login the default view
Make login the default view Signed-off-by: Josua Grawitter <[email protected]>
PHP
agpl-3.0
gwater/rlo-plan,gwater/rlo-plan
php
## Code Before: <?php require_once('config.inc.php'); require_once('misc.inc.php'); require_once('db.inc.php'); require_once('html.inc.php'); date_default_timezone_set('Europe/Berlin'); setlocale(LC_TIME, 'de_DE'); session_start(); // Actual content generation: $db = new db(); switch ($_GET['view']) { case 'login': $source = new ovp_login($db); break; case 'print': authenticate(VIEW_PRINT, 'index.php?view=print'); if (isset($_GET['date'])) { $source = new ovp_print($db, $_GET['date']); } else { $source = new ovp_print($db); } break; case 'author': authenticate(VIEW_AUTHOR, 'index.php?view=author'); $source = new ovp_author($db); break; case 'admin': authenticate(VIEW_ADMIN, 'index.php?view=admin'); $source = new ovp_admin($db); break; case 'public': default: authenticate(VIEW_PUBLIC, 'index.php?view=public'); $source = new ovp_public($db); } $page = new ovp_page($source); exit($page->get_html()); ?> ## Instruction: Make login the default view Signed-off-by: Josua Grawitter <[email protected]> ## Code After: <?php require_once('config.inc.php'); require_once('misc.inc.php'); require_once('db.inc.php'); require_once('html.inc.php'); date_default_timezone_set('Europe/Berlin'); setlocale(LC_TIME, 'de_DE'); session_start(); // Actual content generation: $db = new db(); switch ($_GET['view']) { case 'public': authenticate(VIEW_PUBLIC, 'index.php?view=public'); $source = new ovp_public($db); break; case 'print': authenticate(VIEW_PRINT, 'index.php?view=print'); if (isset($_GET['date'])) { $source = new ovp_print($db, $_GET['date']); } else { $source = new ovp_print($db); } break; case 'author': authenticate(VIEW_AUTHOR, 'index.php?view=author'); $source = new ovp_author($db); break; case 'admin': authenticate(VIEW_ADMIN, 'index.php?view=admin'); $source = new ovp_admin($db); break; case 'login': default: $source = new ovp_login($db); } $page = new ovp_page($source); exit($page->get_html()); ?>
b6ccc6b6ae6c5fab45f7a27dbecbda88cc8775b8
SplitNavigation.py
SplitNavigation.py
import sublime, sublime_plugin class SplitNavigationCommand(sublime_plugin.TextCommand): def run(self, edit, direction): win = self.view.window() num = win.num_groups() act = win.active_group() if direction == "up": act = act + 1 else: act = act - 1 win.focus_group(act % num)
import sublime, sublime_plugin def focusNext(win): act = win.active_group() num = win.num_groups() act += 1 if act >= num: act = 0 win.focus_group(act) if len(win.views_in_group(act)) == 0: focusNext(win) def focusPrev(win): act = win.active_group() num = win.num_groups() act -= 1 if act < 0: act = num - 1 win.focus_group(act) if len(win.views_in_group(act)) == 0: focusPrev(win) class SplitNavigationCommand(sublime_plugin.TextCommand): def run(self, edit, direction): win = self.view.window() if direction == "up": focusNext(win) else: focusPrev(win)
Fix some weird action when user navigates between blank groups.
Fix some weird action when user navigates between blank groups.
Python
mit
oleander/sublime-split-navigation,oleander/sublime-split-navigation
python
## Code Before: import sublime, sublime_plugin class SplitNavigationCommand(sublime_plugin.TextCommand): def run(self, edit, direction): win = self.view.window() num = win.num_groups() act = win.active_group() if direction == "up": act = act + 1 else: act = act - 1 win.focus_group(act % num) ## Instruction: Fix some weird action when user navigates between blank groups. ## Code After: import sublime, sublime_plugin def focusNext(win): act = win.active_group() num = win.num_groups() act += 1 if act >= num: act = 0 win.focus_group(act) if len(win.views_in_group(act)) == 0: focusNext(win) def focusPrev(win): act = win.active_group() num = win.num_groups() act -= 1 if act < 0: act = num - 1 win.focus_group(act) if len(win.views_in_group(act)) == 0: focusPrev(win) class SplitNavigationCommand(sublime_plugin.TextCommand): def run(self, edit, direction): win = self.view.window() if direction == "up": focusNext(win) else: focusPrev(win)
bb80a73b4120a8bdd241f475e50ca76fa5d2801f
app/views/layouts/_footer.html.erb
app/views/layouts/_footer.html.erb
<!-- FOOTER --> <footer class="footer-height"> <hr> <p ><a href="#">Back to top</a></p> <p>&copy; 2014-2018 Holly Moody, Developer ([email protected]) &middot; <%= link_to "Terms", welcome_license_path %></p> </footer>
<!-- FOOTER --> <footer class="footer-height"> <hr> <p ><a href="#">Back to top</a></p> <p>&copy; 2014-2018 <%= link_to "Holly Moody", "http://www.linkedin.com/in/hollycmoody/", target: "_blank" %> &middot; <%= link_to "Terms", welcome_license_path %></p> </footer>
Tweak copyright to link to my linkedin profile.
Tweak copyright to link to my linkedin profile.
HTML+ERB
mit
HollyM021980/DnDCharacterSheet,HollyM021980/DnDCharacterSheet
html+erb
## Code Before: <!-- FOOTER --> <footer class="footer-height"> <hr> <p ><a href="#">Back to top</a></p> <p>&copy; 2014-2018 Holly Moody, Developer ([email protected]) &middot; <%= link_to "Terms", welcome_license_path %></p> </footer> ## Instruction: Tweak copyright to link to my linkedin profile. ## Code After: <!-- FOOTER --> <footer class="footer-height"> <hr> <p ><a href="#">Back to top</a></p> <p>&copy; 2014-2018 <%= link_to "Holly Moody", "http://www.linkedin.com/in/hollycmoody/", target: "_blank" %> &middot; <%= link_to "Terms", welcome_license_path %></p> </footer>
548fb65618dfce8aa43671f79231628a773a8f88
imagekit/admin.py
imagekit/admin.py
from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string class AdminThumbnail(object): """ A convenience utility for adding thumbnails to Django's admin change list. """ short_description = _('Thumbnail') allow_tags = True def __init__(self, image_field, template=None): """ :param image_field: The name of the ImageField or ImageSpecField on the model to use for the thumbnail. :param template: The template with which to render the thumbnail """ self.image_field = image_field self.template = template def __call__(self, obj): try: thumbnail = getattr(obj, self.image_field) except AttributeError: raise Exception('The property %s is not defined on %s.' % \ (self.image_field, obj.__class__.__name__)) original_image = getattr(thumbnail, 'source_file', None) or thumbnail template = self.template or 'imagekit/admin/thumbnail.html' return render_to_string(template, { 'model': obj, 'thumbnail': thumbnail, 'original_image': original_image, })
from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string class AdminThumbnail(object): """ A convenience utility for adding thumbnails to Django's admin change list. """ short_description = _('Thumbnail') allow_tags = True def __init__(self, image_field, template=None): """ :param image_field: The name of the ImageField or ImageSpecField on the model to use for the thumbnail. :param template: The template with which to render the thumbnail """ self.image_field = image_field self.template = template def __call__(self, obj): if callable(self.image_field): thumbnail = self.image_field(obj) else: try: thumbnail = getattr(obj, self.image_field) except AttributeError: raise Exception('The property %s is not defined on %s.' % \ (self.image_field, obj.__class__.__name__)) original_image = getattr(thumbnail, 'source_file', None) or thumbnail template = self.template or 'imagekit/admin/thumbnail.html' return render_to_string(template, { 'model': obj, 'thumbnail': thumbnail, 'original_image': original_image, })
Allow callables for AdminThumbnail image_field arg
Allow callables for AdminThumbnail image_field arg This allows images from related models to be displayed. Closes #138.
Python
bsd-3-clause
pcompassion/django-imagekit,pcompassion/django-imagekit,tawanda/django-imagekit,pcompassion/django-imagekit,tawanda/django-imagekit,FundedByMe/django-imagekit,FundedByMe/django-imagekit
python
## Code Before: from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string class AdminThumbnail(object): """ A convenience utility for adding thumbnails to Django's admin change list. """ short_description = _('Thumbnail') allow_tags = True def __init__(self, image_field, template=None): """ :param image_field: The name of the ImageField or ImageSpecField on the model to use for the thumbnail. :param template: The template with which to render the thumbnail """ self.image_field = image_field self.template = template def __call__(self, obj): try: thumbnail = getattr(obj, self.image_field) except AttributeError: raise Exception('The property %s is not defined on %s.' % \ (self.image_field, obj.__class__.__name__)) original_image = getattr(thumbnail, 'source_file', None) or thumbnail template = self.template or 'imagekit/admin/thumbnail.html' return render_to_string(template, { 'model': obj, 'thumbnail': thumbnail, 'original_image': original_image, }) ## Instruction: Allow callables for AdminThumbnail image_field arg This allows images from related models to be displayed. Closes #138. ## Code After: from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string class AdminThumbnail(object): """ A convenience utility for adding thumbnails to Django's admin change list. """ short_description = _('Thumbnail') allow_tags = True def __init__(self, image_field, template=None): """ :param image_field: The name of the ImageField or ImageSpecField on the model to use for the thumbnail. :param template: The template with which to render the thumbnail """ self.image_field = image_field self.template = template def __call__(self, obj): if callable(self.image_field): thumbnail = self.image_field(obj) else: try: thumbnail = getattr(obj, self.image_field) except AttributeError: raise Exception('The property %s is not defined on %s.' % \ (self.image_field, obj.__class__.__name__)) original_image = getattr(thumbnail, 'source_file', None) or thumbnail template = self.template or 'imagekit/admin/thumbnail.html' return render_to_string(template, { 'model': obj, 'thumbnail': thumbnail, 'original_image': original_image, })
2b612556339a343a7b5b5853117e4aa1cdeb710b
app/src/main/kotlin/com/github/ramonrabello/kiphy/trends/data/TrendingRepository.kt
app/src/main/kotlin/com/github/ramonrabello/kiphy/trends/data/TrendingRepository.kt
package com.github.ramonrabello.kiphy.trends.data import io.reactivex.Single class TrendingRepository( private val localDataSource: TrendingDataSource, private val remoteDataSource: TrendingDataSource) { fun loadTrending() = Single.merge( remoteDataSource.loadTrending(), localDataSource.loadTrending()) }
package com.github.ramonrabello.kiphy.trends.data import com.github.ramonrabello.kiphy.trends.data.source.TrendingDataSource import io.reactivex.Single class TrendingRepository( private val localDataSource: TrendingDataSource, private val remoteDataSource: TrendingDataSource) { fun loadTrending() = Single.merge( remoteDataSource.loadTrending(), localDataSource.loadTrending()) }
Update constructor to use both local and remote data source.
Update constructor to use both local and remote data source.
Kotlin
apache-2.0
ramonrabello/Kiphy
kotlin
## Code Before: package com.github.ramonrabello.kiphy.trends.data import io.reactivex.Single class TrendingRepository( private val localDataSource: TrendingDataSource, private val remoteDataSource: TrendingDataSource) { fun loadTrending() = Single.merge( remoteDataSource.loadTrending(), localDataSource.loadTrending()) } ## Instruction: Update constructor to use both local and remote data source. ## Code After: package com.github.ramonrabello.kiphy.trends.data import com.github.ramonrabello.kiphy.trends.data.source.TrendingDataSource import io.reactivex.Single class TrendingRepository( private val localDataSource: TrendingDataSource, private val remoteDataSource: TrendingDataSource) { fun loadTrending() = Single.merge( remoteDataSource.loadTrending(), localDataSource.loadTrending()) }
6e8a5687a38b837ab606e84a8177ea74edfaad12
src/buildercore/fastly/vcl/original-host.vcl
src/buildercore/fastly/vcl/original-host.vcl
set req.http.X-Forwarded-Host = req.http.host;
if (!req.http.Fastly-FF) { set req.http.X-Forwarded-Host = req.http.host; }
Make X-Forwarded-Host compatible with Fastly shielding
Make X-Forwarded-Host compatible with Fastly shielding
VCL
mit
elifesciences/builder,elifesciences/builder
vcl
## Code Before: set req.http.X-Forwarded-Host = req.http.host; ## Instruction: Make X-Forwarded-Host compatible with Fastly shielding ## Code After: if (!req.http.Fastly-FF) { set req.http.X-Forwarded-Host = req.http.host; }
33ceea40e41d9f568b11e30779b8b7c16ba8f5b8
bench/split-file.py
bench/split-file.py
import sys prefix = sys.argv[1] filename = sys.argv[2] f = open(filename) sf = None for line in f: if line.startswith('Processing database:'): if sf: sf.close() line2 = line.split(':')[1] # Check if entry is compressed and if has to be processed line2 = line2[:line2.rfind('.')] params = line2.split('-') optlevel = 0 complib = None for param in params: if param[0] == 'O' and param[1].isdigit(): optlevel = int(param[1]) elif param[:-1] in ('zlib', 'lzo'): complib = param if complib: sfilename = "%s-O%s-%s.out" % (prefix, optlevel, complib) else: sfilename = "%s-O%s.out" % (prefix, optlevel,) sf = file(sfilename, 'a') sf.write(line) f.close()
import sys prefix = sys.argv[1] filename = sys.argv[2] f = open(filename) sf = None for line in f: if line.startswith('Processing database:'): if sf: sf.close() line2 = line.split(':')[1] # Check if entry is compressed and if has to be processed line2 = line2[:line2.rfind('.')] params = line2.split('-') optlevel = 0 complib = None for param in params: if param[0] == 'O' and param[1].isdigit(): optlevel = int(param[1]) elif param[:-1] in ('zlib', 'lzo'): complib = param if 'PyTables' in prefix: if complib: sfilename = "%s-O%s-%s.out" % (prefix, optlevel, complib) else: sfilename = "%s-O%s.out" % (prefix, optlevel,) else: sfilename = "%s.out" % (prefix,) sf = file(sfilename, 'a') if sf: sf.write(line) f.close()
Support for splitting outputs for PyTables and Postgres indexing benchmarks all in one.
Support for splitting outputs for PyTables and Postgres indexing benchmarks all in one. git-svn-id: 92c705c98a17f0f7623a131b3c42ed50fcde59b4@2885 1b98710c-d8ec-0310-ae81-f5f2bcd8cb94
Python
bsd-3-clause
jennolsen84/PyTables,rabernat/PyTables,avalentino/PyTables,jack-pappas/PyTables,rdhyee/PyTables,gdementen/PyTables,joonro/PyTables,PyTables/PyTables,mohamed-ali/PyTables,andreabedini/PyTables,tp199911/PyTables,jennolsen84/PyTables,tp199911/PyTables,dotsdl/PyTables,cpcloud/PyTables,tp199911/PyTables,FrancescAlted/PyTables,PyTables/PyTables,dotsdl/PyTables,cpcloud/PyTables,rabernat/PyTables,rabernat/PyTables,andreabedini/PyTables,mohamed-ali/PyTables,gdementen/PyTables,jack-pappas/PyTables,jack-pappas/PyTables,rdhyee/PyTables,mohamed-ali/PyTables,FrancescAlted/PyTables,rdhyee/PyTables,PyTables/PyTables,cpcloud/PyTables,avalentino/PyTables,avalentino/PyTables,rdhyee/PyTables,gdementen/PyTables,rabernat/PyTables,jennolsen84/PyTables,jennolsen84/PyTables,tp199911/PyTables,andreabedini/PyTables,dotsdl/PyTables,mohamed-ali/PyTables,joonro/PyTables,joonro/PyTables,andreabedini/PyTables,jack-pappas/PyTables,dotsdl/PyTables,jack-pappas/PyTables,gdementen/PyTables,cpcloud/PyTables,FrancescAlted/PyTables,joonro/PyTables
python
## Code Before: import sys prefix = sys.argv[1] filename = sys.argv[2] f = open(filename) sf = None for line in f: if line.startswith('Processing database:'): if sf: sf.close() line2 = line.split(':')[1] # Check if entry is compressed and if has to be processed line2 = line2[:line2.rfind('.')] params = line2.split('-') optlevel = 0 complib = None for param in params: if param[0] == 'O' and param[1].isdigit(): optlevel = int(param[1]) elif param[:-1] in ('zlib', 'lzo'): complib = param if complib: sfilename = "%s-O%s-%s.out" % (prefix, optlevel, complib) else: sfilename = "%s-O%s.out" % (prefix, optlevel,) sf = file(sfilename, 'a') sf.write(line) f.close() ## Instruction: Support for splitting outputs for PyTables and Postgres indexing benchmarks all in one. git-svn-id: 92c705c98a17f0f7623a131b3c42ed50fcde59b4@2885 1b98710c-d8ec-0310-ae81-f5f2bcd8cb94 ## Code After: import sys prefix = sys.argv[1] filename = sys.argv[2] f = open(filename) sf = None for line in f: if line.startswith('Processing database:'): if sf: sf.close() line2 = line.split(':')[1] # Check if entry is compressed and if has to be processed line2 = line2[:line2.rfind('.')] params = line2.split('-') optlevel = 0 complib = None for param in params: if param[0] == 'O' and param[1].isdigit(): optlevel = int(param[1]) elif param[:-1] in ('zlib', 'lzo'): complib = param if 'PyTables' in prefix: if complib: sfilename = "%s-O%s-%s.out" % (prefix, optlevel, complib) else: sfilename = "%s-O%s.out" % (prefix, optlevel,) else: sfilename = "%s.out" % (prefix,) sf = file(sfilename, 'a') if sf: sf.write(line) f.close()
1e5ebe3c3430888821c77b5b23213f382333598e
src/lunch.coffee
src/lunch.coffee
module.exports = (robot) -> robot.hear /lunch/i, (msg) -> if ! isPastLunchTime() then msg.reply "Hey #{msg.message.user.name}, isn't it a bit early to start talking about lunch?" isPastLunchTime = (time) -> return time.getHours() > 12
module.exports = (robot) -> robot.hear /lunch/i, (msg) -> if ! isPastLunchTime() then msg.reply "Hey #{msg.message.user.name}, isn't it a bit early to start talking about lunch?" isPastLunchTime = -> return new Date().getHours() > 12
Use the date object instead of a param
Use the date object instead of a param
CoffeeScript
mit
arosenb2/hubot-lunch
coffeescript
## Code Before: module.exports = (robot) -> robot.hear /lunch/i, (msg) -> if ! isPastLunchTime() then msg.reply "Hey #{msg.message.user.name}, isn't it a bit early to start talking about lunch?" isPastLunchTime = (time) -> return time.getHours() > 12 ## Instruction: Use the date object instead of a param ## Code After: module.exports = (robot) -> robot.hear /lunch/i, (msg) -> if ! isPastLunchTime() then msg.reply "Hey #{msg.message.user.name}, isn't it a bit early to start talking about lunch?" isPastLunchTime = -> return new Date().getHours() > 12
fc86ddacda98160646e0301fb21f6ebfbc271794
configs/virtualwire.json
configs/virtualwire.json
{ "name": "VirtualWire", "keywords": "rf, radio, protocol", "description": "It provides a simple message passing protocol for a range of inexpensive transmitter and receiver modules", "authors": { "name": "Mike McCauley", "email": "[email protected]" }, "version": "1.15", "downloadUrl": "https://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip", "exclude": "doc", "frameworks": "arduino", "platforms": "*" }
{ "name": "VirtualWire", "keywords": "rf, radio, protocol", "description": "It provides a simple message passing protocol for a range of inexpensive transmitter and receiver modules", "authors": { "name": "Mike McCauley", "email": "[email protected]" }, "version": "1.15", "downloadUrl": "https://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip", "include": "VirtualWire", "exclude": "doc", "frameworks": "arduino", "platforms": "*" }
Update config for VirtualWire library
Update config for VirtualWire library
JSON
apache-2.0
platformio/platformio-libmirror,platformio/platformio-libmirror
json
## Code Before: { "name": "VirtualWire", "keywords": "rf, radio, protocol", "description": "It provides a simple message passing protocol for a range of inexpensive transmitter and receiver modules", "authors": { "name": "Mike McCauley", "email": "[email protected]" }, "version": "1.15", "downloadUrl": "https://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip", "exclude": "doc", "frameworks": "arduino", "platforms": "*" } ## Instruction: Update config for VirtualWire library ## Code After: { "name": "VirtualWire", "keywords": "rf, radio, protocol", "description": "It provides a simple message passing protocol for a range of inexpensive transmitter and receiver modules", "authors": { "name": "Mike McCauley", "email": "[email protected]" }, "version": "1.15", "downloadUrl": "https://www.pjrc.com/teensy/arduino_libraries/VirtualWire.zip", "include": "VirtualWire", "exclude": "doc", "frameworks": "arduino", "platforms": "*" }
44728ce3574b7459e2c9304383fe2c1dc2dc0b8b
Source/Model/Connecting/Socket/Tcp/Method/MConnectingSocketTcpMethodTypeFactory.swift
Source/Model/Connecting/Socket/Tcp/Method/MConnectingSocketTcpMethodTypeFactory.swift
import Foundation extension MConnectingSocketTcpMethodType { private static func factoryMethod( type:MConnectingSocketTcpMethodType) -> MConnectingSocketTcpMethodProtocol.Type { switch type { case MConnectingSocketTcpMethodType.showpin: return MConnectingSocketTcpMethodShowpin.self case MConnectingSocketTcpMethodType.register: return MConnectingSocketTcpMethodRegister.self case MConnectingSocketTcpMethodType.registerResult: return MConnectingSocketTcpMethodRegisterResult.self case MConnectingSocketTcpMethodType.registerCancel: return MConnectingSocketTcpMethodRegisterCancel.self case MConnectingSocketTcpMethodType.connect: return MConnectingSocketTcpMethodConnect.self case MConnectingSocketTcpMethodType.standby: return MConnectingSocketTcpMethodStandby.self } } //MARK: internal static func factoryMethod( name:String, received:String) -> MConnectingSocketTcpMethodProtocol? { guard let type:MConnectingSocketTcpMethodType = MConnectingSocketTcpMethodType( rawValue:name) else { return nil } let methodType:MConnectingSocketTcpMethodProtocol.Type = factoryMethod( type:type) let method:MConnectingSocketTcpMethodProtocol = methodType.init( received:received) return method } }
import Foundation extension MConnectingSocketTcpMethodType { private static let kMethodMap:[ MConnectingSocketTcpMethodType: MConnectingSocketTcpMethodProtocol.Type] = [ MConnectingSocketTcpMethodType.showpin: MConnectingSocketTcpMethodShowpin.self, MConnectingSocketTcpMethodType.register: MConnectingSocketTcpMethodRegister.self, MConnectingSocketTcpMethodType.registerResult: MConnectingSocketTcpMethodRegisterResult.self, MConnectingSocketTcpMethodType.registerCancel: MConnectingSocketTcpMethodRegisterCancel.self, MConnectingSocketTcpMethodType.connect: MConnectingSocketTcpMethodConnect.self, MConnectingSocketTcpMethodType.standby: MConnectingSocketTcpMethodStandby.self] //MARK: internal static func factoryMethod( name:String, received:String) -> MConnectingSocketTcpMethodProtocol? { guard let type:MConnectingSocketTcpMethodType = MConnectingSocketTcpMethodType( rawValue:name), let methodType:MConnectingSocketTcpMethodProtocol.Type = kMethodMap[ type] else { return nil } let method:MConnectingSocketTcpMethodProtocol = methodType.init( received:received) return method } }
Replace switch with method map
Replace switch with method map
Swift
mit
devpunk/velvet_room,devpunk/velvet_room
swift
## Code Before: import Foundation extension MConnectingSocketTcpMethodType { private static func factoryMethod( type:MConnectingSocketTcpMethodType) -> MConnectingSocketTcpMethodProtocol.Type { switch type { case MConnectingSocketTcpMethodType.showpin: return MConnectingSocketTcpMethodShowpin.self case MConnectingSocketTcpMethodType.register: return MConnectingSocketTcpMethodRegister.self case MConnectingSocketTcpMethodType.registerResult: return MConnectingSocketTcpMethodRegisterResult.self case MConnectingSocketTcpMethodType.registerCancel: return MConnectingSocketTcpMethodRegisterCancel.self case MConnectingSocketTcpMethodType.connect: return MConnectingSocketTcpMethodConnect.self case MConnectingSocketTcpMethodType.standby: return MConnectingSocketTcpMethodStandby.self } } //MARK: internal static func factoryMethod( name:String, received:String) -> MConnectingSocketTcpMethodProtocol? { guard let type:MConnectingSocketTcpMethodType = MConnectingSocketTcpMethodType( rawValue:name) else { return nil } let methodType:MConnectingSocketTcpMethodProtocol.Type = factoryMethod( type:type) let method:MConnectingSocketTcpMethodProtocol = methodType.init( received:received) return method } } ## Instruction: Replace switch with method map ## Code After: import Foundation extension MConnectingSocketTcpMethodType { private static let kMethodMap:[ MConnectingSocketTcpMethodType: MConnectingSocketTcpMethodProtocol.Type] = [ MConnectingSocketTcpMethodType.showpin: MConnectingSocketTcpMethodShowpin.self, MConnectingSocketTcpMethodType.register: MConnectingSocketTcpMethodRegister.self, MConnectingSocketTcpMethodType.registerResult: MConnectingSocketTcpMethodRegisterResult.self, MConnectingSocketTcpMethodType.registerCancel: MConnectingSocketTcpMethodRegisterCancel.self, MConnectingSocketTcpMethodType.connect: MConnectingSocketTcpMethodConnect.self, MConnectingSocketTcpMethodType.standby: MConnectingSocketTcpMethodStandby.self] //MARK: internal static func factoryMethod( name:String, received:String) -> MConnectingSocketTcpMethodProtocol? { guard let type:MConnectingSocketTcpMethodType = MConnectingSocketTcpMethodType( rawValue:name), let methodType:MConnectingSocketTcpMethodProtocol.Type = kMethodMap[ type] else { return nil } let method:MConnectingSocketTcpMethodProtocol = methodType.init( received:received) return method } }
0173d18e2c88f4b944b3b12df2259fb0d26fee1d
drogher/shippers/dhl.py
drogher/shippers/dhl.py
from .base import Shipper class DHL(Shipper): barcode_pattern = r'^\d{10}$' shipper = 'DHL'
from .base import Shipper class DHL(Shipper): barcode_pattern = r'^\d{10}$' shipper = 'DHL' @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] return int(sequence) % 7 == int(check_digit)
Add DHL waybill checksum validation
Add DHL waybill checksum validation
Python
bsd-3-clause
jbittel/drogher
python
## Code Before: from .base import Shipper class DHL(Shipper): barcode_pattern = r'^\d{10}$' shipper = 'DHL' ## Instruction: Add DHL waybill checksum validation ## Code After: from .base import Shipper class DHL(Shipper): barcode_pattern = r'^\d{10}$' shipper = 'DHL' @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] return int(sequence) % 7 == int(check_digit)
950cafe0db61fa10d1a024261fcd43a2c5a12525
CONTRIBUTING.md
CONTRIBUTING.md
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: **Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). Please join our [Slack channel](https://slackin-nteract.now.sh/) if you have any questions or just want to say hi. ## Project setup ### Quick and dirty setup `apm develop hydrogen` This will clone the `hydrogen` repository to `~/github` unless you set the `ATOM_REPOS_HOME` environment variable. ### I already cloned it! If you cloned it somewhere else, you'll want to use `apm link --dev` within the package directory, followed by `apm install` to get dependencies. ### Workflow After pulling upstream changes, make sure to run `apm update`. To start hacking, run `atom --dev .` from the package directory. Cut a branch while you're working then either submit a Pull Request when done or when you want some feedback! ### Running specs You can run specs by triggering the `window:run-package-specs` command in Atom. To run tests on the command line use `apm test` within the package directory. We use [Jasmine](https://jasmine.github.io/2.5/introduction) for writing specs.
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: **Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). Please join our [Slack channel](https://slackin-nteract.now.sh/) if you have any questions or just want to say hi. ## Project setup ### Quick and dirty setup `apm develop hydrogen` This will clone the `hydrogen` repository to `~/github` unless you set the `ATOM_REPOS_HOME` environment variable. ### I already cloned it! If you cloned it somewhere else, you'll want to use `apm link --dev` within the package directory, followed by `apm install` to get dependencies. ### Workflow After pulling upstream changes, make sure to run `apm update`. To start hacking, run `atom --dev .` from the package directory. Cut a branch while you're working then either submit a Pull Request when done or when you want some feedback! ### Running specs You can run specs by triggering the `window:run-package-specs` command in Atom. To run tests on the command line use `apm test` within the package directory. We use [Jasmine](https://jasmine.github.io/2.5/introduction) for writing specs. ### Build Documentation To build the website locally run: ```bash npm install gitbook-cli -g gitbook serve ``` For more information take a look at https://toolchain.gitbook.com/setup.html.
Add instructions on how to build docs
Add instructions on how to build docs
Markdown
mit
xanecs/hydrogen,nteract/hydrogen,rgbkrk/hydrogen,nteract/hydrogen
markdown
## Code Before: :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: **Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). Please join our [Slack channel](https://slackin-nteract.now.sh/) if you have any questions or just want to say hi. ## Project setup ### Quick and dirty setup `apm develop hydrogen` This will clone the `hydrogen` repository to `~/github` unless you set the `ATOM_REPOS_HOME` environment variable. ### I already cloned it! If you cloned it somewhere else, you'll want to use `apm link --dev` within the package directory, followed by `apm install` to get dependencies. ### Workflow After pulling upstream changes, make sure to run `apm update`. To start hacking, run `atom --dev .` from the package directory. Cut a branch while you're working then either submit a Pull Request when done or when you want some feedback! ### Running specs You can run specs by triggering the `window:run-package-specs` command in Atom. To run tests on the command line use `apm test` within the package directory. We use [Jasmine](https://jasmine.github.io/2.5/introduction) for writing specs. ## Instruction: Add instructions on how to build docs ## Code After: :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: **Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github). Please join our [Slack channel](https://slackin-nteract.now.sh/) if you have any questions or just want to say hi. ## Project setup ### Quick and dirty setup `apm develop hydrogen` This will clone the `hydrogen` repository to `~/github` unless you set the `ATOM_REPOS_HOME` environment variable. ### I already cloned it! If you cloned it somewhere else, you'll want to use `apm link --dev` within the package directory, followed by `apm install` to get dependencies. ### Workflow After pulling upstream changes, make sure to run `apm update`. To start hacking, run `atom --dev .` from the package directory. Cut a branch while you're working then either submit a Pull Request when done or when you want some feedback! ### Running specs You can run specs by triggering the `window:run-package-specs` command in Atom. To run tests on the command line use `apm test` within the package directory. We use [Jasmine](https://jasmine.github.io/2.5/introduction) for writing specs. ### Build Documentation To build the website locally run: ```bash npm install gitbook-cli -g gitbook serve ``` For more information take a look at https://toolchain.gitbook.com/setup.html.
2a350a6ad1aff1c34a5970ce029e9b2b27fed5a6
README.md
README.md
Qnoise ====== A simple tool to generate noises in a given source data.
Qnoise <img src="https://api.travis-ci.org/Qatar-Computing-Research-Institute/Qnoise.png" /> ====== ### What is Qnoise? Qnoise is a Java based noise data generator, developed by the data analytic group at [Qatar Computing Research Institute](da.qcri.org). ### See it in Action ``` usage: qnoise.sh -f <input csv file> -o <output csv file> [OPTIONS] All the options: -f <file> Input with CSV file. -g <[row | cell]> Injection data granularity, default value is row. -help Print this message. -m <[random | norm]> Noise distribution modal, default value is random. -o <file> Output to CSV file. -p <percentage> Injection data percentage. ``` ### License Qnoise is released under the terms of the [MIT License](http://opensource.org/licenses/MIT). ### Contact For any issues or enhancement please use the issue pages on Github, or contact [[email protected]](mailto:[email protected]). We will try our best to help you sort it out.
Update the readme with travis support.
Update the readme with travis support.
Markdown
mit
Qatar-Computing-Research-Institute/Qnoise,Qatar-Computing-Research-Institute/Qnoise,Qatar-Computing-Research-Institute/Qnoise,Qatar-Computing-Research-Institute/Qnoise
markdown
## Code Before: Qnoise ====== A simple tool to generate noises in a given source data. ## Instruction: Update the readme with travis support. ## Code After: Qnoise <img src="https://api.travis-ci.org/Qatar-Computing-Research-Institute/Qnoise.png" /> ====== ### What is Qnoise? Qnoise is a Java based noise data generator, developed by the data analytic group at [Qatar Computing Research Institute](da.qcri.org). ### See it in Action ``` usage: qnoise.sh -f <input csv file> -o <output csv file> [OPTIONS] All the options: -f <file> Input with CSV file. -g <[row | cell]> Injection data granularity, default value is row. -help Print this message. -m <[random | norm]> Noise distribution modal, default value is random. -o <file> Output to CSV file. -p <percentage> Injection data percentage. ``` ### License Qnoise is released under the terms of the [MIT License](http://opensource.org/licenses/MIT). ### Contact For any issues or enhancement please use the issue pages on Github, or contact [[email protected]](mailto:[email protected]). We will try our best to help you sort it out.
04bf65fa025902f92cd80b87f95c276e32487af0
tensorflow_datasets/image/binary_alpha_digits_test.py
tensorflow_datasets/image/binary_alpha_digits_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow_datasets.image import binary_alpha_digits import tensorflow_datasets.testing as tfds_test class BinaryAlphaDigitsTest(tfds_test.DatasetBuilderTestCase): DATASET_CLASS = binary_alpha_digits.BinaryAlphaDigits SPLITS = { "train": 2, } DL_EXTRACT_RESULT = { "train": "binaryalphadigs.mat", } if __name__ == "__main__": tfds_test.test_main()
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow_datasets.image import binary_alpha_digits import tensorflow_datasets.testing as tfds_test class BinaryAlphaDigitsTest(tfds_test.DatasetBuilderTestCase): DATASET_CLASS = binary_alpha_digits.BinaryAlphaDigits SPLITS = { "train": 2, } DL_EXTRACT_RESULT = { "train": tf.compat.as_text("binaryalphadigs.mat"), } if __name__ == "__main__": tfds_test.test_main()
Fix in test file for Binary Alpha Digit Dataset Issue-189
Fix in test file for Binary Alpha Digit Dataset Issue-189
Python
apache-2.0
tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets
python
## Code Before: from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow_datasets.image import binary_alpha_digits import tensorflow_datasets.testing as tfds_test class BinaryAlphaDigitsTest(tfds_test.DatasetBuilderTestCase): DATASET_CLASS = binary_alpha_digits.BinaryAlphaDigits SPLITS = { "train": 2, } DL_EXTRACT_RESULT = { "train": "binaryalphadigs.mat", } if __name__ == "__main__": tfds_test.test_main() ## Instruction: Fix in test file for Binary Alpha Digit Dataset Issue-189 ## Code After: from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow_datasets.image import binary_alpha_digits import tensorflow_datasets.testing as tfds_test class BinaryAlphaDigitsTest(tfds_test.DatasetBuilderTestCase): DATASET_CLASS = binary_alpha_digits.BinaryAlphaDigits SPLITS = { "train": 2, } DL_EXTRACT_RESULT = { "train": tf.compat.as_text("binaryalphadigs.mat"), } if __name__ == "__main__": tfds_test.test_main()
9e591927718cfa898d3ffddeefdd0c5185f22ce4
graf3d/glew/CMakeLists.txt
graf3d/glew/CMakeLists.txt
include_directories(${OPENGL_INCLUDE_DIR}) ROOT_LINKER_LIBRARY(GLEW *.c LIBRARIES ${OPENGL_LIBRARIES}) ROOT_INSTALL_HEADERS()
include_directories(${OPENGL_INCLUDE_DIR}) # Do not install headers for all platforms and configurations. if(UNIX) set(installoptions OPTIONS REGEX "wglew" EXCLUDE) else() # Windows set(installoptions OPTIONS REGEX "glew" EXCLUDE) endif() if(NOT x11) set(installoptions ${installoptions} OPTIONS REGEX "glxew" EXCLUDE) endif() ROOT_LINKER_LIBRARY(GLEW *.c LIBRARIES ${OPENGL_LIBRARIES}) ROOT_INSTALL_HEADERS(${installoptions})
Install only the relevant headers depending on the platform.
Install only the relevant headers depending on the platform.
Text
lgpl-2.1
zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,beniz/root,gbitzes/root,simonpf/root,karies/root,bbockelm/root,bbockelm/root,gbitzes/root,mhuwiler/rootauto,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,simonpf/root,karies/root,olifre/root,mhuwiler/rootauto,beniz/root,bbockelm/root,mhuwiler/rootauto,agarciamontoro/root,gganis/root,beniz/root,BerserkerTroll/root,mhuwiler/rootauto,zzxuanyuan/root,zzxuanyuan/root,satyarth934/root,agarciamontoro/root,gbitzes/root,buuck/root,mhuwiler/rootauto,gganis/root,beniz/root,karies/root,zzxuanyuan/root,gganis/root,buuck/root,buuck/root,olifre/root,gganis/root,zzxuanyuan/root-compressor-dummy,gganis/root,gbitzes/root,davidlt/root,karies/root,olifre/root,davidlt/root,zzxuanyuan/root,beniz/root,buuck/root,olifre/root,agarciamontoro/root,BerserkerTroll/root,bbockelm/root,zzxuanyuan/root,olifre/root,satyarth934/root,simonpf/root,agarciamontoro/root,BerserkerTroll/root,abhinavmoudgil95/root,root-mirror/root,zzxuanyuan/root,bbockelm/root,satyarth934/root,root-mirror/root,olifre/root,BerserkerTroll/root,abhinavmoudgil95/root,beniz/root,simonpf/root,olifre/root,karies/root,mhuwiler/rootauto,satyarth934/root,davidlt/root,gganis/root,karies/root,abhinavmoudgil95/root,agarciamontoro/root,bbockelm/root,bbockelm/root,davidlt/root,satyarth934/root,zzxuanyuan/root,agarciamontoro/root,beniz/root,beniz/root,davidlt/root,root-mirror/root,satyarth934/root,simonpf/root,simonpf/root,buuck/root,olifre/root,abhinavmoudgil95/root,davidlt/root,satyarth934/root,karies/root,zzxuanyuan/root,gganis/root,beniz/root,root-mirror/root,buuck/root,agarciamontoro/root,BerserkerTroll/root,mhuwiler/rootauto,root-mirror/root,root-mirror/root,root-mirror/root,davidlt/root,karies/root,bbockelm/root,root-mirror/root,BerserkerTroll/root,satyarth934/root,abhinavmoudgil95/root,BerserkerTroll/root,olifre/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,gbitzes/root,karies/root,karies/root,root-mirror/root,simonpf/root,bbockelm/root,simonpf/root,gbitzes/root,gganis/root,agarciamontoro/root,davidlt/root,davidlt/root,zzxuanyuan/root-compressor-dummy,gbitzes/root,simonpf/root,gganis/root,abhinavmoudgil95/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,BerserkerTroll/root,root-mirror/root,buuck/root,gbitzes/root,gbitzes/root,davidlt/root,satyarth934/root,simonpf/root,mhuwiler/rootauto,satyarth934/root,agarciamontoro/root,bbockelm/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,olifre/root,beniz/root,abhinavmoudgil95/root,zzxuanyuan/root,olifre/root,gbitzes/root,simonpf/root,zzxuanyuan/root-compressor-dummy,gbitzes/root,zzxuanyuan/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,root-mirror/root,mhuwiler/rootauto,buuck/root,BerserkerTroll/root,mhuwiler/rootauto,gganis/root,zzxuanyuan/root-compressor-dummy,agarciamontoro/root,abhinavmoudgil95/root,abhinavmoudgil95/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,karies/root,buuck/root,gganis/root,beniz/root,davidlt/root,BerserkerTroll/root,buuck/root,buuck/root,satyarth934/root
text
## Code Before: include_directories(${OPENGL_INCLUDE_DIR}) ROOT_LINKER_LIBRARY(GLEW *.c LIBRARIES ${OPENGL_LIBRARIES}) ROOT_INSTALL_HEADERS() ## Instruction: Install only the relevant headers depending on the platform. ## Code After: include_directories(${OPENGL_INCLUDE_DIR}) # Do not install headers for all platforms and configurations. if(UNIX) set(installoptions OPTIONS REGEX "wglew" EXCLUDE) else() # Windows set(installoptions OPTIONS REGEX "glew" EXCLUDE) endif() if(NOT x11) set(installoptions ${installoptions} OPTIONS REGEX "glxew" EXCLUDE) endif() ROOT_LINKER_LIBRARY(GLEW *.c LIBRARIES ${OPENGL_LIBRARIES}) ROOT_INSTALL_HEADERS(${installoptions})
a345269b75d83af93290c61953ed255a6b27d5be
disable-autofocus.sh
disable-autofocus.sh
CAMERA = video0 # Disable autofocus uvcdynctrl -v -d $CAMERA --set='Focus, Auto' 0 # Fix the focus uvcdynctrl -v -d $CAMERA --set='Focus (absolute)' 30
uvcdynctrl -v -d video0 --set='Focus, Auto' 0 # Fix the focus uvcdynctrl -v -d video0 --set='Focus (absolute)' 0 # Fix the power line frequency uvcdynctrl -v -d video0 --set='Power Line Frequency' 1
Add the power line frequency setup.
Add the power line frequency setup.
Shell
mit
microy/RobotVision,microy/RobotVision
shell
## Code Before: CAMERA = video0 # Disable autofocus uvcdynctrl -v -d $CAMERA --set='Focus, Auto' 0 # Fix the focus uvcdynctrl -v -d $CAMERA --set='Focus (absolute)' 30 ## Instruction: Add the power line frequency setup. ## Code After: uvcdynctrl -v -d video0 --set='Focus, Auto' 0 # Fix the focus uvcdynctrl -v -d video0 --set='Focus (absolute)' 0 # Fix the power line frequency uvcdynctrl -v -d video0 --set='Power Line Frequency' 1
62b88141b8a5642fabc36e951ea0a15f41b95f2c
.travis.yml
.travis.yml
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: 5.4 - php: 5.5 - php: 5.6 - php: 5.6 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' - php: nightly allow_failures: - php: nightly fast_finish: true install: composer update $COMPOSER_FLAGS -n script: vendor/bin/phpunit
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: 5.4 - php: 5.5 - php: 5.6 - php: 5.6 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' - php: 7 - php: hhvm install: composer update $COMPOSER_FLAGS -n script: vendor/bin/phpunit
Add support of PHP7 and HHVM
Add support of PHP7 and HHVM
YAML
mit
FriendsOfSymfony/FOSMessage
yaml
## Code Before: language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: 5.4 - php: 5.5 - php: 5.6 - php: 5.6 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' - php: nightly allow_failures: - php: nightly fast_finish: true install: composer update $COMPOSER_FLAGS -n script: vendor/bin/phpunit ## Instruction: Add support of PHP7 and HHVM ## Code After: language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: 5.4 - php: 5.5 - php: 5.6 - php: 5.6 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' - php: 7 - php: hhvm install: composer update $COMPOSER_FLAGS -n script: vendor/bin/phpunit
831ce8e749e194caa93c43d917a4671a5ead7634
.travis.yml
.travis.yml
sudo: required services: - docker language: python python: - 3.6 env: - DOCKER_COMPOSE_VERSION=1.21.2 before_install: - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - pip install codecov pytest-cov - sudo mkdir -p /tmp/coverage - sudo chmod a+w /tmp/coverage install: - make build - docker-compose up -d script: - docker-compose run -v /tmp/coverage:/tmp/coverage web bash -c "COVERAGE_FILE=/tmp/coverage/.coverage pytest --cov-report= --cov=." after_success: - mv /tmp/coverage/.coverage .coverage.docker - coverage combine - codecov deploy: - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: master - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: eyra-master
sudo: required services: - docker language: python python: - 3.6 env: - DOCKER_COMPOSE_VERSION=1.21.2 before_install: - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - pip install codecov pytest-cov - sudo mkdir -p /tmp/coverage - sudo chmod a+w /tmp/coverage - sudo service postgresql stop install: - make build - docker-compose up -d script: - docker-compose run -v /tmp/coverage:/tmp/coverage web bash -c "COVERAGE_FILE=/tmp/coverage/.coverage pytest --cov-report= --cov=." after_success: - mv /tmp/coverage/.coverage .coverage.docker - coverage combine - codecov deploy: - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: master - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: eyra-master
Fix clash with Travis postgres server
Fix clash with Travis postgres server
YAML
apache-2.0
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
yaml
## Code Before: sudo: required services: - docker language: python python: - 3.6 env: - DOCKER_COMPOSE_VERSION=1.21.2 before_install: - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - pip install codecov pytest-cov - sudo mkdir -p /tmp/coverage - sudo chmod a+w /tmp/coverage install: - make build - docker-compose up -d script: - docker-compose run -v /tmp/coverage:/tmp/coverage web bash -c "COVERAGE_FILE=/tmp/coverage/.coverage pytest --cov-report= --cov=." after_success: - mv /tmp/coverage/.coverage .coverage.docker - coverage combine - codecov deploy: - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: master - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: eyra-master ## Instruction: Fix clash with Travis postgres server ## Code After: sudo: required services: - docker language: python python: - 3.6 env: - DOCKER_COMPOSE_VERSION=1.21.2 before_install: - sudo rm /usr/local/bin/docker-compose - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - chmod +x docker-compose - sudo mv docker-compose /usr/local/bin - pip install codecov pytest-cov - sudo mkdir -p /tmp/coverage - sudo chmod a+w /tmp/coverage - sudo service postgresql stop install: - make build - docker-compose up -d script: - docker-compose run -v /tmp/coverage:/tmp/coverage web bash -c "COVERAGE_FILE=/tmp/coverage/.coverage pytest --cov-report= --cov=." after_success: - mv /tmp/coverage/.coverage .coverage.docker - coverage combine - codecov deploy: - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: master - provider: script script: bash -c "docker login -u grandchallenge -p "$DOCKER_PASSWORD" && make push" on: branch: eyra-master
ac28ed12b1eddebd493f67e1bfa0f451f73e9a8f
lib/mix/lib/mix/tasks/iex.ex
lib/mix/lib/mix/tasks/iex.ex
defmodule Mix.Tasks.Iex do use Mix.Task @hidden true def run(_) do raise Mix.Error, message: "Cannot start IEx after the VM was booted. " <> "To use IEx with Mix, please run: iex -S mix" end end
defmodule Mix.Tasks.Iex do use Mix.Task @hidden true @moduledoc false def run(_) do raise Mix.Error, message: "Cannot start IEx after the VM was booted. " <> "To use IEx with Mix, please run: iex -S mix" end end
Make IEx task with @moduledoc false
Make IEx task with @moduledoc false
Elixir
apache-2.0
antipax/elixir,gfvcastro/elixir,joshprice/elixir,antipax/elixir,ggcampinho/elixir,kimshrier/elixir,kelvinst/elixir,gfvcastro/elixir,lexmag/elixir,kimshrier/elixir,lexmag/elixir,beedub/elixir,pedrosnk/elixir,pedrosnk/elixir,michalmuskala/elixir,ggcampinho/elixir,kelvinst/elixir,elixir-lang/elixir,beedub/elixir
elixir
## Code Before: defmodule Mix.Tasks.Iex do use Mix.Task @hidden true def run(_) do raise Mix.Error, message: "Cannot start IEx after the VM was booted. " <> "To use IEx with Mix, please run: iex -S mix" end end ## Instruction: Make IEx task with @moduledoc false ## Code After: defmodule Mix.Tasks.Iex do use Mix.Task @hidden true @moduledoc false def run(_) do raise Mix.Error, message: "Cannot start IEx after the VM was booted. " <> "To use IEx with Mix, please run: iex -S mix" end end
64e4137f436983af4faa0761a690f226544cc433
.travis.yml
.travis.yml
language: node_js node_js: - "0.10" - "0.12" - "4" - "6" before_install: # setup apt package - sudo apt-get update - sudo apt-get install g++ - sudo apt-get install zlib1g-dev # build kyotocabinet - wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz - tar zxvf kyotocabinet-1.2.76.tar.gz - cd kyotocabinet-1.2.76 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # build kyototycoon - wget http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.56.tar.gz - tar zxvf kyototycoon-0.9.56.tar.gz - cd kyototycoon-0.9.56 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # setup library path - sudo sh -c "echo '/usr/local/lib' >> /etc/ld.so.conf.d/libc.conf" - sudo ldconfig # start kyototycoon - /usr/local/bin/ktserver -host localhost -port 1978 -dmn red#type=% blue#type=*
language: node_js node_js: - "0.12" - "4" - "6" before_install: # setup apt package - sudo apt-get update - sudo apt-get install g++ - sudo apt-get install zlib1g-dev # build kyotocabinet - wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz - tar zxvf kyotocabinet-1.2.76.tar.gz - cd kyotocabinet-1.2.76 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # build kyototycoon - wget http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.56.tar.gz - tar zxvf kyototycoon-0.9.56.tar.gz - cd kyototycoon-0.9.56 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # setup library path - sudo sh -c "echo '/usr/local/lib' >> /etc/ld.so.conf.d/libc.conf" - sudo ldconfig # start kyototycoon - /usr/local/bin/ktserver -host localhost -port 1978 -dmn red#type=% blue#type=*
Drop support for Node.js 0.10
Drop support for Node.js 0.10
YAML
mit
kamoqq/node-kt-client,kamoqq/kt-client
yaml
## Code Before: language: node_js node_js: - "0.10" - "0.12" - "4" - "6" before_install: # setup apt package - sudo apt-get update - sudo apt-get install g++ - sudo apt-get install zlib1g-dev # build kyotocabinet - wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz - tar zxvf kyotocabinet-1.2.76.tar.gz - cd kyotocabinet-1.2.76 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # build kyototycoon - wget http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.56.tar.gz - tar zxvf kyototycoon-0.9.56.tar.gz - cd kyototycoon-0.9.56 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # setup library path - sudo sh -c "echo '/usr/local/lib' >> /etc/ld.so.conf.d/libc.conf" - sudo ldconfig # start kyototycoon - /usr/local/bin/ktserver -host localhost -port 1978 -dmn red#type=% blue#type=* ## Instruction: Drop support for Node.js 0.10 ## Code After: language: node_js node_js: - "0.12" - "4" - "6" before_install: # setup apt package - sudo apt-get update - sudo apt-get install g++ - sudo apt-get install zlib1g-dev # build kyotocabinet - wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz - tar zxvf kyotocabinet-1.2.76.tar.gz - cd kyotocabinet-1.2.76 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # build kyototycoon - wget http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.56.tar.gz - tar zxvf kyototycoon-0.9.56.tar.gz - cd kyototycoon-0.9.56 - ./configure CXXFLAGS='-mno-avx' - make - sudo make install - cd - # setup library path - sudo sh -c "echo '/usr/local/lib' >> /etc/ld.so.conf.d/libc.conf" - sudo ldconfig # start kyototycoon - /usr/local/bin/ktserver -host localhost -port 1978 -dmn red#type=% blue#type=*
0fdc4f87395d449892f945466369d812a04855b4
.emacs.d/config/package.el
.emacs.d/config/package.el
(require 'package) ;; add-to-list add to list's front unless by t ;; reset ;;(setq package-archives nil) ;; default GNU ELPA ;; (add-to-list 'package-archives ;; '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) ;; Milkypostman's Emacs Lisp Pakcage Archive (MELPA) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) (add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t) ;; (add-to-list 'package-archives ;; '("marmalade" . "https://marmalade-repo.org/packages/")) (when (boundp 'package-pinned-packages) (setq package-pinned-packages '((cider . "melpa-stable") (clj-refactor . "melpa-stable")))) (package-initialize)
(require 'package) ;; add-to-list add to list's front unless by t ;; reset ;;(setq package-archives nil) ;; default GNU ELPA ;; (add-to-list 'package-archives ;; '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) ;; Milkypostman's Emacs Lisp Pakcage Archive (MELPA) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) (add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t) ;; (add-to-list 'package-archives ;; '("marmalade" . "https://marmalade-repo.org/packages/")) (when (boundp 'package-pinned-packages) (setq package-pinned-packages '((cider . "melpa-stable")))) (package-initialize)
Use clj-refactor in Melpa to work with cider 0.10.0, which requires clj-refactor 2.0.0-SNAPSHOT.
Use clj-refactor in Melpa to work with cider 0.10.0, which requires clj-refactor 2.0.0-SNAPSHOT.
Emacs Lisp
apache-2.0
pw4ever/dotemacs,pw4ever/dotemacs,pw4ever/dotemacs,pw4ever/dotemacs,pw4ever/dotemacs
emacs-lisp
## Code Before: (require 'package) ;; add-to-list add to list's front unless by t ;; reset ;;(setq package-archives nil) ;; default GNU ELPA ;; (add-to-list 'package-archives ;; '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) ;; Milkypostman's Emacs Lisp Pakcage Archive (MELPA) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) (add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t) ;; (add-to-list 'package-archives ;; '("marmalade" . "https://marmalade-repo.org/packages/")) (when (boundp 'package-pinned-packages) (setq package-pinned-packages '((cider . "melpa-stable") (clj-refactor . "melpa-stable")))) (package-initialize) ## Instruction: Use clj-refactor in Melpa to work with cider 0.10.0, which requires clj-refactor 2.0.0-SNAPSHOT. ## Code After: (require 'package) ;; add-to-list add to list's front unless by t ;; reset ;;(setq package-archives nil) ;; default GNU ELPA ;; (add-to-list 'package-archives ;; '("gnu" . "http://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/")) ;; Milkypostman's Emacs Lisp Pakcage Archive (MELPA) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) (add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t) ;; (add-to-list 'package-archives ;; '("marmalade" . "https://marmalade-repo.org/packages/")) (when (boundp 'package-pinned-packages) (setq package-pinned-packages '((cider . "melpa-stable")))) (package-initialize)
6d8622390a1649c03d59caee2a6eae8a0d184067
scripts/cf-deliver.sh
scripts/cf-deliver.sh
pushd `dirname $0`/.. > /dev/null root=$(pwd -P) popd > /dev/null # gather some data about the repo source $root/scripts/vars.sh [ -f $root/app.$EXT ] && exit mvn dependency:get \ -DremoteRepositories=nexus::default::$NEXUSURL \ -DrepositoryId=nexus \ -DartifactId=$APP \ -DgroupId=io.piazzageo \ -Dpackaging=$EXT \ -Dtransitive=false \ -Ddestination=$root/app.$EXT \ -Dversion=$SHORT
pushd `dirname $0`/.. > /dev/null root=$(pwd -P) popd > /dev/null # gather some data about the repo source $root/scripts/vars.sh [ -f $root/app.$EXT ] && exit mvn dependency:get \ -DremoteRepositories=nexus::default::$NEXUSURL \ -DrepositoryId=nexus \ -DartifactId=$APP \ -DgroupId=io.piazzageo \ -Dpackaging=$EXT \ -Dtransitive=false \ -Dversion=$SHORT mvn dependency:copy \ -DgroupId=core \ -DartifactId=$APP \ -Dversion=$SHORT \ -Dtype=$EXT \ -DoverWrite=true \ -DoutputDirectory=$root \ -DdestFileName=app.$EXT
Revert "Attempt to use destination property"
Revert "Attempt to use destination property" This reverts commit 1a1bd46cc875167273284b4bfb7a2ff554945fde.
Shell
epl-1.0
venicegeo/pz-discover
shell
## Code Before: pushd `dirname $0`/.. > /dev/null root=$(pwd -P) popd > /dev/null # gather some data about the repo source $root/scripts/vars.sh [ -f $root/app.$EXT ] && exit mvn dependency:get \ -DremoteRepositories=nexus::default::$NEXUSURL \ -DrepositoryId=nexus \ -DartifactId=$APP \ -DgroupId=io.piazzageo \ -Dpackaging=$EXT \ -Dtransitive=false \ -Ddestination=$root/app.$EXT \ -Dversion=$SHORT ## Instruction: Revert "Attempt to use destination property" This reverts commit 1a1bd46cc875167273284b4bfb7a2ff554945fde. ## Code After: pushd `dirname $0`/.. > /dev/null root=$(pwd -P) popd > /dev/null # gather some data about the repo source $root/scripts/vars.sh [ -f $root/app.$EXT ] && exit mvn dependency:get \ -DremoteRepositories=nexus::default::$NEXUSURL \ -DrepositoryId=nexus \ -DartifactId=$APP \ -DgroupId=io.piazzageo \ -Dpackaging=$EXT \ -Dtransitive=false \ -Dversion=$SHORT mvn dependency:copy \ -DgroupId=core \ -DartifactId=$APP \ -Dversion=$SHORT \ -Dtype=$EXT \ -DoverWrite=true \ -DoutputDirectory=$root \ -DdestFileName=app.$EXT
85c81fffb1e091142d631b0aa579b4d8bd6d6e75
.travis.yml
.travis.yml
language: ruby script : script/cibuild sudo: false rvm: - 2.3.1 - 2.2.5 - 2.1.9 env: - "" - JEKYLL_VERSION=3.0 - JEKYLL_VERSION=2.0 matrix: include: - # GitHub Pages rvm: 2.1.1 env: GH_PAGES=true - # Ruby 1.9 rvm: 1.9 env: JEKYLL_VERSION=2.0
language: ruby script : script/cibuild sudo: false rvm: - 2.3.1 - 2.2.5 - 2.1.9 env: - "" - JEKYLL_VERSION=3.0 - JEKYLL_VERSION=2.0 matrix: include: - # GitHub Pages rvm: 2.1.1 env: GH_PAGES=true
Remove Travis test for Ruby 1.9
Remove Travis test for Ruby 1.9
YAML
mit
jekyll/jekyll-archives,jekyll/jekyll-archives,jekyll/jekyll-archives
yaml
## Code Before: language: ruby script : script/cibuild sudo: false rvm: - 2.3.1 - 2.2.5 - 2.1.9 env: - "" - JEKYLL_VERSION=3.0 - JEKYLL_VERSION=2.0 matrix: include: - # GitHub Pages rvm: 2.1.1 env: GH_PAGES=true - # Ruby 1.9 rvm: 1.9 env: JEKYLL_VERSION=2.0 ## Instruction: Remove Travis test for Ruby 1.9 ## Code After: language: ruby script : script/cibuild sudo: false rvm: - 2.3.1 - 2.2.5 - 2.1.9 env: - "" - JEKYLL_VERSION=3.0 - JEKYLL_VERSION=2.0 matrix: include: - # GitHub Pages rvm: 2.1.1 env: GH_PAGES=true
779efe4ae9a6af8bf0ef8280e2e3968ed18f51f3
public/js/app.js
public/js/app.js
var CommentBox = React.createClass({ render: function() { return ( <div className="commentBox"> Hello, world! I am a CommentBox. </div> ); } }); React.render( <CommentBox />, document.getElementById('content') );
/* CommentBox */ var CommentBox = React.createClass({ render: function() { return ( <div className="commentBox"> <h1>Comments</h1> <CommentList /> <CommentForm /> </div> ); } }); /* CommentList */ var CommentList = React.createClass({ render: function() { return ( <div className="commentList"> Hello, world! I am a CommentList. </div> ); } }); /* CommentForm */ var CommentForm = React.createClass({ render: function() { return ( <div className="commentForm"> Hello, world! I am a CommentForm. </div> ); } }); /* Initialize the app */ React.render( <CommentBox />, document.getElementById('content') );
Build CommentList and CommentForm components
Build CommentList and CommentForm components
JavaScript
mit
thinkswan/react-comments,thinkswan/react-comments
javascript
## Code Before: var CommentBox = React.createClass({ render: function() { return ( <div className="commentBox"> Hello, world! I am a CommentBox. </div> ); } }); React.render( <CommentBox />, document.getElementById('content') ); ## Instruction: Build CommentList and CommentForm components ## Code After: /* CommentBox */ var CommentBox = React.createClass({ render: function() { return ( <div className="commentBox"> <h1>Comments</h1> <CommentList /> <CommentForm /> </div> ); } }); /* CommentList */ var CommentList = React.createClass({ render: function() { return ( <div className="commentList"> Hello, world! I am a CommentList. </div> ); } }); /* CommentForm */ var CommentForm = React.createClass({ render: function() { return ( <div className="commentForm"> Hello, world! I am a CommentForm. </div> ); } }); /* Initialize the app */ React.render( <CommentBox />, document.getElementById('content') );
4e2d78d3d547e286c1f4d7bf891e1ec9bd050452
mobile/analytics/partners.js
mobile/analytics/partners.js
(function () { 'use strict' $('.partner-profile-contact-email a').click(function (e) { analytics.track('Clicked Contact Gallery Via Email', { partner_id: $(e.currentTarget).data('partner-id'), partner_slug: $(e.currentTarget).data('partner-slug') }) }) $('.partner-profile-contact-website a').click(function (e) { analytics.track('Clicked Gallery Website', { partner_id: $(e.currentTarget).data('partner-id'), partner_slug: $(e.currentTarget).data('partner-slug') }) }) })()
(function () { 'use strict' $('.partner-profile-contact-email a').click(function (e) { analytics.track('Click',{ partner_id: $(e.currentTarget).data('partner-id'), label: "Contact gallery by email" }); }) $('.partner-profile-contact-website a').click(function (e) { analytics.track('Click', { partner_id: $(e.currentTarget).data('partner-id'), label: "External partner site", destination_path: $(e.currentTarget).attr('href') }) }) })()
Send 'Click' events rather than 'Clicked Gallery Website'
Send 'Click' events rather than 'Clicked Gallery Website'
JavaScript
mit
damassi/force,cavvia/force-1,mzikherman/force,artsy/force-public,izakp/force,izakp/force,cavvia/force-1,erikdstock/force,oxaudo/force,izakp/force,oxaudo/force,erikdstock/force,anandaroop/force,anandaroop/force,xtina-starr/force,artsy/force-public,joeyAghion/force,oxaudo/force,joeyAghion/force,mzikherman/force,erikdstock/force,mzikherman/force,anandaroop/force,eessex/force,damassi/force,oxaudo/force,cavvia/force-1,yuki24/force,damassi/force,anandaroop/force,izakp/force,artsy/force,xtina-starr/force,joeyAghion/force,kanaabe/force,eessex/force,erikdstock/force,mzikherman/force,yuki24/force,yuki24/force,artsy/force,eessex/force,kanaabe/force,kanaabe/force,artsy/force,cavvia/force-1,xtina-starr/force,kanaabe/force,joeyAghion/force,kanaabe/force,eessex/force,xtina-starr/force,yuki24/force,artsy/force,damassi/force
javascript
## Code Before: (function () { 'use strict' $('.partner-profile-contact-email a').click(function (e) { analytics.track('Clicked Contact Gallery Via Email', { partner_id: $(e.currentTarget).data('partner-id'), partner_slug: $(e.currentTarget).data('partner-slug') }) }) $('.partner-profile-contact-website a').click(function (e) { analytics.track('Clicked Gallery Website', { partner_id: $(e.currentTarget).data('partner-id'), partner_slug: $(e.currentTarget).data('partner-slug') }) }) })() ## Instruction: Send 'Click' events rather than 'Clicked Gallery Website' ## Code After: (function () { 'use strict' $('.partner-profile-contact-email a').click(function (e) { analytics.track('Click',{ partner_id: $(e.currentTarget).data('partner-id'), label: "Contact gallery by email" }); }) $('.partner-profile-contact-website a').click(function (e) { analytics.track('Click', { partner_id: $(e.currentTarget).data('partner-id'), label: "External partner site", destination_path: $(e.currentTarget).attr('href') }) }) })()
a0b0415cb069dde1ff57e657a5d2663f090e3363
polyball/shared/model/Player.js
polyball/shared/model/Player.js
/** * Created by Jared Rewerts on 3/7/2016. */ "use strict"; /** * Each player owns it's own paddle. The already created paddle is passed into * the constructor of Player in config. * * @param {{id: number, * paddle: Paddle * client: Client}} config * @constructor */ var Player = function(config) { this.id = config.id; this.paddle = config.paddle; this.client = config.client; this.score = 0; }; module.exports = Player;
/** * Created by Jared Rewerts on 3/7/2016. */ "use strict"; /** * Each player owns it's own paddle. The already created paddle is passed into * the constructor of Player in config. * * @param {{id: number, * paddle: Paddle, * arenaPosition: Number, * client: Client}} config * @constructor */ var Player = function(config) { this.id = config.id; this.paddle = config.paddle; this.arenaPosition = config.arenaPosition; this.client = config.client; this.score = 0; }; module.exports = Player;
Add arenaposition state to player.
Add arenaposition state to player.
JavaScript
mit
polyball/polyball,polyball/polyball
javascript
## Code Before: /** * Created by Jared Rewerts on 3/7/2016. */ "use strict"; /** * Each player owns it's own paddle. The already created paddle is passed into * the constructor of Player in config. * * @param {{id: number, * paddle: Paddle * client: Client}} config * @constructor */ var Player = function(config) { this.id = config.id; this.paddle = config.paddle; this.client = config.client; this.score = 0; }; module.exports = Player; ## Instruction: Add arenaposition state to player. ## Code After: /** * Created by Jared Rewerts on 3/7/2016. */ "use strict"; /** * Each player owns it's own paddle. The already created paddle is passed into * the constructor of Player in config. * * @param {{id: number, * paddle: Paddle, * arenaPosition: Number, * client: Client}} config * @constructor */ var Player = function(config) { this.id = config.id; this.paddle = config.paddle; this.arenaPosition = config.arenaPosition; this.client = config.client; this.score = 0; }; module.exports = Player;
c8c9cfa77f0c0fdb895dfdbfc177db3c26dcedcc
swig/CMakeLists.txt
swig/CMakeLists.txt
INCLUDE( ${SWIG_USE_FILE} ) SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ) SET_SOURCE_FILES_PROPERTIES(plist.i PROPERTIES CPLUSPLUS ON) SWIG_ADD_MODULE( PList python plist.i ) SWIG_LINK_LIBRARIES( PList plist plist++ ${PYTHON_LIBRARIES} ) EXEC_PROGRAM("${PYTHON_EXECUTABLE}" ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib()\nexcept: pass\n'" OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/_PList${CMAKE_SHARED_MODULE_SUFFIX} DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/PList.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.i DESTINATION include/plist/swig COMPONENT dev)
INCLUDE( ${SWIG_USE_FILE} ) SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ) SET_SOURCE_FILES_PROPERTIES(plist.i PROPERTIES CPLUSPLUS ON) SWIG_ADD_MODULE( PList python plist.i ) SWIG_LINK_LIBRARIES( PList plist plist++ ${PYTHON_LIBRARIES} ) EXEC_PROGRAM("${PYTHON_EXECUTABLE}" ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)\nexcept: pass\n'" OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/_PList${CMAKE_SHARED_MODULE_SUFFIX} DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/PList.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.i DESTINATION include/plist/swig COMPONENT dev)
Install python bindings in the right directory on 64bit machines.
Install python bindings in the right directory on 64bit machines.
Text
lgpl-2.1
libimobiledevice-win32/libplist,Tatsh/libplist,libimobiledevice/libplist,Tatsh/libplist,libimobiledevice/libplist,libimobiledevice/libplist,Tatsh/libplist,Tatsh/libplist,libimobiledevice-win32/libplist,libimobiledevice-win32/libplist,libimobiledevice-win32/libplist
text
## Code Before: INCLUDE( ${SWIG_USE_FILE} ) SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ) SET_SOURCE_FILES_PROPERTIES(plist.i PROPERTIES CPLUSPLUS ON) SWIG_ADD_MODULE( PList python plist.i ) SWIG_LINK_LIBRARIES( PList plist plist++ ${PYTHON_LIBRARIES} ) EXEC_PROGRAM("${PYTHON_EXECUTABLE}" ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib()\nexcept: pass\n'" OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/_PList${CMAKE_SHARED_MODULE_SUFFIX} DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/PList.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.i DESTINATION include/plist/swig COMPONENT dev) ## Instruction: Install python bindings in the right directory on 64bit machines. ## Code After: INCLUDE( ${SWIG_USE_FILE} ) SET(CMAKE_SWIG_FLAGS -Werror -Wall -modern) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ) SET_SOURCE_FILES_PROPERTIES(plist.i PROPERTIES CPLUSPLUS ON) SWIG_ADD_MODULE( PList python plist.i ) SWIG_LINK_LIBRARIES( PList plist plist++ ${PYTHON_LIBRARIES} ) EXEC_PROGRAM("${PYTHON_EXECUTABLE}" ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)\nexcept: pass\n'" OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/_PList${CMAKE_SHARED_MODULE_SUFFIX} DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/PList.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${DISTUTILS_PYTHON_ILIBRARY_PATH}/libplist/ ) INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/plist.i DESTINATION include/plist/swig COMPONENT dev)
7295998abd322eb591626011ae5bed491cd26799
src/test/java/net/sf/jabref/JabRefPreferencesTest.java
src/test/java/net/sf/jabref/JabRefPreferencesTest.java
package net.sf.jabref; import static org.junit.Assert.assertEquals; import java.io.File; import org.junit.After; import org.junit.Before; import org.junit.Test; public class JabRefPreferencesTest { private JabRefPreferences prefs; private JabRefPreferences backup; @Before public void setUp() { prefs = JabRefPreferences.getInstance(); backup = prefs; } @Test public void testPreferencesImport() throws JabRefException { // the primary sort field has been changed to "editor" in this case File importFile = new File("src/test/resources/net/sf/jabref/customPreferences.xml"); prefs.importPreferences(importFile.getAbsolutePath()); String expected = "editor"; String actual = prefs.get(JabRefPreferences.SAVE_PRIMARY_SORT_FIELD); assertEquals(expected, actual); } @After public void tearDown() { //clean up preferences to default state prefs.overwritePreferences(backup); } }
package net.sf.jabref; import static org.junit.Assert.assertEquals; import java.io.File; import java.nio.charset.StandardCharsets; import org.junit.After; import org.junit.Before; import org.junit.Test; public class JabRefPreferencesTest { private JabRefPreferences prefs; private JabRefPreferences backup; @Before public void setUp() { prefs = JabRefPreferences.getInstance(); backup = prefs; } @Test public void testPreferencesImport() throws JabRefException { // the primary sort field has been changed to "editor" in this case File importFile = new File("src/test/resources/net/sf/jabref/customPreferences.xml"); prefs.importPreferences(importFile.getAbsolutePath()); String expected = "editor"; String actual = prefs.get(JabRefPreferences.SAVE_PRIMARY_SORT_FIELD); assertEquals(expected, actual); } @Test public void getDefaultEncodingReturnsPreviouslyStoredEncoding() { prefs.setDefaultEncoding(StandardCharsets.UTF_16BE); assertEquals(StandardCharsets.UTF_16BE, prefs.getDefaultEncoding()); } @After public void tearDown() { //clean up preferences to default state prefs.overwritePreferences(backup); } }
Add test for getting/setting default encoding in preferences
Add test for getting/setting default encoding in preferences
Java
mit
grimes2/jabref,sauliusg/jabref,zellerdev/jabref,zellerdev/jabref,bartsch-dev/jabref,oscargus/jabref,obraliar/jabref,Braunch/jabref,motokito/jabref,obraliar/jabref,Braunch/jabref,mredaelli/jabref,tschechlovdev/jabref,JabRef/jabref,ayanai1/jabref,motokito/jabref,shitikanth/jabref,mredaelli/jabref,bartsch-dev/jabref,obraliar/jabref,Siedlerchr/jabref,mredaelli/jabref,mairdl/jabref,tschechlovdev/jabref,Mr-DLib/jabref,Braunch/jabref,jhshinn/jabref,tobiasdiez/jabref,grimes2/jabref,jhshinn/jabref,oscargus/jabref,sauliusg/jabref,motokito/jabref,shitikanth/jabref,tobiasdiez/jabref,grimes2/jabref,mredaelli/jabref,sauliusg/jabref,Mr-DLib/jabref,tschechlovdev/jabref,zellerdev/jabref,Mr-DLib/jabref,ayanai1/jabref,tobiasdiez/jabref,obraliar/jabref,shitikanth/jabref,jhshinn/jabref,shitikanth/jabref,shitikanth/jabref,jhshinn/jabref,Siedlerchr/jabref,mairdl/jabref,JabRef/jabref,zellerdev/jabref,JabRef/jabref,Braunch/jabref,ayanai1/jabref,ayanai1/jabref,tobiasdiez/jabref,grimes2/jabref,ayanai1/jabref,bartsch-dev/jabref,tschechlovdev/jabref,mairdl/jabref,motokito/jabref,zellerdev/jabref,bartsch-dev/jabref,Mr-DLib/jabref,Mr-DLib/jabref,Braunch/jabref,sauliusg/jabref,oscargus/jabref,Siedlerchr/jabref,motokito/jabref,mredaelli/jabref,mairdl/jabref,obraliar/jabref,grimes2/jabref,Siedlerchr/jabref,mairdl/jabref,jhshinn/jabref,JabRef/jabref,bartsch-dev/jabref,oscargus/jabref,oscargus/jabref,tschechlovdev/jabref
java
## Code Before: package net.sf.jabref; import static org.junit.Assert.assertEquals; import java.io.File; import org.junit.After; import org.junit.Before; import org.junit.Test; public class JabRefPreferencesTest { private JabRefPreferences prefs; private JabRefPreferences backup; @Before public void setUp() { prefs = JabRefPreferences.getInstance(); backup = prefs; } @Test public void testPreferencesImport() throws JabRefException { // the primary sort field has been changed to "editor" in this case File importFile = new File("src/test/resources/net/sf/jabref/customPreferences.xml"); prefs.importPreferences(importFile.getAbsolutePath()); String expected = "editor"; String actual = prefs.get(JabRefPreferences.SAVE_PRIMARY_SORT_FIELD); assertEquals(expected, actual); } @After public void tearDown() { //clean up preferences to default state prefs.overwritePreferences(backup); } } ## Instruction: Add test for getting/setting default encoding in preferences ## Code After: package net.sf.jabref; import static org.junit.Assert.assertEquals; import java.io.File; import java.nio.charset.StandardCharsets; import org.junit.After; import org.junit.Before; import org.junit.Test; public class JabRefPreferencesTest { private JabRefPreferences prefs; private JabRefPreferences backup; @Before public void setUp() { prefs = JabRefPreferences.getInstance(); backup = prefs; } @Test public void testPreferencesImport() throws JabRefException { // the primary sort field has been changed to "editor" in this case File importFile = new File("src/test/resources/net/sf/jabref/customPreferences.xml"); prefs.importPreferences(importFile.getAbsolutePath()); String expected = "editor"; String actual = prefs.get(JabRefPreferences.SAVE_PRIMARY_SORT_FIELD); assertEquals(expected, actual); } @Test public void getDefaultEncodingReturnsPreviouslyStoredEncoding() { prefs.setDefaultEncoding(StandardCharsets.UTF_16BE); assertEquals(StandardCharsets.UTF_16BE, prefs.getDefaultEncoding()); } @After public void tearDown() { //clean up preferences to default state prefs.overwritePreferences(backup); } }
7074cfd271da781ded38d612a88881c882e193dd
src/jquery-input-file-text.js
src/jquery-input-file-text.js
/** */ (function($) { $.fn.inputFileText = function(userOptions) { var MARKER_ATTRIBUTE = 'data-inputFileText'; if(this.attr(MARKER_ATTRIBUTE) === 'true') { // Plugin has already been applied to input file element return this; } var options = $.extend({ // Defaults text: 'Choose File', remove: false }, userOptions); // Hide input file element this.css({ display: 'none' //width: 0 }); // Insert button after input file element var button = $( '<input type="button" value="' + options.text + '" />' ).insertAfter(this); // Insert text after button element var text = $( '<input type="text" style="readonly:true; border:none; margin-left: 5px" />' ).insertAfter(button); // Open input file dialog when button clicked var self = this; button.click(function() { self.click(); }); // Update text when input file chosen this.change(function() { text.val(self.val()); }); // Mark that this plugin has been applied to the input file element return this.attr(MARKER_ATTRIBUTE, 'true'); }; }(jQuery));
/** */ (function($) { $.fn.inputFileText = function(userOptions) { var MARKER_ATTRIBUTE = 'data-inputFileText'; if(this.attr(MARKER_ATTRIBUTE) === 'true') { // Plugin has already been applied to input file element return this; } var options = $.extend({ // Defaults text: 'Choose File', remove: false }, userOptions); // Hide input file element this.css({ display: 'none' //width: 0 }); // Insert button after input file element var button = $( '<input type="button" value="' + options.text + '" />' ).insertAfter(this); // Insert text after button element var text = $( '<input type="text" style="readonly:true; border:none; margin-left: 5px" />' ).insertAfter(button); // Open input file dialog when button clicked var self = this; button.click(function() { self.click(); }); // Update text when input file chosen this.change(function() { // Chrome puts C:\fakepath\... for file path text.val(self.val().replace('C:\\fakepath\\', '')); }); // Mark that this plugin has been applied to the input file element return this.attr(MARKER_ATTRIBUTE, 'true'); }; }(jQuery));
Fix for Chrome filepath C:\fakepath\
Fix for Chrome filepath C:\fakepath\
JavaScript
mit
datchung/jquery.inputFileText,datchung/jquery.inputFileText
javascript
## Code Before: /** */ (function($) { $.fn.inputFileText = function(userOptions) { var MARKER_ATTRIBUTE = 'data-inputFileText'; if(this.attr(MARKER_ATTRIBUTE) === 'true') { // Plugin has already been applied to input file element return this; } var options = $.extend({ // Defaults text: 'Choose File', remove: false }, userOptions); // Hide input file element this.css({ display: 'none' //width: 0 }); // Insert button after input file element var button = $( '<input type="button" value="' + options.text + '" />' ).insertAfter(this); // Insert text after button element var text = $( '<input type="text" style="readonly:true; border:none; margin-left: 5px" />' ).insertAfter(button); // Open input file dialog when button clicked var self = this; button.click(function() { self.click(); }); // Update text when input file chosen this.change(function() { text.val(self.val()); }); // Mark that this plugin has been applied to the input file element return this.attr(MARKER_ATTRIBUTE, 'true'); }; }(jQuery)); ## Instruction: Fix for Chrome filepath C:\fakepath\ ## Code After: /** */ (function($) { $.fn.inputFileText = function(userOptions) { var MARKER_ATTRIBUTE = 'data-inputFileText'; if(this.attr(MARKER_ATTRIBUTE) === 'true') { // Plugin has already been applied to input file element return this; } var options = $.extend({ // Defaults text: 'Choose File', remove: false }, userOptions); // Hide input file element this.css({ display: 'none' //width: 0 }); // Insert button after input file element var button = $( '<input type="button" value="' + options.text + '" />' ).insertAfter(this); // Insert text after button element var text = $( '<input type="text" style="readonly:true; border:none; margin-left: 5px" />' ).insertAfter(button); // Open input file dialog when button clicked var self = this; button.click(function() { self.click(); }); // Update text when input file chosen this.change(function() { // Chrome puts C:\fakepath\... for file path text.val(self.val().replace('C:\\fakepath\\', '')); }); // Mark that this plugin has been applied to the input file element return this.attr(MARKER_ATTRIBUTE, 'true'); }; }(jQuery));
f1155aa1648f7df67990b2c1511feaafc496df8b
www/ui/header.php
www/ui/header.php
<?php require_once('ui/view.php'); require_once('inc/account.php'); class HeaderView extends View { public function show() { $current_user = Login::GetLoggedInUser(); if ($current_user === FALSE) { ?> <a href="index.php">Home</a> | <a href="login.php">Log In</a> | <a href="register.php">Register</a> <? } else { ?> <a href="index.php">Home</a> | <a href="settings.php">Settings</a> <?php if ($current_user->isAdmin()) { ?> | <a href="admin.php">Administration</a> <? } ?> <div style="float: right;"> You are logged in as <?php echo $current_user->getUsername(); ?>. <a href="logout.php">Log out</a>. </div> <? } } } ?>
<?php require_once('ui/view.php'); require_once('inc/account.php'); class HeaderView extends View { public function show() { $current_user = Login::GetLoggedInUser(); if ($current_user === FALSE) { ?> <a href="login.php">Log In</a> | <a href="register.php">Register</a> <? } else { ?> <a href="settings.php">Settings</a> <?php if ($current_user->isAdmin()) { ?> | <a href="admin.php">Administration</a> <? } ?> <div style="float: right;"> You are logged in as <?php echo $current_user->getUsername(); ?>. <a href="logout.php">Log out</a>. </div> <? } } } ?>
Remove 'Home' link since it's useless.
Remove 'Home' link since it's useless.
PHP
agpl-3.0
defuse/php-newsgroups,defuse/php-newsgroups
php
## Code Before: <?php require_once('ui/view.php'); require_once('inc/account.php'); class HeaderView extends View { public function show() { $current_user = Login::GetLoggedInUser(); if ($current_user === FALSE) { ?> <a href="index.php">Home</a> | <a href="login.php">Log In</a> | <a href="register.php">Register</a> <? } else { ?> <a href="index.php">Home</a> | <a href="settings.php">Settings</a> <?php if ($current_user->isAdmin()) { ?> | <a href="admin.php">Administration</a> <? } ?> <div style="float: right;"> You are logged in as <?php echo $current_user->getUsername(); ?>. <a href="logout.php">Log out</a>. </div> <? } } } ?> ## Instruction: Remove 'Home' link since it's useless. ## Code After: <?php require_once('ui/view.php'); require_once('inc/account.php'); class HeaderView extends View { public function show() { $current_user = Login::GetLoggedInUser(); if ($current_user === FALSE) { ?> <a href="login.php">Log In</a> | <a href="register.php">Register</a> <? } else { ?> <a href="settings.php">Settings</a> <?php if ($current_user->isAdmin()) { ?> | <a href="admin.php">Administration</a> <? } ?> <div style="float: right;"> You are logged in as <?php echo $current_user->getUsername(); ?>. <a href="logout.php">Log out</a>. </div> <? } } } ?>
e2821b56fb7cc4f3917e6c124f0e025c60a234a2
integration_tests/setupStore.js
integration_tests/setupStore.js
// @flow import { createStore, combineReducers, applyMiddleware } from 'redux' import { routerReducer, routerMiddleware } from 'react-router-redux' import { createMemoryHistory } from 'history' import { createReducer } from 'redux-orm' import createSagaMiddleware from 'redux-saga' import sinon from 'sinon' import orm from '../src/models/orm' import * as reducers from '../src/reducers' import sagas from './setupSagas' export const history = createMemoryHistory() export const dispatchSpy = sinon.spy() const spyReducer = (state = {}, action) => { dispatchSpy(action) return state } export default function createStoreWithMiddleware() { const reducer = combineReducers({ spyReducer, orm: createReducer(orm), ...reducers, router: routerReducer }) const sagaMiddleware = createSagaMiddleware() const middleware = [routerMiddleware(history), sagaMiddleware] let store = createStore(reducer, applyMiddleware(...middleware)) sagaMiddleware.run(sagas) return store }
// @flow import { createStore, combineReducers, applyMiddleware } from 'redux' import { routerReducer, routerMiddleware } from 'react-router-redux' import { createMemoryHistory } from 'history' import { createReducer } from 'redux-orm' import createSagaMiddleware from 'redux-saga' import sinon from 'sinon' import orm from '../src/models/orm' import * as reducers from '../src/reducers' import sagas from './setupSagas' export const history = createMemoryHistory() export const dispatchSpy = sinon.spy() const spyReducer = (state = {}, action) => { dispatchSpy(action) return state } export default function createStoreWithMiddleware() { const reducer = combineReducers({ spyReducer, orm: createReducer(orm), ...reducers, router: routerReducer }) const sagaMiddleware = createSagaMiddleware() const middleware = [routerMiddleware(history), sagaMiddleware] // $FlowFixMe: This is erroring for some reason let store = createStore(reducer, applyMiddleware(...middleware)) sagaMiddleware.run(sagas) return store }
Fix flow error in test store setup.
fix(flow): Fix flow error in test store setup.
JavaScript
mit
jsonnull/aleamancer,jsonnull/aleamancer
javascript
## Code Before: // @flow import { createStore, combineReducers, applyMiddleware } from 'redux' import { routerReducer, routerMiddleware } from 'react-router-redux' import { createMemoryHistory } from 'history' import { createReducer } from 'redux-orm' import createSagaMiddleware from 'redux-saga' import sinon from 'sinon' import orm from '../src/models/orm' import * as reducers from '../src/reducers' import sagas from './setupSagas' export const history = createMemoryHistory() export const dispatchSpy = sinon.spy() const spyReducer = (state = {}, action) => { dispatchSpy(action) return state } export default function createStoreWithMiddleware() { const reducer = combineReducers({ spyReducer, orm: createReducer(orm), ...reducers, router: routerReducer }) const sagaMiddleware = createSagaMiddleware() const middleware = [routerMiddleware(history), sagaMiddleware] let store = createStore(reducer, applyMiddleware(...middleware)) sagaMiddleware.run(sagas) return store } ## Instruction: fix(flow): Fix flow error in test store setup. ## Code After: // @flow import { createStore, combineReducers, applyMiddleware } from 'redux' import { routerReducer, routerMiddleware } from 'react-router-redux' import { createMemoryHistory } from 'history' import { createReducer } from 'redux-orm' import createSagaMiddleware from 'redux-saga' import sinon from 'sinon' import orm from '../src/models/orm' import * as reducers from '../src/reducers' import sagas from './setupSagas' export const history = createMemoryHistory() export const dispatchSpy = sinon.spy() const spyReducer = (state = {}, action) => { dispatchSpy(action) return state } export default function createStoreWithMiddleware() { const reducer = combineReducers({ spyReducer, orm: createReducer(orm), ...reducers, router: routerReducer }) const sagaMiddleware = createSagaMiddleware() const middleware = [routerMiddleware(history), sagaMiddleware] // $FlowFixMe: This is erroring for some reason let store = createStore(reducer, applyMiddleware(...middleware)) sagaMiddleware.run(sagas) return store }
07edcea567eb0640edab0dda4f3dabbd0f2c3d98
diary/templates/questions_base.html
diary/templates/questions_base.html
{% extends 'base.html' %} {% block title %}Questions for Week {{ week.week }}{% endblock %} {% block content %} <form id="diary-form" action="{% url 'diary:record_answers' %}" method="POST"> {% csrf_token %} <input type="hidden" name="week" value="{{ week.week }}"> {% block questions %}{% endblock %} </form> <script> has_submitted = false; $("#diary-form").steps({ titleTemplate: '#title#', onStepChanging: function(ev, current, next) { return $('#diary-form').valid(); }, onFinishing: function(ev, current) { if (!has_submitted) { has_submitted = true; $('#diary-form').submit(); } }, labels: { current: '&gt;' } }).validate(); $('input[type="submit"]').hide(); </script> {% endblock %}
{% extends 'base.html' %} {% block title %}Questions for Week {{ week.week }}{% endblock %} {% block content %} <form id="diary-form" action="{% url 'diary:record_answers' %}" method="POST"> {% csrf_token %} <input type="hidden" name="week" value="{{ week.week }}"> {% block questions %}{% endblock %} <h1>6</h1> <div class="screen"> <p> That's all the parts for this week's diary. If you want to review them you can use the Previous and Next buttons. </p> <p> If you're happy with your diary then click the Finish button to save it. Once you do this you won't be able to edit it. </p> <p> Thank you for your participation! </p> </div> </form> <script> has_submitted = false; $("#diary-form").steps({ titleTemplate: '#title#', onStepChanging: function(ev, current, next) { return $('#diary-form').valid(); }, onFinishing: function(ev, current) { if (!has_submitted) { has_submitted = true; $('#diary-form').submit(); } }, labels: { current: '&gt;' } }).validate(); $('input[type="submit"]').hide(); </script> {% endblock %}
Add a confirm page to the diary screens
Add a confirm page to the diary screens To try and cut down on people accidentally submitting
HTML
agpl-3.0
mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey
html
## Code Before: {% extends 'base.html' %} {% block title %}Questions for Week {{ week.week }}{% endblock %} {% block content %} <form id="diary-form" action="{% url 'diary:record_answers' %}" method="POST"> {% csrf_token %} <input type="hidden" name="week" value="{{ week.week }}"> {% block questions %}{% endblock %} </form> <script> has_submitted = false; $("#diary-form").steps({ titleTemplate: '#title#', onStepChanging: function(ev, current, next) { return $('#diary-form').valid(); }, onFinishing: function(ev, current) { if (!has_submitted) { has_submitted = true; $('#diary-form').submit(); } }, labels: { current: '&gt;' } }).validate(); $('input[type="submit"]').hide(); </script> {% endblock %} ## Instruction: Add a confirm page to the diary screens To try and cut down on people accidentally submitting ## Code After: {% extends 'base.html' %} {% block title %}Questions for Week {{ week.week }}{% endblock %} {% block content %} <form id="diary-form" action="{% url 'diary:record_answers' %}" method="POST"> {% csrf_token %} <input type="hidden" name="week" value="{{ week.week }}"> {% block questions %}{% endblock %} <h1>6</h1> <div class="screen"> <p> That's all the parts for this week's diary. If you want to review them you can use the Previous and Next buttons. </p> <p> If you're happy with your diary then click the Finish button to save it. Once you do this you won't be able to edit it. </p> <p> Thank you for your participation! </p> </div> </form> <script> has_submitted = false; $("#diary-form").steps({ titleTemplate: '#title#', onStepChanging: function(ev, current, next) { return $('#diary-form').valid(); }, onFinishing: function(ev, current) { if (!has_submitted) { has_submitted = true; $('#diary-form').submit(); } }, labels: { current: '&gt;' } }).validate(); $('input[type="submit"]').hide(); </script> {% endblock %}
4647183697170ce22910bd6cde27746297543514
python3_tools/get_edx_webservices.py
python3_tools/get_edx_webservices.py
import github from get_repos import * webservices = [] for repo in expanded_repos_list(orgs): try: metadata = get_remote_yaml(repo, 'openedx.yaml') except github.GithubException: continue if 'tags' in metadata and 'webservice' in metadata['tags']: print("{}".format(repo.html_url)) webservices.append(repo)
import github from get_repos import orgs, expanded_repos_list, get_remote_yaml webservices = [] for repo in expanded_repos_list(orgs): try: metadata = get_remote_yaml(repo, 'openedx.yaml') except github.GithubException: continue if 'tags' in metadata and 'webservice' in metadata['tags']: print("{}".format(repo.html_url)) webservices.append(repo)
Add tooling to get all of edx's web services.
Add tooling to get all of edx's web services.
Python
apache-2.0
edx/repo-tools,edx/repo-tools
python
## Code Before: import github from get_repos import * webservices = [] for repo in expanded_repos_list(orgs): try: metadata = get_remote_yaml(repo, 'openedx.yaml') except github.GithubException: continue if 'tags' in metadata and 'webservice' in metadata['tags']: print("{}".format(repo.html_url)) webservices.append(repo) ## Instruction: Add tooling to get all of edx's web services. ## Code After: import github from get_repos import orgs, expanded_repos_list, get_remote_yaml webservices = [] for repo in expanded_repos_list(orgs): try: metadata = get_remote_yaml(repo, 'openedx.yaml') except github.GithubException: continue if 'tags' in metadata and 'webservice' in metadata['tags']: print("{}".format(repo.html_url)) webservices.append(repo)
36d1df8c383002cdc75b66808e1b135607bd4883
cli.ts
cli.ts
/** * Entry point for CLI. * Validate args and kick off electron process so user doesn't have to invoke * electron directly. */ import * as Child from "child_process"; import * as Path from "path"; import * as Yargs from "yargs"; import * as Args from "./arg-parsing"; // Parse cli args before requiring running electron. const argv: Yargs.Arguments = Args.parse(); Child.exec(`electron ${Path.join(__dirname, "cli-electron.js")} ` + process.argv.slice(2), (err: Error, stdout: string, errout: string) => { console.log("Error:", errout); });
/** * Entry point for CLI. * Validate args and kick off electron process so user doesn't have to invoke * electron directly. */ import * as Child from "child_process"; import * as Path from "path"; import * as Yargs from "yargs"; import * as Args from "./arg-parsing"; // Parse cli args before requiring running electron. const argv: Yargs.Arguments = Args.parse(); Child.exec(`./node_modules/.bin/electron ${Path.join(__dirname, "cli-electron.js")} ` + process.argv.slice(2), (err: Error, stdout: string, errout: string) => { console.log("Error:", errout); });
Use local version of electron
Use local version of electron
TypeScript
mit
trodi/peer-review-cli,trodi/peer-review-cli
typescript
## Code Before: /** * Entry point for CLI. * Validate args and kick off electron process so user doesn't have to invoke * electron directly. */ import * as Child from "child_process"; import * as Path from "path"; import * as Yargs from "yargs"; import * as Args from "./arg-parsing"; // Parse cli args before requiring running electron. const argv: Yargs.Arguments = Args.parse(); Child.exec(`electron ${Path.join(__dirname, "cli-electron.js")} ` + process.argv.slice(2), (err: Error, stdout: string, errout: string) => { console.log("Error:", errout); }); ## Instruction: Use local version of electron ## Code After: /** * Entry point for CLI. * Validate args and kick off electron process so user doesn't have to invoke * electron directly. */ import * as Child from "child_process"; import * as Path from "path"; import * as Yargs from "yargs"; import * as Args from "./arg-parsing"; // Parse cli args before requiring running electron. const argv: Yargs.Arguments = Args.parse(); Child.exec(`./node_modules/.bin/electron ${Path.join(__dirname, "cli-electron.js")} ` + process.argv.slice(2), (err: Error, stdout: string, errout: string) => { console.log("Error:", errout); });
6935fbe97bf8ddfdcf6364e298f34bafc859035c
app/views/reaches/edit.erb
app/views/reaches/edit.erb
<div class="container"> <center> <h1> Update Reach </h1> <div class="update_reach"> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="PUT"> Contact name: <input type="text" name="reach[contact_name]" value="<%[email protected]_name %>"><br><br> Contact phone: <input type="text" name="reach[contact_phone]" value="<%[email protected]_phone %>"><br><br> Text: <br> <textarea name="reach[text]" rows="5"><%= @reach.text %></textarea><br><br> Label: <input type="text" name="reach[label]" value="<%[email protected] %>"><br><br> <input type="checkbox" name="reach[main_reach]" <% if @reach.main_reach %>checked<% end %>>Set as primary Reach<br><br> <input type="submit" value="Update" class="btn btn-success"><br> </form> </div> <div class="delete_reach"> <br> <br> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="DELETE"> <input type="submit" value="Delete" class="btn btn-danger"> </form> </div> </center> </div>
<div class="container"> <center> <h1> Update Reach </h1> <div class="update_reach"> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="PUT"> Contact name: <input type="text" name="reach[contact_name]" value="<%[email protected]_name %>"><br><br> Contact phone: <input type="text" name="reach[contact_phone]" value="<%[email protected]_phone %>"><br><br> Text: <br> <textarea name="reach[text]" rows="5"><%= @reach.text %></textarea><br><br> Label: <input type="text" name="reach[label]" value="<%[email protected] %>"><br><br> <% if @reach.main_reach %> <input type="checkbox" name="reach[main_reach]" checked> <% else %> <input type="checkbox" name="reach[main_reach]"> <% end %> Set as main Reach<br><br> <input type="submit" value="Update" class="btn btn-success"><br> </form> </div> <div class="delete_reach"> <br> <br> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="DELETE"> <input type="submit" value="Delete" class="btn btn-danger"> </form> </div> </center> </div>
Fix check box for main reach
Fix check box for main reach
HTML+ERB
mit
hypatiah/reach,hypatiah/reach,hypatiah/reach
html+erb
## Code Before: <div class="container"> <center> <h1> Update Reach </h1> <div class="update_reach"> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="PUT"> Contact name: <input type="text" name="reach[contact_name]" value="<%[email protected]_name %>"><br><br> Contact phone: <input type="text" name="reach[contact_phone]" value="<%[email protected]_phone %>"><br><br> Text: <br> <textarea name="reach[text]" rows="5"><%= @reach.text %></textarea><br><br> Label: <input type="text" name="reach[label]" value="<%[email protected] %>"><br><br> <input type="checkbox" name="reach[main_reach]" <% if @reach.main_reach %>checked<% end %>>Set as primary Reach<br><br> <input type="submit" value="Update" class="btn btn-success"><br> </form> </div> <div class="delete_reach"> <br> <br> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="DELETE"> <input type="submit" value="Delete" class="btn btn-danger"> </form> </div> </center> </div> ## Instruction: Fix check box for main reach ## Code After: <div class="container"> <center> <h1> Update Reach </h1> <div class="update_reach"> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="PUT"> Contact name: <input type="text" name="reach[contact_name]" value="<%[email protected]_name %>"><br><br> Contact phone: <input type="text" name="reach[contact_phone]" value="<%[email protected]_phone %>"><br><br> Text: <br> <textarea name="reach[text]" rows="5"><%= @reach.text %></textarea><br><br> Label: <input type="text" name="reach[label]" value="<%[email protected] %>"><br><br> <% if @reach.main_reach %> <input type="checkbox" name="reach[main_reach]" checked> <% else %> <input type="checkbox" name="reach[main_reach]"> <% end %> Set as main Reach<br><br> <input type="submit" value="Update" class="btn btn-success"><br> </form> </div> <div class="delete_reach"> <br> <br> <form action="/reaches/<%= @reach.id %>" method="POST"> <input type="hidden" name="_method" value="DELETE"> <input type="submit" value="Delete" class="btn btn-danger"> </form> </div> </center> </div>
c5f978ca2ab6040cdf5f60d6c3916df5d5c243ac
lib/rbplusplus/builders/extension.rb
lib/rbplusplus/builders/extension.rb
module RbPlusPlus module Builders # Extension node. # There is only ever one of these in a project as this is # the top level node for building a Ruby extension. # # Extensions are effectively Modules with some slightly different # symantics, in that they expose to Kernel and have slightly # different function handling and code generation. class ExtensionNode < ModuleNode def initialize(name, code, modules) super(nil, name, code, modules, nil) end def qualified_name name end def add_includes(includes) includes.each do |inc| add_child IncludeNode.new(self, inc) end end def build super self.rice_variable = nil self.rice_variable_type = nil end def write # Let nodes build their code, splitting up code blocks into # includes, declarations, and registrations, # then wrap it up in our own template registrations << "extern \"C\"" registrations << "void Init_#{@name}() {" end private def with_module_functions @code.functions.each do |func| add_child GlobalFunctionNode.new(func, self) end end end end end
module RbPlusPlus module Builders # Extension node. # There is only ever one of these in a project as this is # the top level node for building a Ruby extension. # # Extensions are effectively Modules with some slightly different # symantics, in that they expose to Kernel and have slightly # different function handling and code generation. class ExtensionNode < ModuleNode def initialize(name, code, modules) super(nil, name, code, modules, nil) end def qualified_name name end def add_includes(includes) includes.each do |inc| add_child IncludeNode.new(self, inc) end end def build super self.rice_variable = nil self.rice_variable_type = nil end def write # Let nodes build their code, splitting up code blocks into # includes, declarations, and registrations, # then wrap it up in our own template registrations << "extern \"C\"" registrations << "void Init_#{@name}() {" end private def with_module_functions @code.functions.each do |func| next if do_not_wrap?(func) add_child GlobalFunctionNode.new(func, self) end end end end end
Make sure to take into account the same availability checks for global functions
Make sure to take into account the same availability checks for global functions
Ruby
mit
jasonroelofs/rbplusplus,jasonroelofs/rbplusplus,jasonroelofs/rbplusplus,jasonroelofs/rbplusplus
ruby
## Code Before: module RbPlusPlus module Builders # Extension node. # There is only ever one of these in a project as this is # the top level node for building a Ruby extension. # # Extensions are effectively Modules with some slightly different # symantics, in that they expose to Kernel and have slightly # different function handling and code generation. class ExtensionNode < ModuleNode def initialize(name, code, modules) super(nil, name, code, modules, nil) end def qualified_name name end def add_includes(includes) includes.each do |inc| add_child IncludeNode.new(self, inc) end end def build super self.rice_variable = nil self.rice_variable_type = nil end def write # Let nodes build their code, splitting up code blocks into # includes, declarations, and registrations, # then wrap it up in our own template registrations << "extern \"C\"" registrations << "void Init_#{@name}() {" end private def with_module_functions @code.functions.each do |func| add_child GlobalFunctionNode.new(func, self) end end end end end ## Instruction: Make sure to take into account the same availability checks for global functions ## Code After: module RbPlusPlus module Builders # Extension node. # There is only ever one of these in a project as this is # the top level node for building a Ruby extension. # # Extensions are effectively Modules with some slightly different # symantics, in that they expose to Kernel and have slightly # different function handling and code generation. class ExtensionNode < ModuleNode def initialize(name, code, modules) super(nil, name, code, modules, nil) end def qualified_name name end def add_includes(includes) includes.each do |inc| add_child IncludeNode.new(self, inc) end end def build super self.rice_variable = nil self.rice_variable_type = nil end def write # Let nodes build their code, splitting up code blocks into # includes, declarations, and registrations, # then wrap it up in our own template registrations << "extern \"C\"" registrations << "void Init_#{@name}() {" end private def with_module_functions @code.functions.each do |func| next if do_not_wrap?(func) add_child GlobalFunctionNode.new(func, self) end end end end end
17797e2cded9aeab7bf4d7a005339a4af6944d34
archive.go
archive.go
package gohandy import ( "archive/tar" "io" "os" "path/filepath" ) func Unpack(r *tar.Reader, toPath string) error { for { hdr, err := r.Next() if err == io.EOF { break } if err != nil { return err } err = nil if hdr.Typeflag == tar.TypeDir { dirpath := filepath.Join(toPath, hdr.Name) err = os.MkdirAll(dirpath, 0777) } else if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeRegA { err = writeFile(toPath, hdr.Name, r) } if err != nil { return nil } } return nil } func writeFile(toPath, filename string, r *tar.Reader) error { path := filepath.Join(toPath, filename) out, err := os.Create(path) if err != nil { return err } defer out.Close() if _, err := io.Copy(out, r); err != nil { return err } return nil }
package gohandy import ( "archive/tar" "io" "os" "path/filepath" ) func Unpack(r *tar.Reader, toPath string) error { for { hdr, err := r.Next() switch { case err == io.EOF: break case err != nil: return err default: if err := doOnType(hdr.Typeflag, toPath, hdr.Name, r); err != nil { return err } } } return nil } func doOnType(typeFlag byte, toPath string, name string, r *tar.Reader) error { fullpath := filepath.Join(toPath, name) switch typeFlag { case tar.TypeReg, tar.TypeRegA: return writeFile(fullpath, r) case tar.TypeDir: return os.MkdirAll(fullpath, 0777) default: return nil } } func writeFile(path string, r *tar.Reader) error { out, err := os.Create(path) if err != nil { return err } defer out.Close() _, err = io.Copy(out, r) return err }
Refactor to make code more readable.
Refactor to make code more readable.
Go
mit
materials-commons/gohandy,materials-commons/gohandy
go
## Code Before: package gohandy import ( "archive/tar" "io" "os" "path/filepath" ) func Unpack(r *tar.Reader, toPath string) error { for { hdr, err := r.Next() if err == io.EOF { break } if err != nil { return err } err = nil if hdr.Typeflag == tar.TypeDir { dirpath := filepath.Join(toPath, hdr.Name) err = os.MkdirAll(dirpath, 0777) } else if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeRegA { err = writeFile(toPath, hdr.Name, r) } if err != nil { return nil } } return nil } func writeFile(toPath, filename string, r *tar.Reader) error { path := filepath.Join(toPath, filename) out, err := os.Create(path) if err != nil { return err } defer out.Close() if _, err := io.Copy(out, r); err != nil { return err } return nil } ## Instruction: Refactor to make code more readable. ## Code After: package gohandy import ( "archive/tar" "io" "os" "path/filepath" ) func Unpack(r *tar.Reader, toPath string) error { for { hdr, err := r.Next() switch { case err == io.EOF: break case err != nil: return err default: if err := doOnType(hdr.Typeflag, toPath, hdr.Name, r); err != nil { return err } } } return nil } func doOnType(typeFlag byte, toPath string, name string, r *tar.Reader) error { fullpath := filepath.Join(toPath, name) switch typeFlag { case tar.TypeReg, tar.TypeRegA: return writeFile(fullpath, r) case tar.TypeDir: return os.MkdirAll(fullpath, 0777) default: return nil } } func writeFile(path string, r *tar.Reader) error { out, err := os.Create(path) if err != nil { return err } defer out.Close() _, err = io.Copy(out, r) return err }
d3bd236c66fcc401499208441b332b87d45d1588
src/reducers/reducer_weather.js
src/reducers/reducer_weather.js
export default function(state = null, action) { return state; }
import { FETCH_WEATHER } from "../actions/index"; export default function(state = [], action) { switch (action.type) { case FETCH_WEATHER: // return state.concat([ action.payload.data ]); return [ action.payload.data, ...state ]; // insert array at the top [ city, city, city, ...] } return state; }
Add request payload data to state
Add request payload data to state
JavaScript
mit
eduarmreyes/ReactWeatherApp,eduarmreyes/ReactWeatherApp
javascript
## Code Before: export default function(state = null, action) { return state; } ## Instruction: Add request payload data to state ## Code After: import { FETCH_WEATHER } from "../actions/index"; export default function(state = [], action) { switch (action.type) { case FETCH_WEATHER: // return state.concat([ action.payload.data ]); return [ action.payload.data, ...state ]; // insert array at the top [ city, city, city, ...] } return state; }
319cd9449cda087fef68c838af04e5b89134e0f3
content/W2015/W15-event-destress.md
content/W2015/W15-event-destress.md
Title: Big CSters Discussion Circles: De-Stressing Date: 2015-03-05 18:00 Category: Events Tags: social Slug: de-stress Author: Anna Lorimer Summary: School is stressful! Come find out what strategies upper-year students use to handle their workload. Big CSters would like to invite you to our first CSters discussion circle all about de-stressing! There will be several activities centered around recognizing when you are stressed and what causes it. The evening will finish with a presentation and discussion of strategies to manage stress. There will be tacos (vegetarian option available) and other snacks! **About Big CSters** Our Big CSters program helps connect cis and trans, and non-binary folk students with other students in Computer Science and related fields, through social events geared towards mentorship. ## Event Details ## + **Who:** Big and Little CSters + **What:** Big CSters Circle Discussion: De&ndash;stressing + **Where:**: M3 2134 + **When:** Thurs. Mar. 5, 6:00&ndash;8:00PM
Title: Big CSters Discussion Circles: De-Stressing Date: 2015-03-05 18:00 Category: Events Tags: social, big csters Slug: destressing Author: Anna Lorimer Summary: School is stressful! Come find out what strategies upper-year students use to handle their workload. Big CSters would like to invite you to our first CSters discussion circle all about de-stressing! There will be several activities centered around recognizing when you are stressed and what causes it. The evening will finish with a presentation and discussion of strategies to manage stress. There will be tacos (vegetarian option available) and other snacks! **About Big CSters:** Our Big CSters program helps connect cis &amp; trans women and non-binary students in computer science and related fields, through events geared towards mentorship and community-building. ## Event Details ## + **Who:** Big and Little CSters + **What:** Big CSters Circle Discussion: De-stressing + **Where:** M3 2134 + **When:** Thurs. Mar. 5, 6:00&ndash;8:00PM
Update de-stress event with PR feedback
Update de-stress event with PR feedback
Markdown
agpl-3.0
claricen/website,ehashman/website-wics,ehashman/website-wics,fboxwala/website,annalorimer/website,annalorimer/website,annalorimer/website,claricen/website,arshiamufti/website,evykassirer/wics-website,ehashman/website-wics,evykassirer/wics-website,arshiamufti/website,arshiamufti/website,fboxwala/website,claricen/website,fboxwala/website,evykassirer/wics-website
markdown
## Code Before: Title: Big CSters Discussion Circles: De-Stressing Date: 2015-03-05 18:00 Category: Events Tags: social Slug: de-stress Author: Anna Lorimer Summary: School is stressful! Come find out what strategies upper-year students use to handle their workload. Big CSters would like to invite you to our first CSters discussion circle all about de-stressing! There will be several activities centered around recognizing when you are stressed and what causes it. The evening will finish with a presentation and discussion of strategies to manage stress. There will be tacos (vegetarian option available) and other snacks! **About Big CSters** Our Big CSters program helps connect cis and trans, and non-binary folk students with other students in Computer Science and related fields, through social events geared towards mentorship. ## Event Details ## + **Who:** Big and Little CSters + **What:** Big CSters Circle Discussion: De&ndash;stressing + **Where:**: M3 2134 + **When:** Thurs. Mar. 5, 6:00&ndash;8:00PM ## Instruction: Update de-stress event with PR feedback ## Code After: Title: Big CSters Discussion Circles: De-Stressing Date: 2015-03-05 18:00 Category: Events Tags: social, big csters Slug: destressing Author: Anna Lorimer Summary: School is stressful! Come find out what strategies upper-year students use to handle their workload. Big CSters would like to invite you to our first CSters discussion circle all about de-stressing! There will be several activities centered around recognizing when you are stressed and what causes it. The evening will finish with a presentation and discussion of strategies to manage stress. There will be tacos (vegetarian option available) and other snacks! **About Big CSters:** Our Big CSters program helps connect cis &amp; trans women and non-binary students in computer science and related fields, through events geared towards mentorship and community-building. ## Event Details ## + **Who:** Big and Little CSters + **What:** Big CSters Circle Discussion: De-stressing + **Where:** M3 2134 + **When:** Thurs. Mar. 5, 6:00&ndash;8:00PM
84429bfd02de1831f5080a944b9cb7cfea466239
README.md
README.md
Tracka Keepa is a time keeping web application. Specific features will a task interruption tracker, physical button integration and anything else that comes to mind. I expect the project will develop a personality as development progresses. ## Tests ## Tests are run with Protractor and Cucumber. WebDriver must be running in order for the gulp tests to run. npm install bower install webdriver-manager update webdriver-manager start gulp
[ ![Codeship Status for johnapost/tracka-keepa](https://codeship.com/projects/4c85bbe0-9151-0132-34f5-6e434ff849c7/status?branch=master)](https://codeship.com/projects/61691) ### What is Tracka Keepa ### Tracka Keepa is a time keeping web application. Specific features will a task interruption tracker, physical button integration and anything else that comes to mind. I expect the project will develop a personality as development progresses. ## Tests ## Tests are run with Protractor and Cucumber. WebDriver must be running in order for the gulp tests to run. npm install bower install webdriver-manager update webdriver-manager start gulp
Add Codeship status to readme
Add Codeship status to readme
Markdown
mit
johnapost/tracka-keepa,johnapost/tracka-keepa
markdown
## Code Before: Tracka Keepa is a time keeping web application. Specific features will a task interruption tracker, physical button integration and anything else that comes to mind. I expect the project will develop a personality as development progresses. ## Tests ## Tests are run with Protractor and Cucumber. WebDriver must be running in order for the gulp tests to run. npm install bower install webdriver-manager update webdriver-manager start gulp ## Instruction: Add Codeship status to readme ## Code After: [ ![Codeship Status for johnapost/tracka-keepa](https://codeship.com/projects/4c85bbe0-9151-0132-34f5-6e434ff849c7/status?branch=master)](https://codeship.com/projects/61691) ### What is Tracka Keepa ### Tracka Keepa is a time keeping web application. Specific features will a task interruption tracker, physical button integration and anything else that comes to mind. I expect the project will develop a personality as development progresses. ## Tests ## Tests are run with Protractor and Cucumber. WebDriver must be running in order for the gulp tests to run. npm install bower install webdriver-manager update webdriver-manager start gulp
4827551abdd2ecf9b87666c361e0bbb36544ce3c
gutentag.gemspec
gutentag.gemspec
Gem::Specification.new do |s| s.name = 'gutentag' s.version = '0.6.0' s.authors = ['Pat Allan'] s.email = ['[email protected]'] s.homepage = 'https://github.com/pat/gutentag' s.summary = 'Good Tags' s.description = 'A good, simple, solid tagging extension for ActiveRecord' s.license = 'MIT' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec}/*`.split("\n") s.require_paths = ['lib'] s.add_runtime_dependency 'activerecord', '>= 3.2.0' s.add_runtime_dependency 'appraisal', '~> 1.0.2' s.add_development_dependency 'combustion', '0.5.1' s.add_development_dependency 'rspec-rails', '~> 3.1' s.add_development_dependency 'sqlite3', '~> 1.3.7' end
Gem::Specification.new do |s| s.name = 'gutentag' s.version = '0.6.0' s.authors = ['Pat Allan'] s.email = ['[email protected]'] s.homepage = 'https://github.com/pat/gutentag' s.summary = 'Good Tags' s.description = 'A good, simple, solid tagging extension for ActiveRecord' s.license = 'MIT' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec}/*`.split("\n") s.require_paths = ['lib'] s.add_runtime_dependency 'activerecord', '>= 3.2.0' s.add_runtime_dependency 'appraisal', '~> 1.0.2' s.add_development_dependency 'bundler', '>= 1.7.12' s.add_development_dependency 'combustion', '0.5.1' s.add_development_dependency 'rspec-rails', '~> 3.1' s.add_development_dependency 'sqlite3', '~> 1.3.7' end
Use latest release of bundler.
Use latest release of bundler. Required for ruby_22 flag.
Ruby
mit
pat/gutentag,pat/gutentag
ruby
## Code Before: Gem::Specification.new do |s| s.name = 'gutentag' s.version = '0.6.0' s.authors = ['Pat Allan'] s.email = ['[email protected]'] s.homepage = 'https://github.com/pat/gutentag' s.summary = 'Good Tags' s.description = 'A good, simple, solid tagging extension for ActiveRecord' s.license = 'MIT' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec}/*`.split("\n") s.require_paths = ['lib'] s.add_runtime_dependency 'activerecord', '>= 3.2.0' s.add_runtime_dependency 'appraisal', '~> 1.0.2' s.add_development_dependency 'combustion', '0.5.1' s.add_development_dependency 'rspec-rails', '~> 3.1' s.add_development_dependency 'sqlite3', '~> 1.3.7' end ## Instruction: Use latest release of bundler. Required for ruby_22 flag. ## Code After: Gem::Specification.new do |s| s.name = 'gutentag' s.version = '0.6.0' s.authors = ['Pat Allan'] s.email = ['[email protected]'] s.homepage = 'https://github.com/pat/gutentag' s.summary = 'Good Tags' s.description = 'A good, simple, solid tagging extension for ActiveRecord' s.license = 'MIT' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec}/*`.split("\n") s.require_paths = ['lib'] s.add_runtime_dependency 'activerecord', '>= 3.2.0' s.add_runtime_dependency 'appraisal', '~> 1.0.2' s.add_development_dependency 'bundler', '>= 1.7.12' s.add_development_dependency 'combustion', '0.5.1' s.add_development_dependency 'rspec-rails', '~> 3.1' s.add_development_dependency 'sqlite3', '~> 1.3.7' end
2ba6fb3884d3b53438fbf25257bdf5f7ce07c7fc
sources/unicode.org/2014-code-mappings/meta.txt
sources/unicode.org/2014-code-mappings/meta.txt
URL: http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml XPath: /supplementalData/codeMappings/territoryCodes Description: Copyright © 1991-2013 Unicode, Inc. CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) For terms of use, see http://www.unicode.org/copyright.html data generated with CountItems tool per http://sites.google.com/site/cldr/development/updating-codes/update-languagescriptregion-subtags
URL: http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml XPath: /supplementalData/codeMappings/territoryCodes Checked: 2015-02-04 Description: Copyright © 1991-2013 Unicode, Inc. CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) For terms of use, see http://www.unicode.org/copyright.html data generated with CountItems tool per http://sites.google.com/site/cldr/development/updating-codes/update-languagescriptregion-subtags
Check data.csv vs source in XML format
Check data.csv vs source in XML format I checked each code mapping and found no differences, except leading zeros not displayed in numeric codes in LibreOffice Calc (but present in the CSV).
Text
cc0-1.0
eric-brechemier/ipcc-countries,eric-brechemier/ipcc-countries
text
## Code Before: URL: http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml XPath: /supplementalData/codeMappings/territoryCodes Description: Copyright © 1991-2013 Unicode, Inc. CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) For terms of use, see http://www.unicode.org/copyright.html data generated with CountItems tool per http://sites.google.com/site/cldr/development/updating-codes/update-languagescriptregion-subtags ## Instruction: Check data.csv vs source in XML format I checked each code mapping and found no differences, except leading zeros not displayed in numeric codes in LibreOffice Calc (but present in the CSV). ## Code After: URL: http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml XPath: /supplementalData/codeMappings/territoryCodes Checked: 2015-02-04 Description: Copyright © 1991-2013 Unicode, Inc. CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) For terms of use, see http://www.unicode.org/copyright.html data generated with CountItems tool per http://sites.google.com/site/cldr/development/updating-codes/update-languagescriptregion-subtags
b16f72fcabaa3c65e8149f370a795ea030145c6f
config/routes.rb
config/routes.rb
Rails.application.routes.draw do # Render legal documents by using Keiyaku CSS # https://github.com/cognitom/keiyaku-css resources :contracts, only: [:index, :show] # Redirects get "/releases/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') get "/blogs/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') # Issue SSL Certification get "/.well-known/acme-challenge/:id" => "page#letsencrypt" get "/.well-known/acme-challenge/:id" => "plain_page#letsencrypt" # Sessions get '/logout', to: 'sessions#destroy' resource :session, only: [:create, :destroy] # Default Scrivito routes. Adapt them to change the routing of CMS objects. # See the documentation of 'scrivito_route' for a detailed description. scrivito_route '/', using: 'homepage' scrivito_route '(/)(*slug-):id', using: 'slug_id' scrivito_route '/*permalink', using: 'permalink', format: false end
Rails.application.routes.draw do # Render legal documents by using Keiyaku CSS # https://github.com/cognitom/keiyaku-css resources :contracts, only: [:index, :show], path: '/mou' # Redirects get "/releases/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') get "/blogs/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') # Issue SSL Certification get "/.well-known/acme-challenge/:id" => "page#letsencrypt" get "/.well-known/acme-challenge/:id" => "plain_page#letsencrypt" # Sessions get '/logout', to: 'sessions#destroy' resource :session, only: [:create, :destroy] # Default Scrivito routes. Adapt them to change the routing of CMS objects. # See the documentation of 'scrivito_route' for a detailed description. scrivito_route '/', using: 'homepage' scrivito_route '(/)(*slug-):id', using: 'slug_id' scrivito_route '/*permalink', using: 'permalink', format: false end
Change routing from /contracts to /mou
Change routing from /contracts to /mou
Ruby
mit
yasslab/coderdojo.jp,yasslab/coderdojo.jp,coderdojo-japan/coderdojo.jp,coderdojo-japan/coderdojo.jp,yasslab/coderdojo.jp,coderdojo-japan/coderdojo.jp,coderdojo-japan/coderdojo.jp
ruby
## Code Before: Rails.application.routes.draw do # Render legal documents by using Keiyaku CSS # https://github.com/cognitom/keiyaku-css resources :contracts, only: [:index, :show] # Redirects get "/releases/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') get "/blogs/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') # Issue SSL Certification get "/.well-known/acme-challenge/:id" => "page#letsencrypt" get "/.well-known/acme-challenge/:id" => "plain_page#letsencrypt" # Sessions get '/logout', to: 'sessions#destroy' resource :session, only: [:create, :destroy] # Default Scrivito routes. Adapt them to change the routing of CMS objects. # See the documentation of 'scrivito_route' for a detailed description. scrivito_route '/', using: 'homepage' scrivito_route '(/)(*slug-):id', using: 'slug_id' scrivito_route '/*permalink', using: 'permalink', format: false end ## Instruction: Change routing from /contracts to /mou ## Code After: Rails.application.routes.draw do # Render legal documents by using Keiyaku CSS # https://github.com/cognitom/keiyaku-css resources :contracts, only: [:index, :show], path: '/mou' # Redirects get "/releases/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') get "/blogs/2016/12/12/new-backend", to: redirect('/news/2016/12/12/new-backend') # Issue SSL Certification get "/.well-known/acme-challenge/:id" => "page#letsencrypt" get "/.well-known/acme-challenge/:id" => "plain_page#letsencrypt" # Sessions get '/logout', to: 'sessions#destroy' resource :session, only: [:create, :destroy] # Default Scrivito routes. Adapt them to change the routing of CMS objects. # See the documentation of 'scrivito_route' for a detailed description. scrivito_route '/', using: 'homepage' scrivito_route '(/)(*slug-):id', using: 'slug_id' scrivito_route '/*permalink', using: 'permalink', format: false end
dd29c72b58581a4a56d7432944514ca11de888bd
lisp/init-locales.el
lisp/init-locales.el
;;; init-locales.el --- Configure default locale -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (defun sanityinc/utf8-locale-p (v) "Return whether locale string V relates to a UTF-8 locale." (and v (string-match "UTF-8" v))) (defun sanityinc/locale-is-utf8-p () "Return t iff the \"locale\" command or environment variables prefer UTF-8." (or (sanityinc/utf8-locale-p (and (executable-find "locale") (shell-command-to-string "locale"))) (sanityinc/utf8-locale-p (getenv "LC_ALL")) (sanityinc/utf8-locale-p (getenv "LC_CTYPE")) (sanityinc/utf8-locale-p (getenv "LANG")))) (when (or window-system (sanityinc/locale-is-utf8-p)) (set-language-environment 'utf-8) (setq locale-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-selection-coding-system (if (eq system-type 'windows-nt) 'utf-16-le 'utf-8)) (prefer-coding-system 'utf-8)) (provide 'init-locales) ;;; init-locales.el ends here
;;; init-locales.el --- Configure default locale -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (defun sanityinc/utf8-locale-p (v) "Return whether locale string V relates to a UTF-8 locale." (and v (string-match "UTF-8" v))) (defun sanityinc/locale-is-utf8-p () "Return t iff the \"locale\" command or environment variables prefer UTF-8." (or (sanityinc/utf8-locale-p (and (executable-find "locale") (shell-command-to-string "locale"))) (sanityinc/utf8-locale-p (getenv "LC_ALL")) (sanityinc/utf8-locale-p (getenv "LC_CTYPE")) (sanityinc/utf8-locale-p (getenv "LANG")))) (when (or window-system (sanityinc/locale-is-utf8-p)) (set-language-environment 'utf-8) (setq locale-coding-system 'utf-8) (set-selection-coding-system (if (eq system-type 'windows-nt) 'utf-16-le 'utf-8)) (prefer-coding-system 'utf-8)) (provide 'init-locales) ;;; init-locales.el ends here
Remove redundant coding system configuration
Remove redundant coding system configuration
Emacs Lisp
bsd-2-clause
lust4life/emacs.d,arthurl/emacs.d,benkha/emacs.d,purcell/emacs.d,sgarciac/emacs.d,baohaojun/emacs.d,dcorking/emacs.d,krzysz00/emacs.d,svenyurgensson/emacs.d,cjqw/emacs.d,braveoyster/emacs.d,wegatron/emacs.d,gsmlg/emacs.d,emuio/emacs.d,blueseason/emacs.d,qianwan/emacs.d,blueabysm/emacs.d
emacs-lisp
## Code Before: ;;; init-locales.el --- Configure default locale -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (defun sanityinc/utf8-locale-p (v) "Return whether locale string V relates to a UTF-8 locale." (and v (string-match "UTF-8" v))) (defun sanityinc/locale-is-utf8-p () "Return t iff the \"locale\" command or environment variables prefer UTF-8." (or (sanityinc/utf8-locale-p (and (executable-find "locale") (shell-command-to-string "locale"))) (sanityinc/utf8-locale-p (getenv "LC_ALL")) (sanityinc/utf8-locale-p (getenv "LC_CTYPE")) (sanityinc/utf8-locale-p (getenv "LANG")))) (when (or window-system (sanityinc/locale-is-utf8-p)) (set-language-environment 'utf-8) (setq locale-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-selection-coding-system (if (eq system-type 'windows-nt) 'utf-16-le 'utf-8)) (prefer-coding-system 'utf-8)) (provide 'init-locales) ;;; init-locales.el ends here ## Instruction: Remove redundant coding system configuration ## Code After: ;;; init-locales.el --- Configure default locale -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (defun sanityinc/utf8-locale-p (v) "Return whether locale string V relates to a UTF-8 locale." (and v (string-match "UTF-8" v))) (defun sanityinc/locale-is-utf8-p () "Return t iff the \"locale\" command or environment variables prefer UTF-8." (or (sanityinc/utf8-locale-p (and (executable-find "locale") (shell-command-to-string "locale"))) (sanityinc/utf8-locale-p (getenv "LC_ALL")) (sanityinc/utf8-locale-p (getenv "LC_CTYPE")) (sanityinc/utf8-locale-p (getenv "LANG")))) (when (or window-system (sanityinc/locale-is-utf8-p)) (set-language-environment 'utf-8) (setq locale-coding-system 'utf-8) (set-selection-coding-system (if (eq system-type 'windows-nt) 'utf-16-le 'utf-8)) (prefer-coding-system 'utf-8)) (provide 'init-locales) ;;; init-locales.el ends here
7e6c617988e7982d319f099da5fd3f0d4e689ead
README.md
README.md
Early Stages Angular & Ionic Project. [![Build Status](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic.svg?branch=travis)](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic) #### This is a Github Repository for collaborating with 2017's Informatics Project Lecture. --- ## **Details** Development Framework : **Ionic v2.0.1 BUILD 2017-02-08** Framework Plugin : **Ionic Native** Mobile Environment Support : **Android**,**iOS**, ~~Windows Phone~~ Development Status : **Alpha** --- ## **Project Groups** Leader -> **Kevin Pratama** Members 1. **Carissa Ulibasa** 2. **Devi Apriliani** 3. **Jovanka Helen** 4. **Reza Reynaldi**
Early Stages Angular & Ionic Project. [![Build Status](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic.svg?branch=travis)](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic) #### This is a Github Repository for collaborating with 2017's Informatics Project Lecture. --- ## **Details** Development Framework : **Ionic v2.0.1 BUILD 2017-02-08** Framework Plugin : **Ionic Native** Mobile Environment Support : **Android**,**iOS**, ~~Windows Phone~~ Development Status : **Public Beta Release** --- ## **Project Groups** Leader -> **Kevin Pratama** Members 1. **Carissa Ulibasa** 2. **Devi Apriliani** 3. **Jovanka Helen** 4. **Reza Reynaldi**
Update fungsi upload dan FrameApplier
Update fungsi upload dan FrameApplier
Markdown
mit
kpratama24/earlyStagesInformatics-ionic,kpratama24/earlyStagesInformatics-ionic,kpratama24/earlyStagesInformatics-ionic
markdown
## Code Before: Early Stages Angular & Ionic Project. [![Build Status](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic.svg?branch=travis)](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic) #### This is a Github Repository for collaborating with 2017's Informatics Project Lecture. --- ## **Details** Development Framework : **Ionic v2.0.1 BUILD 2017-02-08** Framework Plugin : **Ionic Native** Mobile Environment Support : **Android**,**iOS**, ~~Windows Phone~~ Development Status : **Alpha** --- ## **Project Groups** Leader -> **Kevin Pratama** Members 1. **Carissa Ulibasa** 2. **Devi Apriliani** 3. **Jovanka Helen** 4. **Reza Reynaldi** ## Instruction: Update fungsi upload dan FrameApplier ## Code After: Early Stages Angular & Ionic Project. [![Build Status](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic.svg?branch=travis)](https://travis-ci.org/kpratama24/earlyStagesInformatics-ionic) #### This is a Github Repository for collaborating with 2017's Informatics Project Lecture. --- ## **Details** Development Framework : **Ionic v2.0.1 BUILD 2017-02-08** Framework Plugin : **Ionic Native** Mobile Environment Support : **Android**,**iOS**, ~~Windows Phone~~ Development Status : **Public Beta Release** --- ## **Project Groups** Leader -> **Kevin Pratama** Members 1. **Carissa Ulibasa** 2. **Devi Apriliani** 3. **Jovanka Helen** 4. **Reza Reynaldi**
81a379d4295da4cc1980a5187ba6c5634988305f
cmd/list_test.go
cmd/list_test.go
package cmd import ( "testing" "github.com/stretchr/testify/assert" ) func TestListCmdHasUse(t *testing.T) { assert.NotEmpty(t, ListCmd.Use) } func TestListCmdHasShort(t *testing.T) { assert.NotEmpty(t, ListCmd.Short) } func TestListCmdHasLong(t *testing.T) { assert.NotEmpty(t, ListCmd.Long) } func TestListCmdHasRun(t *testing.T) { assert.NotEmpty(t, ListCmd.Run) }
package cmd import ( "testing" "github.com/stretchr/testify/assert" ) func TestListCmdHasUse(t *testing.T) { assert.NotEmpty(t, ListCmd.Use) } func TestListCmdHasShort(t *testing.T) { assert.NotEmpty(t, ListCmd.Short) } func TestListCmdHasLong(t *testing.T) { assert.NotEmpty(t, ListCmd.Long) } func TestListCmdHasRun(t *testing.T) { assert.NotEmpty(t, ListCmd.Run) } func TestListCmdHasAliasLs(t *testing.T) { assert.Equal(t, "ls", ListCmd.Aliases[0]) }
Add test for ls alias
Add test for ls alias
Go
mit
hoop33/limo
go
## Code Before: package cmd import ( "testing" "github.com/stretchr/testify/assert" ) func TestListCmdHasUse(t *testing.T) { assert.NotEmpty(t, ListCmd.Use) } func TestListCmdHasShort(t *testing.T) { assert.NotEmpty(t, ListCmd.Short) } func TestListCmdHasLong(t *testing.T) { assert.NotEmpty(t, ListCmd.Long) } func TestListCmdHasRun(t *testing.T) { assert.NotEmpty(t, ListCmd.Run) } ## Instruction: Add test for ls alias ## Code After: package cmd import ( "testing" "github.com/stretchr/testify/assert" ) func TestListCmdHasUse(t *testing.T) { assert.NotEmpty(t, ListCmd.Use) } func TestListCmdHasShort(t *testing.T) { assert.NotEmpty(t, ListCmd.Short) } func TestListCmdHasLong(t *testing.T) { assert.NotEmpty(t, ListCmd.Long) } func TestListCmdHasRun(t *testing.T) { assert.NotEmpty(t, ListCmd.Run) } func TestListCmdHasAliasLs(t *testing.T) { assert.Equal(t, "ls", ListCmd.Aliases[0]) }
c8fd9cc1b0fd1c8dd283f3a89918c134b05c5c21
src/bda/plone/shop/browser/shop.js
src/bda/plone/shop/browser/shop.js
/* jslint browser: true */ /* global jQuery */ (function($) { "use strict"; $(document).ready(function() { var binder = function(context) { $('div.availability', context).unbind('mouseover') .bind('mouseover', function() { var details = $('div.availability_details', $(this)); if (!details.is(":visible")) { details.show(); } }); $('div.availability', context).unbind('mouseout') .bind('mouseout', function() { var details = $('div.availability_details', $(this)); if (details.is(":visible")) { details.hide(); } }); }; if (typeof(window.bdajax) !== "undefined") { $.extend(window.bdajax.binders, { buyable_controls_binder: binder }); } binder(document); }); })(jQuery);
/* jslint browser: true */ /* global jQuery, bdajax */ (function($, bdajax) { "use strict"; $(document).ready(function() { var binder = function(context) { $('div.availability', context).unbind('mouseover') .bind('mouseover', function() { var details = $('div.availability_details', $(this)); if (!details.is(":visible")) { details.show(); } }); $('div.availability', context).unbind('mouseout') .bind('mouseout', function() { var details = $('div.availability_details', $(this)); if (details.is(":visible")) { details.hide(); } }); }; if (typeof(window.bdajax) !== "undefined") { $.extend(bdajax.binders, { buyable_controls_binder: binder }); } binder(document); }); })(jQuery, bdajax);
Revert "dont pass bdajax. get it from window"
Revert "dont pass bdajax. get it from window" This reverts commit 05393ce7c10b99eca03f1c8fb5c8f1a3abcc32b1.
JavaScript
bsd-3-clause
TheVirtualLtd/bda.plone.shop,andreesg/bda.plone.shop,andreesg/bda.plone.shop,TheVirtualLtd/bda.plone.shop,TheVirtualLtd/bda.plone.shop,andreesg/bda.plone.shop
javascript
## Code Before: /* jslint browser: true */ /* global jQuery */ (function($) { "use strict"; $(document).ready(function() { var binder = function(context) { $('div.availability', context).unbind('mouseover') .bind('mouseover', function() { var details = $('div.availability_details', $(this)); if (!details.is(":visible")) { details.show(); } }); $('div.availability', context).unbind('mouseout') .bind('mouseout', function() { var details = $('div.availability_details', $(this)); if (details.is(":visible")) { details.hide(); } }); }; if (typeof(window.bdajax) !== "undefined") { $.extend(window.bdajax.binders, { buyable_controls_binder: binder }); } binder(document); }); })(jQuery); ## Instruction: Revert "dont pass bdajax. get it from window" This reverts commit 05393ce7c10b99eca03f1c8fb5c8f1a3abcc32b1. ## Code After: /* jslint browser: true */ /* global jQuery, bdajax */ (function($, bdajax) { "use strict"; $(document).ready(function() { var binder = function(context) { $('div.availability', context).unbind('mouseover') .bind('mouseover', function() { var details = $('div.availability_details', $(this)); if (!details.is(":visible")) { details.show(); } }); $('div.availability', context).unbind('mouseout') .bind('mouseout', function() { var details = $('div.availability_details', $(this)); if (details.is(":visible")) { details.hide(); } }); }; if (typeof(window.bdajax) !== "undefined") { $.extend(bdajax.binders, { buyable_controls_binder: binder }); } binder(document); }); })(jQuery, bdajax);
aded5c6d0c859d34cd5af3cf4d15f28a924b6072
resources/frontend/app/pods/tournament/team/route.js
resources/frontend/app/pods/tournament/team/route.js
import Ember from 'ember'; const { Route, RSVP } = Ember; export default Route.extend({ deactivate() { this.store.peekAll('team-member').forEach((team) => { if (team.get('isNew')) { this.store.deleteRecord(team); } }); }, actions: { assignMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.save().then(() => { this.currentModel.get('teamMembers').addObject(member); flashMessages.success(member.get('name')+' has been assigned to the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to assign member to the team'); }); }, removeMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.destroyRecord().then(() => { flashMessages.success(member.get('name')+' has been removed from the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to remove member from the team'); }); } }, model: function (params) { const store = this.store; const teamId = params.id; const tournament = this.modelFor('tournament'); return RSVP.hash({ team: store.find('team', teamId), matches: store.query('match', {tournamentId: tournament.get('id'), teamId}), teamMembers: store.query('team-member', {teamId}) }).then((hash) => { hash.team.set('teamMembers', hash.teamMembers); return hash; }); } });
import Ember from 'ember'; const { Route, RSVP } = Ember; export default Route.extend({ deactivate() { this.store.peekAll('team-member').forEach((team) => { if (team.get('isNew')) { this.store.deleteRecord(team); } }); }, actions: { assignMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.save().then(() => { flashMessages.success(member.get('name')+' has been assigned to the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to assign member to the team'); }); }, removeMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.destroyRecord().then(() => { flashMessages.success(member.get('name')+' has been removed from the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to remove member from the team'); }); } }, model: function (params) { const store = this.store; const teamId = params.id; const tournament = this.modelFor('tournament'); return RSVP.hash({ team: store.find('team', teamId), matches: store.query('match', {tournamentId: tournament.get('id'), teamId}), teamMembers: store.query('team-member', {teamId}) }).then((hash) => { hash.team.set('teamMembers', hash.teamMembers); return hash; }); } });
Fix assign member to the team
Fix assign member to the team
JavaScript
mit
nixsolutions/ggf,nixsolutions/ggf,nixsolutions/ggf,nixsolutions/ggf
javascript
## Code Before: import Ember from 'ember'; const { Route, RSVP } = Ember; export default Route.extend({ deactivate() { this.store.peekAll('team-member').forEach((team) => { if (team.get('isNew')) { this.store.deleteRecord(team); } }); }, actions: { assignMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.save().then(() => { this.currentModel.get('teamMembers').addObject(member); flashMessages.success(member.get('name')+' has been assigned to the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to assign member to the team'); }); }, removeMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.destroyRecord().then(() => { flashMessages.success(member.get('name')+' has been removed from the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to remove member from the team'); }); } }, model: function (params) { const store = this.store; const teamId = params.id; const tournament = this.modelFor('tournament'); return RSVP.hash({ team: store.find('team', teamId), matches: store.query('match', {tournamentId: tournament.get('id'), teamId}), teamMembers: store.query('team-member', {teamId}) }).then((hash) => { hash.team.set('teamMembers', hash.teamMembers); return hash; }); } }); ## Instruction: Fix assign member to the team ## Code After: import Ember from 'ember'; const { Route, RSVP } = Ember; export default Route.extend({ deactivate() { this.store.peekAll('team-member').forEach((team) => { if (team.get('isNew')) { this.store.deleteRecord(team); } }); }, actions: { assignMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.save().then(() => { flashMessages.success(member.get('name')+' has been assigned to the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to assign member to the team'); }); }, removeMember(member) { const flashMessages = Ember.get(this, 'flashMessages'); return member.destroyRecord().then(() => { flashMessages.success(member.get('name')+' has been removed from the team'); }).catch(() => { member.rollback(); flashMessages.danger('Unable to remove member from the team'); }); } }, model: function (params) { const store = this.store; const teamId = params.id; const tournament = this.modelFor('tournament'); return RSVP.hash({ team: store.find('team', teamId), matches: store.query('match', {tournamentId: tournament.get('id'), teamId}), teamMembers: store.query('team-member', {teamId}) }).then((hash) => { hash.team.set('teamMembers', hash.teamMembers); return hash; }); } });
0b48df9444934c0e25564e990545410d4d64dc29
source/addons/responsive_controls/ResponsiveSizing.gd
source/addons/responsive_controls/ResponsiveSizing.gd
tool extends Control # Minimum size the parent Control must have in order to trigger this Responsive Sizing export(Vector2) var minimumParentSize # Whether or not this Responsive Sizing is visible in the set size export(bool) var isVisible # Checks if this Responsive Sizing is eligible under the specified size func isEligible(size): return size.width >= minimumParentSize.width && size.height >= minimumParentSize.height # Applies this Responsive Sizing to the specified Control func applyTo(control): if isVisible != control.is_visible(): if isVisible: control.show() else: control.hide() control.set_h_size_flags(get_h_size_flags()) control.set_v_size_flags(get_v_size_flags()) control.set_scale(get_scale()) for margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]: control.set_anchor(margin, get_anchor(margin)) control.set_margin(margin, get_marginr(margin))
tool extends Control # Minimum size the parent Control must have in order to trigger this Responsive Sizing export(Vector2) var minimumParentSize = Vector2() # Whether or not this Responsive Sizing is visible in the set size export(bool) var isVisible = true # Checks if this Responsive Sizing is eligible under the specified size func isEligible(size): return size.width >= minimumParentSize.width && size.height >= minimumParentSize.height # Applies this Responsive Sizing to the specified Control func applyTo(control): if isVisible != control.is_visible(): if isVisible: control.show() else: control.hide() control.set_h_size_flags(get_h_size_flags()) control.set_v_size_flags(get_v_size_flags()) control.set_scale(get_scale()) for margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]: control.set_anchor(margin, get_anchor(margin)) control.set_margin(margin, get_marginr(margin))
Add defaults to responsive sizing
Add defaults to responsive sizing
GDScript
mit
ruipsrosario/godot-responsive-control
gdscript
## Code Before: tool extends Control # Minimum size the parent Control must have in order to trigger this Responsive Sizing export(Vector2) var minimumParentSize # Whether or not this Responsive Sizing is visible in the set size export(bool) var isVisible # Checks if this Responsive Sizing is eligible under the specified size func isEligible(size): return size.width >= minimumParentSize.width && size.height >= minimumParentSize.height # Applies this Responsive Sizing to the specified Control func applyTo(control): if isVisible != control.is_visible(): if isVisible: control.show() else: control.hide() control.set_h_size_flags(get_h_size_flags()) control.set_v_size_flags(get_v_size_flags()) control.set_scale(get_scale()) for margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]: control.set_anchor(margin, get_anchor(margin)) control.set_margin(margin, get_marginr(margin)) ## Instruction: Add defaults to responsive sizing ## Code After: tool extends Control # Minimum size the parent Control must have in order to trigger this Responsive Sizing export(Vector2) var minimumParentSize = Vector2() # Whether or not this Responsive Sizing is visible in the set size export(bool) var isVisible = true # Checks if this Responsive Sizing is eligible under the specified size func isEligible(size): return size.width >= minimumParentSize.width && size.height >= minimumParentSize.height # Applies this Responsive Sizing to the specified Control func applyTo(control): if isVisible != control.is_visible(): if isVisible: control.show() else: control.hide() control.set_h_size_flags(get_h_size_flags()) control.set_v_size_flags(get_v_size_flags()) control.set_scale(get_scale()) for margin in [ MARGIN_BOTTOM, MARGIN_TOP, MARGIN_RIGHT, MARGIN_LEFT ]: control.set_anchor(margin, get_anchor(margin)) control.set_margin(margin, get_marginr(margin))
02141d8df02091e89cb02144417753032337525b
src/org/nwapw/abacus/lexing/pattern/PatternNode.java
src/org/nwapw/abacus/lexing/pattern/PatternNode.java
package org.nwapw.abacus.lexing.pattern; import java.util.ArrayList; public class PatternNode<T> { protected ArrayList<PatternNode<T>> outputStates; public PatternNode(){ outputStates = new ArrayList<>(); } public boolean matches(char other){ return false; } public char range(){ return '\0'; } public void addInto(ArrayList<PatternNode<T>> into){ into.add(this); } }
package org.nwapw.abacus.lexing.pattern; import java.util.ArrayList; import java.util.HashSet; public class PatternNode<T> { protected HashSet<PatternNode<T>> outputStates; public PatternNode(){ outputStates = new HashSet<>(); } public boolean matches(char other){ return false; } public char range(){ return '\0'; } public void addInto(ArrayList<PatternNode<T>> into){ into.add(this); } }
Switch underlying implementation to Set from List.
Switch underlying implementation to Set from List.
Java
mit
DanilaFe/abacus,DanilaFe/abacus
java
## Code Before: package org.nwapw.abacus.lexing.pattern; import java.util.ArrayList; public class PatternNode<T> { protected ArrayList<PatternNode<T>> outputStates; public PatternNode(){ outputStates = new ArrayList<>(); } public boolean matches(char other){ return false; } public char range(){ return '\0'; } public void addInto(ArrayList<PatternNode<T>> into){ into.add(this); } } ## Instruction: Switch underlying implementation to Set from List. ## Code After: package org.nwapw.abacus.lexing.pattern; import java.util.ArrayList; import java.util.HashSet; public class PatternNode<T> { protected HashSet<PatternNode<T>> outputStates; public PatternNode(){ outputStates = new HashSet<>(); } public boolean matches(char other){ return false; } public char range(){ return '\0'; } public void addInto(ArrayList<PatternNode<T>> into){ into.add(this); } }
84b48b9be466ac72bddf5ee6288ff48be26eed62
tests/classifier/RandomForestClassifier/RandomForestClassifierPHPTest.py
tests/classifier/RandomForestClassifier/RandomForestClassifierPHPTest.py
import unittest from unittest import TestCase from sklearn.ensemble import RandomForestClassifier from ..Classifier import Classifier from ...language.PHP import PHP class RandomForestClassifierPHPTest(PHP, Classifier, TestCase): def setUp(self): super(RandomForestClassifierPHPTest, self).setUp() self.mdl = RandomForestClassifier(n_estimators=100, random_state=0) def tearDown(self): super(RandomForestClassifierPHPTest, self).tearDown() @unittest.skip('The generated code would be too large.') def test_existing_features_w_digits_data(self): pass @unittest.skip('The generated code would be too large.') def test_random_features_w_digits_data(self): pass
import unittest from unittest import TestCase from sklearn.ensemble import RandomForestClassifier from ..Classifier import Classifier from ...language.PHP import PHP class RandomForestClassifierPHPTest(PHP, Classifier, TestCase): def setUp(self): super(RandomForestClassifierPHPTest, self).setUp() self.mdl = RandomForestClassifier(n_estimators=20, random_state=0) def tearDown(self): super(RandomForestClassifierPHPTest, self).tearDown()
Reduce the number of trees
Reduce the number of trees
Python
bsd-3-clause
nok/sklearn-porter
python
## Code Before: import unittest from unittest import TestCase from sklearn.ensemble import RandomForestClassifier from ..Classifier import Classifier from ...language.PHP import PHP class RandomForestClassifierPHPTest(PHP, Classifier, TestCase): def setUp(self): super(RandomForestClassifierPHPTest, self).setUp() self.mdl = RandomForestClassifier(n_estimators=100, random_state=0) def tearDown(self): super(RandomForestClassifierPHPTest, self).tearDown() @unittest.skip('The generated code would be too large.') def test_existing_features_w_digits_data(self): pass @unittest.skip('The generated code would be too large.') def test_random_features_w_digits_data(self): pass ## Instruction: Reduce the number of trees ## Code After: import unittest from unittest import TestCase from sklearn.ensemble import RandomForestClassifier from ..Classifier import Classifier from ...language.PHP import PHP class RandomForestClassifierPHPTest(PHP, Classifier, TestCase): def setUp(self): super(RandomForestClassifierPHPTest, self).setUp() self.mdl = RandomForestClassifier(n_estimators=20, random_state=0) def tearDown(self): super(RandomForestClassifierPHPTest, self).tearDown()
d0b25766a6e36294ae2c8083664fa36be6be292f
signage/urls.py
signage/urls.py
from django.conf.urls import url from .views import DisplayCreate from .views import DisplayDelete from .views import DisplayDetail from .views import DisplayList from .views import DisplayUpdate from .views import SlideCreate from .views import SlideDelete from .views import SlideList from .views import SlideUpdate app_name = 'signage' urlpatterns = [ url(r'^(?P<pk>\d+)/$', DisplayDetail.as_view(), name='display'), url(r'^displays/$', DisplayList.as_view(), name='display_list'), url(r'^displays/create/$', DisplayCreate.as_view(), name='display_create'), url(r'^displays/delete/(?P<pk>\d+)/$', DisplayDelete.as_view(), name='display_delete'), url(r'^displays/update/(?P<pk>\d+)/$', DisplayUpdate.as_view(), name='display_update'), url(r'^slides/$', SlideList.as_view(), name='slide_list'), url(r'^slides/create/$', SlideCreate.as_view(), name='slide_create'), url(r'^slides/delete/(?P<pk>\d+)/$', SlideDelete.as_view(), name='slide_delete'), url(r'^slides/update/(?P<pk>\d+)/$', SlideUpdate.as_view(), name='slide_update'), ]
from django.conf.urls import url from . import views app_name = 'signage' urlpatterns = [ url(r'^display/(?P<pk>\d+)/$', views.DisplayDetail.as_view(), name='display'), url(r'^display/create/$', views.DisplayCreate.as_view(), name='display_create'), url(r'^display/(?P<pk>\d+)/delete/$', views.DisplayDelete.as_view(), name='display_delete'), url(r'^display/(?P<pk>\d+)/update/$', views.DisplayUpdate.as_view(), name='display_update'), url(r'^displays/$', views.DisplayList.as_view(), name='display_list'), url(r'^slide/create/$', views.SlideCreate.as_view(), name='slide_create'), url(r'^slide/(?P<pk>\d+)/delete/$', views.SlideDelete.as_view(), name='slide_delete'), url(r'^slide/(?P<pk>\d+)/update/$', views.SlideUpdate.as_view(), name='slide_update'), url(r'^slides/$', views.SlideList.as_view(), name='slide_list'), ]
Refactor URL imports and paths
Refactor URL imports and paths
Python
bsd-3-clause
jbittel/django-signage,jbittel/django-signage,jbittel/django-signage
python
## Code Before: from django.conf.urls import url from .views import DisplayCreate from .views import DisplayDelete from .views import DisplayDetail from .views import DisplayList from .views import DisplayUpdate from .views import SlideCreate from .views import SlideDelete from .views import SlideList from .views import SlideUpdate app_name = 'signage' urlpatterns = [ url(r'^(?P<pk>\d+)/$', DisplayDetail.as_view(), name='display'), url(r'^displays/$', DisplayList.as_view(), name='display_list'), url(r'^displays/create/$', DisplayCreate.as_view(), name='display_create'), url(r'^displays/delete/(?P<pk>\d+)/$', DisplayDelete.as_view(), name='display_delete'), url(r'^displays/update/(?P<pk>\d+)/$', DisplayUpdate.as_view(), name='display_update'), url(r'^slides/$', SlideList.as_view(), name='slide_list'), url(r'^slides/create/$', SlideCreate.as_view(), name='slide_create'), url(r'^slides/delete/(?P<pk>\d+)/$', SlideDelete.as_view(), name='slide_delete'), url(r'^slides/update/(?P<pk>\d+)/$', SlideUpdate.as_view(), name='slide_update'), ] ## Instruction: Refactor URL imports and paths ## Code After: from django.conf.urls import url from . import views app_name = 'signage' urlpatterns = [ url(r'^display/(?P<pk>\d+)/$', views.DisplayDetail.as_view(), name='display'), url(r'^display/create/$', views.DisplayCreate.as_view(), name='display_create'), url(r'^display/(?P<pk>\d+)/delete/$', views.DisplayDelete.as_view(), name='display_delete'), url(r'^display/(?P<pk>\d+)/update/$', views.DisplayUpdate.as_view(), name='display_update'), url(r'^displays/$', views.DisplayList.as_view(), name='display_list'), url(r'^slide/create/$', views.SlideCreate.as_view(), name='slide_create'), url(r'^slide/(?P<pk>\d+)/delete/$', views.SlideDelete.as_view(), name='slide_delete'), url(r'^slide/(?P<pk>\d+)/update/$', views.SlideUpdate.as_view(), name='slide_update'), url(r'^slides/$', views.SlideList.as_view(), name='slide_list'), ]
84a5b48d4e4047551a0d52c78bfcadd97efe3194
lib/citrus.rb
lib/citrus.rb
require 'securerandom' require 'json' require 'webmachine' require 'celluloid/zmq' require 'celluloid_zmq_extensions' require 'thor' require 'httpclient' Celluloid.logger = nil module Citrus class << self attr_writer :build_root def build_root @build_root || root.join('builds') end def cache_root @cache_root || root.join('cache') end def root Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..'))) end def notification_address 'tcp://127.0.0.1:1234' end def notification_channel 'citrus' end def environment ENV['CITRUS_ENV'] ||= 'development' end def test? environment == 'test' end end end
require 'bundler' Bundler.require(:default) require 'securerandom' require 'json' Celluloid.logger = nil module Citrus class << self attr_writer :build_root def build_root @build_root || root.join('builds') end def cache_root @cache_root || root.join('cache') end def root Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..'))) end def notification_address 'tcp://127.0.0.1:1234' end def notification_channel 'citrus' end def environment ENV['CITRUS_ENV'] ||= 'development' end def test? environment == 'test' end end end
Make use of bundler require feature.
Make use of bundler require feature.
Ruby
mit
pawelpacana/citrus-legacy
ruby
## Code Before: require 'securerandom' require 'json' require 'webmachine' require 'celluloid/zmq' require 'celluloid_zmq_extensions' require 'thor' require 'httpclient' Celluloid.logger = nil module Citrus class << self attr_writer :build_root def build_root @build_root || root.join('builds') end def cache_root @cache_root || root.join('cache') end def root Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..'))) end def notification_address 'tcp://127.0.0.1:1234' end def notification_channel 'citrus' end def environment ENV['CITRUS_ENV'] ||= 'development' end def test? environment == 'test' end end end ## Instruction: Make use of bundler require feature. ## Code After: require 'bundler' Bundler.require(:default) require 'securerandom' require 'json' Celluloid.logger = nil module Citrus class << self attr_writer :build_root def build_root @build_root || root.join('builds') end def cache_root @cache_root || root.join('cache') end def root Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..'))) end def notification_address 'tcp://127.0.0.1:1234' end def notification_channel 'citrus' end def environment ENV['CITRUS_ENV'] ||= 'development' end def test? environment == 'test' end end end
d2f75744f3f42a4c37c55b51d9ba2e24c430c6cf
drupal.make.yml
drupal.make.yml
api: '2' core: 7.x projects: drupal: type: 'core' version: '7.41' redhen_training: type: 'profile' download: type: 'git' branch: 'master' url: https://github.com/thinkshout/redhen_training.git working-copy: true
api: '2' core: 7.x projects: drupal: type: 'core' version: '7.41' redhen_training: type: 'profile' download: type: 'git' branch: 'native-redhen' url: https://github.com/thinkshout/redhen_training.git working-copy: true
Use native-redhen branch by default
Use native-redhen branch by default
YAML
mit
thinkshout/crm-training
yaml
## Code Before: api: '2' core: 7.x projects: drupal: type: 'core' version: '7.41' redhen_training: type: 'profile' download: type: 'git' branch: 'master' url: https://github.com/thinkshout/redhen_training.git working-copy: true ## Instruction: Use native-redhen branch by default ## Code After: api: '2' core: 7.x projects: drupal: type: 'core' version: '7.41' redhen_training: type: 'profile' download: type: 'git' branch: 'native-redhen' url: https://github.com/thinkshout/redhen_training.git working-copy: true
01cd8092c3a6e5d0bf3448640361603aace1de06
thingmenn-data/utility/xml.js
thingmenn-data/utility/xml.js
import axios from 'axios' import { parseString } from 'xml2js' const cache = {} function parseXmlPromiseWrapper(xml) { return new Promise((resolve, reject) => { parseString(xml, (err, result) => { if (err) { reject(err) } else { resolve(result) } }) }) } export async function fetchXml(url) { if (cache[url]) { console.log(`fetchXml (cached):\t${url}`) return cache[url] } const xml = await axios.get(url) const result = await parseXmlPromiseWrapper(xml.data) cache[url] = result console.log(`fetchXml (request)\t${url}`) return result }
import axios from 'axios' import { parseString } from 'xml2js' const cache = {} function parseXmlPromiseWrapper(xml) { return new Promise((resolve, reject) => { parseString(xml, (err, result) => { if (err) { reject(err) } else { resolve(result) } }) }) } export async function fetchXml(url) { if (cache[url]) { console.log(`fetchXml (cached):\t${url}`) return cache[url] } let tries = 0 let xml = undefined while (xml === undefined) { try { console.log(`fetchXml (request)\t${url}`) tries += 0 if (tries >= 4) { break } xml = await axios.get(url) } catch (e) { console.log('Failed. Retrying (', tries, ')') } } const result = await parseXmlPromiseWrapper(xml.data) cache[url] = result return result }
Allow fetchXml a few tries if it fails
Data: Allow fetchXml a few tries if it fails
JavaScript
mit
baering/thingmenn,baering/thingmenn,baering/thingmenn,baering/thingmenn
javascript
## Code Before: import axios from 'axios' import { parseString } from 'xml2js' const cache = {} function parseXmlPromiseWrapper(xml) { return new Promise((resolve, reject) => { parseString(xml, (err, result) => { if (err) { reject(err) } else { resolve(result) } }) }) } export async function fetchXml(url) { if (cache[url]) { console.log(`fetchXml (cached):\t${url}`) return cache[url] } const xml = await axios.get(url) const result = await parseXmlPromiseWrapper(xml.data) cache[url] = result console.log(`fetchXml (request)\t${url}`) return result } ## Instruction: Data: Allow fetchXml a few tries if it fails ## Code After: import axios from 'axios' import { parseString } from 'xml2js' const cache = {} function parseXmlPromiseWrapper(xml) { return new Promise((resolve, reject) => { parseString(xml, (err, result) => { if (err) { reject(err) } else { resolve(result) } }) }) } export async function fetchXml(url) { if (cache[url]) { console.log(`fetchXml (cached):\t${url}`) return cache[url] } let tries = 0 let xml = undefined while (xml === undefined) { try { console.log(`fetchXml (request)\t${url}`) tries += 0 if (tries >= 4) { break } xml = await axios.get(url) } catch (e) { console.log('Failed. Retrying (', tries, ')') } } const result = await parseXmlPromiseWrapper(xml.data) cache[url] = result return result }
70992e8a55e466186417174a5cea4a88d35693df
.github/pull_request_template.md
.github/pull_request_template.md
--- name: Pull Request about: Create a pull request to make changes to Spark. --- ## What does this PR do? A clear and concise description of what this PR does. ## Please check off completed items as you work. If a checklist item or section does not apply to your PR then please remove it. ### Documentation - [ ] Update Spark Docs Angular - [ ] Update Spark Docs Vanilla - [ ] Update Component Sass Var/Class Modifier table ### Code - [ ] Build Component in Spark Vanilla (Sass, HTML, JS) - [ ] Build Component in Spark Angular - [ ] Unit Testing in Spark Vanilla (100% coverage, 100% passing) - [ ] Unit Testing in Spark Angular (100% coverage, 100% passing) ### Accessibility - [ ] New changes abide by [accessibility requirements](https://sparkdesignsystem.com/docs/accessibility) ### Browser Testing (current version and 1 prior) - [ ] Google Chrome - [ ] Google Chrome (Mobile) - [ ] Mozilla Firefox (Mobile) - [ ] Microsoft Internet Explorer 11 (only this specific version of IE) - [ ] Microsoft Edge - [ ] Apple Safari - [ ] Apple Safari (Mobile) ### Design Review - [ ] Design reviewed and approved ### Screenshots Add screenshots to help explain your PR if you'd like. However, this is not expected.
A clear and concise description of what this PR does. ## Please check off completed items as you work. If a checklist item or section does not apply to your PR then please remove it. ### Documentation - [ ] Update Spark Docs Angular - [ ] Update Spark Docs Vanilla - [ ] Update Component Sass Var/Class Modifier table ### Code - [ ] Build Component in Spark Vanilla (Sass, HTML, JS) - [ ] Build Component in Spark Angular - [ ] Unit Testing in Spark Vanilla with `npm run test --prefix ./packages/spark-core` (100% coverage, 100% passing) - [ ] Unit Testing in Spark Angular with `gulp test-angular` (100% coverage, 100% passing) ### Accessibility - [ ] New changes abide by [accessibility requirements](https://sparkdesignsystem.com/docs/accessibility) ### Browser Testing (current version and 1 prior) - [ ] Google Chrome - [ ] Google Chrome (Mobile) - [ ] Mozilla Firefox (Mobile) - [ ] Microsoft Internet Explorer 11 (only this specific version of IE) - [ ] Microsoft Edge - [ ] Apple Safari - [ ] Apple Safari (Mobile) ### Design Review - [ ] Design reviewed and approved ### Screenshots Add screenshots to help explain your PR if you'd like. However, this is not expected.
Remove top header, add test commands
Remove top header, add test commands
Markdown
mit
sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system
markdown
## Code Before: --- name: Pull Request about: Create a pull request to make changes to Spark. --- ## What does this PR do? A clear and concise description of what this PR does. ## Please check off completed items as you work. If a checklist item or section does not apply to your PR then please remove it. ### Documentation - [ ] Update Spark Docs Angular - [ ] Update Spark Docs Vanilla - [ ] Update Component Sass Var/Class Modifier table ### Code - [ ] Build Component in Spark Vanilla (Sass, HTML, JS) - [ ] Build Component in Spark Angular - [ ] Unit Testing in Spark Vanilla (100% coverage, 100% passing) - [ ] Unit Testing in Spark Angular (100% coverage, 100% passing) ### Accessibility - [ ] New changes abide by [accessibility requirements](https://sparkdesignsystem.com/docs/accessibility) ### Browser Testing (current version and 1 prior) - [ ] Google Chrome - [ ] Google Chrome (Mobile) - [ ] Mozilla Firefox (Mobile) - [ ] Microsoft Internet Explorer 11 (only this specific version of IE) - [ ] Microsoft Edge - [ ] Apple Safari - [ ] Apple Safari (Mobile) ### Design Review - [ ] Design reviewed and approved ### Screenshots Add screenshots to help explain your PR if you'd like. However, this is not expected. ## Instruction: Remove top header, add test commands ## Code After: A clear and concise description of what this PR does. ## Please check off completed items as you work. If a checklist item or section does not apply to your PR then please remove it. ### Documentation - [ ] Update Spark Docs Angular - [ ] Update Spark Docs Vanilla - [ ] Update Component Sass Var/Class Modifier table ### Code - [ ] Build Component in Spark Vanilla (Sass, HTML, JS) - [ ] Build Component in Spark Angular - [ ] Unit Testing in Spark Vanilla with `npm run test --prefix ./packages/spark-core` (100% coverage, 100% passing) - [ ] Unit Testing in Spark Angular with `gulp test-angular` (100% coverage, 100% passing) ### Accessibility - [ ] New changes abide by [accessibility requirements](https://sparkdesignsystem.com/docs/accessibility) ### Browser Testing (current version and 1 prior) - [ ] Google Chrome - [ ] Google Chrome (Mobile) - [ ] Mozilla Firefox (Mobile) - [ ] Microsoft Internet Explorer 11 (only this specific version of IE) - [ ] Microsoft Edge - [ ] Apple Safari - [ ] Apple Safari (Mobile) ### Design Review - [ ] Design reviewed and approved ### Screenshots Add screenshots to help explain your PR if you'd like. However, this is not expected.
cc330fda86522ea7b602dffbed4feb3da7db4e78
test/controllers/api/networks_controller_test.rb
test/controllers/api/networks_controller_test.rb
require 'test_helper' describe Api::NetworksController do let(:user) { create(:user) } let(:network) { create(:network, account: user.individual_account) } it 'should show' do get(:show, { api_version: 'v1', format: 'json', id: network.id } ) assert_response :success end it 'should list' do network.id.wont_be_nil get(:index, { api_version: 'v1', format: 'json' } ) assert_response :success end end
require 'test_helper' require 'json' describe Api::NetworksController do let(:user) { create(:user) } let(:network) { create(:network, account: user.individual_account) } it 'should show' do get(:show, api_version: 'v1', format: 'json', id: network.id) resource = JSON.parse(@response.body) resource["id"].must_equal network.id assert_response :success end it 'should list' do network.id.wont_be_nil get(:index, api_version: 'v1', format: 'json') list = JSON.parse(@response.body) list["total"].must_equal 1 assert_response :success end end
Make tests better, actually check some values
Make tests better, actually check some values
Ruby
agpl-3.0
PRX/cms.prx.org,PRX/cms.prx.org,PRX/cms.prx.org,PRX/cms.prx.org
ruby
## Code Before: require 'test_helper' describe Api::NetworksController do let(:user) { create(:user) } let(:network) { create(:network, account: user.individual_account) } it 'should show' do get(:show, { api_version: 'v1', format: 'json', id: network.id } ) assert_response :success end it 'should list' do network.id.wont_be_nil get(:index, { api_version: 'v1', format: 'json' } ) assert_response :success end end ## Instruction: Make tests better, actually check some values ## Code After: require 'test_helper' require 'json' describe Api::NetworksController do let(:user) { create(:user) } let(:network) { create(:network, account: user.individual_account) } it 'should show' do get(:show, api_version: 'v1', format: 'json', id: network.id) resource = JSON.parse(@response.body) resource["id"].must_equal network.id assert_response :success end it 'should list' do network.id.wont_be_nil get(:index, api_version: 'v1', format: 'json') list = JSON.parse(@response.body) list["total"].must_equal 1 assert_response :success end end
e0b0804a6f194add34e17cfcedcb40c77b321827
ipa-fun-check-rpms.sh
ipa-fun-check-rpms.sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/config.sh # Set DIST_DIR if given via command line if [[ ! $1 == "" ]] then if [[ ! -d $WORKING_DIR/$1 ]] then echo "$WORKING_DIR/$1 does not exist" exit 1 fi DIST_DIR=$WORKING_DIR/$1/dist fi if [[ `ls $DIST_DIR | wc -l` -eq 0 ]] then echo "There are no rpms in $DIST_DIR" exit 1 fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/config.sh if [[ `ls $DIST_DIR | wc -l` -eq 0 ]] then echo "There are no rpms in $DIST_DIR" exit 1 fi
Remove custom directory support from check-rpms
Remove custom directory support from check-rpms
Shell
mit
pspacek/labtool,tomaskrizek/labtool,pvoborni/labtool,tomaskrizek/labtool,pspacek/labtool,pvoborni/labtool
shell
## Code Before: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/config.sh # Set DIST_DIR if given via command line if [[ ! $1 == "" ]] then if [[ ! -d $WORKING_DIR/$1 ]] then echo "$WORKING_DIR/$1 does not exist" exit 1 fi DIST_DIR=$WORKING_DIR/$1/dist fi if [[ `ls $DIST_DIR | wc -l` -eq 0 ]] then echo "There are no rpms in $DIST_DIR" exit 1 fi ## Instruction: Remove custom directory support from check-rpms ## Code After: DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/config.sh if [[ `ls $DIST_DIR | wc -l` -eq 0 ]] then echo "There are no rpms in $DIST_DIR" exit 1 fi
0bff34400d912806a9d831f5e0436082d359a531
tomviz/python/tomviz/state/_pipeline.py
tomviz/python/tomviz/state/_pipeline.py
from tomviz._wrapping import PipelineStateManagerBase class PipelineStateManager(PipelineStateManagerBase): _instance = None # Need to define a constructor as the implementation on the C++ side is # static. def __init__(self): pass def __call__(cls): if cls._instance is None: cls._instance = super(PipelineStateManager, cls).__call__() return cls._instances
from tomviz._wrapping import PipelineStateManagerBase class PipelineStateManager(PipelineStateManagerBase): _instance = None def __new__(cls, *args, **kwargs): if cls._instance is None: cls._instance = PipelineStateManagerBase.__new__(cls, *args, **kwargs) return cls._instance
Fix singleton to work with wrapped manager class
Fix singleton to work with wrapped manager class Signed-off-by: Chris Harris <[email protected]>
Python
bsd-3-clause
OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz
python
## Code Before: from tomviz._wrapping import PipelineStateManagerBase class PipelineStateManager(PipelineStateManagerBase): _instance = None # Need to define a constructor as the implementation on the C++ side is # static. def __init__(self): pass def __call__(cls): if cls._instance is None: cls._instance = super(PipelineStateManager, cls).__call__() return cls._instances ## Instruction: Fix singleton to work with wrapped manager class Signed-off-by: Chris Harris <[email protected]> ## Code After: from tomviz._wrapping import PipelineStateManagerBase class PipelineStateManager(PipelineStateManagerBase): _instance = None def __new__(cls, *args, **kwargs): if cls._instance is None: cls._instance = PipelineStateManagerBase.__new__(cls, *args, **kwargs) return cls._instance
148d4c44a9eb63016b469c6bf317a3dbe9ed7918
permuta/permutations.py
permuta/permutations.py
from .misc import DancingLinks from .permutation import Permutation import random class Permutations(object): def __init__(self, n): assert 0 <= n self.n = n def __iter__(self): left = DancingLinks(range(1, self.n+1)) res = [] def gen(): if len(left) == 0: yield Permutation(list(res)) else: cur = left.front while cur is not None: left.erase(cur) res.append(cur.value) for p in gen(): yield p res.pop() left.restore(cur) cur = cur.next return gen() def random_element(self): p = [ i+1 for i in range(self.n) ] for i in range(self.n-1, -1, -1): j = random.randint(0, i) p[i],p[j] = p[j],p[i] return Permutation(p) def __str__(self): return 'The set of Permutations of length %d' % self.n def __repr__(self): return 'Permutations(%d)' % self.n
from .misc import DancingLinks from .permutation import Permutation import random class Permutations(object): """Class for iterating through all Permutations of length n""" def __init__(self, n): """Returns an object giving all permutations of length n""" assert 0 <= n self.n = n def __iter__(self): """Iterates through permutations of length n in lexical order""" left = DancingLinks(range(1, self.n+1)) res = [] def gen(): if len(left) == 0: yield Permutation(list(res)) else: cur = left.front while cur is not None: left.erase(cur) res.append(cur.value) for p in gen(): yield p res.pop() left.restore(cur) cur = cur.next return gen() def random_element(self): """Returns a random permutation of length n""" p = [i+1 for i in range(self.n)] for i in range(self.n-1, -1, -1): j = random.randint(0, i) p[i], p[j] = p[j], p[i] return Permutation(p) def __str__(self): return 'The set of Permutations of length %d' % self.n def __repr__(self): return 'Permutations(%d)' % self.n
Add documentation for Permutations class
Add documentation for Permutations class
Python
bsd-3-clause
PermutaTriangle/Permuta
python
## Code Before: from .misc import DancingLinks from .permutation import Permutation import random class Permutations(object): def __init__(self, n): assert 0 <= n self.n = n def __iter__(self): left = DancingLinks(range(1, self.n+1)) res = [] def gen(): if len(left) == 0: yield Permutation(list(res)) else: cur = left.front while cur is not None: left.erase(cur) res.append(cur.value) for p in gen(): yield p res.pop() left.restore(cur) cur = cur.next return gen() def random_element(self): p = [ i+1 for i in range(self.n) ] for i in range(self.n-1, -1, -1): j = random.randint(0, i) p[i],p[j] = p[j],p[i] return Permutation(p) def __str__(self): return 'The set of Permutations of length %d' % self.n def __repr__(self): return 'Permutations(%d)' % self.n ## Instruction: Add documentation for Permutations class ## Code After: from .misc import DancingLinks from .permutation import Permutation import random class Permutations(object): """Class for iterating through all Permutations of length n""" def __init__(self, n): """Returns an object giving all permutations of length n""" assert 0 <= n self.n = n def __iter__(self): """Iterates through permutations of length n in lexical order""" left = DancingLinks(range(1, self.n+1)) res = [] def gen(): if len(left) == 0: yield Permutation(list(res)) else: cur = left.front while cur is not None: left.erase(cur) res.append(cur.value) for p in gen(): yield p res.pop() left.restore(cur) cur = cur.next return gen() def random_element(self): """Returns a random permutation of length n""" p = [i+1 for i in range(self.n)] for i in range(self.n-1, -1, -1): j = random.randint(0, i) p[i], p[j] = p[j], p[i] return Permutation(p) def __str__(self): return 'The set of Permutations of length %d' % self.n def __repr__(self): return 'Permutations(%d)' % self.n
ab5fc4baf2dd856e7bea2b837d6a6eb794cf68e9
README.md
README.md
Put something like this in your $HOME/.bashrc or $HOME/.zshrc: ```shell . /path/to/skip.sh ``` ## Usage ```shell $ cat moby-dick.txt | skip 1 Some years ago — never mind how long precisely - having little or no money ... ``` Or: ```shell $ skip 1 moby-dick.txt Some years ago — never mind how long precisely - having little or no money ... ``` ## Requirements GNU tail
Put something like this in your $HOME/.bashrc or $HOME/.zshrc: ```shell . /path/to/skip.sh ``` ## Usage ```shell $ cat moby-dick.txt | skip 1 Some years ago — never mind how long precisely - having little or no money ... ``` Or: ```shell $ skip 1 moby-dick.txt Some years ago — never mind how long precisely - having little or no money ... ``` ## Requirements GNU tail (your system probably have it)
Add a note on presence of GNU tail
:memo: Add a note on presence of GNU tail Most systems have it.
Markdown
mit
alexandershov/skip
markdown
## Code Before: Put something like this in your $HOME/.bashrc or $HOME/.zshrc: ```shell . /path/to/skip.sh ``` ## Usage ```shell $ cat moby-dick.txt | skip 1 Some years ago — never mind how long precisely - having little or no money ... ``` Or: ```shell $ skip 1 moby-dick.txt Some years ago — never mind how long precisely - having little or no money ... ``` ## Requirements GNU tail ## Instruction: :memo: Add a note on presence of GNU tail Most systems have it. ## Code After: Put something like this in your $HOME/.bashrc or $HOME/.zshrc: ```shell . /path/to/skip.sh ``` ## Usage ```shell $ cat moby-dick.txt | skip 1 Some years ago — never mind how long precisely - having little or no money ... ``` Or: ```shell $ skip 1 moby-dick.txt Some years ago — never mind how long precisely - having little or no money ... ``` ## Requirements GNU tail (your system probably have it)
a8ec265ab894131ce5d4bed5c88631b2e85f1fc7
spec/unit/morpher/evaluator/transformer/hash_transform_spec.rb
spec/unit/morpher/evaluator/transformer/hash_transform_spec.rb
require 'spec_helper' describe Morpher::Evaluator::Transformer::HashTransform do let(:body_a) do s(:symbolize_key, 'foo', s(:guard, s(:primitive, String))) end let(:ast) do s(:hash_transform, body_a) end let(:object) do Morpher.evaluator(ast) end let(:evaluator_a) do Morpher.evaluator(body_a) end let(:input) { { 'foo' => 'bar' } } let(:output) { { foo: 'bar' } } describe '#call' do context 'with valid input' do subject { object.call(input) } it 'returns output' do should eql(output) end end end describe '#evaluation' do subject { object.evaluation(input) } let(:evaluations) { [evaluator_a.evaluation(input)] } context 'with valid input' do it 'returns evaluation' do should eql(Morpher::Evaluation::Nary.new( input: input, evaluator: object, evaluations: evaluations, output: output )) end end end end
require 'spec_helper' describe Morpher::Evaluator::Transformer::HashTransform do let(:body_a) do s(:symbolize_key, 'foo', s(:guard, s(:primitive, String))) end let(:ast) do s(:hash_transform, body_a) end let(:object) do Morpher.evaluator(ast) end let(:evaluator_a) do Morpher.evaluator(body_a) end let(:input) { { 'foo' => 'bar' } } let(:output) { { foo: 'bar' } } describe '#inverse' do subject { object.inverse } it { should eql(described_class.new([evaluator_a.inverse])) } end describe '#call' do context 'with valid input' do subject { object.call(input) } it 'returns output' do should eql(output) end end end describe '#evaluation' do subject { object.evaluation(input) } let(:evaluations) { [evaluator_a.evaluation(input)] } context 'with valid input' do it 'returns evaluation' do should eql(Morpher::Evaluation::Nary.new( input: input, evaluator: object, evaluations: evaluations, output: output )) end end end end
Add mutation covering unit spec for Morpher::Evaluator::Transformer::HashTransform
Add mutation covering unit spec for Morpher::Evaluator::Transformer::HashTransform
Ruby
mit
snusnu/morpher,mbj/morpher,nepalez/morpher
ruby
## Code Before: require 'spec_helper' describe Morpher::Evaluator::Transformer::HashTransform do let(:body_a) do s(:symbolize_key, 'foo', s(:guard, s(:primitive, String))) end let(:ast) do s(:hash_transform, body_a) end let(:object) do Morpher.evaluator(ast) end let(:evaluator_a) do Morpher.evaluator(body_a) end let(:input) { { 'foo' => 'bar' } } let(:output) { { foo: 'bar' } } describe '#call' do context 'with valid input' do subject { object.call(input) } it 'returns output' do should eql(output) end end end describe '#evaluation' do subject { object.evaluation(input) } let(:evaluations) { [evaluator_a.evaluation(input)] } context 'with valid input' do it 'returns evaluation' do should eql(Morpher::Evaluation::Nary.new( input: input, evaluator: object, evaluations: evaluations, output: output )) end end end end ## Instruction: Add mutation covering unit spec for Morpher::Evaluator::Transformer::HashTransform ## Code After: require 'spec_helper' describe Morpher::Evaluator::Transformer::HashTransform do let(:body_a) do s(:symbolize_key, 'foo', s(:guard, s(:primitive, String))) end let(:ast) do s(:hash_transform, body_a) end let(:object) do Morpher.evaluator(ast) end let(:evaluator_a) do Morpher.evaluator(body_a) end let(:input) { { 'foo' => 'bar' } } let(:output) { { foo: 'bar' } } describe '#inverse' do subject { object.inverse } it { should eql(described_class.new([evaluator_a.inverse])) } end describe '#call' do context 'with valid input' do subject { object.call(input) } it 'returns output' do should eql(output) end end end describe '#evaluation' do subject { object.evaluation(input) } let(:evaluations) { [evaluator_a.evaluation(input)] } context 'with valid input' do it 'returns evaluation' do should eql(Morpher::Evaluation::Nary.new( input: input, evaluator: object, evaluations: evaluations, output: output )) end end end end
16ddb8b0d20e343c87abf465d55611b798076fc5
README.md
README.md
[![Build Status](https://travis-ci.org/hajimehoshi/ebiten.svg?branch=master)](https://travis-ci.org/hajimehoshi/ebiten) [![GoDoc](https://godoc.org/github.com/hajimehoshi/ebiten?status.svg)](http://godoc.org/github.com/hajimehoshi/ebiten) * A simple SNES-like 2D game library in Go * Works on * Web browsers (powered by [GopherJS](http://gopherjs.org/)) * Supported browsers: Chrome and Firefox on desktops * Windows * Mac OS X * Linux ## Features * 2D Graphics * Input (Mouse, Keyboard, and Gamepad) * Audio (Ogg/Vorbis, WAV, and PCM) ## Documentation http://hajimehoshi.github.io/ebiten/ ## License Ebiten is licensed under Apache license version 2.0. See LICENSE file.
[![Build Status](https://travis-ci.org/hajimehoshi/ebiten.svg?branch=master)](https://travis-ci.org/hajimehoshi/ebiten) [![GoDoc](https://godoc.org/github.com/hajimehoshi/ebiten?status.svg)](http://godoc.org/github.com/hajimehoshi/ebiten) [![Go Report Card](https://goreportcard.com/badge/github.com/hajimehoshi/ebiten)](https://goreportcard.com/report/github.com/hajimehoshi/ebiten) * A simple SNES-like 2D game library in Go * Works on * Web browsers (powered by [GopherJS](http://gopherjs.org/)) * Supported browsers: Chrome and Firefox on desktops * Windows * Mac OS X * Linux ## Features * 2D Graphics * Input (Mouse, Keyboard, and Gamepad) * Audio (Ogg/Vorbis, WAV, and PCM) ## Documentation http://hajimehoshi.github.io/ebiten/ ## License Ebiten is licensed under Apache license version 2.0. See LICENSE file.
Add 'Go Report Card' Link
doc: Add 'Go Report Card' Link
Markdown
apache-2.0
hajimehoshi/ebiten,hajimehoshi/ebiten
markdown
## Code Before: [![Build Status](https://travis-ci.org/hajimehoshi/ebiten.svg?branch=master)](https://travis-ci.org/hajimehoshi/ebiten) [![GoDoc](https://godoc.org/github.com/hajimehoshi/ebiten?status.svg)](http://godoc.org/github.com/hajimehoshi/ebiten) * A simple SNES-like 2D game library in Go * Works on * Web browsers (powered by [GopherJS](http://gopherjs.org/)) * Supported browsers: Chrome and Firefox on desktops * Windows * Mac OS X * Linux ## Features * 2D Graphics * Input (Mouse, Keyboard, and Gamepad) * Audio (Ogg/Vorbis, WAV, and PCM) ## Documentation http://hajimehoshi.github.io/ebiten/ ## License Ebiten is licensed under Apache license version 2.0. See LICENSE file. ## Instruction: doc: Add 'Go Report Card' Link ## Code After: [![Build Status](https://travis-ci.org/hajimehoshi/ebiten.svg?branch=master)](https://travis-ci.org/hajimehoshi/ebiten) [![GoDoc](https://godoc.org/github.com/hajimehoshi/ebiten?status.svg)](http://godoc.org/github.com/hajimehoshi/ebiten) [![Go Report Card](https://goreportcard.com/badge/github.com/hajimehoshi/ebiten)](https://goreportcard.com/report/github.com/hajimehoshi/ebiten) * A simple SNES-like 2D game library in Go * Works on * Web browsers (powered by [GopherJS](http://gopherjs.org/)) * Supported browsers: Chrome and Firefox on desktops * Windows * Mac OS X * Linux ## Features * 2D Graphics * Input (Mouse, Keyboard, and Gamepad) * Audio (Ogg/Vorbis, WAV, and PCM) ## Documentation http://hajimehoshi.github.io/ebiten/ ## License Ebiten is licensed under Apache license version 2.0. See LICENSE file.
f53fe0e190b604fdde345aa36432b2a4f4bf1e1f
src/discordcr/mappings/gateway.cr
src/discordcr/mappings/gateway.cr
require "./converters" require "./user" require "./channel" require "./guild" module Discord module Gateway struct ReadyPayload JSON.mapping( v: UInt8, user: User, private_channels: Array(PrivateChannel), guilds: Array(UnavailableGuild), session_id: String ) end struct HelloPayload JSON.mapping( heartbeat_interval: UInt32, _trace: Array(String) ) end struct GuildDeletePayload JSON.mapping( id: {type: UInt64, converter: SnowflakeConverter}, unavailable: {type: Bool, nilable: true} ) end struct GuildBanPayload JSON.mapping( username: String, id: {type: UInt64, converter: SnowflakeConverter}, discriminator: String, avatar: String, bot: {type: Bool, nilable: true}, guild_id: {type: UInt64, converter: SnowflakeConverter} ) end struct GuildEmojiUpdatePayload JSON.mapping( guild_id: {type: UInt64, converter: SnowflakeConverter}, emoji: {type: Array(Emoji), key: "emojis"} ) end end end
require "./converters" require "./user" require "./channel" require "./guild" module Discord module Gateway struct ReadyPayload JSON.mapping( v: UInt8, user: User, private_channels: Array(PrivateChannel), guilds: Array(UnavailableGuild), session_id: String ) end struct HelloPayload JSON.mapping( heartbeat_interval: UInt32, _trace: Array(String) ) end struct GuildDeletePayload JSON.mapping( id: {type: UInt64, converter: SnowflakeConverter}, unavailable: {type: Bool, nilable: true} ) end struct GuildBanPayload JSON.mapping( username: String, id: {type: UInt64, converter: SnowflakeConverter}, discriminator: String, avatar: String, bot: {type: Bool, nilable: true}, guild_id: {type: UInt64, converter: SnowflakeConverter} ) end struct GuildEmojiUpdatePayload JSON.mapping( guild_id: {type: UInt64, converter: SnowflakeConverter}, emoji: {type: Array(Emoji), key: "emojis"} ) end struct GuildIntegrationsUpdatePayload JSON.mapping( guild_id: {type: UInt64, converter: SnowflakeConverter} ) end end end
Add a mapping for the GUILD_INTEGRATIONS_UPDATE dispatch payload
Add a mapping for the GUILD_INTEGRATIONS_UPDATE dispatch payload
Crystal
mit
meew0/discordcr
crystal
## Code Before: require "./converters" require "./user" require "./channel" require "./guild" module Discord module Gateway struct ReadyPayload JSON.mapping( v: UInt8, user: User, private_channels: Array(PrivateChannel), guilds: Array(UnavailableGuild), session_id: String ) end struct HelloPayload JSON.mapping( heartbeat_interval: UInt32, _trace: Array(String) ) end struct GuildDeletePayload JSON.mapping( id: {type: UInt64, converter: SnowflakeConverter}, unavailable: {type: Bool, nilable: true} ) end struct GuildBanPayload JSON.mapping( username: String, id: {type: UInt64, converter: SnowflakeConverter}, discriminator: String, avatar: String, bot: {type: Bool, nilable: true}, guild_id: {type: UInt64, converter: SnowflakeConverter} ) end struct GuildEmojiUpdatePayload JSON.mapping( guild_id: {type: UInt64, converter: SnowflakeConverter}, emoji: {type: Array(Emoji), key: "emojis"} ) end end end ## Instruction: Add a mapping for the GUILD_INTEGRATIONS_UPDATE dispatch payload ## Code After: require "./converters" require "./user" require "./channel" require "./guild" module Discord module Gateway struct ReadyPayload JSON.mapping( v: UInt8, user: User, private_channels: Array(PrivateChannel), guilds: Array(UnavailableGuild), session_id: String ) end struct HelloPayload JSON.mapping( heartbeat_interval: UInt32, _trace: Array(String) ) end struct GuildDeletePayload JSON.mapping( id: {type: UInt64, converter: SnowflakeConverter}, unavailable: {type: Bool, nilable: true} ) end struct GuildBanPayload JSON.mapping( username: String, id: {type: UInt64, converter: SnowflakeConverter}, discriminator: String, avatar: String, bot: {type: Bool, nilable: true}, guild_id: {type: UInt64, converter: SnowflakeConverter} ) end struct GuildEmojiUpdatePayload JSON.mapping( guild_id: {type: UInt64, converter: SnowflakeConverter}, emoji: {type: Array(Emoji), key: "emojis"} ) end struct GuildIntegrationsUpdatePayload JSON.mapping( guild_id: {type: UInt64, converter: SnowflakeConverter} ) end end end
fc9832ffa6a181003afaf11a9be1cad66d05619e
src/Http/Adapter/Curl.php
src/Http/Adapter/Curl.php
<?php namespace Faulancer\Http\Adapter; use Faulancer\Exception\ClientException; use Faulancer\Http\Request; /** * Class Curl * @package Faulancer\Http\Adapter * @author Florian Knapp <[email protected]> */ class Curl extends AbstractAdapter { /** * @param Request $request * @return void */ public function send(Request $request) { $ch = curl_init($request->getUri()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (!empty($request->getHeaders())) { curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); } if ($request->getMethod() === 'POST' && !empty($request->getBody())) { curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getBody()); } $this->response = curl_exec($ch); curl_close($ch); } /** * @return mixed * @throws ClientException */ public function getResponse() { if (empty($this->response)) { throw new ClientException('You have to call the \'send\' method first.'); } return $this->response; } }
<?php namespace Faulancer\Http\Adapter; use Faulancer\Exception\ClientException; use Faulancer\Http\Request; /** * Class Curl * @package Faulancer\Http\Adapter * @author Florian Knapp <[email protected]> */ class Curl extends AbstractAdapter { /** * @param Request $request * @return void */ public function send(Request $request) { $ch = curl_init($request->getUri()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (!empty($request->getHeaders())) { curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); } if ($request->getMethod() === 'POST' && !empty($request->getBody())) { curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getBody()); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'); $this->response = curl_exec($ch); curl_close($ch); } /** * @return mixed * @throws ClientException */ public function getResponse() { if (empty($this->response)) { throw new ClientException('You have to call the \'send\' method first.'); } return $this->response; } }
Add user agent to request
Add user agent to request
PHP
mit
FloKnapp/faulancer,FloKnapp/faulancer,FloKnapp/faulancer
php
## Code Before: <?php namespace Faulancer\Http\Adapter; use Faulancer\Exception\ClientException; use Faulancer\Http\Request; /** * Class Curl * @package Faulancer\Http\Adapter * @author Florian Knapp <[email protected]> */ class Curl extends AbstractAdapter { /** * @param Request $request * @return void */ public function send(Request $request) { $ch = curl_init($request->getUri()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (!empty($request->getHeaders())) { curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); } if ($request->getMethod() === 'POST' && !empty($request->getBody())) { curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getBody()); } $this->response = curl_exec($ch); curl_close($ch); } /** * @return mixed * @throws ClientException */ public function getResponse() { if (empty($this->response)) { throw new ClientException('You have to call the \'send\' method first.'); } return $this->response; } } ## Instruction: Add user agent to request ## Code After: <?php namespace Faulancer\Http\Adapter; use Faulancer\Exception\ClientException; use Faulancer\Http\Request; /** * Class Curl * @package Faulancer\Http\Adapter * @author Florian Knapp <[email protected]> */ class Curl extends AbstractAdapter { /** * @param Request $request * @return void */ public function send(Request $request) { $ch = curl_init($request->getUri()); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (!empty($request->getHeaders())) { curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders()); } if ($request->getMethod() === 'POST' && !empty($request->getBody())) { curl_setopt($ch, CURLOPT_POSTFIELDS, $request->getBody()); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'); $this->response = curl_exec($ch); curl_close($ch); } /** * @return mixed * @throws ClientException */ public function getResponse() { if (empty($this->response)) { throw new ClientException('You have to call the \'send\' method first.'); } return $this->response; } }
f56339b6f2b26f3392144b917440413eb0679624
setup/macos/brew_casks.txt
setup/macos/brew_casks.txt
java xquartz 1password alfred dropbox evernote docker iterm2 sublime-text visual-studio-code appcleaner caffeine flux handbrake omnidisksweeper sublime the-unarchiver transmission vlc firefox flash-npapi google-chrome torbrowser basictex djview marked microsoft-office-2011 skype slack textual betterzip epubquicklook qlcolorcode qlimagesize qlmarkdown qlstephen qlvideo quicklook-json provisionql suspicious-package
java xquartz 1password alfred dropbox evernote docker iterm2 sublime-text visual-studio-code appcleaner flux handbrake itsycal keepingyouawake omnidisksweeper sublime the-unarchiver transmission vlc firefox flash-npapi google-chrome torbrowser basictex djview marked microsoft-office-2011 skype slack textual betterzip epubquicklook qlcolorcode qlimagesize qlmarkdown qlstephen qlvideo quicklook-json provisionql suspicious-package
Replace caffeine by keepingyouawake and add calendar app in macos setup
Replace caffeine by keepingyouawake and add calendar app in macos setup
Text
mit
lendenmc/dotfiles
text
## Code Before: java xquartz 1password alfred dropbox evernote docker iterm2 sublime-text visual-studio-code appcleaner caffeine flux handbrake omnidisksweeper sublime the-unarchiver transmission vlc firefox flash-npapi google-chrome torbrowser basictex djview marked microsoft-office-2011 skype slack textual betterzip epubquicklook qlcolorcode qlimagesize qlmarkdown qlstephen qlvideo quicklook-json provisionql suspicious-package ## Instruction: Replace caffeine by keepingyouawake and add calendar app in macos setup ## Code After: java xquartz 1password alfred dropbox evernote docker iterm2 sublime-text visual-studio-code appcleaner flux handbrake itsycal keepingyouawake omnidisksweeper sublime the-unarchiver transmission vlc firefox flash-npapi google-chrome torbrowser basictex djview marked microsoft-office-2011 skype slack textual betterzip epubquicklook qlcolorcode qlimagesize qlmarkdown qlstephen qlvideo quicklook-json provisionql suspicious-package
783fd1063a156b30488b5db7804912e5588ecc1f
src/test/java/Test/SemantTest.java
src/test/java/Test/SemantTest.java
package Test; import absyn.Exp; import env.Env; import error.CompilerError; import java_cup.runtime.Symbol; import org.assertj.core.api.JUnitSoftAssertions; import org.junit.Rule; import org.junit.Test; import parse.Lexer; import parse.Parser; import types.*; import java.io.IOException; import java.io.StringReader; public class SemantTest { private Type runSemantic(String input) throws Exception { Lexer lexer = new Lexer(new StringReader(input), "unknown"); Parser parser = new Parser(lexer); Symbol program = parser.parse(); Exp parseTree = (Exp) program.value; return parseTree.semantic(new Env()); } private void trun(String input, Type type) { try { softly.assertThat(runSemantic(input)) .as("%s", input) .isEqualTo(type); } catch (Exception e) { e.printStackTrace(); } } private void erun(String input, String message) throws IOException { softly.assertThatThrownBy(() -> runSemantic(input)) .as("%s", input) .isInstanceOf(CompilerError.class) .hasToString(message); } @Rule public final JUnitSoftAssertions softly = new JUnitSoftAssertions(); }
package Test; import absyn.Exp; import env.Env; import error.CompilerError; import java_cup.runtime.Symbol; import org.assertj.core.api.JUnitSoftAssertions; import org.junit.Rule; import org.junit.Test; import parse.Lexer; import parse.Parser; import types.*; import java.io.IOException; import java.io.StringReader; public class SemantTest { private Type runSemantic(String input) throws Exception { Lexer lexer = new Lexer(new StringReader(input), "unknown"); Parser parser = new Parser(lexer); Symbol program = parser.parse(); Exp parseTree = (Exp) program.value; return parseTree.semantic(new Env()); } private void trun(String input, Type type) { try { softly.assertThat(runSemantic(input)) .as("%s", input) .isEqualTo(type); } catch (Exception e) { e.printStackTrace(); } } private void erun(String input, String message) throws IOException { softly.assertThatThrownBy(() -> runSemantic(input)) .as("%s", input) .isInstanceOf(CompilerError.class) .hasToString(message); } @Rule public final JUnitSoftAssertions softly = new JUnitSoftAssertions(); @Test public void testLiterals() throws Exception { trun("true", BOOL.T); trun("123", INT.T); trun("12.34", REAL.T); } }
Add tests of semantic analysis of literals
Add tests of semantic analysis of literals
Java
mit
romildo/eplan,romildo/eplan
java
## Code Before: package Test; import absyn.Exp; import env.Env; import error.CompilerError; import java_cup.runtime.Symbol; import org.assertj.core.api.JUnitSoftAssertions; import org.junit.Rule; import org.junit.Test; import parse.Lexer; import parse.Parser; import types.*; import java.io.IOException; import java.io.StringReader; public class SemantTest { private Type runSemantic(String input) throws Exception { Lexer lexer = new Lexer(new StringReader(input), "unknown"); Parser parser = new Parser(lexer); Symbol program = parser.parse(); Exp parseTree = (Exp) program.value; return parseTree.semantic(new Env()); } private void trun(String input, Type type) { try { softly.assertThat(runSemantic(input)) .as("%s", input) .isEqualTo(type); } catch (Exception e) { e.printStackTrace(); } } private void erun(String input, String message) throws IOException { softly.assertThatThrownBy(() -> runSemantic(input)) .as("%s", input) .isInstanceOf(CompilerError.class) .hasToString(message); } @Rule public final JUnitSoftAssertions softly = new JUnitSoftAssertions(); } ## Instruction: Add tests of semantic analysis of literals ## Code After: package Test; import absyn.Exp; import env.Env; import error.CompilerError; import java_cup.runtime.Symbol; import org.assertj.core.api.JUnitSoftAssertions; import org.junit.Rule; import org.junit.Test; import parse.Lexer; import parse.Parser; import types.*; import java.io.IOException; import java.io.StringReader; public class SemantTest { private Type runSemantic(String input) throws Exception { Lexer lexer = new Lexer(new StringReader(input), "unknown"); Parser parser = new Parser(lexer); Symbol program = parser.parse(); Exp parseTree = (Exp) program.value; return parseTree.semantic(new Env()); } private void trun(String input, Type type) { try { softly.assertThat(runSemantic(input)) .as("%s", input) .isEqualTo(type); } catch (Exception e) { e.printStackTrace(); } } private void erun(String input, String message) throws IOException { softly.assertThatThrownBy(() -> runSemantic(input)) .as("%s", input) .isInstanceOf(CompilerError.class) .hasToString(message); } @Rule public final JUnitSoftAssertions softly = new JUnitSoftAssertions(); @Test public void testLiterals() throws Exception { trun("true", BOOL.T); trun("123", INT.T); trun("12.34", REAL.T); } }
2e2fb333adeffc2d076fa889bf95a58a39ba9f56
lib/puppet/parser/functions/dns_array.rb
lib/puppet/parser/functions/dns_array.rb
module Puppet::Parser::Functions newfunction(:dns_array, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Returns a json array of hostnames and addresses from the data source. Arguments are the data source, the name of the api we are using, the token to connect to that api, and the domain to get the IPs from. When pulling for a reverse lookup zone, we submit a subnet that is understood by phpipam and it returns all entries in that subnet. For example: args[0] = https://ipam.dev/api/GetIPs.php? args[1] = ipinfo args[2] = asdlgadOuaaeiaoewr234679ds args[3] = covermymeds.com would return {"host1.example.com" => "192.168.30.22", ...ect} ENDHEREDOC require "timeout" require "net/https" require "uri" require "json" begin timeout(40) do uri = URI.parse("#{args[0]}apiapp=#{args[1]}&apitoken=#{args[2]}&domain=#{args[3]}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 30 request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) response.body end end end end
module Puppet::Parser::Functions newfunction(:dns_array, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Returns a json array of hostnames and addresses from the data source. Arguments are the data source, the name of the api we are using, the token to connect to that api, and the domain to get the IPs from. When pulling for a reverse lookup zone, we submit a subnet that is understood by phpipam and it returns all entries in that subnet. For example: args[0] = https://ipam.dev/api/GetIPs.php? args[1] = ipinfo args[2] = asdlgadOuaaeiaoewr234679ds args[3] = covermymeds.com would return {"host1.example.com" => "192.168.30.22", ...ect} ENDHEREDOC require "timeout" require "net/https" require "uri" require "json" begin timeout(40) do uri = URI.parse("#{args[0]}apiapp=#{args[1]}&apitoken=#{args[2]}&domain=#{args[3]}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.ssl_version=:TLSv1_2 http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 30 request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) response.body end end end end
Adjust ruby ssl settings to use TLSv1.2 for connection to web server
Adjust ruby ssl settings to use TLSv1.2 for connection to web server
Ruby
mit
covermymeds/puppet-bind,covermymeds/puppet-bind
ruby
## Code Before: module Puppet::Parser::Functions newfunction(:dns_array, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Returns a json array of hostnames and addresses from the data source. Arguments are the data source, the name of the api we are using, the token to connect to that api, and the domain to get the IPs from. When pulling for a reverse lookup zone, we submit a subnet that is understood by phpipam and it returns all entries in that subnet. For example: args[0] = https://ipam.dev/api/GetIPs.php? args[1] = ipinfo args[2] = asdlgadOuaaeiaoewr234679ds args[3] = covermymeds.com would return {"host1.example.com" => "192.168.30.22", ...ect} ENDHEREDOC require "timeout" require "net/https" require "uri" require "json" begin timeout(40) do uri = URI.parse("#{args[0]}apiapp=#{args[1]}&apitoken=#{args[2]}&domain=#{args[3]}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 30 request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) response.body end end end end ## Instruction: Adjust ruby ssl settings to use TLSv1.2 for connection to web server ## Code After: module Puppet::Parser::Functions newfunction(:dns_array, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| Returns a json array of hostnames and addresses from the data source. Arguments are the data source, the name of the api we are using, the token to connect to that api, and the domain to get the IPs from. When pulling for a reverse lookup zone, we submit a subnet that is understood by phpipam and it returns all entries in that subnet. For example: args[0] = https://ipam.dev/api/GetIPs.php? args[1] = ipinfo args[2] = asdlgadOuaaeiaoewr234679ds args[3] = covermymeds.com would return {"host1.example.com" => "192.168.30.22", ...ect} ENDHEREDOC require "timeout" require "net/https" require "uri" require "json" begin timeout(40) do uri = URI.parse("#{args[0]}apiapp=#{args[1]}&apitoken=#{args[2]}&domain=#{args[3]}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.ssl_version=:TLSv1_2 http.verify_mode = OpenSSL::SSL::VERIFY_NONE http.read_timeout = 30 request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) response.body end end end end
03b2923a10b5023fa582805074e033b1eb44783b
app/components/common/appMainFooter/appMainFooter.html
app/components/common/appMainFooter/appMainFooter.html
<footer class="appMainFooter"> <div class="container"> <div class="row appMainFooter-row"> <div class="col-xs-6"> <div class="appMainFooter__brand"> <a ui-sref="home"><span class="text-grey-2">OD</span>Ca</a> </div> <ul class="appMainFooter-linksList"> <li><a ui-sref="appMain.about" class="appMainFooter-linksList--link" title="About">About</a></li> <li><a ui-sref="appMain.faq" class="appMainFooter-linksList--link" title="FAQ">FAQ</a></li> <li><a href="http://caciviclab.org/opendisclosure/" class="appMainFooter-linksList--link" title="Join us">Join us</a></li> </ul> </div> <div class="col-xs-6"> <p class="appMainFooter-taglineText text-right"><em>Brought to you by <a href="http://caciviclab.org/" class="text-nowrap">California Civic Lab</a></em></p> </div> </div> </div> </footer>
<footer class="appMainFooter"> <div class="container"> <div class="row appMainFooter-row"> <div class="col-xs-6"> <div class="appMainFooter__brand"> <a ui-sref="home"><span class="text-grey-2">OD</span>Ca</a> </div> <ul class="appMainFooter-linksList"> <li><a ui-sref="appMain.about" class="appMainFooter-linksList--link" title="About">About</a></li> <li><a ui-sref="appMain.faq" class="appMainFooter-linksList--link" title="FAQ">FAQ</a></li> <li><a href="http://caciviclab.org/opendisclosure/" class="appMainFooter-linksList--link" title="Join us">Join us</a></li> </ul> </div> <div class="col-xs-6"> <p class="appMainFooter-taglineText text-right"><em>Brought to you by <a href="http://caciviclab.org/">California <span class="text-nowrap">Civic Lab</span></a></em></p> </div> </div> </div> </footer>
Fix extra gutter by allowing word break
Fix extra gutter by allowing word break
HTML
mit
caciviclab/disclosure-frontend-alpha,KyleW/disclosure-frontend,KyleW/disclosure-frontend,KyleW/disclosure-frontend,caciviclab/disclosure-frontend,caciviclab/disclosure-frontend-alpha,caciviclab/disclosure-frontend,caciviclab/disclosure-frontend-alpha,caciviclab/disclosure-frontend
html
## Code Before: <footer class="appMainFooter"> <div class="container"> <div class="row appMainFooter-row"> <div class="col-xs-6"> <div class="appMainFooter__brand"> <a ui-sref="home"><span class="text-grey-2">OD</span>Ca</a> </div> <ul class="appMainFooter-linksList"> <li><a ui-sref="appMain.about" class="appMainFooter-linksList--link" title="About">About</a></li> <li><a ui-sref="appMain.faq" class="appMainFooter-linksList--link" title="FAQ">FAQ</a></li> <li><a href="http://caciviclab.org/opendisclosure/" class="appMainFooter-linksList--link" title="Join us">Join us</a></li> </ul> </div> <div class="col-xs-6"> <p class="appMainFooter-taglineText text-right"><em>Brought to you by <a href="http://caciviclab.org/" class="text-nowrap">California Civic Lab</a></em></p> </div> </div> </div> </footer> ## Instruction: Fix extra gutter by allowing word break ## Code After: <footer class="appMainFooter"> <div class="container"> <div class="row appMainFooter-row"> <div class="col-xs-6"> <div class="appMainFooter__brand"> <a ui-sref="home"><span class="text-grey-2">OD</span>Ca</a> </div> <ul class="appMainFooter-linksList"> <li><a ui-sref="appMain.about" class="appMainFooter-linksList--link" title="About">About</a></li> <li><a ui-sref="appMain.faq" class="appMainFooter-linksList--link" title="FAQ">FAQ</a></li> <li><a href="http://caciviclab.org/opendisclosure/" class="appMainFooter-linksList--link" title="Join us">Join us</a></li> </ul> </div> <div class="col-xs-6"> <p class="appMainFooter-taglineText text-right"><em>Brought to you by <a href="http://caciviclab.org/">California <span class="text-nowrap">Civic Lab</span></a></em></p> </div> </div> </div> </footer>
f703e7ece93e859af0f6e268e8933021cba36367
tox.ini
tox.ini
[tox] envlist = py26,py27,pep8 minversion = 1.6 skipsdist = True [testenv] usedevelop = True whitelist_externals = bash install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = bash tools/pretty_tox.sh '{posargs}' [testenv:pep8] commands = flake8 {posargs} [testenv:venv] commands = {posargs} [testenv:functional] setenv = OS_TEST_PATH = ./muranoclient/tests/functional passenv = OS_* [testenv:uitests] commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}" [testenv:cover] commands = python setup.py testr --coverage --testr-args='--concurrency 1 {posargs}' [testenv:pyflakes] deps = flake8 commands = flake8 [flake8] # H405 multi line docstring summary not separated with an empty line # H904 Wrap long lines in parentheses instead of a backslash # F812 list comprehension redefines ignore = F812,H405,H904 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
[tox] envlist = py26,py27,pep8 minversion = 1.6 skipsdist = True [testenv] usedevelop = True whitelist_externals = bash install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = bash tools/pretty_tox.sh '{posargs}' [testenv:pep8] commands = flake8 {posargs} [testenv:venv] commands = {posargs} [testenv:functional] setenv = OS_TEST_PATH = ./muranoclient/tests/functional passenv = OS_* [testenv:uitests] commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}" [testenv:cover] commands = python setup.py testr --coverage --testr-args='--concurrency 1 {posargs}' [testenv:pyflakes] deps = flake8 commands = flake8 [flake8] # H405 multi line docstring summary not separated with an empty line ignore = H405 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
Enable F812 and H904 style check
Enable F812 and H904 style check There are no shadowed variables in list comprehensions so F812 can be enabled. Also enable H904 because it was removed since hacking 0.10.0 [1] [1] http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0 Change-Id: I11e55066f2ec883c5706774d72c4f21b928ebde5
INI
apache-2.0
openstack/python-muranoclient,openstack/python-muranoclient
ini
## Code Before: [tox] envlist = py26,py27,pep8 minversion = 1.6 skipsdist = True [testenv] usedevelop = True whitelist_externals = bash install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = bash tools/pretty_tox.sh '{posargs}' [testenv:pep8] commands = flake8 {posargs} [testenv:venv] commands = {posargs} [testenv:functional] setenv = OS_TEST_PATH = ./muranoclient/tests/functional passenv = OS_* [testenv:uitests] commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}" [testenv:cover] commands = python setup.py testr --coverage --testr-args='--concurrency 1 {posargs}' [testenv:pyflakes] deps = flake8 commands = flake8 [flake8] # H405 multi line docstring summary not separated with an empty line # H904 Wrap long lines in parentheses instead of a backslash # F812 list comprehension redefines ignore = F812,H405,H904 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools ## Instruction: Enable F812 and H904 style check There are no shadowed variables in list comprehensions so F812 can be enabled. Also enable H904 because it was removed since hacking 0.10.0 [1] [1] http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0 Change-Id: I11e55066f2ec883c5706774d72c4f21b928ebde5 ## Code After: [tox] envlist = py26,py27,pep8 minversion = 1.6 skipsdist = True [testenv] usedevelop = True whitelist_externals = bash install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = bash tools/pretty_tox.sh '{posargs}' [testenv:pep8] commands = flake8 {posargs} [testenv:venv] commands = {posargs} [testenv:functional] setenv = OS_TEST_PATH = ./muranoclient/tests/functional passenv = OS_* [testenv:uitests] commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}" [testenv:cover] commands = python setup.py testr --coverage --testr-args='--concurrency 1 {posargs}' [testenv:pyflakes] deps = flake8 commands = flake8 [flake8] # H405 multi line docstring summary not separated with an empty line ignore = H405 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
66fed655a9b41f6e270acec19fe66f787049063b
src/atom10/feed.php
src/atom10/feed.php
<?php namespace ComplexPie\Atom10; class Feed { private static $aliases = array( 'description' => 'subtitle', 'tagline' => 'subtitle', 'copyright' => 'rights', ); private static $elements = array( 'title' => array( 'element' => 'atom:title', 'type' => 'atomTextConstruct', 'single' => true ), 'subtitle' => array( 'element' => 'atom:subtitle', 'type' => 'atomTextConstruct', 'single' => true ), 'rights' => array( 'element' => 'atom:rights', 'type' => 'atomTextConstruct', 'single' => true ), ); public function __invoke($dom, $name) { if (isset(self::$elements[$name])) { return $this->elements_table($dom, $name); } elseif (isset(self::$aliases[$name])) { return $this->__invoke($dom, self::$aliases[$name]); } } private function elements_table($dom, $name) { $element = self::$elements[$name]; if ($return = \ComplexPie\Misc::get_descendant($dom, $element['element'], array('atom' => XMLNS), $element['single'])) { switch ($element['type']) { case 'atomTextConstruct': return Content::from_text_construct($return); default: throw new \Exception('Um, this shouldn\'t happen'); } } } }
<?php namespace ComplexPie\Atom10; class Feed { private static $aliases = array( 'description' => 'subtitle', 'tagline' => 'subtitle', 'copyright' => 'rights', ); private static $elements = array( 'title' => array( 'element' => 'atom:title', 'contentConstructor' => 'ComplexPie\\Atom10\\Content::from_text_construct', 'single' => true ), 'subtitle' => array( 'element' => 'atom:subtitle', 'contentConstructor' => 'ComplexPie\\Atom10\\Content::from_text_construct', 'single' => true ), 'rights' => array( 'element' => 'atom:rights', 'contentConstructor' => 'ComplexPie\\Atom10\\Content::from_text_construct', 'single' => true ), ); public function __invoke($dom, $name) { if (isset(self::$elements[$name])) { return $this->elements_table($dom, $name); } elseif (isset(self::$aliases[$name])) { return $this->__invoke($dom, self::$aliases[$name]); } } private function elements_table($dom, $name) { $element = self::$elements[$name]; if ($return = \ComplexPie\Misc::get_descendant($dom, $element['element'], array('atom' => XMLNS), $element['single'])) { return call_user_func($element['contentConstructor'], $return); } } }
Make this a bit cleaner.
Make this a bit cleaner.
PHP
bsd-3-clause
gsnedders/complexpie
php
## Code Before: <?php namespace ComplexPie\Atom10; class Feed { private static $aliases = array( 'description' => 'subtitle', 'tagline' => 'subtitle', 'copyright' => 'rights', ); private static $elements = array( 'title' => array( 'element' => 'atom:title', 'type' => 'atomTextConstruct', 'single' => true ), 'subtitle' => array( 'element' => 'atom:subtitle', 'type' => 'atomTextConstruct', 'single' => true ), 'rights' => array( 'element' => 'atom:rights', 'type' => 'atomTextConstruct', 'single' => true ), ); public function __invoke($dom, $name) { if (isset(self::$elements[$name])) { return $this->elements_table($dom, $name); } elseif (isset(self::$aliases[$name])) { return $this->__invoke($dom, self::$aliases[$name]); } } private function elements_table($dom, $name) { $element = self::$elements[$name]; if ($return = \ComplexPie\Misc::get_descendant($dom, $element['element'], array('atom' => XMLNS), $element['single'])) { switch ($element['type']) { case 'atomTextConstruct': return Content::from_text_construct($return); default: throw new \Exception('Um, this shouldn\'t happen'); } } } } ## Instruction: Make this a bit cleaner. ## Code After: <?php namespace ComplexPie\Atom10; class Feed { private static $aliases = array( 'description' => 'subtitle', 'tagline' => 'subtitle', 'copyright' => 'rights', ); private static $elements = array( 'title' => array( 'element' => 'atom:title', 'contentConstructor' => 'ComplexPie\\Atom10\\Content::from_text_construct', 'single' => true ), 'subtitle' => array( 'element' => 'atom:subtitle', 'contentConstructor' => 'ComplexPie\\Atom10\\Content::from_text_construct', 'single' => true ), 'rights' => array( 'element' => 'atom:rights', 'contentConstructor' => 'ComplexPie\\Atom10\\Content::from_text_construct', 'single' => true ), ); public function __invoke($dom, $name) { if (isset(self::$elements[$name])) { return $this->elements_table($dom, $name); } elseif (isset(self::$aliases[$name])) { return $this->__invoke($dom, self::$aliases[$name]); } } private function elements_table($dom, $name) { $element = self::$elements[$name]; if ($return = \ComplexPie\Misc::get_descendant($dom, $element['element'], array('atom' => XMLNS), $element['single'])) { return call_user_func($element['contentConstructor'], $return); } } }
1e243b491ca7621302a499e9cef169f6dd1f5b62
t/01-load.t
t/01-load.t
use v6; use Test; use Test::Builder; plan 1; # Verify that module is loaded properly ok 1, 'Load module'; # vim: ft=perl6
use v6; use Test; use Test::Builder; plan 2; # Verify that module is loaded properly ok 1, 'Load module'; my Test::Builder $tb .= new; ok $tb, 'Instance was created'; # vim: ft=perl6
Test for checking instance creation
Test for checking instance creation
Perl
artistic-2.0
perl6-community-modules/p6-test-builder
perl
## Code Before: use v6; use Test; use Test::Builder; plan 1; # Verify that module is loaded properly ok 1, 'Load module'; # vim: ft=perl6 ## Instruction: Test for checking instance creation ## Code After: use v6; use Test; use Test::Builder; plan 2; # Verify that module is loaded properly ok 1, 'Load module'; my Test::Builder $tb .= new; ok $tb, 'Instance was created'; # vim: ft=perl6
58b33c99faa2d9ea0667b967f784556dfec78616
_config.yml
_config.yml
name: Micah Miller-Eshleman description: Blog meta_description: "Your New Jekyll Site, Blogging about stuffs" aboutPage: true markdown: kramdown highlighter: rouge paginate: 20 baseurl: / domain_name: 'http://yourblog-domain.com' google_analytics: 'UA-XXXXXXXX-X' disqus: false disqus_shortname: 'your-disqus-shortname' # Prose.io Configuration media: assets/images # Details for the RSS feed generator url: 'http://micahjon.com' author: 'Micah Miller-Eshleman' authorTwitter: 'YourTwitterUsername' permalink: /:year/:title/ defaults: - scope: path: "" # empty string for all files type: pages values: layout: default - scope: path: "" # empty string for all files type: posts values: layout: post - scope: path: "" type: drafts values: layout: post
name: Micah Miller-Eshleman description: Blog meta_description: "Your New Jekyll Site, Blogging about stuffs" aboutPage: true markdown: kramdown highlighter: rouge paginate: 20 baseurl: 'https://pranksinatra.github.io/' domain_name: 'http://yourblog-domain.com' google_analytics: 'UA-XXXXXXXX-X' disqus: false disqus_shortname: 'your-disqus-shortname' # Prose.io Configuration media: assets/images # Details for the RSS feed generator url: 'http://micahjon.com' author: 'Micah Miller-Eshleman' authorTwitter: 'YourTwitterUsername' permalink: /:year/:title/ defaults: - scope: path: "" # empty string for all files type: pages values: layout: default - scope: path: "" # empty string for all files type: posts values: layout: post - scope: path: "" type: drafts values: layout: post
Update baseurl to pranksinatra.github.io so Prose.io image preview works
Update baseurl to pranksinatra.github.io so Prose.io image preview works
YAML
mit
pranksinatra/pranksinatra.github.io,pranksinatra/pranksinatra.github.io
yaml
## Code Before: name: Micah Miller-Eshleman description: Blog meta_description: "Your New Jekyll Site, Blogging about stuffs" aboutPage: true markdown: kramdown highlighter: rouge paginate: 20 baseurl: / domain_name: 'http://yourblog-domain.com' google_analytics: 'UA-XXXXXXXX-X' disqus: false disqus_shortname: 'your-disqus-shortname' # Prose.io Configuration media: assets/images # Details for the RSS feed generator url: 'http://micahjon.com' author: 'Micah Miller-Eshleman' authorTwitter: 'YourTwitterUsername' permalink: /:year/:title/ defaults: - scope: path: "" # empty string for all files type: pages values: layout: default - scope: path: "" # empty string for all files type: posts values: layout: post - scope: path: "" type: drafts values: layout: post ## Instruction: Update baseurl to pranksinatra.github.io so Prose.io image preview works ## Code After: name: Micah Miller-Eshleman description: Blog meta_description: "Your New Jekyll Site, Blogging about stuffs" aboutPage: true markdown: kramdown highlighter: rouge paginate: 20 baseurl: 'https://pranksinatra.github.io/' domain_name: 'http://yourblog-domain.com' google_analytics: 'UA-XXXXXXXX-X' disqus: false disqus_shortname: 'your-disqus-shortname' # Prose.io Configuration media: assets/images # Details for the RSS feed generator url: 'http://micahjon.com' author: 'Micah Miller-Eshleman' authorTwitter: 'YourTwitterUsername' permalink: /:year/:title/ defaults: - scope: path: "" # empty string for all files type: pages values: layout: default - scope: path: "" # empty string for all files type: posts values: layout: post - scope: path: "" type: drafts values: layout: post
e2382e4d30dc6739ef819802aad904f93d2c3aff
examples/logger.php
examples/logger.php
<?php class logger { private $logfile = null; private static $instance = null; public static function getInstance() { if (self::$instance == null) { self::$instance = new logger(); } return self::$instance; } private function __construct() { } public function setLogfile($logfile) { $this->logfile = $logfile; } public function log($level, $message) { $msg = $level." : ".$message."\n"; $type = 3; if ($logfile == null) { $type = 0; } error_log($message, $type, $this->logfile); } }
<?php /** * Logger class to register the logger for * to give a central logging with callback * registration in the php_rsync extension. * * @author ironpinguin * */ class logger { /** * Log file. * * @var string */ private $logfile = null; /** * Instance variable for the logger singelton. * * @var logger */ private static $instance = null; /** * Static method to get the instance of the * logger singelton. * * @return logger */ public static function getInstance() { if (self::$instance == null) { self::$instance = new logger(); } return self::$instance; } /** * Empty Constructor.... * */ private function __construct() { } /** * Setter for the logfile. * * @param string $logfile String with the logfile incl. path. */ public function setLogfile($logfile) { $this->logfile = $logfile; } /** * Logging method where will be register as callback in the * php_rsync extension. * * @param int $level Logging level. * @param string $message Logging message. */ public function log($level, $message) { $msg = $level." : ".$message."\n"; $type = 3; if ($logfile == null) { $type = 0; } error_log($message, $type, $this->logfile); } }
Add doc comment to the class.
Add doc comment to the class.
PHP
bsd-2-clause
ironpinguin/php_rsync,ironpinguin/php_rsync,ironpinguin/php_rsync,ironpinguin/php_rsync,ironpinguin/php_rsync
php
## Code Before: <?php class logger { private $logfile = null; private static $instance = null; public static function getInstance() { if (self::$instance == null) { self::$instance = new logger(); } return self::$instance; } private function __construct() { } public function setLogfile($logfile) { $this->logfile = $logfile; } public function log($level, $message) { $msg = $level." : ".$message."\n"; $type = 3; if ($logfile == null) { $type = 0; } error_log($message, $type, $this->logfile); } } ## Instruction: Add doc comment to the class. ## Code After: <?php /** * Logger class to register the logger for * to give a central logging with callback * registration in the php_rsync extension. * * @author ironpinguin * */ class logger { /** * Log file. * * @var string */ private $logfile = null; /** * Instance variable for the logger singelton. * * @var logger */ private static $instance = null; /** * Static method to get the instance of the * logger singelton. * * @return logger */ public static function getInstance() { if (self::$instance == null) { self::$instance = new logger(); } return self::$instance; } /** * Empty Constructor.... * */ private function __construct() { } /** * Setter for the logfile. * * @param string $logfile String with the logfile incl. path. */ public function setLogfile($logfile) { $this->logfile = $logfile; } /** * Logging method where will be register as callback in the * php_rsync extension. * * @param int $level Logging level. * @param string $message Logging message. */ public function log($level, $message) { $msg = $level." : ".$message."\n"; $type = 3; if ($logfile == null) { $type = 0; } error_log($message, $type, $this->logfile); } }
815d187d68ab86d8c20e46427a75f0b784464340
models/scoreset.rb
models/scoreset.rb
class Scoreset < Sequel::Model many_to_one :player one_to_many :score def Scoreset.new_scores(player, song, registered_at) scoreset = Scoreset.new( player: player, registered_at: registered_at) scoreset.save song.each do |s| song_name = s[:name].gsub(/''/, '"').strip music = Music.find(:name => song_name) unless music (1..song_name.size-1).each do |i| puts "trying: #{song_name.slice(0..(song_name.size - i))}" music = Music.find(:name.like(song_name.slice(0..(song_name.size - i)) + '%')) break if music end puts "found music!" if music raise MusicMismatchError.new(song_name, music ? music.name : nil) end DIFFICULTY.each do |diff, diff_num| if s[:scores][diff][:achieve] score = Score.new( music: music, scoreset: scoreset, difficulty: diff_num, achieve: s[:scores][diff][:achieve], miss: s[:scores][diff][:miss]) scoreset.add_score(score) score.save end end end scoreset.save scoreset end end
class Scoreset < Sequel::Model many_to_one :player one_to_many :score def Scoreset.new_scores(player, song, registered_at) scoreset = Scoreset.new( player: player, registered_at: registered_at) scoreset.save song.each do |s| song_name = s[:name].gsub(/''/, '"').strip music = Music.find(:name => song_name) unless music (1..song_name.size-1).each do |i| puts "trying: #{song_name.slice(0..(song_name.size - i))}" music = Music.find(:name.like(song_name.slice(0..(song_name.size - i)) + '%')) break if music end puts "found music!" if music raise MusicMismatchError.new(song_name, music ? music.name : nil) end DIFFICULTY.each do |diff| if s[:scores][diff][:achieve] score = Score.new( music: music, scoreset: scoreset, difficulty: DIFFICULTY.index(diff), achieve: s[:scores][diff][:achieve], miss: s[:scores][diff][:miss]) scoreset.add_score(score) score.save end end end scoreset.save scoreset end end
Fix bug (use DIFFICULTY as Array)
Fix bug (use DIFFICULTY as Array)
Ruby
mit
mayth/refixative,mayth/refixative,mayth/refixative
ruby
## Code Before: class Scoreset < Sequel::Model many_to_one :player one_to_many :score def Scoreset.new_scores(player, song, registered_at) scoreset = Scoreset.new( player: player, registered_at: registered_at) scoreset.save song.each do |s| song_name = s[:name].gsub(/''/, '"').strip music = Music.find(:name => song_name) unless music (1..song_name.size-1).each do |i| puts "trying: #{song_name.slice(0..(song_name.size - i))}" music = Music.find(:name.like(song_name.slice(0..(song_name.size - i)) + '%')) break if music end puts "found music!" if music raise MusicMismatchError.new(song_name, music ? music.name : nil) end DIFFICULTY.each do |diff, diff_num| if s[:scores][diff][:achieve] score = Score.new( music: music, scoreset: scoreset, difficulty: diff_num, achieve: s[:scores][diff][:achieve], miss: s[:scores][diff][:miss]) scoreset.add_score(score) score.save end end end scoreset.save scoreset end end ## Instruction: Fix bug (use DIFFICULTY as Array) ## Code After: class Scoreset < Sequel::Model many_to_one :player one_to_many :score def Scoreset.new_scores(player, song, registered_at) scoreset = Scoreset.new( player: player, registered_at: registered_at) scoreset.save song.each do |s| song_name = s[:name].gsub(/''/, '"').strip music = Music.find(:name => song_name) unless music (1..song_name.size-1).each do |i| puts "trying: #{song_name.slice(0..(song_name.size - i))}" music = Music.find(:name.like(song_name.slice(0..(song_name.size - i)) + '%')) break if music end puts "found music!" if music raise MusicMismatchError.new(song_name, music ? music.name : nil) end DIFFICULTY.each do |diff| if s[:scores][diff][:achieve] score = Score.new( music: music, scoreset: scoreset, difficulty: DIFFICULTY.index(diff), achieve: s[:scores][diff][:achieve], miss: s[:scores][diff][:miss]) scoreset.add_score(score) score.save end end end scoreset.save scoreset end end