commit
stringlengths
40
40
old_file
stringlengths
4
184
new_file
stringlengths
4
184
old_contents
stringlengths
1
3.6k
new_contents
stringlengths
5
3.38k
subject
stringlengths
15
778
message
stringlengths
16
6.74k
lang
stringclasses
201 values
license
stringclasses
13 values
repos
stringlengths
6
116k
config
stringclasses
201 values
content
stringlengths
137
7.24k
diff
stringlengths
26
5.55k
diff_length
int64
1
123
relative_diff_length
float64
0.01
89
n_lines_added
int64
0
108
n_lines_deleted
int64
0
106
5482ee2eb883207d72d0ba90ef6dc4173520866d
CHANGELOG.md
CHANGELOG.md
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## v1.0.0 (2019-10-23) ### Notes This is the first official release. The flink-eeros wrapper library enables the usage of flink hardware with the EEROS Robotics Framework.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased (v1.1.0 targeted for 2020-03-31) ([GitHub compare v1.0.0...master](https://github.com/eeros-project/flink-eeros/compare/v1.0.0...master)) ## v1.0.0 (2019-10-23) ### Notes This is the first official release. The flink-eeros wrapper library enables the usage of flink hardware with the EEROS Robotics Framework.
Add unreleased section to change log
Add unreleased section to change log
Markdown
apache-2.0
eeros-project/flink-eeros
markdown
## Code Before: The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## v1.0.0 (2019-10-23) ### Notes This is the first official release. The flink-eeros wrapper library enables the usage of flink hardware with the EEROS Robotics Framework. ## Instruction: Add unreleased section to change log ## Code After: The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased (v1.1.0 targeted for 2020-03-31) ([GitHub compare v1.0.0...master](https://github.com/eeros-project/flink-eeros/compare/v1.0.0...master)) ## v1.0.0 (2019-10-23) ### Notes This is the first official release. The flink-eeros wrapper library enables the usage of flink hardware with the EEROS Robotics Framework.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + + ## Unreleased + (v1.1.0 targeted for 2020-03-31) ([GitHub compare v1.0.0...master](https://github.com/eeros-project/flink-eeros/compare/v1.0.0...master)) ## v1.0.0 (2019-10-23) ### Notes This is the first official release. The flink-eeros wrapper library enables the usage of flink hardware with the EEROS Robotics Framework.
4
0.333333
4
0
af5a10a0d2843096e3176d89d7c4da824909b82e
config/mongoid.yml
config/mongoid.yml
development: host: localhost database: joinplato_development test: host: localhost database: joinplato_test # set these environment variables on your prod server production: uri: <%= ENV['MONGOHQ_URL'] %>
development: host: localhost database: joinplato_development test: host: localhost database: joinplato_test # set these environment variables on your prod server production: uri: <%= ENV['MONGOHQ_URL'] %> staging: uri: <%= ENV['MONGOHQ_URL'] %>
Add staging connexion for MongoDB
Add staging connexion for MongoDB
YAML
apache-2.0
voxe/voxe-web,voxe/voxe-web,voxe/voxe-web
yaml
## Code Before: development: host: localhost database: joinplato_development test: host: localhost database: joinplato_test # set these environment variables on your prod server production: uri: <%= ENV['MONGOHQ_URL'] %> ## Instruction: Add staging connexion for MongoDB ## Code After: development: host: localhost database: joinplato_development test: host: localhost database: joinplato_test # set these environment variables on your prod server production: uri: <%= ENV['MONGOHQ_URL'] %> staging: uri: <%= ENV['MONGOHQ_URL'] %>
development: host: localhost database: joinplato_development test: host: localhost database: joinplato_test # set these environment variables on your prod server production: uri: <%= ENV['MONGOHQ_URL'] %> + + staging: + uri: <%= ENV['MONGOHQ_URL'] %>
3
0.272727
3
0
1745a4710945ac381f69477456685852ed70dcb5
test/options.js
test/options.js
var uuid = require('../uuid'); var today = new Date().getTime(); var tenhoursago = new Date(today - 10*3600*1000).getTime(); function compare(ids) { console.log(ids); for (var i = 0; i < ids.length; i++) { var id = ids[i].split('-'); id = [id[2], id[1], id[0], id[3], id[4]].join(''); ids[i] = id; } var sorted = ([].concat(ids)).sort(); if (sorted.toString() !== ids.toString()) { console.log('Warning: sorted !== ids'); } else { console.log('everything in order!'); } } var uuidToday = uuid.v1({ timestamp: today }); var uuidTenhoursago = uuid.v1({ timestamp: tenhoursago }); var uuidNow = uuid.v1(); var ids = [uuidTenhoursago, uuidToday, uuidNow]; console.log('Test if ids are in order:'); compare(ids);
var uuid = require('../uuid'), assert = require('assert'); function compare(ids) { console.log(ids); for (var i = 0; i < ids.length; i++) { var id = ids[i].split('-'); id = [id[2], id[1], id[0], id[3], id[4]].join(''); ids[i] = id; } var sorted = ([].concat(ids)).sort(); assert.equal(sorted.toString(), ids.toString(), 'Warning: sorted !== ids'); console.log('everything in order!'); } var today = new Date().getTime(); var tenhoursago = new Date(today - 10*3600*1000).getTime(); var twentyeightdayslater = new Date(today + 28*24*3600*1000).getTime(); var uuidToday = uuid.v1({ timestamp: today }); var uuidTenhoursago = uuid.v1({ timestamp: tenhoursago }); var uuidTwentyeightdayslater = uuid.v1({ timestamp: twentyeightdayslater }); var uuidNow = uuid.v1(); var ids = [uuidTenhoursago, uuidToday, uuidNow, uuidTwentyeightdayslater]; console.log('Test if ids are in order:'); compare(ids); // Betwenn uuidToday and uuidTenhoursago the clock is set backwards, so we // expect the clock_seq to increase by one assert.ok(uuidToday[22] < uuidTenhoursago[22], 'clock_seq was not increased'); // Same for uuidNow since we set the clock to a future value inbetween assert.ok(uuidTwentyeightdayslater[22] < uuidNow[22], 'clock_seq was not increased');
Add test for clock_seq increase if the clock is set backwards
Add test for clock_seq increase if the clock is set backwards
JavaScript
mit
kolonse/node-uuid,kolonse/node-uuid,IbpTeam/node-uuid,ortutay/node-uuid,kelektiv/node-uuid,broofa/node-uuid,johnhenry/node-uuid,kolonse/node-uuid,ortutay/node-uuid,IbpTeam/node-uuid,johnhenry/node-uuid,johnhenry/node-uuid,ortutay/node-uuid,kolonse/node-uuid,ortutay/node-uuid,IbpTeam/node-uuid,IbpTeam/node-uuid,johnhenry/node-uuid
javascript
## Code Before: var uuid = require('../uuid'); var today = new Date().getTime(); var tenhoursago = new Date(today - 10*3600*1000).getTime(); function compare(ids) { console.log(ids); for (var i = 0; i < ids.length; i++) { var id = ids[i].split('-'); id = [id[2], id[1], id[0], id[3], id[4]].join(''); ids[i] = id; } var sorted = ([].concat(ids)).sort(); if (sorted.toString() !== ids.toString()) { console.log('Warning: sorted !== ids'); } else { console.log('everything in order!'); } } var uuidToday = uuid.v1({ timestamp: today }); var uuidTenhoursago = uuid.v1({ timestamp: tenhoursago }); var uuidNow = uuid.v1(); var ids = [uuidTenhoursago, uuidToday, uuidNow]; console.log('Test if ids are in order:'); compare(ids); ## Instruction: Add test for clock_seq increase if the clock is set backwards ## Code After: var uuid = require('../uuid'), assert = require('assert'); function compare(ids) { console.log(ids); for (var i = 0; i < ids.length; i++) { var id = ids[i].split('-'); id = [id[2], id[1], id[0], id[3], id[4]].join(''); ids[i] = id; } var sorted = ([].concat(ids)).sort(); assert.equal(sorted.toString(), ids.toString(), 'Warning: sorted !== ids'); console.log('everything in order!'); } var today = new Date().getTime(); var tenhoursago = new Date(today - 10*3600*1000).getTime(); var twentyeightdayslater = new Date(today + 28*24*3600*1000).getTime(); var uuidToday = uuid.v1({ timestamp: today }); var uuidTenhoursago = uuid.v1({ timestamp: tenhoursago }); var uuidTwentyeightdayslater = uuid.v1({ timestamp: twentyeightdayslater }); var uuidNow = uuid.v1(); var ids = [uuidTenhoursago, uuidToday, uuidNow, uuidTwentyeightdayslater]; console.log('Test if ids are in order:'); compare(ids); // Betwenn uuidToday and uuidTenhoursago the clock is set backwards, so we // expect the clock_seq to increase by one assert.ok(uuidToday[22] < uuidTenhoursago[22], 'clock_seq was not increased'); // Same for uuidNow since we set the clock to a future value inbetween assert.ok(uuidTwentyeightdayslater[22] < uuidNow[22], 'clock_seq was not increased');
- var uuid = require('../uuid'); ? ^ + var uuid = require('../uuid'), ? ^ + assert = require('assert'); - - var today = new Date().getTime(); - var tenhoursago = new Date(today - 10*3600*1000).getTime(); function compare(ids) { console.log(ids); for (var i = 0; i < ids.length; i++) { var id = ids[i].split('-'); id = [id[2], id[1], id[0], id[3], id[4]].join(''); ids[i] = id; } var sorted = ([].concat(ids)).sort(); + assert.equal(sorted.toString(), ids.toString(), 'Warning: sorted !== ids'); - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); ? -- + console.log('everything in order!'); - } } + + var today = new Date().getTime(); + var tenhoursago = new Date(today - 10*3600*1000).getTime(); + var twentyeightdayslater = new Date(today + 28*24*3600*1000).getTime(); var uuidToday = uuid.v1({ timestamp: today }); var uuidTenhoursago = uuid.v1({ timestamp: tenhoursago }); + var uuidTwentyeightdayslater = uuid.v1({ + timestamp: twentyeightdayslater + }); var uuidNow = uuid.v1(); - var ids = [uuidTenhoursago, uuidToday, uuidNow]; + var ids = [uuidTenhoursago, uuidToday, uuidNow, uuidTwentyeightdayslater]; ? ++++++++++++++++++++++++++ console.log('Test if ids are in order:'); compare(ids); + // Betwenn uuidToday and uuidTenhoursago the clock is set backwards, so we + // expect the clock_seq to increase by one + assert.ok(uuidToday[22] < uuidTenhoursago[22], 'clock_seq was not increased'); + // Same for uuidNow since we set the clock to a future value inbetween + assert.ok(uuidTwentyeightdayslater[22] < uuidNow[22], 'clock_seq was not increased');
27
0.794118
17
10
00e0610e96aa362bc2d5798d7078973fddc775e8
client/controllers/incidentReports/incidentTable.coffee
client/controllers/incidentReports/incidentTable.coffee
Template.incidentTable.events 'mouseover .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return $annotation = $("span[data-incident-id=#{@_id}]") $("span[data-incident-id]").removeClass('viewing') appHeaderHeight = $('header nav.navbar').outerHeight() detailsHeaderHeight = $('.curator-source-details-header').outerHeight() headerOffset = appHeaderHeight + detailsHeaderHeight containerScrollTop = $('.curator-source-details-copy').scrollTop() annotationTopOffset = $annotation.offset().top countainerVerticalMidpoint = $('.curator-source-details-copy').height() / 2 totalOffset = annotationTopOffset - headerOffset # Distance of scroll based on postition of text container, scroll position # within the text container and the container's midpoint (to position the # annotation in the center of the container) scrollDistance = totalOffset + containerScrollTop - countainerVerticalMidpoint $('.curator-source-details-copy').stop().animate scrollTop: scrollDistance , 500, -> $annotation.addClass('viewing')
SCROLL_WAIT_TIME = 500 Template.incidentTable.onCreated -> @scrollToAnnotation = (id) => intervalTime = 0 @interval = setInterval => if intervalTime >= SCROLL_WAIT_TIME @stopScrollingInterval() $annotation = $("span[data-incident-id=#{id}]") $("span[data-incident-id]").removeClass('viewing') appHeaderHeight = $('header nav.navbar').outerHeight() detailsHeaderHeight = $('.curator-source-details--header').outerHeight() headerOffset = appHeaderHeight + detailsHeaderHeight containerScrollTop = $('.curator-source-details--copy').scrollTop() annotationTopOffset = $annotation.offset().top countainerVerticalMidpoint = $('.curator-source-details--copy').height() / 2 totalOffset = annotationTopOffset - headerOffset # Distance of scroll based on postition of text container, scroll position # within the text container and the container's midpoint (to position the # annotation in the center of the container) scrollDistance = totalOffset + containerScrollTop - countainerVerticalMidpoint $('.curator-source-details--copy').stop().animate scrollTop: scrollDistance , 500, -> $annotation.addClass('viewing') intervalTime += 100 , 100 @stopScrollingInterval = -> clearInterval(@interval) Template.incidentTable.events 'mouseover .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return instance.scrollToAnnotation(@_id) 'mouseout .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return instance.stopScrollingInterval()
Add wait time for scrolling to annotations on hover
Add wait time for scrolling to annotations on hover
CoffeeScript
apache-2.0
ecohealthalliance/eidr-connect,ecohealthalliance/eidr-connect,ecohealthalliance/eidr-connect,ecohealthalliance/eidr-connect
coffeescript
## Code Before: Template.incidentTable.events 'mouseover .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return $annotation = $("span[data-incident-id=#{@_id}]") $("span[data-incident-id]").removeClass('viewing') appHeaderHeight = $('header nav.navbar').outerHeight() detailsHeaderHeight = $('.curator-source-details-header').outerHeight() headerOffset = appHeaderHeight + detailsHeaderHeight containerScrollTop = $('.curator-source-details-copy').scrollTop() annotationTopOffset = $annotation.offset().top countainerVerticalMidpoint = $('.curator-source-details-copy').height() / 2 totalOffset = annotationTopOffset - headerOffset # Distance of scroll based on postition of text container, scroll position # within the text container and the container's midpoint (to position the # annotation in the center of the container) scrollDistance = totalOffset + containerScrollTop - countainerVerticalMidpoint $('.curator-source-details-copy').stop().animate scrollTop: scrollDistance , 500, -> $annotation.addClass('viewing') ## Instruction: Add wait time for scrolling to annotations on hover ## Code After: SCROLL_WAIT_TIME = 500 Template.incidentTable.onCreated -> @scrollToAnnotation = (id) => intervalTime = 0 @interval = setInterval => if intervalTime >= SCROLL_WAIT_TIME @stopScrollingInterval() $annotation = $("span[data-incident-id=#{id}]") $("span[data-incident-id]").removeClass('viewing') appHeaderHeight = $('header nav.navbar').outerHeight() detailsHeaderHeight = $('.curator-source-details--header').outerHeight() headerOffset = appHeaderHeight + detailsHeaderHeight containerScrollTop = $('.curator-source-details--copy').scrollTop() annotationTopOffset = $annotation.offset().top countainerVerticalMidpoint = $('.curator-source-details--copy').height() / 2 totalOffset = annotationTopOffset - headerOffset # Distance of scroll based on postition of text container, scroll position # within the text container and the container's midpoint (to position the # annotation in the center of the container) scrollDistance = totalOffset + containerScrollTop - countainerVerticalMidpoint $('.curator-source-details--copy').stop().animate scrollTop: scrollDistance , 500, -> $annotation.addClass('viewing') intervalTime += 100 , 100 @stopScrollingInterval = -> clearInterval(@interval) Template.incidentTable.events 'mouseover .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return instance.scrollToAnnotation(@_id) 'mouseout .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return instance.stopScrollingInterval()
+ SCROLL_WAIT_TIME = 500 + + Template.incidentTable.onCreated -> + @scrollToAnnotation = (id) => + intervalTime = 0 + @interval = setInterval => + if intervalTime >= SCROLL_WAIT_TIME + @stopScrollingInterval() + $annotation = $("span[data-incident-id=#{id}]") + $("span[data-incident-id]").removeClass('viewing') + appHeaderHeight = $('header nav.navbar').outerHeight() + detailsHeaderHeight = $('.curator-source-details--header').outerHeight() + headerOffset = appHeaderHeight + detailsHeaderHeight + containerScrollTop = $('.curator-source-details--copy').scrollTop() + annotationTopOffset = $annotation.offset().top + countainerVerticalMidpoint = $('.curator-source-details--copy').height() / 2 + totalOffset = annotationTopOffset - headerOffset + # Distance of scroll based on postition of text container, scroll position + # within the text container and the container's midpoint (to position the + # annotation in the center of the container) + scrollDistance = totalOffset + containerScrollTop - countainerVerticalMidpoint + $('.curator-source-details--copy').stop().animate + scrollTop: scrollDistance + , 500, -> $annotation.addClass('viewing') + intervalTime += 100 + , 100 + + @stopScrollingInterval = -> + clearInterval(@interval) + Template.incidentTable.events 'mouseover .incident-table tbody tr': (event, instance) -> if not instance.data.scrollToAnnotations return + instance.scrollToAnnotation(@_id) + + 'mouseout .incident-table tbody tr': (event, instance) -> + if not instance.data.scrollToAnnotations + return + instance.stopScrollingInterval() - $annotation = $("span[data-incident-id=#{@_id}]") - $("span[data-incident-id]").removeClass('viewing') - appHeaderHeight = $('header nav.navbar').outerHeight() - detailsHeaderHeight = $('.curator-source-details-header').outerHeight() - headerOffset = appHeaderHeight + detailsHeaderHeight - containerScrollTop = $('.curator-source-details-copy').scrollTop() - annotationTopOffset = $annotation.offset().top - countainerVerticalMidpoint = $('.curator-source-details-copy').height() / 2 - totalOffset = annotationTopOffset - headerOffset - # Distance of scroll based on postition of text container, scroll position - # within the text container and the container's midpoint (to position the - # annotation in the center of the container) - scrollDistance = totalOffset + containerScrollTop - countainerVerticalMidpoint - $('.curator-source-details-copy').stop().animate - scrollTop: scrollDistance - , 500, -> $annotation.addClass('viewing')
52
2.6
36
16
1a9b44f4be1a3e48021a9bc7b7a0929654f000e7
app/views/institutions/_form.html.erb
app/views/institutions/_form.html.erb
<%= form_for(@institution) do |f| %> <% if @institution.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@institution.errors.count, "error") %> prohibited this institution from being saved:</h2> <ul> <% @institution.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :name %><br> <%= f.text_field :name %> </div> <div class="actions"> <%= f.submit %> </div> <% end %>
<%= simple_form_for(@institution) do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :name %> </div> <div class="form-actions"> <%= f.button :submit, "Submit", {class: "btn btn-success"} %> <%= show_link @user, "Cancel" %> </div> <% end %>
Convert Insitution form to simple_form
Convert Insitution form to simple_form
HTML+ERB
apache-2.0
APTrust/fluctus,APTrust/fluctus,APTrust/fluctus
html+erb
## Code Before: <%= form_for(@institution) do |f| %> <% if @institution.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@institution.errors.count, "error") %> prohibited this institution from being saved:</h2> <ul> <% @institution.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :name %><br> <%= f.text_field :name %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> ## Instruction: Convert Insitution form to simple_form ## Code After: <%= simple_form_for(@institution) do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :name %> </div> <div class="form-actions"> <%= f.button :submit, "Submit", {class: "btn btn-success"} %> <%= show_link @user, "Cancel" %> </div> <% end %>
- <%= form_for(@institution) do |f| %> + <%= simple_form_for(@institution) do |f| %> ? +++++++ + <%= f.error_notification %> - <% if @institution.errors.any? %> - <div id="error_explanation"> - <h2><%= pluralize(@institution.errors.count, "error") %> prohibited this institution from being saved:</h2> - <ul> - <% @institution.errors.full_messages.each do |msg| %> - <li><%= msg %></li> - <% end %> - </ul> - </div> - <% end %> - - <div class="field"> ? ^^^ + <div class="form-inputs"> ? ++++ ^^^^^ - <%= f.label :name %><br> - <%= f.text_field :name %> ? --------- + <%= f.input :name %> ? ++++ </div> + - <div class="actions"> + <div class="form-actions"> ? +++++ - <%= f.submit %> + <%= f.button :submit, "Submit", {class: "btn btn-success"} %> + <%= show_link @user, "Cancel" %> </div> <% end %>
25
1.190476
8
17
131bdc48b50d1d9db7906d3d4deeaf33b4ffc35d
templates/base_wide.html
templates/base_wide.html
{% extends "base.html" %} {% block headextra %} <link rel="stylesheet" href="{{STATIC}}datatables/css/jquery.dataTables.css" type="text/css"> {% endblock headextra %} {% block body %} <div id="search-tool" class="fullwidth"> <p class="conditions-agreement-statement"> By using the UQ Anthropology Museum Online Catalogue you agree to the conditions of the <a href="#">Copyright Statement</a>. </p> {% include "snippets/top_search_panel.html" %} </div> <div id="content-primary" class="fullwidth"> {% block content %} {% endblock %} </div> {% endblock %}
{% extends "base.html" %} {% block headextra %} <link rel="stylesheet" href="{{STATIC}}datatables/css/jquery.dataTables.css" type="text/css"> {% endblock headextra %} {% block body %} <div id="search-tool" class="fullwidth"> <p class="conditions-agreement-statement"> By using the UQ Anthropology Museum Online Catalogue you agree to the conditions of the <a href="#">Copyright Statement</a>. </p> {% include "snippets/top_search_panel.html" %} </div> <div id="content-primary" class="fullwidth"> {% block content %} {% endblock %} </div> {% endblock %} {% block javascript %} <script type="text/javascript"> $(document).ready(function () { $('.grid-list-selector button').click(function (e) { if ($(this).hasClass('grid')) { $('#item-listing-table').hide(); $('#item-listing-grid').show(); } else if ($(this).hasClass('list')) { $('#item-listing-table').show(); $('#item-listing-grid').hide(); } }); }); </script> {% endblock javascript %}
Add javascript for switching between list/grid item view
Add javascript for switching between list/grid item view
HTML
bsd-3-clause
uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam
html
## Code Before: {% extends "base.html" %} {% block headextra %} <link rel="stylesheet" href="{{STATIC}}datatables/css/jquery.dataTables.css" type="text/css"> {% endblock headextra %} {% block body %} <div id="search-tool" class="fullwidth"> <p class="conditions-agreement-statement"> By using the UQ Anthropology Museum Online Catalogue you agree to the conditions of the <a href="#">Copyright Statement</a>. </p> {% include "snippets/top_search_panel.html" %} </div> <div id="content-primary" class="fullwidth"> {% block content %} {% endblock %} </div> {% endblock %} ## Instruction: Add javascript for switching between list/grid item view ## Code After: {% extends "base.html" %} {% block headextra %} <link rel="stylesheet" href="{{STATIC}}datatables/css/jquery.dataTables.css" type="text/css"> {% endblock headextra %} {% block body %} <div id="search-tool" class="fullwidth"> <p class="conditions-agreement-statement"> By using the UQ Anthropology Museum Online Catalogue you agree to the conditions of the <a href="#">Copyright Statement</a>. </p> {% include "snippets/top_search_panel.html" %} </div> <div id="content-primary" class="fullwidth"> {% block content %} {% endblock %} </div> {% endblock %} {% block javascript %} <script type="text/javascript"> $(document).ready(function () { $('.grid-list-selector button').click(function (e) { if ($(this).hasClass('grid')) { $('#item-listing-table').hide(); $('#item-listing-grid').show(); } else if ($(this).hasClass('list')) { $('#item-listing-table').show(); $('#item-listing-grid').hide(); } }); }); </script> {% endblock javascript %}
{% extends "base.html" %} {% block headextra %} <link rel="stylesheet" href="{{STATIC}}datatables/css/jquery.dataTables.css" type="text/css"> {% endblock headextra %} {% block body %} <div id="search-tool" class="fullwidth"> <p class="conditions-agreement-statement"> By using the UQ Anthropology Museum Online Catalogue you agree to the conditions of the <a href="#">Copyright Statement</a>. </p> {% include "snippets/top_search_panel.html" %} </div> <div id="content-primary" class="fullwidth"> {% block content %} {% endblock %} </div> {% endblock %} + + + + {% block javascript %} + + <script type="text/javascript"> + $(document).ready(function () { + $('.grid-list-selector button').click(function (e) { + if ($(this).hasClass('grid')) { + $('#item-listing-table').hide(); + $('#item-listing-grid').show(); + } else if ($(this).hasClass('list')) { + $('#item-listing-table').show(); + $('#item-listing-grid').hide(); + } + }); + }); + </script> + {% endblock javascript %}
19
0.703704
19
0
867730d0855a81aa7b72118fc969932c37790cfb
packages/accounts/accounts_server.js
packages/accounts/accounts_server.js
/** * Sets the default permissions to new users */ Meteor.users.after.insert(function (userId, doc) { var userId = doc._id; if (orion.adminExists) { // if there is a admin created we will set the default roles. var defaultRoles = Options.get('defaultRoles'); Roles.addUserToRoles(userId, defaultRoles); } else { // If there is no admin, we will add the admin role to this new user. Roles.addUserToRoles(userId, 'admin'); // Pass to the client if the admin exists orion.adminExists = true; Inject.obj('adminExists', { exists: true }); } }); /** * Pass to the client if there is a admin account */ orion.adminExists = Roles._collection.find({ roles: 'admin' }).count() != 0; Inject.obj('adminExists', { exists: orion.adminExists });
/** * Sets the default permissions to new users */ Meteor.users.after.insert(function (userId, doc) { var userId = doc._id; if (orion.adminExists) { // if there is a admin created we will set the default roles. if (Roles._collection.find({ userId: userId }).count() == 0) { var defaultRoles = Options.get('defaultRoles'); Roles.addUserToRoles(userId, defaultRoles); } } else { // If there is no admin, we will add the admin role to this new user. Roles.addUserToRoles(userId, 'admin'); // Pass to the client if the admin exists orion.adminExists = true; Inject.obj('adminExists', { exists: true }); } }); /** * Pass to the client if there is a admin account */ orion.adminExists = Roles._collection.find({ roles: 'admin' }).count() != 0; Inject.obj('adminExists', { exists: orion.adminExists });
Set default roles only if user has no roles
Set default roles only if user has no roles
JavaScript
mit
kevohagan/orion,BudickDa/orion,justathoughtor2/orion,PEM--/orion,Citronnade/orion,mauricionr/orion,PEM--/orion,nabiltntn/orion,Citronnade/orion,orionjs/orion,BudickDa/orion,kevohagan/orion,jorisroling/orion,mauricionr/orion,justathoughtor2/orion,rwatts3/orion,rwatts3/orion,nabiltntn/orion,orionjs/orion,TedEwanchyna/orion,dgleba/orion,TedEwanchyna/orion,dgleba/orion,jorisroling/orion
javascript
## Code Before: /** * Sets the default permissions to new users */ Meteor.users.after.insert(function (userId, doc) { var userId = doc._id; if (orion.adminExists) { // if there is a admin created we will set the default roles. var defaultRoles = Options.get('defaultRoles'); Roles.addUserToRoles(userId, defaultRoles); } else { // If there is no admin, we will add the admin role to this new user. Roles.addUserToRoles(userId, 'admin'); // Pass to the client if the admin exists orion.adminExists = true; Inject.obj('adminExists', { exists: true }); } }); /** * Pass to the client if there is a admin account */ orion.adminExists = Roles._collection.find({ roles: 'admin' }).count() != 0; Inject.obj('adminExists', { exists: orion.adminExists }); ## Instruction: Set default roles only if user has no roles ## Code After: /** * Sets the default permissions to new users */ Meteor.users.after.insert(function (userId, doc) { var userId = doc._id; if (orion.adminExists) { // if there is a admin created we will set the default roles. if (Roles._collection.find({ userId: userId }).count() == 0) { var defaultRoles = Options.get('defaultRoles'); Roles.addUserToRoles(userId, defaultRoles); } } else { // If there is no admin, we will add the admin role to this new user. Roles.addUserToRoles(userId, 'admin'); // Pass to the client if the admin exists orion.adminExists = true; Inject.obj('adminExists', { exists: true }); } }); /** * Pass to the client if there is a admin account */ orion.adminExists = Roles._collection.find({ roles: 'admin' }).count() != 0; Inject.obj('adminExists', { exists: orion.adminExists });
/** * Sets the default permissions to new users */ Meteor.users.after.insert(function (userId, doc) { var userId = doc._id; if (orion.adminExists) { // if there is a admin created we will set the default roles. + + if (Roles._collection.find({ userId: userId }).count() == 0) { - var defaultRoles = Options.get('defaultRoles'); + var defaultRoles = Options.get('defaultRoles'); ? ++ - Roles.addUserToRoles(userId, defaultRoles); + Roles.addUserToRoles(userId, defaultRoles); ? ++ + } } else { // If there is no admin, we will add the admin role to this new user. Roles.addUserToRoles(userId, 'admin'); // Pass to the client if the admin exists orion.adminExists = true; Inject.obj('adminExists', { exists: true }); } }); /** * Pass to the client if there is a admin account */ orion.adminExists = Roles._collection.find({ roles: 'admin' }).count() != 0; Inject.obj('adminExists', { exists: orion.adminExists });
7
0.28
5
2
ba6c7088285d3fcb5e9d5e30a57eaa57276153ef
specs/components/Form.spec.jsx
specs/components/Form.spec.jsx
import React from "react"; import loremIpsum from "lorem-ipsum"; import Form from "../../src/components/Form"; import Field from "../../src/components/Field"; import TextInput from "../../src/components/TextInput"; describe("Form", function() { this.header(`## Form`); // Markdown. before(() => { function handleSubmit(submitData) { console.log("submitData", submitData); } // Runs when the Suite loads. Use this to host your component-under-test. this.load( <Form onSubmit={handleSubmit}> <Field fieldKey={"firstName"} label={"First Name"} required={true} > <TextInput placeholder={"Fred"} /> </Field> <Field fieldKey={"lastName"} label={"Last Name"} required={true} > <TextInput placeholder={"Jones"} /> </Field> </Form> ).width("100%"); }); /** * Documentation (Markdown) */ this.footer(` ### Form A Form Element #### API - **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted `); });
import React from "react"; import loremIpsum from "lorem-ipsum"; import Form from "../../src/components/Form"; import Field from "../../src/components/Field"; import EmailInput from "../../src/components/EmailInput"; import PasswordInput from "../../src/components/PasswordInput"; describe("Form", function() { this.header(`## Form`); // Markdown. before(() => { function handleSubmit(submitData) { console.log("submitData", submitData); } // Runs when the Suite loads. Use this to host your component-under-test. this.load( <Form onSubmit={handleSubmit}> <Field fieldKey={"email"} label={"Email"} required={true} > <EmailInput placeholder={"test@signal.co"} /> </Field> <Field fieldKey={"password"} label={"Password"} required={true} > <PasswordInput placeholder={"password"} /> </Field> </Form> ).width("100%"); }); /** * Documentation (Markdown) */ this.footer(` ### Form A Form Element #### API - **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted `); });
Use email and password in the form example
Use email and password in the form example
JSX
mit
signal/sprinkles-ui,signal/sprinkles-ui
jsx
## Code Before: import React from "react"; import loremIpsum from "lorem-ipsum"; import Form from "../../src/components/Form"; import Field from "../../src/components/Field"; import TextInput from "../../src/components/TextInput"; describe("Form", function() { this.header(`## Form`); // Markdown. before(() => { function handleSubmit(submitData) { console.log("submitData", submitData); } // Runs when the Suite loads. Use this to host your component-under-test. this.load( <Form onSubmit={handleSubmit}> <Field fieldKey={"firstName"} label={"First Name"} required={true} > <TextInput placeholder={"Fred"} /> </Field> <Field fieldKey={"lastName"} label={"Last Name"} required={true} > <TextInput placeholder={"Jones"} /> </Field> </Form> ).width("100%"); }); /** * Documentation (Markdown) */ this.footer(` ### Form A Form Element #### API - **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted `); }); ## Instruction: Use email and password in the form example ## Code After: import React from "react"; import loremIpsum from "lorem-ipsum"; import Form from "../../src/components/Form"; import Field from "../../src/components/Field"; import EmailInput from "../../src/components/EmailInput"; import PasswordInput from "../../src/components/PasswordInput"; describe("Form", function() { this.header(`## Form`); // Markdown. before(() => { function handleSubmit(submitData) { console.log("submitData", submitData); } // Runs when the Suite loads. Use this to host your component-under-test. this.load( <Form onSubmit={handleSubmit}> <Field fieldKey={"email"} label={"Email"} required={true} > <EmailInput placeholder={"test@signal.co"} /> </Field> <Field fieldKey={"password"} label={"Password"} required={true} > <PasswordInput placeholder={"password"} /> </Field> </Form> ).width("100%"); }); /** * Documentation (Markdown) */ this.footer(` ### Form A Form Element #### API - **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted `); });
import React from "react"; import loremIpsum from "lorem-ipsum"; import Form from "../../src/components/Form"; import Field from "../../src/components/Field"; - import TextInput from "../../src/components/TextInput"; ? ^^^^ ^^^^ + import EmailInput from "../../src/components/EmailInput"; ? ^^^^^ ^^^^^ + import PasswordInput from "../../src/components/PasswordInput"; describe("Form", function() { this.header(`## Form`); // Markdown. before(() => { function handleSubmit(submitData) { console.log("submitData", submitData); } // Runs when the Suite loads. Use this to host your component-under-test. this.load( <Form onSubmit={handleSubmit}> <Field - fieldKey={"firstName"} ? ^ ^^^^^^^ + fieldKey={"email"} ? ^^^ ^ - label={"First Name"} ? ^ ^^^^^^^^ + label={"Email"} ? ^^^ ^ required={true} > - <TextInput placeholder={"Fred"} /> ? ^^^^ ^^ ^ + <EmailInput placeholder={"test@signal.co"} /> ? ^^^^^ ^ ^^^^^^^^^^^^ </Field> <Field - fieldKey={"lastName"} ? ^ ^^^^^ + fieldKey={"password"} ? ^ ^^^^^ - label={"Last Name"} ? ^ ^^^^^^ + label={"Password"} ? ^ ^^^^^ required={true} > - <TextInput placeholder={"Jones"} /> ? ^^^^ ^ ^^^ + <PasswordInput placeholder={"password"} /> ? ^^^^^^^^ ^^^^^ ^^ </Field> </Form> ).width("100%"); }); /** * Documentation (Markdown) */ this.footer(` ### Form A Form Element #### API - **onSubmit** *React.PropTypes.func* (optional) called when Form has been submitted `); });
15
0.3125
8
7
50faa6a2d7b2b457d21806975243fd53816b2fe3
src/java/com/hypirion/beckon/SignalRegistererHelper.java
src/java/com/hypirion/beckon/SignalRegistererHelper.java
package com.hypirion.beckon; import sun.misc.Signal; import sun.misc.SignalHandler; import java.util.List; import java.util.Map; import java.util.HashMap; public class SignalRegistererHelper { private static Map<String, SignalHandler> originalHandlers = new HashMap<String, SignalHandler>(); /** * Registers the new list of functions to the signal name, and returns the * old SignalHandler. */ private static SignalHandler reset_BANG_(String signame, List fns) { Signal sig = new Signal(signame); SignalFolder folder = new SignalFolder(fns); SignalHandler oldHandler = Signal.handle(sig, folder); return oldHandler; } static synchronized void register(String signame, List fns) { SignalHandler old = reset_BANG_(signame, fns); if (!originalHandlers.containsKey(signame)) { originalHandlers.put(signame, old); } } }
package com.hypirion.beckon; import sun.misc.Signal; import sun.misc.SignalHandler; import java.util.List; import java.util.Map; import java.util.HashMap; public class SignalRegistererHelper { /** * A mapping of the signal name to the original signal handler. */ private final static Map<String, SignalHandler> originalHandlers = new HashMap<String, SignalHandler>(); /** * Registers the new list of functions to the signal name, and returns the * old SignalHandler. */ private static SignalHandler reset_BANG_(String signame, List fns) { Signal sig = new Signal(signame); SignalFolder folder = new SignalFolder(fns); SignalHandler oldHandler = Signal.handle(sig, folder); return oldHandler; } /** * Registers the signal name to a List of Callables, where each callable * returns an Object. The signal handling is performed as follows: The first * callable is called, and if it returns a value equal to <code>false</code> * or <code>null</code> it will stop. Otherwise it will repeat on the next * callable, until there are no more left. * * @param signame the signal name to register this list of callables on. * @param fns the list of Callables to (potentially) call. */ static synchronized void register(String signame, List fns) { SignalHandler old = reset_BANG_(signame, fns); if (!originalHandlers.containsKey(signame)) { originalHandlers.put(signame, old); } } }
Document and synchronize register method.
Document and synchronize register method.
Java
epl-1.0
hyPiRion/beckon
java
## Code Before: package com.hypirion.beckon; import sun.misc.Signal; import sun.misc.SignalHandler; import java.util.List; import java.util.Map; import java.util.HashMap; public class SignalRegistererHelper { private static Map<String, SignalHandler> originalHandlers = new HashMap<String, SignalHandler>(); /** * Registers the new list of functions to the signal name, and returns the * old SignalHandler. */ private static SignalHandler reset_BANG_(String signame, List fns) { Signal sig = new Signal(signame); SignalFolder folder = new SignalFolder(fns); SignalHandler oldHandler = Signal.handle(sig, folder); return oldHandler; } static synchronized void register(String signame, List fns) { SignalHandler old = reset_BANG_(signame, fns); if (!originalHandlers.containsKey(signame)) { originalHandlers.put(signame, old); } } } ## Instruction: Document and synchronize register method. ## Code After: package com.hypirion.beckon; import sun.misc.Signal; import sun.misc.SignalHandler; import java.util.List; import java.util.Map; import java.util.HashMap; public class SignalRegistererHelper { /** * A mapping of the signal name to the original signal handler. */ private final static Map<String, SignalHandler> originalHandlers = new HashMap<String, SignalHandler>(); /** * Registers the new list of functions to the signal name, and returns the * old SignalHandler. */ private static SignalHandler reset_BANG_(String signame, List fns) { Signal sig = new Signal(signame); SignalFolder folder = new SignalFolder(fns); SignalHandler oldHandler = Signal.handle(sig, folder); return oldHandler; } /** * Registers the signal name to a List of Callables, where each callable * returns an Object. The signal handling is performed as follows: The first * callable is called, and if it returns a value equal to <code>false</code> * or <code>null</code> it will stop. Otherwise it will repeat on the next * callable, until there are no more left. * * @param signame the signal name to register this list of callables on. * @param fns the list of Callables to (potentially) call. */ static synchronized void register(String signame, List fns) { SignalHandler old = reset_BANG_(signame, fns); if (!originalHandlers.containsKey(signame)) { originalHandlers.put(signame, old); } } }
package com.hypirion.beckon; import sun.misc.Signal; import sun.misc.SignalHandler; import java.util.List; import java.util.Map; import java.util.HashMap; public class SignalRegistererHelper { + /** + * A mapping of the signal name to the original signal handler. + */ - private static Map<String, SignalHandler> originalHandlers = + private final static Map<String, SignalHandler> originalHandlers = ? ++++++ new HashMap<String, SignalHandler>(); /** * Registers the new list of functions to the signal name, and returns the * old SignalHandler. */ private static SignalHandler reset_BANG_(String signame, List fns) { Signal sig = new Signal(signame); SignalFolder folder = new SignalFolder(fns); SignalHandler oldHandler = Signal.handle(sig, folder); return oldHandler; } + /** + * Registers the signal name to a List of Callables, where each callable + * returns an Object. The signal handling is performed as follows: The first + * callable is called, and if it returns a value equal to <code>false</code> + * or <code>null</code> it will stop. Otherwise it will repeat on the next + * callable, until there are no more left. + * + * @param signame the signal name to register this list of callables on. + * @param fns the list of Callables to (potentially) call. + */ static synchronized void register(String signame, List fns) { SignalHandler old = reset_BANG_(signame, fns); if (!originalHandlers.containsKey(signame)) { originalHandlers.put(signame, old); } } }
15
0.46875
14
1
2b59809e67a1f84e77f4135e429211d847c1f3fb
spec/spec_helper.rb
spec/spec_helper.rb
require 'rubygems' require 'webrick' require 'net/http' require 'bundler' Bundler.require(:default, :development) module OpsHelper VENDOR_BASE = File.expand_path('./vendor/', File.dirname(__FILE__)) PORT = 5678 class << self def assert_has_phantomjs raise 'Could not locate phantomjs binary!' unless system('which phantomjs') end def start_server fork do server = WEBrick::HTTPServer.new(:Port => PORT, :DocumentRoot => VENDOR_BASE) %w{INT TERM}.each do |signal| trap(signal) { server.shutdown } end server.start end end def ensure_server_started could_connect = false uri = URI("http://localhost:#{PORT}/") i = 0 max = 20 while i < max do begin res = Net::HTTP.get_response(uri) could_connect = true break rescue Errno::ECONNREFUSED sleep 1 end i += 1 end raise "Could not ever connect to server" unless could_connect end end end RSpec.configure do |config| config.before(:all) do OpsHelper::assert_has_phantomjs server_pid = OpsHelper::start_server at_exit do Process.kill('TERM', server_pid) end OpsHelper::ensure_server_started end end shared_examples_for 'correct failures' do it 'fails when no url is given' do %x{phantomjs #{script}} $?.exitstatus.should == 1 end end
require 'rubygems' require 'webrick' require 'net/http' require 'bundler' Bundler.require(:default, :development) module OpsHelper VENDOR_BASE = File.expand_path('./vendor/', File.dirname(__FILE__)) PORT = 5678 class << self def start_server_once return if @started @started = true assert_has_phantomjs start_server ensure_server_started end def assert_has_phantomjs raise 'Could not locate phantomjs binary!' unless system('which phantomjs') end def start_server fork do server = WEBrick::HTTPServer.new(:Port => PORT, :DocumentRoot => VENDOR_BASE) %w{INT TERM}.each do |signal| trap(signal) { server.shutdown } end server.start end end def ensure_server_started could_connect = false uri = URI("http://localhost:#{PORT}/") i = 0 max = 20 while i < max do begin res = Net::HTTP.get_response(uri) could_connect = true break rescue Errno::ECONNREFUSED sleep 1 end i += 1 end raise "Could not ever connect to server" unless could_connect end end end OpsHelper::start_server_once shared_examples_for 'correct failures' do it 'fails when no url is given' do %x{phantomjs #{script}} $?.exitstatus.should == 1 end end
Move starting server outside before(:all)
Move starting server outside before(:all)
Ruby
mit
mark-rushakoff/OpenPhantomScripts,mark-rushakoff/OpenPhantomScripts
ruby
## Code Before: require 'rubygems' require 'webrick' require 'net/http' require 'bundler' Bundler.require(:default, :development) module OpsHelper VENDOR_BASE = File.expand_path('./vendor/', File.dirname(__FILE__)) PORT = 5678 class << self def assert_has_phantomjs raise 'Could not locate phantomjs binary!' unless system('which phantomjs') end def start_server fork do server = WEBrick::HTTPServer.new(:Port => PORT, :DocumentRoot => VENDOR_BASE) %w{INT TERM}.each do |signal| trap(signal) { server.shutdown } end server.start end end def ensure_server_started could_connect = false uri = URI("http://localhost:#{PORT}/") i = 0 max = 20 while i < max do begin res = Net::HTTP.get_response(uri) could_connect = true break rescue Errno::ECONNREFUSED sleep 1 end i += 1 end raise "Could not ever connect to server" unless could_connect end end end RSpec.configure do |config| config.before(:all) do OpsHelper::assert_has_phantomjs server_pid = OpsHelper::start_server at_exit do Process.kill('TERM', server_pid) end OpsHelper::ensure_server_started end end shared_examples_for 'correct failures' do it 'fails when no url is given' do %x{phantomjs #{script}} $?.exitstatus.should == 1 end end ## Instruction: Move starting server outside before(:all) ## Code After: require 'rubygems' require 'webrick' require 'net/http' require 'bundler' Bundler.require(:default, :development) module OpsHelper VENDOR_BASE = File.expand_path('./vendor/', File.dirname(__FILE__)) PORT = 5678 class << self def start_server_once return if @started @started = true assert_has_phantomjs start_server ensure_server_started end def assert_has_phantomjs raise 'Could not locate phantomjs binary!' unless system('which phantomjs') end def start_server fork do server = WEBrick::HTTPServer.new(:Port => PORT, :DocumentRoot => VENDOR_BASE) %w{INT TERM}.each do |signal| trap(signal) { server.shutdown } end server.start end end def ensure_server_started could_connect = false uri = URI("http://localhost:#{PORT}/") i = 0 max = 20 while i < max do begin res = Net::HTTP.get_response(uri) could_connect = true break rescue Errno::ECONNREFUSED sleep 1 end i += 1 end raise "Could not ever connect to server" unless could_connect end end end OpsHelper::start_server_once shared_examples_for 'correct failures' do it 'fails when no url is given' do %x{phantomjs #{script}} $?.exitstatus.should == 1 end end
require 'rubygems' require 'webrick' require 'net/http' require 'bundler' Bundler.require(:default, :development) module OpsHelper VENDOR_BASE = File.expand_path('./vendor/', File.dirname(__FILE__)) PORT = 5678 class << self + def start_server_once + return if @started + @started = true + assert_has_phantomjs + start_server + ensure_server_started + end + def assert_has_phantomjs raise 'Could not locate phantomjs binary!' unless system('which phantomjs') end def start_server fork do server = WEBrick::HTTPServer.new(:Port => PORT, :DocumentRoot => VENDOR_BASE) %w{INT TERM}.each do |signal| trap(signal) { server.shutdown } end server.start end end def ensure_server_started could_connect = false uri = URI("http://localhost:#{PORT}/") i = 0 max = 20 while i < max do begin res = Net::HTTP.get_response(uri) could_connect = true break rescue Errno::ECONNREFUSED sleep 1 end i += 1 end raise "Could not ever connect to server" unless could_connect end end end + OpsHelper::start_server_once - RSpec.configure do |config| - config.before(:all) do - OpsHelper::assert_has_phantomjs - server_pid = OpsHelper::start_server - at_exit do - Process.kill('TERM', server_pid) - end - OpsHelper::ensure_server_started - end - end shared_examples_for 'correct failures' do it 'fails when no url is given' do %x{phantomjs #{script}} $?.exitstatus.should == 1 end end
19
0.296875
9
10
a610faf9d64c062ed2dd44a818acc0d12d1f6e0b
django_evolution/compat/picklers.py
django_evolution/compat/picklers.py
"""Picklers for working with serialized data.""" from __future__ import unicode_literals import pickle class DjangoCompatUnpickler(pickle.Unpickler): """Unpickler compatible with changes to Django class/module paths. This provides compatibility across Django versions for various field types, updating referenced module paths for fields to a standard location so that the fields can be located on all Django versions. """ def find_class(self, module, name): """Return the class for a given module and class name. If looking up a class from ``django.db.models.fields``, the class will instead be looked up from ``django.db.models``, fixing lookups on some Django versions. Args: module (unicode): The module path. name (unicode): The class name. Returns: type: The resulting class. Raises: AttributeError: The class could not be found in the module. """ if module == 'django.db.models.fields': module = 'django.db.models' return super(DjangoCompatUnpickler, self).find_class(module, name)
"""Picklers for working with serialized data.""" from __future__ import unicode_literals import pickle from django_evolution.compat.datastructures import OrderedDict class SortedDict(dict): """Compatibility for unpickling a SortedDict. Old signatures may use an old Django ``SortedDict`` structure, which does not exist in modern versions. This changes any construction of this data structure into a :py:class:`collections.OrderedDict`. """ def __new__(cls, *args, **kwargs): """Construct an instance of the class. Args: *args (tuple): Positional arguments to pass to the constructor. **kwargs (dict): Keyword arguments to pass to the constructor. Returns: collections.OrderedDict: The new instance. """ return OrderedDict.__new__(cls, *args, **kwargs) class DjangoCompatUnpickler(pickle._Unpickler): """Unpickler compatible with changes to Django class/module paths. This provides compatibility across Django versions for various field types, updating referenced module paths for fields to a standard location so that the fields can be located on all Django versions. """ def find_class(self, module, name): """Return the class for a given module and class name. If looking up a class from ``django.db.models.fields``, the class will instead be looked up from ``django.db.models``, fixing lookups on some Django versions. Args: module (unicode): The module path. name (unicode): The class name. Returns: type: The resulting class. Raises: AttributeError: The class could not be found in the module. """ if module == 'django.utils.datastructures' and name == 'SortedDict': return SortedDict elif module == 'django.db.models.fields': module = 'django.db.models' return super(DjangoCompatUnpickler, self).find_class(module, name)
Support loading pickled data referencing SortedDict.
Support loading pickled data referencing SortedDict. Django used to provide a class called `SortedDict`, which has long been deprecated in favor of Python's own `OrderedDict`. However, due to the way that pickling works, older signatures would still attempt to loading a `SortedDict` class. This change adds a compatibility mechanism for this. Upon finding an attempt to load a `SortedDict`, we instead give it a forwarding object that's compatible with the unpickle code that constructs a new `OrderedDict`. It's a bit hacky, in that we need to have this class that subclasses `dict`, overrides `__new__`, and then returns an entirely different object, but it's a necessity for the compatibility. Testing Done: Successfully loaded an older signature on Python 3.7/Django 1.11. Reviewed at https://reviews.reviewboard.org/r/10557/
Python
bsd-3-clause
beanbaginc/django-evolution
python
## Code Before: """Picklers for working with serialized data.""" from __future__ import unicode_literals import pickle class DjangoCompatUnpickler(pickle.Unpickler): """Unpickler compatible with changes to Django class/module paths. This provides compatibility across Django versions for various field types, updating referenced module paths for fields to a standard location so that the fields can be located on all Django versions. """ def find_class(self, module, name): """Return the class for a given module and class name. If looking up a class from ``django.db.models.fields``, the class will instead be looked up from ``django.db.models``, fixing lookups on some Django versions. Args: module (unicode): The module path. name (unicode): The class name. Returns: type: The resulting class. Raises: AttributeError: The class could not be found in the module. """ if module == 'django.db.models.fields': module = 'django.db.models' return super(DjangoCompatUnpickler, self).find_class(module, name) ## Instruction: Support loading pickled data referencing SortedDict. Django used to provide a class called `SortedDict`, which has long been deprecated in favor of Python's own `OrderedDict`. However, due to the way that pickling works, older signatures would still attempt to loading a `SortedDict` class. This change adds a compatibility mechanism for this. Upon finding an attempt to load a `SortedDict`, we instead give it a forwarding object that's compatible with the unpickle code that constructs a new `OrderedDict`. It's a bit hacky, in that we need to have this class that subclasses `dict`, overrides `__new__`, and then returns an entirely different object, but it's a necessity for the compatibility. Testing Done: Successfully loaded an older signature on Python 3.7/Django 1.11. Reviewed at https://reviews.reviewboard.org/r/10557/ ## Code After: """Picklers for working with serialized data.""" from __future__ import unicode_literals import pickle from django_evolution.compat.datastructures import OrderedDict class SortedDict(dict): """Compatibility for unpickling a SortedDict. Old signatures may use an old Django ``SortedDict`` structure, which does not exist in modern versions. This changes any construction of this data structure into a :py:class:`collections.OrderedDict`. """ def __new__(cls, *args, **kwargs): """Construct an instance of the class. Args: *args (tuple): Positional arguments to pass to the constructor. **kwargs (dict): Keyword arguments to pass to the constructor. Returns: collections.OrderedDict: The new instance. """ return OrderedDict.__new__(cls, *args, **kwargs) class DjangoCompatUnpickler(pickle._Unpickler): """Unpickler compatible with changes to Django class/module paths. This provides compatibility across Django versions for various field types, updating referenced module paths for fields to a standard location so that the fields can be located on all Django versions. """ def find_class(self, module, name): """Return the class for a given module and class name. If looking up a class from ``django.db.models.fields``, the class will instead be looked up from ``django.db.models``, fixing lookups on some Django versions. Args: module (unicode): The module path. name (unicode): The class name. Returns: type: The resulting class. Raises: AttributeError: The class could not be found in the module. """ if module == 'django.utils.datastructures' and name == 'SortedDict': return SortedDict elif module == 'django.db.models.fields': module = 'django.db.models' return super(DjangoCompatUnpickler, self).find_class(module, name)
"""Picklers for working with serialized data.""" from __future__ import unicode_literals import pickle + from django_evolution.compat.datastructures import OrderedDict + + class SortedDict(dict): + """Compatibility for unpickling a SortedDict. + + Old signatures may use an old Django ``SortedDict`` structure, which does + not exist in modern versions. This changes any construction of this + data structure into a :py:class:`collections.OrderedDict`. + """ + + def __new__(cls, *args, **kwargs): + """Construct an instance of the class. + + Args: + *args (tuple): + Positional arguments to pass to the constructor. + + **kwargs (dict): + Keyword arguments to pass to the constructor. + + Returns: + collections.OrderedDict: + The new instance. + """ + return OrderedDict.__new__(cls, *args, **kwargs) + + - class DjangoCompatUnpickler(pickle.Unpickler): + class DjangoCompatUnpickler(pickle._Unpickler): ? + """Unpickler compatible with changes to Django class/module paths. This provides compatibility across Django versions for various field types, updating referenced module paths for fields to a standard location so that the fields can be located on all Django versions. """ def find_class(self, module, name): """Return the class for a given module and class name. If looking up a class from ``django.db.models.fields``, the class will instead be looked up from ``django.db.models``, fixing lookups on some Django versions. Args: module (unicode): The module path. name (unicode): The class name. Returns: type: The resulting class. Raises: AttributeError: The class could not be found in the module. """ + if module == 'django.utils.datastructures' and name == 'SortedDict': + return SortedDict - if module == 'django.db.models.fields': + elif module == 'django.db.models.fields': ? ++ module = 'django.db.models' return super(DjangoCompatUnpickler, self).find_class(module, name)
33
0.804878
31
2
cc9e2f63ebb22fecf497a5feade1dc0b5d6d245a
client/html/templates/welcome.html
client/html/templates/welcome.html
<template name="welcome"> {{#unless showing_post}} <div class="row"> <div class="span8 offset2 well"> </div> </div> {{/unless}} </template>
<template name="welcome"> {{#unless showing_post}} <div class="row"> <div class="span8 offset2 well"> <h1>Welcome to Socrenchus!</h1> <div class="row"> <div class="span4"> <h2>There's no front page yet,</h2> <p>but you can still access any post if you have a link to it.</p> <p>Submit a root post, or join an existing conversation!</p> <p class="footer">(c) 2012 Socrenchus LLC - Find us on <a href="https://www.facebook.com/socrenchus">Facebook</a>!</p> </div> </div> </div> </div> {{/unless}} </template>
Put up a rudimentary Welcome page.
Put up a rudimentary Welcome page. It's just a start.
HTML
mit
Socrenchus/Socrenchus,Socrenchus/Socrenchus
html
## Code Before: <template name="welcome"> {{#unless showing_post}} <div class="row"> <div class="span8 offset2 well"> </div> </div> {{/unless}} </template> ## Instruction: Put up a rudimentary Welcome page. It's just a start. ## Code After: <template name="welcome"> {{#unless showing_post}} <div class="row"> <div class="span8 offset2 well"> <h1>Welcome to Socrenchus!</h1> <div class="row"> <div class="span4"> <h2>There's no front page yet,</h2> <p>but you can still access any post if you have a link to it.</p> <p>Submit a root post, or join an existing conversation!</p> <p class="footer">(c) 2012 Socrenchus LLC - Find us on <a href="https://www.facebook.com/socrenchus">Facebook</a>!</p> </div> </div> </div> </div> {{/unless}} </template>
<template name="welcome"> {{#unless showing_post}} <div class="row"> <div class="span8 offset2 well"> - + <h1>Welcome to Socrenchus!</h1> + <div class="row"> + <div class="span4"> + <h2>There's no front page yet,</h2> + <p>but you can still access any post if you have a link to it.</p> + <p>Submit a root post, or join an existing conversation!</p> + <p class="footer">(c) 2012 Socrenchus LLC - Find us on <a href="https://www.facebook.com/socrenchus">Facebook</a>!</p> + </div> + </div> </div> </div> {{/unless}} </template>
10
1.111111
9
1
af877e9bca1324a4d8c4cc9e44806de573c7eab3
Vpc/Directories/Item/Directory/Trl/Controller.php
Vpc/Directories/Item/Directory/Trl/Controller.php
<?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); protected $_paging = 25; public function preDispatch() { $this->setModel(new Vpc_Directories_Item_Directory_Trl_AdminModel(array( 'proxyModel' => Vpc_Abstract::createChildModel( Vpc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass') ), 'trlModel' => Vpc_Abstract::createChildModel($this->_getParam('class')), ))); parent::preDispatch(); $url = Vpc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form'); $this->_editDialog['controllerUrl'] = $url; } protected function _initColumns() { parent::_initColumns(); $this->_columns->add(new Vps_Grid_Column('id')); } protected function _getRowById($id) { if (!$id) return null; $s = new Vps_Model_Select(); $s->whereEquals($this->_model->getPrimaryKey(), $id); $s->whereEquals('component_id', $this->_getParam('componentId')); return $this->_model->getRow($s); } }
<?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); protected $_hasComponentId = false; //component_id nicht speichern protected $_paging = 25; public function preDispatch() { $this->setModel(new Vpc_Directories_Item_Directory_Trl_AdminModel(array( 'proxyModel' => Vpc_Abstract::createChildModel( Vpc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass') ), 'trlModel' => Vpc_Abstract::createChildModel($this->_getParam('class')), ))); parent::preDispatch(); $url = Vpc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form'); $this->_editDialog['controllerUrl'] = $url; } protected function _initColumns() { parent::_initColumns(); $this->_columns->add(new Vps_Grid_Column('id')); } protected function _getSelect() { $ret = parent::_getSelect(); $ret->whereEquals('component_id', $this->_getParam('componentId')); return $ret; } protected function _getRowById($id) { if (!$id) return null; $s = new Vps_Model_Select(); $s->whereEquals($this->_model->getPrimaryKey(), $id); $s->whereEquals('component_id', $this->_getParam('componentId')); return $this->_model->getRow($s); } }
Fix trl controller fuer directories
Fix trl controller fuer directories
PHP
bsd-2-clause
fraxachun/koala-framework,yacon/koala-framework,koala-framework/koala-framework,nsams/koala-framework,koala-framework/koala-framework,Ben-Ho/koala-framework,yacon/koala-framework,kaufmo/koala-framework,Sogl/koala-framework,kaufmo/koala-framework,fraxachun/koala-framework,darimpulso/koala-framework,Sogl/koala-framework,nsams/koala-framework,yacon/koala-framework,nsams/koala-framework,kaufmo/koala-framework,darimpulso/koala-framework,Ben-Ho/koala-framework
php
## Code Before: <?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); protected $_paging = 25; public function preDispatch() { $this->setModel(new Vpc_Directories_Item_Directory_Trl_AdminModel(array( 'proxyModel' => Vpc_Abstract::createChildModel( Vpc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass') ), 'trlModel' => Vpc_Abstract::createChildModel($this->_getParam('class')), ))); parent::preDispatch(); $url = Vpc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form'); $this->_editDialog['controllerUrl'] = $url; } protected function _initColumns() { parent::_initColumns(); $this->_columns->add(new Vps_Grid_Column('id')); } protected function _getRowById($id) { if (!$id) return null; $s = new Vps_Model_Select(); $s->whereEquals($this->_model->getPrimaryKey(), $id); $s->whereEquals('component_id', $this->_getParam('componentId')); return $this->_model->getRow($s); } } ## Instruction: Fix trl controller fuer directories ## Code After: <?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); protected $_hasComponentId = false; //component_id nicht speichern protected $_paging = 25; public function preDispatch() { $this->setModel(new Vpc_Directories_Item_Directory_Trl_AdminModel(array( 'proxyModel' => Vpc_Abstract::createChildModel( Vpc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass') ), 'trlModel' => Vpc_Abstract::createChildModel($this->_getParam('class')), ))); parent::preDispatch(); $url = Vpc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form'); $this->_editDialog['controllerUrl'] = $url; } protected function _initColumns() { parent::_initColumns(); $this->_columns->add(new Vps_Grid_Column('id')); } protected function _getSelect() { $ret = parent::_getSelect(); $ret->whereEquals('component_id', $this->_getParam('componentId')); return $ret; } protected function _getRowById($id) { if (!$id) return null; $s = new Vps_Model_Select(); $s->whereEquals($this->_model->getPrimaryKey(), $id); $s->whereEquals('component_id', $this->_getParam('componentId')); return $this->_model->getRow($s); } }
<?php class Vpc_Directories_Item_Directory_Trl_Controller extends Vps_Controller_Action_Auto_Vpc_Grid { protected $_buttons = array( 'save', 'reload', ); protected $_editDialog = array( 'width' => 500, 'height' => 400 ); + protected $_hasComponentId = false; //component_id nicht speichern protected $_paging = 25; public function preDispatch() { $this->setModel(new Vpc_Directories_Item_Directory_Trl_AdminModel(array( 'proxyModel' => Vpc_Abstract::createChildModel( Vpc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass') ), 'trlModel' => Vpc_Abstract::createChildModel($this->_getParam('class')), ))); parent::preDispatch(); $url = Vpc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form'); $this->_editDialog['controllerUrl'] = $url; } protected function _initColumns() { parent::_initColumns(); $this->_columns->add(new Vps_Grid_Column('id')); } + protected function _getSelect() + { + $ret = parent::_getSelect(); + $ret->whereEquals('component_id', $this->_getParam('componentId')); + return $ret; + } + protected function _getRowById($id) { if (!$id) return null; $s = new Vps_Model_Select(); $s->whereEquals($this->_model->getPrimaryKey(), $id); $s->whereEquals('component_id', $this->_getParam('componentId')); return $this->_model->getRow($s); } }
8
0.186047
8
0
842a64a60c275072a487ae221b49b4c0fac41907
RuM_Workspace/src/ee/ut/cs/rum/workspaces/internal/ui/task/newtask/dialog/NewTaskDialogShell.java
RuM_Workspace/src/ee/ut/cs/rum/workspaces/internal/ui/task/newtask/dialog/NewTaskDialogShell.java
package ee.ut.cs.rum.workspaces.internal.ui.task.newtask.dialog; import org.eclipse.swt.widgets.Shell; import ee.ut.cs.rum.plugins.interfaces.factory.RumPluginConfiguration; public class NewTaskDialogShell extends Shell { private static final long serialVersionUID = -4970825745896119968L; NewTaskDialog newTaskDialog; private RumPluginConfiguration rumPluginConfiguration; public NewTaskDialogShell(Shell parent, int style, NewTaskDialog newTaskDialog) { super(parent, style); this.newTaskDialog=newTaskDialog; } public RumPluginConfiguration getRumPluginConfiguration() { return rumPluginConfiguration; } public void setRumPluginConfiguration(RumPluginConfiguration rumPluginConfiguration) { this.rumPluginConfiguration = rumPluginConfiguration; } public NewTaskDialog getNewTaskDialog() { return newTaskDialog; } }
package ee.ut.cs.rum.workspaces.internal.ui.task.newtask.dialog; import org.eclipse.swt.widgets.Shell; import ee.ut.cs.rum.plugins.interfaces.factory.RumPluginConfiguration; public class NewTaskDialogShell extends Shell { private static final long serialVersionUID = -4970825745896119968L; NewTaskDialog newTaskDialog; private RumPluginConfiguration rumPluginConfiguration; public NewTaskDialogShell(Shell parent, int style, NewTaskDialog newTaskDialog) { super(parent, style); this.newTaskDialog=newTaskDialog; } public RumPluginConfiguration getRumPluginConfiguration() { return rumPluginConfiguration; } public void setRumPluginConfiguration(RumPluginConfiguration rumPluginConfiguration) { this.pack(); this.rumPluginConfiguration = rumPluginConfiguration; } public NewTaskDialog getNewTaskDialog() { return newTaskDialog; } }
Update new task dialog size after selecting a plugin
Update new task dialog size after selecting a plugin
Java
agpl-3.0
FableBlaze/RuM,FableBlaze/RuM
java
## Code Before: package ee.ut.cs.rum.workspaces.internal.ui.task.newtask.dialog; import org.eclipse.swt.widgets.Shell; import ee.ut.cs.rum.plugins.interfaces.factory.RumPluginConfiguration; public class NewTaskDialogShell extends Shell { private static final long serialVersionUID = -4970825745896119968L; NewTaskDialog newTaskDialog; private RumPluginConfiguration rumPluginConfiguration; public NewTaskDialogShell(Shell parent, int style, NewTaskDialog newTaskDialog) { super(parent, style); this.newTaskDialog=newTaskDialog; } public RumPluginConfiguration getRumPluginConfiguration() { return rumPluginConfiguration; } public void setRumPluginConfiguration(RumPluginConfiguration rumPluginConfiguration) { this.rumPluginConfiguration = rumPluginConfiguration; } public NewTaskDialog getNewTaskDialog() { return newTaskDialog; } } ## Instruction: Update new task dialog size after selecting a plugin ## Code After: package ee.ut.cs.rum.workspaces.internal.ui.task.newtask.dialog; import org.eclipse.swt.widgets.Shell; import ee.ut.cs.rum.plugins.interfaces.factory.RumPluginConfiguration; public class NewTaskDialogShell extends Shell { private static final long serialVersionUID = -4970825745896119968L; NewTaskDialog newTaskDialog; private RumPluginConfiguration rumPluginConfiguration; public NewTaskDialogShell(Shell parent, int style, NewTaskDialog newTaskDialog) { super(parent, style); this.newTaskDialog=newTaskDialog; } public RumPluginConfiguration getRumPluginConfiguration() { return rumPluginConfiguration; } public void setRumPluginConfiguration(RumPluginConfiguration rumPluginConfiguration) { this.pack(); this.rumPluginConfiguration = rumPluginConfiguration; } public NewTaskDialog getNewTaskDialog() { return newTaskDialog; } }
package ee.ut.cs.rum.workspaces.internal.ui.task.newtask.dialog; import org.eclipse.swt.widgets.Shell; import ee.ut.cs.rum.plugins.interfaces.factory.RumPluginConfiguration; public class NewTaskDialogShell extends Shell { private static final long serialVersionUID = -4970825745896119968L; NewTaskDialog newTaskDialog; private RumPluginConfiguration rumPluginConfiguration; public NewTaskDialogShell(Shell parent, int style, NewTaskDialog newTaskDialog) { super(parent, style); this.newTaskDialog=newTaskDialog; } public RumPluginConfiguration getRumPluginConfiguration() { return rumPluginConfiguration; } public void setRumPluginConfiguration(RumPluginConfiguration rumPluginConfiguration) { + this.pack(); this.rumPluginConfiguration = rumPluginConfiguration; } public NewTaskDialog getNewTaskDialog() { return newTaskDialog; } }
1
0.033333
1
0
fabcbbd7409b4ffac0254c78a6f6ec286f6dbeb3
ext/sha3/extconf.rb
ext/sha3/extconf.rb
require 'mkmf' FileUtils.rm "#{$srcdir}/KeccakF-1600-opt.c", :force => true case 1.size when 4 # x86 32bit optimized code FileUtils.cp "#{$srcdir}/KeccakF-1600-opt32.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" when 8 # x86 64bit optimized code FileUtils.cp "#{$srcdir}/KeccakF-1600-opt64.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" else # Ha? Use reference code -- slow FileUtils.cp "#{$srcdir}/KeccakF-1600-reference.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" end find_header("KeccakF-1600-interface.h") find_header("KeccakSponge.h") find_header("KeccakNISTInterface.h") find_header("sha3.h") find_header("digest.h") $CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=nocona ' create_makefile 'sha3_n'
require 'mkmf' require 'rbconfig' FileUtils.rm "#{$srcdir}/KeccakF-1600-opt.c", :force => true build_cpu = RbConfig::CONFIG['build_cpu'] if 1.size == 4 and build_cpu =~ /i386|x86_32/ # x86 32bit optimized code Logging::message "=== Using i386 optimized Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-opt32.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" elsif 1.size == 8 and build_cpu =~ /i686|x86_64/ Logging::message "=== Using i686 optimized Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-opt64.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" else # Ha? Use reference code -- slow Logging::message "=== Using reference Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-reference.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" end find_header("KeccakF-1600-interface.h") find_header("KeccakSponge.h") find_header("KeccakNISTInterface.h") find_header("sha3.h") find_header("digest.h") $CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=nocona ' create_makefile 'sha3_n'
Use x86 optimized code only when compiling on a x86 CPU. - Resolves compilation errors on ARM based processor (defaults to reference code).
FIX: Use x86 optimized code only when compiling on a x86 CPU. - Resolves compilation errors on ARM based processor (defaults to reference code).
Ruby
mit
johanns/sha3,johanns/sha3,johanns/sha3,johanns/sha3
ruby
## Code Before: require 'mkmf' FileUtils.rm "#{$srcdir}/KeccakF-1600-opt.c", :force => true case 1.size when 4 # x86 32bit optimized code FileUtils.cp "#{$srcdir}/KeccakF-1600-opt32.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" when 8 # x86 64bit optimized code FileUtils.cp "#{$srcdir}/KeccakF-1600-opt64.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" else # Ha? Use reference code -- slow FileUtils.cp "#{$srcdir}/KeccakF-1600-reference.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" end find_header("KeccakF-1600-interface.h") find_header("KeccakSponge.h") find_header("KeccakNISTInterface.h") find_header("sha3.h") find_header("digest.h") $CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=nocona ' create_makefile 'sha3_n' ## Instruction: FIX: Use x86 optimized code only when compiling on a x86 CPU. - Resolves compilation errors on ARM based processor (defaults to reference code). ## Code After: require 'mkmf' require 'rbconfig' FileUtils.rm "#{$srcdir}/KeccakF-1600-opt.c", :force => true build_cpu = RbConfig::CONFIG['build_cpu'] if 1.size == 4 and build_cpu =~ /i386|x86_32/ # x86 32bit optimized code Logging::message "=== Using i386 optimized Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-opt32.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" elsif 1.size == 8 and build_cpu =~ /i686|x86_64/ Logging::message "=== Using i686 optimized Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-opt64.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" else # Ha? Use reference code -- slow Logging::message "=== Using reference Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-reference.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" end find_header("KeccakF-1600-interface.h") find_header("KeccakSponge.h") find_header("KeccakNISTInterface.h") find_header("sha3.h") find_header("digest.h") $CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=nocona ' create_makefile 'sha3_n'
require 'mkmf' + require 'rbconfig' FileUtils.rm "#{$srcdir}/KeccakF-1600-opt.c", :force => true - case 1.size - when 4 # x86 32bit optimized code + build_cpu = RbConfig::CONFIG['build_cpu'] + + if 1.size == 4 and build_cpu =~ /i386|x86_32/ # x86 32bit optimized code + Logging::message "=== Using i386 optimized Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-opt32.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" - when 8 # x86 64bit optimized code + elsif 1.size == 8 and build_cpu =~ /i686|x86_64/ + Logging::message "=== Using i686 optimized Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-opt64.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" else # Ha? Use reference code -- slow + Logging::message "=== Using reference Keccak code ===\n" FileUtils.cp "#{$srcdir}/KeccakF-1600-reference.c-arch", "#{$srcdir}/KeccakF-1600-opt.c" end find_header("KeccakF-1600-interface.h") find_header("KeccakSponge.h") find_header("KeccakNISTInterface.h") find_header("sha3.h") find_header("digest.h") $CFLAGS = ' -fomit-frame-pointer -O3 -g0 -march=nocona ' create_makefile 'sha3_n' -
12
0.545455
8
4
86eac8b3f0ab35a714600e42c58993ae334faf55
spotify-to-mp3.gemspec
spotify-to-mp3.gemspec
Gem::Specification.new do |gem| gem.name = 'spotify-to-mp3' gem.summary = 'Spotify to MP3' gem.description = 'Download MP3 files of your Spotify tracks from Grooveshark' gem.version = '0.7.1' gem.author = 'Francesc Rosàs' gem.email = 'francescrosasbosque@gmail.com' gem.homepage = 'https://github.com/frosas/spotify-to-mp3' gem.license = 'MIT' gem.add_runtime_dependency 'rspotify', '~> 1.11.0' gem.add_runtime_dependency 'grooveshark', '~> 0.2.12' gem.add_runtime_dependency 'colorize', '~> 0.7.5' gem.add_runtime_dependency 'ruby-progressbar', '~> 1.7.1' gem.add_development_dependency 'rspec', '~> 2.14.1' gem.files = `git ls-files`.split("\n") gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.require_paths = ['lib'] end
Gem::Specification.new do |gem| gem.name = 'spotify-to-mp3' gem.summary = 'Spotify to MP3' gem.description = 'Download MP3 files of your Spotify tracks from Grooveshark' gem.version = '0.7.1' gem.author = 'Francesc Rosàs' gem.email = 'francescrosasbosque@gmail.com' gem.homepage = 'https://github.com/frosas/spotify-to-mp3' gem.license = 'MIT' gem.add_runtime_dependency 'rspotify', '~> 1.11', '>= 1.11.0' gem.add_runtime_dependency 'grooveshark', '~> 0.2.12' gem.add_runtime_dependency 'colorize', '~> 0.7.5' gem.add_runtime_dependency 'ruby-progressbar', '~> 1.7', '>= 1.7.1' gem.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1' gem.files = `git ls-files`.split("\n") gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.require_paths = ['lib'] end
Fix "pessimistic dependency on ..." warnings
Fix "pessimistic dependency on ..." warnings
Ruby
mit
Morl99/spotify-to-mp3,frosas/spotify-to-mp3
ruby
## Code Before: Gem::Specification.new do |gem| gem.name = 'spotify-to-mp3' gem.summary = 'Spotify to MP3' gem.description = 'Download MP3 files of your Spotify tracks from Grooveshark' gem.version = '0.7.1' gem.author = 'Francesc Rosàs' gem.email = 'francescrosasbosque@gmail.com' gem.homepage = 'https://github.com/frosas/spotify-to-mp3' gem.license = 'MIT' gem.add_runtime_dependency 'rspotify', '~> 1.11.0' gem.add_runtime_dependency 'grooveshark', '~> 0.2.12' gem.add_runtime_dependency 'colorize', '~> 0.7.5' gem.add_runtime_dependency 'ruby-progressbar', '~> 1.7.1' gem.add_development_dependency 'rspec', '~> 2.14.1' gem.files = `git ls-files`.split("\n") gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.require_paths = ['lib'] end ## Instruction: Fix "pessimistic dependency on ..." warnings ## Code After: Gem::Specification.new do |gem| gem.name = 'spotify-to-mp3' gem.summary = 'Spotify to MP3' gem.description = 'Download MP3 files of your Spotify tracks from Grooveshark' gem.version = '0.7.1' gem.author = 'Francesc Rosàs' gem.email = 'francescrosasbosque@gmail.com' gem.homepage = 'https://github.com/frosas/spotify-to-mp3' gem.license = 'MIT' gem.add_runtime_dependency 'rspotify', '~> 1.11', '>= 1.11.0' gem.add_runtime_dependency 'grooveshark', '~> 0.2.12' gem.add_runtime_dependency 'colorize', '~> 0.7.5' gem.add_runtime_dependency 'ruby-progressbar', '~> 1.7', '>= 1.7.1' gem.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1' gem.files = `git ls-files`.split("\n") gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.require_paths = ['lib'] end
Gem::Specification.new do |gem| gem.name = 'spotify-to-mp3' gem.summary = 'Spotify to MP3' gem.description = 'Download MP3 files of your Spotify tracks from Grooveshark' gem.version = '0.7.1' gem.author = 'Francesc Rosàs' gem.email = 'francescrosasbosque@gmail.com' gem.homepage = 'https://github.com/frosas/spotify-to-mp3' gem.license = 'MIT' - gem.add_runtime_dependency 'rspotify', '~> 1.11.0' + gem.add_runtime_dependency 'rspotify', '~> 1.11', '>= 1.11.0' ? +++++++++++ gem.add_runtime_dependency 'grooveshark', '~> 0.2.12' gem.add_runtime_dependency 'colorize', '~> 0.7.5' - gem.add_runtime_dependency 'ruby-progressbar', '~> 1.7.1' + gem.add_runtime_dependency 'ruby-progressbar', '~> 1.7', '>= 1.7.1' ? ++++++++++ - gem.add_development_dependency 'rspec', '~> 2.14.1' + gem.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1' ? +++++++++++ gem.files = `git ls-files`.split("\n") gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.require_paths = ['lib'] end
6
0.285714
3
3
bcc6b36eadec86d2ae854e66608008ad5b50fda8
lib/Fuzzer/test/no-coverage/CMakeLists.txt
lib/Fuzzer/test/no-coverage/CMakeLists.txt
set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard") set(NoCoverageTests UninstrumentedTest ) foreach(Test ${NoCoverageTests}) add_libfuzzer_test(${Test}-NoCoverage SOURCES ../${Test}.cpp) endforeach() ############################################################################### # AFL Driver test ############################################################################### add_executable(AFLDriverTest ../AFLDriverTest.cpp ../../afl/afl_driver.cpp) set_target_properties(AFLDriverTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/Fuzzer/test" ) # Propagate value into parent directory set(TestBinaries ${TestBinaries} AFLDriverTest PARENT_SCOPE)
set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard") set(NoCoverageTests UninstrumentedTest ) foreach(Test ${NoCoverageTests}) add_libfuzzer_test(${Test}-NoCoverage SOURCES ../${Test}.cpp) endforeach() ############################################################################### # AFL Driver test ############################################################################### if(NOT MSVC) add_executable(AFLDriverTest ../AFLDriverTest.cpp ../../afl/afl_driver.cpp) set_target_properties(AFLDriverTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/Fuzzer/test" ) # Propagate value into parent directory set(TestBinaries ${TestBinaries} AFLDriverTest PARENT_SCOPE) endif()
Disable afl tests for Windows.
[libFuzzer] Disable afl tests for Windows. On Windows, we don't have interoperability between libFuzzer and afl. Differential Revision: https://reviews.llvm.org/D28355 git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@292734 91177308-0d34-0410-b5e6-96231b3b80d8
Text
apache-2.0
llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm
text
## Code Before: set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard") set(NoCoverageTests UninstrumentedTest ) foreach(Test ${NoCoverageTests}) add_libfuzzer_test(${Test}-NoCoverage SOURCES ../${Test}.cpp) endforeach() ############################################################################### # AFL Driver test ############################################################################### add_executable(AFLDriverTest ../AFLDriverTest.cpp ../../afl/afl_driver.cpp) set_target_properties(AFLDriverTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/Fuzzer/test" ) # Propagate value into parent directory set(TestBinaries ${TestBinaries} AFLDriverTest PARENT_SCOPE) ## Instruction: [libFuzzer] Disable afl tests for Windows. On Windows, we don't have interoperability between libFuzzer and afl. Differential Revision: https://reviews.llvm.org/D28355 git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@292734 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard") set(NoCoverageTests UninstrumentedTest ) foreach(Test ${NoCoverageTests}) add_libfuzzer_test(${Test}-NoCoverage SOURCES ../${Test}.cpp) endforeach() ############################################################################### # AFL Driver test ############################################################################### if(NOT MSVC) add_executable(AFLDriverTest ../AFLDriverTest.cpp ../../afl/afl_driver.cpp) set_target_properties(AFLDriverTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/Fuzzer/test" ) # Propagate value into parent directory set(TestBinaries ${TestBinaries} AFLDriverTest PARENT_SCOPE) endif()
set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard") set(NoCoverageTests UninstrumentedTest ) foreach(Test ${NoCoverageTests}) add_libfuzzer_test(${Test}-NoCoverage SOURCES ../${Test}.cpp) endforeach() ############################################################################### # AFL Driver test ############################################################################### + if(NOT MSVC) + add_executable(AFLDriverTest + ../AFLDriverTest.cpp ../../afl/afl_driver.cpp) - add_executable(AFLDriverTest - ../AFLDriverTest.cpp ../../afl/afl_driver.cpp) + set_target_properties(AFLDriverTest + PROPERTIES RUNTIME_OUTPUT_DIRECTORY + "${CMAKE_BINARY_DIR}/lib/Fuzzer/test" + ) - set_target_properties(AFLDriverTest - PROPERTIES RUNTIME_OUTPUT_DIRECTORY - "${CMAKE_BINARY_DIR}/lib/Fuzzer/test" - ) - - # Propagate value into parent directory + # Propagate value into parent directory ? ++ - set(TestBinaries ${TestBinaries} AFLDriverTest PARENT_SCOPE) + set(TestBinaries ${TestBinaries} AFLDriverTest PARENT_SCOPE) ? ++ + endif()
19
0.703704
10
9
cac3099b9ab07d5ac2180e0b2796f55668ddda1e
generate_keyczart.py
generate_keyczart.py
import keyczar from keyczar import keyczart import os directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'keyset') if not os.listdir(directory): os.makedirs(directory) keyczart.main(['create','--location=keyset','--purpose=crypt','--name=crypt']) keyczart.main(['addkey','--location=keyset' ,'--status=primary']) else: print 'Keyset directory already has something in there. Skipping key generation.'
import keyczar from keyczar import keyczart import os directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'keyset') if not os.path.exists(directory): os.makedirs(directory) if not os.listdir(directory): keyczart.main(['create','--location=keyset','--purpose=crypt','--name=crypt']) keyczart.main(['addkey','--location=keyset' ,'--status=primary']) else: print 'Keyset directory already has something in there. Skipping key generation.'
Make the directory if it doesn't exist
Make the directory if it doesn't exist
Python
apache-2.0
arubdesu/Crypt-Server,arubdesu/Crypt-Server,arubdesu/Crypt-Server,grahamgilbert/Crypt-Server,squarit/Crypt-Server,grahamgilbert/Crypt-Server,squarit/Crypt-Server,squarit/Crypt-Server,grahamgilbert/Crypt-Server,squarit/Crypt-Server,grahamgilbert/Crypt-Server
python
## Code Before: import keyczar from keyczar import keyczart import os directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'keyset') if not os.listdir(directory): os.makedirs(directory) keyczart.main(['create','--location=keyset','--purpose=crypt','--name=crypt']) keyczart.main(['addkey','--location=keyset' ,'--status=primary']) else: print 'Keyset directory already has something in there. Skipping key generation.' ## Instruction: Make the directory if it doesn't exist ## Code After: import keyczar from keyczar import keyczart import os directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'keyset') if not os.path.exists(directory): os.makedirs(directory) if not os.listdir(directory): keyczart.main(['create','--location=keyset','--purpose=crypt','--name=crypt']) keyczart.main(['addkey','--location=keyset' ,'--status=primary']) else: print 'Keyset directory already has something in there. Skipping key generation.'
import keyczar from keyczar import keyczart import os directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'keyset') + + if not os.path.exists(directory): + os.makedirs(directory) + if not os.listdir(directory): - os.makedirs(directory) keyczart.main(['create','--location=keyset','--purpose=crypt','--name=crypt']) keyczart.main(['addkey','--location=keyset' ,'--status=primary']) else: print 'Keyset directory already has something in there. Skipping key generation.'
5
0.5
4
1
66ec368495fcbb42a4961239824681ae7e8df28a
lib/index.js
lib/index.js
/** * Module dependencies */ var defaults = require('./helpers'); var template = require('./template'); module.exports = createInstance; /** * Create an instance of JSONt * * @return {JSONt} */ function createInstance() { function JSONt(tmpl, options){ return JSONt.compile(tmpl, options); }; JSONt.helpers = {}; JSONt.helpers.__proto__ = defaults; JSONt.use = use; JSONt.plugin = plugin; JSONt.compile = compile; return JSONt; }; /** * Use a helpers * * @param {String} name * @param {Function} fun * @return {JSONt} for chaining */ function use(name, fun) { this.helpers[name] = fun; return this; }; /** * Register a collection of helpers */ function plugin(fn) { fn(this); return this; }; /** * Compile a template with the default helpers * * @param {String|Object} tmpl * @param {Object} options * @return {Template} */ function compile(tmpl, options) { return template(tmpl, options || {}, this.helpers); };
/** * Module dependencies */ var defaults = require('./helpers'); var template = require('./template'); module.exports = createInstance; /** * Create an instance of JSONt * * @return {JSONt} */ function createInstance() { function JSONt(tmpl, options){ return JSONt.compile(tmpl, options); }; JSONt.helpers = {}; JSONt.helpers.__proto__ = defaults; JSONt.use = use; JSONt.plugin = plugin; JSONt.compile = compile; JSONt.render = render; JSONt.renderFile = renderFile; return JSONt; }; /** * Use a helpers * * @param {String} name * @param {Function} fun * @return {JSONt} for chaining */ function use(name, fun) { this.helpers[name] = fun; return this; }; /** * Register a collection of helpers */ function plugin(fn) { fn(this); return this; }; /** * Compile a template with the default helpers * * @param {String|Object} tmpl * @param {Object} options * @return {Template} */ function compile(tmpl, options) { return template(tmpl, options || {}, this.helpers); }; /** * Compile and render a template * * @param {String|Object} tmpl * @param {Object} options * @param {Function} fn */ function render(tmpl, options, fn) { this.compile(tmpl, options)(options, fn); }; /** * Compile and render a template * * @param {String} filename * @param {Object} options * @param {Function} fn */ function renderFile(file, options, fn) { this.compile(require(file), options)(options, fn); };
Add render and renderFile methods
Add render and renderFile methods
JavaScript
mit
UptownFound/jsont,camshaft/jsont
javascript
## Code Before: /** * Module dependencies */ var defaults = require('./helpers'); var template = require('./template'); module.exports = createInstance; /** * Create an instance of JSONt * * @return {JSONt} */ function createInstance() { function JSONt(tmpl, options){ return JSONt.compile(tmpl, options); }; JSONt.helpers = {}; JSONt.helpers.__proto__ = defaults; JSONt.use = use; JSONt.plugin = plugin; JSONt.compile = compile; return JSONt; }; /** * Use a helpers * * @param {String} name * @param {Function} fun * @return {JSONt} for chaining */ function use(name, fun) { this.helpers[name] = fun; return this; }; /** * Register a collection of helpers */ function plugin(fn) { fn(this); return this; }; /** * Compile a template with the default helpers * * @param {String|Object} tmpl * @param {Object} options * @return {Template} */ function compile(tmpl, options) { return template(tmpl, options || {}, this.helpers); }; ## Instruction: Add render and renderFile methods ## Code After: /** * Module dependencies */ var defaults = require('./helpers'); var template = require('./template'); module.exports = createInstance; /** * Create an instance of JSONt * * @return {JSONt} */ function createInstance() { function JSONt(tmpl, options){ return JSONt.compile(tmpl, options); }; JSONt.helpers = {}; JSONt.helpers.__proto__ = defaults; JSONt.use = use; JSONt.plugin = plugin; JSONt.compile = compile; JSONt.render = render; JSONt.renderFile = renderFile; return JSONt; }; /** * Use a helpers * * @param {String} name * @param {Function} fun * @return {JSONt} for chaining */ function use(name, fun) { this.helpers[name] = fun; return this; }; /** * Register a collection of helpers */ function plugin(fn) { fn(this); return this; }; /** * Compile a template with the default helpers * * @param {String|Object} tmpl * @param {Object} options * @return {Template} */ function compile(tmpl, options) { return template(tmpl, options || {}, this.helpers); }; /** * Compile and render a template * * @param {String|Object} tmpl * @param {Object} options * @param {Function} fn */ function render(tmpl, options, fn) { this.compile(tmpl, options)(options, fn); }; /** * Compile and render a template * * @param {String} filename * @param {Object} options * @param {Function} fn */ function renderFile(file, options, fn) { this.compile(require(file), options)(options, fn); };
/** * Module dependencies */ var defaults = require('./helpers'); var template = require('./template'); module.exports = createInstance; /** * Create an instance of JSONt * * @return {JSONt} */ function createInstance() { function JSONt(tmpl, options){ return JSONt.compile(tmpl, options); }; JSONt.helpers = {}; JSONt.helpers.__proto__ = defaults; JSONt.use = use; JSONt.plugin = plugin; JSONt.compile = compile; + JSONt.render = render; + JSONt.renderFile = renderFile; return JSONt; }; /** * Use a helpers * * @param {String} name * @param {Function} fun * @return {JSONt} for chaining */ function use(name, fun) { this.helpers[name] = fun; return this; }; /** * Register a collection of helpers */ function plugin(fn) { fn(this); return this; }; /** * Compile a template with the default helpers * * @param {String|Object} tmpl * @param {Object} options * @return {Template} */ function compile(tmpl, options) { return template(tmpl, options || {}, this.helpers); }; + + /** + * Compile and render a template + * + * @param {String|Object} tmpl + * @param {Object} options + * @param {Function} fn + */ + + function render(tmpl, options, fn) { + this.compile(tmpl, options)(options, fn); + }; + + /** + * Compile and render a template + * + * @param {String} filename + * @param {Object} options + * @param {Function} fn + */ + + function renderFile(file, options, fn) { + this.compile(require(file), options)(options, fn); + };
26
0.433333
26
0
d6f92b85f62db9a6aa6e12f701467cb4eaf3d933
src/doc/components/DocCommentParser.php
src/doc/components/DocCommentParser.php
<?php /** * Created by PhpStorm. * User: alex * Date: 20/10/2016 * Time: 23:36 */ namespace vr\api\doc\components; use yii\base\BaseObject; /** * Class DocCommentParser * @package vr\api\doc\components * @property string $description */ class DocCommentParser extends BaseObject { /** * @var */ public $source; /** * @var */ public $params; /** * */ public function init() { } /** * @return string */ public function getDescription() { $string = explode(PHP_EOL, $this->source); $values = array_splice($string, 1); array_walk($values, function (&$item) { $item = trim($item, '* /\t\r\n'); }); return implode(array_filter($values), '<br/>'); } }
<?php /** * Created by PhpStorm. * User: alex * Date: 20/10/2016 * Time: 23:36 */ namespace vr\api\doc\components; use yii\base\BaseObject; /** * Class DocCommentParser * @package vr\api\doc\components * @property string $description */ class DocCommentParser extends BaseObject { /** * @var */ public $source; /** * @var */ public $params; /** * */ public function init() { } /** * @return string */ public function getDescription() { $string = explode(PHP_EOL, $this->source); $values = array_splice($string, 1); array_walk($values, function (&$item) { $item = trim($item, "* /\t\r\n"); }); $filtered = array_filter($values, function ($string) { return !empty($string) && strpos($string, '@throws') === false && strpos($string, '@return') === false; }); return implode($filtered, '<br/>'); } }
Change the parsing doc comments algorithm to show full method documentation but not just the first string
Change the parsing doc comments algorithm to show full method documentation but not just the first string
PHP
mit
voodoo-mobile/yii2-api,voodoo-mobile/yii2-api,voodoo-mobile/yii2-api,voodoo-rocks/yii2-api,voodoo-rocks/yii2-api
php
## Code Before: <?php /** * Created by PhpStorm. * User: alex * Date: 20/10/2016 * Time: 23:36 */ namespace vr\api\doc\components; use yii\base\BaseObject; /** * Class DocCommentParser * @package vr\api\doc\components * @property string $description */ class DocCommentParser extends BaseObject { /** * @var */ public $source; /** * @var */ public $params; /** * */ public function init() { } /** * @return string */ public function getDescription() { $string = explode(PHP_EOL, $this->source); $values = array_splice($string, 1); array_walk($values, function (&$item) { $item = trim($item, '* /\t\r\n'); }); return implode(array_filter($values), '<br/>'); } } ## Instruction: Change the parsing doc comments algorithm to show full method documentation but not just the first string ## Code After: <?php /** * Created by PhpStorm. * User: alex * Date: 20/10/2016 * Time: 23:36 */ namespace vr\api\doc\components; use yii\base\BaseObject; /** * Class DocCommentParser * @package vr\api\doc\components * @property string $description */ class DocCommentParser extends BaseObject { /** * @var */ public $source; /** * @var */ public $params; /** * */ public function init() { } /** * @return string */ public function getDescription() { $string = explode(PHP_EOL, $this->source); $values = array_splice($string, 1); array_walk($values, function (&$item) { $item = trim($item, "* /\t\r\n"); }); $filtered = array_filter($values, function ($string) { return !empty($string) && strpos($string, '@throws') === false && strpos($string, '@return') === false; }); return implode($filtered, '<br/>'); } }
<?php /** * Created by PhpStorm. * User: alex * Date: 20/10/2016 * Time: 23:36 */ namespace vr\api\doc\components; use yii\base\BaseObject; /** * Class DocCommentParser * @package vr\api\doc\components * @property string $description */ class DocCommentParser extends BaseObject { /** * @var */ public $source; /** * @var */ public $params; /** * */ public function init() { } /** * @return string */ public function getDescription() { $string = explode(PHP_EOL, $this->source); $values = array_splice($string, 1); array_walk($values, function (&$item) { - $item = trim($item, '* /\t\r\n'); ? ^ ^ + $item = trim($item, "* /\t\r\n"); ? ^ ^ }); + $filtered = array_filter($values, function ($string) { + return !empty($string) + && strpos($string, '@throws') === false + && strpos($string, '@return') === false; + }); + - return implode(array_filter($values), '<br/>'); ? ^^^^^^ ------ ^^ + return implode($filtered, '<br/>'); ? ^ ^ } }
10
0.196078
8
2
75ca1a9b6ae482a6ca67acd62baaeec2490f3350
app/models/simple_smart_answer_node.rb
app/models/simple_smart_answer_node.rb
class SimpleSmartAnswerNode include Mongoid::Document embedded_in :edition, :class_name => "SimpleSmartAnswerEdition" field :slug, type: String field :title, type: String field :body, type: String field :order, type: Integer field :options, type: Hash field :kind, type: String default_scope order_by([:order, :asc]) KINDS = [ 'question', 'outcome' ] validates :slug, :title, :kind, presence: true validates :kind, inclusion: { :in => KINDS } validate :outcomes_have_no_options validate :all_options_have_labels private def outcomes_have_no_options errors.add(:options, "cannot be added for an outcome") if options.present? and options.any? and kind == "outcome" end def all_options_have_labels errors.add(:options, "must not have blank labels") if options.present? and options.values.select(&:blank?).size > 0 end end
class SimpleSmartAnswerNode include Mongoid::Document embedded_in :edition, :class_name => "SimpleSmartAnswerEdition" field :slug, type: String field :title, type: String field :body, type: String field :order, type: Integer field :options, type: Hash field :kind, type: String default_scope order_by([:order, :asc]) GOVSPEAK_FIELDS = [:body] KINDS = [ 'question', 'outcome' ] validates :slug, :title, :kind, presence: true validates :kind, inclusion: { :in => KINDS } validate :outcomes_have_no_options validate :all_options_have_labels validates_with SafeHtml private def outcomes_have_no_options errors.add(:options, "cannot be added for an outcome") if options.present? and options.any? and kind == "outcome" end def all_options_have_labels errors.add(:options, "must not have blank labels") if options.present? and options.values.select(&:blank?).size > 0 end end
Validate node body with SafeHtml
Validate node body with SafeHtml
Ruby
mit
dinuksha/Test,theodi/govuk_content_models,dinuksha/Test,alphagov/govuk_content_models,theodi/govuk_content_models
ruby
## Code Before: class SimpleSmartAnswerNode include Mongoid::Document embedded_in :edition, :class_name => "SimpleSmartAnswerEdition" field :slug, type: String field :title, type: String field :body, type: String field :order, type: Integer field :options, type: Hash field :kind, type: String default_scope order_by([:order, :asc]) KINDS = [ 'question', 'outcome' ] validates :slug, :title, :kind, presence: true validates :kind, inclusion: { :in => KINDS } validate :outcomes_have_no_options validate :all_options_have_labels private def outcomes_have_no_options errors.add(:options, "cannot be added for an outcome") if options.present? and options.any? and kind == "outcome" end def all_options_have_labels errors.add(:options, "must not have blank labels") if options.present? and options.values.select(&:blank?).size > 0 end end ## Instruction: Validate node body with SafeHtml ## Code After: class SimpleSmartAnswerNode include Mongoid::Document embedded_in :edition, :class_name => "SimpleSmartAnswerEdition" field :slug, type: String field :title, type: String field :body, type: String field :order, type: Integer field :options, type: Hash field :kind, type: String default_scope order_by([:order, :asc]) GOVSPEAK_FIELDS = [:body] KINDS = [ 'question', 'outcome' ] validates :slug, :title, :kind, presence: true validates :kind, inclusion: { :in => KINDS } validate :outcomes_have_no_options validate :all_options_have_labels validates_with SafeHtml private def outcomes_have_no_options errors.add(:options, "cannot be added for an outcome") if options.present? and options.any? and kind == "outcome" end def all_options_have_labels errors.add(:options, "must not have blank labels") if options.present? and options.values.select(&:blank?).size > 0 end end
class SimpleSmartAnswerNode include Mongoid::Document embedded_in :edition, :class_name => "SimpleSmartAnswerEdition" field :slug, type: String field :title, type: String field :body, type: String field :order, type: Integer field :options, type: Hash field :kind, type: String default_scope order_by([:order, :asc]) + GOVSPEAK_FIELDS = [:body] + KINDS = [ 'question', 'outcome' ] validates :slug, :title, :kind, presence: true validates :kind, inclusion: { :in => KINDS } validate :outcomes_have_no_options validate :all_options_have_labels + validates_with SafeHtml + private def outcomes_have_no_options errors.add(:options, "cannot be added for an outcome") if options.present? and options.any? and kind == "outcome" end def all_options_have_labels errors.add(:options, "must not have blank labels") if options.present? and options.values.select(&:blank?).size > 0 end end
4
0.114286
4
0
16fb387bc3fe563f3cf09eb4d3d92ae29026f91a
src/main/main.rs
src/main/main.rs
extern crate common; extern crate support; extern crate hil; extern crate process; extern crate platform; mod sched; pub mod syscall; #[allow(improper_ctypes)] extern { static _sapps : usize; } #[no_mangle] pub extern fn main() { use process::Process; use process::AppId; let processes = unsafe { process::process::PROCS = [Process::create(&_sapps)]; &mut process::process::PROCS }; let mut platform = unsafe { platform::init() }; loop { unsafe { platform.service_pending_interrupts(); for (i, p) in processes.iter_mut().enumerate() { p.as_mut().map(|process| { sched::do_process(platform, process, AppId::new(i)); }); } support::atomic(|| { if !platform.has_pending_interrupts() { support::wfi(); } }) }; } }
extern crate common; extern crate support; extern crate hil; extern crate process; extern crate platform; mod sched; pub mod syscall; #[allow(improper_ctypes)] extern { static _sapps : usize; } #[no_mangle] pub extern fn main() { use process::Process; use process::AppId; let mut platform = unsafe { platform::init() }; let processes = unsafe { process::process::PROCS = [Process::create(&_sapps)]; &mut process::process::PROCS }; loop { unsafe { platform.service_pending_interrupts(); for (i, p) in processes.iter_mut().enumerate() { p.as_mut().map(|process| { sched::do_process(platform, process, AppId::new(i)); }); } support::atomic(|| { if !platform.has_pending_interrupts() { support::wfi(); } }) }; } }
Load the platform before apps
Load the platform before apps That way, if there is an error loading the apps, the console is already configured and we can panic with useful output
Rust
apache-2.0
google/tock-on-titan,google/tock-on-titan,google/tock-on-titan
rust
## Code Before: extern crate common; extern crate support; extern crate hil; extern crate process; extern crate platform; mod sched; pub mod syscall; #[allow(improper_ctypes)] extern { static _sapps : usize; } #[no_mangle] pub extern fn main() { use process::Process; use process::AppId; let processes = unsafe { process::process::PROCS = [Process::create(&_sapps)]; &mut process::process::PROCS }; let mut platform = unsafe { platform::init() }; loop { unsafe { platform.service_pending_interrupts(); for (i, p) in processes.iter_mut().enumerate() { p.as_mut().map(|process| { sched::do_process(platform, process, AppId::new(i)); }); } support::atomic(|| { if !platform.has_pending_interrupts() { support::wfi(); } }) }; } } ## Instruction: Load the platform before apps That way, if there is an error loading the apps, the console is already configured and we can panic with useful output ## Code After: extern crate common; extern crate support; extern crate hil; extern crate process; extern crate platform; mod sched; pub mod syscall; #[allow(improper_ctypes)] extern { static _sapps : usize; } #[no_mangle] pub extern fn main() { use process::Process; use process::AppId; let mut platform = unsafe { platform::init() }; let processes = unsafe { process::process::PROCS = [Process::create(&_sapps)]; &mut process::process::PROCS }; loop { unsafe { platform.service_pending_interrupts(); for (i, p) in processes.iter_mut().enumerate() { p.as_mut().map(|process| { sched::do_process(platform, process, AppId::new(i)); }); } support::atomic(|| { if !platform.has_pending_interrupts() { support::wfi(); } }) }; } }
extern crate common; extern crate support; extern crate hil; extern crate process; extern crate platform; mod sched; pub mod syscall; #[allow(improper_ctypes)] extern { static _sapps : usize; } #[no_mangle] pub extern fn main() { use process::Process; use process::AppId; + let mut platform = unsafe { + platform::init() + }; + + let processes = unsafe { process::process::PROCS = [Process::create(&_sapps)]; &mut process::process::PROCS - }; - - let mut platform = unsafe { - platform::init() }; loop { unsafe { platform.service_pending_interrupts(); for (i, p) in processes.iter_mut().enumerate() { p.as_mut().map(|process| { sched::do_process(platform, process, AppId::new(i)); }); } support::atomic(|| { if !platform.has_pending_interrupts() { support::wfi(); } }) }; } }
9
0.183673
5
4
be8cd447201fc4d144491f8b7156731faa2412b5
bin/prepare_environment.bash
bin/prepare_environment.bash
set -e # check that we are in the expected directory cd `dirname $0`/.. # Some env variables used during development seem to make things break - set # them back to the defaults which is what they would have on the servers. PYTHONDONTWRITEBYTECODE="" # create the virtual environment, install/update required packages virtualenv ../mzalendo-virtualenv source ../mzalendo-virtualenv/bin/activate pip install Mercurial pip install -r requirements.txt # use the virtualenv just created/updated source ../mzalendo-virtualenv/bin/activate # make sure that there is no old code (the .py files may have been git deleted) find . -name '*.pyc' -delete # go to the project directory for local config cd mzalendo # get the database up to speed ./manage.py syncdb --noinput ./manage.py migrate # gather all the static files in one place ./manage.py collectstatic --noinput cd --
set -e # check that we are in the expected directory cd "$(dirname $BASH_SOURCE)"/.. # Some env variables used during development seem to make things break - set # them back to the defaults which is what they would have on the servers. PYTHONDONTWRITEBYTECODE="" # create the virtual environment, install/update required packages virtualenv ../mzalendo-virtualenv source ../mzalendo-virtualenv/bin/activate pip install Mercurial pip install -r requirements.txt # use the virtualenv just created/updated source ../mzalendo-virtualenv/bin/activate # make sure that there is no old code (the .py files may have been git deleted) find . -name '*.pyc' -delete # go to the project directory for local config cd mzalendo # get the database up to speed ./manage.py syncdb --noinput ./manage.py migrate # gather all the static files in one place ./manage.py collectstatic --noinput cd --
Make the initial cd more robust
Make the initial cd more robust $BASH_SOURCE is guaranteed to be the path to the script whereas $0 may not be. Also use "$()" instead of backquotes to avoid failure where there is a space in the directory path.
Shell
agpl-3.0
geoffkilpin/pombola,ken-muturi/pombola,geoffkilpin/pombola,geoffkilpin/pombola,hzj123/56th,patricmutwiri/pombola,ken-muturi/pombola,hzj123/56th,ken-muturi/pombola,geoffkilpin/pombola,patricmutwiri/pombola,hzj123/56th,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,hzj123/56th,patricmutwiri/pombola,geoffkilpin/pombola,hzj123/56th,mysociety/pombola,mysociety/pombola,hzj123/56th,mysociety/pombola,geoffkilpin/pombola,mysociety/pombola
shell
## Code Before: set -e # check that we are in the expected directory cd `dirname $0`/.. # Some env variables used during development seem to make things break - set # them back to the defaults which is what they would have on the servers. PYTHONDONTWRITEBYTECODE="" # create the virtual environment, install/update required packages virtualenv ../mzalendo-virtualenv source ../mzalendo-virtualenv/bin/activate pip install Mercurial pip install -r requirements.txt # use the virtualenv just created/updated source ../mzalendo-virtualenv/bin/activate # make sure that there is no old code (the .py files may have been git deleted) find . -name '*.pyc' -delete # go to the project directory for local config cd mzalendo # get the database up to speed ./manage.py syncdb --noinput ./manage.py migrate # gather all the static files in one place ./manage.py collectstatic --noinput cd -- ## Instruction: Make the initial cd more robust $BASH_SOURCE is guaranteed to be the path to the script whereas $0 may not be. Also use "$()" instead of backquotes to avoid failure where there is a space in the directory path. ## Code After: set -e # check that we are in the expected directory cd "$(dirname $BASH_SOURCE)"/.. # Some env variables used during development seem to make things break - set # them back to the defaults which is what they would have on the servers. PYTHONDONTWRITEBYTECODE="" # create the virtual environment, install/update required packages virtualenv ../mzalendo-virtualenv source ../mzalendo-virtualenv/bin/activate pip install Mercurial pip install -r requirements.txt # use the virtualenv just created/updated source ../mzalendo-virtualenv/bin/activate # make sure that there is no old code (the .py files may have been git deleted) find . -name '*.pyc' -delete # go to the project directory for local config cd mzalendo # get the database up to speed ./manage.py syncdb --noinput ./manage.py migrate # gather all the static files in one place ./manage.py collectstatic --noinput cd --
set -e # check that we are in the expected directory - cd `dirname $0`/.. + cd "$(dirname $BASH_SOURCE)"/.. # Some env variables used during development seem to make things break - set # them back to the defaults which is what they would have on the servers. PYTHONDONTWRITEBYTECODE="" # create the virtual environment, install/update required packages virtualenv ../mzalendo-virtualenv source ../mzalendo-virtualenv/bin/activate pip install Mercurial pip install -r requirements.txt # use the virtualenv just created/updated source ../mzalendo-virtualenv/bin/activate # make sure that there is no old code (the .py files may have been git deleted) find . -name '*.pyc' -delete # go to the project directory for local config cd mzalendo # get the database up to speed ./manage.py syncdb --noinput ./manage.py migrate # gather all the static files in one place ./manage.py collectstatic --noinput cd --
2
0.058824
1
1
12a6447328879cda4bfd49a46158fffa36437a7f
deploy.sh
deploy.sh
set -e rm -rf out || exit 0; mkdir out; npm install node main.js > out/geonamesjp_vs_sac.nt.txt # go to the out directory and create a *new* Git repo cd out git init # inside this git repo we'll pretend to be a new user git config user.name "Travis CI" git config user.email "indigo-lab@users.noreply.github.com" git add . git commit -m "Deploy to GitHub Pages" git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 # git push "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
set -e rm -rf out || exit 0; mkdir out; npm install cat << EOS > out/geonamesjp_vs_sac.nt.txt # Copyright (c) 2016 Indigo Corp. Research and Development Center # # このデータはクリエイティブ・コモンズ 表示 - 継承 4.0 国際 ライセンスの下に提供されています。 # <https://creativecommons.org/licenses/by-sa/4.0/deed.ja> # # このデータは総務省統計局 統計LOD の SPARQL Endpoint の出力を加工して作成されました。 # <http://data.e-stat.go.jp/> # EOS node main.js >> out/geonamesjp_vs_sac.nt.txt # go to the out directory and create a *new* Git repo cd out git init # inside this git repo we'll pretend to be a new user git config user.name "Travis CI" git config user.email "indigo-lab@users.noreply.github.com" git add . git commit -m "Deploy to GitHub Pages" git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 # git push "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
Add license header to result N-Triples file
Add license header to result N-Triples file
Shell
mit
indigo-lab/geonamesjp_vs_sac,indigo-lab/geonamesjp_vs_sac
shell
## Code Before: set -e rm -rf out || exit 0; mkdir out; npm install node main.js > out/geonamesjp_vs_sac.nt.txt # go to the out directory and create a *new* Git repo cd out git init # inside this git repo we'll pretend to be a new user git config user.name "Travis CI" git config user.email "indigo-lab@users.noreply.github.com" git add . git commit -m "Deploy to GitHub Pages" git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 # git push "https://${GH_TOKEN}@${GH_REF}" master:gh-pages ## Instruction: Add license header to result N-Triples file ## Code After: set -e rm -rf out || exit 0; mkdir out; npm install cat << EOS > out/geonamesjp_vs_sac.nt.txt # Copyright (c) 2016 Indigo Corp. Research and Development Center # # このデータはクリエイティブ・コモンズ 表示 - 継承 4.0 国際 ライセンスの下に提供されています。 # <https://creativecommons.org/licenses/by-sa/4.0/deed.ja> # # このデータは総務省統計局 統計LOD の SPARQL Endpoint の出力を加工して作成されました。 # <http://data.e-stat.go.jp/> # EOS node main.js >> out/geonamesjp_vs_sac.nt.txt # go to the out directory and create a *new* Git repo cd out git init # inside this git repo we'll pretend to be a new user git config user.name "Travis CI" git config user.email "indigo-lab@users.noreply.github.com" git add . git commit -m "Deploy to GitHub Pages" git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 # git push "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
set -e rm -rf out || exit 0; mkdir out; npm install + cat << EOS > out/geonamesjp_vs_sac.nt.txt + # Copyright (c) 2016 Indigo Corp. Research and Development Center + # + # このデータはクリエイティブ・コモンズ 表示 - 継承 4.0 国際 ライセンスの下に提供されています。 + # <https://creativecommons.org/licenses/by-sa/4.0/deed.ja> + # + # このデータは総務省統計局 統計LOD の SPARQL Endpoint の出力を加工して作成されました。 + # <http://data.e-stat.go.jp/> + # + + EOS + - node main.js > out/geonamesjp_vs_sac.nt.txt + node main.js >> out/geonamesjp_vs_sac.nt.txt ? + # go to the out directory and create a *new* Git repo cd out git init # inside this git repo we'll pretend to be a new user git config user.name "Travis CI" git config user.email "indigo-lab@users.noreply.github.com" git add . git commit -m "Deploy to GitHub Pages" git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1 # git push "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
14
0.608696
13
1
1458c109df2d3ea37380c6f8352ef04baa401bf0
src/braid/core/client/pages.cljs
src/braid/core/client/pages.cljs
(ns braid.core.client.pages (:require [spec-tools.data-spec :as ds] [braid.core.hooks :as hooks])) (def page-dataspec {:key keyword? :on-load fn? :view fn? (ds/opt :styles) vector?}) (defonce pages (hooks/register! (atom {}) {keyword? page-dataspec})) (defn on-load! [page-id page] (when-let [f (get-in @pages [page-id :on-load])] (f page))) (defn get-view [page-id] (get-in @pages [page-id :view]))
(ns braid.core.client.pages (:require [spec-tools.data-spec :as ds] [braid.core.hooks :as hooks])) (def page-dataspec {:key keyword? :view fn? (ds/opt :on-load) fn? (ds/opt :styles) vector?}) (defonce pages (hooks/register! (atom {}) {keyword? page-dataspec})) (defn on-load! [page-id page] (when-let [f (get-in @pages [page-id :on-load])] (f page))) (defn get-view [page-id] (get-in @pages [page-id :view]))
Make on-load key optional as per documentation
Make on-load key optional as per documentation
Clojure
agpl-3.0
braidchat/braid,rafd/braid,braidchat/braid,rafd/braid
clojure
## Code Before: (ns braid.core.client.pages (:require [spec-tools.data-spec :as ds] [braid.core.hooks :as hooks])) (def page-dataspec {:key keyword? :on-load fn? :view fn? (ds/opt :styles) vector?}) (defonce pages (hooks/register! (atom {}) {keyword? page-dataspec})) (defn on-load! [page-id page] (when-let [f (get-in @pages [page-id :on-load])] (f page))) (defn get-view [page-id] (get-in @pages [page-id :view])) ## Instruction: Make on-load key optional as per documentation ## Code After: (ns braid.core.client.pages (:require [spec-tools.data-spec :as ds] [braid.core.hooks :as hooks])) (def page-dataspec {:key keyword? :view fn? (ds/opt :on-load) fn? (ds/opt :styles) vector?}) (defonce pages (hooks/register! (atom {}) {keyword? page-dataspec})) (defn on-load! [page-id page] (when-let [f (get-in @pages [page-id :on-load])] (f page))) (defn get-view [page-id] (get-in @pages [page-id :view]))
(ns braid.core.client.pages (:require [spec-tools.data-spec :as ds] [braid.core.hooks :as hooks])) (def page-dataspec {:key keyword? - :on-load fn? :view fn? + (ds/opt :on-load) fn? (ds/opt :styles) vector?}) (defonce pages (hooks/register! (atom {}) {keyword? page-dataspec})) (defn on-load! [page-id page] (when-let [f (get-in @pages [page-id :on-load])] (f page))) (defn get-view [page-id] (get-in @pages [page-id :view]))
2
0.1
1
1
b88a7c539369de2defd02c780f60e402003de865
test/Sema/builtins-x86.cpp
test/Sema/builtins-x86.cpp
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. typedef short __v8hi __attribute__((__vector_size__(16))); template <int Imm> __v8hi test(__v8hi a) { if (Imm < 4) return __builtin_ia32_pshuflw(a, 0x55 * Imm); else return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4)); } template __v8hi test<0>(__v8hi); template __v8hi test<1>(__v8hi); template __v8hi test<2>(__v8hi); template __v8hi test<3>(__v8hi); template __v8hi test<4>(__v8hi); template __v8hi test<5>(__v8hi); template __v8hi test<6>(__v8hi); template __v8hi test<7>(__v8hi);
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. // expected-no-diagnostics typedef short __v8hi __attribute__((__vector_size__(16))); template <int Imm> __v8hi test(__v8hi a) { if (Imm < 4) return __builtin_ia32_pshuflw(a, 0x55 * Imm); else return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4)); } template __v8hi test<0>(__v8hi); template __v8hi test<1>(__v8hi); template __v8hi test<2>(__v8hi); template __v8hi test<3>(__v8hi); template __v8hi test<4>(__v8hi); template __v8hi test<5>(__v8hi); template __v8hi test<6>(__v8hi); template __v8hi test<7>(__v8hi);
Fix a tiny bug in my test case in r335309 by marking that we don't expect any diagnostics.
[x86] Fix a tiny bug in my test case in r335309 by marking that we don't expect any diagnostics. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@335310 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
c++
## Code Before: // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. typedef short __v8hi __attribute__((__vector_size__(16))); template <int Imm> __v8hi test(__v8hi a) { if (Imm < 4) return __builtin_ia32_pshuflw(a, 0x55 * Imm); else return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4)); } template __v8hi test<0>(__v8hi); template __v8hi test<1>(__v8hi); template __v8hi test<2>(__v8hi); template __v8hi test<3>(__v8hi); template __v8hi test<4>(__v8hi); template __v8hi test<5>(__v8hi); template __v8hi test<6>(__v8hi); template __v8hi test<7>(__v8hi); ## Instruction: [x86] Fix a tiny bug in my test case in r335309 by marking that we don't expect any diagnostics. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@335310 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. // expected-no-diagnostics typedef short __v8hi __attribute__((__vector_size__(16))); template <int Imm> __v8hi test(__v8hi a) { if (Imm < 4) return __builtin_ia32_pshuflw(a, 0x55 * Imm); else return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4)); } template __v8hi test<0>(__v8hi); template __v8hi test<1>(__v8hi); template __v8hi test<2>(__v8hi); template __v8hi test<3>(__v8hi); template __v8hi test<4>(__v8hi); template __v8hi test<5>(__v8hi); template __v8hi test<6>(__v8hi); template __v8hi test<7>(__v8hi);
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. + // expected-no-diagnostics typedef short __v8hi __attribute__((__vector_size__(16))); template <int Imm> __v8hi test(__v8hi a) { if (Imm < 4) return __builtin_ia32_pshuflw(a, 0x55 * Imm); else return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4)); } template __v8hi test<0>(__v8hi); template __v8hi test<1>(__v8hi); template __v8hi test<2>(__v8hi); template __v8hi test<3>(__v8hi); template __v8hi test<4>(__v8hi); template __v8hi test<5>(__v8hi); template __v8hi test<6>(__v8hi); template __v8hi test<7>(__v8hi);
1
0.043478
1
0
88fcd9e1ae2a8fe21023816304023526eb7b7e35
fb_import.py
fb_import.py
import MySQLdb # Download Guest List.csv from Facebook event page and copy it to a file named # 'list.csv'. Remove the first line (column title) and the '"'s around each # name (they cause trouble with MySQL) filename = "list.csv" data = open(filename, 'r'); guests = []; db_host = "" # Add your host db_user = "" # Add your user db_password = "" # Add your password db_name = "" # Add your database name db_table = "" # Add your table name for line in data: person = line.split(',') guests.append([person[0].strip(), person[1].strip()]) print("Number of guests {}\n".format(str(len(guests)))) db = MySQLdb.connect(db_host, db_user, db_password, db_name) cursor = db.cursor() for person, status in guests: print("Adding " + person + " status: " + status) cursor.execute("INSERT INTO {} (name, status)\ VALUES (\"{}\", \"{}\")".format(db_table, person, status)) # Clean up cursor.close() db.commit() db.close()
import MySQLdb import json # Download Guest List.csv from Facebook event page and copy it to a file named # 'list.csv'. Remove the first line (column title) and the '"'s around each # name (they cause trouble with MySQL) filename = "list.csv" data = open(filename, 'r') guests = [] # Config Setup config_file = open('config.json', 'r') config = json.load(config_file) for line in data: person = line.split(',') guests.append([person[0].strip(), person[1].strip()]) print("Number of guests {}\n".format(str(len(guests)))) db = MySQLdb.connect(config['db_host'], config['db_user'], config['db_password'], config['db_name']) cursor = db.cursor() for person, status in guests: print("Adding " + person + " status: " + status) cursor.execute("INSERT INTO {} (name, status)\ VALUES (\"{}\", \"{}\")".format(db_table, person, status)) # Clean up cursor.close() db.commit() db.close()
Use config file in import script
Use config file in import script
Python
mit
copperwall/Attendance-Checker,copperwall/Attendance-Checker,copperwall/Attendance-Checker
python
## Code Before: import MySQLdb # Download Guest List.csv from Facebook event page and copy it to a file named # 'list.csv'. Remove the first line (column title) and the '"'s around each # name (they cause trouble with MySQL) filename = "list.csv" data = open(filename, 'r'); guests = []; db_host = "" # Add your host db_user = "" # Add your user db_password = "" # Add your password db_name = "" # Add your database name db_table = "" # Add your table name for line in data: person = line.split(',') guests.append([person[0].strip(), person[1].strip()]) print("Number of guests {}\n".format(str(len(guests)))) db = MySQLdb.connect(db_host, db_user, db_password, db_name) cursor = db.cursor() for person, status in guests: print("Adding " + person + " status: " + status) cursor.execute("INSERT INTO {} (name, status)\ VALUES (\"{}\", \"{}\")".format(db_table, person, status)) # Clean up cursor.close() db.commit() db.close() ## Instruction: Use config file in import script ## Code After: import MySQLdb import json # Download Guest List.csv from Facebook event page and copy it to a file named # 'list.csv'. Remove the first line (column title) and the '"'s around each # name (they cause trouble with MySQL) filename = "list.csv" data = open(filename, 'r') guests = [] # Config Setup config_file = open('config.json', 'r') config = json.load(config_file) for line in data: person = line.split(',') guests.append([person[0].strip(), person[1].strip()]) print("Number of guests {}\n".format(str(len(guests)))) db = MySQLdb.connect(config['db_host'], config['db_user'], config['db_password'], config['db_name']) cursor = db.cursor() for person, status in guests: print("Adding " + person + " status: " + status) cursor.execute("INSERT INTO {} (name, status)\ VALUES (\"{}\", \"{}\")".format(db_table, person, status)) # Clean up cursor.close() db.commit() db.close()
import MySQLdb + import json # Download Guest List.csv from Facebook event page and copy it to a file named # 'list.csv'. Remove the first line (column title) and the '"'s around each # name (they cause trouble with MySQL) filename = "list.csv" - data = open(filename, 'r'); ? - + data = open(filename, 'r') - guests = []; ? - + guests = [] + # Config Setup + config_file = open('config.json', 'r') + config = json.load(config_file) - db_host = "" # Add your host - db_user = "" # Add your user - db_password = "" # Add your password - db_name = "" # Add your database name - db_table = "" # Add your table name for line in data: person = line.split(',') guests.append([person[0].strip(), person[1].strip()]) print("Number of guests {}\n".format(str(len(guests)))) - db = MySQLdb.connect(db_host, db_user, db_password, db_name) + db = MySQLdb.connect(config['db_host'], config['db_user'], config['db_password'], + config['db_name']) cursor = db.cursor() for person, status in guests: print("Adding " + person + " status: " + status) cursor.execute("INSERT INTO {} (name, status)\ VALUES (\"{}\", \"{}\")".format(db_table, person, status)) # Clean up cursor.close() db.commit() db.close()
16
0.484848
8
8
0d1377db7d3ad142847dd2a578a59fc935a2edec
docs/rules/valid-typeof.md
docs/rules/valid-typeof.md
For a vast majority of use-cases, the only valid results of the `typeof` operator will be one of the following: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, and `"function"`. When the result of a `typeof` operation is compared against a string that is not one of these strings, it is usually a typo. This rule ensures that when the result of a `typeof` operation is compared against a string, that string is in the aforementioned set. ## Rule Details This rule aims to prevent errors from likely typos by ensuring that when the result of a `typeof` operation is compared against a string, that the string is a valid value. The following patterns are considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "strnig" typeof foo == "undefimed" typeof bar != "nunber" typeof bar !== "fucntion" ``` The following patterns are not considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "string" typeof bar == "undefined" typeof foo === baz typeof bar === typeof qux ``` ## When Not To Use It You may want to turn this rule off if you will be using the `typeof` operator on host objects.
For a vast majority of use-cases, the only valid results of the `typeof` operator will be one of the following: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, `"function"` and `"symbol"`. When the result of a `typeof` operation is compared against a string that is not one of these strings, it is usually a typo. This rule ensures that when the result of a `typeof` operation is compared against a string, that string is in the aforementioned set. ## Rule Details This rule aims to prevent errors from likely typos by ensuring that when the result of a `typeof` operation is compared against a string, that the string is a valid value. The following patterns are considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "strnig" typeof foo == "undefimed" typeof bar != "nunber" typeof bar !== "fucntion" ``` The following patterns are not considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "string" typeof bar == "undefined" typeof foo === baz typeof bar === typeof qux ``` ## When Not To Use It You may want to turn this rule off if you will be using the `typeof` operator on host objects.
Add missing `symbol` type into valid list
Docs: Add missing `symbol` type into valid list * Update `valid-typeof.md`
Markdown
mit
Trott/eslint,eslint/eslint,mdebruijne/eslint,ABaldwinHunter/eslint,vitorbal/eslint,martijndeh/eslint,davidshepherd7/eslint,lemonmade/eslint,ipanasenko/eslint,spadgos/eslint,Aladdin-ADD/eslint,AcceptableIce/eslint,mzgol/eslint,menelaos/eslint-solarized,Trott/eslint,pvamshi/eslint,Moeriki/eslint,SimenB/eslint,jrencz/eslint,SimenB/eslint,whitneyit/eslint,scriptdaemon/eslint,LinusU/eslint,jrencz/eslint,brgibson/eslint,gabro/eslint,DavidAnson/eslint,eslint/eslint,davidshepherd7/eslint,lemonmade/eslint,BenoitZugmeyer/eslint,platinumazure/eslint,pvamshi/eslint,onurtemizkan/eslint,codeschool/eslint,mzgol/eslint,ljharb/eslint,martijndeh/eslint,lemonmade/eslint,whitneyit/eslint,platinumazure/eslint,ABaldwinHunter/eslint,BenoitZugmeyer/eslint,morrissinger/eslint,kentcdodds/eslint,onurtemizkan/eslint,brgibson/eslint,menelaos/eslint-solarized,vitorbal/eslint,scriptdaemon/eslint,mdebruijne/eslint,Gillespie59/eslint,Moeriki/eslint,Aladdin-ADD/eslint,ipanasenko/eslint,ljharb/eslint,LinusU/eslint,Gillespie59/eslint,AcceptableIce/eslint,morrissinger/eslint,DavidAnson/eslint,gabro/eslint,kentcdodds/eslint,spadgos/eslint,codeschool/eslint
markdown
## Code Before: For a vast majority of use-cases, the only valid results of the `typeof` operator will be one of the following: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, and `"function"`. When the result of a `typeof` operation is compared against a string that is not one of these strings, it is usually a typo. This rule ensures that when the result of a `typeof` operation is compared against a string, that string is in the aforementioned set. ## Rule Details This rule aims to prevent errors from likely typos by ensuring that when the result of a `typeof` operation is compared against a string, that the string is a valid value. The following patterns are considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "strnig" typeof foo == "undefimed" typeof bar != "nunber" typeof bar !== "fucntion" ``` The following patterns are not considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "string" typeof bar == "undefined" typeof foo === baz typeof bar === typeof qux ``` ## When Not To Use It You may want to turn this rule off if you will be using the `typeof` operator on host objects. ## Instruction: Docs: Add missing `symbol` type into valid list * Update `valid-typeof.md` ## Code After: For a vast majority of use-cases, the only valid results of the `typeof` operator will be one of the following: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, `"function"` and `"symbol"`. When the result of a `typeof` operation is compared against a string that is not one of these strings, it is usually a typo. This rule ensures that when the result of a `typeof` operation is compared against a string, that string is in the aforementioned set. ## Rule Details This rule aims to prevent errors from likely typos by ensuring that when the result of a `typeof` operation is compared against a string, that the string is a valid value. The following patterns are considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "strnig" typeof foo == "undefimed" typeof bar != "nunber" typeof bar !== "fucntion" ``` The following patterns are not considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "string" typeof bar == "undefined" typeof foo === baz typeof bar === typeof qux ``` ## When Not To Use It You may want to turn this rule off if you will be using the `typeof` operator on host objects.
- For a vast majority of use-cases, the only valid results of the `typeof` operator will be one of the following: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, and `"function"`. When the result of a `typeof` operation is compared against a string that is not one of these strings, it is usually a typo. This rule ensures that when the result of a `typeof` operation is compared against a string, that string is in the aforementioned set. ? ---- + For a vast majority of use-cases, the only valid results of the `typeof` operator will be one of the following: `"undefined"`, `"object"`, `"boolean"`, `"number"`, `"string"`, `"function"` and `"symbol"`. When the result of a `typeof` operation is compared against a string that is not one of these strings, it is usually a typo. This rule ensures that when the result of a `typeof` operation is compared against a string, that string is in the aforementioned set. ? +++++++++++++++ ## Rule Details This rule aims to prevent errors from likely typos by ensuring that when the result of a `typeof` operation is compared against a string, that the string is a valid value. The following patterns are considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "strnig" typeof foo == "undefimed" typeof bar != "nunber" typeof bar !== "fucntion" ``` The following patterns are not considered problems: ```js /*eslint valid-typeof: 2*/ typeof foo === "string" typeof bar == "undefined" typeof foo === baz typeof bar === typeof qux ``` ## When Not To Use It You may want to turn this rule off if you will be using the `typeof` operator on host objects.
2
0.0625
1
1
e989139379d1b8350b04c1874c994cf11da769c8
.delivery/config.json
.delivery/config.json
{ "version": "2", "build_cookbook": { "name": "delivery_rust", "path": "cookbooks/delivery_rust" }, "skip_phases": [ "lint", "quality", "security", "smoke", "provision", "deploy", "functional" ], "build_nodes": { "default" : ["name:builder*.shd.chef.co"], "unit" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"], "syntax" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"], "publish" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"] } }
{ "version": "2", "build_cookbook": { "name": "delivery_rust", "path": "cookbooks/delivery_rust" }, "skip_phases": [ "lint", "quality", "security", "smoke", "provision", "deploy", "functional" ], "build_nodes": { "default" : ["name:builder*.shd.chef.co"], "unit" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", "description": "Debian Build"}, {"query": "name:builder*.shd.chef.co AND platform_family:rhel", "description": "Rhel Build"}], "syntax" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", "description": "Debian Build"}, {"query": "name:builder*.shd.chef.co AND platform_family:rhel", "description": "Rhel Build"}], "publish" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", "description": "Debian Build"}, {"query": "name:builder*.shd.chef.co AND platform_family:rhel", "description": "Rhel Build"}] } }
Add labels to each of the matrix phases.
Add labels to each of the matrix phases.
JSON
apache-2.0
chef/delivery-cli,chef/delivery-cli,retep998/delivery-cli,retep998/delivery-cli,retep998/delivery-cli,chef/delivery-cli,retep998/delivery-cli
json
## Code Before: { "version": "2", "build_cookbook": { "name": "delivery_rust", "path": "cookbooks/delivery_rust" }, "skip_phases": [ "lint", "quality", "security", "smoke", "provision", "deploy", "functional" ], "build_nodes": { "default" : ["name:builder*.shd.chef.co"], "unit" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"], "syntax" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"], "publish" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"] } } ## Instruction: Add labels to each of the matrix phases. ## Code After: { "version": "2", "build_cookbook": { "name": "delivery_rust", "path": "cookbooks/delivery_rust" }, "skip_phases": [ "lint", "quality", "security", "smoke", "provision", "deploy", "functional" ], "build_nodes": { "default" : ["name:builder*.shd.chef.co"], "unit" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", "description": "Debian Build"}, {"query": "name:builder*.shd.chef.co AND platform_family:rhel", "description": "Rhel Build"}], "syntax" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", "description": "Debian Build"}, {"query": "name:builder*.shd.chef.co AND platform_family:rhel", "description": "Rhel Build"}], "publish" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", "description": "Debian Build"}, {"query": "name:builder*.shd.chef.co AND platform_family:rhel", "description": "Rhel Build"}] } }
{ "version": "2", "build_cookbook": { "name": "delivery_rust", "path": "cookbooks/delivery_rust" }, "skip_phases": [ "lint", "quality", "security", "smoke", "provision", "deploy", "functional" ], "build_nodes": { "default" : ["name:builder*.shd.chef.co"], - "unit" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"], - "syntax" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"], - "publish" : ["name:builder*.shd.chef.co AND platform_family:debian", "name:builder*.shd.chef.co AND platform_family:rhel"] + "unit" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", + "description": "Debian Build"}, + {"query": "name:builder*.shd.chef.co AND platform_family:rhel", + "description": "Rhel Build"}], + "syntax" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", + "description": "Debian Build"}, + {"query": "name:builder*.shd.chef.co AND platform_family:rhel", + "description": "Rhel Build"}], + "publish" : [{"query": "name:builder*.shd.chef.co AND platform_family:debian", + "description": "Debian Build"}, + {"query": "name:builder*.shd.chef.co AND platform_family:rhel", + "description": "Rhel Build"}] } }
15
0.681818
12
3
525cbab46570342098613ae591749b4cf5026453
tests/terrain.py
tests/terrain.py
from lettuce import world import os """ Set world.basedir relative to this terrain.py file, when running lettuce from this directory, and add the directory it to the import path """ world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.sys.path.insert(0,world.basedir) world.basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,world.basedir)
from lettuce import world import os """ Set world.basedir relative to this terrain.py file, when running lettuce from this directory, and add the directory it to the import path """ world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.sys.path.insert(0,world.basedir) world.basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,world.basedir) # Create output directory if not exists if not os.path.exists("test_output"): os.makedirs("test_output")
Create the tests output directory automatically.
Create the tests output directory automatically.
Python
mit
gnott/elife-poa-xml-generation,gnott/elife-poa-xml-generation
python
## Code Before: from lettuce import world import os """ Set world.basedir relative to this terrain.py file, when running lettuce from this directory, and add the directory it to the import path """ world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.sys.path.insert(0,world.basedir) world.basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,world.basedir) ## Instruction: Create the tests output directory automatically. ## Code After: from lettuce import world import os """ Set world.basedir relative to this terrain.py file, when running lettuce from this directory, and add the directory it to the import path """ world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.sys.path.insert(0,world.basedir) world.basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,world.basedir) # Create output directory if not exists if not os.path.exists("test_output"): os.makedirs("test_output")
from lettuce import world import os """ Set world.basedir relative to this terrain.py file, when running lettuce from this directory, and add the directory it to the import path """ world.basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.sys.path.insert(0,world.basedir) world.basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,world.basedir) + + # Create output directory if not exists + if not os.path.exists("test_output"): + os.makedirs("test_output")
4
0.363636
4
0
d6d3a132b887c286b5b74e2a14be327f3a302d26
app/views/projects/issues/update.js.haml
app/views/projects/issues/update.js.haml
$('aside.right-sidebar').parent().html("#{escape_javascript(render 'shared/issuable/sidebar', issuable: @issue)}"); $('aside.right-sidebar').effect('highlight') new Issue();
$('aside.right-sidebar')[0].outerHTML = "#{escape_javascript(render 'shared/issuable/sidebar', issuable: @issue)}"); $('aside.right-sidebar').effect('highlight') new Issue();
Fix sidebar replacement for issues & MRs
Fix sidebar replacement for issues & MRs
Haml
mit
htve/GitlabForChinese,openwide-java/gitlabhq,mr-dxdy/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,dreampet/gitlab,openwide-java/gitlabhq,larryli/gitlabhq,allysonbarros/gitlabhq,shinexiao/gitlabhq,axilleas/gitlabhq,jirutka/gitlabhq,allysonbarros/gitlabhq,t-zuehlsdorff/gitlabhq,larryli/gitlabhq,daiyu/gitlab-zh,ttasanen/gitlabhq,jrjang/gitlab-ce,icedwater/gitlabhq,SVArago/gitlabhq,LUMC/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,dwrensha/gitlabhq,ttasanen/gitlabhq,Soullivaneuh/gitlabhq,martijnvermaat/gitlabhq,Soullivaneuh/gitlabhq,jirutka/gitlabhq,dplarson/gitlabhq,stoplightio/gitlabhq,daiyu/gitlab-zh,daiyu/gitlab-zh,jrjang/gitlab-ce,Soullivaneuh/gitlabhq,shinexiao/gitlabhq,larryli/gitlabhq,allysonbarros/gitlabhq,axilleas/gitlabhq,yatish27/gitlabhq,screenpages/gitlabhq,icedwater/gitlabhq,screenpages/gitlabhq,screenpages/gitlabhq,yatish27/gitlabhq,jrjang/gitlabhq,dplarson/gitlabhq,t-zuehlsdorff/gitlabhq,martijnvermaat/gitlabhq,darkrasid/gitlabhq,ttasanen/gitlabhq,iiet/iiet-git,openwide-java/gitlabhq,icedwater/gitlabhq,jrjang/gitlabhq,mr-dxdy/gitlabhq,axilleas/gitlabhq,darkrasid/gitlabhq,daiyu/gitlab-zh,mmkassem/gitlabhq,LUMC/gitlabhq,shinexiao/gitlabhq,mr-dxdy/gitlabhq,mmkassem/gitlabhq,yatish27/gitlabhq,stoplightio/gitlabhq,SVArago/gitlabhq,screenpages/gitlabhq,jirutka/gitlabhq,icedwater/gitlabhq,dreampet/gitlab,Soullivaneuh/gitlabhq,htve/GitlabForChinese,iiet/iiet-git,mr-dxdy/gitlabhq,shinexiao/gitlabhq,ttasanen/gitlabhq,jrjang/gitlab-ce,LUMC/gitlabhq,allysonbarros/gitlabhq,openwide-java/gitlabhq,jrjang/gitlabhq,dplarson/gitlabhq,dreampet/gitlab,iiet/iiet-git,SVArago/gitlabhq,LUMC/gitlabhq,dwrensha/gitlabhq,dreampet/gitlab,dplarson/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,larryli/gitlabhq,yatish27/gitlabhq,martijnvermaat/gitlabhq,dwrensha/gitlabhq,dwrensha/gitlabhq,mmkassem/gitlabhq,martijnvermaat/gitlabhq,axilleas/gitlabhq,SVArago/gitlabhq,htve/GitlabForChinese,jrjang/gitlabhq,jrjang/gitlab-ce,stoplightio/gitlabhq,darkrasid/gitlabhq,darkrasid/gitlabhq,htve/GitlabForChinese
haml
## Code Before: $('aside.right-sidebar').parent().html("#{escape_javascript(render 'shared/issuable/sidebar', issuable: @issue)}"); $('aside.right-sidebar').effect('highlight') new Issue(); ## Instruction: Fix sidebar replacement for issues & MRs ## Code After: $('aside.right-sidebar')[0].outerHTML = "#{escape_javascript(render 'shared/issuable/sidebar', issuable: @issue)}"); $('aside.right-sidebar').effect('highlight') new Issue();
- $('aside.right-sidebar').parent().html("#{escape_javascript(render 'shared/issuable/sidebar', issuable: @issue)}"); ? ^^ ^^^^^^^^^^^ + $('aside.right-sidebar')[0].outerHTML = "#{escape_javascript(render 'shared/issuable/sidebar', issuable: @issue)}"); ? +++ ^^^^ ^^^^^^^ $('aside.right-sidebar').effect('highlight') new Issue();
2
0.666667
1
1
865c3ff4cc36149047403c76665b42a5efd4f99c
src/main/scala/sangria/macros/derive/GraphQLOutputTypeLookup.scala
src/main/scala/sangria/macros/derive/GraphQLOutputTypeLookup.scala
package sangria.macros.derive import language.higherKinds import sangria.schema._ import scala.annotation.implicitNotFound @implicitNotFound(msg = "Can't find suitable GraphQL output type for ${T}. If you have defined it already, please consider making it implicit and ensure that it's available in the scope.") trait GraphQLOutputTypeLookup[T] { def graphqlType: OutputType[T] } object GraphQLOutputTypeLookup extends GraphQLOutputTypeLookupLowPrio { implicit def outLookup[T](implicit out: OutputType[T]) = new GraphQLOutputTypeLookup[T] { def graphqlType = out } implicit def optionLookup[T : GraphQLOutputTypeLookup] = new GraphQLOutputTypeLookup[Option[T]] { def graphqlType = OptionType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType) } implicit def interfaceLookup[T](implicit int: InterfaceType[_, T]) = new GraphQLOutputTypeLookup[T] { override def graphqlType = int } } trait GraphQLOutputTypeLookupLowPrio { implicit def seqLookup[T : GraphQLOutputTypeLookup, Coll[_] <: Seq[_]] = new GraphQLOutputTypeLookup[Coll[T]] { def graphqlType = ListType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType).asInstanceOf[OutputType[Coll[T]]] } }
package sangria.macros.derive import language.higherKinds import sangria.schema._ import scala.annotation.implicitNotFound @implicitNotFound(msg = "Can't find suitable GraphQL output type for ${T}. If you have defined it already, please consider making it implicit and ensure that it's available in the scope.") trait GraphQLOutputTypeLookup[T] { def graphqlType: OutputType[T] } object GraphQLOutputTypeLookup extends GraphQLOutputTypeLookupLowPrio { implicit def outLookup[T](implicit out: OutputType[T]) = new GraphQLOutputTypeLookup[T] { def graphqlType = out } implicit def optionLookup[T : GraphQLOutputTypeLookup] = new GraphQLOutputTypeLookup[Option[T]] { def graphqlType = OptionType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType) } } trait GraphQLOutputTypeLookupLowPrio { implicit def seqLookup[T : GraphQLOutputTypeLookup, Coll[_] <: Seq[_]] = new GraphQLOutputTypeLookup[Coll[T]] { def graphqlType = ListType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType).asInstanceOf[OutputType[Coll[T]]] } }
Revert "Support implicit output lookups for interface types"
Revert "Support implicit output lookups for interface types"
Scala
apache-2.0
sangria-graphql/sangria
scala
## Code Before: package sangria.macros.derive import language.higherKinds import sangria.schema._ import scala.annotation.implicitNotFound @implicitNotFound(msg = "Can't find suitable GraphQL output type for ${T}. If you have defined it already, please consider making it implicit and ensure that it's available in the scope.") trait GraphQLOutputTypeLookup[T] { def graphqlType: OutputType[T] } object GraphQLOutputTypeLookup extends GraphQLOutputTypeLookupLowPrio { implicit def outLookup[T](implicit out: OutputType[T]) = new GraphQLOutputTypeLookup[T] { def graphqlType = out } implicit def optionLookup[T : GraphQLOutputTypeLookup] = new GraphQLOutputTypeLookup[Option[T]] { def graphqlType = OptionType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType) } implicit def interfaceLookup[T](implicit int: InterfaceType[_, T]) = new GraphQLOutputTypeLookup[T] { override def graphqlType = int } } trait GraphQLOutputTypeLookupLowPrio { implicit def seqLookup[T : GraphQLOutputTypeLookup, Coll[_] <: Seq[_]] = new GraphQLOutputTypeLookup[Coll[T]] { def graphqlType = ListType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType).asInstanceOf[OutputType[Coll[T]]] } } ## Instruction: Revert "Support implicit output lookups for interface types" ## Code After: package sangria.macros.derive import language.higherKinds import sangria.schema._ import scala.annotation.implicitNotFound @implicitNotFound(msg = "Can't find suitable GraphQL output type for ${T}. If you have defined it already, please consider making it implicit and ensure that it's available in the scope.") trait GraphQLOutputTypeLookup[T] { def graphqlType: OutputType[T] } object GraphQLOutputTypeLookup extends GraphQLOutputTypeLookupLowPrio { implicit def outLookup[T](implicit out: OutputType[T]) = new GraphQLOutputTypeLookup[T] { def graphqlType = out } implicit def optionLookup[T : GraphQLOutputTypeLookup] = new GraphQLOutputTypeLookup[Option[T]] { def graphqlType = OptionType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType) } } trait GraphQLOutputTypeLookupLowPrio { implicit def seqLookup[T : GraphQLOutputTypeLookup, Coll[_] <: Seq[_]] = new GraphQLOutputTypeLookup[Coll[T]] { def graphqlType = ListType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType).asInstanceOf[OutputType[Coll[T]]] } }
package sangria.macros.derive import language.higherKinds import sangria.schema._ import scala.annotation.implicitNotFound @implicitNotFound(msg = "Can't find suitable GraphQL output type for ${T}. If you have defined it already, please consider making it implicit and ensure that it's available in the scope.") trait GraphQLOutputTypeLookup[T] { def graphqlType: OutputType[T] } object GraphQLOutputTypeLookup extends GraphQLOutputTypeLookupLowPrio { implicit def outLookup[T](implicit out: OutputType[T]) = new GraphQLOutputTypeLookup[T] { def graphqlType = out } implicit def optionLookup[T : GraphQLOutputTypeLookup] = new GraphQLOutputTypeLookup[Option[T]] { def graphqlType = OptionType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType) } - - implicit def interfaceLookup[T](implicit int: InterfaceType[_, T]) = new GraphQLOutputTypeLookup[T] { - override def graphqlType = int - } } trait GraphQLOutputTypeLookupLowPrio { implicit def seqLookup[T : GraphQLOutputTypeLookup, Coll[_] <: Seq[_]] = new GraphQLOutputTypeLookup[Coll[T]] { def graphqlType = ListType(implicitly[GraphQLOutputTypeLookup[T]].graphqlType).asInstanceOf[OutputType[Coll[T]]] } }
4
0.114286
0
4
b7058edf3c90bcd9e0223ebd5b8a23dae3eb7f30
bower.json
bower.json
{ "name": "SimpleFrontendBoilerplate", "version": "1.0.0", "authors": [], "description": "Simple Frontend Boilerplate", "main": "index.html", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "a0-angular-storage": "~0.0.12", "angular": "1.4.1", "angular-ui-router": "~0.2.15", "font-awesome": "~4.3.0", "jquery": "~2.1.4", "lodash": "~3.10.1", "angular-ui-sortable": "~0.13.4", "angularjs-slider": "~1.0.0", "video.js": "~5.0.2", "famous-angular": "~0.5.2", "moment": "~2.10.6", "vjs-video": "~0.1.1", "angular-moment": "~0.10.3", "ngDraggable": "~0.1.8", "angular-visjs": "~4.0.2" }, "devDependencies": { "angular-mocks": "~1.4.1" }, "resolutions": { "angular": ">= 1.4.8" } }
{ "name": "SimpleFrontendBoilerplate", "version": "1.0.0", "authors": [], "description": "Simple Frontend Boilerplate", "main": "index.html", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "a0-angular-storage": "~0.0.12", "angular": "1.4.1", "angular-ui-router": "~0.2.15", "font-awesome": "~4.3.0", "jquery": "~2.1.4", "lodash": "~3.10.1", "angular-ui-sortable": "~0.13.4", "angularjs-slider": "~1.0.0", "video.js": "~5.0.2", "famous-angular": "~0.5.2", "moment": "~2.10.6", "vjs-video": "~0.1.1", "angular-moment": "~0.10.3", "ngDraggable": "~0.1.8", "angular-visjs": "~4.0.2" }, "devDependencies": { "angular-mocks": "~1.4.1" }, "resolutions": { "angular": ">= 1.4.8", "vis": "~4.10.0" } }
Resolve to vis 4.10.0 and angular 1.4.8
Resolve to vis 4.10.0 and angular 1.4.8
JSON
mit
genu/lowkey,genu/lowkey
json
## Code Before: { "name": "SimpleFrontendBoilerplate", "version": "1.0.0", "authors": [], "description": "Simple Frontend Boilerplate", "main": "index.html", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "a0-angular-storage": "~0.0.12", "angular": "1.4.1", "angular-ui-router": "~0.2.15", "font-awesome": "~4.3.0", "jquery": "~2.1.4", "lodash": "~3.10.1", "angular-ui-sortable": "~0.13.4", "angularjs-slider": "~1.0.0", "video.js": "~5.0.2", "famous-angular": "~0.5.2", "moment": "~2.10.6", "vjs-video": "~0.1.1", "angular-moment": "~0.10.3", "ngDraggable": "~0.1.8", "angular-visjs": "~4.0.2" }, "devDependencies": { "angular-mocks": "~1.4.1" }, "resolutions": { "angular": ">= 1.4.8" } } ## Instruction: Resolve to vis 4.10.0 and angular 1.4.8 ## Code After: { "name": "SimpleFrontendBoilerplate", "version": "1.0.0", "authors": [], "description": "Simple Frontend Boilerplate", "main": "index.html", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "a0-angular-storage": "~0.0.12", "angular": "1.4.1", "angular-ui-router": "~0.2.15", "font-awesome": "~4.3.0", "jquery": "~2.1.4", "lodash": "~3.10.1", "angular-ui-sortable": "~0.13.4", "angularjs-slider": "~1.0.0", "video.js": "~5.0.2", "famous-angular": "~0.5.2", "moment": "~2.10.6", "vjs-video": "~0.1.1", "angular-moment": "~0.10.3", "ngDraggable": "~0.1.8", "angular-visjs": "~4.0.2" }, "devDependencies": { "angular-mocks": "~1.4.1" }, "resolutions": { "angular": ">= 1.4.8", "vis": "~4.10.0" } }
{ "name": "SimpleFrontendBoilerplate", "version": "1.0.0", "authors": [], "description": "Simple Frontend Boilerplate", "main": "index.html", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "a0-angular-storage": "~0.0.12", "angular": "1.4.1", "angular-ui-router": "~0.2.15", "font-awesome": "~4.3.0", "jquery": "~2.1.4", "lodash": "~3.10.1", "angular-ui-sortable": "~0.13.4", "angularjs-slider": "~1.0.0", "video.js": "~5.0.2", "famous-angular": "~0.5.2", "moment": "~2.10.6", "vjs-video": "~0.1.1", "angular-moment": "~0.10.3", "ngDraggable": "~0.1.8", "angular-visjs": "~4.0.2" }, "devDependencies": { "angular-mocks": "~1.4.1" }, "resolutions": { - "angular": ">= 1.4.8" + "angular": ">= 1.4.8", ? + + "vis": "~4.10.0" } }
3
0.078947
2
1
57b6d6dbcee35062083a56bfc81be208b9bab9d2
plugins/imagebam.com.json
plugins/imagebam.com.json
{ "type": "resolver", "ns": "downthemall.net", "prefix": "imagebam.com", "match": "^http://(?:[\\w\\d]+\\.)?imagebam\\.com/image/", "finder": "src=\"(http://(?:[\\w\\d]+\\.)?imagebam\\.com/(dl|download)\\.php.*?)\"", "builder": "{1}", "useServerName": true }
{ "type": "resolver", "ns": "downthemall.net", "prefix": "imagebam.com", "match": "^http://(?:[\\w\\d]+\\.)?imagebam\\.com/image/", "finder": "src=\"(http://(?:[\\w\\d]+\\.)?imagebam\\.com/(dl|download)\\.php.*?)\"", "gone": "has been deleted", "builder": "{1}", "useServerName": true }
Add "gone" to imagebam plugin
Add "gone" to imagebam plugin
JSON
mpl-2.0
downthemall/anticontainer,marianocarrazana/anticontainer,marianocarrazana/anticontainer,downthemall/anticontainer,downthemall/anticontainer,marianocarrazana/anticontainer
json
## Code Before: { "type": "resolver", "ns": "downthemall.net", "prefix": "imagebam.com", "match": "^http://(?:[\\w\\d]+\\.)?imagebam\\.com/image/", "finder": "src=\"(http://(?:[\\w\\d]+\\.)?imagebam\\.com/(dl|download)\\.php.*?)\"", "builder": "{1}", "useServerName": true } ## Instruction: Add "gone" to imagebam plugin ## Code After: { "type": "resolver", "ns": "downthemall.net", "prefix": "imagebam.com", "match": "^http://(?:[\\w\\d]+\\.)?imagebam\\.com/image/", "finder": "src=\"(http://(?:[\\w\\d]+\\.)?imagebam\\.com/(dl|download)\\.php.*?)\"", "gone": "has been deleted", "builder": "{1}", "useServerName": true }
{ "type": "resolver", "ns": "downthemall.net", "prefix": "imagebam.com", "match": "^http://(?:[\\w\\d]+\\.)?imagebam\\.com/image/", "finder": "src=\"(http://(?:[\\w\\d]+\\.)?imagebam\\.com/(dl|download)\\.php.*?)\"", + "gone": "has been deleted", "builder": "{1}", "useServerName": true }
1
0.111111
1
0
b96f72aed202dce28978d838e94c9bd0f09a1b54
cookbooks/google-chrome/recipes/default.rb
cookbooks/google-chrome/recipes/default.rb
apt_repository 'google-chrome-stable' do uri 'http://dl.google.com/linux/chrome/deb' components %w(main stable) key 'https://dl-ssl.google.com/linux/linux_signing_key.pub' end package 'google-chrome-stable'
apt_repository 'google-chrome-stable' do uri 'http://dl.google.com/linux/chrome/deb' components %w(stable main) key 'https://dl-ssl.google.com/linux/linux_signing_key.pub' end package 'google-chrome-stable'
Correct order of google chrome APT repo components
Correct order of google chrome APT repo components
Ruby
mit
dracos/travis-cookbooks,spurti-chopra/travis-cookbooks,ljharb/travis-cookbooks,travis-ci/travis-cookbooks,travis-ci/travis-cookbooks,ljharb/travis-cookbooks,spurti-chopra/travis-cookbooks,travis-ci/travis-cookbooks,dracos/travis-cookbooks,spurti-chopra/travis-cookbooks,ljharb/travis-cookbooks,dracos/travis-cookbooks,dracos/travis-cookbooks
ruby
## Code Before: apt_repository 'google-chrome-stable' do uri 'http://dl.google.com/linux/chrome/deb' components %w(main stable) key 'https://dl-ssl.google.com/linux/linux_signing_key.pub' end package 'google-chrome-stable' ## Instruction: Correct order of google chrome APT repo components ## Code After: apt_repository 'google-chrome-stable' do uri 'http://dl.google.com/linux/chrome/deb' components %w(stable main) key 'https://dl-ssl.google.com/linux/linux_signing_key.pub' end package 'google-chrome-stable'
apt_repository 'google-chrome-stable' do uri 'http://dl.google.com/linux/chrome/deb' - components %w(main stable) ? ----- + components %w(stable main) ? +++++ key 'https://dl-ssl.google.com/linux/linux_signing_key.pub' end package 'google-chrome-stable'
2
0.25
1
1
a38fe83045b7e6ecc6d3787f140ad42e48a6d9e3
src/main/resources/templates/PojoConstructors.ftl
src/main/resources/templates/PojoConstructors.ftl
<#-- /** default constructor */ --> public ${pojo.getDeclarationName()}() { <#if pojo.hasMetaAttribute("generate-uuid")> setId(UUID.randomUUID().toString()); this.isNew = true; </#if> }
<#-- /** default constructor */ --> public ${pojo.getDeclarationName()}() { <#if pojo.hasMetaAttribute("generate-uuid")> setId(UUID.randomUUID().toString()); this.isNew = true; </#if> } <#-- /** copy constructor */ --> <#if pojo.hasMetaAttribute("generate-copy-constructor")> public ${pojo.getDeclarationName()}(${pojo.getDeclarationName()} that) { this(); <#foreach field in pojo.getPropertiesForFullConstructor()> <#if !field.name.equals("id")> <#if c2h.isCollection(field)> this.${field.name}.addAll(that.${field.name}); <#else> this.${field.name} = that.${field.name}; </#if> </#if> </#foreach> } </#if>
Copy constructor has been added to template
Copy constructor has been added to template
FreeMarker
apache-2.0
corballis/treeway
freemarker
## Code Before: <#-- /** default constructor */ --> public ${pojo.getDeclarationName()}() { <#if pojo.hasMetaAttribute("generate-uuid")> setId(UUID.randomUUID().toString()); this.isNew = true; </#if> } ## Instruction: Copy constructor has been added to template ## Code After: <#-- /** default constructor */ --> public ${pojo.getDeclarationName()}() { <#if pojo.hasMetaAttribute("generate-uuid")> setId(UUID.randomUUID().toString()); this.isNew = true; </#if> } <#-- /** copy constructor */ --> <#if pojo.hasMetaAttribute("generate-copy-constructor")> public ${pojo.getDeclarationName()}(${pojo.getDeclarationName()} that) { this(); <#foreach field in pojo.getPropertiesForFullConstructor()> <#if !field.name.equals("id")> <#if c2h.isCollection(field)> this.${field.name}.addAll(that.${field.name}); <#else> this.${field.name} = that.${field.name}; </#if> </#if> </#foreach> } </#if>
<#-- /** default constructor */ --> public ${pojo.getDeclarationName()}() { <#if pojo.hasMetaAttribute("generate-uuid")> setId(UUID.randomUUID().toString()); this.isNew = true; </#if> } + + <#-- /** copy constructor */ --> + <#if pojo.hasMetaAttribute("generate-copy-constructor")> + public ${pojo.getDeclarationName()}(${pojo.getDeclarationName()} that) { + this(); + <#foreach field in pojo.getPropertiesForFullConstructor()> + <#if !field.name.equals("id")> + <#if c2h.isCollection(field)> + this.${field.name}.addAll(that.${field.name}); + <#else> + this.${field.name} = that.${field.name}; + </#if> + </#if> + </#foreach> + } + </#if>
16
2
16
0
182b94f777b1743671b706c939ce14f89c31efca
lint/queue.py
lint/queue.py
from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queue: Can't hit before start." vid = view.id() delay = get_delay() # [seconds] return queue_lint(vid, delay, self._callback) def queue_lint(vid, delay, callback): hit_time = time.monotonic() def worker(): callback(vid, hit_time) try: timers[vid].cancel() except KeyError: pass timers[vid] = timer = threading.Timer(delay, worker) timer.start() return hit_time MIN_DELAY = 0.1 def get_delay(): """Return the delay between a lint request and when it will be processed. If the lint mode is not background, there is no delay. Otherwise, if a "delay" setting is not available in any of the settings, MIN_DELAY is used. """ if persist.settings.get('lint_mode') != 'background': return 0 return persist.settings.get('delay', MIN_DELAY) queue = Daemon()
from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queue: Can't hit before start." vid = view.id() delay = get_delay() # [seconds] return queue_lint(vid, delay, self._callback) def queue_lint(vid, delay, callback): hit_time = time.monotonic() def worker(): callback(vid, hit_time) try: timers[vid].cancel() except KeyError: pass timers[vid] = timer = threading.Timer(delay, worker) timer.start() return hit_time def get_delay(): """Return the delay between a lint request and when it will be processed. If the lint mode is not background, there is no delay. Otherwise, if a "delay" setting is not available in any of the settings, MIN_DELAY is used. """ if persist.settings.get('lint_mode') != 'background': return 0 return persist.settings.get('delay') queue = Daemon()
Remove MIN_DELAY bc a default setting is guaranteed
Remove MIN_DELAY bc a default setting is guaranteed
Python
mit
SublimeLinter/SublimeLinter3,SublimeLinter/SublimeLinter3
python
## Code Before: from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queue: Can't hit before start." vid = view.id() delay = get_delay() # [seconds] return queue_lint(vid, delay, self._callback) def queue_lint(vid, delay, callback): hit_time = time.monotonic() def worker(): callback(vid, hit_time) try: timers[vid].cancel() except KeyError: pass timers[vid] = timer = threading.Timer(delay, worker) timer.start() return hit_time MIN_DELAY = 0.1 def get_delay(): """Return the delay between a lint request and when it will be processed. If the lint mode is not background, there is no delay. Otherwise, if a "delay" setting is not available in any of the settings, MIN_DELAY is used. """ if persist.settings.get('lint_mode') != 'background': return 0 return persist.settings.get('delay', MIN_DELAY) queue = Daemon() ## Instruction: Remove MIN_DELAY bc a default setting is guaranteed ## Code After: from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queue: Can't hit before start." vid = view.id() delay = get_delay() # [seconds] return queue_lint(vid, delay, self._callback) def queue_lint(vid, delay, callback): hit_time = time.monotonic() def worker(): callback(vid, hit_time) try: timers[vid].cancel() except KeyError: pass timers[vid] = timer = threading.Timer(delay, worker) timer.start() return hit_time def get_delay(): """Return the delay between a lint request and when it will be processed. If the lint mode is not background, there is no delay. Otherwise, if a "delay" setting is not available in any of the settings, MIN_DELAY is used. """ if persist.settings.get('lint_mode') != 'background': return 0 return persist.settings.get('delay') queue = Daemon()
from . import persist import time import threading # Map from view_id to threading.Timer objects timers = {} # For compatibility this is a class with unchanged API from SL3. class Daemon: def start(self, callback): self._callback = callback def hit(self, view): assert self._callback, "Queue: Can't hit before start." vid = view.id() delay = get_delay() # [seconds] return queue_lint(vid, delay, self._callback) def queue_lint(vid, delay, callback): hit_time = time.monotonic() def worker(): callback(vid, hit_time) try: timers[vid].cancel() except KeyError: pass timers[vid] = timer = threading.Timer(delay, worker) timer.start() return hit_time - MIN_DELAY = 0.1 - - def get_delay(): """Return the delay between a lint request and when it will be processed. If the lint mode is not background, there is no delay. Otherwise, if a "delay" setting is not available in any of the settings, MIN_DELAY is used. """ if persist.settings.get('lint_mode') != 'background': return 0 - return persist.settings.get('delay', MIN_DELAY) ? ----------- + return persist.settings.get('delay') queue = Daemon()
5
0.089286
1
4
b255d7162f5cc97c0f49e1477608483677335356
init.rb
init.rb
Dir["#{File.dirname(__FILE__)}/lib/**/*.rb"].each { |fn| require fn # E.g. "./lib/active_record/scopes/limit.rb" -> ActiveRecord::Scopes::Limit module_name = fn.sub("./lib/", "").sub(".rb", "").camelize.constantize ActiveRecord::Base.send :include, module_name }
pwd = File.expand_path(File.dirname(__FILE__)) Dir["#{pwd}/lib/**/*.rb"].each { |fn| require fn # E.g. "/path/to/app/vendor/plugins/scopes/lib/active_record/scopes/limit.rb" # -> ActiveRecord::Scopes::Limit module_name = fn.sub("#{pwd}/lib/", "").sub(".rb", "").camelize.constantize ActiveRecord::Base.send :include, module_name }
Use absolute path for module lookup
Bugfix: Use absolute path for module lookup
Ruby
mit
jazen/scopes
ruby
## Code Before: Dir["#{File.dirname(__FILE__)}/lib/**/*.rb"].each { |fn| require fn # E.g. "./lib/active_record/scopes/limit.rb" -> ActiveRecord::Scopes::Limit module_name = fn.sub("./lib/", "").sub(".rb", "").camelize.constantize ActiveRecord::Base.send :include, module_name } ## Instruction: Bugfix: Use absolute path for module lookup ## Code After: pwd = File.expand_path(File.dirname(__FILE__)) Dir["#{pwd}/lib/**/*.rb"].each { |fn| require fn # E.g. "/path/to/app/vendor/plugins/scopes/lib/active_record/scopes/limit.rb" # -> ActiveRecord::Scopes::Limit module_name = fn.sub("#{pwd}/lib/", "").sub(".rb", "").camelize.constantize ActiveRecord::Base.send :include, module_name }
+ pwd = File.expand_path(File.dirname(__FILE__)) + - Dir["#{File.dirname(__FILE__)}/lib/**/*.rb"].each { |fn| ? ^^^^^ ---------------- + Dir["#{pwd}/lib/**/*.rb"].each { |fn| ? ^^ require fn - # E.g. "./lib/active_record/scopes/limit.rb" -> ActiveRecord::Scopes::Limit + # E.g. "/path/to/app/vendor/plugins/scopes/lib/active_record/scopes/limit.rb" + # -> ActiveRecord::Scopes::Limit - module_name = fn.sub("./lib/", "").sub(".rb", "").camelize.constantize ? ^ + module_name = fn.sub("#{pwd}/lib/", "").sub(".rb", "").camelize.constantize ? ^^^^^^ ActiveRecord::Base.send :include, module_name }
9
1.125
6
3
08ad04c43e7e826a8245a284b5ad8133ae878194
bower.json
bower.json
{ "name": "OSF", "dependencies": { "jQuery": ">=2.1.0", "jquery-ui": "~1.10.4", "bootstrap": "~3.1.1", "requirejs": "~2.1.11", "zeroclipboard": "~1.3.5", "hgrid": "https://github.com/CenterForOpenScience/hgrid.git#f0efa5807e21f9894fa38f1d4f0c7d9d86f8b23e", "moment": "~2.7.0", "select2": "~3.5.1" } }
{ "name": "OSF", "dependencies": { "jQuery": ">=2.1.0", "jquery-ui": "~1.10.4", "bootstrap": "~3.1.1", "requirejs": "~2.1.11", "zeroclipboard": "~1.3.5", "hgrid": ">=0.2.1", "moment": "~2.7.0", "select2": "~3.5.1" } }
Update hgrid version requirement (>= 0.2.1)
Update hgrid version requirement (>= 0.2.1) This fully resolves CenterForOpenScience/openscienceframework.org#837
JSON
apache-2.0
arpitar/osf.io,icereval/osf.io,revanthkolli/osf.io,aaxelb/osf.io,kwierman/osf.io,danielneis/osf.io,caseyrygt/osf.io,baylee-d/osf.io,lamdnhan/osf.io,alexschiller/osf.io,amyshi188/osf.io,ZobairAlijan/osf.io,jolene-esposito/osf.io,sloria/osf.io,jmcarp/osf.io,asanfilippo7/osf.io,zachjanicki/osf.io,DanielSBrown/osf.io,ticklemepierce/osf.io,mfraezz/osf.io,pattisdr/osf.io,samanehsan/osf.io,dplorimer/osf,rdhyee/osf.io,saradbowman/osf.io,bdyetton/prettychart,jinluyuan/osf.io,Johnetordoff/osf.io,ZobairAlijan/osf.io,ticklemepierce/osf.io,dplorimer/osf,billyhunt/osf.io,dplorimer/osf,reinaH/osf.io,monikagrabowska/osf.io,zachjanicki/osf.io,crcresearch/osf.io,TomHeatwole/osf.io,DanielSBrown/osf.io,njantrania/osf.io,acshi/osf.io,jnayak1/osf.io,caseyrollins/osf.io,fabianvf/osf.io,SSJohns/osf.io,doublebits/osf.io,billyhunt/osf.io,cwisecarver/osf.io,monikagrabowska/osf.io,Nesiehr/osf.io,emetsger/osf.io,mluo613/osf.io,abought/osf.io,danielneis/osf.io,samchrisinger/osf.io,revanthkolli/osf.io,bdyetton/prettychart,sbt9uc/osf.io,kwierman/osf.io,jinluyuan/osf.io,zkraime/osf.io,rdhyee/osf.io,njantrania/osf.io,petermalcolm/osf.io,GageGaskins/osf.io,laurenrevere/osf.io,SSJohns/osf.io,jnayak1/osf.io,asanfilippo7/osf.io,adlius/osf.io,wearpants/osf.io,TomHeatwole/osf.io,jeffreyliu3230/osf.io,monikagrabowska/osf.io,dplorimer/osf,lyndsysimon/osf.io,TomBaxter/osf.io,mfraezz/osf.io,mluke93/osf.io,binoculars/osf.io,caneruguz/osf.io,fabianvf/osf.io,hmoco/osf.io,jmcarp/osf.io,lamdnhan/osf.io,caseyrygt/osf.io,cldershem/osf.io,MerlinZhang/osf.io,icereval/osf.io,kch8qx/osf.io,mluo613/osf.io,cldershem/osf.io,leb2dg/osf.io,mluke93/osf.io,kch8qx/osf.io,caseyrollins/osf.io,TomBaxter/osf.io,samanehsan/osf.io,sbt9uc/osf.io,jeffreyliu3230/osf.io,HarryRybacki/osf.io,ticklemepierce/osf.io,RomanZWang/osf.io,leb2dg/osf.io,mattclark/osf.io,reinaH/osf.io,Ghalko/osf.io,billyhunt/osf.io,zkraime/osf.io,KAsante95/osf.io,zamattiac/osf.io,sbt9uc/osf.io,chennan47/osf.io,jolene-esposito/osf.io,jolene-esposito/osf.io,mluke93/osf.io,GaryKriebel/osf.io,wearpants/osf.io,mluo613/osf.io,arpitar/osf.io,samchrisinger/osf.io,mluo613/osf.io,ckc6cz/osf.io,jmcarp/osf.io,cldershem/osf.io,asanfilippo7/osf.io,felliott/osf.io,kch8qx/osf.io,brianjgeiger/osf.io,petermalcolm/osf.io,laurenrevere/osf.io,barbour-em/osf.io,caneruguz/osf.io,arpitar/osf.io,kushG/osf.io,monikagrabowska/osf.io,caneruguz/osf.io,ticklemepierce/osf.io,alexschiller/osf.io,RomanZWang/osf.io,himanshuo/osf.io,ckc6cz/osf.io,kwierman/osf.io,cosenal/osf.io,Nesiehr/osf.io,cosenal/osf.io,SSJohns/osf.io,revanthkolli/osf.io,pattisdr/osf.io,fabianvf/osf.io,RomanZWang/osf.io,zamattiac/osf.io,binoculars/osf.io,caseyrygt/osf.io,GaryKriebel/osf.io,brandonPurvis/osf.io,GageGaskins/osf.io,abought/osf.io,doublebits/osf.io,acshi/osf.io,sbt9uc/osf.io,alexschiller/osf.io,njantrania/osf.io,MerlinZhang/osf.io,acshi/osf.io,zamattiac/osf.io,wearpants/osf.io,samchrisinger/osf.io,himanshuo/osf.io,hmoco/osf.io,barbour-em/osf.io,lyndsysimon/osf.io,haoyuchen1992/osf.io,kch8qx/osf.io,brandonPurvis/osf.io,chrisseto/osf.io,cslzchen/osf.io,binoculars/osf.io,cwisecarver/osf.io,GageGaskins/osf.io,bdyetton/prettychart,amyshi188/osf.io,mluo613/osf.io,jnayak1/osf.io,samchrisinger/osf.io,lamdnhan/osf.io,mattclark/osf.io,kch8qx/osf.io,doublebits/osf.io,GaryKriebel/osf.io,asanfilippo7/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,TomBaxter/osf.io,Johnetordoff/osf.io,cosenal/osf.io,brandonPurvis/osf.io,crcresearch/osf.io,zkraime/osf.io,Ghalko/osf.io,KAsante95/osf.io,laurenrevere/osf.io,Ghalko/osf.io,felliott/osf.io,CenterForOpenScience/osf.io,KAsante95/osf.io,sloria/osf.io,jinluyuan/osf.io,cslzchen/osf.io,amyshi188/osf.io,saradbowman/osf.io,jolene-esposito/osf.io,ZobairAlijan/osf.io,chennan47/osf.io,zachjanicki/osf.io,kushG/osf.io,RomanZWang/osf.io,Nesiehr/osf.io,HarryRybacki/osf.io,jinluyuan/osf.io,erinspace/osf.io,petermalcolm/osf.io,KAsante95/osf.io,brandonPurvis/osf.io,zamattiac/osf.io,njantrania/osf.io,jnayak1/osf.io,monikagrabowska/osf.io,haoyuchen1992/osf.io,emetsger/osf.io,abought/osf.io,zkraime/osf.io,baylee-d/osf.io,ckc6cz/osf.io,CenterForOpenScience/osf.io,aaxelb/osf.io,haoyuchen1992/osf.io,acshi/osf.io,lamdnhan/osf.io,caseyrygt/osf.io,danielneis/osf.io,doublebits/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,lyndsysimon/osf.io,KAsante95/osf.io,HarryRybacki/osf.io,felliott/osf.io,SSJohns/osf.io,mfraezz/osf.io,chrisseto/osf.io,aaxelb/osf.io,GageGaskins/osf.io,TomHeatwole/osf.io,DanielSBrown/osf.io,GaryKriebel/osf.io,cwisecarver/osf.io,mfraezz/osf.io,icereval/osf.io,pattisdr/osf.io,revanthkolli/osf.io,HalcyonChimera/osf.io,emetsger/osf.io,zachjanicki/osf.io,amyshi188/osf.io,MerlinZhang/osf.io,chennan47/osf.io,Nesiehr/osf.io,rdhyee/osf.io,arpitar/osf.io,kushG/osf.io,cslzchen/osf.io,adlius/osf.io,hmoco/osf.io,jmcarp/osf.io,felliott/osf.io,alexschiller/osf.io,AndrewSallans/osf.io,caseyrollins/osf.io,Ghalko/osf.io,jeffreyliu3230/osf.io,DanielSBrown/osf.io,AndrewSallans/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,hmoco/osf.io,cwisecarver/osf.io,samanehsan/osf.io,caneruguz/osf.io,leb2dg/osf.io,HalcyonChimera/osf.io,danielneis/osf.io,abought/osf.io,himanshuo/osf.io,CenterForOpenScience/osf.io,HalcyonChimera/osf.io,chrisseto/osf.io,erinspace/osf.io,RomanZWang/osf.io,adlius/osf.io,TomHeatwole/osf.io,cslzchen/osf.io,crcresearch/osf.io,cosenal/osf.io,brandonPurvis/osf.io,lyndsysimon/osf.io,billyhunt/osf.io,doublebits/osf.io,rdhyee/osf.io,ckc6cz/osf.io,acshi/osf.io,emetsger/osf.io,erinspace/osf.io,chrisseto/osf.io,brianjgeiger/osf.io,adlius/osf.io,HalcyonChimera/osf.io,cldershem/osf.io,wearpants/osf.io,barbour-em/osf.io,himanshuo/osf.io,MerlinZhang/osf.io,reinaH/osf.io,brianjgeiger/osf.io,mattclark/osf.io,bdyetton/prettychart,petermalcolm/osf.io,samanehsan/osf.io,barbour-em/osf.io,jeffreyliu3230/osf.io,mluke93/osf.io,HarryRybacki/osf.io,billyhunt/osf.io,sloria/osf.io,fabianvf/osf.io,kushG/osf.io,alexschiller/osf.io,reinaH/osf.io,leb2dg/osf.io,kwierman/osf.io,GageGaskins/osf.io,ZobairAlijan/osf.io,haoyuchen1992/osf.io
json
## Code Before: { "name": "OSF", "dependencies": { "jQuery": ">=2.1.0", "jquery-ui": "~1.10.4", "bootstrap": "~3.1.1", "requirejs": "~2.1.11", "zeroclipboard": "~1.3.5", "hgrid": "https://github.com/CenterForOpenScience/hgrid.git#f0efa5807e21f9894fa38f1d4f0c7d9d86f8b23e", "moment": "~2.7.0", "select2": "~3.5.1" } } ## Instruction: Update hgrid version requirement (>= 0.2.1) This fully resolves CenterForOpenScience/openscienceframework.org#837 ## Code After: { "name": "OSF", "dependencies": { "jQuery": ">=2.1.0", "jquery-ui": "~1.10.4", "bootstrap": "~3.1.1", "requirejs": "~2.1.11", "zeroclipboard": "~1.3.5", "hgrid": ">=0.2.1", "moment": "~2.7.0", "select2": "~3.5.1" } }
{ "name": "OSF", "dependencies": { "jQuery": ">=2.1.0", "jquery-ui": "~1.10.4", "bootstrap": "~3.1.1", "requirejs": "~2.1.11", "zeroclipboard": "~1.3.5", - "hgrid": "https://github.com/CenterForOpenScience/hgrid.git#f0efa5807e21f9894fa38f1d4f0c7d9d86f8b23e", + "hgrid": ">=0.2.1", "moment": "~2.7.0", "select2": "~3.5.1" } }
2
0.153846
1
1
c7a74535cafbf8f7de5577016099cbd56ad5c82b
scss/_regions/_container.scss
scss/_regions/_container.scss
// Standard container for centered 12-column layouts. Collapses to full-width on mobile. // Modifier classes can be applied to the wrapper to create different layouts. // // .-narrow - Three-quarters width container. // .-half - Half-width container, can be placed side-by-side to create two-column layouts. // // Styleguide Container .container { @include clearfix(); > .wrapper { position: relative; padding: $base-spacing; @include media($tablet) { @include span(12); @include push(2); } &.-narrow { @include media($tablet) { @include span(9); } } &.-half { @include media($tablet) { @include span(6); &:nth-of-type(2) { @include push(0); } } } } } // JS Enabled .js { .container__body { p + .tabbed { margin-top: 9px; } } }
// Standard container for centered 12-column layouts. Collapses to full-width on mobile. // Modifier classes can be applied to the wrapper to create different layouts. // // .-narrow - Three-quarters width container. // .-half - Half-width container, can be placed side-by-side to create two-column layouts. // // Styleguide Container .container { @include clearfix; > .wrapper { position: relative; padding: $base-spacing; @include media($tablet) { @include span(12); @include push(2); } &.-narrow { @include media($tablet) { @include span(9); } } &.-half { @include media($tablet) { @include span(6); &:nth-of-type(2n+1) { clear: both; } &:nth-of-type(2n) { @include push(0); } } } } } // JS Enabled .js { .container__body { p + .tabbed { margin-top: 9px; } } }
Fix "half" container display issue.
Fix "half" container display issue.
SCSS
mit
sbsmith86/neue,DoSomething/forge,DoSomething/neue
scss
## Code Before: // Standard container for centered 12-column layouts. Collapses to full-width on mobile. // Modifier classes can be applied to the wrapper to create different layouts. // // .-narrow - Three-quarters width container. // .-half - Half-width container, can be placed side-by-side to create two-column layouts. // // Styleguide Container .container { @include clearfix(); > .wrapper { position: relative; padding: $base-spacing; @include media($tablet) { @include span(12); @include push(2); } &.-narrow { @include media($tablet) { @include span(9); } } &.-half { @include media($tablet) { @include span(6); &:nth-of-type(2) { @include push(0); } } } } } // JS Enabled .js { .container__body { p + .tabbed { margin-top: 9px; } } } ## Instruction: Fix "half" container display issue. ## Code After: // Standard container for centered 12-column layouts. Collapses to full-width on mobile. // Modifier classes can be applied to the wrapper to create different layouts. // // .-narrow - Three-quarters width container. // .-half - Half-width container, can be placed side-by-side to create two-column layouts. // // Styleguide Container .container { @include clearfix; > .wrapper { position: relative; padding: $base-spacing; @include media($tablet) { @include span(12); @include push(2); } &.-narrow { @include media($tablet) { @include span(9); } } &.-half { @include media($tablet) { @include span(6); &:nth-of-type(2n+1) { clear: both; } &:nth-of-type(2n) { @include push(0); } } } } } // JS Enabled .js { .container__body { p + .tabbed { margin-top: 9px; } } }
// Standard container for centered 12-column layouts. Collapses to full-width on mobile. // Modifier classes can be applied to the wrapper to create different layouts. // // .-narrow - Three-quarters width container. // .-half - Half-width container, can be placed side-by-side to create two-column layouts. // // Styleguide Container .container { - @include clearfix(); ? -- + @include clearfix; > .wrapper { position: relative; padding: $base-spacing; @include media($tablet) { @include span(12); @include push(2); } &.-narrow { @include media($tablet) { @include span(9); } } &.-half { @include media($tablet) { @include span(6); + &:nth-of-type(2n+1) { + clear: both; + } + - &:nth-of-type(2) { + &:nth-of-type(2n) { ? + @include push(0); } } } } } // JS Enabled .js { .container__body { p + .tabbed { margin-top: 9px; } } }
8
0.173913
6
2
5c3039cccc06ecc0fa32ece6468b6e6a3d14a499
README.md
README.md
casmi =====
casmi ===== `` $ cd path/to/casmi $ mkdir build && cd build $ cmake .. $ make ``` Tests ------------------------ At the moment `ctest` is used for the integration tests. To run the tests, use `make check`. To pass options to `ctest` use `make ARGS="-E foo"`
Add simple readme with build instructions
Add simple readme with build instructions
Markdown
bsd-3-clause
fhahn/casmi,fhahn/casmi,fhahn/casmi
markdown
## Code Before: casmi ===== ## Instruction: Add simple readme with build instructions ## Code After: casmi ===== `` $ cd path/to/casmi $ mkdir build && cd build $ cmake .. $ make ``` Tests ------------------------ At the moment `ctest` is used for the integration tests. To run the tests, use `make check`. To pass options to `ctest` use `make ARGS="-E foo"`
casmi ===== + + `` + $ cd path/to/casmi + $ mkdir build && cd build + $ cmake .. + $ make + ``` + + + Tests + ------------------------ + + At the moment `ctest` is used for the integration tests. + To run the tests, use `make check`. + + To pass options to `ctest` use `make ARGS="-E foo"`
16
8
16
0
ebc64681781b3d791c3de6f7b1e9427f15e67004
.decent_ci-Windows.yaml
.decent_ci-Windows.yaml
compilers: - name: Visual Studio version: 14 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 14 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% skip_packaging: true - name: Visual Studio version: 12 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% - name: Visual Studio version: 12 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze
compilers: - name: Visual Studio version: 14 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 14 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 12 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% - name: Visual Studio version: 12 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA%
Remove all /analyze from VS12, it's too slow
Remove all /analyze from VS12, it's too slow But still use it on VS14
YAML
bsd-3-clause
bradparks/ChaiScript__cplusplus_scripting_language,bradparks/ChaiScript__cplusplus_scripting_language,bradparks/ChaiScript__cplusplus_scripting_language
yaml
## Code Before: compilers: - name: Visual Studio version: 14 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 14 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% skip_packaging: true - name: Visual Studio version: 12 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% - name: Visual Studio version: 12 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze ## Instruction: Remove all /analyze from VS12, it's too slow But still use it on VS14 ## Code After: compilers: - name: Visual Studio version: 14 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 14 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 12 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% - name: Visual Studio version: 12 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA%
compilers: - name: Visual Studio version: 14 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 14 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% + compiler_extra_flags: /analyze skip_packaging: true - name: Visual Studio version: 12 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% - name: Visual Studio version: 12 architecture: Win64 cmake_extra_flags: -DBUILD_SAMPLES:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% - compiler_extra_flags: /analyze
2
0.1
1
1
6b4efd3c708f21d6dbe4aa9ef82b7ed377b1269a
manifest.json
manifest.json
{ "name": "Tabs Clusterized", "version": "0.1.5", "manifest_version": 2, "description": "Tabs Clusterizer", "icons": { "16": "img/icon_16.png", "32": "img/icon_32.png", "256": "img/icon_256.png" }, "browser_action": { "default_popup": "html/popup.html" }, "commands": { "_execute_browser_action": { "suggested_key": { "default": "Alt+C", "mac": "Alt+C", "linux": "Alt+C", "windows": "Alt+C" } } }, "permissions": ["tabs", "http://*/", "https://*/"], "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": [ "js/jquery.js", "js/scraper.js" ] }], "background": { "scripts": ["js/background.js"] }, "web_accessible_resources": [] }
{ "name": "Tabs Clusterized", "version": "0.1.5", "manifest_version": 2, "offline_enabled": true, "description": "Tabs Clusterizer", "icons": { "16": "img/icon_16.png", "32": "img/icon_32.png", "256": "img/icon_256.png" }, "browser_action": { "default_popup": "html/popup.html" }, "commands": { "_execute_browser_action": { "suggested_key": { "default": "Alt+C", "mac": "Alt+C", "linux": "Alt+C", "windows": "Alt+C" } } }, "permissions": ["tabs", "http://*/", "https://*/"], "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": [ "js/jquery.js", "js/scraper.js" ] }], "background": { "scripts": ["js/background.js"] }, "web_accessible_resources": [] }
Make extension work in offline mode
update: Make extension work in offline mode * Setting 'offline_enabled' should make the extension work in offline mode. Signed-off-by: mr.Shu <8e7be411ad89ade93d144531f3925d0bb4011004@shu.io>
JSON
apache-2.0
mrshu/chrome-clusterizer,mrshu/chrome-clusterizer
json
## Code Before: { "name": "Tabs Clusterized", "version": "0.1.5", "manifest_version": 2, "description": "Tabs Clusterizer", "icons": { "16": "img/icon_16.png", "32": "img/icon_32.png", "256": "img/icon_256.png" }, "browser_action": { "default_popup": "html/popup.html" }, "commands": { "_execute_browser_action": { "suggested_key": { "default": "Alt+C", "mac": "Alt+C", "linux": "Alt+C", "windows": "Alt+C" } } }, "permissions": ["tabs", "http://*/", "https://*/"], "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": [ "js/jquery.js", "js/scraper.js" ] }], "background": { "scripts": ["js/background.js"] }, "web_accessible_resources": [] } ## Instruction: update: Make extension work in offline mode * Setting 'offline_enabled' should make the extension work in offline mode. Signed-off-by: mr.Shu <8e7be411ad89ade93d144531f3925d0bb4011004@shu.io> ## Code After: { "name": "Tabs Clusterized", "version": "0.1.5", "manifest_version": 2, "offline_enabled": true, "description": "Tabs Clusterizer", "icons": { "16": "img/icon_16.png", "32": "img/icon_32.png", "256": "img/icon_256.png" }, "browser_action": { "default_popup": "html/popup.html" }, "commands": { "_execute_browser_action": { "suggested_key": { "default": "Alt+C", "mac": "Alt+C", "linux": "Alt+C", "windows": "Alt+C" } } }, "permissions": ["tabs", "http://*/", "https://*/"], "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": [ "js/jquery.js", "js/scraper.js" ] }], "background": { "scripts": ["js/background.js"] }, "web_accessible_resources": [] }
{ "name": "Tabs Clusterized", "version": "0.1.5", "manifest_version": 2, + "offline_enabled": true, "description": "Tabs Clusterizer", "icons": { "16": "img/icon_16.png", "32": "img/icon_32.png", "256": "img/icon_256.png" }, "browser_action": { "default_popup": "html/popup.html" }, "commands": { "_execute_browser_action": { "suggested_key": { "default": "Alt+C", "mac": "Alt+C", "linux": "Alt+C", "windows": "Alt+C" } } }, "permissions": ["tabs", "http://*/", "https://*/"], "content_scripts": [{ "matches": ["http://*/*", "https://*/*"], "js": [ "js/jquery.js", "js/scraper.js" ] }], "background": { "scripts": ["js/background.js"] }, "web_accessible_resources": [] }
1
0.027778
1
0
b2d6e3a0a69915c0cdcd5dfdc29403f5306b9308
lib/flyover_comments/authorization.rb
lib/flyover_comments/authorization.rb
module FlyoverComments module Authorization def can_delete_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.destroy? elsif user.respond_to?(:can_delete_flyover_comment?) user.can_delete_flyover_comment?(comment) else comment.user == user end end def can_create_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_create_flyover_comment?) user.can_create_flyover_comment?(comment) else comment.user == user end end def can_flag_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_flag_flyover_comment?) user.can_flag_flyover_comment?(comment) else !user.nil? end end end end
module FlyoverComments module Authorization def can_delete_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.destroy? elsif user.respond_to?(:can_delete_flyover_comment?) user.can_delete_flyover_comment?(comment) else comment.user == user end end def can_create_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_create_flyover_comment?) user.can_create_flyover_comment?(comment) else comment.user == user end end def can_flag_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, FlyoverComments::Flag.new(comment: comment, user: user)) policy.create? elsif user.respond_to?(:can_flag_flyover_comment?) user.can_flag_flyover_comment?(comment) else !user.nil? end end end end
Make pundit use a flag policy, not comment policy if app is using pundit
Make pundit use a flag policy, not comment policy if app is using pundit
Ruby
mit
CultivateLabs/flyover_comments,FlyoverWorks/flyover_comments,CultivateLabs/flyover_comments,FlyoverWorks/flyover_comments,CultivateLabs/flyover_comments,FlyoverWorks/flyover_comments
ruby
## Code Before: module FlyoverComments module Authorization def can_delete_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.destroy? elsif user.respond_to?(:can_delete_flyover_comment?) user.can_delete_flyover_comment?(comment) else comment.user == user end end def can_create_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_create_flyover_comment?) user.can_create_flyover_comment?(comment) else comment.user == user end end def can_flag_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_flag_flyover_comment?) user.can_flag_flyover_comment?(comment) else !user.nil? end end end end ## Instruction: Make pundit use a flag policy, not comment policy if app is using pundit ## Code After: module FlyoverComments module Authorization def can_delete_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.destroy? elsif user.respond_to?(:can_delete_flyover_comment?) user.can_delete_flyover_comment?(comment) else comment.user == user end end def can_create_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_create_flyover_comment?) user.can_create_flyover_comment?(comment) else comment.user == user end end def can_flag_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, FlyoverComments::Flag.new(comment: comment, user: user)) policy.create? elsif user.respond_to?(:can_flag_flyover_comment?) user.can_flag_flyover_comment?(comment) else !user.nil? end end end end
module FlyoverComments module Authorization def can_delete_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.destroy? elsif user.respond_to?(:can_delete_flyover_comment?) user.can_delete_flyover_comment?(comment) else comment.user == user end end def can_create_flyover_comment?(comment, user) if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) policy.create? elsif user.respond_to?(:can_create_flyover_comment?) user.can_create_flyover_comment?(comment) else comment.user == user end end def can_flag_flyover_comment?(comment, user) - if Object.const_defined?("Pundit") && policy = Pundit.policy(user, comment) + if Object.const_defined?("Pundit") && policy = Pundit.policy(user, FlyoverComments::Flag.new(comment: comment, user: user)) ? ++++++++++++++++++++++++++ +++++++++++++++++++++ + policy.create? elsif user.respond_to?(:can_flag_flyover_comment?) user.can_flag_flyover_comment?(comment) else !user.nil? end end end end
2
0.057143
1
1
99be43b2815017a33760a42dc95c3253da0e8c72
mfa-neotree/packages.el
mfa-neotree/packages.el
(defconst mfa-neotree-packages '(neotree)) (defun mfa-neotree/post-init-neotree () ;; Bind neotree-find to a key. (spacemacs/set-leader-keys "fd" #'neotree-find) (with-eval-after-load 'neotree ;; Enlarge the NeoTree window. (setq neo-window-width 40)
(defconst mfa-neotree-packages '(all-the-icons neotree)) (defun mfa-neotree/init-all-the-icons () (use-package all-the-icons :defer t :config ;; Don't waste valuable window real-estate. (setq all-the-icons-scale-factor 1.0))) (defun mfa-neotree/post-init-neotree () ;; Bind neotree-find to a key. (spacemacs/set-leader-keys "fd" #'neotree-find) (with-eval-after-load 'neotree ;; Make the tree more fancy. (setq neo-theme (if window-system 'icons 'arrow)) ;; Enlarge the NeoTree window. (setq neo-window-width 40)))
Add all-the-icons, use it as fancy icon theme for neotree
Add all-the-icons, use it as fancy icon theme for neotree
Emacs Lisp
mit
amfranz/spacemacs.d
emacs-lisp
## Code Before: (defconst mfa-neotree-packages '(neotree)) (defun mfa-neotree/post-init-neotree () ;; Bind neotree-find to a key. (spacemacs/set-leader-keys "fd" #'neotree-find) (with-eval-after-load 'neotree ;; Enlarge the NeoTree window. (setq neo-window-width 40) ## Instruction: Add all-the-icons, use it as fancy icon theme for neotree ## Code After: (defconst mfa-neotree-packages '(all-the-icons neotree)) (defun mfa-neotree/init-all-the-icons () (use-package all-the-icons :defer t :config ;; Don't waste valuable window real-estate. (setq all-the-icons-scale-factor 1.0))) (defun mfa-neotree/post-init-neotree () ;; Bind neotree-find to a key. (spacemacs/set-leader-keys "fd" #'neotree-find) (with-eval-after-load 'neotree ;; Make the tree more fancy. (setq neo-theme (if window-system 'icons 'arrow)) ;; Enlarge the NeoTree window. (setq neo-window-width 40)))
- (defconst mfa-neotree-packages '(neotree)) + (defconst mfa-neotree-packages '(all-the-icons neotree)) ? ++++++++++++++ + + (defun mfa-neotree/init-all-the-icons () + (use-package all-the-icons + :defer t + :config + ;; Don't waste valuable window real-estate. + (setq all-the-icons-scale-factor 1.0))) (defun mfa-neotree/post-init-neotree () ;; Bind neotree-find to a key. (spacemacs/set-leader-keys "fd" #'neotree-find) (with-eval-after-load 'neotree + + ;; Make the tree more fancy. + (setq neo-theme (if window-system 'icons 'arrow)) + ;; Enlarge the NeoTree window. - (setq neo-window-width 40) + (setq neo-window-width 40))) ? ++ -
16
1.6
13
3
61ab3c470691585d77cb7401ca599c14793f29a7
app/views/ilohv/files/_file.json.jbuilder
app/views/ilohv/files/_file.json.jbuilder
json.partial! 'ilohv/nodes/node', node: file
json.partial! 'ilohv/nodes/node', node: file json.size file.size json.content_type file.content_type json.extension file.extension
Add more fields to JSON API
Add more fields to JSON API
Ruby
mit
clemens/ilohv
ruby
## Code Before: json.partial! 'ilohv/nodes/node', node: file ## Instruction: Add more fields to JSON API ## Code After: json.partial! 'ilohv/nodes/node', node: file json.size file.size json.content_type file.content_type json.extension file.extension
json.partial! 'ilohv/nodes/node', node: file + + json.size file.size + json.content_type file.content_type + json.extension file.extension
4
4
4
0
fd6ff30dd4f0e10798a5b6a797ee5479788746eb
spec/boostrap_spec.rb
spec/boostrap_spec.rb
require 'spec_helper' describe "#bootstrap" do let(:user) { ENV['HEROKU_USER'] } let(:password) { ENV['HEROKU_PASSWORD'] } let(:client) { Heroku::Client.new(user, password) } let(:command) { Heroku::Command::Json.new } it "bootstrap stuff" do ENV.delete 'HEROKU_APP' command.bootstrap end end
require 'spec_helper' if ENV['HEROKU_APP'] describe "#bootstrap" do let(:user) { ENV['HEROKU_USER'] } let(:password) { ENV['HEROKU_PASSWORD'] } let(:client) { Heroku::Client.new(user, password) } let(:command) { Heroku::Command::Json.new } it "bootstrap stuff" do ENV.delete 'HEROKU_APP' command.bootstrap end end end
Disable integration tests if there is no heroku app configured
Disable integration tests if there is no heroku app configured
Ruby
mit
rainforestapp/heroku.json
ruby
## Code Before: require 'spec_helper' describe "#bootstrap" do let(:user) { ENV['HEROKU_USER'] } let(:password) { ENV['HEROKU_PASSWORD'] } let(:client) { Heroku::Client.new(user, password) } let(:command) { Heroku::Command::Json.new } it "bootstrap stuff" do ENV.delete 'HEROKU_APP' command.bootstrap end end ## Instruction: Disable integration tests if there is no heroku app configured ## Code After: require 'spec_helper' if ENV['HEROKU_APP'] describe "#bootstrap" do let(:user) { ENV['HEROKU_USER'] } let(:password) { ENV['HEROKU_PASSWORD'] } let(:client) { Heroku::Client.new(user, password) } let(:command) { Heroku::Command::Json.new } it "bootstrap stuff" do ENV.delete 'HEROKU_APP' command.bootstrap end end end
require 'spec_helper' + if ENV['HEROKU_APP'] - describe "#bootstrap" do - let(:user) { ENV['HEROKU_USER'] } - let(:password) { ENV['HEROKU_PASSWORD'] } - let(:client) { Heroku::Client.new(user, password) } - let(:command) { Heroku::Command::Json.new } + describe "#bootstrap" do + let(:user) { ENV['HEROKU_USER'] } + let(:password) { ENV['HEROKU_PASSWORD'] } + let(:client) { Heroku::Client.new(user, password) } + let(:command) { Heroku::Command::Json.new } + - it "bootstrap stuff" do + it "bootstrap stuff" do ? ++ - ENV.delete 'HEROKU_APP' + ENV.delete 'HEROKU_APP' ? ++ - command.bootstrap + command.bootstrap ? ++ + end end + end
20
1.538462
12
8
4376f613033865c1b2de77c692967ed97d6fd17a
spec/requests/settlements_spec.rb
spec/requests/settlements_spec.rb
require 'spec_helper' describe SettlementsController do fixtures :users, :accounts, :account_links, :account_link_requests, :preferences set_fixture_class :accounts => Account::Base include_context "太郎 logged in" describe "新しい精算" do context "資産口座が現金しかないとき" do before do AccountLink.destroy_all AccountLinkRequest.destroy_all Account::Asset.destroy_all("asset_kind != 'cache'") visit '/settlements/new' end it "精算機能が利用できないと表示される" do page.should have_content("精算対象となる口座(債権、クレジットカード)が1つも登録されていないため、精算機能は利用できません。") end end end end
require 'spec_helper' describe SettlementsController do fixtures :users, :accounts, :account_links, :account_link_requests, :preferences set_fixture_class :accounts => Account::Base include_context "太郎 logged in" describe "新しい精算" do context "資産口座が現金しかないとき" do before do AccountLink.destroy_all AccountLinkRequest.destroy_all Account::Asset.destroy_all("asset_kind != 'cache'") visit '/settlements/new' end it "精算機能が利用できないと表示される" do page.should have_content("精算対象となる口座(債権、クレジットカード)が1つも登録されていないため、精算機能は利用できません。") end end context "資産口座にカードがあるとき" do context "対象記入がないとき" do before do visit '/settlements/new' end it "口座や期間のフォームがあり、データがない旨が表示される" do page.should have_css("select#settlement_account_id") page.should have_css("select#start_date_year") page.should have_css("select#end_date_day") page.should have_css("div#target_deals") page.should have_content("の未精算取引 は 全0件あります。") end end end end end
Add a request spec for visiting /settlements/new when you have any credit card account.
Add a request spec for visiting /settlements/new when you have any credit card account.
Ruby
bsd-3-clause
yakitorii/kozuchi,everyleaf/kozuchi,everyleaf/kozuchi,upinetree/kozuchi,ymmtmsys/kozuchi,hdyk3118/kozuchi,hdyk3118/kozuchi,upinetree/kozuchi,yakitorii/kozuchi,everyleaf/kozuchi,ymmtmsys/kozuchi
ruby
## Code Before: require 'spec_helper' describe SettlementsController do fixtures :users, :accounts, :account_links, :account_link_requests, :preferences set_fixture_class :accounts => Account::Base include_context "太郎 logged in" describe "新しい精算" do context "資産口座が現金しかないとき" do before do AccountLink.destroy_all AccountLinkRequest.destroy_all Account::Asset.destroy_all("asset_kind != 'cache'") visit '/settlements/new' end it "精算機能が利用できないと表示される" do page.should have_content("精算対象となる口座(債権、クレジットカード)が1つも登録されていないため、精算機能は利用できません。") end end end end ## Instruction: Add a request spec for visiting /settlements/new when you have any credit card account. ## Code After: require 'spec_helper' describe SettlementsController do fixtures :users, :accounts, :account_links, :account_link_requests, :preferences set_fixture_class :accounts => Account::Base include_context "太郎 logged in" describe "新しい精算" do context "資産口座が現金しかないとき" do before do AccountLink.destroy_all AccountLinkRequest.destroy_all Account::Asset.destroy_all("asset_kind != 'cache'") visit '/settlements/new' end it "精算機能が利用できないと表示される" do page.should have_content("精算対象となる口座(債権、クレジットカード)が1つも登録されていないため、精算機能は利用できません。") end end context "資産口座にカードがあるとき" do context "対象記入がないとき" do before do visit '/settlements/new' end it "口座や期間のフォームがあり、データがない旨が表示される" do page.should have_css("select#settlement_account_id") page.should have_css("select#start_date_year") page.should have_css("select#end_date_day") page.should have_css("div#target_deals") page.should have_content("の未精算取引 は 全0件あります。") end end end end end
require 'spec_helper' describe SettlementsController do fixtures :users, :accounts, :account_links, :account_link_requests, :preferences set_fixture_class :accounts => Account::Base include_context "太郎 logged in" describe "新しい精算" do context "資産口座が現金しかないとき" do before do AccountLink.destroy_all AccountLinkRequest.destroy_all Account::Asset.destroy_all("asset_kind != 'cache'") visit '/settlements/new' end it "精算機能が利用できないと表示される" do page.should have_content("精算対象となる口座(債権、クレジットカード)が1つも登録されていないため、精算機能は利用できません。") end end + context "資産口座にカードがあるとき" do + + context "対象記入がないとき" do + before do + visit '/settlements/new' + end + it "口座や期間のフォームがあり、データがない旨が表示される" do + page.should have_css("select#settlement_account_id") + page.should have_css("select#start_date_year") + page.should have_css("select#end_date_day") + page.should have_css("div#target_deals") + page.should have_content("の未精算取引 は 全0件あります。") + end + end + end + end end
16
0.615385
16
0
38b709665f9f0cf91e4cda03db5fecc1fb15b275
src/test/java/com/spotify/jni/ClassWrapperTest.java
src/test/java/com/spotify/jni/ClassWrapperTest.java
package com.spotify.jni; public class ClassWrapperTest { static { System.loadLibrary("JniHelpersTest"); } }
package com.spotify.jni; import org.junit.Test; import static org.junit.Assert.assertEquals; public class ClassWrapperTest { static { System.loadLibrary("JniHelpersTest"); } static final double TEST_FLOAT_TOLERANCE = 0.01; @Test native public void createClassWrapper() throws Exception; @Test native public void getCanonicalName() throws Exception; @Test native public void getSimpleName() throws Exception; @Test native public void merge() throws Exception; native public void nativeSetJavaObject(TestObject object); @Test public void setJavaObject() throws Exception { TestObject object = new TestObject("hello", 1, 3.14f); nativeSetJavaObject(object); } native public TestObject nativeToJavaObject(); @Test public void toJavaObject() throws Exception { TestObject object = nativeToJavaObject(); assertEquals("hello", object.s); assertEquals(1, object.i); assertEquals(3.14, object.f, TEST_FLOAT_TOLERANCE); } @Test native public void getCachedMethod() throws Exception; @Test native public void getCachedField() throws Exception; }
Add test cases for ClassWrapper
Add test cases for ClassWrapper
Java
apache-2.0
spotify/JniHelpers,spotify/JniHelpers,spotify/JniHelpers,spotify/JniHelpers
java
## Code Before: package com.spotify.jni; public class ClassWrapperTest { static { System.loadLibrary("JniHelpersTest"); } } ## Instruction: Add test cases for ClassWrapper ## Code After: package com.spotify.jni; import org.junit.Test; import static org.junit.Assert.assertEquals; public class ClassWrapperTest { static { System.loadLibrary("JniHelpersTest"); } static final double TEST_FLOAT_TOLERANCE = 0.01; @Test native public void createClassWrapper() throws Exception; @Test native public void getCanonicalName() throws Exception; @Test native public void getSimpleName() throws Exception; @Test native public void merge() throws Exception; native public void nativeSetJavaObject(TestObject object); @Test public void setJavaObject() throws Exception { TestObject object = new TestObject("hello", 1, 3.14f); nativeSetJavaObject(object); } native public TestObject nativeToJavaObject(); @Test public void toJavaObject() throws Exception { TestObject object = nativeToJavaObject(); assertEquals("hello", object.s); assertEquals(1, object.i); assertEquals(3.14, object.f, TEST_FLOAT_TOLERANCE); } @Test native public void getCachedMethod() throws Exception; @Test native public void getCachedField() throws Exception; }
package com.spotify.jni; + + import org.junit.Test; + + import static org.junit.Assert.assertEquals; public class ClassWrapperTest { static { System.loadLibrary("JniHelpersTest"); } + + static final double TEST_FLOAT_TOLERANCE = 0.01; + + @Test + native public void createClassWrapper() throws Exception; + + @Test + native public void getCanonicalName() throws Exception; + + @Test + native public void getSimpleName() throws Exception; + + @Test + native public void merge() throws Exception; + + native public void nativeSetJavaObject(TestObject object); + @Test + public void setJavaObject() throws Exception { + TestObject object = new TestObject("hello", 1, 3.14f); + nativeSetJavaObject(object); + } + + native public TestObject nativeToJavaObject(); + @Test + public void toJavaObject() throws Exception { + TestObject object = nativeToJavaObject(); + assertEquals("hello", object.s); + assertEquals(1, object.i); + assertEquals(3.14, object.f, TEST_FLOAT_TOLERANCE); + } + + @Test + native public void getCachedMethod() throws Exception; + + @Test + native public void getCachedField() throws Exception; }
40
5.714286
40
0
74b63067dbe5cc6cf5766bcdb5f50ec0ea7f4e8f
package.json
package.json
{ "dependencies": { "bower": "~1.3.12", "del": "~1.1.1", "gulp": "~3.8.11", "laravel-elixir": "~0.9.1", "laravel-elixir-jshint": "~0.1.6", "array-union": "~1.0.1" } }
{ "dependencies": { "bower": "~1.3.12", "del": "~1.1.1", "gulp": "~3.8.11", "laravel-elixir": "~0.10.0", "array-union": "~1.0.1" }, "devDependencies": { "laravel-elixir-jshint": "^0.1.6" } }
Update version of elixir, devDependencies
Update version of elixir, devDependencies
JSON
bsd-3-clause
withings-sas/Cachet,clbn/Cachet,brianjking/openshift-cachet,coupej/Cachet,whealmedia/Cachet,h3zjp/Cachet,0x73/Cachet,cachethq/Cachet,0x73/Cachet,n0mer/Cachet,g-forks/Cachet,pellaeon/Cachet,elektropay/Cachet,ZengineChris/Cachet,MatheusRV/Cachet-Sandstorm,ematthews/Cachet,alobintechnologies/Cachet,ematthews/Cachet,sapk/Cachet,billmn/Cachet,karaktaka/Cachet,eduardocruz/Cachet,eduardocruz/Cachet,brianjking/openshift-cachet,karaktaka/Cachet,MatheusRV/Cachet-Sandstorm,g-forks/Cachet,NossaJureg/Cachet,billmn/Cachet,wakermahmud/Cachet,MatheusRV/Cachet-Sandstorm,elektropay/Cachet,anujaprasad/Hihat,pellaeon/Cachet,ephillipe/Cachet,chaseconey/Cachet,murendie/Cachet,chaseconey/Cachet,karaktaka/Cachet,Mebus/Cachet,SamuelMoraesF/Cachet,wakermahmud/Cachet,murendie/Cachet,cachethq/Cachet,CloudA/Cachet,chaseconey/Cachet,leegeng/Cachet,bthiago/Cachet,ephillipe/Cachet,sapk/Cachet,leegeng/Cachet,sapk/Cachet,CloudA/Cachet,gm-ah/Cachet,billmn/Cachet,ZengineChris/Cachet,murendie/Cachet,wngravette/Cachet,Mebus/Cachet,alobintechnologies/Cachet,SamuelMoraesF/Cachet,withings-sas/Cachet,bthiago/Cachet,anujaprasad/Hihat,gm-ah/Cachet,rogerapras/Cachet,coupej/Cachet,MatheusRV/Cachet-Sandstorm,eduardocruz/Cachet,bthiago/Cachet,rogerapras/Cachet,NossaJureg/Cachet,ematthews/Cachet,displayn/Cachet,MatheusRV/Cachet-Sandstorm,robglas/Cachet,g-forks/Cachet,NossaJureg/Cachet,nxtreaming/Cachet,whealmedia/Cachet,h3zjp/Cachet,katzien/Cachet,MicroWorldwide/Cachet,wakermahmud/Cachet,withings-sas/Cachet,n0mer/Cachet,coupej/Cachet,pellaeon/Cachet,anujaprasad/Hihat,elektropay/Cachet,ZengineChris/Cachet,clbn/Cachet,wngravette/Cachet,ephillipe/Cachet,robglas/Cachet,Surventrix/Cachet,MicroWorldwide/Cachet,everpay/Cachet,Mebus/Cachet,nxtreaming/Cachet,everpay/Cachet,katzien/Cachet,brianjking/openshift-cachet,h3zjp/Cachet,displayn/Cachet,SamuelMoraesF/Cachet,Surventrix/Cachet,n0mer/Cachet,rogerapras/Cachet
json
## Code Before: { "dependencies": { "bower": "~1.3.12", "del": "~1.1.1", "gulp": "~3.8.11", "laravel-elixir": "~0.9.1", "laravel-elixir-jshint": "~0.1.6", "array-union": "~1.0.1" } } ## Instruction: Update version of elixir, devDependencies ## Code After: { "dependencies": { "bower": "~1.3.12", "del": "~1.1.1", "gulp": "~3.8.11", "laravel-elixir": "~0.10.0", "array-union": "~1.0.1" }, "devDependencies": { "laravel-elixir-jshint": "^0.1.6" } }
{ "dependencies": { "bower": "~1.3.12", "del": "~1.1.1", "gulp": "~3.8.11", - "laravel-elixir": "~0.9.1", ? ^ ^ + "laravel-elixir": "~0.10.0", ? ^^ ^ - "laravel-elixir-jshint": "~0.1.6", "array-union": "~1.0.1" + }, + "devDependencies": { + "laravel-elixir-jshint": "^0.1.6" } }
6
0.6
4
2
51556eb83406cba363d82b565efd7e6051e6a29e
app/overrides/add_print_invoice_to_admin_configuration_sidebar.rb
app/overrides/add_print_invoice_to_admin_configuration_sidebar.rb
Deface::Override.new(virtual_path: 'spree/admin/shared/_configuration_menu', name: 'print_invoice_admin_configurations_menu', insert_bottom: '[data-hook="admin_configurations_sidebar_menu"], #admin_configurations_sidebar_menu[data-hook]', text: '<%= configurations_sidebar_menu_item Spree.t(:settings, scope: :print_invoice), edit_admin_print_invoice_settings_path %>', disabled: false)
Deface::Override.new(virtual_path: 'spree/admin/shared/sub_menu/_configuration', name: 'print_invoice_admin_configurations_menu', insert_bottom: '[data-hook="admin_configurations_sidebar_menu"]', text: '<%= configurations_sidebar_menu_item Spree.t(:settings, scope: :print_invoice), edit_admin_print_invoice_settings_path %>', disabled: false)
Correct menu hook for Spree v3.0.0.beta
Correct menu hook for Spree v3.0.0.beta
Ruby
bsd-3-clause
MercaFly/spree_print_invoice,sunny2601/spree_print_invoice,heritageid/invoice,heritageid/invoice,sunny2601/spree_print_invoice,nebulab/spree_print_invoice,nebulab/spree_print_invoice,simo163/solidus_print_invoice,spree-contrib/spree_print_invoice,maximedelpit/spree_print_invoice,maximedelpit/spree_print_invoice,tgfi/spree_print_invoice,MercaFly/spree_print_invoice,tgfi/spree_print_invoice,heritageid/invoice,simo163/solidus_print_invoice,MercaFly/spree_print_invoice,fajrif/spree_print_invoice,simo163/solidus_print_invoice,FadliKun/spree_print_invoice,spree-contrib/spree_print_invoice,tgfi/spree_print_invoice,adaddeo/spree_print_invoice,fajrif/spree_print_invoice,sunny2601/spree_print_invoice,adaddeo/spree_print_invoice,firmanm/spree_print_invoice,firmanm/spree_print_invoice,fajrif/spree_print_invoice,FadliKun/spree_print_invoice,maximedelpit/spree_print_invoice,FadliKun/spree_print_invoice,firmanm/spree_print_invoice,nebulab/spree_print_invoice,spree-contrib/spree_print_invoice
ruby
## Code Before: Deface::Override.new(virtual_path: 'spree/admin/shared/_configuration_menu', name: 'print_invoice_admin_configurations_menu', insert_bottom: '[data-hook="admin_configurations_sidebar_menu"], #admin_configurations_sidebar_menu[data-hook]', text: '<%= configurations_sidebar_menu_item Spree.t(:settings, scope: :print_invoice), edit_admin_print_invoice_settings_path %>', disabled: false) ## Instruction: Correct menu hook for Spree v3.0.0.beta ## Code After: Deface::Override.new(virtual_path: 'spree/admin/shared/sub_menu/_configuration', name: 'print_invoice_admin_configurations_menu', insert_bottom: '[data-hook="admin_configurations_sidebar_menu"]', text: '<%= configurations_sidebar_menu_item Spree.t(:settings, scope: :print_invoice), edit_admin_print_invoice_settings_path %>', disabled: false)
- Deface::Override.new(virtual_path: 'spree/admin/shared/_configuration_menu', ? ----- + Deface::Override.new(virtual_path: 'spree/admin/shared/sub_menu/_configuration', ? +++++++++ name: 'print_invoice_admin_configurations_menu', - insert_bottom: '[data-hook="admin_configurations_sidebar_menu"], #admin_configurations_sidebar_menu[data-hook]', ? ----------------------------------------------- + insert_bottom: '[data-hook="admin_configurations_sidebar_menu"]', text: '<%= configurations_sidebar_menu_item Spree.t(:settings, scope: :print_invoice), edit_admin_print_invoice_settings_path %>', disabled: false)
4
0.8
2
2
4ea2384a1e14dadc458940f23c9a75cb8584e629
app/controllers/alumni_controller.rb
app/controllers/alumni_controller.rb
class AlumniController < ApplicationController def index end def show if not student_member_signed_in? and not coordinator_signed_in? render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) return end @thisID = params[:id] @alum = Alumni.select("*").joins(:AlumniData, :AlumniStatus, :TieAlumniWithStudentMember).find(@thisID) # @alum = Alumni.find(@thisID) # @astat = AlumniStatus.find_by_alumni_id(@thisID) @alumni_data = AlumniData.find_by_alumni_id(@thisID) @editingAllowed = false @assignedtoid = -1 if @tie = TieAlumniWithStudentMember.find_by_alumni_id(@thisID) @assignedtoid = @tie.studentmember_id if student_member_signed_in? && @assignedtoid == current_student_member.id @editingAllowed = true end else render plain: "This alumni has not been allotted to anyone yet. Contact the SysAdmin." end # render plain: @alumni_data.inspect # render plain: @astat.inspect end end
class AlumniController < ApplicationController def index end def show ensure_signed_in @thisID = params[:id] @alum = Alumni.select("*").joins(:AlumniData, :AlumniStatus, :TieAlumniWithStudentMember).find(@thisID) # @alum = Alumni.find(@thisID) # @astat = AlumniStatus.find_by_alumni_id(@thisID) @alumni_data = AlumniData.find_by_alumni_id(@thisID) @editingAllowed = false @assignedtoid = -1 if @tie = TieAlumniWithStudentMember.find_by_alumni_id(@thisID) @assignedtoid = @tie.studentmember_id if student_member_signed_in? && @assignedtoid == current_student_member.id @editingAllowed = true end else render plain: "This alumni has not been allotted to anyone yet. Contact the SysAdmin." end # render plain: @alumni_data.inspect # render plain: @astat.inspect end end
Use helper inside the alumni how controller action
Use helper inside the alumni how controller action Signed-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>
Ruby
mit
icyflame/erp-rails,aniarya82/networking-rails,aniarya82/networking-rails,icyflame/erp-rails,icyflame/erp-rails,aniarya82/networking-rails
ruby
## Code Before: class AlumniController < ApplicationController def index end def show if not student_member_signed_in? and not coordinator_signed_in? render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) return end @thisID = params[:id] @alum = Alumni.select("*").joins(:AlumniData, :AlumniStatus, :TieAlumniWithStudentMember).find(@thisID) # @alum = Alumni.find(@thisID) # @astat = AlumniStatus.find_by_alumni_id(@thisID) @alumni_data = AlumniData.find_by_alumni_id(@thisID) @editingAllowed = false @assignedtoid = -1 if @tie = TieAlumniWithStudentMember.find_by_alumni_id(@thisID) @assignedtoid = @tie.studentmember_id if student_member_signed_in? && @assignedtoid == current_student_member.id @editingAllowed = true end else render plain: "This alumni has not been allotted to anyone yet. Contact the SysAdmin." end # render plain: @alumni_data.inspect # render plain: @astat.inspect end end ## Instruction: Use helper inside the alumni how controller action Signed-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com> ## Code After: class AlumniController < ApplicationController def index end def show ensure_signed_in @thisID = params[:id] @alum = Alumni.select("*").joins(:AlumniData, :AlumniStatus, :TieAlumniWithStudentMember).find(@thisID) # @alum = Alumni.find(@thisID) # @astat = AlumniStatus.find_by_alumni_id(@thisID) @alumni_data = AlumniData.find_by_alumni_id(@thisID) @editingAllowed = false @assignedtoid = -1 if @tie = TieAlumniWithStudentMember.find_by_alumni_id(@thisID) @assignedtoid = @tie.studentmember_id if student_member_signed_in? && @assignedtoid == current_student_member.id @editingAllowed = true end else render plain: "This alumni has not been allotted to anyone yet. Contact the SysAdmin." end # render plain: @alumni_data.inspect # render plain: @astat.inspect end end
class AlumniController < ApplicationController def index end def show + ensure_signed_in - if not student_member_signed_in? and not coordinator_signed_in? - render(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false) - return - end @thisID = params[:id] @alum = Alumni.select("*").joins(:AlumniData, :AlumniStatus, :TieAlumniWithStudentMember).find(@thisID) # @alum = Alumni.find(@thisID) # @astat = AlumniStatus.find_by_alumni_id(@thisID) @alumni_data = AlumniData.find_by_alumni_id(@thisID) @editingAllowed = false @assignedtoid = -1 if @tie = TieAlumniWithStudentMember.find_by_alumni_id(@thisID) @assignedtoid = @tie.studentmember_id if student_member_signed_in? && @assignedtoid == current_student_member.id @editingAllowed = true end else render plain: "This alumni has not been allotted to anyone yet. Contact the SysAdmin." end # render plain: @alumni_data.inspect # render plain: @astat.inspect end end
5
0.142857
1
4
8823acb41f9810e07f09ea9fe660deebc657f451
lib/menus/contextMenu.js
lib/menus/contextMenu.js
'use babel'; const init = () => { const copyEnabled = () => atom.config.get('remote-ftp.context.enableCopyFilename'); const contextMenu = { '.remote-ftp-view .entries.list-tree:not(.multi-select) .directory .header': { enabled: copyEnabled(), command: [{ label: 'Copy name', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, '.remote-ftp-view .entries.list-tree:not(.multi-select) .file': { enabled: copyEnabled(), command: [{ label: 'Copy filename', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, }; return contextMenu; }; export default init;
'use babel'; const init = () => { const contextMenu = { '.remote-ftp-view .entries.list-tree:not(.multi-select) .directory': { enabled: atom.config.get('remote-ftp.context.enableCopyFilename'), command: [{ label: 'Copy name', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, '.remote-ftp-view .entries.list-tree:not(.multi-select) .file': { enabled: atom.config.get('remote-ftp.context.enableCopyFilename'), command: [{ label: 'Copy filename', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, }; return contextMenu; }; export default init;
Fix directory "Copy name" function
Fix directory "Copy name" function
JavaScript
mit
mgrenier/remote-ftp,icetee/remote-ftp
javascript
## Code Before: 'use babel'; const init = () => { const copyEnabled = () => atom.config.get('remote-ftp.context.enableCopyFilename'); const contextMenu = { '.remote-ftp-view .entries.list-tree:not(.multi-select) .directory .header': { enabled: copyEnabled(), command: [{ label: 'Copy name', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, '.remote-ftp-view .entries.list-tree:not(.multi-select) .file': { enabled: copyEnabled(), command: [{ label: 'Copy filename', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, }; return contextMenu; }; export default init; ## Instruction: Fix directory "Copy name" function ## Code After: 'use babel'; const init = () => { const contextMenu = { '.remote-ftp-view .entries.list-tree:not(.multi-select) .directory': { enabled: atom.config.get('remote-ftp.context.enableCopyFilename'), command: [{ label: 'Copy name', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, '.remote-ftp-view .entries.list-tree:not(.multi-select) .file': { enabled: atom.config.get('remote-ftp.context.enableCopyFilename'), command: [{ label: 'Copy filename', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, }; return contextMenu; }; export default init;
'use babel'; const init = () => { - const copyEnabled = () => atom.config.get('remote-ftp.context.enableCopyFilename'); const contextMenu = { - '.remote-ftp-view .entries.list-tree:not(.multi-select) .directory .header': { ? -------- + '.remote-ftp-view .entries.list-tree:not(.multi-select) .directory': { - enabled: copyEnabled(), + enabled: atom.config.get('remote-ftp.context.enableCopyFilename'), command: [{ label: 'Copy name', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, '.remote-ftp-view .entries.list-tree:not(.multi-select) .file': { - enabled: copyEnabled(), + enabled: atom.config.get('remote-ftp.context.enableCopyFilename'), command: [{ label: 'Copy filename', command: 'remote-ftp:copy-name', }, { type: 'separator', }], }, }; return contextMenu; }; export default init;
7
0.25
3
4
596ee1d8c4e7a34020579dfefcf86a8c5a0a1814
src/shlwapi_dll.c
src/shlwapi_dll.c
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; }
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV_VLA(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; }
Reorder function definitions to match their order in the header file.
Reorder function definitions to match their order in the header file. This is driving me ma~d.
C
unlicense
thpatch/win32_utf8
c
## Code Before: /** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; } ## Instruction: Reorder function definitions to match their order in the header file. This is driving me ma~d. ## Code After: /** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV_VLA(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; }
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" + + BOOL STDAPICALLTYPE PathFileExistsU( + __in LPCSTR pszPath + ) + { + BOOL ret; + WCHAR_T_DEC(pszPath); + WCHAR_T_CONV_VLA(pszPath); + ret = PathFileExistsW(pszPath_w); + VLA_FREE(pszPath_w); + return ret; + } BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } - BOOL STDAPICALLTYPE PathFileExistsU( - __in LPCSTR pszPath - ) - { - BOOL ret; - WCHAR_T_DEC(pszPath); - WCHAR_T_CONV(pszPath); - ret = PathFileExistsW(pszPath_w); - VLA_FREE(pszPath_w); - return ret; - } - BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; }
24
0.461538
12
12
fcf908c5989a9db76110928b13816083b951ebc3
README.md
README.md
A permanent, accurate, convenient, accessible, open archive of the world's powerlifting data.<br/> Presentation of this data is available at [OpenPowerlifting.org](http://www.openpowerlifting.org). **Powerlifting to the People.** ## Code Licensing All OpenPowerlifting code is Free/Libre software under the GNU AGPLv3+.<br/> Please refer to the LICENSE file. ## Data Licensing OpenPowerlifting data under `meet-data/` is contributed to the public domain. The OpenPowerlifting database contains facts that, in and of themselves,<br/> are not protected by copyright law. However, the copyright laws of some jurisdictions<br/> may cover database design and structure. To the extent possible under law, all data in the `meet-data/` folder is waived</br> of all copyright and related or neighboring rights.</br> The work is published from the United States. Although you are under no requirement to do so, if you incorporate OpenPowerlifting</br> data into your project, please consider adding a statement of attribution,</br> so that people may know about this project and help contribute data. Sample attribution text: > This page uses data from the OpenPowerlifting project, http://www.openpowerlifting.org.<br/> > You may download a copy of the data at http://github.com/sstangl/openpowerlifting. If you modify the data or add useful new data, please consider contributing<br/> the changes back so the entire powerlifting community may benefit.
A permanent, accurate, convenient, accessible, open archive of the world's powerlifting data.<br/> Presentation of this data is available at [OpenPowerlifting.org](http://www.openpowerlifting.org). **Powerlifting to the People.** ## Code Licensing All OpenPowerlifting code is Free/Libre software under the GNU AGPLv3+.<br/> Please refer to the LICENSE file. ## Data Licensing OpenPowerlifting data (`*.csv`) under `meet-data/` is contributed to the public domain. The OpenPowerlifting database contains facts that, in and of themselves,<br/> are not protected by copyright law. However, the copyright laws of some jurisdictions<br/> may cover database design and structure. To the extent possible under law, all data (`*.csv`) in the `meet-data/` folder is waived</br> of all copyright and related or neighboring rights.</br> The work is published from the United States. Although you are under no requirement to do so, if you incorporate OpenPowerlifting</br> data into your project, please consider adding a statement of attribution,</br> so that people may know about this project and help contribute data. Sample attribution text: > This page uses data from the OpenPowerlifting project, http://www.openpowerlifting.org.<br/> > You may download a copy of the data at http://github.com/sstangl/openpowerlifting. If you modify the data or add useful new data, please consider contributing<br/> the changes back so the entire powerlifting community may benefit.
Clarify that only CSV files count as data.
Clarify that only CSV files count as data.
Markdown
agpl-3.0
emilyytlin/openpowerlifting,emilyytlin/openpowerlifting,emilyytlin/openpowerlifting,emilyytlin/openpowerlifting,emilyytlin/openpowerlifting
markdown
## Code Before: A permanent, accurate, convenient, accessible, open archive of the world's powerlifting data.<br/> Presentation of this data is available at [OpenPowerlifting.org](http://www.openpowerlifting.org). **Powerlifting to the People.** ## Code Licensing All OpenPowerlifting code is Free/Libre software under the GNU AGPLv3+.<br/> Please refer to the LICENSE file. ## Data Licensing OpenPowerlifting data under `meet-data/` is contributed to the public domain. The OpenPowerlifting database contains facts that, in and of themselves,<br/> are not protected by copyright law. However, the copyright laws of some jurisdictions<br/> may cover database design and structure. To the extent possible under law, all data in the `meet-data/` folder is waived</br> of all copyright and related or neighboring rights.</br> The work is published from the United States. Although you are under no requirement to do so, if you incorporate OpenPowerlifting</br> data into your project, please consider adding a statement of attribution,</br> so that people may know about this project and help contribute data. Sample attribution text: > This page uses data from the OpenPowerlifting project, http://www.openpowerlifting.org.<br/> > You may download a copy of the data at http://github.com/sstangl/openpowerlifting. If you modify the data or add useful new data, please consider contributing<br/> the changes back so the entire powerlifting community may benefit. ## Instruction: Clarify that only CSV files count as data. ## Code After: A permanent, accurate, convenient, accessible, open archive of the world's powerlifting data.<br/> Presentation of this data is available at [OpenPowerlifting.org](http://www.openpowerlifting.org). **Powerlifting to the People.** ## Code Licensing All OpenPowerlifting code is Free/Libre software under the GNU AGPLv3+.<br/> Please refer to the LICENSE file. ## Data Licensing OpenPowerlifting data (`*.csv`) under `meet-data/` is contributed to the public domain. The OpenPowerlifting database contains facts that, in and of themselves,<br/> are not protected by copyright law. However, the copyright laws of some jurisdictions<br/> may cover database design and structure. To the extent possible under law, all data (`*.csv`) in the `meet-data/` folder is waived</br> of all copyright and related or neighboring rights.</br> The work is published from the United States. Although you are under no requirement to do so, if you incorporate OpenPowerlifting</br> data into your project, please consider adding a statement of attribution,</br> so that people may know about this project and help contribute data. Sample attribution text: > This page uses data from the OpenPowerlifting project, http://www.openpowerlifting.org.<br/> > You may download a copy of the data at http://github.com/sstangl/openpowerlifting. If you modify the data or add useful new data, please consider contributing<br/> the changes back so the entire powerlifting community may benefit.
A permanent, accurate, convenient, accessible, open archive of the world's powerlifting data.<br/> Presentation of this data is available at [OpenPowerlifting.org](http://www.openpowerlifting.org). **Powerlifting to the People.** ## Code Licensing All OpenPowerlifting code is Free/Libre software under the GNU AGPLv3+.<br/> Please refer to the LICENSE file. ## Data Licensing - OpenPowerlifting data under `meet-data/` is contributed to the public domain. + OpenPowerlifting data (`*.csv`) under `meet-data/` is contributed to the public domain. ? ++++++++++ The OpenPowerlifting database contains facts that, in and of themselves,<br/> are not protected by copyright law. However, the copyright laws of some jurisdictions<br/> may cover database design and structure. - To the extent possible under law, all data in the `meet-data/` folder is waived</br> + To the extent possible under law, all data (`*.csv`) in the `meet-data/` folder is waived</br> ? ++++++++++ of all copyright and related or neighboring rights.</br> The work is published from the United States. Although you are under no requirement to do so, if you incorporate OpenPowerlifting</br> data into your project, please consider adding a statement of attribution,</br> so that people may know about this project and help contribute data. Sample attribution text: > This page uses data from the OpenPowerlifting project, http://www.openpowerlifting.org.<br/> > You may download a copy of the data at http://github.com/sstangl/openpowerlifting. If you modify the data or add useful new data, please consider contributing<br/> the changes back so the entire powerlifting community may benefit.
4
0.117647
2
2
52fe94a45de7be5d265d851cce2d9e1bb56c3617
src/service/scraper.js
src/service/scraper.js
const request = require('request-promise'); const cheerio = require('cheerio'); const BASE_URL = 'https://play.google.com/store/apps/details?hl=en&id='; const HEADERS = { 'Accept-Language': 'en-US,en;q=0.8' }; function scan(packageName) { const cleanPackageName = clean(packageName); const config = { url: BASE_URL + cleanPackageName, headers: HEADERS }; return request(config) .then(html => { const $ = cheerio.load(html); changesList = $('.recent-change') .map((i, elem) => $(elem).text()) .get(); return result = { packageName: cleanPackageName, changes: changesList }; }); } function clean(packageName) { const MAX_PACKAGE_LENGTH = 100; const NON_ALLOWED_CHARS = /[^\w\.]/g; return packageName .substr(0, MAX_PACKAGE_LENGTH) .replace(NON_ALLOWED_CHARS, ''); } module.exports = { scan };
const request = require('request-promise'); const cheerio = require('cheerio'); const crypto = require('crypto'); const BASE_URL = 'https://play.google.com/store/apps/details?hl=en&id='; const HEADERS = { 'Accept-Language': 'en-US,en;q=0.8' }; function scan(packageName) { const cleanPackageName = clean(packageName); const config = { url: BASE_URL + cleanPackageName, headers: HEADERS }; return request(config) .then(html => { const $ = cheerio.load(html); changesList = $('.recent-change') .map((i, elem) => $(elem).text()) .get(); return result = { packageName: cleanPackageName, changes: changesList, changesHash: hash(changesList.join()) }; }); } function clean(packageName) { const MAX_PACKAGE_LENGTH = 100; const NON_ALLOWED_CHARS = /[^\w\.]/g; return packageName .substr(0, MAX_PACKAGE_LENGTH) .replace(NON_ALLOWED_CHARS, ''); } function hash(payload) { return crypto.createHash('md5') .update(payload, 'utf8') .digest('base64'); } module.exports = { scan };
Add hash of the changes to the response to facilitate comparison
Add hash of the changes to the response to facilitate comparison
JavaScript
mit
enric-sinh/android-changelog-api
javascript
## Code Before: const request = require('request-promise'); const cheerio = require('cheerio'); const BASE_URL = 'https://play.google.com/store/apps/details?hl=en&id='; const HEADERS = { 'Accept-Language': 'en-US,en;q=0.8' }; function scan(packageName) { const cleanPackageName = clean(packageName); const config = { url: BASE_URL + cleanPackageName, headers: HEADERS }; return request(config) .then(html => { const $ = cheerio.load(html); changesList = $('.recent-change') .map((i, elem) => $(elem).text()) .get(); return result = { packageName: cleanPackageName, changes: changesList }; }); } function clean(packageName) { const MAX_PACKAGE_LENGTH = 100; const NON_ALLOWED_CHARS = /[^\w\.]/g; return packageName .substr(0, MAX_PACKAGE_LENGTH) .replace(NON_ALLOWED_CHARS, ''); } module.exports = { scan }; ## Instruction: Add hash of the changes to the response to facilitate comparison ## Code After: const request = require('request-promise'); const cheerio = require('cheerio'); const crypto = require('crypto'); const BASE_URL = 'https://play.google.com/store/apps/details?hl=en&id='; const HEADERS = { 'Accept-Language': 'en-US,en;q=0.8' }; function scan(packageName) { const cleanPackageName = clean(packageName); const config = { url: BASE_URL + cleanPackageName, headers: HEADERS }; return request(config) .then(html => { const $ = cheerio.load(html); changesList = $('.recent-change') .map((i, elem) => $(elem).text()) .get(); return result = { packageName: cleanPackageName, changes: changesList, changesHash: hash(changesList.join()) }; }); } function clean(packageName) { const MAX_PACKAGE_LENGTH = 100; const NON_ALLOWED_CHARS = /[^\w\.]/g; return packageName .substr(0, MAX_PACKAGE_LENGTH) .replace(NON_ALLOWED_CHARS, ''); } function hash(payload) { return crypto.createHash('md5') .update(payload, 'utf8') .digest('base64'); } module.exports = { scan };
const request = require('request-promise'); const cheerio = require('cheerio'); + const crypto = require('crypto'); const BASE_URL = 'https://play.google.com/store/apps/details?hl=en&id='; const HEADERS = { 'Accept-Language': 'en-US,en;q=0.8' }; function scan(packageName) { const cleanPackageName = clean(packageName); const config = { url: BASE_URL + cleanPackageName, headers: HEADERS }; return request(config) .then(html => { const $ = cheerio.load(html); changesList = $('.recent-change') .map((i, elem) => $(elem).text()) .get(); return result = { packageName: cleanPackageName, - changes: changesList + changes: changesList, ? + + changesHash: hash(changesList.join()) }; }); } function clean(packageName) { const MAX_PACKAGE_LENGTH = 100; const NON_ALLOWED_CHARS = /[^\w\.]/g; return packageName .substr(0, MAX_PACKAGE_LENGTH) .replace(NON_ALLOWED_CHARS, ''); } + function hash(payload) { + return crypto.createHash('md5') + .update(payload, 'utf8') + .digest('base64'); + } + module.exports = { scan };
10
0.294118
9
1
d24a6f1ac5e75b7dcc5deace96a7019fcc31ea37
app/forms/gobierto_admin/gobierto_citizens_charters/charter_form.rb
app/forms/gobierto_admin/gobierto_citizens_charters/charter_form.rb
module GobiertoAdmin module GobiertoCitizensCharters class CharterForm < GobiertoCitizensCharters::BaseForm attr_accessor( :service_id, :title_translations, :slug ) validates :service, presence: true validates :title_translations, translated_attribute_presence: true def available_services services_relation end def attributes_assignments { service_id: service.id, title_translations: title_translations, slug: slug } end private def resources_relation ::GobiertoCitizensCharters::Charter end def service services_relation.find_by(id: service_id) end def services_relation site.services end end end end
module GobiertoAdmin module GobiertoCitizensCharters class CharterForm < GobiertoCitizensCharters::BaseForm attr_accessor( :service_id, :title_translations, :slug ) validates :service, presence: true validates :title_translations, translated_attribute_presence: true def available_services services_relation.order(Arel.sql("title_translations->'#{I18n.locale}' ASC")) end def attributes_assignments { service_id: service.id, title_translations: title_translations, slug: slug } end private def resources_relation ::GobiertoCitizensCharters::Charter end def service services_relation.find_by(id: service_id) end def services_relation site.services end end end end
Return alphabetically ordered available services in charters form
Return alphabetically ordered available services in charters form
Ruby
agpl-3.0
PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto
ruby
## Code Before: module GobiertoAdmin module GobiertoCitizensCharters class CharterForm < GobiertoCitizensCharters::BaseForm attr_accessor( :service_id, :title_translations, :slug ) validates :service, presence: true validates :title_translations, translated_attribute_presence: true def available_services services_relation end def attributes_assignments { service_id: service.id, title_translations: title_translations, slug: slug } end private def resources_relation ::GobiertoCitizensCharters::Charter end def service services_relation.find_by(id: service_id) end def services_relation site.services end end end end ## Instruction: Return alphabetically ordered available services in charters form ## Code After: module GobiertoAdmin module GobiertoCitizensCharters class CharterForm < GobiertoCitizensCharters::BaseForm attr_accessor( :service_id, :title_translations, :slug ) validates :service, presence: true validates :title_translations, translated_attribute_presence: true def available_services services_relation.order(Arel.sql("title_translations->'#{I18n.locale}' ASC")) end def attributes_assignments { service_id: service.id, title_translations: title_translations, slug: slug } end private def resources_relation ::GobiertoCitizensCharters::Charter end def service services_relation.find_by(id: service_id) end def services_relation site.services end end end end
module GobiertoAdmin module GobiertoCitizensCharters class CharterForm < GobiertoCitizensCharters::BaseForm attr_accessor( :service_id, :title_translations, :slug ) validates :service, presence: true validates :title_translations, translated_attribute_presence: true def available_services - services_relation + services_relation.order(Arel.sql("title_translations->'#{I18n.locale}' ASC")) end def attributes_assignments { service_id: service.id, title_translations: title_translations, slug: slug } end private def resources_relation ::GobiertoCitizensCharters::Charter end def service services_relation.find_by(id: service_id) end def services_relation site.services end end end end
2
0.04878
1
1
faaae67a0768e766db845c4fbec711165ec2a44d
core/app/backbone/views/channel_view.coffee
core/app/backbone/views/channel_view.coffee
class window.ChannelView extends Backbone.Marionette.Layout template: 'channels/channel' regions: factList: '.js-region-fact-list' subChannelsRegion: '.js-region-sub-channels' addToChannelRegion: '.js-region-add-to-channel' creatorProfileRegion: ".js-region-creator-profile" events: 'change .js-channel-topic-switch': 'showChosenFacts' onRender: -> @showChosenFacts() if @model.get('inspectable?') @subChannelsRegion.show new SubchannelsView collection: @model.subchannels() model: @model if @model.get('followable?') @addToChannelRegion.show new AddChannelToChannelsButtonView(model: @model) @creatorProfileRegion.show new UserWithAuthorityBox model: @model.user(), authority: @model.get('created_by_authority') showChosenFacts: -> choice = @$('.js-channel-topic-switch').val() if choice == 'topic' @showFacts @topicFacts() else @showFacts @channelFacts() showFacts: (facts) -> @factList.show new FactsView model: @model collection: facts channelFacts: -> new ChannelFacts([], channel: @model) topicFacts: -> @model.topic().facts()
class window.ChannelView extends Backbone.Marionette.Layout template: 'channels/channel' regions: factList: '.js-region-fact-list' subChannelsRegion: '.js-region-sub-channels' addToChannelRegion: '.js-region-add-to-channel' creatorProfileRegion: ".js-region-creator-profile" events: 'change .js-channel-topic-switch': 'showChosenFacts' onRender: -> @showChosenFacts() if @model.get('inspectable?') @subChannelsRegion.show new SubchannelsView collection: @model.subchannels() model: @model if @model.get('followable?') @addToChannelRegion.show new AddChannelToChannelsButtonView(model: @model) @creatorProfileRegion.show new UserWithAuthorityBox model: @model.user(), authority: @model.get('created_by_authority') showChosenFacts: -> choice = @$('.js-channel-topic-switch').val() if choice == 'topic' @showFacts @topicFacts() @$('.js-region-sub-channels').hide() else @showFacts @channelFacts() @$('.js-region-sub-channels').show() showFacts: (facts) -> @factList.show new FactsView model: @model collection: facts channelFacts: -> new ChannelFacts([], channel: @model) topicFacts: -> @model.topic().facts()
Hide subchannels when showing all factlinks in topic
Hide subchannels when showing all factlinks in topic
CoffeeScript
mit
daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core
coffeescript
## Code Before: class window.ChannelView extends Backbone.Marionette.Layout template: 'channels/channel' regions: factList: '.js-region-fact-list' subChannelsRegion: '.js-region-sub-channels' addToChannelRegion: '.js-region-add-to-channel' creatorProfileRegion: ".js-region-creator-profile" events: 'change .js-channel-topic-switch': 'showChosenFacts' onRender: -> @showChosenFacts() if @model.get('inspectable?') @subChannelsRegion.show new SubchannelsView collection: @model.subchannels() model: @model if @model.get('followable?') @addToChannelRegion.show new AddChannelToChannelsButtonView(model: @model) @creatorProfileRegion.show new UserWithAuthorityBox model: @model.user(), authority: @model.get('created_by_authority') showChosenFacts: -> choice = @$('.js-channel-topic-switch').val() if choice == 'topic' @showFacts @topicFacts() else @showFacts @channelFacts() showFacts: (facts) -> @factList.show new FactsView model: @model collection: facts channelFacts: -> new ChannelFacts([], channel: @model) topicFacts: -> @model.topic().facts() ## Instruction: Hide subchannels when showing all factlinks in topic ## Code After: class window.ChannelView extends Backbone.Marionette.Layout template: 'channels/channel' regions: factList: '.js-region-fact-list' subChannelsRegion: '.js-region-sub-channels' addToChannelRegion: '.js-region-add-to-channel' creatorProfileRegion: ".js-region-creator-profile" events: 'change .js-channel-topic-switch': 'showChosenFacts' onRender: -> @showChosenFacts() if @model.get('inspectable?') @subChannelsRegion.show new SubchannelsView collection: @model.subchannels() model: @model if @model.get('followable?') @addToChannelRegion.show new AddChannelToChannelsButtonView(model: @model) @creatorProfileRegion.show new UserWithAuthorityBox model: @model.user(), authority: @model.get('created_by_authority') showChosenFacts: -> choice = @$('.js-channel-topic-switch').val() if choice == 'topic' @showFacts @topicFacts() @$('.js-region-sub-channels').hide() else @showFacts @channelFacts() @$('.js-region-sub-channels').show() showFacts: (facts) -> @factList.show new FactsView model: @model collection: facts channelFacts: -> new ChannelFacts([], channel: @model) topicFacts: -> @model.topic().facts()
class window.ChannelView extends Backbone.Marionette.Layout template: 'channels/channel' regions: factList: '.js-region-fact-list' subChannelsRegion: '.js-region-sub-channels' addToChannelRegion: '.js-region-add-to-channel' creatorProfileRegion: ".js-region-creator-profile" events: 'change .js-channel-topic-switch': 'showChosenFacts' onRender: -> @showChosenFacts() if @model.get('inspectable?') @subChannelsRegion.show new SubchannelsView collection: @model.subchannels() model: @model if @model.get('followable?') @addToChannelRegion.show new AddChannelToChannelsButtonView(model: @model) @creatorProfileRegion.show new UserWithAuthorityBox model: @model.user(), authority: @model.get('created_by_authority') showChosenFacts: -> choice = @$('.js-channel-topic-switch').val() if choice == 'topic' @showFacts @topicFacts() + @$('.js-region-sub-channels').hide() else @showFacts @channelFacts() + @$('.js-region-sub-channels').show() + showFacts: (facts) -> @factList.show new FactsView model: @model collection: facts channelFacts: -> new ChannelFacts([], channel: @model) topicFacts: -> @model.topic().facts()
3
0.073171
3
0
eb4f60f116fbd04030d8082728f48e79ed4ded35
sagan-site/src/main/java/sagan/support/nav/NavSection.java
sagan-site/src/main/java/sagan/support/nav/NavSection.java
package sagan.support.nav; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) public @interface NavSection { String value() default ""; }
package sagan.support.nav; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to be used at the class level on Controllers to indicate which section in * the site's main navigation should be highlighted. * * @see sagan.MvcConfig#addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry) */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface NavSection { String value() default ""; }
Add class-level Javadoc for sagan.projects.nav.*
Add class-level Javadoc for sagan.projects.nav.*
Java
bsd-3-clause
garylgh/sagan,rwinch/sagan,dsyer/sagan,lowtalker/sagan,yhj630520/sagan,martinlippert/sagan,TabberGit/sagan,dlizarra/sagan,andriykonoz/sagan,gregturn/sagan,dvaughn555/sagan,eonezhang/sagan,eonezhang/sagan,dvaughn555/sagan,BHASKARSDEN277GITHUB/sagan,dharmaraju/sagan,dkushner/sagan,dharmaraju/sagan,dvaughn555/sagan,vizewang/sagan,vizewang/sagan,BHASKARSDEN277GITHUB/sagan,seoilhyun/sagan,amit-siddhu/sagan,yhj630520/sagan,mbateman/sagan,dkushner/sagan,BHASKARSDEN277GITHUB/sagan,eonezhang/sagan,lowtalker/sagan,seoilhyun/sagan,lowtalker/sagan,mbateman/sagan,rwinch/sagan,garylgh/sagan,TabberGit/sagan,dsyer/sagan,martinlippert/sagan,dsyer/sagan,seoilhyun/sagan,vizewang/sagan,spring-io/sagan,eonezhang/sagan,rwinch/sagan,dvaughn555/sagan,andriykonoz/sagan,dharmaraju/sagan,dkushner/sagan,BHASKARSDEN277GITHUB/sagan,amit-siddhu/sagan,mbateman/sagan,rwinch/sagan,martinlippert/sagan,gregturn/sagan,andriykonoz/sagan,yhj630520/sagan,yhj630520/sagan,mbateman/sagan,garylgh/sagan,andriykonoz/sagan,dlizarra/sagan,lowtalker/sagan,amit-siddhu/sagan,dlizarra/sagan,TabberGit/sagan,spring-io/sagan,TabberGit/sagan,seoilhyun/sagan,garylgh/sagan,spring-io/sagan,dsyer/sagan,martinlippert/sagan,dlizarra/sagan,vizewang/sagan,amit-siddhu/sagan,spring-io/sagan,dharmaraju/sagan,dkushner/sagan,gregturn/sagan
java
## Code Before: package sagan.support.nav; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) public @interface NavSection { String value() default ""; } ## Instruction: Add class-level Javadoc for sagan.projects.nav.* ## Code After: package sagan.support.nav; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation to be used at the class level on Controllers to indicate which section in * the site's main navigation should be highlighted. * * @see sagan.MvcConfig#addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry) */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface NavSection { String value() default ""; }
package sagan.support.nav; + import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; + import java.lang.annotation.Target; + /** + * Annotation to be used at the class level on Controllers to indicate which section in + * the site's main navigation should be highlighted. + * + * @see sagan.MvcConfig#addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry) + */ + @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface NavSection { String value() default ""; }
9
0.9
9
0
5d7658c67eaa03e75450aa7ec2cc76c616551335
languages/patterns/php.js
languages/patterns/php.js
module.exports = { name: 'PHP', nameMatchers: ['.php', '.php3', '.php4', '.php5', '.fbp'], singleLineComment: require('./common/c-style.js').singleLine() }
module.exports = { name: 'PHP', nameMatchers: ['.php', '.php3', '.php4', '.php5', '.fbp'], multiLineComment: require('./common/c-style.js').multiLine(), singleLineComment: require('./common/c-style.js').singleLine() }
Add support for multiline comments in PHP.
Add support for multiline comments in PHP.
JavaScript
mit
nknapp/comment-patterns
javascript
## Code Before: module.exports = { name: 'PHP', nameMatchers: ['.php', '.php3', '.php4', '.php5', '.fbp'], singleLineComment: require('./common/c-style.js').singleLine() } ## Instruction: Add support for multiline comments in PHP. ## Code After: module.exports = { name: 'PHP', nameMatchers: ['.php', '.php3', '.php4', '.php5', '.fbp'], multiLineComment: require('./common/c-style.js').multiLine(), singleLineComment: require('./common/c-style.js').singleLine() }
module.exports = { name: 'PHP', nameMatchers: ['.php', '.php3', '.php4', '.php5', '.fbp'], + multiLineComment: require('./common/c-style.js').multiLine(), singleLineComment: require('./common/c-style.js').singleLine() }
1
0.2
1
0
f0e119fc22172c9279d8242c31c7a5d2940e4c2e
.travis.yml
.travis.yml
language: python python: - "2.6" - "2.7" env: - DB=sqlite - DB=mysql - DB=postgres before_script: - mysql -e 'create database sentry;' - psql -c 'create database sentry;' -U postgres install: - pip install mysql-python - pip install psycopg2 - make develop script: - make test notifications: irc: channels: "irc.freenode.org#sentry" on_success: change on_failure: change
language: python python: - "2.6" - "2.7" env: - DB=sqlite - DB=mysql - DB=postgres before_script: - mysql -e 'create database sentry;' - psql -c 'create database sentry;' -U postgres install: - make develop dev-postgres dev-mysql script: - make test notifications: irc: channels: "irc.freenode.org#sentry" on_success: change on_failure: change
Use standardized make commands for mysql and postgres
Use standardized make commands for mysql and postgres
YAML
bsd-3-clause
jean/sentry,ifduyue/sentry,1tush/sentry,JamesMura/sentry,wujuguang/sentry,kevinlondon/sentry,wong2/sentry,hongliang5623/sentry,boneyao/sentry,looker/sentry,zenefits/sentry,camilonova/sentry,JamesMura/sentry,JamesMura/sentry,NickPresta/sentry,BayanGroup/sentry,looker/sentry,imankulov/sentry,mvaled/sentry,llonchj/sentry,JackDanger/sentry,Kryz/sentry,beni55/sentry,gg7/sentry,gencer/sentry,ifduyue/sentry,felixbuenemann/sentry,fotinakis/sentry,mvaled/sentry,zenefits/sentry,Natim/sentry,mvaled/sentry,korealerts1/sentry,pauloschilling/sentry,SilentCircle/sentry,vperron/sentry,llonchj/sentry,TedaLIEz/sentry,zenefits/sentry,JackDanger/sentry,zenefits/sentry,Kryz/sentry,vperron/sentry,drcapulet/sentry,rdio/sentry,jean/sentry,imankulov/sentry,gencer/sentry,nicholasserra/sentry,ngonzalvez/sentry,ifduyue/sentry,BuildingLink/sentry,nicholasserra/sentry,beeftornado/sentry,looker/sentry,NickPresta/sentry,argonemyth/sentry,kevinlondon/sentry,wong2/sentry,daevaorn/sentry,fotinakis/sentry,kevinastone/sentry,argonemyth/sentry,mvaled/sentry,beeftornado/sentry,fotinakis/sentry,jokey2k/sentry,imankulov/sentry,BuildingLink/sentry,kevinastone/sentry,fuziontech/sentry,boneyao/sentry,JamesMura/sentry,looker/sentry,hongliang5623/sentry,drcapulet/sentry,alexm92/sentry,gencer/sentry,camilonova/sentry,gg7/sentry,fuziontech/sentry,NickPresta/sentry,zenefits/sentry,Natim/sentry,fotinakis/sentry,NickPresta/sentry,JackDanger/sentry,ewdurbin/sentry,daevaorn/sentry,BuildingLink/sentry,JTCunning/sentry,TedaLIEz/sentry,kevinastone/sentry,wujuguang/sentry,pauloschilling/sentry,gencer/sentry,alexm92/sentry,songyi199111/sentry,ifduyue/sentry,BayanGroup/sentry,kevinlondon/sentry,ifduyue/sentry,beni55/sentry,rdio/sentry,ngonzalvez/sentry,alexm92/sentry,jokey2k/sentry,argonemyth/sentry,1tush/sentry,ngonzalvez/sentry,gg7/sentry,jean/sentry,beni55/sentry,ewdurbin/sentry,Natim/sentry,SilentCircle/sentry,camilonova/sentry,mvaled/sentry,looker/sentry,BayanGroup/sentry,rdio/sentry,hongliang5623/sentry,SilentCircle/sentry,songyi199111/sentry,mitsuhiko/sentry,JTCunning/sentry,BuildingLink/sentry,ewdurbin/sentry,daevaorn/sentry,Kryz/sentry,jean/sentry,fuziontech/sentry,drcapulet/sentry,vperron/sentry,nicholasserra/sentry,boneyao/sentry,BuildingLink/sentry,mitsuhiko/sentry,felixbuenemann/sentry,gencer/sentry,korealerts1/sentry,mvaled/sentry,songyi199111/sentry,JamesMura/sentry,wong2/sentry,felixbuenemann/sentry,1tush/sentry,llonchj/sentry,korealerts1/sentry,pauloschilling/sentry,wujuguang/sentry,rdio/sentry,TedaLIEz/sentry,daevaorn/sentry,jokey2k/sentry,JTCunning/sentry,beeftornado/sentry,SilentCircle/sentry,jean/sentry
yaml
## Code Before: language: python python: - "2.6" - "2.7" env: - DB=sqlite - DB=mysql - DB=postgres before_script: - mysql -e 'create database sentry;' - psql -c 'create database sentry;' -U postgres install: - pip install mysql-python - pip install psycopg2 - make develop script: - make test notifications: irc: channels: "irc.freenode.org#sentry" on_success: change on_failure: change ## Instruction: Use standardized make commands for mysql and postgres ## Code After: language: python python: - "2.6" - "2.7" env: - DB=sqlite - DB=mysql - DB=postgres before_script: - mysql -e 'create database sentry;' - psql -c 'create database sentry;' -U postgres install: - make develop dev-postgres dev-mysql script: - make test notifications: irc: channels: "irc.freenode.org#sentry" on_success: change on_failure: change
language: python python: - "2.6" - "2.7" env: - DB=sqlite - DB=mysql - DB=postgres before_script: - mysql -e 'create database sentry;' - psql -c 'create database sentry;' -U postgres install: + - make develop dev-postgres dev-mysql - - pip install mysql-python - - pip install psycopg2 - - make develop script: - make test notifications: irc: channels: "irc.freenode.org#sentry" on_success: change on_failure: change
4
0.181818
1
3
ce5a4ae1d5feb93ea5022ed95fb369a2abf911db
src/treePrices.js
src/treePrices.js
// Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity // Calculate the buy prices tree.buyPriceEach = itemPrices[tree.id] || false tree.buyPrice = tree.buyPriceEach ? quantity * tree.buyPriceEach : false tree.bestPrice = tree.buyPrice if (!tree.components) { return tree } // Calculate the tree prices traversal for the sub-components tree.components = tree.components.map(component => treePrices(component, itemPrices)) // Calculate the craft price out of the best prices tree.craftPrice = tree.components.reduce((a, b) => a.bestPrice + b.bestPrice) // If we explicitly don't craft this, keep the buy price as the best price if (tree.craft === false) { return tree } // Update the best price of this tree segment, used to // determine the craft price of the higher-up recipe if (!tree.buyPrice || tree.craftPrice < tree.buyPrice) { tree.bestPrice = tree.craftPrice } return tree } module.exports = treePrices
// Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity // Calculate the buy prices tree.buyPriceEach = itemPrices[tree.id] || false tree.buyPrice = tree.buyPriceEach ? quantity * tree.buyPriceEach : false tree.bestPrice = tree.buyPrice if (!tree.components) { return tree } // Calculate the tree prices traversal for the sub-components tree.components = tree.components.map(component => treePrices(component, itemPrices)) // Calculate the craft price out of the best prices tree.craftPrice = tree.components.map(c => c.bestPrice).reduce((a, b) => a + b) // If we explicitly don't craft this, keep the buy price as the best price if (tree.craft === false) { return tree } // Update the best price of this tree segment, used to // determine the craft price of the higher-up recipe if (!tree.buyPrice || tree.craftPrice < tree.buyPrice) { tree.bestPrice = tree.craftPrice } return tree } module.exports = treePrices
Fix weird issue with craft price calculation in some cases
Fix weird issue with craft price calculation in some cases
JavaScript
mit
gw2efficiency/recipe-calculation,gw2efficiency/recipe-calculation
javascript
## Code Before: // Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity // Calculate the buy prices tree.buyPriceEach = itemPrices[tree.id] || false tree.buyPrice = tree.buyPriceEach ? quantity * tree.buyPriceEach : false tree.bestPrice = tree.buyPrice if (!tree.components) { return tree } // Calculate the tree prices traversal for the sub-components tree.components = tree.components.map(component => treePrices(component, itemPrices)) // Calculate the craft price out of the best prices tree.craftPrice = tree.components.reduce((a, b) => a.bestPrice + b.bestPrice) // If we explicitly don't craft this, keep the buy price as the best price if (tree.craft === false) { return tree } // Update the best price of this tree segment, used to // determine the craft price of the higher-up recipe if (!tree.buyPrice || tree.craftPrice < tree.buyPrice) { tree.bestPrice = tree.craftPrice } return tree } module.exports = treePrices ## Instruction: Fix weird issue with craft price calculation in some cases ## Code After: // Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity // Calculate the buy prices tree.buyPriceEach = itemPrices[tree.id] || false tree.buyPrice = tree.buyPriceEach ? quantity * tree.buyPriceEach : false tree.bestPrice = tree.buyPrice if (!tree.components) { return tree } // Calculate the tree prices traversal for the sub-components tree.components = tree.components.map(component => treePrices(component, itemPrices)) // Calculate the craft price out of the best prices tree.craftPrice = tree.components.map(c => c.bestPrice).reduce((a, b) => a + b) // If we explicitly don't craft this, keep the buy price as the best price if (tree.craft === false) { return tree } // Update the best price of this tree segment, used to // determine the craft price of the higher-up recipe if (!tree.buyPrice || tree.craftPrice < tree.buyPrice) { tree.bestPrice = tree.craftPrice } return tree } module.exports = treePrices
// Update the tree prices function treePrices (tree, itemPrices) { tree = {...tree} // Either use the "used quantity" which gets set when the user uses // own materials, or the base "total quantity" of this tree segment let quantity = tree.usedQuantity !== undefined ? tree.usedQuantity : tree.totalQuantity // Calculate the buy prices tree.buyPriceEach = itemPrices[tree.id] || false tree.buyPrice = tree.buyPriceEach ? quantity * tree.buyPriceEach : false tree.bestPrice = tree.buyPrice if (!tree.components) { return tree } // Calculate the tree prices traversal for the sub-components tree.components = tree.components.map(component => treePrices(component, itemPrices)) // Calculate the craft price out of the best prices - tree.craftPrice = tree.components.reduce((a, b) => a.bestPrice + b.bestPrice) + tree.craftPrice = tree.components.map(c => c.bestPrice).reduce((a, b) => a + b) // If we explicitly don't craft this, keep the buy price as the best price if (tree.craft === false) { return tree } // Update the best price of this tree segment, used to // determine the craft price of the higher-up recipe if (!tree.buyPrice || tree.craftPrice < tree.buyPrice) { tree.bestPrice = tree.craftPrice } return tree } module.exports = treePrices
2
0.052632
1
1
f6c6c024ccf93a58aee1f1873c95d59e134ba3e3
roles/repos/rdo/tasks/main.yml
roles/repos/rdo/tasks/main.yml
--- - name: Install rdo repository configuration package: name: centos-release-openstack-{{rdo_release}} state: present when: manage_repos|default(false) and ansible_distribution == 'CentOS'
--- - name: Install rdo repository configuration package: name: centos-release-openstack-{{rdo_release}} state: present when: manage_repos|default(false) and ansible_distribution == 'CentOS' # workaround for centos-qemu-ev and centos-release issue # - name: update centos-release rpm yum: name: centos-release state: latest disablerepo: centos-qemu-ev tags: - skip_ansible_lint
Fix qemu-kvm-ev repo access until ...
Fix qemu-kvm-ev repo access until ... new centos-release rpm is included in base images Change-Id: I9f5c9f7dbed0dc4968f7f602c0c44108dc95747d
YAML
apache-2.0
centos-opstools/opstools-ansible,centos-opstools/opstools-ansible
yaml
## Code Before: --- - name: Install rdo repository configuration package: name: centos-release-openstack-{{rdo_release}} state: present when: manage_repos|default(false) and ansible_distribution == 'CentOS' ## Instruction: Fix qemu-kvm-ev repo access until ... new centos-release rpm is included in base images Change-Id: I9f5c9f7dbed0dc4968f7f602c0c44108dc95747d ## Code After: --- - name: Install rdo repository configuration package: name: centos-release-openstack-{{rdo_release}} state: present when: manage_repos|default(false) and ansible_distribution == 'CentOS' # workaround for centos-qemu-ev and centos-release issue # - name: update centos-release rpm yum: name: centos-release state: latest disablerepo: centos-qemu-ev tags: - skip_ansible_lint
--- - name: Install rdo repository configuration package: name: centos-release-openstack-{{rdo_release}} state: present when: manage_repos|default(false) and ansible_distribution == 'CentOS' + + # workaround for centos-qemu-ev and centos-release issue + # + - name: update centos-release rpm + yum: + name: centos-release + state: latest + disablerepo: centos-qemu-ev + tags: + - skip_ansible_lint
10
1.666667
10
0
47fdaabaa72fc79142ddf2d330ab9857f7cdce8b
base.js
base.js
module.exports = { parser: 'babel-eslint', rules: { // Disallow dangling commas 'comma-dangle': [2, 'never'], // Allow anonymous functions 'func-names': [0], // Allow short identifiers 'id-length': [0], // Enforce indentation of switch/case statements // See: https://github.com/airbnb/javascript/issues/470#issuecomment-145066890 'indent': [2, 2, { SwitchCase: 1 }], // Enforce curly spacing in object literals and destructuring 'object-curly-spacing': [2, 'always'], // Allow padded blocks 'padded-blocks': [0] } };
module.exports = { parser: 'babel-eslint', rules: { // Disallow dangling commas 'comma-dangle': [2, 'never'], // Allow anonymous functions 'func-names': [0], // Allow short identifiers 'id-length': [0], // Enforce indentation of switch/case statements // See: https://github.com/airbnb/javascript/issues/470#issuecomment-145066890 'indent': [2, 2, { SwitchCase: 1 }], // Enforce using all arguments // Allow ignoring arguments with underscore prefix 'no-unused-vars': [2, { args: 'all', 'argsIgnorePattern': '^_' }], // Enforce curly spacing in object literals and destructuring 'object-curly-spacing': [2, 'always'], // Allow padded blocks 'padded-blocks': [0] } };
Enforce using all args and ignore with underscore
Enforce using all args and ignore with underscore
JavaScript
mit
timkurvers/eslint-config
javascript
## Code Before: module.exports = { parser: 'babel-eslint', rules: { // Disallow dangling commas 'comma-dangle': [2, 'never'], // Allow anonymous functions 'func-names': [0], // Allow short identifiers 'id-length': [0], // Enforce indentation of switch/case statements // See: https://github.com/airbnb/javascript/issues/470#issuecomment-145066890 'indent': [2, 2, { SwitchCase: 1 }], // Enforce curly spacing in object literals and destructuring 'object-curly-spacing': [2, 'always'], // Allow padded blocks 'padded-blocks': [0] } }; ## Instruction: Enforce using all args and ignore with underscore ## Code After: module.exports = { parser: 'babel-eslint', rules: { // Disallow dangling commas 'comma-dangle': [2, 'never'], // Allow anonymous functions 'func-names': [0], // Allow short identifiers 'id-length': [0], // Enforce indentation of switch/case statements // See: https://github.com/airbnb/javascript/issues/470#issuecomment-145066890 'indent': [2, 2, { SwitchCase: 1 }], // Enforce using all arguments // Allow ignoring arguments with underscore prefix 'no-unused-vars': [2, { args: 'all', 'argsIgnorePattern': '^_' }], // Enforce curly spacing in object literals and destructuring 'object-curly-spacing': [2, 'always'], // Allow padded blocks 'padded-blocks': [0] } };
module.exports = { parser: 'babel-eslint', rules: { // Disallow dangling commas 'comma-dangle': [2, 'never'], // Allow anonymous functions 'func-names': [0], // Allow short identifiers 'id-length': [0], // Enforce indentation of switch/case statements // See: https://github.com/airbnb/javascript/issues/470#issuecomment-145066890 'indent': [2, 2, { SwitchCase: 1 }], + // Enforce using all arguments + // Allow ignoring arguments with underscore prefix + 'no-unused-vars': [2, { args: 'all', 'argsIgnorePattern': '^_' }], + // Enforce curly spacing in object literals and destructuring 'object-curly-spacing': [2, 'always'], // Allow padded blocks 'padded-blocks': [0] } };
4
0.173913
4
0
af16c03f7814871b063f627b8829b44a9e8648b9
src/Resources/config/processor.yml
src/Resources/config/processor.yml
services: hexanet_statsd_swarrot.processor.statsd: class: Hexanet\SwarrotStatsdBundle\Configurator\StatsdProcessorConfigurator arguments: - "@event_dispatcher"
services: hexanet_swarrot_statsd.processor.statsd: class: Hexanet\SwarrotStatsdBundle\Configurator\StatsdProcessorConfigurator arguments: - "@event_dispatcher"
Rename service to match bundle name
Rename service to match bundle name
YAML
mit
Hexanet/SwarrotStatsdBundle
yaml
## Code Before: services: hexanet_statsd_swarrot.processor.statsd: class: Hexanet\SwarrotStatsdBundle\Configurator\StatsdProcessorConfigurator arguments: - "@event_dispatcher" ## Instruction: Rename service to match bundle name ## Code After: services: hexanet_swarrot_statsd.processor.statsd: class: Hexanet\SwarrotStatsdBundle\Configurator\StatsdProcessorConfigurator arguments: - "@event_dispatcher"
services: - hexanet_statsd_swarrot.processor.statsd: ? ------- + hexanet_swarrot_statsd.processor.statsd: ? +++++++ class: Hexanet\SwarrotStatsdBundle\Configurator\StatsdProcessorConfigurator arguments: - "@event_dispatcher"
2
0.4
1
1
e959f7d67fd0efdf0f157e74d3b606b54c597a87
README.md
README.md
[![Build Status](https://travis-ci.org/bjornharrtell/topolis.svg)](https://travis-ci.org/bjornharrtell/topolis) [![Coverage Status](https://coveralls.io/repos/github/bjornharrtell/topolis/badge.svg?branch=master)](https://coveralls.io/github/bjornharrtell/topolis?branch=master) JavaScript library implementing two dimensional planar topology representation and operations modeled after ISO/IEC 13249-3 (SQL/MM). [API documentation](https://bjornharrtell.github.io/topolis/0.1.0/apidocs). ## References * https://docs.oracle.com/cd/B19306_01/appdev.102/b14256/sdo_topo_concepts.htm * http://postgis.net/docs/manual-2.3/Topology.html * https://www.gaia-gis.it/fossil/libspatialite/wiki?name=ISO+Topology
[![Build Status](https://travis-ci.org/bjornharrtell/topolis.svg)](https://travis-ci.org/bjornharrtell/topolis) [![Coverage Status](https://coveralls.io/repos/github/bjornharrtell/topolis/badge.svg?branch=master)](https://coveralls.io/github/bjornharrtell/topolis?branch=master) JavaScript library implementing two dimensional planar topology representation and operations modeled after ISO/IEC 13249-3 (SQL/MM). The code is largely a manual port of the implementation that can be found in PostGIS. [API documentation](https://bjornharrtell.github.io/topolis/0.1.0/apidocs). ## References * https://docs.oracle.com/cd/B19306_01/appdev.102/b14256/sdo_topo_concepts.htm * http://postgis.net/docs/manual-2.3/Topology.html * https://www.gaia-gis.it/fossil/libspatialite/wiki?name=ISO+Topology
Add note that this is a port from PostGIS
Add note that this is a port from PostGIS
Markdown
mit
bjornharrtell/topolis
markdown
## Code Before: [![Build Status](https://travis-ci.org/bjornharrtell/topolis.svg)](https://travis-ci.org/bjornharrtell/topolis) [![Coverage Status](https://coveralls.io/repos/github/bjornharrtell/topolis/badge.svg?branch=master)](https://coveralls.io/github/bjornharrtell/topolis?branch=master) JavaScript library implementing two dimensional planar topology representation and operations modeled after ISO/IEC 13249-3 (SQL/MM). [API documentation](https://bjornharrtell.github.io/topolis/0.1.0/apidocs). ## References * https://docs.oracle.com/cd/B19306_01/appdev.102/b14256/sdo_topo_concepts.htm * http://postgis.net/docs/manual-2.3/Topology.html * https://www.gaia-gis.it/fossil/libspatialite/wiki?name=ISO+Topology ## Instruction: Add note that this is a port from PostGIS ## Code After: [![Build Status](https://travis-ci.org/bjornharrtell/topolis.svg)](https://travis-ci.org/bjornharrtell/topolis) [![Coverage Status](https://coveralls.io/repos/github/bjornharrtell/topolis/badge.svg?branch=master)](https://coveralls.io/github/bjornharrtell/topolis?branch=master) JavaScript library implementing two dimensional planar topology representation and operations modeled after ISO/IEC 13249-3 (SQL/MM). The code is largely a manual port of the implementation that can be found in PostGIS. [API documentation](https://bjornharrtell.github.io/topolis/0.1.0/apidocs). ## References * https://docs.oracle.com/cd/B19306_01/appdev.102/b14256/sdo_topo_concepts.htm * http://postgis.net/docs/manual-2.3/Topology.html * https://www.gaia-gis.it/fossil/libspatialite/wiki?name=ISO+Topology
[![Build Status](https://travis-ci.org/bjornharrtell/topolis.svg)](https://travis-ci.org/bjornharrtell/topolis) [![Coverage Status](https://coveralls.io/repos/github/bjornharrtell/topolis/badge.svg?branch=master)](https://coveralls.io/github/bjornharrtell/topolis?branch=master) JavaScript library implementing two dimensional planar topology representation and operations modeled after ISO/IEC 13249-3 (SQL/MM). + + The code is largely a manual port of the implementation that can be found in PostGIS. [API documentation](https://bjornharrtell.github.io/topolis/0.1.0/apidocs). ## References * https://docs.oracle.com/cd/B19306_01/appdev.102/b14256/sdo_topo_concepts.htm * http://postgis.net/docs/manual-2.3/Topology.html * https://www.gaia-gis.it/fossil/libspatialite/wiki?name=ISO+Topology
2
0.153846
2
0
60830702cfad70c1417d6c5708b8de36f19e2226
index.js
index.js
var sudo = require('sudo-prompt'); var cmdFnPath = require.resolve('cmd-fn'); var setName = sudo.setName; var call = function(options, cb) { var cmd = process.execPath + ' ' + cmdFnPath; if (process.execPath.indexOf("/Contents/MacOS/Electron") >= 0) { // If we're running in Electron then make sure that the process is being // run in node mode not as the GUI app. cmd = 'ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 ' + cmd; } if (options.module) { cmd = cmd + ' --module ' + options.module; } else { return cb(new Error('module option is required')); } if (options.function) { cmd = cmd + ' --function ' + options.function; } if (options.params) { cmd = cmd + ' --params \'' + JSON.stringify(options.params) + '\''; } if (options.cwd) { cmd = cmd + ' --cwd \'' + options.cwd + '\''; } if (options.type) { cmd = cmd + ' --' + options.type; } return sudo.exec(cmd, function(err, val) { try { val = JSON.parse(val); } catch (e) { // Do Nothing } cb(err,val); }); }; module.exports = { call: call, setName: setName };
var sudo = require('sudo-prompt'); var cmdFnPath = require.resolve('cmd-fn'); var setName = sudo.setName; var call = function(options, cb) { // Put paths inside quotes so spaces don't need to be escaped var cmd = '"' + process.execPath +'" "' + cmdFnPath + '"'; if (process.execPath.indexOf("/Contents/MacOS/Electron") >= 0) { // If we're running in Electron then make sure that the process is being // run in node mode not as the GUI app. cmd = 'ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 ' + cmd; } if (options.module) { cmd = cmd + ' --module ' + options.module; } else { return cb(new Error('module option is required')); } if (options.function) { cmd = cmd + ' --function ' + options.function; } if (options.params) { cmd = cmd + ' --params \'' + JSON.stringify(options.params) + '\''; } if (options.cwd) { cmd = cmd + ' --cwd \'' + options.cwd + '\''; } if (options.type) { cmd = cmd + ' --' + options.type; } return sudo.exec(cmd, function(err, val) { try { val = JSON.parse(val); } catch (e) { // Do Nothing } cb(err,val); }); }; module.exports = { call: call, setName: setName };
Put paths inside quotes so spaces don't need to be escaped
Put paths inside quotes so spaces don't need to be escaped
JavaScript
mit
davej/sudo-fn
javascript
## Code Before: var sudo = require('sudo-prompt'); var cmdFnPath = require.resolve('cmd-fn'); var setName = sudo.setName; var call = function(options, cb) { var cmd = process.execPath + ' ' + cmdFnPath; if (process.execPath.indexOf("/Contents/MacOS/Electron") >= 0) { // If we're running in Electron then make sure that the process is being // run in node mode not as the GUI app. cmd = 'ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 ' + cmd; } if (options.module) { cmd = cmd + ' --module ' + options.module; } else { return cb(new Error('module option is required')); } if (options.function) { cmd = cmd + ' --function ' + options.function; } if (options.params) { cmd = cmd + ' --params \'' + JSON.stringify(options.params) + '\''; } if (options.cwd) { cmd = cmd + ' --cwd \'' + options.cwd + '\''; } if (options.type) { cmd = cmd + ' --' + options.type; } return sudo.exec(cmd, function(err, val) { try { val = JSON.parse(val); } catch (e) { // Do Nothing } cb(err,val); }); }; module.exports = { call: call, setName: setName }; ## Instruction: Put paths inside quotes so spaces don't need to be escaped ## Code After: var sudo = require('sudo-prompt'); var cmdFnPath = require.resolve('cmd-fn'); var setName = sudo.setName; var call = function(options, cb) { // Put paths inside quotes so spaces don't need to be escaped var cmd = '"' + process.execPath +'" "' + cmdFnPath + '"'; if (process.execPath.indexOf("/Contents/MacOS/Electron") >= 0) { // If we're running in Electron then make sure that the process is being // run in node mode not as the GUI app. cmd = 'ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 ' + cmd; } if (options.module) { cmd = cmd + ' --module ' + options.module; } else { return cb(new Error('module option is required')); } if (options.function) { cmd = cmd + ' --function ' + options.function; } if (options.params) { cmd = cmd + ' --params \'' + JSON.stringify(options.params) + '\''; } if (options.cwd) { cmd = cmd + ' --cwd \'' + options.cwd + '\''; } if (options.type) { cmd = cmd + ' --' + options.type; } return sudo.exec(cmd, function(err, val) { try { val = JSON.parse(val); } catch (e) { // Do Nothing } cb(err,val); }); }; module.exports = { call: call, setName: setName };
var sudo = require('sudo-prompt'); var cmdFnPath = require.resolve('cmd-fn'); var setName = sudo.setName; var call = function(options, cb) { + // Put paths inside quotes so spaces don't need to be escaped - var cmd = process.execPath + ' ' + cmdFnPath; ? ^^ + var cmd = '"' + process.execPath +'" "' + cmdFnPath + '"'; ? ++++++ ++ ^ ++++++ if (process.execPath.indexOf("/Contents/MacOS/Electron") >= 0) { // If we're running in Electron then make sure that the process is being // run in node mode not as the GUI app. cmd = 'ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 ' + cmd; } if (options.module) { cmd = cmd + ' --module ' + options.module; } else { return cb(new Error('module option is required')); } if (options.function) { cmd = cmd + ' --function ' + options.function; } if (options.params) { cmd = cmd + ' --params \'' + JSON.stringify(options.params) + '\''; } if (options.cwd) { cmd = cmd + ' --cwd \'' + options.cwd + '\''; } if (options.type) { cmd = cmd + ' --' + options.type; } return sudo.exec(cmd, function(err, val) { try { val = JSON.parse(val); } catch (e) { // Do Nothing } cb(err,val); }); }; module.exports = { call: call, setName: setName };
3
0.06383
2
1
6fa092960dd7bf0cae93bcd6678a0f18b1aac5cc
_wiki/source-insight.md
_wiki/source-insight.md
--- layout: wiki title: Source Insight categories: tools description: Source Insight 工具的快捷键及使用日常。 keywords: Source Insight --- ### 快捷键 C --> Ctrl S --> Shift M --> Alt | 功能 | 快捷键 | |:-------------|:-------| | 返回 | M-, | | 前进 | M-. | | 跳到定义 | C-= | | 查找引用 | C-/ | | 搜索 | C-f | | 向下搜索 | F4 | | 向上搜索 | F3 | | 高亮当前单词 | S-F8 | ### Q&A 1. 新建工程后函数跳转等遇到 `symbol not found` 如何解决? 打开菜单里的「Project」-「Synchronize Files」(快捷键 <kbd>Alt</kbd> + <kbd>Shift</kbd> +<kbd>S</kbd>),勾选 `Force all files to be re-parsed` 后点击 `OK`,等待 Source Insight 重新解析工程里的文件完成即可。
--- layout: wiki title: Source Insight categories: tools description: Source Insight 工具的快捷键及使用日常。 keywords: Source Insight --- ### 快捷键 C --> Ctrl S --> Shift M --> Alt | 功能 | 快捷键 | |:-------------|:-------| | 返回 | M-, | | 前进 | M-. | | 跳到定义 | C-= | | 查找引用 | C-/ | | 搜索 | C-f | | 向下搜索 | F4 | | 向上搜索 | F3 | | 高亮当前单词 | S-F8 | ### Q&A 1. 新建工程后函数跳转等遇到 `symbol not found` 如何解决? 打开菜单里的「Project」-「Synchronize Files」(快捷键 <kbd>Alt</kbd> + <kbd>Shift</kbd> +<kbd>S</kbd>),勾选 `Force all files to be re-parsed` 后点击 `OK`,等待 Source Insight 重新解析工程里的文件完成即可。 2. 如何在标题栏里显示文件全路径? 打开菜单里的「Options」-「Preferences」-「Display」,取消勾选 `Trim long path names with ellipses`。
Add show full path in title bar tip
Add show full path in title bar tip
Markdown
mit
huanghu996/boke,poluoluo/poluoluo.github.io,scans/scans.github.io,lvsazf/lvsazf.github.io,zmatsh/zmatsh.github.io,zmatsh/zmatsh.github.io,jiayue0107/Log,tiencubi/tiencubi.github.io,lvsazf/lvsazf.github.io,jpyean/jpyean.github.io,jiayue0107/Log,JepsonWong/JepsonWong.github.io,stantsang/stantsang.github.io,lyxiang/lyxiang.github.io,esonger/esonger.github.io,jiayue0107/Log,afterafuture/afterafuture.github.io,Lzpgithub/Lzpgithub.github.io,JepsonWong/JepsonWong.github.io,zmatsh/zmatsh.github.io,aaronshang/aaronshang.github.io,lyxiang/lyxiang.github.io,ktcer/ktcer.github.io,lukexwang/lukexwang.github.io,stantsang/stantsang.github.io,mzlogin/mzlogin.github.io,breakEval13/breakEval13.github.io,lvsazf/lvsazf.github.io,songtaohome/songtaohome.github.io,songtaohome/songtaohome.github.io,CloudNil/cloudnil.github.io,AllenChyou/AllenChyou.github.io,afterafuture/afterafuture.github.io,aaronshang/aaronshang.github.io,liuxiong21/liuxiong21.github.io,mzlogin/mzlogin.github.io,breakEval13/breakEval13.github.io,songtaohome/songtaohome.github.io,liuxiong21/liuxiong21.github.io,tiencubi/tiencubi.github.io,Duansir/Duansir.github.io,breakEval13/breakEval13.github.io,esonger/esonger.github.io,tiencubi/tiencubi.github.io,CloudNil/cloudnil.github.io,ktcer/ktcer.github.io,afterafuture/afterafuture.github.io,lyxiang/lyxiang.github.io,aaronshang/aaronshang.github.io,stantsang/stantsang.github.io,zmatsh/zmatsh.github.io,huanghu996/boke,AllenChyou/AllenChyou.github.io,esonger/esonger.github.io,Lzpgithub/Lzpgithub.github.io,Duansir/Duansir.github.io,poluoluo/poluoluo.github.io,liuxiong21/liuxiong21.github.io,scans/scans.github.io,ktcer/ktcer.github.io,mzlogin/mzlogin.github.io,Lzpgithub/Lzpgithub.github.io,breakEval13/breakEval13.github.io,jpyean/jpyean.github.io,huanghu996/boke,CloudNil/cloudnil.github.io,scans/scans.github.io,Duansir/Duansir.github.io,jpyean/jpyean.github.io,poluoluo/poluoluo.github.io,CloudNil/cloudnil.github.io,JepsonWong/JepsonWong.github.io
markdown
## Code Before: --- layout: wiki title: Source Insight categories: tools description: Source Insight 工具的快捷键及使用日常。 keywords: Source Insight --- ### 快捷键 C --> Ctrl S --> Shift M --> Alt | 功能 | 快捷键 | |:-------------|:-------| | 返回 | M-, | | 前进 | M-. | | 跳到定义 | C-= | | 查找引用 | C-/ | | 搜索 | C-f | | 向下搜索 | F4 | | 向上搜索 | F3 | | 高亮当前单词 | S-F8 | ### Q&A 1. 新建工程后函数跳转等遇到 `symbol not found` 如何解决? 打开菜单里的「Project」-「Synchronize Files」(快捷键 <kbd>Alt</kbd> + <kbd>Shift</kbd> +<kbd>S</kbd>),勾选 `Force all files to be re-parsed` 后点击 `OK`,等待 Source Insight 重新解析工程里的文件完成即可。 ## Instruction: Add show full path in title bar tip ## Code After: --- layout: wiki title: Source Insight categories: tools description: Source Insight 工具的快捷键及使用日常。 keywords: Source Insight --- ### 快捷键 C --> Ctrl S --> Shift M --> Alt | 功能 | 快捷键 | |:-------------|:-------| | 返回 | M-, | | 前进 | M-. | | 跳到定义 | C-= | | 查找引用 | C-/ | | 搜索 | C-f | | 向下搜索 | F4 | | 向上搜索 | F3 | | 高亮当前单词 | S-F8 | ### Q&A 1. 新建工程后函数跳转等遇到 `symbol not found` 如何解决? 打开菜单里的「Project」-「Synchronize Files」(快捷键 <kbd>Alt</kbd> + <kbd>Shift</kbd> +<kbd>S</kbd>),勾选 `Force all files to be re-parsed` 后点击 `OK`,等待 Source Insight 重新解析工程里的文件完成即可。 2. 如何在标题栏里显示文件全路径? 打开菜单里的「Options」-「Preferences」-「Display」,取消勾选 `Trim long path names with ellipses`。
--- layout: wiki title: Source Insight categories: tools description: Source Insight 工具的快捷键及使用日常。 keywords: Source Insight --- ### 快捷键 C --> Ctrl S --> Shift M --> Alt | 功能 | 快捷键 | |:-------------|:-------| | 返回 | M-, | | 前进 | M-. | | 跳到定义 | C-= | | 查找引用 | C-/ | | 搜索 | C-f | | 向下搜索 | F4 | | 向上搜索 | F3 | | 高亮当前单词 | S-F8 | ### Q&A 1. 新建工程后函数跳转等遇到 `symbol not found` 如何解决? 打开菜单里的「Project」-「Synchronize Files」(快捷键 <kbd>Alt</kbd> + <kbd>Shift</kbd> +<kbd>S</kbd>),勾选 `Force all files to be re-parsed` 后点击 `OK`,等待 Source Insight 重新解析工程里的文件完成即可。 + + 2. 如何在标题栏里显示文件全路径? + + 打开菜单里的「Options」-「Preferences」-「Display」,取消勾选 `Trim long path names with ellipses`。
4
0.125
4
0
942bb524f3dc21333463f777b7f8f8e8a7f3cb1e
lib/active_set/filtering/operation.rb
lib/active_set/filtering/operation.rb
require_relative '../attribute_instruction' require_relative './enumerable_strategy' require_relative './active_record_strategy' class ActiveSet module Filtering class Operation def initialize(set, instructions_hash) @set = set @instructions_hash = instructions_hash end # rubocop:disable Metrics/MethodLength def execute attribute_instructions = @instructions_hash .flatten_keys .map { |k, v| AttributeInstruction.new(k, v) } activerecord_filtered_set = attribute_instructions.reduce(@set) do |set, attribute_instruction| maybe_set_or_false = ActiveRecordStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end return activerecord_filtered_set if attribute_instructions.all?(&:processed?) attribute_instructions.reject(&:processed?).reduce(activerecord_filtered_set) do |set, attribute_instruction| maybe_set_or_false = EnumerableStrategy.new(set, attribute_instruction).execute maybe_set_or_false.presence || set end end # rubocop:enable Metrics/MethodLength def operation_instructions @instructions_hash.symbolize_keys end end end end
require_relative '../attribute_instruction' require_relative './enumerable_strategy' require_relative './active_record_strategy' class ActiveSet module Filtering class Operation def initialize(set, instructions_hash) @set = set @instructions_hash = instructions_hash end # rubocop:disable Metrics/MethodLength def execute attribute_instructions = @instructions_hash .flatten_keys .map { |k, v| AttributeInstruction.new(k, v) } activerecord_filtered_set = attribute_instructions.reduce(@set) do |set, attribute_instruction| maybe_set_or_false = ActiveRecordStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end return activerecord_filtered_set if attribute_instructions.all?(&:processed?) attribute_instructions.reject(&:processed?).reduce(activerecord_filtered_set) do |set, attribute_instruction| maybe_set_or_false = EnumerableStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end end # rubocop:enable Metrics/MethodLength def operation_instructions @instructions_hash.symbolize_keys end end end end
Fix the logic for ensuring the filtering Enumerable adapter has properly processed a filtering instruction
Fix the logic for ensuring the filtering Enumerable adapter has properly processed a filtering instruction
Ruby
mit
fractaledmind/activeset,fractaledmind/activeset
ruby
## Code Before: require_relative '../attribute_instruction' require_relative './enumerable_strategy' require_relative './active_record_strategy' class ActiveSet module Filtering class Operation def initialize(set, instructions_hash) @set = set @instructions_hash = instructions_hash end # rubocop:disable Metrics/MethodLength def execute attribute_instructions = @instructions_hash .flatten_keys .map { |k, v| AttributeInstruction.new(k, v) } activerecord_filtered_set = attribute_instructions.reduce(@set) do |set, attribute_instruction| maybe_set_or_false = ActiveRecordStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end return activerecord_filtered_set if attribute_instructions.all?(&:processed?) attribute_instructions.reject(&:processed?).reduce(activerecord_filtered_set) do |set, attribute_instruction| maybe_set_or_false = EnumerableStrategy.new(set, attribute_instruction).execute maybe_set_or_false.presence || set end end # rubocop:enable Metrics/MethodLength def operation_instructions @instructions_hash.symbolize_keys end end end end ## Instruction: Fix the logic for ensuring the filtering Enumerable adapter has properly processed a filtering instruction ## Code After: require_relative '../attribute_instruction' require_relative './enumerable_strategy' require_relative './active_record_strategy' class ActiveSet module Filtering class Operation def initialize(set, instructions_hash) @set = set @instructions_hash = instructions_hash end # rubocop:disable Metrics/MethodLength def execute attribute_instructions = @instructions_hash .flatten_keys .map { |k, v| AttributeInstruction.new(k, v) } activerecord_filtered_set = attribute_instructions.reduce(@set) do |set, attribute_instruction| maybe_set_or_false = ActiveRecordStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end return activerecord_filtered_set if attribute_instructions.all?(&:processed?) attribute_instructions.reject(&:processed?).reduce(activerecord_filtered_set) do |set, attribute_instruction| maybe_set_or_false = EnumerableStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end end # rubocop:enable Metrics/MethodLength def operation_instructions @instructions_hash.symbolize_keys end end end end
require_relative '../attribute_instruction' require_relative './enumerable_strategy' require_relative './active_record_strategy' class ActiveSet module Filtering class Operation def initialize(set, instructions_hash) @set = set @instructions_hash = instructions_hash end # rubocop:disable Metrics/MethodLength def execute attribute_instructions = @instructions_hash .flatten_keys .map { |k, v| AttributeInstruction.new(k, v) } activerecord_filtered_set = attribute_instructions.reduce(@set) do |set, attribute_instruction| maybe_set_or_false = ActiveRecordStrategy.new(set, attribute_instruction).execute next set unless maybe_set_or_false attribute_instruction.processed = true maybe_set_or_false end return activerecord_filtered_set if attribute_instructions.all?(&:processed?) attribute_instructions.reject(&:processed?).reduce(activerecord_filtered_set) do |set, attribute_instruction| maybe_set_or_false = EnumerableStrategy.new(set, attribute_instruction).execute + next set unless maybe_set_or_false + + attribute_instruction.processed = true - maybe_set_or_false.presence || set ? ---------------- + maybe_set_or_false end end # rubocop:enable Metrics/MethodLength def operation_instructions @instructions_hash.symbolize_keys end end end end
5
0.119048
4
1
aaecfd36c1b901ac8fff3190ba365bd051e1d662
templates/ErrorView.hbs
templates/ErrorView.hbs
<div class='header'> <h1 class='breadcrumb'> <a href='#!/'>TileStream</a> </h1> </div> <div class='error'> <div class='message'>{{message}}</div> </div>
<div class='header'> <h1 class='breadcrumb'> <a class='route logo' href='#/'>TileStream</a> </h1> </div> <div class='error'> <div class='message'>{{message}}</div> </div>
Fix logo on Error page.
Fix logo on Error page.
Handlebars
bsd-3-clause
makinacorpus/tilestream,staltz/tilestream,frankrowe/tilestream,HydroLogic/tilestream,staltz/tilestream,makinacorpus/tilestream,mapbox/tilestream,HydroLogic/tilestream,markng/tilestream,NolaMark/tilestream,NolaMark/tilestream,zhm/tilestream,zhm/tilestream,simonpoole/tilestream,markng/tilestream,frankrowe/tilestream,mapbox/tilestream,simonpoole/tilestream
handlebars
## Code Before: <div class='header'> <h1 class='breadcrumb'> <a href='#!/'>TileStream</a> </h1> </div> <div class='error'> <div class='message'>{{message}}</div> </div> ## Instruction: Fix logo on Error page. ## Code After: <div class='header'> <h1 class='breadcrumb'> <a class='route logo' href='#/'>TileStream</a> </h1> </div> <div class='error'> <div class='message'>{{message}}</div> </div>
<div class='header'> <h1 class='breadcrumb'> - <a href='#!/'>TileStream</a> ? - + <a class='route logo' href='#/'>TileStream</a> ? +++++++++++++++++++ </h1> </div> - <div class='error'> <div class='message'>{{message}}</div> </div>
3
0.333333
1
2
1ed9280a21302a467214179c15958df428dbea6f
.travis.yml
.travis.yml
sudo: false language: objective-c rvm: - 2.2.3 - 2.3.0 cache: bundler os: - osx before_install: - brew install youtube-dl before_script: - which youtube-dl - youtube-dl --version script: bundle exec rake spec
sudo: false language: objective-c rvm: - 2.2.3 cache: bundler os: - osx before_install: - brew install youtube-dl before_script: - which youtube-dl - youtube-dl --version script: bundle exec rake spec
Remove Ruby 2.3.0 because that is not supporting Travis's OS X environment
Remove Ruby 2.3.0 because that is not supporting Travis's OS X environment
YAML
mit
Tomohiro/airplayer,Tomohiro/airplayer
yaml
## Code Before: sudo: false language: objective-c rvm: - 2.2.3 - 2.3.0 cache: bundler os: - osx before_install: - brew install youtube-dl before_script: - which youtube-dl - youtube-dl --version script: bundle exec rake spec ## Instruction: Remove Ruby 2.3.0 because that is not supporting Travis's OS X environment ## Code After: sudo: false language: objective-c rvm: - 2.2.3 cache: bundler os: - osx before_install: - brew install youtube-dl before_script: - which youtube-dl - youtube-dl --version script: bundle exec rake spec
sudo: false language: objective-c rvm: - 2.2.3 - - 2.3.0 cache: bundler os: - osx before_install: - brew install youtube-dl before_script: - which youtube-dl - youtube-dl --version script: bundle exec rake spec
1
0.052632
0
1
6b2b58760da192f63cdc21dfe5293be3ed1dc290
src/resources/views/plugins/tinymce.blade.php
src/resources/views/plugins/tinymce.blade.php
<script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script> <script> !function ($) { $(function(){ tinymce.init({ skin: 'redooor', selector:'textarea', menubar:false, plugins: "link image code", convert_urls: false, relative_urls: false, toolbar: "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image | code", content_css: [ @foreach (config('redminportal::tinymce') as $tinymce_css) "{{ url($tinymce_css) }}", @endforeach ] }); }) }(window.jQuery); </script>
<script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script> <script> !function ($) { $(function(){ tinymce.init({ skin: 'redooor', selector:'textarea', menubar:false, plugins: "link image code", convert_urls: false, relative_urls: false, toolbar: "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image | code", body_class: 'container-fluid', content_css: [ @foreach (config('redminportal::tinymce') as $tinymce_css) "{{ url($tinymce_css) }}", @endforeach ] }); }) }(window.jQuery); </script>
Fix Tinymce editor not showing Bootstrap components correctly by adding container-fluid class to body.
Fix Tinymce editor not showing Bootstrap components correctly by adding container-fluid class to body.
PHP
mit
redooor/redminportal,redooor/redminportal,redooor/redminportal
php
## Code Before: <script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script> <script> !function ($) { $(function(){ tinymce.init({ skin: 'redooor', selector:'textarea', menubar:false, plugins: "link image code", convert_urls: false, relative_urls: false, toolbar: "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image | code", content_css: [ @foreach (config('redminportal::tinymce') as $tinymce_css) "{{ url($tinymce_css) }}", @endforeach ] }); }) }(window.jQuery); </script> ## Instruction: Fix Tinymce editor not showing Bootstrap components correctly by adding container-fluid class to body. ## Code After: <script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script> <script> !function ($) { $(function(){ tinymce.init({ skin: 'redooor', selector:'textarea', menubar:false, plugins: "link image code", convert_urls: false, relative_urls: false, toolbar: "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image | code", body_class: 'container-fluid', content_css: [ @foreach (config('redminportal::tinymce') as $tinymce_css) "{{ url($tinymce_css) }}", @endforeach ] }); }) }(window.jQuery); </script>
<script src="{{ URL::to('vendor/redooor/redminportal/js/tinymce/tinymce.min.js') }}"></script> <script> !function ($) { $(function(){ tinymce.init({ skin: 'redooor', selector:'textarea', menubar:false, plugins: "link image code", convert_urls: false, relative_urls: false, toolbar: "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image | code", + body_class: 'container-fluid', content_css: [ @foreach (config('redminportal::tinymce') as $tinymce_css) "{{ url($tinymce_css) }}", @endforeach ] }); }) }(window.jQuery); </script>
1
0.047619
1
0
338644fa81cf93bafa32326ceeccd4be4b06f7ec
README.md
README.md
Tuckman Questionnare for teams101x
Tuckman Questionnare for teams101x ## SETUP #### config.php once you have cloned, create a file called "config.php" and add the following with your details in place of the placeholder values ```php <?php //Configuration File //key=>secret $config = array( 'lti_keys'=>array( 'CLIENT_KEY'=>'CLIENT_SECRET' ), 'use_db'=>true, 'db'=>array( 'driver'=>'mysql', 'hostname'=>'localhost', 'username'=>'YOUR_DB_USERNAME', 'password'=>'YOUR_DB_PASSWORD', 'dbname'=>'YOUR_DB_NAME', ) ); ?> ```
Update readme file with config info
Update readme file with config info
Markdown
mit
UQ-UQx/teams101x_generate_pdf,UQ-UQx/teams101x_generate_pdf,UQ-UQx/teams101x_generate_pdf
markdown
## Code Before: Tuckman Questionnare for teams101x ## Instruction: Update readme file with config info ## Code After: Tuckman Questionnare for teams101x ## SETUP #### config.php once you have cloned, create a file called "config.php" and add the following with your details in place of the placeholder values ```php <?php //Configuration File //key=>secret $config = array( 'lti_keys'=>array( 'CLIENT_KEY'=>'CLIENT_SECRET' ), 'use_db'=>true, 'db'=>array( 'driver'=>'mysql', 'hostname'=>'localhost', 'username'=>'YOUR_DB_USERNAME', 'password'=>'YOUR_DB_PASSWORD', 'dbname'=>'YOUR_DB_NAME', ) ); ?> ```
Tuckman Questionnare for teams101x + + + + + + ## SETUP + + #### config.php + + once you have cloned, create a file called "config.php" and add the following with your details in place of the placeholder values + + ```php + <?php + //Configuration File + //key=>secret + $config = array( + 'lti_keys'=>array( + 'CLIENT_KEY'=>'CLIENT_SECRET' + ), + 'use_db'=>true, + 'db'=>array( + 'driver'=>'mysql', + 'hostname'=>'localhost', + 'username'=>'YOUR_DB_USERNAME', + 'password'=>'YOUR_DB_PASSWORD', + 'dbname'=>'YOUR_DB_NAME', + ) + ); + ?> + ```
30
30
30
0
b1262d6de025236ba6e273684b0d06657210872f
docs/installation/requirements.rst
docs/installation/requirements.rst
Requirements ============ Imbo requires a web server (for instance `Apache <http://httpd.apache.org/>`_, `Nginx <http://nginx.org/en/>`_ or `Lighttpd <http://www.lighttpd.net/>`_) running `PHP >= 5.6 <http://php.net>`_ and the `Imagick <http://pecl.php.net/package/imagick>`_ extension for PHP. You will also need a backend for storing image information, like for instance `MongoDB <http://www.mongodb.org/>`_ or `MySQL <http://www.mysql.com>`_. If you want to use MongoDB as a database and/or `GridFS <http://docs.mongodb.org/manual/core/gridfs/>`_ for storage, you will need to install the `Mongo <http://pecl.php.net/package/mongo>`_ PECL extension, and if you want to use a :abbr:`RDBMS (Relational Database Management System)` like MySQL, you will need to install the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_.
Requirements ============ Imbo requires a web server (for instance `Apache <http://httpd.apache.org/>`_, `Nginx <http://nginx.org/en/>`_ or `Lighttpd <http://www.lighttpd.net/>`_) running `PHP >= 5.6 <http://php.net>`_ and the `Imagick <http://pecl.php.net/package/imagick>`_ extension for PHP (with at least ImageMagick 6.3.8). You will also need a backend for storing image information, like for instance `MongoDB <http://www.mongodb.org/>`_ or `MySQL <http://www.mysql.com>`_. If you want to use MongoDB as a database and/or `GridFS <http://docs.mongodb.org/manual/core/gridfs/>`_ for storage, you will need to install the `Mongo <http://pecl.php.net/package/mongo>`_ PECL extension, and if you want to use a :abbr:`RDBMS (Relational Database Management System)` like MySQL, you will need to install the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_.
Add note about ImageMagick requirement
Add note about ImageMagick requirement
reStructuredText
mit
TV2/imbo,imbo/imbo,TV2/imbo,matslindh/imbo,imbo/imbo,matslindh/imbo
restructuredtext
## Code Before: Requirements ============ Imbo requires a web server (for instance `Apache <http://httpd.apache.org/>`_, `Nginx <http://nginx.org/en/>`_ or `Lighttpd <http://www.lighttpd.net/>`_) running `PHP >= 5.6 <http://php.net>`_ and the `Imagick <http://pecl.php.net/package/imagick>`_ extension for PHP. You will also need a backend for storing image information, like for instance `MongoDB <http://www.mongodb.org/>`_ or `MySQL <http://www.mysql.com>`_. If you want to use MongoDB as a database and/or `GridFS <http://docs.mongodb.org/manual/core/gridfs/>`_ for storage, you will need to install the `Mongo <http://pecl.php.net/package/mongo>`_ PECL extension, and if you want to use a :abbr:`RDBMS (Relational Database Management System)` like MySQL, you will need to install the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_. ## Instruction: Add note about ImageMagick requirement ## Code After: Requirements ============ Imbo requires a web server (for instance `Apache <http://httpd.apache.org/>`_, `Nginx <http://nginx.org/en/>`_ or `Lighttpd <http://www.lighttpd.net/>`_) running `PHP >= 5.6 <http://php.net>`_ and the `Imagick <http://pecl.php.net/package/imagick>`_ extension for PHP (with at least ImageMagick 6.3.8). You will also need a backend for storing image information, like for instance `MongoDB <http://www.mongodb.org/>`_ or `MySQL <http://www.mysql.com>`_. If you want to use MongoDB as a database and/or `GridFS <http://docs.mongodb.org/manual/core/gridfs/>`_ for storage, you will need to install the `Mongo <http://pecl.php.net/package/mongo>`_ PECL extension, and if you want to use a :abbr:`RDBMS (Relational Database Management System)` like MySQL, you will need to install the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_.
Requirements ============ - Imbo requires a web server (for instance `Apache <http://httpd.apache.org/>`_, `Nginx <http://nginx.org/en/>`_ or `Lighttpd <http://www.lighttpd.net/>`_) running `PHP >= 5.6 <http://php.net>`_ and the `Imagick <http://pecl.php.net/package/imagick>`_ extension for PHP. ? ^ + Imbo requires a web server (for instance `Apache <http://httpd.apache.org/>`_, `Nginx <http://nginx.org/en/>`_ or `Lighttpd <http://www.lighttpd.net/>`_) running `PHP >= 5.6 <http://php.net>`_ and the `Imagick <http://pecl.php.net/package/imagick>`_ extension for PHP (with at least ImageMagick 6.3.8). ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You will also need a backend for storing image information, like for instance `MongoDB <http://www.mongodb.org/>`_ or `MySQL <http://www.mysql.com>`_. If you want to use MongoDB as a database and/or `GridFS <http://docs.mongodb.org/manual/core/gridfs/>`_ for storage, you will need to install the `Mongo <http://pecl.php.net/package/mongo>`_ PECL extension, and if you want to use a :abbr:`RDBMS (Relational Database Management System)` like MySQL, you will need to install the `Doctrine Database Abstraction Layer <http://www.doctrine-project.org/projects/dbal.html>`_.
2
0.333333
1
1
5b3cdc3df66d2eadfc473eac69f00b616b996a22
docs/index.rst
docs/index.rst
.. sqlr documentation master file, created by sphinx-quickstart on Sun Jan 29 10:27:50 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. sqlr -- SQL package =================== +--------------------+-----------------------------------+ | GoDoc Documenation | https://godoc.org/github.com/sqlr | +--------------------+-----------------------------------+ | Source Code | https://github.com/sqlr | +--------------------+-----------------------------------+ .. toctree:: :maxdepth: 1 :glob: intro queries column-mapping sql-format dialects naming-conventions schema sqlr-gen tests prior-art .. Indices and tables .. ================== .. * :ref:`genindex` .. * :ref:`modindex` .. * :ref:`search`
.. sqlr documentation master file, created by sphinx-quickstart on Sun Jan 29 10:27:50 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. sqlr -- SQL package =================== +--------------------+--------------------------------------------+ | GoDoc Documenation | https://godoc.org/github.com/jjeffery/sqlr | +--------------------+--------------------------------------------+ | Source Code | https://github.com/jjeffery/sqlr | +--------------------+--------------------------------------------+ .. toctree:: :maxdepth: 1 :glob: intro queries column-mapping sql-format dialects naming-conventions schema sqlr-gen tests prior-art .. Indices and tables .. ================== .. * :ref:`genindex` .. * :ref:`modindex` .. * :ref:`search`
Fix GoDoc/Github URLs in documentation
Fix GoDoc/Github URLs in documentation
reStructuredText
mit
jjeffery/sqlr,jjeffery/sqlr
restructuredtext
## Code Before: .. sqlr documentation master file, created by sphinx-quickstart on Sun Jan 29 10:27:50 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. sqlr -- SQL package =================== +--------------------+-----------------------------------+ | GoDoc Documenation | https://godoc.org/github.com/sqlr | +--------------------+-----------------------------------+ | Source Code | https://github.com/sqlr | +--------------------+-----------------------------------+ .. toctree:: :maxdepth: 1 :glob: intro queries column-mapping sql-format dialects naming-conventions schema sqlr-gen tests prior-art .. Indices and tables .. ================== .. * :ref:`genindex` .. * :ref:`modindex` .. * :ref:`search` ## Instruction: Fix GoDoc/Github URLs in documentation ## Code After: .. sqlr documentation master file, created by sphinx-quickstart on Sun Jan 29 10:27:50 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. sqlr -- SQL package =================== +--------------------+--------------------------------------------+ | GoDoc Documenation | https://godoc.org/github.com/jjeffery/sqlr | +--------------------+--------------------------------------------+ | Source Code | https://github.com/jjeffery/sqlr | +--------------------+--------------------------------------------+ .. toctree:: :maxdepth: 1 :glob: intro queries column-mapping sql-format dialects naming-conventions schema sqlr-gen tests prior-art .. Indices and tables .. ================== .. * :ref:`genindex` .. * :ref:`modindex` .. * :ref:`search`
.. sqlr documentation master file, created by sphinx-quickstart on Sun Jan 29 10:27:50 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. sqlr -- SQL package =================== - +--------------------+-----------------------------------+ + +--------------------+--------------------------------------------+ ? +++++++++ - | GoDoc Documenation | https://godoc.org/github.com/sqlr | + | GoDoc Documenation | https://godoc.org/github.com/jjeffery/sqlr | ? +++++++++ - +--------------------+-----------------------------------+ + +--------------------+--------------------------------------------+ ? +++++++++ - | Source Code | https://github.com/sqlr | + | Source Code | https://github.com/jjeffery/sqlr | ? +++++++++ - +--------------------+-----------------------------------+ + +--------------------+--------------------------------------------+ ? +++++++++ .. toctree:: :maxdepth: 1 :glob: intro queries column-mapping sql-format dialects naming-conventions schema sqlr-gen tests prior-art .. Indices and tables .. ================== .. * :ref:`genindex` .. * :ref:`modindex` .. * :ref:`search`
10
0.263158
5
5
8fad47da8c5cba3c16d8eb045c18cee1629a8b28
src/main/java/reborncore/api/IToolHandler.java
src/main/java/reborncore/api/IToolHandler.java
package reborncore.api; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** * Added onto an item */ public interface IToolHandler { /** * Called when a machine is actived with the item that has IToolHandler on it * * @param pos the pos of the block * @param world the world of the block * @param player the player that actived the block * @param side the side that the player actived * @param damage if the tool should be damged, or power taken * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. */ boolean handleTool(BlockPos pos, World world, EntityPlayer player, EnumFacing side, boolean damage); }
package reborncore.api; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** * Added onto an item */ public interface IToolHandler { /** * Called when a machine is actived with the item that has IToolHandler on it * * @param stack the held itemstack * @param pos the pos of the block * @param world the world of the block * @param player the player that actived the block * @param side the side that the player actived * @param damage if the tool should be damged, or power taken * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. */ boolean handleTool(ItemStack stack, BlockPos pos, World world, EntityPlayer player, EnumFacing side, boolean damage); }
Add the stack as it might be useful :P
Add the stack as it might be useful :P
Java
mit
TechReborn/RebornCore
java
## Code Before: package reborncore.api; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** * Added onto an item */ public interface IToolHandler { /** * Called when a machine is actived with the item that has IToolHandler on it * * @param pos the pos of the block * @param world the world of the block * @param player the player that actived the block * @param side the side that the player actived * @param damage if the tool should be damged, or power taken * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. */ boolean handleTool(BlockPos pos, World world, EntityPlayer player, EnumFacing side, boolean damage); } ## Instruction: Add the stack as it might be useful :P ## Code After: package reborncore.api; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** * Added onto an item */ public interface IToolHandler { /** * Called when a machine is actived with the item that has IToolHandler on it * * @param stack the held itemstack * @param pos the pos of the block * @param world the world of the block * @param player the player that actived the block * @param side the side that the player actived * @param damage if the tool should be damged, or power taken * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. */ boolean handleTool(ItemStack stack, BlockPos pos, World world, EntityPlayer player, EnumFacing side, boolean damage); }
package reborncore.api; import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** * Added onto an item */ public interface IToolHandler { /** * Called when a machine is actived with the item that has IToolHandler on it * + * @param stack the held itemstack * @param pos the pos of the block * @param world the world of the block * @param player the player that actived the block * @param side the side that the player actived * @param damage if the tool should be damged, or power taken * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. */ - boolean handleTool(BlockPos pos, World world, EntityPlayer player, EnumFacing side, boolean damage); + boolean handleTool(ItemStack stack, BlockPos pos, World world, EntityPlayer player, EnumFacing side, boolean damage); ? +++++++++++++++++ }
4
0.16
3
1
025d8f691d883d11511c45da4738d2c5af6b2afe
src/Events/RegisterApiRoutes.php
src/Events/RegisterApiRoutes.php
<?php namespace Flarum\Events; use Flarum\Api\Request; use Flarum\Http\RouteCollection; use Psr\Http\Message\ServerRequestInterface; class RegisterApiRoutes { /** * @var RouteCollection */ public $routes; /** * @param RouteCollection $routes */ public function __construct(RouteCollection $routes) { $this->routes = $routes; } public function get($url, $name, $action) { $this->route('get', $url, $name, $action); } public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); } protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action)); } protected function action($class) { return function (ServerRequestInterface $httpRequest, $routeParams) use ($class) { $action = app($class); $actor = app('flarum.actor'); $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); $request = new Request($input, $actor, $httpRequest); return $action->handle($request); }; } }
<?php namespace Flarum\Events; use Flarum\Api\Request; use Flarum\Http\RouteCollection; use Psr\Http\Message\ServerRequestInterface; class RegisterApiRoutes { /** * @var RouteCollection */ public $routes; /** * @param RouteCollection $routes */ public function __construct(RouteCollection $routes) { $this->routes = $routes; } public function get($url, $name, $action) { $this->route('get', $url, $name, $action); } public function post($url, $name, $action) { $this->route('post', $url, $name, $action); } public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); } public function delete($url, $name, $action) { $this->route('delete', $url, $name, $action); } protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action)); } protected function action($class) { return function (ServerRequestInterface $httpRequest, $routeParams) use ($class) { $action = app($class); $actor = app('flarum.actor'); $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); $request = new Request($input, $actor, $httpRequest); return $action->handle($request); }; } }
Add API methods to add POST/DELETE routes to the API
Add API methods to add POST/DELETE routes to the API
PHP
mit
zaksoup/core,Luceos/core,malayladu/core,malayladu/core,Onyx47/core,vuthaihoc/core,billmn/core,malayladu/core,dungphanxuan/core,vuthaihoc/core,kidaa/core,liukaijv/core,renyuneyun/core,falconchen/core,dungphanxuan/core,Albert221/core,falconchen/core,huytd/core,utkarshx/core,zaksoup/core,dungphanxuan/core,renyuneyun/core,zaksoup/core,jubianchi/core,flarum/core,datitisev/core,renyuneyun/core,liukaijv/core,flarum/core,Luceos/core,Albert221/core,kirkbushell/core,jubianchi/core,Luceos/core,datitisev/core,billmn/core,malayladu/core,datitisev/core,kirkbushell/core,utkarshx/core,Onyx47/core,Onyx47/core,flarum/core,Albert221/core,renyuneyun/core,kirkbushell/core,kidaa/core,huytd/core,Albert221/core,datitisev/core,falconchen/core,billmn/core,kidaa/core,kirkbushell/core,vuthaihoc/core,Luceos/core
php
## Code Before: <?php namespace Flarum\Events; use Flarum\Api\Request; use Flarum\Http\RouteCollection; use Psr\Http\Message\ServerRequestInterface; class RegisterApiRoutes { /** * @var RouteCollection */ public $routes; /** * @param RouteCollection $routes */ public function __construct(RouteCollection $routes) { $this->routes = $routes; } public function get($url, $name, $action) { $this->route('get', $url, $name, $action); } public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); } protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action)); } protected function action($class) { return function (ServerRequestInterface $httpRequest, $routeParams) use ($class) { $action = app($class); $actor = app('flarum.actor'); $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); $request = new Request($input, $actor, $httpRequest); return $action->handle($request); }; } } ## Instruction: Add API methods to add POST/DELETE routes to the API ## Code After: <?php namespace Flarum\Events; use Flarum\Api\Request; use Flarum\Http\RouteCollection; use Psr\Http\Message\ServerRequestInterface; class RegisterApiRoutes { /** * @var RouteCollection */ public $routes; /** * @param RouteCollection $routes */ public function __construct(RouteCollection $routes) { $this->routes = $routes; } public function get($url, $name, $action) { $this->route('get', $url, $name, $action); } public function post($url, $name, $action) { $this->route('post', $url, $name, $action); } public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); } public function delete($url, $name, $action) { $this->route('delete', $url, $name, $action); } protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action)); } protected function action($class) { return function (ServerRequestInterface $httpRequest, $routeParams) use ($class) { $action = app($class); $actor = app('flarum.actor'); $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); $request = new Request($input, $actor, $httpRequest); return $action->handle($request); }; } }
<?php namespace Flarum\Events; use Flarum\Api\Request; use Flarum\Http\RouteCollection; use Psr\Http\Message\ServerRequestInterface; class RegisterApiRoutes { /** * @var RouteCollection */ public $routes; /** * @param RouteCollection $routes */ public function __construct(RouteCollection $routes) { $this->routes = $routes; } public function get($url, $name, $action) { $this->route('get', $url, $name, $action); } + public function post($url, $name, $action) + { + $this->route('post', $url, $name, $action); + } + public function patch($url, $name, $action) { $this->route('patch', $url, $name, $action); + } + + public function delete($url, $name, $action) + { + $this->route('delete', $url, $name, $action); } protected function route($method, $url, $name, $action) { $this->routes->$method($url, $name, $this->action($action)); } protected function action($class) { return function (ServerRequestInterface $httpRequest, $routeParams) use ($class) { $action = app($class); $actor = app('flarum.actor'); $input = array_merge($httpRequest->getQueryParams(), $httpRequest->getAttributes(), $routeParams); $request = new Request($input, $actor, $httpRequest); return $action->handle($request); }; } }
10
0.204082
10
0
290e0089e664f8a4ccabbc9f51446b0554a491ef
.travis.yml
.travis.yml
language: node_js # Use container-based infrastructure sudo: false node_js: - "6" - "5" - "4" script: - npm run lint - npm run test:cover after_script: - codeclimate-test-reporter < coverage/lcov.info addons: code_climate: repo_token: d46a480972b9542986bef5f14563522aa4ad65a9122fa68158de52d54d044933
language: node_js node_js: - "node" # latest stable release - "lts/*" # latest LTS release script: - npm run lint - npm run test:cover after_script: - codeclimate-test-reporter < coverage/lcov.info addons: code_climate: repo_token: d46a480972b9542986bef5f14563522aa4ad65a9122fa68158de52d54d044933
Update to supported node versions
Update to supported node versions Also sudo is no longer required: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
YAML
mit
nordsoftware/redux-fetch-data
yaml
## Code Before: language: node_js # Use container-based infrastructure sudo: false node_js: - "6" - "5" - "4" script: - npm run lint - npm run test:cover after_script: - codeclimate-test-reporter < coverage/lcov.info addons: code_climate: repo_token: d46a480972b9542986bef5f14563522aa4ad65a9122fa68158de52d54d044933 ## Instruction: Update to supported node versions Also sudo is no longer required: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration ## Code After: language: node_js node_js: - "node" # latest stable release - "lts/*" # latest LTS release script: - npm run lint - npm run test:cover after_script: - codeclimate-test-reporter < coverage/lcov.info addons: code_climate: repo_token: d46a480972b9542986bef5f14563522aa4ad65a9122fa68158de52d54d044933
language: node_js - # Use container-based infrastructure - sudo: false - node_js: + - "node" # latest stable release + - "lts/*" # latest LTS release - - "6" - - "5" - - "4" script: - npm run lint - npm run test:cover after_script: - codeclimate-test-reporter < coverage/lcov.info addons: code_climate: repo_token: d46a480972b9542986bef5f14563522aa4ad65a9122fa68158de52d54d044933
8
0.4
2
6
05e03aa6e5f99e1e0a47c6a3ba023c802b6ec968
README.md
README.md
RooMUHistos =========== Multiple-universe histograms based on ROOT.
RooMUHistos =========== Multiple-universe histograms based on ROOT. Build =========== Currently, the build works only on Mac OSX. There is an environment-setting script in the home area that looks for a ROOT configuration script in the user `$HOME` area. If it doesn't find it, it complains. If it gets past this, it adds the RooMUHistos library directories to the `$LD_LIBRARY_PATH` or `$DYLD_LIBRARY_PATH` depending on OS. Once the environment is configured, run `make` in the `PlotUtils` directory and then run `make` in the macros directory. Then test the build with `macros/tryToRead` and `macros/tryToWrite`. To-Do =========== 1. Build on Scientific Linux! 2. Figure out what is missing from the port from Minerva software that is important. 3. Bring in anything from Minerva software that is important. 4. Think about unfolding and other Minerva analysis packages that might be useful. 5. Add lots of other good items to this list and make the package fantastic.
Expand a bit on how to start and add some to-dos.
Expand a bit on how to start and add some to-dos.
Markdown
mit
ManyUniverseAna/RooMUHistos,ManyUniverseAna/RooMUHistos,ManyUniverseAna/RooMUHistos
markdown
## Code Before: RooMUHistos =========== Multiple-universe histograms based on ROOT. ## Instruction: Expand a bit on how to start and add some to-dos. ## Code After: RooMUHistos =========== Multiple-universe histograms based on ROOT. Build =========== Currently, the build works only on Mac OSX. There is an environment-setting script in the home area that looks for a ROOT configuration script in the user `$HOME` area. If it doesn't find it, it complains. If it gets past this, it adds the RooMUHistos library directories to the `$LD_LIBRARY_PATH` or `$DYLD_LIBRARY_PATH` depending on OS. Once the environment is configured, run `make` in the `PlotUtils` directory and then run `make` in the macros directory. Then test the build with `macros/tryToRead` and `macros/tryToWrite`. To-Do =========== 1. Build on Scientific Linux! 2. Figure out what is missing from the port from Minerva software that is important. 3. Bring in anything from Minerva software that is important. 4. Think about unfolding and other Minerva analysis packages that might be useful. 5. Add lots of other good items to this list and make the package fantastic.
RooMUHistos =========== Multiple-universe histograms based on ROOT. + + Build + =========== + + Currently, the build works only on Mac OSX. There is an environment-setting + script in the home area that looks for a ROOT configuration script in the + user `$HOME` area. If it doesn't find it, it complains. If it gets past this, + it adds the RooMUHistos library directories to the `$LD_LIBRARY_PATH` or + `$DYLD_LIBRARY_PATH` depending on OS. + + Once the environment is configured, run `make` in the `PlotUtils` directory + and then run `make` in the macros directory. Then test the build with + `macros/tryToRead` and `macros/tryToWrite`. + + To-Do + =========== + + 1. Build on Scientific Linux! + 2. Figure out what is missing from the port from Minerva software that is important. + 3. Bring in anything from Minerva software that is important. + 4. Think about unfolding and other Minerva analysis packages that might be useful. + 5. Add lots of other good items to this list and make the package fantastic. +
23
5.75
23
0
22e436ffddaed8ea1a2ce6168fcaedc99cc21313
Assets/.scripts/build.sh
Assets/.scripts/build.sh
project="ci-build" echo "Attempting to build $project for Windows" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \ -quit echo "Attempting to build $project for OS X" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \ -quit echo 'Logs from OS X build' cat $(pwd)/unity.log echo "Attempting to build $project for Linux" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \ -quit echo 'Logs from build' cat $(pwd)/unity.log
project="ci-build" echo "Attempting to build $project for Windows" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \ -quit rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo "Attempting to build $project for OS X" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \ -quit rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo 'Logs from OS X build' cat $(pwd)/unity.log echo "Attempting to build $project for Linux" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \ -quit rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo 'Logs from build' cat $(pwd)/unity.log
Exit if result code is non zero
Exit if result code is non zero
Shell
mit
virtuoushub/game-off-2016,virtuoushub/game-off-2016,whoa-algebraic/game-off-2016,whoa-algebraic/game-off-2016,whoa-algebraic/game-off-2016,virtuoushub/game-off-2016
shell
## Code Before: project="ci-build" echo "Attempting to build $project for Windows" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \ -quit echo "Attempting to build $project for OS X" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \ -quit echo 'Logs from OS X build' cat $(pwd)/unity.log echo "Attempting to build $project for Linux" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \ -quit echo 'Logs from build' cat $(pwd)/unity.log ## Instruction: Exit if result code is non zero ## Code After: project="ci-build" echo "Attempting to build $project for Windows" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \ -quit rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo "Attempting to build $project for OS X" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \ -quit rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo 'Logs from OS X build' cat $(pwd)/unity.log echo "Attempting to build $project for Linux" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \ -quit rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo 'Logs from build' cat $(pwd)/unity.log
project="ci-build" echo "Attempting to build $project for Windows" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \ -quit + rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo "Attempting to build $project for OS X" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \ -quit + rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo 'Logs from OS X build' cat $(pwd)/unity.log echo "Attempting to build $project for Linux" /Applications/Unity/Unity.app/Contents/MacOS/Unity \ -batchmode \ -nographics \ -silent-crashes \ -logFile $(pwd)/unity.log \ -projectPath $(pwd) \ -buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \ -quit + rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi echo 'Logs from build' cat $(pwd)/unity.log
3
0.078947
3
0
d24e4c23c94d722c195f27b52bea33a659e1fd79
test/eslint-test.js
test/eslint-test.js
const lint = require('mocha-eslint'); const paths = [ 'bin', 'ext', 'lib', 'test' ]; const options = {}; lint(paths, options);
const lint = require('mocha-eslint'); const paths = [ 'bin', 'ext', 'lib', 'test' ]; lint(paths, { timeout: 5000 });
Increase timeout for eslint tests.
Increase timeout for eslint tests.
JavaScript
mit
rwjblue/ember-template-lint
javascript
## Code Before: const lint = require('mocha-eslint'); const paths = [ 'bin', 'ext', 'lib', 'test' ]; const options = {}; lint(paths, options); ## Instruction: Increase timeout for eslint tests. ## Code After: const lint = require('mocha-eslint'); const paths = [ 'bin', 'ext', 'lib', 'test' ]; lint(paths, { timeout: 5000 });
const lint = require('mocha-eslint'); const paths = [ 'bin', 'ext', 'lib', 'test' ]; - const options = {}; - lint(paths, options); + lint(paths, { + timeout: 5000 + });
5
0.454545
3
2
9352cf4d7376650774907cc319ca4a89d2f68142
docker/ubuntu-14.04/Dockerfile
docker/ubuntu-14.04/Dockerfile
FROM chef/ubuntu-14.04 RUN install -d -m 755 /cookbooks /etc/chef /var/chef/node RUN echo "local_mode true" >> /etc/chef/client.rb; \ echo "cookbook_path ['/cookbooks']" >> /etc/chef/client.rb; \ echo "cache_path '/var/chef/cache'" >> /etc/chef/client.rb; \ echo "node_path '/var/chef/node'" >> /etc/chef/client.rb; \ echo "environment '_default'" >> /etc/chef/client.rb; \ echo "ssl_verify_mode :verify_peer" >> /etc/chef/client.rb; RUN echo '{"run_list":["recipe[mackerel-agent]"]}' > /var/chef/node/localhost.json COPY ./cookbooks /cookbooks RUN chef-client -j /var/chef/node/localhost.json
FROM ubuntu:14.04 RUN apt-get update && apt-get install -y curl && \ curl -sL -o /tmp/chef_12.19.36-1_amd64.deb \ https://packages.chef.io/files/stable/chef/12.19.36/ubuntu/14.04/chef_12.19.36-1_amd64.deb && \ dpkg -i /tmp/chef_12.19.36-1_amd64.deb RUN install -d -m 755 /cookbooks /etc/chef /var/chef/node RUN echo "local_mode true" >> /etc/chef/client.rb; \ echo "cookbook_path ['/cookbooks']" >> /etc/chef/client.rb; \ echo "cache_path '/var/chef/cache'" >> /etc/chef/client.rb; \ echo "node_path '/var/chef/node'" >> /etc/chef/client.rb; \ echo "environment '_default'" >> /etc/chef/client.rb; \ echo "ssl_verify_mode :verify_peer" >> /etc/chef/client.rb; RUN echo '{"run_list":["recipe[mackerel-agent]"], "mackerel-agent": {"start_on_setup": false}}' > /var/chef/node/localhost.json COPY ./cookbooks /cookbooks RUN chef-client -j /var/chef/node/localhost.json
Modify Dockerfile so that build finishes successfully
Modify Dockerfile so that build finishes successfully
unknown
apache-2.0
mackerelio/cookbook-mackerel-agent,mackerelio/cookbook-mackerel-agent,mackerelio/cookbook-mackerel-agent
unknown
## Code Before: FROM chef/ubuntu-14.04 RUN install -d -m 755 /cookbooks /etc/chef /var/chef/node RUN echo "local_mode true" >> /etc/chef/client.rb; \ echo "cookbook_path ['/cookbooks']" >> /etc/chef/client.rb; \ echo "cache_path '/var/chef/cache'" >> /etc/chef/client.rb; \ echo "node_path '/var/chef/node'" >> /etc/chef/client.rb; \ echo "environment '_default'" >> /etc/chef/client.rb; \ echo "ssl_verify_mode :verify_peer" >> /etc/chef/client.rb; RUN echo '{"run_list":["recipe[mackerel-agent]"]}' > /var/chef/node/localhost.json COPY ./cookbooks /cookbooks RUN chef-client -j /var/chef/node/localhost.json ## Instruction: Modify Dockerfile so that build finishes successfully ## Code After: FROM ubuntu:14.04 RUN apt-get update && apt-get install -y curl && \ curl -sL -o /tmp/chef_12.19.36-1_amd64.deb \ https://packages.chef.io/files/stable/chef/12.19.36/ubuntu/14.04/chef_12.19.36-1_amd64.deb && \ dpkg -i /tmp/chef_12.19.36-1_amd64.deb RUN install -d -m 755 /cookbooks /etc/chef /var/chef/node RUN echo "local_mode true" >> /etc/chef/client.rb; \ echo "cookbook_path ['/cookbooks']" >> /etc/chef/client.rb; \ echo "cache_path '/var/chef/cache'" >> /etc/chef/client.rb; \ echo "node_path '/var/chef/node'" >> /etc/chef/client.rb; \ echo "environment '_default'" >> /etc/chef/client.rb; \ echo "ssl_verify_mode :verify_peer" >> /etc/chef/client.rb; RUN echo '{"run_list":["recipe[mackerel-agent]"], "mackerel-agent": {"start_on_setup": false}}' > /var/chef/node/localhost.json COPY ./cookbooks /cookbooks RUN chef-client -j /var/chef/node/localhost.json
- FROM chef/ubuntu-14.04 ? ----- ^ + FROM ubuntu:14.04 ? ^ + + RUN apt-get update && apt-get install -y curl && \ + curl -sL -o /tmp/chef_12.19.36-1_amd64.deb \ + https://packages.chef.io/files/stable/chef/12.19.36/ubuntu/14.04/chef_12.19.36-1_amd64.deb && \ + dpkg -i /tmp/chef_12.19.36-1_amd64.deb RUN install -d -m 755 /cookbooks /etc/chef /var/chef/node RUN echo "local_mode true" >> /etc/chef/client.rb; \ echo "cookbook_path ['/cookbooks']" >> /etc/chef/client.rb; \ echo "cache_path '/var/chef/cache'" >> /etc/chef/client.rb; \ echo "node_path '/var/chef/node'" >> /etc/chef/client.rb; \ echo "environment '_default'" >> /etc/chef/client.rb; \ echo "ssl_verify_mode :verify_peer" >> /etc/chef/client.rb; - RUN echo '{"run_list":["recipe[mackerel-agent]"]}' > /var/chef/node/localhost.json + RUN echo '{"run_list":["recipe[mackerel-agent]"], "mackerel-agent": {"start_on_setup": false}}' > /var/chef/node/localhost.json ? +++++++++++++++++++++++++++++++++++++++++++++ COPY ./cookbooks /cookbooks RUN chef-client -j /var/chef/node/localhost.json
9
0.6
7
2
a5675bcb304623bcc28307751fd538f253c02fae
document/app.js
document/app.js
var express = require('express'); module.exports = function setup(options, imports, register) { var backend = imports.backend.app, frontend = imports.frontend.app; var plugin = { app: {}, documents: {} }; backend.get('/api/Documents', function (req, res, next) { res.json(module.documents); }); register(null, { document: plugin }); };
var express = require('express'); module.exports = function setup(options, imports, register) { var backend = imports.backend.app, frontend = imports.frontend.app; var plugin = { app: {}, documents: {}, addType: function (name, config) { this.documents[name] = config; } }; backend.get('/api/Documents', function (req, res, next) { res.json(module.documents); }); register(null, { document: plugin }); };
Add addType method to content
Add addType method to content
JavaScript
mit
bauhausjs/bauhausjs,bauhausjs/bauhausjs,bauhausjs/bauhausjs,bauhausjs/bauhausjs
javascript
## Code Before: var express = require('express'); module.exports = function setup(options, imports, register) { var backend = imports.backend.app, frontend = imports.frontend.app; var plugin = { app: {}, documents: {} }; backend.get('/api/Documents', function (req, res, next) { res.json(module.documents); }); register(null, { document: plugin }); }; ## Instruction: Add addType method to content ## Code After: var express = require('express'); module.exports = function setup(options, imports, register) { var backend = imports.backend.app, frontend = imports.frontend.app; var plugin = { app: {}, documents: {}, addType: function (name, config) { this.documents[name] = config; } }; backend.get('/api/Documents', function (req, res, next) { res.json(module.documents); }); register(null, { document: plugin }); };
var express = require('express'); module.exports = function setup(options, imports, register) { var backend = imports.backend.app, frontend = imports.frontend.app; var plugin = { app: {}, - documents: {} + documents: {}, ? + + addType: function (name, config) { + this.documents[name] = config; + } }; backend.get('/api/Documents', function (req, res, next) { res.json(module.documents); }); register(null, { document: plugin }); };
5
0.263158
4
1
bd37635462a0e0ccc8a1e240ec427ea5244acf18
client/components/Main/Loading.jsx
client/components/Main/Loading.jsx
var React = require('react'); var Loading = React.createClass({ render: function() { return( <div className="text-center loading"><img src="https://3.bp.blogspot.com/-FjddXJJsIv8/VeaoXmv8HQI/AAAAAAAAGww/PlCl0uSR_9g/s1600/loading.gif"></img></div> ); } }); module.exports = Loading;
var React = require('react'); // Please fix this link ASAP... var Loading = React.createClass({ render: function() { return( <div className="text-center loading"><img src="https://3.bp.blogspot.com/-FjddXJJsIv8/VeaoXmv8HQI/AAAAAAAAGww/PlCl0uSR_9g/s1600/loading.gif"></img></div> ); } }); module.exports = Loading;
Add a comment about replacing a link.
Add a comment about replacing a link.
JSX
mit
Zanibas/Last-Stop,Zanibas/Last-Stop,Zanibas/Last-Stop
jsx
## Code Before: var React = require('react'); var Loading = React.createClass({ render: function() { return( <div className="text-center loading"><img src="https://3.bp.blogspot.com/-FjddXJJsIv8/VeaoXmv8HQI/AAAAAAAAGww/PlCl0uSR_9g/s1600/loading.gif"></img></div> ); } }); module.exports = Loading; ## Instruction: Add a comment about replacing a link. ## Code After: var React = require('react'); // Please fix this link ASAP... var Loading = React.createClass({ render: function() { return( <div className="text-center loading"><img src="https://3.bp.blogspot.com/-FjddXJJsIv8/VeaoXmv8HQI/AAAAAAAAGww/PlCl0uSR_9g/s1600/loading.gif"></img></div> ); } }); module.exports = Loading;
var React = require('react'); + + // Please fix this link ASAP... var Loading = React.createClass({ render: function() { return( <div className="text-center loading"><img src="https://3.bp.blogspot.com/-FjddXJJsIv8/VeaoXmv8HQI/AAAAAAAAGww/PlCl0uSR_9g/s1600/loading.gif"></img></div> ); } }); module.exports = Loading;
2
0.181818
2
0
e65a035a0453663fc4175de59b15cb0b55704341
README.md
README.md
A docker-compose cli tool that will watch and restart the service whenever the files changes. `compose-watch backend` This will look for a docker-compose.yml in your current folder. If it can't find it there, it will begin to work up the directories until `~`.
``` npm install compose-watch -g ``` A docker-compose cli tool that will watch and restart the service whenever the files changes. ``` compose-watch backend ``` This will look for a docker-compose.yml in your current folder. If it can't find it there, it will begin to work up the directories until `~`.
Update with npm install command
Update with npm install command
Markdown
mit
blackbeardapp/compose-watch
markdown
## Code Before: A docker-compose cli tool that will watch and restart the service whenever the files changes. `compose-watch backend` This will look for a docker-compose.yml in your current folder. If it can't find it there, it will begin to work up the directories until `~`. ## Instruction: Update with npm install command ## Code After: ``` npm install compose-watch -g ``` A docker-compose cli tool that will watch and restart the service whenever the files changes. ``` compose-watch backend ``` This will look for a docker-compose.yml in your current folder. If it can't find it there, it will begin to work up the directories until `~`.
+ + ``` + npm install compose-watch -g + ``` A docker-compose cli tool that will watch and restart the service whenever the files changes. + ``` - `compose-watch backend` ? - - + compose-watch backend + ``` This will look for a docker-compose.yml in your current folder. If it can't find it there, it will begin to work up the directories until `~`.
8
1
7
1
a1fef525ca71cdf464e835b3014810f2383d0a82
src/resources/views/crud/columns/check.blade.php
src/resources/views/crud/columns/check.blade.php
{{-- checkbox with loose false/null/0 checking --}} @php $checkValue = data_get($entry, $column['name']); $checkedIcon = data_get($column, 'icons.checked', 'fa-check-circle'); $uncheckedIcon = data_get($column, 'icons.unchecked', 'fa-circle'); $exportCheckedText = data_get($column, 'labels.checked', 'Yes'); $exportUncheckedText = data_get($column, 'labels.unchecked', 'No'); $icon = $checkValue == false ? $uncheckedIcon : $checkedIcon; $text = $checkValue == false ? $exportUncheckedText : $exportCheckedText; @endphp <span> <i class="fa {{ $icon }}"></i> </span> <span class="hidden">{{ $text }}</span>
{{-- checkbox with loose false/null/0 checking --}} @php $checkValue = data_get($entry, $column['name']); $checkedIcon = data_get($column, 'icons.checked', 'fa-check-circle'); $uncheckedIcon = data_get($column, 'icons.unchecked', 'fa-circle'); $exportCheckedText = data_get($column, 'labels.checked', trans('backpack::crud.yes')); $exportUncheckedText = data_get($column, 'labels.unchecked', trans('backpack::crud.no')); $icon = $checkValue == false ? $uncheckedIcon : $checkedIcon; $text = $checkValue == false ? $exportUncheckedText : $exportCheckedText; @endphp <span> <i class="fa {{ $icon }}"></i> </span> <span class="hidden">{{ $text }}</span>
Use translation file for check column
Use translation file for check column
PHP
mit
Laravel-Backpack/crud,Laravel-Backpack/crud,Laravel-Backpack/crud,Laravel-Backpack/crud
php
## Code Before: {{-- checkbox with loose false/null/0 checking --}} @php $checkValue = data_get($entry, $column['name']); $checkedIcon = data_get($column, 'icons.checked', 'fa-check-circle'); $uncheckedIcon = data_get($column, 'icons.unchecked', 'fa-circle'); $exportCheckedText = data_get($column, 'labels.checked', 'Yes'); $exportUncheckedText = data_get($column, 'labels.unchecked', 'No'); $icon = $checkValue == false ? $uncheckedIcon : $checkedIcon; $text = $checkValue == false ? $exportUncheckedText : $exportCheckedText; @endphp <span> <i class="fa {{ $icon }}"></i> </span> <span class="hidden">{{ $text }}</span> ## Instruction: Use translation file for check column ## Code After: {{-- checkbox with loose false/null/0 checking --}} @php $checkValue = data_get($entry, $column['name']); $checkedIcon = data_get($column, 'icons.checked', 'fa-check-circle'); $uncheckedIcon = data_get($column, 'icons.unchecked', 'fa-circle'); $exportCheckedText = data_get($column, 'labels.checked', trans('backpack::crud.yes')); $exportUncheckedText = data_get($column, 'labels.unchecked', trans('backpack::crud.no')); $icon = $checkValue == false ? $uncheckedIcon : $checkedIcon; $text = $checkValue == false ? $exportUncheckedText : $exportCheckedText; @endphp <span> <i class="fa {{ $icon }}"></i> </span> <span class="hidden">{{ $text }}</span>
{{-- checkbox with loose false/null/0 checking --}} @php $checkValue = data_get($entry, $column['name']); $checkedIcon = data_get($column, 'icons.checked', 'fa-check-circle'); $uncheckedIcon = data_get($column, 'icons.unchecked', 'fa-circle'); - $exportCheckedText = data_get($column, 'labels.checked', 'Yes'); ? ^ + $exportCheckedText = data_get($column, 'labels.checked', trans('backpack::crud.yes')); ? ++++++ ^^^^^^^^^^^^^^^^ + - $exportUncheckedText = data_get($column, 'labels.unchecked', 'No'); ? ^ + $exportUncheckedText = data_get($column, 'labels.unchecked', trans('backpack::crud.no')); ? ++++++ ^^^^^^^^^^^^^^^^ + $icon = $checkValue == false ? $uncheckedIcon : $checkedIcon; $text = $checkValue == false ? $exportUncheckedText : $exportCheckedText; @endphp <span> <i class="fa {{ $icon }}"></i> </span> <span class="hidden">{{ $text }}</span>
4
0.210526
2
2
5cdeec4a43697146226b5a92e88de998577e2e49
docs-src/contents/pages/start/index.hbs
docs-src/contents/pages/start/index.hbs
--- title: Quick Start area: start section: start list-order: 0 --- <div class="section-header"> <h2>Setting up Petal</h2> </div> <h4>Quick Start</h4> <p>Include the line below inside the <code>&lt;head&gt;</code> of your HTML file. Place it before any other site page stylesheets.</p> <div class="code-block"> {{#markdown}} ``` html <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/shakrmedia/petal/7841a6e8/dist/petal.min.css"> ``` {{/markdown}} </div> <p>The CDN link will provide the latest minified pre-built version of Petal with default settings.</p> <p>Now you can use all the Petal classes and styles in your project's HTML file.</p> <p>If you want to customize options and personalize Petal style for your project, you will need to build Petal manually. Head to <a href="advanced.html">Custom Building</a> for guide and recommendations on integrating Petal into your project.</p>
--- title: Quick Start area: start section: start list-order: 0 --- <div class="section-header"> <h2>Setting up Petal</h2> </div> <h4>Quick Start</h4> <p>Include the line below inside the <code>&lt;head&gt;</code> of your HTML file. Place it before any other site page stylesheets.</p> <div class="code-block"> {{#markdown}} ``` html <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/shakrmedia/petal@0.11.1/dist/petal.min.css"> ``` {{/markdown}} </div> <p>The CDN link will provide the latest minified pre-built version of Petal with default settings.</p> <p>Now you can use all the Petal classes and styles in your project's HTML file.</p> <p>If you want to customize options and personalize Petal style for your project, you will need to build Petal manually. Head to <a href="advanced.html">Custom Building</a> for guide and recommendations on integrating Petal into your project.</p>
Change rawgit link to jsdelivr
Change rawgit link to jsdelivr
Handlebars
mit
shakrmedia/petal
handlebars
## Code Before: --- title: Quick Start area: start section: start list-order: 0 --- <div class="section-header"> <h2>Setting up Petal</h2> </div> <h4>Quick Start</h4> <p>Include the line below inside the <code>&lt;head&gt;</code> of your HTML file. Place it before any other site page stylesheets.</p> <div class="code-block"> {{#markdown}} ``` html <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/shakrmedia/petal/7841a6e8/dist/petal.min.css"> ``` {{/markdown}} </div> <p>The CDN link will provide the latest minified pre-built version of Petal with default settings.</p> <p>Now you can use all the Petal classes and styles in your project's HTML file.</p> <p>If you want to customize options and personalize Petal style for your project, you will need to build Petal manually. Head to <a href="advanced.html">Custom Building</a> for guide and recommendations on integrating Petal into your project.</p> ## Instruction: Change rawgit link to jsdelivr ## Code After: --- title: Quick Start area: start section: start list-order: 0 --- <div class="section-header"> <h2>Setting up Petal</h2> </div> <h4>Quick Start</h4> <p>Include the line below inside the <code>&lt;head&gt;</code> of your HTML file. Place it before any other site page stylesheets.</p> <div class="code-block"> {{#markdown}} ``` html <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/shakrmedia/petal@0.11.1/dist/petal.min.css"> ``` {{/markdown}} </div> <p>The CDN link will provide the latest minified pre-built version of Petal with default settings.</p> <p>Now you can use all the Petal classes and styles in your project's HTML file.</p> <p>If you want to customize options and personalize Petal style for your project, you will need to build Petal manually. Head to <a href="advanced.html">Custom Building</a> for guide and recommendations on integrating Petal into your project.</p>
--- title: Quick Start area: start section: start list-order: 0 --- <div class="section-header"> <h2>Setting up Petal</h2> </div> <h4>Quick Start</h4> <p>Include the line below inside the <code>&lt;head&gt;</code> of your HTML file. Place it before any other site page stylesheets.</p> <div class="code-block"> {{#markdown}} ``` html - <link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/shakrmedia/petal/7841a6e8/dist/petal.min.css"> ? ^^ ^^^^^^ ^^^^ ^^^^ + <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/shakrmedia/petal@0.11.1/dist/petal.min.css"> ? +++++++ ^^^^^ ^ ^^^ ^^^ ``` {{/markdown}} </div> <p>The CDN link will provide the latest minified pre-built version of Petal with default settings.</p> <p>Now you can use all the Petal classes and styles in your project's HTML file.</p> <p>If you want to customize options and personalize Petal style for your project, you will need to build Petal manually. Head to <a href="advanced.html">Custom Building</a> for guide and recommendations on integrating Petal into your project.</p>
2
0.071429
1
1
8bfa222682789ef98bee6e3b2e8dead24d3fd891
runtests.sh
runtests.sh
for file in $(ls tests/bin); do if valgrind --error-exitcode=0 tests/bin/$file $TEST_ARGS; then echo "Error: $file leaking memory" fi tests/bin/$file done for file in $(ls build/bin); do if valgrind --error-exitcode=0 $file $ARGS; then echo "Error: leaking memory" fi done
make tests for file in $(ls tests/bin); do echo "Testing " $file if valgrind --error-exitcode=0 tests/bin/$file $TEST_ARGS; then echo "Error:" $file "leaking memory" 1>&2 fi tests/bin/$file done for file in $(ls build/bin); do echo "Testing " $file if valgrind --error-exitcode=0 $file $ARGS; then echo "Error: leaking memory" fi done
Fix syntax errors; Echo errors to stderr
Fix syntax errors; Echo errors to stderr
Shell
mit
iankronquist/yaz,iankronquist/yaz
shell
## Code Before: for file in $(ls tests/bin); do if valgrind --error-exitcode=0 tests/bin/$file $TEST_ARGS; then echo "Error: $file leaking memory" fi tests/bin/$file done for file in $(ls build/bin); do if valgrind --error-exitcode=0 $file $ARGS; then echo "Error: leaking memory" fi done ## Instruction: Fix syntax errors; Echo errors to stderr ## Code After: make tests for file in $(ls tests/bin); do echo "Testing " $file if valgrind --error-exitcode=0 tests/bin/$file $TEST_ARGS; then echo "Error:" $file "leaking memory" 1>&2 fi tests/bin/$file done for file in $(ls build/bin); do echo "Testing " $file if valgrind --error-exitcode=0 $file $ARGS; then echo "Error: leaking memory" fi done
+ + make tests for file in $(ls tests/bin); do + echo "Testing " $file if valgrind --error-exitcode=0 tests/bin/$file $TEST_ARGS; then - echo "Error: $file leaking memory" + echo "Error:" $file "leaking memory" 1>&2 ? + + +++++ fi tests/bin/$file done for file in $(ls build/bin); do + echo "Testing " $file if valgrind --error-exitcode=0 $file $ARGS; then echo "Error: leaking memory" fi done
6
0.461538
5
1
9aa423a9ba6e90599a720c81ce384ab1529ad6ee
CHANGES.rst
CHANGES.rst
========= Changelog ========= Version 0.3 =========== - Fix help text in ecmwf_repurpose command line program. - Fix reading of metadata for variables that do not have 'levels' Version 0.2 =========== - Add reading of basic metadata fields name, depth and units. - Fix reading of latitudes and longitudes - where flipped before. - Fix longitude range to -180, 180. - Add conversion to time series format. Version 0.1 =========== - First version - Add ERA Interim support for downloading and reading.
========= Changelog ========= Version 0.3 =========== - Fix help text in ecmwf_repurpose command line program. - Fix reading of metadata for variables that do not have 'levels' - Fix wrong import when trying to read the reformatted time series data. Version 0.2 =========== - Add reading of basic metadata fields name, depth and units. - Fix reading of latitudes and longitudes - where flipped before. - Fix longitude range to -180, 180. - Add conversion to time series format. Version 0.1 =========== - First version - Add ERA Interim support for downloading and reading.
Update changelog for version 0.3
Update changelog for version 0.3
reStructuredText
mit
TUW-GEO/ecmwf_models
restructuredtext
## Code Before: ========= Changelog ========= Version 0.3 =========== - Fix help text in ecmwf_repurpose command line program. - Fix reading of metadata for variables that do not have 'levels' Version 0.2 =========== - Add reading of basic metadata fields name, depth and units. - Fix reading of latitudes and longitudes - where flipped before. - Fix longitude range to -180, 180. - Add conversion to time series format. Version 0.1 =========== - First version - Add ERA Interim support for downloading and reading. ## Instruction: Update changelog for version 0.3 ## Code After: ========= Changelog ========= Version 0.3 =========== - Fix help text in ecmwf_repurpose command line program. - Fix reading of metadata for variables that do not have 'levels' - Fix wrong import when trying to read the reformatted time series data. Version 0.2 =========== - Add reading of basic metadata fields name, depth and units. - Fix reading of latitudes and longitudes - where flipped before. - Fix longitude range to -180, 180. - Add conversion to time series format. Version 0.1 =========== - First version - Add ERA Interim support for downloading and reading.
========= Changelog ========= Version 0.3 =========== - Fix help text in ecmwf_repurpose command line program. - Fix reading of metadata for variables that do not have 'levels' + - Fix wrong import when trying to read the reformatted time series data. Version 0.2 =========== - Add reading of basic metadata fields name, depth and units. - Fix reading of latitudes and longitudes - where flipped before. - Fix longitude range to -180, 180. - Add conversion to time series format. Version 0.1 =========== - First version - Add ERA Interim support for downloading and reading.
1
0.041667
1
0
23c5f39e8e408317362ebe33e9be6c180242b8b8
app/src/lib/fatal-error.ts
app/src/lib/fatal-error.ts
/** Throw an error. */ export default function fatalError(msg: string): never { throw new Error(msg) }
/** Throw an error. */ export default function fatalError(msg: string): never { throw new Error(msg) } /** * Utility function used to achieve exhaustive type checks at compile time. * * If the type system is bypassed or this method will throw an exception * using the second parameter as the message. * * @param {x} Placeholder parameter in order to leverage the type * system. Pass the variable which has been type narrowed * in an exhaustive check. * * @param {message} The message to be used in the runtime exception. * */ export function assertNever(x: never, message: string): never { throw new Error(message) }
Add type helper for exhaustive checks
Add type helper for exhaustive checks
TypeScript
mit
shiftkey/desktop,kactus-io/kactus,BugTesterTest/desktops,say25/desktop,kactus-io/kactus,hjobrien/desktop,shiftkey/desktop,BugTesterTest/desktops,hjobrien/desktop,gengjiawen/desktop,artivilla/desktop,BugTesterTest/desktops,kactus-io/kactus,BugTesterTest/desktops,artivilla/desktop,desktop/desktop,artivilla/desktop,gengjiawen/desktop,desktop/desktop,j-f1/forked-desktop,gengjiawen/desktop,shiftkey/desktop,shiftkey/desktop,hjobrien/desktop,hjobrien/desktop,desktop/desktop,kactus-io/kactus,say25/desktop,j-f1/forked-desktop,say25/desktop,j-f1/forked-desktop,say25/desktop,gengjiawen/desktop,artivilla/desktop,j-f1/forked-desktop,desktop/desktop
typescript
## Code Before: /** Throw an error. */ export default function fatalError(msg: string): never { throw new Error(msg) } ## Instruction: Add type helper for exhaustive checks ## Code After: /** Throw an error. */ export default function fatalError(msg: string): never { throw new Error(msg) } /** * Utility function used to achieve exhaustive type checks at compile time. * * If the type system is bypassed or this method will throw an exception * using the second parameter as the message. * * @param {x} Placeholder parameter in order to leverage the type * system. Pass the variable which has been type narrowed * in an exhaustive check. * * @param {message} The message to be used in the runtime exception. * */ export function assertNever(x: never, message: string): never { throw new Error(message) }
/** Throw an error. */ export default function fatalError(msg: string): never { throw new Error(msg) } + + /** + * Utility function used to achieve exhaustive type checks at compile time. + * + * If the type system is bypassed or this method will throw an exception + * using the second parameter as the message. + * + * @param {x} Placeholder parameter in order to leverage the type + * system. Pass the variable which has been type narrowed + * in an exhaustive check. + * + * @param {message} The message to be used in the runtime exception. + * + */ + export function assertNever(x: never, message: string): never { + throw new Error(message) + }
17
4.25
17
0
ea68619f0b1171414df381facdada5eb4a906547
script/mirror_db.sh
script/mirror_db.sh
set -e if hash zeus 2>/dev/null && [ -e .zeus.sock ]; then RAILS_RUN='zeus r' else RAILS_RUN='rails runner' fi # -- Mirror database echo "Mirroring database..." echo "drop database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test echo "create database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test ssh $1 "pg_dump -h localhost -U openfoodweb openfoodweb_production |gzip" |gunzip |psql -h localhost -U ofn open_food_network_dev # -- Disable S3 echo "Preparing mirrored database..." $RAILS_RUN script/prepare_imported_db.rb # -- Mirror images if hash aws 2>/dev/null; then echo "Mirroring images..." BUCKET=`echo $1 | sed s/-/_/ | sed "s/\\([0-9]\\)/_\1/" | sed s/prod/production/` aws s3 sync s3://$BUCKET/public public/ else echo "Please install the AWS CLI tools so that I can copy the images from $1 for you." echo "eg. sudo easy_install awscli" fi
set -e if hash zeus 2>/dev/null && [ -e .zeus.sock ]; then RAILS_RUN='zeus r' else RAILS_RUN='bundle exec rails runner' fi # -- Mirror database echo "Mirroring database..." echo "drop database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test echo "create database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test ssh $1 "pg_dump -h localhost -U openfoodweb openfoodweb_production |gzip" |gunzip |psql -h localhost -U ofn open_food_network_dev # -- Disable S3 echo "Preparing mirrored database..." $RAILS_RUN script/prepare_imported_db.rb # -- Mirror images if hash aws 2>/dev/null; then echo "Mirroring images..." BUCKET=`echo $1 | sed s/-/_/ | sed "s/\\([0-9]\\)/_\1/" | sed s/prod/production/` aws s3 sync s3://$BUCKET/public public/ else echo "Please install the AWS CLI tools so that I can copy the images from $1 for you." echo "eg. sudo easy_install awscli" fi
Use bundled rails to prepare imported database
Use bundled rails to prepare imported database
Shell
agpl-3.0
oeoeaio/openfoodnetwork,Em-AK/openfoodnetwork,mkllnk/openfoodnetwork,oeoeaio/openfoodnetwork,ltrls/openfoodnetwork,Matt-Yorkley/openfoodnetwork,RohanM/openfoodnetwork,mkllnk/openfoodnetwork,oeoeaio/openfoodnetwork,ltrls/openfoodnetwork,MikeiLL/openfoodnetwork,KateDavis/openfoodnetwork,RohanM/openfoodnetwork,levent/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,levent/openfoodnetwork,lin-d-hop/openfoodnetwork,ltrls/openfoodnetwork,openfoodfoundation/openfoodnetwork,KateDavis/openfoodnetwork,Em-AK/openfoodnetwork,RohanM/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,MikeiLL/openfoodnetwork,MikeiLL/openfoodnetwork,KateDavis/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,Matt-Yorkley/openfoodnetwork,Matt-Yorkley/openfoodnetwork,RohanM/openfoodnetwork,levent/openfoodnetwork,ltrls/openfoodnetwork,KateDavis/openfoodnetwork,Em-AK/openfoodnetwork,Em-AK/openfoodnetwork,oeoeaio/openfoodnetwork,mkllnk/openfoodnetwork,levent/openfoodnetwork,MikeiLL/openfoodnetwork,lin-d-hop/openfoodnetwork
shell
## Code Before: set -e if hash zeus 2>/dev/null && [ -e .zeus.sock ]; then RAILS_RUN='zeus r' else RAILS_RUN='rails runner' fi # -- Mirror database echo "Mirroring database..." echo "drop database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test echo "create database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test ssh $1 "pg_dump -h localhost -U openfoodweb openfoodweb_production |gzip" |gunzip |psql -h localhost -U ofn open_food_network_dev # -- Disable S3 echo "Preparing mirrored database..." $RAILS_RUN script/prepare_imported_db.rb # -- Mirror images if hash aws 2>/dev/null; then echo "Mirroring images..." BUCKET=`echo $1 | sed s/-/_/ | sed "s/\\([0-9]\\)/_\1/" | sed s/prod/production/` aws s3 sync s3://$BUCKET/public public/ else echo "Please install the AWS CLI tools so that I can copy the images from $1 for you." echo "eg. sudo easy_install awscli" fi ## Instruction: Use bundled rails to prepare imported database ## Code After: set -e if hash zeus 2>/dev/null && [ -e .zeus.sock ]; then RAILS_RUN='zeus r' else RAILS_RUN='bundle exec rails runner' fi # -- Mirror database echo "Mirroring database..." echo "drop database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test echo "create database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test ssh $1 "pg_dump -h localhost -U openfoodweb openfoodweb_production |gzip" |gunzip |psql -h localhost -U ofn open_food_network_dev # -- Disable S3 echo "Preparing mirrored database..." $RAILS_RUN script/prepare_imported_db.rb # -- Mirror images if hash aws 2>/dev/null; then echo "Mirroring images..." BUCKET=`echo $1 | sed s/-/_/ | sed "s/\\([0-9]\\)/_\1/" | sed s/prod/production/` aws s3 sync s3://$BUCKET/public public/ else echo "Please install the AWS CLI tools so that I can copy the images from $1 for you." echo "eg. sudo easy_install awscli" fi
set -e if hash zeus 2>/dev/null && [ -e .zeus.sock ]; then RAILS_RUN='zeus r' else - RAILS_RUN='rails runner' + RAILS_RUN='bundle exec rails runner' ? ++++++++++++ fi # -- Mirror database echo "Mirroring database..." echo "drop database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test echo "create database open_food_network_dev" | psql -h localhost -U ofn open_food_network_test ssh $1 "pg_dump -h localhost -U openfoodweb openfoodweb_production |gzip" |gunzip |psql -h localhost -U ofn open_food_network_dev # -- Disable S3 echo "Preparing mirrored database..." $RAILS_RUN script/prepare_imported_db.rb # -- Mirror images if hash aws 2>/dev/null; then echo "Mirroring images..." BUCKET=`echo $1 | sed s/-/_/ | sed "s/\\([0-9]\\)/_\1/" | sed s/prod/production/` aws s3 sync s3://$BUCKET/public public/ else echo "Please install the AWS CLI tools so that I can copy the images from $1 for you." echo "eg. sudo easy_install awscli" fi
2
0.0625
1
1
bd2669a1e50b0546874eceb07816d6a638dc8321
src/PhpToZephir/CodeCollector/DirectoryCodeCollector.php
src/PhpToZephir/CodeCollector/DirectoryCodeCollector.php
<?php namespace PhpToZephir\CodeCollector; class DirectoryCodeCollector implements CodeCollectorInterface { /** * @var array */ private $directories; /** * @param array $code */ public function __construct(array $directories) { $this->directories = $directories; } /** * @param string $dir * @return \RegexIterator */ private function findFiles($dir) { $directory = new \RecursiveDirectoryIterator($dir); $iterator = new \RecursiveIteratorIterator($directory); $regex = new \RegexIterator($iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); return $regex; } /** * @return array */ public function getCode() { $files = array(); foreach ($this->directories as $directory) { foreach ($this->findFiles($directory) as $file) { $files[$file] = file_get_contents($file); } } return $files; } }
<?php namespace PhpToZephir\CodeCollector; class DirectoryCodeCollector implements CodeCollectorInterface { /** * @var array */ private $directories; /** * @param array $code */ public function __construct(array $directories) { $this->directories = $directories; } /** * @param string $dir * @return \RegexIterator */ private function findFiles($dir) { $directory = new \RecursiveDirectoryIterator($dir); $iterator = new \RecursiveIteratorIterator($directory); $regex = new \RegexIterator($iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); return $regex; } /** * @return array */ public function getCode() { $files = array(); foreach ($this->directories as $directory) { foreach ($this->findFiles($directory) as $file) { if (is_array($file)) { $file = reset($file); } $files[$file] = file_get_contents($file); } } return $files; } }
Fix error on PHP >= 5.5
Fix error on PHP >= 5.5
PHP
mit
fezfez/php-to-zephir
php
## Code Before: <?php namespace PhpToZephir\CodeCollector; class DirectoryCodeCollector implements CodeCollectorInterface { /** * @var array */ private $directories; /** * @param array $code */ public function __construct(array $directories) { $this->directories = $directories; } /** * @param string $dir * @return \RegexIterator */ private function findFiles($dir) { $directory = new \RecursiveDirectoryIterator($dir); $iterator = new \RecursiveIteratorIterator($directory); $regex = new \RegexIterator($iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); return $regex; } /** * @return array */ public function getCode() { $files = array(); foreach ($this->directories as $directory) { foreach ($this->findFiles($directory) as $file) { $files[$file] = file_get_contents($file); } } return $files; } } ## Instruction: Fix error on PHP >= 5.5 ## Code After: <?php namespace PhpToZephir\CodeCollector; class DirectoryCodeCollector implements CodeCollectorInterface { /** * @var array */ private $directories; /** * @param array $code */ public function __construct(array $directories) { $this->directories = $directories; } /** * @param string $dir * @return \RegexIterator */ private function findFiles($dir) { $directory = new \RecursiveDirectoryIterator($dir); $iterator = new \RecursiveIteratorIterator($directory); $regex = new \RegexIterator($iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); return $regex; } /** * @return array */ public function getCode() { $files = array(); foreach ($this->directories as $directory) { foreach ($this->findFiles($directory) as $file) { if (is_array($file)) { $file = reset($file); } $files[$file] = file_get_contents($file); } } return $files; } }
<?php namespace PhpToZephir\CodeCollector; class DirectoryCodeCollector implements CodeCollectorInterface { /** * @var array */ private $directories; /** * @param array $code */ public function __construct(array $directories) { $this->directories = $directories; } /** * @param string $dir * @return \RegexIterator */ private function findFiles($dir) { $directory = new \RecursiveDirectoryIterator($dir); $iterator = new \RecursiveIteratorIterator($directory); $regex = new \RegexIterator($iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); return $regex; } /** * @return array */ public function getCode() { $files = array(); foreach ($this->directories as $directory) { foreach ($this->findFiles($directory) as $file) { + if (is_array($file)) { + $file = reset($file); + } + $files[$file] = file_get_contents($file); } } return $files; } }
4
0.081633
4
0
863828c37eca9046a7dd169114e2a6c3e02e28aa
proxy-firewall.py
proxy-firewall.py
import os, sys, urllib, urlparse from conary.conarycfg import ConaryConfiguration def main(args): cfg = ConaryConfiguration(False) cfg.read('/etc/conaryrc', exception=False) for schema, uri in cfg.proxy.items(): hostpart = urlparse.urlsplit(uri)[1] host, port = urllib.splitport(hostpart) if not port: if schema == 'https': port = '443' else: port = '80' os.system('/sbin/iptables -A FORWARD-SLAVE -m state --state NEW ' '-m tcp -p tcp --dport %s -d %s -j ACCEPT 2>/dev/null' % (port, host)) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
import os, sys, urllib, urlparse from conary.conarycfg import ConaryConfiguration def main(args): cfg = ConaryConfiguration(False) cfg.read('/etc/conaryrc', exception=False) import epdb;epdb.st() for schema, uri in cfg.proxy.items(): userhostport = urlparse.urlsplit(uri)[1] hostport = urllib.splituser(userhostport)[1] host, port = urllib.splitport(hostport) if not port: if schema == 'https': port = '443' else: port = '80' os.system('/sbin/iptables -A FORWARD-SLAVE -m state --state NEW ' '-m tcp -p tcp --dport %s -d %s -j ACCEPT 2>/dev/null' % (port, host)) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
Fix proxy URIs with credentials in them
Fix proxy URIs with credentials in them
Python
apache-2.0
sassoftware/jobmaster,sassoftware/jobmaster,sassoftware/jobmaster
python
## Code Before: import os, sys, urllib, urlparse from conary.conarycfg import ConaryConfiguration def main(args): cfg = ConaryConfiguration(False) cfg.read('/etc/conaryrc', exception=False) for schema, uri in cfg.proxy.items(): hostpart = urlparse.urlsplit(uri)[1] host, port = urllib.splitport(hostpart) if not port: if schema == 'https': port = '443' else: port = '80' os.system('/sbin/iptables -A FORWARD-SLAVE -m state --state NEW ' '-m tcp -p tcp --dport %s -d %s -j ACCEPT 2>/dev/null' % (port, host)) if __name__ == '__main__': sys.exit(main(sys.argv[1:])) ## Instruction: Fix proxy URIs with credentials in them ## Code After: import os, sys, urllib, urlparse from conary.conarycfg import ConaryConfiguration def main(args): cfg = ConaryConfiguration(False) cfg.read('/etc/conaryrc', exception=False) import epdb;epdb.st() for schema, uri in cfg.proxy.items(): userhostport = urlparse.urlsplit(uri)[1] hostport = urllib.splituser(userhostport)[1] host, port = urllib.splitport(hostport) if not port: if schema == 'https': port = '443' else: port = '80' os.system('/sbin/iptables -A FORWARD-SLAVE -m state --state NEW ' '-m tcp -p tcp --dport %s -d %s -j ACCEPT 2>/dev/null' % (port, host)) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
import os, sys, urllib, urlparse from conary.conarycfg import ConaryConfiguration def main(args): cfg = ConaryConfiguration(False) cfg.read('/etc/conaryrc', exception=False) + import epdb;epdb.st() for schema, uri in cfg.proxy.items(): - hostpart = urlparse.urlsplit(uri)[1] ? ^ + userhostport = urlparse.urlsplit(uri)[1] ? ++++ ^ + hostport = urllib.splituser(userhostport)[1] - host, port = urllib.splitport(hostpart) ? ^ + host, port = urllib.splitport(hostport) ? ^ if not port: if schema == 'https': port = '443' else: port = '80' os.system('/sbin/iptables -A FORWARD-SLAVE -m state --state NEW ' '-m tcp -p tcp --dport %s -d %s -j ACCEPT 2>/dev/null' % (port, host)) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
6
0.272727
4
2
7f64c698bc03714e9c1dc155f6c76fb3c88a92ef
billboard_client.gemspec
billboard_client.gemspec
Gem::Specification.new do |s| s.name = 'billboard_client' s.version = '0.0.0' s.date = '2014-05-17' s.platform = Gem::Platform::RUBY s.summary = 'Billboard client and CLI' s.description = 'A client and CLI for the billboard app: https://github.com/mick/billboard/' s.author = 'Dave Guarino' s.email = 'dave@codeforamerica.org' s.files = ['lib/billboard_client.rb'] s.homepage = 'https://github.com/daguar/billboard-client' s.license = 'MIT' s.executables << 'billboard' s.required_ruby_version = '>= 1.9.3' s.add_runtime_dependency 'httparty' end
Gem::Specification.new do |s| s.name = 'billboard_client' s.version = '0.0.0' s.date = '2014-05-18' s.platform = Gem::Platform::RUBY s.summary = 'Billboard client and CLI' s.description = 'A client and CLI for the billboard app: https://github.com/mick/billboard/' s.author = 'Dave Guarino' s.email = 'dave@codeforamerica.org' s.files = ['lib/billboard_client.rb'] s.homepage = 'https://github.com/daguar/billboard-client' s.license = 'MIT' s.executables << 'billboard' s.required_ruby_version = '>= 1.9.3' s.add_runtime_dependency 'httparty' s.add_runtime_dependency 'thor' end
Add thor as gemspec dependency
Add thor as gemspec dependency
Ruby
mit
daguar/billboard-client
ruby
## Code Before: Gem::Specification.new do |s| s.name = 'billboard_client' s.version = '0.0.0' s.date = '2014-05-17' s.platform = Gem::Platform::RUBY s.summary = 'Billboard client and CLI' s.description = 'A client and CLI for the billboard app: https://github.com/mick/billboard/' s.author = 'Dave Guarino' s.email = 'dave@codeforamerica.org' s.files = ['lib/billboard_client.rb'] s.homepage = 'https://github.com/daguar/billboard-client' s.license = 'MIT' s.executables << 'billboard' s.required_ruby_version = '>= 1.9.3' s.add_runtime_dependency 'httparty' end ## Instruction: Add thor as gemspec dependency ## Code After: Gem::Specification.new do |s| s.name = 'billboard_client' s.version = '0.0.0' s.date = '2014-05-18' s.platform = Gem::Platform::RUBY s.summary = 'Billboard client and CLI' s.description = 'A client and CLI for the billboard app: https://github.com/mick/billboard/' s.author = 'Dave Guarino' s.email = 'dave@codeforamerica.org' s.files = ['lib/billboard_client.rb'] s.homepage = 'https://github.com/daguar/billboard-client' s.license = 'MIT' s.executables << 'billboard' s.required_ruby_version = '>= 1.9.3' s.add_runtime_dependency 'httparty' s.add_runtime_dependency 'thor' end
Gem::Specification.new do |s| s.name = 'billboard_client' s.version = '0.0.0' - s.date = '2014-05-17' ? ^ + s.date = '2014-05-18' ? ^ s.platform = Gem::Platform::RUBY s.summary = 'Billboard client and CLI' s.description = 'A client and CLI for the billboard app: https://github.com/mick/billboard/' s.author = 'Dave Guarino' s.email = 'dave@codeforamerica.org' s.files = ['lib/billboard_client.rb'] s.homepage = 'https://github.com/daguar/billboard-client' s.license = 'MIT' s.executables << 'billboard' s.required_ruby_version = '>= 1.9.3' s.add_runtime_dependency 'httparty' + s.add_runtime_dependency 'thor' end
3
0.176471
2
1
0f9942824d809cbc6a0957566291b4c03df39fed
app/models/text_element.rb
app/models/text_element.rb
class TextElement < ActiveRecord::Base acts_as_textiled :value validates_presence_of :var #get with the variable as the called method def self.method_missing(method, *args) method_name = method.to_s uri = args[0].to_s super(method, *args) rescue NoMethodError #retrieve a value te = object(method_name, uri) "<div class=\"ugc\">#{te.value || dummy_text(method_name)}</div>" end #retrieve the actual Setting record def self.object(var_name, uri) TextElement.find_or_create_by_var(:var => var_name.to_s, :uri => uri) end def self.dummy_text(method_name) "<p>You can edit this text in the CMS under text elements, it is called '#{method_name.titleize}'</p>" end end
class TextElement < ActiveRecord::Base acts_as_textiled :value validates_presence_of :var #get with the variable as the called method def self.method_missing(method, *args) method_name = method.to_s uri = args[0].to_s super(method, *args) rescue NoMethodError #retrieve a value te = object(method_name, uri) "<div class=\"ugc\">#{te.value || dummy_text}</div>" end #retrieve the actual Setting record def self.object(var_name, uri) TextElement.find_or_create_by_var(:var => var_name.to_s, :uri => uri) end def self.dummy_text(method_name) "<p>You can edit this text in the CMS under text elements, it is called '#{method_name.titleize}'</p>" end end
Revert "update to include links to the pages that they sit on and a more explanatory piece of dummy text"
Revert "update to include links to the pages that they sit on and a more explanatory piece of dummy text" This reverts commit af3e6e627d213f492bb105258563b4c86633875a.
Ruby
mit
beef/Text-Elements
ruby
## Code Before: class TextElement < ActiveRecord::Base acts_as_textiled :value validates_presence_of :var #get with the variable as the called method def self.method_missing(method, *args) method_name = method.to_s uri = args[0].to_s super(method, *args) rescue NoMethodError #retrieve a value te = object(method_name, uri) "<div class=\"ugc\">#{te.value || dummy_text(method_name)}</div>" end #retrieve the actual Setting record def self.object(var_name, uri) TextElement.find_or_create_by_var(:var => var_name.to_s, :uri => uri) end def self.dummy_text(method_name) "<p>You can edit this text in the CMS under text elements, it is called '#{method_name.titleize}'</p>" end end ## Instruction: Revert "update to include links to the pages that they sit on and a more explanatory piece of dummy text" This reverts commit af3e6e627d213f492bb105258563b4c86633875a. ## Code After: class TextElement < ActiveRecord::Base acts_as_textiled :value validates_presence_of :var #get with the variable as the called method def self.method_missing(method, *args) method_name = method.to_s uri = args[0].to_s super(method, *args) rescue NoMethodError #retrieve a value te = object(method_name, uri) "<div class=\"ugc\">#{te.value || dummy_text}</div>" end #retrieve the actual Setting record def self.object(var_name, uri) TextElement.find_or_create_by_var(:var => var_name.to_s, :uri => uri) end def self.dummy_text(method_name) "<p>You can edit this text in the CMS under text elements, it is called '#{method_name.titleize}'</p>" end end
class TextElement < ActiveRecord::Base acts_as_textiled :value validates_presence_of :var #get with the variable as the called method def self.method_missing(method, *args) method_name = method.to_s uri = args[0].to_s super(method, *args) rescue NoMethodError #retrieve a value te = object(method_name, uri) - "<div class=\"ugc\">#{te.value || dummy_text(method_name)}</div>" ? ------------- + "<div class=\"ugc\">#{te.value || dummy_text}</div>" end #retrieve the actual Setting record def self.object(var_name, uri) TextElement.find_or_create_by_var(:var => var_name.to_s, :uri => uri) end def self.dummy_text(method_name) "<p>You can edit this text in the CMS under text elements, it is called '#{method_name.titleize}'</p>" end end
2
0.076923
1
1
073f4ddaff5efdd13f291280a8b46ce1d5e7b0c5
src/DailySoccerSolution/DailySoccerMobile/package.json
src/DailySoccerSolution/DailySoccerMobile/package.json
{ "name": "dailysoccermobile", "version": "1.1.1", "description": "DailySoccerMobile: An Ionic project", "dependencies": { "gulp": "^3.5.6", "gulp-sass": "^2.0.4", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0" }, "devDependencies": { "bower": "^1.3.3", "gulp-util": "^2.2.14", "shelljs": "^0.3.0" }, "cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard" ], "cordovaPlatforms": [ "android" ] }
{ "name": "dailysoccermobile", "version": "1.1.1", "description": "DailySoccerMobile: An Ionic project", "dependencies": { "gulp": "^3.5.6", "gulp-sass": "^2.0.4", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0" }, "devDependencies": { "bower": "^1.3.3", "gulp-util": "^2.2.14", "shelljs": "^0.3.0" }, "cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard" ], "cordovaPlatforms": [] }
Remove platforms from DailySoccerMobile, make it blank.
Remove platforms from DailySoccerMobile, make it blank. Signed-off-by: Teerachai Laothong <a99983811b0545058c43897cab2c997528200432@perfenterprise.com>
JSON
mit
tlaothong/xdailysoccer,tlaothong/xdailysoccer,tlaothong/xdailysoccer,tlaothong/xdailysoccer
json
## Code Before: { "name": "dailysoccermobile", "version": "1.1.1", "description": "DailySoccerMobile: An Ionic project", "dependencies": { "gulp": "^3.5.6", "gulp-sass": "^2.0.4", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0" }, "devDependencies": { "bower": "^1.3.3", "gulp-util": "^2.2.14", "shelljs": "^0.3.0" }, "cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard" ], "cordovaPlatforms": [ "android" ] } ## Instruction: Remove platforms from DailySoccerMobile, make it blank. Signed-off-by: Teerachai Laothong <a99983811b0545058c43897cab2c997528200432@perfenterprise.com> ## Code After: { "name": "dailysoccermobile", "version": "1.1.1", "description": "DailySoccerMobile: An Ionic project", "dependencies": { "gulp": "^3.5.6", "gulp-sass": "^2.0.4", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0" }, "devDependencies": { "bower": "^1.3.3", "gulp-util": "^2.2.14", "shelljs": "^0.3.0" }, "cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard" ], "cordovaPlatforms": [] }
{ "name": "dailysoccermobile", "version": "1.1.1", "description": "DailySoccerMobile: An Ionic project", "dependencies": { "gulp": "^3.5.6", "gulp-sass": "^2.0.4", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0" }, "devDependencies": { "bower": "^1.3.3", "gulp-util": "^2.2.14", "shelljs": "^0.3.0" }, "cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "ionic-plugin-keyboard" ], - "cordovaPlatforms": [ + "cordovaPlatforms": [] ? + - "android" - ] }
4
0.142857
1
3
67a85b80d22584718b512da3cdf27c99fa611a3a
tests/generics/bug640330.vala
tests/generics/bug640330.vala
[GenericAccessors] interface Foo<G> : Object { public virtual G get_foo (G g) { return g; } } class Bar<G> : Object, Foo<G> { } void main () { var bar = new Bar<string> (); assert ("foo" == bar.get_foo ("foo")); }
[GenericAccessors] interface Foo<G> : Object { public virtual G get_foo (G g) { assert (typeof (G) == typeof (string)); G g_copy = g; assert (GLib.strcmp ((string) g_copy, "foo") == 0); assert (&g_copy != &g); return g; } } class Bar<G> : Object, Foo<G> { } void main () { var bar = new Bar<string> (); assert ("foo" == bar.get_foo ("foo")); }
Extend "GenericAccessors" test to increase coverage
tests: Extend "GenericAccessors" test to increase coverage
Vala
lgpl-2.1
GNOME/vala,frida/vala,GNOME/vala,frida/vala,GNOME/vala,frida/vala,GNOME/vala,frida/vala,frida/vala
vala
## Code Before: [GenericAccessors] interface Foo<G> : Object { public virtual G get_foo (G g) { return g; } } class Bar<G> : Object, Foo<G> { } void main () { var bar = new Bar<string> (); assert ("foo" == bar.get_foo ("foo")); } ## Instruction: tests: Extend "GenericAccessors" test to increase coverage ## Code After: [GenericAccessors] interface Foo<G> : Object { public virtual G get_foo (G g) { assert (typeof (G) == typeof (string)); G g_copy = g; assert (GLib.strcmp ((string) g_copy, "foo") == 0); assert (&g_copy != &g); return g; } } class Bar<G> : Object, Foo<G> { } void main () { var bar = new Bar<string> (); assert ("foo" == bar.get_foo ("foo")); }
[GenericAccessors] interface Foo<G> : Object { public virtual G get_foo (G g) { + assert (typeof (G) == typeof (string)); + G g_copy = g; + assert (GLib.strcmp ((string) g_copy, "foo") == 0); + assert (&g_copy != &g); return g; } } class Bar<G> : Object, Foo<G> { } void main () { var bar = new Bar<string> (); assert ("foo" == bar.get_foo ("foo")); }
4
0.285714
4
0
32e66bf1c0e6828ba088808dfb7837b5abf4e872
templates/pages/search.twig
templates/pages/search.twig
{% extends "base.twig" %} {% block content %} {% include 'blocks/page-header.twig' %} {% if posts.post_count == 0 %} {{ __('Sorry, no results were found.', 'sage') }} {{ function('get_search_form') }} {% endif %} {% for post in posts %} {% include "templates/blocks/content.twig" with {post: post} %} {% endfor %} {{ function('the_posts_navigation') }} {% endblock %}
{% extends "base.twig" %} {% block content %} {% include 'blocks/page-header.twig' %} {% if posts == [] %} {{ __('Sorry, no results were found.', 'sage') }} {{ function('get_search_form') }} {% endif %} {% for post in posts %} {% include "templates/blocks/content.twig" with {post: post} %} {% endfor %} {{ function('the_posts_navigation') }} {% endblock %}
Fix check for empty posts array
Fix check for empty posts array The conditional for posts.post_count == 0 didn't work; I could see the "Sorry, no results" text on every search page, even one with results. It looks like simply checking against an empty array works as expected.
Twig
mit
artifex404/sage-timber,artifex404/sage-timber,artifex404/sage-timber
twig
## Code Before: {% extends "base.twig" %} {% block content %} {% include 'blocks/page-header.twig' %} {% if posts.post_count == 0 %} {{ __('Sorry, no results were found.', 'sage') }} {{ function('get_search_form') }} {% endif %} {% for post in posts %} {% include "templates/blocks/content.twig" with {post: post} %} {% endfor %} {{ function('the_posts_navigation') }} {% endblock %} ## Instruction: Fix check for empty posts array The conditional for posts.post_count == 0 didn't work; I could see the "Sorry, no results" text on every search page, even one with results. It looks like simply checking against an empty array works as expected. ## Code After: {% extends "base.twig" %} {% block content %} {% include 'blocks/page-header.twig' %} {% if posts == [] %} {{ __('Sorry, no results were found.', 'sage') }} {{ function('get_search_form') }} {% endif %} {% for post in posts %} {% include "templates/blocks/content.twig" with {post: post} %} {% endfor %} {{ function('the_posts_navigation') }} {% endblock %}
{% extends "base.twig" %} {% block content %} {% include 'blocks/page-header.twig' %} - {% if posts.post_count == 0 %} ? ----------- ^ + {% if posts == [] %} ? ^^ {{ __('Sorry, no results were found.', 'sage') }} {{ function('get_search_form') }} {% endif %} {% for post in posts %} {% include "templates/blocks/content.twig" with {post: post} %} {% endfor %} {{ function('the_posts_navigation') }} {% endblock %}
2
0.111111
1
1
09931d5acd0c161e7a91740aadb29642f8685330
database_cleaner_seeded.gemspec
database_cleaner_seeded.gemspec
require 'rake' Gem::Specification.new do |s| s.name = 'database_cleaner_seeded' s.version = '0.1.3' s.date = '2016-08-09' s.summary = 'Seed database directly between feature tests' s.description = 'Provide a strategy for injecting database seeds between feature tests, using the DBMS directly.' s.authors = ['Michael Dawson'] s.email = 'email.michaeldawson@gmail.com' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.homepage = 'http://rubygems.org/gems/database_cleaner_seeded' s.license = 'MIT' s.add_dependency('database_cleaner', '>= 1.2.0') s.add_dependency('activerecord', '> 3.0') s.add_dependency('rspec') end
require 'rake' Gem::Specification.new do |s| s.name = 'database_cleaner_seeded' s.version = '0.1.4' s.date = '2016-08-09' s.summary = 'Seed database directly between feature tests' s.description = 'Provide a strategy for injecting database seeds between feature tests, using the DBMS directly.' s.authors = ['Michael Dawson'] s.email = 'email.michaeldawson@gmail.com' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.homepage = 'https://github.com/michaeldawson/database_cleaner_seeded' s.license = 'MIT' s.add_dependency('database_cleaner', '>= 1.2.0') s.add_dependency('activerecord', '> 3.0') s.add_dependency('rspec') end
Set homepage to github in gemspec
Set homepage to github in gemspec
Ruby
mit
michaeldawson/database_cleaner_seeded
ruby
## Code Before: require 'rake' Gem::Specification.new do |s| s.name = 'database_cleaner_seeded' s.version = '0.1.3' s.date = '2016-08-09' s.summary = 'Seed database directly between feature tests' s.description = 'Provide a strategy for injecting database seeds between feature tests, using the DBMS directly.' s.authors = ['Michael Dawson'] s.email = 'email.michaeldawson@gmail.com' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.homepage = 'http://rubygems.org/gems/database_cleaner_seeded' s.license = 'MIT' s.add_dependency('database_cleaner', '>= 1.2.0') s.add_dependency('activerecord', '> 3.0') s.add_dependency('rspec') end ## Instruction: Set homepage to github in gemspec ## Code After: require 'rake' Gem::Specification.new do |s| s.name = 'database_cleaner_seeded' s.version = '0.1.4' s.date = '2016-08-09' s.summary = 'Seed database directly between feature tests' s.description = 'Provide a strategy for injecting database seeds between feature tests, using the DBMS directly.' s.authors = ['Michael Dawson'] s.email = 'email.michaeldawson@gmail.com' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.homepage = 'https://github.com/michaeldawson/database_cleaner_seeded' s.license = 'MIT' s.add_dependency('database_cleaner', '>= 1.2.0') s.add_dependency('activerecord', '> 3.0') s.add_dependency('rspec') end
require 'rake' Gem::Specification.new do |s| s.name = 'database_cleaner_seeded' - s.version = '0.1.3' ? ^ + s.version = '0.1.4' ? ^ s.date = '2016-08-09' s.summary = 'Seed database directly between feature tests' s.description = 'Provide a strategy for injecting database seeds between feature tests, using the DBMS directly.' s.authors = ['Michael Dawson'] s.email = 'email.michaeldawson@gmail.com' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - s.homepage = 'http://rubygems.org/gems/database_cleaner_seeded' ? ^ ^^ ^ - ^^^^^^^ + s.homepage = 'https://github.com/michaeldawson/database_cleaner_seeded' ? + ^^^^ ^^^^^^^^^^ ^^^^ ^ s.license = 'MIT' s.add_dependency('database_cleaner', '>= 1.2.0') s.add_dependency('activerecord', '> 3.0') s.add_dependency('rspec') end
4
0.210526
2
2
639b26b3977374426bc314af175426093727e879
packages/entity-detail/src/dev/textResources.json
packages/entity-detail/src/dev/textResources.json
[ "client.entity-detail.invalidFieldsError", "client.entity-detail.invalidRelationErrors", "client.entity-detail.lastSave", "client.entity-detail.loadingText", "client.entity-detail.mandatoryFieldTitle", "client.entity-detail.save", "client.entity-detail.saveError", "client.entity-detail.saveAbortedTitle", "client.entity-detail.saveAbortedMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.saveSuccessfulMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.syncValidationRequired", "client.entity-detail.syncValidationMinLength", "client.entity-detail.syncValidationMaxLength", "client.entity-detail.validationError", "client.component.remoteselect.noResultsText", "client.component.remoteselect.clearAllText", "client.component.remoteselect.clearValueText", "client.component.remoteselect.searchPromptText", "client.component.remoteselect.moreOptionsAvailableText" ]
[ "client.entity-detail.invalidFieldsError", "client.entity-detail.invalidRelationErrors", "client.entity-detail.lastSave", "client.entity-detail.loadingText", "client.entity-detail.mandatoryFieldTitle", "client.entity-detail.save", "client.entity-detail.saveError", "client.entity-detail.saveAbortedTitle", "client.entity-detail.saveAbortedMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.saveSuccessfulMessage", "client.entity-detail.syncValidationRequired", "client.entity-detail.syncValidationMinLength", "client.entity-detail.syncValidationMaxLength", "client.entity-detail.validationError", "client.component.remoteselect.noResultsText", "client.component.remoteselect.clearAllText", "client.component.remoteselect.clearValueText", "client.component.remoteselect.searchPromptText", "client.component.remoteselect.moreOptionsAvailableText" ]
Remove duplicate text resource key
chore(entity-detail): Remove duplicate text resource key
JSON
agpl-3.0
tocco/tocco-client,tocco/tocco-client,tocco/tocco-client
json
## Code Before: [ "client.entity-detail.invalidFieldsError", "client.entity-detail.invalidRelationErrors", "client.entity-detail.lastSave", "client.entity-detail.loadingText", "client.entity-detail.mandatoryFieldTitle", "client.entity-detail.save", "client.entity-detail.saveError", "client.entity-detail.saveAbortedTitle", "client.entity-detail.saveAbortedMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.saveSuccessfulMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.syncValidationRequired", "client.entity-detail.syncValidationMinLength", "client.entity-detail.syncValidationMaxLength", "client.entity-detail.validationError", "client.component.remoteselect.noResultsText", "client.component.remoteselect.clearAllText", "client.component.remoteselect.clearValueText", "client.component.remoteselect.searchPromptText", "client.component.remoteselect.moreOptionsAvailableText" ] ## Instruction: chore(entity-detail): Remove duplicate text resource key ## Code After: [ "client.entity-detail.invalidFieldsError", "client.entity-detail.invalidRelationErrors", "client.entity-detail.lastSave", "client.entity-detail.loadingText", "client.entity-detail.mandatoryFieldTitle", "client.entity-detail.save", "client.entity-detail.saveError", "client.entity-detail.saveAbortedTitle", "client.entity-detail.saveAbortedMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.saveSuccessfulMessage", "client.entity-detail.syncValidationRequired", "client.entity-detail.syncValidationMinLength", "client.entity-detail.syncValidationMaxLength", "client.entity-detail.validationError", "client.component.remoteselect.noResultsText", "client.component.remoteselect.clearAllText", "client.component.remoteselect.clearValueText", "client.component.remoteselect.searchPromptText", "client.component.remoteselect.moreOptionsAvailableText" ]
[ "client.entity-detail.invalidFieldsError", "client.entity-detail.invalidRelationErrors", "client.entity-detail.lastSave", "client.entity-detail.loadingText", "client.entity-detail.mandatoryFieldTitle", "client.entity-detail.save", "client.entity-detail.saveError", "client.entity-detail.saveAbortedTitle", "client.entity-detail.saveAbortedMessage", "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.saveSuccessfulMessage", - "client.entity-detail.saveSuccessfulTitle", "client.entity-detail.syncValidationRequired", "client.entity-detail.syncValidationMinLength", "client.entity-detail.syncValidationMaxLength", "client.entity-detail.validationError", "client.component.remoteselect.noResultsText", "client.component.remoteselect.clearAllText", "client.component.remoteselect.clearValueText", "client.component.remoteselect.searchPromptText", "client.component.remoteselect.moreOptionsAvailableText" ]
1
0.041667
0
1