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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8fd4529fad2cb7f02272ade483e7bc37e3a40539 | resources/views/partials/forms/edit/serial.blade.php | resources/views/partials/forms/edit/serial.blade.php | <!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<input class="form-control" type="text" name="serial" id="serial" value="{{ old('serial', $item->serial) }}" />
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
| <!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old('serial', $item->serial) }}" />
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
| Change the form input name for serials in the view | Change the form input name for serials in the view
| PHP | agpl-3.0 | uberbrady/snipe-it,mtucker6784/snipe-it,uberbrady/snipe-it,uberbrady/snipe-it,snipe/snipe-it,snipe/snipe-it,snipe/snipe-it,uberbrady/snipe-it,uberbrady/snipe-it,mtucker6784/snipe-it,mtucker6784/snipe-it,mtucker6784/snipe-it,snipe/snipe-it,mtucker6784/snipe-it | php | ## Code Before:
<!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<input class="form-control" type="text" name="serial" id="serial" value="{{ old('serial', $item->serial) }}" />
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
## Instruction:
Change the form input name for serials in the view
## Code After:
<!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old('serial', $item->serial) }}" />
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
| <!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
- <input class="form-control" type="text" name="serial" id="serial" value="{{ old('serial', $item->serial) }}" />
? ^ ^^ ^ ^ ^^ ^
+ <input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old('serial', $item->serial) }}" />
? ^^^^^^ ^^^ ^^^^^ ^^^^^^ ^^^ ^^^^^
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div> | 2 | 0.25 | 1 | 1 |
eb14c1a8a14fc785a695d957ee6f75efeb9ab2f0 | press.html | press.html | ---
layout: default
title: Press
menu: true
order: 4
image: press.jpg
image-credit: Austin Love
vpos: 25%
subhead: Press
---
<div id="press-container">
{% for story in (site.data.press | sort:"sort_date" | reverse) %}
<div class="press-story">
<a href="{{story.url}}">
<p class="press-date">{{story.date}}</p>
<p class="press-title">{{story.title}}</p>
<p class="press-snippet">{{story.snippet}}</p>
<p class="press-author">by {{story.author}}</p>
<p class="press-source">{{story.source}}</p>
</a>
</div>
{% endfor %}
</div>
| ---
layout: default
title: Press
menu: true
order: 4
image: press.jpg
image-credit: Austin Love
vpos: 25%
subhead: Press
---
<div id="press-container">
{% for story in (site.data.press | sort: "sort_date") %}
<div class="press-story">
<a href="{{story.url}}">
<p class="press-date">{{story.date}}</p>
<p class="press-title">{{story.title}}</p>
<p class="press-snippet">{{story.snippet}}</p>
<p class="press-author">by {{story.author}}</p>
<p class="press-source">{{story.source}}</p>
</a>
</div>
{% endfor %}
</div>
| Sort by date, try 2 | Sort by date, try 2 | HTML | mit | javbotero/Trans-Alaska-Trail,javbotero/Trans-Alaska-Trail,javbotero/Trans-Alaska-Trail,javbotero/Trans-Alaska-Trail | html | ## Code Before:
---
layout: default
title: Press
menu: true
order: 4
image: press.jpg
image-credit: Austin Love
vpos: 25%
subhead: Press
---
<div id="press-container">
{% for story in (site.data.press | sort:"sort_date" | reverse) %}
<div class="press-story">
<a href="{{story.url}}">
<p class="press-date">{{story.date}}</p>
<p class="press-title">{{story.title}}</p>
<p class="press-snippet">{{story.snippet}}</p>
<p class="press-author">by {{story.author}}</p>
<p class="press-source">{{story.source}}</p>
</a>
</div>
{% endfor %}
</div>
## Instruction:
Sort by date, try 2
## Code After:
---
layout: default
title: Press
menu: true
order: 4
image: press.jpg
image-credit: Austin Love
vpos: 25%
subhead: Press
---
<div id="press-container">
{% for story in (site.data.press | sort: "sort_date") %}
<div class="press-story">
<a href="{{story.url}}">
<p class="press-date">{{story.date}}</p>
<p class="press-title">{{story.title}}</p>
<p class="press-snippet">{{story.snippet}}</p>
<p class="press-author">by {{story.author}}</p>
<p class="press-source">{{story.source}}</p>
</a>
</div>
{% endfor %}
</div>
| ---
layout: default
title: Press
menu: true
order: 4
image: press.jpg
image-credit: Austin Love
vpos: 25%
subhead: Press
---
<div id="press-container">
- {% for story in (site.data.press | sort:"sort_date" | reverse) %}
? ----------
+ {% for story in (site.data.press | sort: "sort_date") %}
? +
<div class="press-story">
<a href="{{story.url}}">
<p class="press-date">{{story.date}}</p>
<p class="press-title">{{story.title}}</p>
<p class="press-snippet">{{story.snippet}}</p>
<p class="press-author">by {{story.author}}</p>
<p class="press-source">{{story.source}}</p>
</a>
</div>
{% endfor %}
</div> | 2 | 0.086957 | 1 | 1 |
60723beea3f8436af5ec689ecb3128c66409effb | dashboard/app/scripts/views/iops-dash-view.js | dashboard/app/scripts/views/iops-dash-view.js | /*global define*/
define([
'jquery',
'underscore',
'backbone',
'templates',
'dygraphs',
'marionette'
], function($, _, Backbone, JST, Dygraph) {
'use strict';
var IopsDashView = Backbone.Marionette.ItemView.extend({
className: 'custom-gutter col-sm-12 col-xs-12 col-lg-9 col-md-9',
template: JST['app/scripts/templates/iops-dash.ejs'],
ui: {
'canvas': '.iopscanvas',
'headline': '.headline'
},
initialize: function() {
this.Dygraph = Dygraph;
_.bindAll(this, 'postRender');
this.listenToOnce(this, 'render', this.postRender);
},
data: [
[1, 10, 120],
[2, 20, 80],
[3, 50, 60],
[4, 70, 80]
],
postRender: function() {
this.d = new Dygraph(this.ui.canvas[0], this.data, {
axisLabelFontSize: 10,
drawYAxis: false,
height: 100,
width: 400
});
this.ui.headline.text('lotta');
}
});
return IopsDashView;
});
| /*global define*/
define([
'jquery',
'underscore',
'backbone',
'templates',
'dygraphs',
'helpers/gauge-helper',
'marionette',
], function($, _, Backbone, JST, Dygraph, gaugeHelper) {
'use strict';
var IopsDashView = Backbone.Marionette.ItemView.extend({
className: 'custom-gutter col-sm-12 col-xs-12 col-lg-9 col-md-9',
template: JST['app/scripts/templates/iops-dash.ejs'],
ui: {
'canvas': '.iopscanvas',
'headline': '.headline'
},
initialize: function() {
this.Dygraph = Dygraph;
_.bindAll(this, 'postRender');
this.App = Backbone.Marionette.getOption(this, 'App');
this.listenToOnce(this, 'render', this.postRender);
gaugeHelper(this);
},
data: [
[1, 10, 120],
[2, 20, 80],
[3, 50, 60],
[4, 70, 80]
],
postRender: function() {
this.d = new Dygraph(this.ui.canvas[0], this.data, {
axisLabelFontSize: 10,
drawYAxis: false,
height: 100,
width: 400
});
this.ui.headline.text('lotta');
}
});
return IopsDashView;
});
| Add gauge Helper so card disappears | Add gauge Helper so card disappears
| JavaScript | mit | ceph/romana,GregMeno/test,ceph/calamari-clients,GregMeno/test,SUSE/calamari-clients,ceph/calamari-clients,SUSE/calamari-clients,SUSE/romana,ceph/romana,ceph/romana,ceph/romana,ceph/calamari-clients,GregMeno/test,SUSE/calamari-clients,SUSE/romana,SUSE/romana,SUSE/calamari-clients,GregMeno/test,ceph/romana,ceph/calamari-clients,SUSE/calamari-clients,SUSE/romana,GregMeno/test,SUSE/romana,ceph/calamari-clients | javascript | ## Code Before:
/*global define*/
define([
'jquery',
'underscore',
'backbone',
'templates',
'dygraphs',
'marionette'
], function($, _, Backbone, JST, Dygraph) {
'use strict';
var IopsDashView = Backbone.Marionette.ItemView.extend({
className: 'custom-gutter col-sm-12 col-xs-12 col-lg-9 col-md-9',
template: JST['app/scripts/templates/iops-dash.ejs'],
ui: {
'canvas': '.iopscanvas',
'headline': '.headline'
},
initialize: function() {
this.Dygraph = Dygraph;
_.bindAll(this, 'postRender');
this.listenToOnce(this, 'render', this.postRender);
},
data: [
[1, 10, 120],
[2, 20, 80],
[3, 50, 60],
[4, 70, 80]
],
postRender: function() {
this.d = new Dygraph(this.ui.canvas[0], this.data, {
axisLabelFontSize: 10,
drawYAxis: false,
height: 100,
width: 400
});
this.ui.headline.text('lotta');
}
});
return IopsDashView;
});
## Instruction:
Add gauge Helper so card disappears
## Code After:
/*global define*/
define([
'jquery',
'underscore',
'backbone',
'templates',
'dygraphs',
'helpers/gauge-helper',
'marionette',
], function($, _, Backbone, JST, Dygraph, gaugeHelper) {
'use strict';
var IopsDashView = Backbone.Marionette.ItemView.extend({
className: 'custom-gutter col-sm-12 col-xs-12 col-lg-9 col-md-9',
template: JST['app/scripts/templates/iops-dash.ejs'],
ui: {
'canvas': '.iopscanvas',
'headline': '.headline'
},
initialize: function() {
this.Dygraph = Dygraph;
_.bindAll(this, 'postRender');
this.App = Backbone.Marionette.getOption(this, 'App');
this.listenToOnce(this, 'render', this.postRender);
gaugeHelper(this);
},
data: [
[1, 10, 120],
[2, 20, 80],
[3, 50, 60],
[4, 70, 80]
],
postRender: function() {
this.d = new Dygraph(this.ui.canvas[0], this.data, {
axisLabelFontSize: 10,
drawYAxis: false,
height: 100,
width: 400
});
this.ui.headline.text('lotta');
}
});
return IopsDashView;
});
| /*global define*/
define([
'jquery',
'underscore',
'backbone',
'templates',
'dygraphs',
+ 'helpers/gauge-helper',
- 'marionette'
+ 'marionette',
? +
- ], function($, _, Backbone, JST, Dygraph) {
+ ], function($, _, Backbone, JST, Dygraph, gaugeHelper) {
? +++++++++++++
'use strict';
var IopsDashView = Backbone.Marionette.ItemView.extend({
className: 'custom-gutter col-sm-12 col-xs-12 col-lg-9 col-md-9',
template: JST['app/scripts/templates/iops-dash.ejs'],
ui: {
'canvas': '.iopscanvas',
'headline': '.headline'
},
initialize: function() {
this.Dygraph = Dygraph;
_.bindAll(this, 'postRender');
+ this.App = Backbone.Marionette.getOption(this, 'App');
this.listenToOnce(this, 'render', this.postRender);
+ gaugeHelper(this);
},
data: [
[1, 10, 120],
[2, 20, 80],
[3, 50, 60],
[4, 70, 80]
],
postRender: function() {
this.d = new Dygraph(this.ui.canvas[0], this.data, {
axisLabelFontSize: 10,
drawYAxis: false,
height: 100,
width: 400
});
this.ui.headline.text('lotta');
}
});
return IopsDashView;
}); | 7 | 0.162791 | 5 | 2 |
3ba7104d55581f41c4e25238941be42ddfed489f | src/image/kindNames.js | src/image/kindNames.js | // Shortcuts for common image kinds
export const BINARY = 'BINARY';
export const GREYA = 'GREYA';
export const RGBA = 'RGBA';
export const RGB = 'RGB';
export const GREY = 'GREY';
| // Shortcuts for common image kinds
export const BINARY = 'BINARY';
export const GREY = 'GREY';
export const GREYA = 'GREYA';
export const RGB = 'RGB';
export const RGBA = 'RGBA';
export const CMYK = 'CMYK';
export const CMYKA = 'CMYKA';
| Add CMYK and CMYKA kinds | Add CMYK and CMYKA kinds
| JavaScript | mit | image-js/core,image-js/ij,image-js/ij,image-js/ij,image-js/image-js,image-js/image-js,image-js/core | javascript | ## Code Before:
// Shortcuts for common image kinds
export const BINARY = 'BINARY';
export const GREYA = 'GREYA';
export const RGBA = 'RGBA';
export const RGB = 'RGB';
export const GREY = 'GREY';
## Instruction:
Add CMYK and CMYKA kinds
## Code After:
// Shortcuts for common image kinds
export const BINARY = 'BINARY';
export const GREY = 'GREY';
export const GREYA = 'GREYA';
export const RGB = 'RGB';
export const RGBA = 'RGBA';
export const CMYK = 'CMYK';
export const CMYKA = 'CMYKA';
| // Shortcuts for common image kinds
export const BINARY = 'BINARY';
+ export const GREY = 'GREY';
export const GREYA = 'GREYA';
+ export const RGB = 'RGB';
export const RGBA = 'RGBA';
- export const RGB = 'RGB';
- export const GREY = 'GREY';
? ^^^ ^^^
+ export const CMYK = 'CMYK';
? ^^ + ^^ +
+ export const CMYKA = 'CMYKA';
| 6 | 0.75 | 4 | 2 |
937fc60c4e076804da57a995f9cbc7489e651cd7 | templates/widgets/select_all.jade | templates/widgets/select_all.jade | fieldset(style='border:none')
| {{original_widget}}
if empty
| Nothing here.
else
label(for=select_all_id)
input.checkall(id=select_all_id, name=select_all_name, checked=all_selected, type='checkbox')
| Check all
script(type='text/javascript')
(function ($) {
$(document).ready(function() {
$('.checkall').click(function () {
$(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked);
});
});
})(django.jQuery);
| div(style='border:none', id=select_all_name)
| {{original_widget}}
if empty
| Nothing here.
else
label(for=select_all_id)
input.checkall(id=select_all_id, name=select_all_name, checked=all_selected, type='checkbox')
| Check all
script(type='text/javascript')
(function ($) {
$(document).ready(function() {
$('.checkall').click(function () {
$('div#{{ select_all_name }}').find(':checkbox').prop('checked', this.checked);
});
});
})(django.jQuery);
| Select all doesn't look nice at all in django-suit | Select all doesn't look nice at all in django-suit
| Jade | agpl-3.0 | monouno/site,Minkov/site,monouno/site,monouno/site,DMOJ/site,Minkov/site,Minkov/site,DMOJ/site,DMOJ/site,monouno/site,Phoenix1369/site,monouno/site,Phoenix1369/site,Phoenix1369/site,Minkov/site,Phoenix1369/site,DMOJ/site | jade | ## Code Before:
fieldset(style='border:none')
| {{original_widget}}
if empty
| Nothing here.
else
label(for=select_all_id)
input.checkall(id=select_all_id, name=select_all_name, checked=all_selected, type='checkbox')
| Check all
script(type='text/javascript')
(function ($) {
$(document).ready(function() {
$('.checkall').click(function () {
$(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked);
});
});
})(django.jQuery);
## Instruction:
Select all doesn't look nice at all in django-suit
## Code After:
div(style='border:none', id=select_all_name)
| {{original_widget}}
if empty
| Nothing here.
else
label(for=select_all_id)
input.checkall(id=select_all_id, name=select_all_name, checked=all_selected, type='checkbox')
| Check all
script(type='text/javascript')
(function ($) {
$(document).ready(function() {
$('.checkall').click(function () {
$('div#{{ select_all_name }}').find(':checkbox').prop('checked', this.checked);
});
});
})(django.jQuery);
| - fieldset(style='border:none')
+ div(style='border:none', id=select_all_name)
| {{original_widget}}
if empty
| Nothing here.
else
label(for=select_all_id)
input.checkall(id=select_all_id, name=select_all_name, checked=all_selected, type='checkbox')
- | Check all
+ | Check all
? ++++++
script(type='text/javascript')
(function ($) {
$(document).ready(function() {
$('.checkall').click(function () {
- $(this).parents('fieldset:eq(0)').find(':checkbox').attr('checked', this.checked);
? ^^ ------------- -- ^ ^^^^ ^^^
+ $('div#{{ select_all_name }}').find(':checkbox').prop('checked', this.checked);
? ^^ +++++ + ^^^^^^^^ ^^^ ^ ++
});
});
})(django.jQuery); | 6 | 0.375 | 3 | 3 |
c1b2edaba806b9329b74f1156015781d12321137 | zucchini-ui-frontend/app/scripts/browser-storage.js | zucchini-ui-frontend/app/scripts/browser-storage.js | (function (angular) {
'use strict';
var StoredItem = function (storage, itemName, defaultValueFactory, log) {
var value = defaultValueFactory();
var storedValue = storage.getItem(itemName);
if (_.isString(storedValue)) {
try {
_.merge(value, angular.fromJson(storedValue));
} catch (e) {
log.warn('Caught exception when loading filters from local storage item', itemName, ':', e);
}
}
this.get = function () {
return value;
};
this.save = function (newValue) {
value = newValue;
storage.setItem(itemName, angular.toJson(value));
};
this.reset = function () {
value = defaultValueFactory();
storage.removeItem(itemName);
};
};
var BrowserObjectStorage = function (storage, log) {
this.getItem = function (itemName, defaultValueFactory) {
return new StoredItem(storage, itemName, defaultValueFactory, log);
};
};
angular.module('zucchini-ui-frontend')
.factory('BrowserSessionStorage', function ($window, $log) {
return new BrowserObjectStorage($window.sessionStorage, $log);
})
.factory('BrowserLocalStorage', function ($window, $log) {
return new BrowserObjectStorage($window.localStorage, $log);
});
})(angular);
| (function (angular) {
'use strict';
var StoredItem = function (storage, itemName, defaultValueFactory, log) {
var value = defaultValueFactory();
this.get = function () {
return value;
};
this.save = function (newValue) {
value = newValue;
storage.setItem(itemName, angular.toJson(value));
};
this.reset = function () {
value = defaultValueFactory();
storage.removeItem(itemName);
};
var storedValue = storage.getItem(itemName);
if (_.isString(storedValue)) {
try {
_.merge(value, angular.fromJson(storedValue));
} catch (e) {
log.warn('Caught exception when loading filters from local storage item', itemName, ':', e);
}
}
this.save(value);
};
var BrowserObjectStorage = function (storage, log) {
this.getItem = function (itemName, defaultValueFactory) {
return new StoredItem(storage, itemName, defaultValueFactory, log);
};
};
angular.module('zucchini-ui-frontend')
.factory('BrowserSessionStorage', function ($window, $log) {
return new BrowserObjectStorage($window.sessionStorage, $log);
})
.factory('BrowserLocalStorage', function ($window, $log) {
return new BrowserObjectStorage($window.localStorage, $log);
});
})(angular);
| Save value in storage on init | Save value in storage on init
| JavaScript | mit | pgentile/zucchini-ui,pgentile/tests-cucumber,jeremiemarc/zucchini-ui,pgentile/zucchini-ui,pgentile/tests-cucumber,jeremiemarc/zucchini-ui,jeremiemarc/zucchini-ui,pgentile/tests-cucumber,pgentile/tests-cucumber,jeremiemarc/zucchini-ui,pgentile/zucchini-ui,pgentile/zucchini-ui,pgentile/zucchini-ui | javascript | ## Code Before:
(function (angular) {
'use strict';
var StoredItem = function (storage, itemName, defaultValueFactory, log) {
var value = defaultValueFactory();
var storedValue = storage.getItem(itemName);
if (_.isString(storedValue)) {
try {
_.merge(value, angular.fromJson(storedValue));
} catch (e) {
log.warn('Caught exception when loading filters from local storage item', itemName, ':', e);
}
}
this.get = function () {
return value;
};
this.save = function (newValue) {
value = newValue;
storage.setItem(itemName, angular.toJson(value));
};
this.reset = function () {
value = defaultValueFactory();
storage.removeItem(itemName);
};
};
var BrowserObjectStorage = function (storage, log) {
this.getItem = function (itemName, defaultValueFactory) {
return new StoredItem(storage, itemName, defaultValueFactory, log);
};
};
angular.module('zucchini-ui-frontend')
.factory('BrowserSessionStorage', function ($window, $log) {
return new BrowserObjectStorage($window.sessionStorage, $log);
})
.factory('BrowserLocalStorage', function ($window, $log) {
return new BrowserObjectStorage($window.localStorage, $log);
});
})(angular);
## Instruction:
Save value in storage on init
## Code After:
(function (angular) {
'use strict';
var StoredItem = function (storage, itemName, defaultValueFactory, log) {
var value = defaultValueFactory();
this.get = function () {
return value;
};
this.save = function (newValue) {
value = newValue;
storage.setItem(itemName, angular.toJson(value));
};
this.reset = function () {
value = defaultValueFactory();
storage.removeItem(itemName);
};
var storedValue = storage.getItem(itemName);
if (_.isString(storedValue)) {
try {
_.merge(value, angular.fromJson(storedValue));
} catch (e) {
log.warn('Caught exception when loading filters from local storage item', itemName, ':', e);
}
}
this.save(value);
};
var BrowserObjectStorage = function (storage, log) {
this.getItem = function (itemName, defaultValueFactory) {
return new StoredItem(storage, itemName, defaultValueFactory, log);
};
};
angular.module('zucchini-ui-frontend')
.factory('BrowserSessionStorage', function ($window, $log) {
return new BrowserObjectStorage($window.sessionStorage, $log);
})
.factory('BrowserLocalStorage', function ($window, $log) {
return new BrowserObjectStorage($window.localStorage, $log);
});
})(angular);
| (function (angular) {
'use strict';
var StoredItem = function (storage, itemName, defaultValueFactory, log) {
var value = defaultValueFactory();
-
- var storedValue = storage.getItem(itemName);
- if (_.isString(storedValue)) {
- try {
- _.merge(value, angular.fromJson(storedValue));
- } catch (e) {
- log.warn('Caught exception when loading filters from local storage item', itemName, ':', e);
- }
- }
this.get = function () {
return value;
};
this.save = function (newValue) {
value = newValue;
storage.setItem(itemName, angular.toJson(value));
};
this.reset = function () {
value = defaultValueFactory();
storage.removeItem(itemName);
};
+
+ var storedValue = storage.getItem(itemName);
+ if (_.isString(storedValue)) {
+ try {
+ _.merge(value, angular.fromJson(storedValue));
+ } catch (e) {
+ log.warn('Caught exception when loading filters from local storage item', itemName, ':', e);
+ }
+ }
+ this.save(value);
};
var BrowserObjectStorage = function (storage, log) {
this.getItem = function (itemName, defaultValueFactory) {
return new StoredItem(storage, itemName, defaultValueFactory, log);
};
};
angular.module('zucchini-ui-frontend')
.factory('BrowserSessionStorage', function ($window, $log) {
return new BrowserObjectStorage($window.sessionStorage, $log);
})
.factory('BrowserLocalStorage', function ($window, $log) {
return new BrowserObjectStorage($window.localStorage, $log);
});
})(angular); | 19 | 0.387755 | 10 | 9 |
1ad4c1d14e93c9acc814cbed6bbdeab8e0b60120 | app/views/landing_pages/index.html.slim | app/views/landing_pages/index.html.slim | .intro-header
.intro-message
.container
.row.visible-lg
.col-lg-12
h1 I want to learn
input(type="text" autofocus)
.row.hidden-lg
.col-md-12
h1 I want to learn
.col-md-12
input(type="text" autofocus)
.container
.row
.col-lg-12
button.btn.btn-primary.btn-lg.btn-block type="button" Go!
| .intro-header
.intro-message
.container
.row.visible-lg
.col-lg-12
h1 I want to learn
input (type="text" spellcheck="false" autofocus)
.row.hidden-lg
.col-md-12
h1 I want to learn
.col-md-12
input (type="text" spellcheck="false" autofocus)
.container
.row
.col-lg-12
button.btn.btn-primary.btn-lg.btn-block type="button" Go!
| Remove spellcheck from search bar | Remove spellcheck from search bar
| Slim | mit | amberbit/programming-resources | slim | ## Code Before:
.intro-header
.intro-message
.container
.row.visible-lg
.col-lg-12
h1 I want to learn
input(type="text" autofocus)
.row.hidden-lg
.col-md-12
h1 I want to learn
.col-md-12
input(type="text" autofocus)
.container
.row
.col-lg-12
button.btn.btn-primary.btn-lg.btn-block type="button" Go!
## Instruction:
Remove spellcheck from search bar
## Code After:
.intro-header
.intro-message
.container
.row.visible-lg
.col-lg-12
h1 I want to learn
input (type="text" spellcheck="false" autofocus)
.row.hidden-lg
.col-md-12
h1 I want to learn
.col-md-12
input (type="text" spellcheck="false" autofocus)
.container
.row
.col-lg-12
button.btn.btn-primary.btn-lg.btn-block type="button" Go!
| .intro-header
.intro-message
.container
.row.visible-lg
.col-lg-12
h1 I want to learn
- input(type="text" autofocus)
+ input (type="text" spellcheck="false" autofocus)
? + +++++++++++++++++++
.row.hidden-lg
.col-md-12
h1 I want to learn
.col-md-12
- input(type="text" autofocus)
+ input (type="text" spellcheck="false" autofocus)
? + + +++++++++++++++++++
-
.container
.row
.col-lg-12
button.btn.btn-primary.btn-lg.btn-block type="button" Go!
| 5 | 0.277778 | 2 | 3 |
51030364ec2b5f74381725aa49f73af34d690f8c | railties/lib/rails/commands/application.rb | railties/lib/rails/commands/application.rb | require 'rails/version'
if ['--version', '-v'].include?(ARGV.first)
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
unless ARGV.delete("--no-rc")
customrc = ARGV.index('--rc')
railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc')
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
ARGV.insert(1, *extra_args)
end
end
end
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
class AppGenerator # :nodoc:
# We want to exit on failure to be kind to other libraries
# This is only when accessing via CLI
def self.exit_on_failure?
true
end
end
end
end
Rails::Generators::AppGenerator.start
| require 'rails/version'
if ['--version', '-v'].include?(ARGV.first)
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
unless ARGV.delete("--no-rc")
customrc = ARGV.index{ |x| x.include?("--rc=") }
railsrc = if customrc
File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ""))
else
File.join(File.expand_path("~"), '.railsrc')
end
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
ARGV.insert(1, *extra_args)
end
end
end
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
class AppGenerator # :nodoc:
# We want to exit on failure to be kind to other libraries
# This is only when accessing via CLI
def self.exit_on_failure?
true
end
end
end
end
Rails::Generators::AppGenerator.start
| Use --rc= instead of --rc | Use --rc= instead of --rc
| Ruby | mit | illacceptanything/illacceptanything,rails/rails,kddeisz/rails,mtsmfm/railstest,MichaelSp/rails,samphilipd/rails,yalab/rails,bogdanvlviv/rails,EmmaB/rails-1,betesh/rails,EmmaB/rails-1,joonyou/rails,maicher/rails,lcreid/rails,Erol/rails,marklocklear/rails,georgeclaghorn/rails,vipulnsward/rails,baerjam/rails,baerjam/rails,Stellenticket/rails,deraru/rails,arjes/rails,pvalena/rails,sealocal/rails,flanger001/rails,yasslab/railsguides.jp,mohitnatoo/rails,riseshia/railsguides.kr,kachick/rails,yahonda/rails,mtsmfm/railstest,illacceptanything/illacceptanything,ngpestelos/rails,jeremy/rails,rossta/rails,matrinox/rails,tjschuck/rails,MSP-Greg/rails,illacceptanything/illacceptanything,BlakeWilliams/rails,sergey-alekseev/rails,kachick/rails,odedniv/rails,kachick/rails,pvalena/rails,prathamesh-sonpatki/rails,yalab/rails,ledestin/rails,Erol/rails,yasslab/railsguides.jp,sergey-alekseev/rails,alecspopa/rails,tjschuck/rails,utilum/rails,Spin42/rails,mtsmfm/rails,yawboakye/rails,hanystudy/rails,odedniv/rails,arjes/rails,mtsmfm/railstest,marklocklear/rails,voray/rails,kenta-s/rails,kmayer/rails,kddeisz/rails,schuetzm/rails,jeremy/rails,alecspopa/rails,hanystudy/rails,palkan/rails,BlakeWilliams/rails,bogdanvlviv/rails,ngpestelos/rails,gavingmiller/rails,eileencodes/rails,jeremy/rails,tgxworld/rails,BlakeWilliams/rails,yhirano55/rails,esparta/rails,elfassy/rails,ledestin/rails,xlymian/rails,kamipo/rails,maicher/rails,ttanimichi/rails,rafaelfranca/omg-rails,MichaelSp/rails,coreyward/rails,matrinox/rails,joonyou/rails,fabianoleittes/rails,mechanicles/rails,richseviora/rails,tjschuck/rails,yalab/rails,sealocal/rails,joonyou/rails,Stellenticket/rails,eileencodes/rails,samphilipd/rails,printercu/rails,shioyama/rails,mechanicles/rails,iainbeeston/rails,tjschuck/rails,lucasmazza/rails,travisofthenorth/rails,rafaelfranca/omg-rails,Vasfed/rails,Edouard-chin/rails,Stellenticket/rails,amoody2108/TechForJustice,MSP-Greg/rails,88rabbit/newRails,Stellenticket/rails,untidy-hair/rails,mtsmfm/rails,notapatch/rails,richseviora/rails,palkan/rails,utilum/rails,untidy-hair/rails,vassilevsky/rails,iainbeeston/rails,gauravtiwari/rails,stefanmb/rails,mathieujobin/reduced-rails-for-travis,esparta/rails,lucasmazza/rails,baerjam/rails,yhirano55/rails,Vasfed/rails,starknx/rails,stefanmb/rails,illacceptanything/illacceptanything,repinel/rails,mathieujobin/reduced-rails-for-travis,kmayer/rails,assain/rails,stefanmb/rails,rails/rails,MSP-Greg/rails,bradleypriest/rails,sealocal/rails,pvalena/rails,ttanimichi/rails,betesh/rails,utilum/rails,Spin42/rails,MSP-Greg/rails,vipulnsward/rails,ngpestelos/rails,tgxworld/rails,tijwelch/rails,illacceptanything/illacceptanything,mohitnatoo/rails,bogdanvlviv/rails,xlymian/rails,illacceptanything/illacceptanything,pschambacher/rails,yawboakye/rails,riseshia/railsguides.kr,shioyama/rails,kirs/rails-1,kamipo/rails,arjes/rails,rafaelfranca/omg-rails,gcourtemanche/rails,yasslab/railsguides.jp,bogdanvlviv/rails,riseshia/railsguides.kr,shioyama/rails,prathamesh-sonpatki/rails,maicher/rails,kmcphillips/rails,kenta-s/rails,brchristian/rails,vipulnsward/rails,arunagw/rails,jeremy/rails,kaspth/rails,illacceptanything/illacceptanything,Envek/rails,kmayer/rails,voray/rails,repinel/rails,EmmaB/rails-1,koic/rails,printercu/rails,arunagw/rails,mohitnatoo/rails,gauravtiwari/rails,88rabbit/newRails,tijwelch/rails,xlymian/rails,coreyward/rails,lcreid/rails,brchristian/rails,travisofthenorth/rails,palkan/rails,rbhitchcock/rails,aditya-kapoor/rails,riseshia/railsguides.kr,gauravtiwari/rails,esparta/rails,rails/rails,mijoharas/rails,deraru/rails,odedniv/rails,gcourtemanche/rails,kddeisz/rails,matrinox/rails,notapatch/rails,vipulnsward/rails,repinel/rails,lcreid/rails,vassilevsky/rails,BlakeWilliams/rails,gfvcastro/rails,bolek/rails,hanystudy/rails,kenta-s/rails,rbhitchcock/rails,untidy-hair/rails,georgeclaghorn/rails,yalab/rails,mechanicles/rails,eileencodes/rails,pvalena/rails,lucasmazza/rails,lcreid/rails,Edouard-chin/rails,joonyou/rails,betesh/rails,mijoharas/rails,bradleypriest/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,assain/rails,pschambacher/rails,MichaelSp/rails,aditya-kapoor/rails,elfassy/rails,richseviora/rails,schuetzm/rails,samphilipd/rails,yahonda/rails,Edouard-chin/rails,marklocklear/rails,shioyama/rails,Erol/rails,deraru/rails,illacceptanything/illacceptanything,schuetzm/rails,baerjam/rails,printercu/rails,mathieujobin/reduced-rails-for-travis,starknx/rails,fabianoleittes/rails,iainbeeston/rails,yhirano55/rails,palkan/rails,Envek/rails,gcourtemanche/rails,mtsmfm/rails,yahonda/rails,flanger001/rails,Envek/rails,aditya-kapoor/rails,fabianoleittes/rails,bolek/rails,mohitnatoo/rails,gfvcastro/rails,rossta/rails,schuetzm/rails,88rabbit/newRails,ledestin/rails,repinel/rails,felipecvo/rails,starknx/rails,untidy-hair/rails,illacceptanything/illacceptanything,yasslab/railsguides.jp,kmcphillips/rails,aditya-kapoor/rails,voray/rails,kddeisz/rails,gavingmiller/rails,Spin42/rails,illacceptanything/illacceptanything,Erol/rails,amoody2108/TechForJustice,coreyward/rails,ttanimichi/rails,kaspth/rails,utilum/rails,tijwelch/rails,flanger001/rails,kirs/rails-1,tgxworld/rails,illacceptanything/illacceptanything,notapatch/rails,kamipo/rails,koic/rails,gfvcastro/rails,rails/rails,bradleypriest/rails,illacceptanything/illacceptanything,sergey-alekseev/rails,assain/rails,kaspth/rails,travisofthenorth/rails,printercu/rails,kirs/rails-1,eileencodes/rails,alecspopa/rails,yahonda/rails,bolek/rails,Envek/rails,kmcphillips/rails,georgeclaghorn/rails,fabianoleittes/rails,rossta/rails,brchristian/rails,notapatch/rails,yhirano55/rails,mechanicles/rails,kmcphillips/rails,gfvcastro/rails,georgeclaghorn/rails,flanger001/rails,travisofthenorth/rails,Sen-Zhang/rails,Vasfed/rails,rbhitchcock/rails,iainbeeston/rails,elfassy/rails,amoody2108/TechForJustice,vassilevsky/rails,Edouard-chin/rails,gavingmiller/rails,arunagw/rails,felipecvo/rails,yawboakye/rails,deraru/rails,koic/rails,pschambacher/rails,Vasfed/rails,Sen-Zhang/rails,arunagw/rails,mijoharas/rails,assain/rails,yawboakye/rails,felipecvo/rails,Sen-Zhang/rails,illacceptanything/illacceptanything,prathamesh-sonpatki/rails,betesh/rails,tgxworld/rails,prathamesh-sonpatki/rails,esparta/rails | ruby | ## Code Before:
require 'rails/version'
if ['--version', '-v'].include?(ARGV.first)
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
unless ARGV.delete("--no-rc")
customrc = ARGV.index('--rc')
railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc')
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
ARGV.insert(1, *extra_args)
end
end
end
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
class AppGenerator # :nodoc:
# We want to exit on failure to be kind to other libraries
# This is only when accessing via CLI
def self.exit_on_failure?
true
end
end
end
end
Rails::Generators::AppGenerator.start
## Instruction:
Use --rc= instead of --rc
## Code After:
require 'rails/version'
if ['--version', '-v'].include?(ARGV.first)
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
unless ARGV.delete("--no-rc")
customrc = ARGV.index{ |x| x.include?("--rc=") }
railsrc = if customrc
File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ""))
else
File.join(File.expand_path("~"), '.railsrc')
end
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
ARGV.insert(1, *extra_args)
end
end
end
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
class AppGenerator # :nodoc:
# We want to exit on failure to be kind to other libraries
# This is only when accessing via CLI
def self.exit_on_failure?
true
end
end
end
end
Rails::Generators::AppGenerator.start
| require 'rails/version'
if ['--version', '-v'].include?(ARGV.first)
puts "Rails #{Rails::VERSION::STRING}"
exit(0)
end
if ARGV.first != "new"
ARGV[0] = "--help"
else
ARGV.shift
unless ARGV.delete("--no-rc")
- customrc = ARGV.index('--rc')
- railsrc = customrc ? ARGV.slice!(customrc, 2).last : File.join(File.expand_path("~"), '.railsrc')
+ customrc = ARGV.index{ |x| x.include?("--rc=") }
+ railsrc = if customrc
+ File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, ""))
+ else
+ File.join(File.expand_path("~"), '.railsrc')
+ end
if File.exist?(railsrc)
extra_args_string = File.read(railsrc)
extra_args = extra_args_string.split(/\n+/).map {|l| l.split}.flatten
puts "Using #{extra_args.join(" ")} from #{railsrc}"
ARGV.insert(1, *extra_args)
end
end
end
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Rails
module Generators
class AppGenerator # :nodoc:
# We want to exit on failure to be kind to other libraries
# This is only when accessing via CLI
def self.exit_on_failure?
true
end
end
end
end
Rails::Generators::AppGenerator.start | 8 | 0.205128 | 6 | 2 |
00c9d6357362f4b8a872b8cc9f6b76aa1b7b3f01 | lib/weak_headers/base_validator.rb | lib/weak_headers/base_validator.rb | module WeakHeaders
class BaseValidator
def initialize(controller, key, options = {}, &block)
@controller = controller
@key = key.to_s
@options = options
@block = block
end
def validate
handle_failure unless valid?
end
def type
self.class.name.split("::").last.sub(/Validator\z/, '').underscore.to_sym
end
private
def valid?
case
when requires? && blank?
false
when present? && exceptional?
false
when requires? && @block && !@block.call(value)
false
when optional? && present? && @block && !@controller.instance_exec(value, &@block)
false
else
true
end
end
def headers
@controller.request.headers
end
def value
headers[@key]
end
def handle_failure
if has_handler?
@controller.send(@options[:handler])
else
raise_error
end
end
def blank?
headers.nil? || headers[@key].blank?
end
def present?
!blank?
end
def requires?
type == :requires
end
def optional?
type == :optional
end
def exceptional?
case
when @options[:only].try(:exclude?, value)
true
when @options[:except].try(:include?, value)
true
else
false
end
end
def raise_error
raise WeakHeaders::ValidationError, error_message
end
def error_message
"request.headers[#{@key.inspect}] must be a valid value"
end
def has_handler?
!!@options[:handler]
end
end
end
| module WeakHeaders
class BaseValidator
def initialize(controller, key, options = {}, &block)
@controller = controller
@key = key.to_s
@options = options
@block = block
end
def validate
handle_failure unless valid?
end
def type
self.class.name.split('::').last.sub(/Validator\z/, '').underscore.to_sym
end
private
def valid?
case
when requires? && blank?
false
when present? && exceptional?
false
when requires? && @block && !@block.call(value)
false
when optional? && present? && @block && !@controller.instance_exec(value, &@block)
false
else
true
end
end
def headers
@controller.request.headers
end
def value
headers[@key]
end
def handle_failure
if has_handler?
@controller.send(@options[:handler])
else
raise_error
end
end
def blank?
headers.nil? || headers[@key].blank?
end
def present?
!blank?
end
def requires?
type == :requires
end
def optional?
type == :optional
end
def exceptional?
case
when @options[:only].try(:exclude?, value)
true
when @options[:except].try(:include?, value)
true
else
false
end
end
def raise_error
raise WeakHeaders::ValidationError, error_message
end
def error_message
"request.headers[#{@key.inspect}] must be a valid value"
end
def has_handler?
!!@options[:handler]
end
end
end
| Adjust the format of code | Adjust the format of code
| Ruby | mit | kenchan0130/weak_headers | ruby | ## Code Before:
module WeakHeaders
class BaseValidator
def initialize(controller, key, options = {}, &block)
@controller = controller
@key = key.to_s
@options = options
@block = block
end
def validate
handle_failure unless valid?
end
def type
self.class.name.split("::").last.sub(/Validator\z/, '').underscore.to_sym
end
private
def valid?
case
when requires? && blank?
false
when present? && exceptional?
false
when requires? && @block && !@block.call(value)
false
when optional? && present? && @block && !@controller.instance_exec(value, &@block)
false
else
true
end
end
def headers
@controller.request.headers
end
def value
headers[@key]
end
def handle_failure
if has_handler?
@controller.send(@options[:handler])
else
raise_error
end
end
def blank?
headers.nil? || headers[@key].blank?
end
def present?
!blank?
end
def requires?
type == :requires
end
def optional?
type == :optional
end
def exceptional?
case
when @options[:only].try(:exclude?, value)
true
when @options[:except].try(:include?, value)
true
else
false
end
end
def raise_error
raise WeakHeaders::ValidationError, error_message
end
def error_message
"request.headers[#{@key.inspect}] must be a valid value"
end
def has_handler?
!!@options[:handler]
end
end
end
## Instruction:
Adjust the format of code
## Code After:
module WeakHeaders
class BaseValidator
def initialize(controller, key, options = {}, &block)
@controller = controller
@key = key.to_s
@options = options
@block = block
end
def validate
handle_failure unless valid?
end
def type
self.class.name.split('::').last.sub(/Validator\z/, '').underscore.to_sym
end
private
def valid?
case
when requires? && blank?
false
when present? && exceptional?
false
when requires? && @block && !@block.call(value)
false
when optional? && present? && @block && !@controller.instance_exec(value, &@block)
false
else
true
end
end
def headers
@controller.request.headers
end
def value
headers[@key]
end
def handle_failure
if has_handler?
@controller.send(@options[:handler])
else
raise_error
end
end
def blank?
headers.nil? || headers[@key].blank?
end
def present?
!blank?
end
def requires?
type == :requires
end
def optional?
type == :optional
end
def exceptional?
case
when @options[:only].try(:exclude?, value)
true
when @options[:except].try(:include?, value)
true
else
false
end
end
def raise_error
raise WeakHeaders::ValidationError, error_message
end
def error_message
"request.headers[#{@key.inspect}] must be a valid value"
end
def has_handler?
!!@options[:handler]
end
end
end
| module WeakHeaders
class BaseValidator
def initialize(controller, key, options = {}, &block)
@controller = controller
@key = key.to_s
@options = options
@block = block
end
def validate
handle_failure unless valid?
end
def type
- self.class.name.split("::").last.sub(/Validator\z/, '').underscore.to_sym
? ^ ^
+ self.class.name.split('::').last.sub(/Validator\z/, '').underscore.to_sym
? ^ ^
end
private
def valid?
case
when requires? && blank?
false
when present? && exceptional?
false
when requires? && @block && !@block.call(value)
false
when optional? && present? && @block && !@controller.instance_exec(value, &@block)
false
else
true
end
end
def headers
@controller.request.headers
end
def value
headers[@key]
end
def handle_failure
if has_handler?
@controller.send(@options[:handler])
else
raise_error
end
end
def blank?
headers.nil? || headers[@key].blank?
end
def present?
!blank?
end
def requires?
type == :requires
end
def optional?
type == :optional
end
def exceptional?
case
- when @options[:only].try(:exclude?, value)
? --
+ when @options[:only].try(:exclude?, value)
- true
? --
+ true
- when @options[:except].try(:include?, value)
? --
+ when @options[:except].try(:include?, value)
- true
? --
+ true
- else
? --
+ else
- false
? --
+ false
end
end
def raise_error
raise WeakHeaders::ValidationError, error_message
end
def error_message
"request.headers[#{@key.inspect}] must be a valid value"
end
def has_handler?
!!@options[:handler]
end
end
end | 14 | 0.155556 | 7 | 7 |
d2390db0be2e3bc5d865294fe00218ece7f398c9 | spec/spec_helper.rb | spec/spec_helper.rb | $:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'bundler'
Bundler.setup(:test)
require 'rspec'
require 'rspec/autorun'
require 'evented-spec'
require 'support/shared_contexts'
require 'support/shared_examples'
require 'queueing_rabbit'
RSpec.configure do |config|
QueueingRabbit.configure do |qr|
qr.amqp_uri = "amqp://guest:guest@localhost:5672"
qr.amqp_exchange_name = "queueing_rabbit_test"
qr.amqp_exchange_options = {:durable => true}
end
end
| $:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'bundler'
Bundler.setup(:test)
require 'rspec'
require 'rspec/autorun'
require 'evented-spec'
require 'support/shared_contexts'
require 'support/shared_examples'
require 'queueing_rabbit'
RSpec.configure do |config|
config.before(:each) {
QueueingRabbit.drop_connection
}
QueueingRabbit.configure do |qr|
qr.amqp_uri = "amqp://guest:guest@localhost:5672"
qr.amqp_exchange_name = "queueing_rabbit_test"
qr.amqp_exchange_options = {:durable => true}
end
end
| Drop connection before each example. | Drop connection before each example.
| Ruby | mit | temochka/queueing_rabbit | ruby | ## Code Before:
$:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'bundler'
Bundler.setup(:test)
require 'rspec'
require 'rspec/autorun'
require 'evented-spec'
require 'support/shared_contexts'
require 'support/shared_examples'
require 'queueing_rabbit'
RSpec.configure do |config|
QueueingRabbit.configure do |qr|
qr.amqp_uri = "amqp://guest:guest@localhost:5672"
qr.amqp_exchange_name = "queueing_rabbit_test"
qr.amqp_exchange_options = {:durable => true}
end
end
## Instruction:
Drop connection before each example.
## Code After:
$:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'bundler'
Bundler.setup(:test)
require 'rspec'
require 'rspec/autorun'
require 'evented-spec'
require 'support/shared_contexts'
require 'support/shared_examples'
require 'queueing_rabbit'
RSpec.configure do |config|
config.before(:each) {
QueueingRabbit.drop_connection
}
QueueingRabbit.configure do |qr|
qr.amqp_uri = "amqp://guest:guest@localhost:5672"
qr.amqp_exchange_name = "queueing_rabbit_test"
qr.amqp_exchange_options = {:durable => true}
end
end
| $:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'rubygems'
require 'bundler'
Bundler.setup(:test)
require 'rspec'
require 'rspec/autorun'
require 'evented-spec'
require 'support/shared_contexts'
require 'support/shared_examples'
require 'queueing_rabbit'
RSpec.configure do |config|
+ config.before(:each) {
+ QueueingRabbit.drop_connection
+ }
+
QueueingRabbit.configure do |qr|
qr.amqp_uri = "amqp://guest:guest@localhost:5672"
qr.amqp_exchange_name = "queueing_rabbit_test"
qr.amqp_exchange_options = {:durable => true}
end
end | 4 | 0.181818 | 4 | 0 |
9e3bb71571d75974e7162760ef4850e84021294a | README.md | README.md | Antenna
=======
[](https://travis-ci.org/henrikbjorn/Antenna)
Recentry i had to implement authentication in an AngularJS application. For this pupose i found
https://github.com/sahat/satellizer which supports different flows of authentication, one of these
is username/password through JSON Web Token (JWT).
This small library combines firebase/php-jwt and two custom Symfony Security SimplePreAuthenticators
in order to have a simple flow.
`TokenExchangeAuthenticator` only purpose is to take the username / password provided in a JSON request and return a
valid JWT token. Depending on the way it have been setup.
`TokenAuthenticator` assumes a `Authorization: Bearer my-token` header is present and will use a `TokenUserProvider`
implementation to authenticate the User.
| Antenna
=======
[](https://travis-ci.org/henrikbjorn/Antenna)
Antenna is a small library that helps integrating JWT (JSON Web Token) for projects using
the Symfony Security Component.
In order to use this library you need to set up two authenticators in your firewall.
The first is `UsernamePasswordAuthenticator` which uses the security flow to authenticate through and
then "hijack" the request by rendering a body with a token `{ "token" : "json web token here" }`.
The second uses the `Authorization: Bearer <json web token>` header style to authenticate your
users by validating the JWT.
Using Symfony Standard it would look something like:
``` yaml
services:
antenna.coder:
class: Antenna\Coder
arguments: ['shared-secret']
antenna.username_password_authenticator:
class: Antenna\Security\UsernamePasswordAuthenticator
arguments: [@security.user_checker, @security.encoder_factory, @antenna.coder]
antenna.token_authenticator:
class: Antenna\Security\TokenAuthenticator
arguments: [@security.user_checker, @antenna.coder]
security:
providers:
in_memory:
memory:
users:
henrikbjorn:
password: my-unique-password
roles: 'ROLE_USER'
firewalls:
token_exchange:
pattern: ^/auth
simple-preauth:
provider: in_memory
authenticator: antenna.username_password_authenticator
web_token:
pattern: ^/api
simple-preauth:
provider: in_memory
authenticator: antenna.token_authenticator
```
| Add information about usage to readme | Add information about usage to readme
| Markdown | mit | flint/Antenna,henrikbjorn/Antenna,robinvdvleuten/Antenna | markdown | ## Code Before:
Antenna
=======
[](https://travis-ci.org/henrikbjorn/Antenna)
Recentry i had to implement authentication in an AngularJS application. For this pupose i found
https://github.com/sahat/satellizer which supports different flows of authentication, one of these
is username/password through JSON Web Token (JWT).
This small library combines firebase/php-jwt and two custom Symfony Security SimplePreAuthenticators
in order to have a simple flow.
`TokenExchangeAuthenticator` only purpose is to take the username / password provided in a JSON request and return a
valid JWT token. Depending on the way it have been setup.
`TokenAuthenticator` assumes a `Authorization: Bearer my-token` header is present and will use a `TokenUserProvider`
implementation to authenticate the User.
## Instruction:
Add information about usage to readme
## Code After:
Antenna
=======
[](https://travis-ci.org/henrikbjorn/Antenna)
Antenna is a small library that helps integrating JWT (JSON Web Token) for projects using
the Symfony Security Component.
In order to use this library you need to set up two authenticators in your firewall.
The first is `UsernamePasswordAuthenticator` which uses the security flow to authenticate through and
then "hijack" the request by rendering a body with a token `{ "token" : "json web token here" }`.
The second uses the `Authorization: Bearer <json web token>` header style to authenticate your
users by validating the JWT.
Using Symfony Standard it would look something like:
``` yaml
services:
antenna.coder:
class: Antenna\Coder
arguments: ['shared-secret']
antenna.username_password_authenticator:
class: Antenna\Security\UsernamePasswordAuthenticator
arguments: [@security.user_checker, @security.encoder_factory, @antenna.coder]
antenna.token_authenticator:
class: Antenna\Security\TokenAuthenticator
arguments: [@security.user_checker, @antenna.coder]
security:
providers:
in_memory:
memory:
users:
henrikbjorn:
password: my-unique-password
roles: 'ROLE_USER'
firewalls:
token_exchange:
pattern: ^/auth
simple-preauth:
provider: in_memory
authenticator: antenna.username_password_authenticator
web_token:
pattern: ^/api
simple-preauth:
provider: in_memory
authenticator: antenna.token_authenticator
```
| Antenna
=======
[](https://travis-ci.org/henrikbjorn/Antenna)
+ Antenna is a small library that helps integrating JWT (JSON Web Token) for projects using
+ the Symfony Security Component.
- Recentry i had to implement authentication in an AngularJS application. For this pupose i found
- https://github.com/sahat/satellizer which supports different flows of authentication, one of these
- is username/password through JSON Web Token (JWT).
+ In order to use this library you need to set up two authenticators in your firewall.
- This small library combines firebase/php-jwt and two custom Symfony Security SimplePreAuthenticators
- in order to have a simple flow.
- `TokenExchangeAuthenticator` only purpose is to take the username / password provided in a JSON request and return a
- valid JWT token. Depending on the way it have been setup.
+ The first is `UsernamePasswordAuthenticator` which uses the security flow to authenticate through and
+ then "hijack" the request by rendering a body with a token `{ "token" : "json web token here" }`.
- `TokenAuthenticator` assumes a `Authorization: Bearer my-token` header is present and will use a `TokenUserProvider`
- implementation to authenticate the User.
+ The second uses the `Authorization: Bearer <json web token>` header style to authenticate your
+ users by validating the JWT.
+
+ Using Symfony Standard it would look something like:
+
+ ``` yaml
+ services:
+ antenna.coder:
+ class: Antenna\Coder
+ arguments: ['shared-secret']
+
+ antenna.username_password_authenticator:
+ class: Antenna\Security\UsernamePasswordAuthenticator
+ arguments: [@security.user_checker, @security.encoder_factory, @antenna.coder]
+
+ antenna.token_authenticator:
+ class: Antenna\Security\TokenAuthenticator
+ arguments: [@security.user_checker, @antenna.coder]
+
+ security:
+ providers:
+ in_memory:
+ memory:
+ users:
+ henrikbjorn:
+ password: my-unique-password
+ roles: 'ROLE_USER'
+
+ firewalls:
+ token_exchange:
+ pattern: ^/auth
+ simple-preauth:
+ provider: in_memory
+ authenticator: antenna.username_password_authenticator
+ web_token:
+ pattern: ^/api
+ simple-preauth:
+ provider: in_memory
+ authenticator: antenna.token_authenticator
+ ``` | 54 | 3.176471 | 45 | 9 |
cdaaebb8891d4f022464b51efbb1a8d64efc97e6 | test/test_finder.js | test/test_finder.js | var Finder = require("../lib");
describe("Finder",function(){
describe(".find() thumbnailer",function(){
beforeEach(function(){
this.finder = new Finder("thumbnailer");
});
it("simple",function(){
return this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("/usr/bin/foo %i %o");
});
});
});
describe(".find() desktop",function(){
beforeEach(function(){
this.finder = new Finder("desktop");
});
it("simple",function(done){
this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("fooview %f");
done();
}).catch(function(e){
done(e);
});
});
});
describe(".findEntry() desktop", () => {
beforeEach(() => {
this.finder = new Finder("desktop");
});
it("simple", () => {
return this.finder.findEntry("/path/to/file.txt").then(desktop => {
expect(typeof desktop).to.equals("object");
expect(desktop['Exec']).to.equals("fooview %f");
});
});
});
})
| var Finder = require("../lib");
describe("Finder",function(){
describe(".find() thumbnailer",function(){
beforeEach(function(){
this.finder = new Finder("thumbnailer");
});
it("simple",function(){
return this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("/usr/bin/foo %i %o");
});
});
});
describe(".find() desktop",function(){
beforeEach(function(){
this.finder = new Finder("desktop");
});
it("simple",function(done){
this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("fooview %f");
done();
}).catch(function(e){
done(e);
});
});
});
describe(".findEntry() desktop", () => {
beforeEach(() => {
this.finder = new Finder("desktop");
});
it("simple", () => {
return this.finder.findEntry("/path/to/file.txt").then(desktop => {
expect(typeof desktop).to.equals("object");
expect(desktop['Exec']).to.equals("fooview %f");
});
});
it("no entry found", () => {
this.finder.findEntry("path/to/file").then(e => {
throw e;
}).catch(e => {
expect(e).to.equals(new Error("ENOTFOUND"))
});
});
});
})
| Add tests to check when any desktop files was found | Add tests to check when any desktop files was found
| JavaScript | mit | Holusion/node-xdg-apps | javascript | ## Code Before:
var Finder = require("../lib");
describe("Finder",function(){
describe(".find() thumbnailer",function(){
beforeEach(function(){
this.finder = new Finder("thumbnailer");
});
it("simple",function(){
return this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("/usr/bin/foo %i %o");
});
});
});
describe(".find() desktop",function(){
beforeEach(function(){
this.finder = new Finder("desktop");
});
it("simple",function(done){
this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("fooview %f");
done();
}).catch(function(e){
done(e);
});
});
});
describe(".findEntry() desktop", () => {
beforeEach(() => {
this.finder = new Finder("desktop");
});
it("simple", () => {
return this.finder.findEntry("/path/to/file.txt").then(desktop => {
expect(typeof desktop).to.equals("object");
expect(desktop['Exec']).to.equals("fooview %f");
});
});
});
})
## Instruction:
Add tests to check when any desktop files was found
## Code After:
var Finder = require("../lib");
describe("Finder",function(){
describe(".find() thumbnailer",function(){
beforeEach(function(){
this.finder = new Finder("thumbnailer");
});
it("simple",function(){
return this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("/usr/bin/foo %i %o");
});
});
});
describe(".find() desktop",function(){
beforeEach(function(){
this.finder = new Finder("desktop");
});
it("simple",function(done){
this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("fooview %f");
done();
}).catch(function(e){
done(e);
});
});
});
describe(".findEntry() desktop", () => {
beforeEach(() => {
this.finder = new Finder("desktop");
});
it("simple", () => {
return this.finder.findEntry("/path/to/file.txt").then(desktop => {
expect(typeof desktop).to.equals("object");
expect(desktop['Exec']).to.equals("fooview %f");
});
});
it("no entry found", () => {
this.finder.findEntry("path/to/file").then(e => {
throw e;
}).catch(e => {
expect(e).to.equals(new Error("ENOTFOUND"))
});
});
});
})
| var Finder = require("../lib");
describe("Finder",function(){
describe(".find() thumbnailer",function(){
beforeEach(function(){
this.finder = new Finder("thumbnailer");
});
it("simple",function(){
return this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("/usr/bin/foo %i %o");
});
});
});
describe(".find() desktop",function(){
beforeEach(function(){
this.finder = new Finder("desktop");
});
it("simple",function(done){
this.finder.find("/path/to/file.txt").then(function(thumbnailer){
expect(thumbnailer).to.equal("fooview %f");
done();
}).catch(function(e){
done(e);
});
});
});
describe(".findEntry() desktop", () => {
beforeEach(() => {
this.finder = new Finder("desktop");
});
it("simple", () => {
return this.finder.findEntry("/path/to/file.txt").then(desktop => {
expect(typeof desktop).to.equals("object");
expect(desktop['Exec']).to.equals("fooview %f");
});
});
+ it("no entry found", () => {
+ this.finder.findEntry("path/to/file").then(e => {
+ throw e;
+ }).catch(e => {
+ expect(e).to.equals(new Error("ENOTFOUND"))
+ });
+ });
});
}) | 7 | 0.179487 | 7 | 0 |
ced05bed8dbf556421435aa77c32ad8888c224b4 | init_deps/build.sbt | init_deps/build.sbt | scalaVersion := "2.12.1" |
scalaVersion := "2.12.1"
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3")
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.2"
libraryDependencies += "org.typelevel" %% "cats" % "0.8.1"
| Add akka, shapeless and a few others. | Add akka, shapeless and a few others.
| Scala | apache-2.0 | linkyard/docker-sbt | scala | ## Code Before:
scalaVersion := "2.12.1"
## Instruction:
Add akka, shapeless and a few others.
## Code After:
scalaVersion := "2.12.1"
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3")
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.2"
libraryDependencies += "org.typelevel" %% "cats" % "0.8.1"
| +
scalaVersion := "2.12.1"
+
+ addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
+ addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.3")
+
+ libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.2"
+ libraryDependencies += "org.typelevel" %% "cats" % "0.8.1" | 7 | 7 | 7 | 0 |
bf1517f61a018e50eb52af1eea9c30b93460b39f | hwtest/CMakeLists.txt | hwtest/CMakeLists.txt | project(ENVYTOOLS C)
cmake_minimum_required(VERSION 2.6)
option(DISABLE_HWTEST "Disable building hwtest" OFF)
if (NOT DISABLE_HWTEST)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_PCIACCESS pciaccess)
if (PC_PCIACCESS_FOUND)
add_executable(hwtest hwtest.c common.c vram.c nv01_pgraph.c nv10_tile.c nv50_ptherm.c nv84_ptherm.c punk1c1_isa.c vp2_macro.c mpeg_crypt.c)
target_link_libraries(hwtest nva nvhw m)
install(TARGETS hwtest
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
else(PC_PCIACCESS_FOUND)
message("Warning: hwtest won't be built because of un-met dependencies (pciaccess)")
endif(PC_PCIACCESS_FOUND)
endif (NOT DISABLE_HWTEST)
| project(ENVYTOOLS C)
cmake_minimum_required(VERSION 2.6)
option(DISABLE_HWTEST "Disable building hwtest" OFF)
if (NOT DISABLE_HWTEST)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_PCIACCESS pciaccess)
if (PC_PCIACCESS_FOUND)
include_directories(${PC_PCIACCESS_INCLUDE_DIRS})
link_directories(${PC_PCIACCESS_LIBRARY_DIRS})
add_executable(hwtest hwtest.c common.c vram.c nv01_pgraph.c nv10_tile.c nv50_ptherm.c nv84_ptherm.c punk1c1_isa.c vp2_macro.c mpeg_crypt.c)
target_link_libraries(hwtest nva nvhw m)
install(TARGETS hwtest
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
else(PC_PCIACCESS_FOUND)
message("Warning: hwtest won't be built because of un-met dependencies (pciaccess)")
endif(PC_PCIACCESS_FOUND)
endif (NOT DISABLE_HWTEST)
| Fix compilation with custom libpciaccess location. | hwtest: Fix compilation with custom libpciaccess location.
| Text | mit | grate-driver/envytools,pierremoreau/envytools,karolherbst/envytools,grate-driver/envytools,pierremoreau/envytools,hakzsam/envytools,envytools/envytools,grate-driver/envytools,karolherbst/envytools,kfractal/envytools,envytools/envytools,pierremoreau/envytools,karolherbst/envytools,envytools/envytools,envytools/envytools,kfractal/envytools,MoochMcGee/envytools,MoochMcGee/envytools,karolherbst/envytools,MoochMcGee/envytools,pierremoreau/envytools,hakzsam/envytools,kfractal/envytools,karolherbst/envytools,envytools/envytools,hakzsam/envytools,kfractal/envytools,pierremoreau/envytools,grate-driver/envytools,hakzsam/envytools,hakzsam/envytools,kfractal/envytools,grate-driver/envytools,MoochMcGee/envytools,MoochMcGee/envytools | text | ## Code Before:
project(ENVYTOOLS C)
cmake_minimum_required(VERSION 2.6)
option(DISABLE_HWTEST "Disable building hwtest" OFF)
if (NOT DISABLE_HWTEST)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_PCIACCESS pciaccess)
if (PC_PCIACCESS_FOUND)
add_executable(hwtest hwtest.c common.c vram.c nv01_pgraph.c nv10_tile.c nv50_ptherm.c nv84_ptherm.c punk1c1_isa.c vp2_macro.c mpeg_crypt.c)
target_link_libraries(hwtest nva nvhw m)
install(TARGETS hwtest
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
else(PC_PCIACCESS_FOUND)
message("Warning: hwtest won't be built because of un-met dependencies (pciaccess)")
endif(PC_PCIACCESS_FOUND)
endif (NOT DISABLE_HWTEST)
## Instruction:
hwtest: Fix compilation with custom libpciaccess location.
## Code After:
project(ENVYTOOLS C)
cmake_minimum_required(VERSION 2.6)
option(DISABLE_HWTEST "Disable building hwtest" OFF)
if (NOT DISABLE_HWTEST)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_PCIACCESS pciaccess)
if (PC_PCIACCESS_FOUND)
include_directories(${PC_PCIACCESS_INCLUDE_DIRS})
link_directories(${PC_PCIACCESS_LIBRARY_DIRS})
add_executable(hwtest hwtest.c common.c vram.c nv01_pgraph.c nv10_tile.c nv50_ptherm.c nv84_ptherm.c punk1c1_isa.c vp2_macro.c mpeg_crypt.c)
target_link_libraries(hwtest nva nvhw m)
install(TARGETS hwtest
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
else(PC_PCIACCESS_FOUND)
message("Warning: hwtest won't be built because of un-met dependencies (pciaccess)")
endif(PC_PCIACCESS_FOUND)
endif (NOT DISABLE_HWTEST)
| project(ENVYTOOLS C)
cmake_minimum_required(VERSION 2.6)
option(DISABLE_HWTEST "Disable building hwtest" OFF)
if (NOT DISABLE_HWTEST)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_PCIACCESS pciaccess)
if (PC_PCIACCESS_FOUND)
- add_executable(hwtest hwtest.c common.c vram.c nv01_pgraph.c nv10_tile.c nv50_ptherm.c nv84_ptherm.c punk1c1_isa.c vp2_macro.c mpeg_crypt.c)
- target_link_libraries(hwtest nva nvhw m)
+ include_directories(${PC_PCIACCESS_INCLUDE_DIRS})
+ link_directories(${PC_PCIACCESS_LIBRARY_DIRS})
+ add_executable(hwtest hwtest.c common.c vram.c nv01_pgraph.c nv10_tile.c nv50_ptherm.c nv84_ptherm.c punk1c1_isa.c vp2_macro.c mpeg_crypt.c)
+ target_link_libraries(hwtest nva nvhw m)
+
- install(TARGETS hwtest
+ install(TARGETS hwtest
? +
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION bin
? +
- LIBRARY DESTINATION lib${LIB_SUFFIX}
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
? +
- ARCHIVE DESTINATION lib${LIB_SUFFIX})
+ ARCHIVE DESTINATION lib${LIB_SUFFIX})
? +
else(PC_PCIACCESS_FOUND)
message("Warning: hwtest won't be built because of un-met dependencies (pciaccess)")
endif(PC_PCIACCESS_FOUND)
endif (NOT DISABLE_HWTEST) | 15 | 0.681818 | 9 | 6 |
957802fba61808505da79e253e83625586d4b0ea | .travis.yml | .travis.yml | language: python
# Use container-based infrastructure
sudo: false
# Those without lxml wheels first because building lxml is slow
python:
- 2.7
- 3.4
- 3.5
- 3.6
env:
- XMLPARSER=LXML
- XMLPARSER=STDLIB
install:
# Check whether to install lxml
- if [ "$XMLPARSER" == "LXML" ]; then pip install lxml; fi
- travis_retry pip install coverage
script:
- coverage run --source=gpxpy ./test.py
after_success:
- pip install coveralls
- coveralls
after_script:
- coverage report
- pip install pyflakes pycodestyle
- pyflakes . | tee >(wc -l)
- pycodestyle --statistics --count .
matrix:
fast_finish: true
| language: python
# Use container-based infrastructure
sudo: false
# Those without lxml wheels first because building lxml is slow
python:
- 2.7
- 3.4
- 3.5
- 3.6
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
env:
- XMLPARSER=LXML
- XMLPARSER=STDLIB
install:
# Check whether to install lxml
- if [ "$XMLPARSER" == "LXML" ]; then pip install lxml; fi
- travis_retry pip install coverage
script:
- coverage run --source=gpxpy ./test.py
after_success:
- pip install coveralls
- coveralls
after_script:
- coverage report
- pip install pyflakes pycodestyle
- pyflakes . | tee >(wc -l)
- pycodestyle --statistics --count .
matrix:
fast_finish: true
| Test 3.7 on Travis CI | Test 3.7 on Travis CI
| YAML | apache-2.0 | tkrajina/gpxpy | yaml | ## Code Before:
language: python
# Use container-based infrastructure
sudo: false
# Those without lxml wheels first because building lxml is slow
python:
- 2.7
- 3.4
- 3.5
- 3.6
env:
- XMLPARSER=LXML
- XMLPARSER=STDLIB
install:
# Check whether to install lxml
- if [ "$XMLPARSER" == "LXML" ]; then pip install lxml; fi
- travis_retry pip install coverage
script:
- coverage run --source=gpxpy ./test.py
after_success:
- pip install coveralls
- coveralls
after_script:
- coverage report
- pip install pyflakes pycodestyle
- pyflakes . | tee >(wc -l)
- pycodestyle --statistics --count .
matrix:
fast_finish: true
## Instruction:
Test 3.7 on Travis CI
## Code After:
language: python
# Use container-based infrastructure
sudo: false
# Those without lxml wheels first because building lxml is slow
python:
- 2.7
- 3.4
- 3.5
- 3.6
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
env:
- XMLPARSER=LXML
- XMLPARSER=STDLIB
install:
# Check whether to install lxml
- if [ "$XMLPARSER" == "LXML" ]; then pip install lxml; fi
- travis_retry pip install coverage
script:
- coverage run --source=gpxpy ./test.py
after_success:
- pip install coveralls
- coveralls
after_script:
- coverage report
- pip install pyflakes pycodestyle
- pyflakes . | tee >(wc -l)
- pycodestyle --statistics --count .
matrix:
fast_finish: true
| language: python
# Use container-based infrastructure
sudo: false
# Those without lxml wheels first because building lxml is slow
python:
- 2.7
- 3.4
- 3.5
- 3.6
+ # Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
+ matrix:
+ include:
+ - python: 3.7
+ dist: xenial
+ sudo: true
env:
- XMLPARSER=LXML
- XMLPARSER=STDLIB
install:
# Check whether to install lxml
- if [ "$XMLPARSER" == "LXML" ]; then pip install lxml; fi
- travis_retry pip install coverage
script:
- coverage run --source=gpxpy ./test.py
after_success:
- pip install coveralls
- coveralls
after_script:
- coverage report
- pip install pyflakes pycodestyle
- pyflakes . | tee >(wc -l)
- pycodestyle --statistics --count .
matrix:
fast_finish: true | 6 | 0.153846 | 6 | 0 |
cef8a1ca6923b9d662e3d1bf9b05cf8e3816b89c | ansible/roles/calorie_find/tasks/main.yml | ansible/roles/calorie_find/tasks/main.yml | ---
- name: Login into dockerhub
docker_login:
username: "{{docker_user}}"
password: "{{docker_password}}"
email: "{{docker_email}}"
tags:
- deploy
- name: Add compose
template:
src: ./templates/docker-compose.yml
dest: /tmp/docker-compose.yml
tags:
- deploy
- name: Get latest image - {{image}}
docker_image:
name: "{{image}}"
force: yes
tags:
- deploy
- name: Run staging compose
docker_service:
build: true
recreate: always
restarted: yes
project_src: /tmp/.
tags:
- deploy
| ---
- name: Login into dockerhub
docker_login:
username: "{{docker_user}}"
password: "{{docker_password}}"
email: "{{docker_email}}"
tags:
- deploy
- name: Add compose
template:
src: ./templates/docker-compose.yml
dest: /tmp/docker-compose.yml
tags:
- deploy
- name: Get latest image - {{image}}
docker_image:
name: "{{image}}"
force: yes
tags:
- deploy
- name: Get latest image - {{image_frontend}}
docker_image:
name: "{{image_frontend}}"
force: yes
tags:
- deploy
- name: Run staging compose
docker_service:
build: true
recreate: always
restarted: yes
project_src: /tmp/.
tags:
- deploy
| Add build image in ansible | Add build image in ansible
| YAML | bsd-2-clause | banjocat/calorie-find,banjocat/calorie-find | yaml | ## Code Before:
---
- name: Login into dockerhub
docker_login:
username: "{{docker_user}}"
password: "{{docker_password}}"
email: "{{docker_email}}"
tags:
- deploy
- name: Add compose
template:
src: ./templates/docker-compose.yml
dest: /tmp/docker-compose.yml
tags:
- deploy
- name: Get latest image - {{image}}
docker_image:
name: "{{image}}"
force: yes
tags:
- deploy
- name: Run staging compose
docker_service:
build: true
recreate: always
restarted: yes
project_src: /tmp/.
tags:
- deploy
## Instruction:
Add build image in ansible
## Code After:
---
- name: Login into dockerhub
docker_login:
username: "{{docker_user}}"
password: "{{docker_password}}"
email: "{{docker_email}}"
tags:
- deploy
- name: Add compose
template:
src: ./templates/docker-compose.yml
dest: /tmp/docker-compose.yml
tags:
- deploy
- name: Get latest image - {{image}}
docker_image:
name: "{{image}}"
force: yes
tags:
- deploy
- name: Get latest image - {{image_frontend}}
docker_image:
name: "{{image_frontend}}"
force: yes
tags:
- deploy
- name: Run staging compose
docker_service:
build: true
recreate: always
restarted: yes
project_src: /tmp/.
tags:
- deploy
| ---
- name: Login into dockerhub
docker_login:
username: "{{docker_user}}"
password: "{{docker_password}}"
email: "{{docker_email}}"
tags:
- deploy
- name: Add compose
template:
src: ./templates/docker-compose.yml
dest: /tmp/docker-compose.yml
tags:
- deploy
- name: Get latest image - {{image}}
docker_image:
name: "{{image}}"
force: yes
tags:
- deploy
+ - name: Get latest image - {{image_frontend}}
+ docker_image:
+ name: "{{image_frontend}}"
+ force: yes
+ tags:
+ - deploy
+
+
- name: Run staging compose
docker_service:
build: true
recreate: always
restarted: yes
project_src: /tmp/.
tags:
- deploy
| 8 | 0.216216 | 8 | 0 |
61f36892a30822a04002b0a0e3a6bf3aee52c8c4 | README.md | README.md |
[](http://www.serverless.com)
A Serverless v1.0 plugin to automatically bundle dependencies from
`requirements.txt`.
## Install
```
npm install --save serverless-python-requirements
```
Add the plugin to your `serverless.yml`:
```yaml
plugins:
- serverless-python-requirements
```
## Adding the dependencies to `sys.path`
`serverless-python-requirements` adds a module called `requirements` to your
puck. To easily make the bundled dependencies available, simply import it. Eg.
add this to the top of any file using dependencies specified in your
`requirements.txt`:
```python
import requirements
# Now you can use deps you specified in requirements.txt!
import requests
```
|
[](http://www.serverless.com)
A Serverless v1.0 plugin to automatically bundle dependencies from
`requirements.txt`.
## Install
```
npm install --save serverless-python-requirements
```
Add the plugin to your `serverless.yml`:
```yaml
plugins:
- serverless-python-requirements
```
## Adding the dependencies to `sys.path`
`serverless-python-requirements` adds a module called `requirements` to your
puck. To easily make the bundled dependencies available, simply import it. Eg.
add this to the top of any file using dependencies specified in your
`requirements.txt`:
```python
import requirements
# Now you can use deps you specified in requirements.txt!
import requests
```
## Limintations
For now this only works with pure Python modules unless running serverless on the same architeture as AWS (x86_64 Linux).
| Document pure Python (non x86_64 linux) limitation | Document pure Python (non x86_64 linux) limitation | Markdown | mit | suxor42/serverless-python-requirements,UnitedIncome/serverless-python-requirements,suxor42/serverless-python-requirements,UnitedIncome/serverless-python-requirements | markdown | ## Code Before:
[](http://www.serverless.com)
A Serverless v1.0 plugin to automatically bundle dependencies from
`requirements.txt`.
## Install
```
npm install --save serverless-python-requirements
```
Add the plugin to your `serverless.yml`:
```yaml
plugins:
- serverless-python-requirements
```
## Adding the dependencies to `sys.path`
`serverless-python-requirements` adds a module called `requirements` to your
puck. To easily make the bundled dependencies available, simply import it. Eg.
add this to the top of any file using dependencies specified in your
`requirements.txt`:
```python
import requirements
# Now you can use deps you specified in requirements.txt!
import requests
```
## Instruction:
Document pure Python (non x86_64 linux) limitation
## Code After:
[](http://www.serverless.com)
A Serverless v1.0 plugin to automatically bundle dependencies from
`requirements.txt`.
## Install
```
npm install --save serverless-python-requirements
```
Add the plugin to your `serverless.yml`:
```yaml
plugins:
- serverless-python-requirements
```
## Adding the dependencies to `sys.path`
`serverless-python-requirements` adds a module called `requirements` to your
puck. To easily make the bundled dependencies available, simply import it. Eg.
add this to the top of any file using dependencies specified in your
`requirements.txt`:
```python
import requirements
# Now you can use deps you specified in requirements.txt!
import requests
```
## Limintations
For now this only works with pure Python modules unless running serverless on the same architeture as AWS (x86_64 Linux).
|
[](http://www.serverless.com)
A Serverless v1.0 plugin to automatically bundle dependencies from
`requirements.txt`.
## Install
```
npm install --save serverless-python-requirements
```
Add the plugin to your `serverless.yml`:
```yaml
plugins:
- serverless-python-requirements
```
## Adding the dependencies to `sys.path`
`serverless-python-requirements` adds a module called `requirements` to your
puck. To easily make the bundled dependencies available, simply import it. Eg.
add this to the top of any file using dependencies specified in your
`requirements.txt`:
```python
import requirements
# Now you can use deps you specified in requirements.txt!
import requests
```
+
+ ## Limintations
+
+ For now this only works with pure Python modules unless running serverless on the same architeture as AWS (x86_64 Linux). | 4 | 0.125 | 4 | 0 |
34b53c59815d6cd195753c76268bc2ea09517af3 | data/tree/RedHat/RedHat/7.0.yaml | data/tree/RedHat/RedHat/7.0.yaml | ---
# vim: ts=8
| ---
gluster::params::package_python_argparse: '' # doesn't exist
gluster::params::misc_gluster_reload: '/usr/bin/systemctl reload glusterd'
# vim: ts=8
| Update data file for RHEL7. | Update data file for RHEL7.
| YAML | agpl-3.0 | rdo-puppet-modules/puppet-gluster,pdrakeweb/puppet-gluster,purpleidea/puppet-gluster,RewardGateway/puppet-gluster,pdrakeweb/puppet-gluster,rdo-puppet-modules/puppet-gluster,purpleidea/puppet-gluster,pulecp/puppet-gluster,derjohn/puppet-gluster,derjohn/puppet-gluster,RewardGateway/puppet-gluster,RewardGateway/puppet-gluster,derjohn/puppet-gluster,purpleidea/puppet-gluster,pdrakeweb/puppet-gluster,pulecp/puppet-gluster,pulecp/puppet-gluster,rdo-puppet-modules/puppet-gluster | yaml | ## Code Before:
---
# vim: ts=8
## Instruction:
Update data file for RHEL7.
## Code After:
---
gluster::params::package_python_argparse: '' # doesn't exist
gluster::params::misc_gluster_reload: '/usr/bin/systemctl reload glusterd'
# vim: ts=8
| ---
+ gluster::params::package_python_argparse: '' # doesn't exist
+ gluster::params::misc_gluster_reload: '/usr/bin/systemctl reload glusterd'
# vim: ts=8 | 2 | 0.666667 | 2 | 0 |
5a20e27700819a737f4d0942e03adcb5b7b4f44f | applications/opibuilder/opibuilder-repository/category.xml | applications/opibuilder/opibuilder-repository/category.xml | <?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="org.csstudio.applications.opibuilder.feature">
<category name="org.csstudio.category.applications"/>
</feature>
<category-def name="org.csstudio.category.applications" label="CS-Studio Applications"/>
</site>
| <?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="org.csstudio.applications.opibuilder.feature">
<category name="org.csstudio.category.applications"/>
</feature>
<feature id="org.csstudio.applications.opibuilder.rap.feature">
<category name="org.csstudio.category.applications"/>
</feature>
<category-def name="org.csstudio.category.applications" label="CS-Studio Applications"/>
</site>
| Add the rap feature back to the repository. | Add the rap feature back to the repository.
| XML | epl-1.0 | ControlSystemStudio/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,ControlSystemStudio/cs-studio,ESSICS/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,css-iter/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,ControlSystemStudio/cs-studio,css-iter/cs-studio,ESSICS/cs-studio,css-iter/cs-studio,css-iter/cs-studio | xml | ## Code Before:
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="org.csstudio.applications.opibuilder.feature">
<category name="org.csstudio.category.applications"/>
</feature>
<category-def name="org.csstudio.category.applications" label="CS-Studio Applications"/>
</site>
## Instruction:
Add the rap feature back to the repository.
## Code After:
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="org.csstudio.applications.opibuilder.feature">
<category name="org.csstudio.category.applications"/>
</feature>
<feature id="org.csstudio.applications.opibuilder.rap.feature">
<category name="org.csstudio.category.applications"/>
</feature>
<category-def name="org.csstudio.category.applications" label="CS-Studio Applications"/>
</site>
| <?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="org.csstudio.applications.opibuilder.feature">
<category name="org.csstudio.category.applications"/>
</feature>
+ <feature id="org.csstudio.applications.opibuilder.rap.feature">
+ <category name="org.csstudio.category.applications"/>
+ </feature>
<category-def name="org.csstudio.category.applications" label="CS-Studio Applications"/>
</site> | 3 | 0.428571 | 3 | 0 |
81e3425bc6b2b9b35071afd7c14322f0dd52b418 | oneanddone/tests/functional/tests/test_task_assignment.py | oneanddone/tests/functional/tests/test_task_assignment.py |
import pytest
from pages.home import HomePage
class TestAvailableTasks():
@pytest.mark.nondestructive
def test_assign_tasks(self, base_url, selenium, nonrepeatable_assigned_task, new_user):
home_page = HomePage(selenium, base_url).open()
home_page.login(new_user)
available_tasks_page = home_page.click_available_tasks()
home_page.search_for_task(nonrepeatable_assigned_task.name)
assert len(available_tasks_page.available_tasks) == 0
|
import pytest
from pages.home import HomePage
class TestAvailableTasks():
@pytest.mark.nondestructive
def test_assign_tasks(self, base_url, selenium, nonrepeatable_assigned_task, task, new_user):
home_page = HomePage(selenium, base_url).open()
home_page.login(new_user)
available_tasks_page = home_page.click_available_tasks()
# Check if assignable task is found
home_page.search_for_task(task.name)
assert len(available_tasks_page.available_tasks)
home_page.search_for_task(nonrepeatable_assigned_task.name)
assert len(available_tasks_page.available_tasks) == 0
| Add positive test for search | Add positive test for search
| Python | mpl-2.0 | VarnaSuresh/oneanddone,VarnaSuresh/oneanddone,VarnaSuresh/oneanddone,VarnaSuresh/oneanddone | python | ## Code Before:
import pytest
from pages.home import HomePage
class TestAvailableTasks():
@pytest.mark.nondestructive
def test_assign_tasks(self, base_url, selenium, nonrepeatable_assigned_task, new_user):
home_page = HomePage(selenium, base_url).open()
home_page.login(new_user)
available_tasks_page = home_page.click_available_tasks()
home_page.search_for_task(nonrepeatable_assigned_task.name)
assert len(available_tasks_page.available_tasks) == 0
## Instruction:
Add positive test for search
## Code After:
import pytest
from pages.home import HomePage
class TestAvailableTasks():
@pytest.mark.nondestructive
def test_assign_tasks(self, base_url, selenium, nonrepeatable_assigned_task, task, new_user):
home_page = HomePage(selenium, base_url).open()
home_page.login(new_user)
available_tasks_page = home_page.click_available_tasks()
# Check if assignable task is found
home_page.search_for_task(task.name)
assert len(available_tasks_page.available_tasks)
home_page.search_for_task(nonrepeatable_assigned_task.name)
assert len(available_tasks_page.available_tasks) == 0
|
import pytest
from pages.home import HomePage
class TestAvailableTasks():
@pytest.mark.nondestructive
- def test_assign_tasks(self, base_url, selenium, nonrepeatable_assigned_task, new_user):
+ def test_assign_tasks(self, base_url, selenium, nonrepeatable_assigned_task, task, new_user):
? ++++++
home_page = HomePage(selenium, base_url).open()
home_page.login(new_user)
available_tasks_page = home_page.click_available_tasks()
+
+ # Check if assignable task is found
+ home_page.search_for_task(task.name)
+ assert len(available_tasks_page.available_tasks)
+
home_page.search_for_task(nonrepeatable_assigned_task.name)
assert len(available_tasks_page.available_tasks) == 0 | 7 | 0.5 | 6 | 1 |
5d6d8bce983a6614a956ed81816914386d08e4b4 | src/main.cpp | src/main.cpp |
int main(int argc, char *argv[])
{
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
app.setOrganizationName("lpd8-editor");
app.setApplicationName("lpd8-editor");
app.setApplicationVersion("0.0.0");
Application application;
MainWindow win(&application);
win.show();
// Application app;
return app.exec();
}
|
int main(int argc, char *argv[])
{
#if QT_VERSION >= 0x050600
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
app.setOrganizationName("lpd8-editor");
app.setApplicationName("lpd8-editor");
app.setApplicationVersion("0.0.0");
Application application;
MainWindow win(&application);
win.show();
return app.exec();
}
| Enable HiDPI rendering if supported | Enable HiDPI rendering if supported
| C++ | mit | charlesfleche/lpd8-editor,charlesfleche/lpd8-editor | c++ | ## Code Before:
int main(int argc, char *argv[])
{
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
app.setOrganizationName("lpd8-editor");
app.setApplicationName("lpd8-editor");
app.setApplicationVersion("0.0.0");
Application application;
MainWindow win(&application);
win.show();
// Application app;
return app.exec();
}
## Instruction:
Enable HiDPI rendering if supported
## Code After:
int main(int argc, char *argv[])
{
#if QT_VERSION >= 0x050600
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
app.setOrganizationName("lpd8-editor");
app.setApplicationName("lpd8-editor");
app.setApplicationVersion("0.0.0");
Application application;
MainWindow win(&application);
win.show();
return app.exec();
}
|
int main(int argc, char *argv[])
{
+ #if QT_VERSION >= 0x050600
- // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
? --
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ #endif
QApplication app(argc, argv);
app.setOrganizationName("lpd8-editor");
app.setApplicationName("lpd8-editor");
app.setApplicationVersion("0.0.0");
Application application;
MainWindow win(&application);
win.show();
- // Application app;
-
return app.exec();
} | 6 | 0.333333 | 3 | 3 |
a89b22e960745dfc76dff7becfabb04281bfe11d | .eslintrc.js | .eslintrc.js | module.exports = {
extends: "airbnb",
globals: {
Urls: true
},
env: {
browser: true
},
rules: {
"react/jsx-filename-extension": [
1,
{
extensions: [
".js",
".jsx"
]
}
]
},
settings: {
"import/resolver": {
webpack: {
config: "webpack.config.js"
}
}
}
}
| module.exports = {
extends: "airbnb",
globals: {
Urls: true
},
env: {
browser: true,
jest: true
},
rules: {
"react/jsx-filename-extension": [
1,
{
extensions: [
".js",
".jsx"
]
}
]
},
settings: {
"import/resolver": {
webpack: {
config: "webpack.config.js"
}
}
}
}
| Add jest to eslint env | Add jest to eslint env
| JavaScript | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | javascript | ## Code Before:
module.exports = {
extends: "airbnb",
globals: {
Urls: true
},
env: {
browser: true
},
rules: {
"react/jsx-filename-extension": [
1,
{
extensions: [
".js",
".jsx"
]
}
]
},
settings: {
"import/resolver": {
webpack: {
config: "webpack.config.js"
}
}
}
}
## Instruction:
Add jest to eslint env
## Code After:
module.exports = {
extends: "airbnb",
globals: {
Urls: true
},
env: {
browser: true,
jest: true
},
rules: {
"react/jsx-filename-extension": [
1,
{
extensions: [
".js",
".jsx"
]
}
]
},
settings: {
"import/resolver": {
webpack: {
config: "webpack.config.js"
}
}
}
}
| module.exports = {
extends: "airbnb",
globals: {
Urls: true
},
env: {
- browser: true
+ browser: true,
? +
+ jest: true
},
rules: {
"react/jsx-filename-extension": [
1,
{
extensions: [
".js",
".jsx"
]
}
]
},
settings: {
"import/resolver": {
webpack: {
config: "webpack.config.js"
}
}
}
} | 3 | 0.111111 | 2 | 1 |
9af50ecde67e593533898040e63e6a456fc16da5 | tests/test_style.py | tests/test_style.py | import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
flake8([])
except SystemExit as e:
if e.code != 0:
self.fail('Code style checks failed')
| import logging
import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
logger = logging.getLogger('flake8')
logger.setLevel(logging.ERROR)
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
flake8([])
except SystemExit as e:
if e.code != 0:
self.fail('Code style checks failed')
| Decrease noise from code-style test | Decrease noise from code-style test
| Python | mit | ministryofjustice/django-zendesk-tickets,ministryofjustice/django-zendesk-tickets | python | ## Code Before:
import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
flake8([])
except SystemExit as e:
if e.code != 0:
self.fail('Code style checks failed')
## Instruction:
Decrease noise from code-style test
## Code After:
import logging
import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
logger = logging.getLogger('flake8')
logger.setLevel(logging.ERROR)
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
flake8([])
except SystemExit as e:
if e.code != 0:
self.fail('Code style checks failed')
| + import logging
import pkg_resources
import unittest
class CodeStyleTestCase(unittest.TestCase):
def test_code_style(self):
+ logger = logging.getLogger('flake8')
+ logger.setLevel(logging.ERROR)
flake8 = pkg_resources.load_entry_point('flake8', 'console_scripts', 'flake8')
try:
flake8([])
except SystemExit as e:
if e.code != 0:
self.fail('Code style checks failed') | 3 | 0.25 | 3 | 0 |
2d9b858c7d447a9169b54900940b56ed2908bebd | app/controllers/save_controller.rb | app/controllers/save_controller.rb | class SaveController < BaseController
def viewDidLoad
super
self.view.backgroundColor = UIColor.purpleColor
self.title = "Save"
end
def viewDidAppear(animated)
height = { quantity_type: :height, quantity: 77, unit: "inch" }
Medic.save(height) do |success, error|
NSLog "Saved sample" unless error
end
end
end
| class SaveController < BaseController
def viewDidLoad
super
self.view.backgroundColor = UIColor.purpleColor
self.title = "Save"
end
def viewDidAppear(animated)
blood_pressure = {
correlation_type: :blood_pressure,
objects: [
{
quantity_type: :blood_pressure_systolic,
quantity: 120
},
{
quantity_type: :blood_pressure_diastolic,
quantity: 80
}
]
}
Medic.save(blood_pressure) do |success, error|
NSLog "Saved sample" unless error
end
end
end
| Use correlation example in save controller to demonstrate saving both correlations and quantities | Use correlation example in save controller to demonstrate saving both correlations and quantities
| Ruby | mit | ryanlntn/medic | ruby | ## Code Before:
class SaveController < BaseController
def viewDidLoad
super
self.view.backgroundColor = UIColor.purpleColor
self.title = "Save"
end
def viewDidAppear(animated)
height = { quantity_type: :height, quantity: 77, unit: "inch" }
Medic.save(height) do |success, error|
NSLog "Saved sample" unless error
end
end
end
## Instruction:
Use correlation example in save controller to demonstrate saving both correlations and quantities
## Code After:
class SaveController < BaseController
def viewDidLoad
super
self.view.backgroundColor = UIColor.purpleColor
self.title = "Save"
end
def viewDidAppear(animated)
blood_pressure = {
correlation_type: :blood_pressure,
objects: [
{
quantity_type: :blood_pressure_systolic,
quantity: 120
},
{
quantity_type: :blood_pressure_diastolic,
quantity: 80
}
]
}
Medic.save(blood_pressure) do |success, error|
NSLog "Saved sample" unless error
end
end
end
| class SaveController < BaseController
def viewDidLoad
super
self.view.backgroundColor = UIColor.purpleColor
self.title = "Save"
end
def viewDidAppear(animated)
- height = { quantity_type: :height, quantity: 77, unit: "inch" }
+ blood_pressure = {
+ correlation_type: :blood_pressure,
+ objects: [
+ {
+ quantity_type: :blood_pressure_systolic,
+ quantity: 120
+ },
+ {
+ quantity_type: :blood_pressure_diastolic,
+ quantity: 80
+ }
+ ]
+ }
- Medic.save(height) do |success, error|
? ^ ^^^^
+ Medic.save(blood_pressure) do |success, error|
? ^^^^^^^^ ^^^^^
NSLog "Saved sample" unless error
end
end
end | 16 | 0.941176 | 14 | 2 |
9acb51cda733751729fbe33c29c666c40cbdae35 | src/Header/index.js | src/Header/index.js | import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} />
}
return (
<header className="masthead" style={{backgroundColor: '#4C5664'}}>
<div className="container">
<a href={this.props.config.rootUrl} className="masthead-logo">{this.props.config.name}</a>
{navMenu}
</div>
</header>
);
}
}
| import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} />
}
return (
<header className="masthead" style={{backgroundColor: this.props.config.headerColor}}>
<div className="container">
<a href={this.props.config.rootUrl} className="masthead-logo">{this.props.config.name}</a>
{navMenu}
</div>
</header>
);
}
}
| Add header background color based on config | Add header background color based on config
| JavaScript | apache-2.0 | naltaki/naltaki-front,naltaki/naltaki-front | javascript | ## Code Before:
import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} />
}
return (
<header className="masthead" style={{backgroundColor: '#4C5664'}}>
<div className="container">
<a href={this.props.config.rootUrl} className="masthead-logo">{this.props.config.name}</a>
{navMenu}
</div>
</header>
);
}
}
## Instruction:
Add header background color based on config
## Code After:
import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} />
}
return (
<header className="masthead" style={{backgroundColor: this.props.config.headerColor}}>
<div className="container">
<a href={this.props.config.rootUrl} className="masthead-logo">{this.props.config.name}</a>
{navMenu}
</div>
</header>
);
}
}
| import React from 'react';
import NavMenu from './NavMenu';
export default class Header extends React.Component {
constructor(props) {
super(props);
}
render() {
let navMenu;
if (this.props.config.headerMenuLinks.length > 0) {
navMenu = <NavMenu links={this.props.config.headerMenuLinks} />
}
return (
- <header className="masthead" style={{backgroundColor: '#4C5664'}}>
? ^^^ ^^^^^
+ <header className="masthead" style={{backgroundColor: this.props.config.headerColor}}>
? ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^
<div className="container">
<a href={this.props.config.rootUrl} className="masthead-logo">{this.props.config.name}</a>
{navMenu}
</div>
</header>
);
}
} | 2 | 0.08 | 1 | 1 |
076f526e2cb8c12cdb3b87d1fd2e1be914e31bf7 | README.md | README.md |
A test task for the implementation of the food basket. The application is built on the stack React + Redux. For convenience, the data is stored in localStorage.
DEMO: http://product-cart.shtykov.com/
### **1. Install git**
Go to [git site](https://git-scm.com/downloads) and download/install a version for your OS
### **2. Install node**
Go to [Node JS](https://nodejs.org/en/) site and pick the last version
### **3. Clone the repository and install dependencies**
git clone https://github.com/shtbik/product-cart.git
cd product-cart
yarn add --global webpack babel
yarn add --global --production windows-build-tools (for node-sass windows user)
yarn install
yarn start
go to http://localhost:3000/
|
An implementation of the food basket. The application is built using the React + Redux stack. All the data is stored in localStorage for testing purposes.
LIVE DEMO: http://product-cart.shtykov.com/

### **1. Install git**
Go to [git site](https://git-scm.com/downloads) and download/install a version for your OS
### **2. Install node**
Go to [Node JS](https://nodejs.org/en/) site and pick the latest version
### **3. Clone the repository and install dependencies**
git clone https://github.com/shtbik/product-cart.git
cd product-cart
yarn add --global webpack babel
yarn add --global --production windows-build-tools (for node-sass windows user)
yarn install
yarn start
go to http://localhost:3000/ | Add picture to Readme.md and fix errors | Add picture to Readme.md and fix errors
| Markdown | mit | shtbik/ProductCart,shtbik/ProductCart | markdown | ## Code Before:
A test task for the implementation of the food basket. The application is built on the stack React + Redux. For convenience, the data is stored in localStorage.
DEMO: http://product-cart.shtykov.com/
### **1. Install git**
Go to [git site](https://git-scm.com/downloads) and download/install a version for your OS
### **2. Install node**
Go to [Node JS](https://nodejs.org/en/) site and pick the last version
### **3. Clone the repository and install dependencies**
git clone https://github.com/shtbik/product-cart.git
cd product-cart
yarn add --global webpack babel
yarn add --global --production windows-build-tools (for node-sass windows user)
yarn install
yarn start
go to http://localhost:3000/
## Instruction:
Add picture to Readme.md and fix errors
## Code After:
An implementation of the food basket. The application is built using the React + Redux stack. All the data is stored in localStorage for testing purposes.
LIVE DEMO: http://product-cart.shtykov.com/

### **1. Install git**
Go to [git site](https://git-scm.com/downloads) and download/install a version for your OS
### **2. Install node**
Go to [Node JS](https://nodejs.org/en/) site and pick the latest version
### **3. Clone the repository and install dependencies**
git clone https://github.com/shtbik/product-cart.git
cd product-cart
yarn add --global webpack babel
yarn add --global --production windows-build-tools (for node-sass windows user)
yarn install
yarn start
go to http://localhost:3000/ |
- A test task for the implementation of the food basket. The application is built on the stack React + Redux. For convenience, the data is stored in localStorage.
? ^^^^^^^^^^^^^^^^^^ ^ ------ ^^^^^^^^^^^^^^^^
+ An implementation of the food basket. The application is built using the React + Redux stack. All the data is stored in localStorage for testing purposes.
? ^ ^^^ + ++++++ ^^^ +++++++++++++++++++++
- DEMO: http://product-cart.shtykov.com/
+ LIVE DEMO: http://product-cart.shtykov.com/
? +++++
+
+ 
### **1. Install git**
Go to [git site](https://git-scm.com/downloads) and download/install a version for your OS
### **2. Install node**
- Go to [Node JS](https://nodejs.org/en/) site and pick the last version
+ Go to [Node JS](https://nodejs.org/en/) site and pick the latest version
? ++
### **3. Clone the repository and install dependencies**
git clone https://github.com/shtbik/product-cart.git
cd product-cart
yarn add --global webpack babel
yarn add --global --production windows-build-tools (for node-sass windows user)
yarn install
yarn start
go to http://localhost:3000/ | 8 | 0.421053 | 5 | 3 |
e2399c0f56ef63e8574ff85c424112e095271f4b | apis/Google.Cloud.Kms.V1/docs/index.md | apis/Google.Cloud.Kms.V1/docs/index.md | {{title}}
{{description}}
{{version}}
{{installation}}
{{auth}}
# Getting started
{{client-classes}}
{{client-construction}}
# Sample code
This example lists all the key rings in the "global" location for a specific project.
{{sample:KeyManagementServiceClient.ListGlobalKeyRings}}
| {{title}}
{{description}}
{{version}}
{{installation}}
{{auth}}
# Getting started
{{client-classes}}
{{client-construction}}
# Sample code
This example lists all the key rings in the "global" location for a specific project.
{{sample:KeyManagementServiceClient.ListGlobalKeyRings}}
For further information and examples, see the [main Cloud KMS
documentation](https://cloud.google.com/kms/docs/reference/libraries#client-libraries-install-csharp).
| Update the Cloud KMS documentation to link to the main site | Update the Cloud KMS documentation to link to the main site
This avoids duplicating a lot of samples within our page.
| Markdown | apache-2.0 | googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/gcloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet | markdown | ## Code Before:
{{title}}
{{description}}
{{version}}
{{installation}}
{{auth}}
# Getting started
{{client-classes}}
{{client-construction}}
# Sample code
This example lists all the key rings in the "global" location for a specific project.
{{sample:KeyManagementServiceClient.ListGlobalKeyRings}}
## Instruction:
Update the Cloud KMS documentation to link to the main site
This avoids duplicating a lot of samples within our page.
## Code After:
{{title}}
{{description}}
{{version}}
{{installation}}
{{auth}}
# Getting started
{{client-classes}}
{{client-construction}}
# Sample code
This example lists all the key rings in the "global" location for a specific project.
{{sample:KeyManagementServiceClient.ListGlobalKeyRings}}
For further information and examples, see the [main Cloud KMS
documentation](https://cloud.google.com/kms/docs/reference/libraries#client-libraries-install-csharp).
| {{title}}
{{description}}
{{version}}
{{installation}}
{{auth}}
# Getting started
{{client-classes}}
{{client-construction}}
# Sample code
This example lists all the key rings in the "global" location for a specific project.
{{sample:KeyManagementServiceClient.ListGlobalKeyRings}}
+
+ For further information and examples, see the [main Cloud KMS
+ documentation](https://cloud.google.com/kms/docs/reference/libraries#client-libraries-install-csharp). | 3 | 0.142857 | 3 | 0 |
2c28c415d33ffd0810386857c2b2ac36c92ff420 | parliament/templates/alerts/politician.txt | parliament/templates/alerts/politician.txt | {% autoescape off %}Here's what {{ alert.politician.name }} had to say in the House of Commons.
{% for statement in statements %}
{{ statement.time|date:"F jS, P" }}
{{ statement.topic }}
http://openparliament.ca{{ statement.get_absolute_url }}
----------------------------------------------------------
{{ statement.text_plain|wordwrap:78 }}
{% endfor %}
************
You're receiving this e-mail because you signed up at openparliament.ca to
receive alerts about {{ alert.politician.name }}.
If you no longer want to receive these messages, just follow the link below:
http://openparliament.ca{{ alert.get_unsubscribe_url }}
love,
openparliament.ca
{% endautoescape %} | {% autoescape off %}{% filter wordwrap:76 %}Here's what {{ alert.politician.name }} had to say in the House of Commons.
{% for statement in statements %}
{{ statement.time|date:"F jS, P" }}
{{ statement.topic }}
http://openparliament.ca{{ statement.get_absolute_url }}
----------------------------------------------------------
{{ statement.text_plain }}
{% endfor %}
************
You're receiving this e-mail because you signed up at openparliament.ca to
receive alerts about {{ alert.politician.name }}.
If you no longer want to receive these messages, just follow the link below:
http://openparliament.ca{{ alert.get_unsubscribe_url }}
love,
openparliament.ca
{% endfilter %}{% endautoescape %} | Change wordwrap on alert e-mails | Change wordwrap on alert e-mails
| Text | agpl-3.0 | twhyte/openparliament,litui/openparliament,rhymeswithcycle/openparliament,rhymeswithcycle/openparliament,litui/openparliament,rhymeswithcycle/openparliament,twhyte/openparliament,litui/openparliament,twhyte/openparliament | text | ## Code Before:
{% autoescape off %}Here's what {{ alert.politician.name }} had to say in the House of Commons.
{% for statement in statements %}
{{ statement.time|date:"F jS, P" }}
{{ statement.topic }}
http://openparliament.ca{{ statement.get_absolute_url }}
----------------------------------------------------------
{{ statement.text_plain|wordwrap:78 }}
{% endfor %}
************
You're receiving this e-mail because you signed up at openparliament.ca to
receive alerts about {{ alert.politician.name }}.
If you no longer want to receive these messages, just follow the link below:
http://openparliament.ca{{ alert.get_unsubscribe_url }}
love,
openparliament.ca
{% endautoescape %}
## Instruction:
Change wordwrap on alert e-mails
## Code After:
{% autoescape off %}{% filter wordwrap:76 %}Here's what {{ alert.politician.name }} had to say in the House of Commons.
{% for statement in statements %}
{{ statement.time|date:"F jS, P" }}
{{ statement.topic }}
http://openparliament.ca{{ statement.get_absolute_url }}
----------------------------------------------------------
{{ statement.text_plain }}
{% endfor %}
************
You're receiving this e-mail because you signed up at openparliament.ca to
receive alerts about {{ alert.politician.name }}.
If you no longer want to receive these messages, just follow the link below:
http://openparliament.ca{{ alert.get_unsubscribe_url }}
love,
openparliament.ca
{% endfilter %}{% endautoescape %} | - {% autoescape off %}Here's what {{ alert.politician.name }} had to say in the House of Commons.
+ {% autoescape off %}{% filter wordwrap:76 %}Here's what {{ alert.politician.name }} had to say in the House of Commons.
? ++++++++++++++++++++++++
{% for statement in statements %}
{{ statement.time|date:"F jS, P" }}
{{ statement.topic }}
http://openparliament.ca{{ statement.get_absolute_url }}
----------------------------------------------------------
- {{ statement.text_plain|wordwrap:78 }}
? ------------
+ {{ statement.text_plain }}
{% endfor %}
************
You're receiving this e-mail because you signed up at openparliament.ca to
receive alerts about {{ alert.politician.name }}.
If you no longer want to receive these messages, just follow the link below:
http://openparliament.ca{{ alert.get_unsubscribe_url }}
love,
openparliament.ca
- {% endautoescape %}
+ {% endfilter %}{% endautoescape %} | 6 | 0.272727 | 3 | 3 |
7060a7c85cf82fae9e018f1c82a1d8181bd5214d | library/tests/factories.py | library/tests/factories.py | from django.conf import settings
import factory
from factory.fuzzy import FuzzyText
from ..models import Book, BookSpecimen
class BookFactory(factory.django.DjangoModelFactory):
title = factory.Sequence(lambda n: "Test book %03d" % n)
summary = "This is a test summary"
section = 1
lang = settings.LANGUAGE_CODE
class Meta:
model = Book
class BookSpecimenFactory(factory.django.DjangoModelFactory):
serial = FuzzyText(length=6)
book = factory.SubFactory(BookFactory)
class Meta:
model = BookSpecimen
| from django.conf import settings
import factory
from factory.fuzzy import FuzzyText
from ..models import Book, BookSpecimen
class BookFactory(factory.django.DjangoModelFactory):
title = factory.Sequence(lambda n: "Test book {0}".format(n))
summary = "This is a test summary"
section = 1
lang = settings.LANGUAGE_CODE
class Meta:
model = Book
class BookSpecimenFactory(factory.django.DjangoModelFactory):
serial = FuzzyText(length=6)
book = factory.SubFactory(BookFactory)
class Meta:
model = BookSpecimen
| Use format for string formatting | Use format for string formatting
| Python | agpl-3.0 | Lcaracol/ideasbox.lan,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,Lcaracol/ideasbox.lan,ideascube/ideascube,Lcaracol/ideasbox.lan | python | ## Code Before:
from django.conf import settings
import factory
from factory.fuzzy import FuzzyText
from ..models import Book, BookSpecimen
class BookFactory(factory.django.DjangoModelFactory):
title = factory.Sequence(lambda n: "Test book %03d" % n)
summary = "This is a test summary"
section = 1
lang = settings.LANGUAGE_CODE
class Meta:
model = Book
class BookSpecimenFactory(factory.django.DjangoModelFactory):
serial = FuzzyText(length=6)
book = factory.SubFactory(BookFactory)
class Meta:
model = BookSpecimen
## Instruction:
Use format for string formatting
## Code After:
from django.conf import settings
import factory
from factory.fuzzy import FuzzyText
from ..models import Book, BookSpecimen
class BookFactory(factory.django.DjangoModelFactory):
title = factory.Sequence(lambda n: "Test book {0}".format(n))
summary = "This is a test summary"
section = 1
lang = settings.LANGUAGE_CODE
class Meta:
model = Book
class BookSpecimenFactory(factory.django.DjangoModelFactory):
serial = FuzzyText(length=6)
book = factory.SubFactory(BookFactory)
class Meta:
model = BookSpecimen
| from django.conf import settings
import factory
from factory.fuzzy import FuzzyText
from ..models import Book, BookSpecimen
class BookFactory(factory.django.DjangoModelFactory):
- title = factory.Sequence(lambda n: "Test book %03d" % n)
? ^ ^^ ^^^
+ title = factory.Sequence(lambda n: "Test book {0}".format(n))
? ^ ^ ^^^^^^^^ +
summary = "This is a test summary"
section = 1
lang = settings.LANGUAGE_CODE
class Meta:
model = Book
class BookSpecimenFactory(factory.django.DjangoModelFactory):
serial = FuzzyText(length=6)
book = factory.SubFactory(BookFactory)
class Meta:
model = BookSpecimen | 2 | 0.08 | 1 | 1 |
e18cd5c60b10f3f2f4838f4080bd10a5d540ebf3 | lib/tasks/open_conference_ware_tasks.rake | lib/tasks/open_conference_ware_tasks.rake | namespace :open_conference_ware do
desc %{Setup application's database and seed data}
task :setup => ['db:migrate', 'db:seed'] do
puts <<-HERE
TO FINISH SETUP
1. See README.markdown for information about security and customization
2. Start the server, e.g.: bin/rails server
3. Sign in as an admin in development mode
4. Use the web-based admin interface to create and configure an event
HERE
end
end
| namespace :open_conference_ware do
desc %{Setup application's database and seed data}
task :setup => ['db:migrate', 'db:seed'] do
puts <<-HERE
TO FINISH SETUP
1. See README.markdown for information about security and customization
2. Start the server, e.g.: bin/rails server
3. Sign in as an admin in development mode
4. Use the web-based admin interface to create and configure an event
HERE
end
end
Rake::Task["open_conference_ware:install:migrations"].clear
| Remove the install:migrations rake task | Remove the install:migrations rake task
We're automatically appending our migrations to the host app, to allow
for easier iteration.
| Ruby | mit | ondrocks/openconferenceware,osbridge/openconferenceware,ondrocks/openconferenceware,mynameisfashanu/openconferenceware,mynameisfashanu/openconferenceware,osbridge/openconferenceware,ondrocks/openconferenceware,osbridge/openconferenceware,ondrocks/openconferenceware,osbridge/openconferenceware,mynameisfashanu/openconferenceware,mynameisfashanu/openconferenceware | ruby | ## Code Before:
namespace :open_conference_ware do
desc %{Setup application's database and seed data}
task :setup => ['db:migrate', 'db:seed'] do
puts <<-HERE
TO FINISH SETUP
1. See README.markdown for information about security and customization
2. Start the server, e.g.: bin/rails server
3. Sign in as an admin in development mode
4. Use the web-based admin interface to create and configure an event
HERE
end
end
## Instruction:
Remove the install:migrations rake task
We're automatically appending our migrations to the host app, to allow
for easier iteration.
## Code After:
namespace :open_conference_ware do
desc %{Setup application's database and seed data}
task :setup => ['db:migrate', 'db:seed'] do
puts <<-HERE
TO FINISH SETUP
1. See README.markdown for information about security and customization
2. Start the server, e.g.: bin/rails server
3. Sign in as an admin in development mode
4. Use the web-based admin interface to create and configure an event
HERE
end
end
Rake::Task["open_conference_ware:install:migrations"].clear
| namespace :open_conference_ware do
desc %{Setup application's database and seed data}
task :setup => ['db:migrate', 'db:seed'] do
puts <<-HERE
TO FINISH SETUP
1. See README.markdown for information about security and customization
2. Start the server, e.g.: bin/rails server
3. Sign in as an admin in development mode
4. Use the web-based admin interface to create and configure an event
HERE
end
end
+ Rake::Task["open_conference_ware:install:migrations"].clear | 1 | 0.071429 | 1 | 0 |
87f1f72d973d0a46833ef1e0277d8d34033bd6e1 | discrank/requirements.txt | discrank/requirements.txt | https://github.com/jkchen2/Riot-Watcher/archive/master.zip
requests
| https://github.com/pseudonym117/Riot-Watcher/archive/master.zip
requests
| Use official Riot Watcher repository | Use official Riot Watcher repository
It's about time | Text | mit | jkchen2/JshBot-plugins | text | ## Code Before:
https://github.com/jkchen2/Riot-Watcher/archive/master.zip
requests
## Instruction:
Use official Riot Watcher repository
It's about time
## Code After:
https://github.com/pseudonym117/Riot-Watcher/archive/master.zip
requests
| - https://github.com/jkchen2/Riot-Watcher/archive/master.zip
? ^^^^ ^
+ https://github.com/pseudonym117/Riot-Watcher/archive/master.zip
? ^^ +++ ^^^^^
requests | 2 | 1 | 1 | 1 |
ccc5a680bc1b63a3b13c59a33cf83116a386c995 | README.rst | README.rst |
{<img src="https://secure.travis-ci.org/pyinvoke/invoke.png?branch=master" alt="Build Status" />}[http://travis-ci.org/pyinvoke/invoke]
Invoke is a Python (2.6+) task execution and management tool. It's similar to
pre-existing tools in other languages (such as Make or Rake) but lets you
interface easily with Python codebases, and of course write your tasks
themselves in straight-up Python.
For documentation, including detailed installation information, please see
http://docs.pyinvoke.org. Post-install usage information may be found in ``invoke
--help``.
You can install the `development version
<https://github.com/pyinvoke/invoke/tarball/master#egg=invoke-dev>`_ via ``pip
install invoke==dev``.
| Invoke is a Python (2.6+) task execution and management tool. It's similar to
pre-existing tools in other languages (such as Make or Rake) but lets you
interface easily with Python codebases, and of course write your tasks
themselves in straight-up Python.
For documentation, including detailed installation information, please see
http://docs.pyinvoke.org. Post-install usage information may be found in ``invoke
--help``.
You can install the `development version
<https://github.com/pyinvoke/invoke/tarball/master#egg=invoke-dev>`_ via ``pip
install invoke==dev``.
| Revert "adding travis build status logo" | Revert "adding travis build status logo"
This reverts commit b20a9abfa9b651839df02dcb8ed5c3f12993a058.
| reStructuredText | bsd-2-clause | alex/invoke,mattrobenolt/invoke,frol/invoke,mkusz/invoke,pyinvoke/invoke,mattrobenolt/invoke,pyinvoke/invoke,singingwolfboy/invoke,sophacles/invoke,mkusz/invoke,kejbaly2/invoke,tyewang/invoke,pfmoore/invoke,kejbaly2/invoke,pfmoore/invoke,frol/invoke | restructuredtext | ## Code Before:
{<img src="https://secure.travis-ci.org/pyinvoke/invoke.png?branch=master" alt="Build Status" />}[http://travis-ci.org/pyinvoke/invoke]
Invoke is a Python (2.6+) task execution and management tool. It's similar to
pre-existing tools in other languages (such as Make or Rake) but lets you
interface easily with Python codebases, and of course write your tasks
themselves in straight-up Python.
For documentation, including detailed installation information, please see
http://docs.pyinvoke.org. Post-install usage information may be found in ``invoke
--help``.
You can install the `development version
<https://github.com/pyinvoke/invoke/tarball/master#egg=invoke-dev>`_ via ``pip
install invoke==dev``.
## Instruction:
Revert "adding travis build status logo"
This reverts commit b20a9abfa9b651839df02dcb8ed5c3f12993a058.
## Code After:
Invoke is a Python (2.6+) task execution and management tool. It's similar to
pre-existing tools in other languages (such as Make or Rake) but lets you
interface easily with Python codebases, and of course write your tasks
themselves in straight-up Python.
For documentation, including detailed installation information, please see
http://docs.pyinvoke.org. Post-install usage information may be found in ``invoke
--help``.
You can install the `development version
<https://github.com/pyinvoke/invoke/tarball/master#egg=invoke-dev>`_ via ``pip
install invoke==dev``.
| -
- {<img src="https://secure.travis-ci.org/pyinvoke/invoke.png?branch=master" alt="Build Status" />}[http://travis-ci.org/pyinvoke/invoke]
-
Invoke is a Python (2.6+) task execution and management tool. It's similar to
pre-existing tools in other languages (such as Make or Rake) but lets you
interface easily with Python codebases, and of course write your tasks
themselves in straight-up Python.
For documentation, including detailed installation information, please see
http://docs.pyinvoke.org. Post-install usage information may be found in ``invoke
--help``.
You can install the `development version
<https://github.com/pyinvoke/invoke/tarball/master#egg=invoke-dev>`_ via ``pip
install invoke==dev``. | 3 | 0.2 | 0 | 3 |
b397291844b3ce5863db01309651850abf7da116 | bootstrap.sh | bootstrap.sh |
set -e
as_vagrant='sudo -u vagrant -H bash -l -c'
apt-get -y update
apt-get install -y curl git-core mingw32 default-jdk
$as_vagrant 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
# install rvm
$as_vagrant 'curl -L https://get.rvm.io | bash -s stable'
$as_vagrant '~/.rvm/bin/rvm install jruby'
$as_vagrant '~/.rvm/bin/rvm install 1.9.3'
$as_vagrant '~/.rvm/bin/rvm install 1.8.7'
|
set -e
as_vagrant='sudo -u vagrant -H bash -l -c'
apt-get -y update
apt-get install -y curl git-core mingw32 default-jdk
$as_vagrant 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
# install rvm
$as_vagrant 'curl -L https://get.rvm.io | bash -s stable'
$as_vagrant '~/.rvm/bin/rvm install jruby'
$as_vagrant '~/.rvm/bin/rvm install 2.0.0'
$as_vagrant '~/.rvm/bin/rvm install 1.9.3'
$as_vagrant '~/.rvm/bin/rvm install 1.8.7'
| Install Ruby 2.0.0 in the VM | Install Ruby 2.0.0 in the VM
To target 64bits Windows, we need Ruby 2.0.0 as is the only version of
Ruby RubyInstaller provides binaries for.
| Shell | mit | ruby-concurrency/rake-compiler-dev-box,flavorjones/rake-compiler-dev-box,copiousfreetime/rake-compiler-dev-box,flavorjones/rake-compiler-dev-box,tjschuck/rake-compiler-dev-box,tjschuck/rake-compiler-dev-box,tjschuck/rake-compiler-dev-box,flavorjones/rake-compiler-dev-box,ruby-concurrency/rake-compiler-dev-box,ruby-concurrency/rake-compiler-dev-box,copiousfreetime/rake-compiler-dev-box,ruby-concurrency/rake-compiler-dev-box,tjschuck/rake-compiler-dev-box,copiousfreetime/rake-compiler-dev-box,copiousfreetime/rake-compiler-dev-box,flavorjones/rake-compiler-dev-box | shell | ## Code Before:
set -e
as_vagrant='sudo -u vagrant -H bash -l -c'
apt-get -y update
apt-get install -y curl git-core mingw32 default-jdk
$as_vagrant 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
# install rvm
$as_vagrant 'curl -L https://get.rvm.io | bash -s stable'
$as_vagrant '~/.rvm/bin/rvm install jruby'
$as_vagrant '~/.rvm/bin/rvm install 1.9.3'
$as_vagrant '~/.rvm/bin/rvm install 1.8.7'
## Instruction:
Install Ruby 2.0.0 in the VM
To target 64bits Windows, we need Ruby 2.0.0 as is the only version of
Ruby RubyInstaller provides binaries for.
## Code After:
set -e
as_vagrant='sudo -u vagrant -H bash -l -c'
apt-get -y update
apt-get install -y curl git-core mingw32 default-jdk
$as_vagrant 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
# install rvm
$as_vagrant 'curl -L https://get.rvm.io | bash -s stable'
$as_vagrant '~/.rvm/bin/rvm install jruby'
$as_vagrant '~/.rvm/bin/rvm install 2.0.0'
$as_vagrant '~/.rvm/bin/rvm install 1.9.3'
$as_vagrant '~/.rvm/bin/rvm install 1.8.7'
|
set -e
as_vagrant='sudo -u vagrant -H bash -l -c'
apt-get -y update
apt-get install -y curl git-core mingw32 default-jdk
$as_vagrant 'echo "gem: --no-ri --no-rdoc" >> ~/.gemrc'
# install rvm
$as_vagrant 'curl -L https://get.rvm.io | bash -s stable'
$as_vagrant '~/.rvm/bin/rvm install jruby'
+ $as_vagrant '~/.rvm/bin/rvm install 2.0.0'
$as_vagrant '~/.rvm/bin/rvm install 1.9.3'
$as_vagrant '~/.rvm/bin/rvm install 1.8.7' | 1 | 0.058824 | 1 | 0 |
11b2fd54fd0112d6fc69276d3d9d8b6592d9e6d4 | _config.yml | _config.yml | title: amiedes.tech
description: > # this means to ignore newlines until "baseurl:"
Blog/página personal de Alberto Miedes.
baseurl: "" # the subpath of your site, e.g. /blog
# Cambiar esto en función de si estoy trabajando en localhost o en el sitio publicado
url: "http://amiedes.tech" # the base hostname & protocol for your site
#url: "http://localhost"
twitter_username: albertomg994
github_username: amiedes
linkedin_username: amiedes
# Build settings
markdown: kramdown
# Outputting
permalink: date
| title: amiedes.com
description: "Alberto Miedes' web site and blog. Developer currently living in Madrid."
baseurl: "" # the subpath of your site, e.g. /blog
# Cambiar esto en función de si estoy trabajando en localhost o en el sitio publicado
url: "http://amiedes.com" # the base hostname & protocol for your site
#url: "http://localhost"
twitter_username: albertomg994
github_username: amiedes
linkedin_username: amiedes
# Build settings
markdown: kramdown
# Outputting
permalink: date
| Update website name and description | Update website name and description
| YAML | mit | albertomg994/albertomg994.github.io,albertomg994/albertomg994.github.io | yaml | ## Code Before:
title: amiedes.tech
description: > # this means to ignore newlines until "baseurl:"
Blog/página personal de Alberto Miedes.
baseurl: "" # the subpath of your site, e.g. /blog
# Cambiar esto en función de si estoy trabajando en localhost o en el sitio publicado
url: "http://amiedes.tech" # the base hostname & protocol for your site
#url: "http://localhost"
twitter_username: albertomg994
github_username: amiedes
linkedin_username: amiedes
# Build settings
markdown: kramdown
# Outputting
permalink: date
## Instruction:
Update website name and description
## Code After:
title: amiedes.com
description: "Alberto Miedes' web site and blog. Developer currently living in Madrid."
baseurl: "" # the subpath of your site, e.g. /blog
# Cambiar esto en función de si estoy trabajando en localhost o en el sitio publicado
url: "http://amiedes.com" # the base hostname & protocol for your site
#url: "http://localhost"
twitter_username: albertomg994
github_username: amiedes
linkedin_username: amiedes
# Build settings
markdown: kramdown
# Outputting
permalink: date
| - title: amiedes.tech
? -- ^
+ title: amiedes.com
? ^^
+ description: "Alberto Miedes' web site and blog. Developer currently living in Madrid."
- description: > # this means to ignore newlines until "baseurl:"
- Blog/página personal de Alberto Miedes.
baseurl: "" # the subpath of your site, e.g. /blog
# Cambiar esto en función de si estoy trabajando en localhost o en el sitio publicado
- url: "http://amiedes.tech" # the base hostname & protocol for your site
? -- ^
+ url: "http://amiedes.com" # the base hostname & protocol for your site
? ^^
#url: "http://localhost"
twitter_username: albertomg994
github_username: amiedes
linkedin_username: amiedes
# Build settings
markdown: kramdown
# Outputting
permalink: date | 7 | 0.388889 | 3 | 4 |
1105294bc9bcd6e94e235ee8c4a4d7e7b31abf89 | src/Services/FacebookMessenger/Listeners/SendFacebookMessengerMessage.php | src/Services/FacebookMessenger/Listeners/SendFacebookMessengerMessage.php | <?php
namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;
use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;
class SendFacebookMessengerMessage
{
/**
* @var EventPublisher
*/
private $eventPublisher;
/**
* @var FacebookMessenger
*/
private $facebookMessengerRepository;
public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
{
$this->eventPublisher = $eventPublisher;
$this->facebookMessengerRepository = $facebookMessengerRepository;
}
/**
* Handle the event.
*
* @param FacebookMessengerAudioWasCreated $event
*/
public function handle(ChatMessageWasSent $event)
{
$message = $event->data['message_model'];
if ($message->chat->facebook_messenger_chat_id)
{
if ($this->facebookMessengerRepository->sendMessage($event->data['message_model']))
{
event(new ChatMessageWasDelivered($message));
}
}
$this->eventPublisher->publish('ChatListWasUpdated');
}
}
| <?php
namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;
use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;
class SendFacebookMessengerMessage
{
/**
* @var EventPublisher
*/
private $eventPublisher;
/**
* @var FacebookMessenger
*/
private $facebookMessengerRepository;
public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
{
$this->eventPublisher = $eventPublisher;
$this->facebookMessengerRepository = $facebookMessengerRepository;
}
/**
* Handle the event.
*
* @param FacebookMessengerAudioWasCreated $event
*/
public function handle(ChatMessageWasSent $event)
{
$message = $event->data['message_model'];
if ($message->chat->facebook_messenger_chat_id)
{
$this->facebookMessengerRepository->sendMessage($event->data['message_model'])
}
$this->eventPublisher->publish('ChatListWasUpdated');
}
}
| Remove message delivery for Facebook | Remove message delivery for Facebook
| PHP | mit | antonioribeiro/sdk,antonioribeiro/sdk,antonioribeiro/sdk | php | ## Code Before:
<?php
namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;
use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;
class SendFacebookMessengerMessage
{
/**
* @var EventPublisher
*/
private $eventPublisher;
/**
* @var FacebookMessenger
*/
private $facebookMessengerRepository;
public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
{
$this->eventPublisher = $eventPublisher;
$this->facebookMessengerRepository = $facebookMessengerRepository;
}
/**
* Handle the event.
*
* @param FacebookMessengerAudioWasCreated $event
*/
public function handle(ChatMessageWasSent $event)
{
$message = $event->data['message_model'];
if ($message->chat->facebook_messenger_chat_id)
{
if ($this->facebookMessengerRepository->sendMessage($event->data['message_model']))
{
event(new ChatMessageWasDelivered($message));
}
}
$this->eventPublisher->publish('ChatListWasUpdated');
}
}
## Instruction:
Remove message delivery for Facebook
## Code After:
<?php
namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;
use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;
class SendFacebookMessengerMessage
{
/**
* @var EventPublisher
*/
private $eventPublisher;
/**
* @var FacebookMessenger
*/
private $facebookMessengerRepository;
public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
{
$this->eventPublisher = $eventPublisher;
$this->facebookMessengerRepository = $facebookMessengerRepository;
}
/**
* Handle the event.
*
* @param FacebookMessengerAudioWasCreated $event
*/
public function handle(ChatMessageWasSent $event)
{
$message = $event->data['message_model'];
if ($message->chat->facebook_messenger_chat_id)
{
$this->facebookMessengerRepository->sendMessage($event->data['message_model'])
}
$this->eventPublisher->publish('ChatListWasUpdated');
}
}
| <?php
namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;
use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;
class SendFacebookMessengerMessage
{
/**
* @var EventPublisher
*/
private $eventPublisher;
/**
* @var FacebookMessenger
*/
private $facebookMessengerRepository;
public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
{
$this->eventPublisher = $eventPublisher;
$this->facebookMessengerRepository = $facebookMessengerRepository;
}
/**
* Handle the event.
*
* @param FacebookMessengerAudioWasCreated $event
*/
public function handle(ChatMessageWasSent $event)
{
$message = $event->data['message_model'];
if ($message->chat->facebook_messenger_chat_id)
{
- if ($this->facebookMessengerRepository->sendMessage($event->data['message_model']))
? ---- -
+ $this->facebookMessengerRepository->sendMessage($event->data['message_model'])
- {
- event(new ChatMessageWasDelivered($message));
- }
}
$this->eventPublisher->publish('ChatListWasUpdated');
}
} | 5 | 0.106383 | 1 | 4 |
b86654f2f47606e61d319f8f02130b4ec6e93bc4 | indexer/lib/patches/patch_loyalty_symbol.rb | indexer/lib/patches/patch_loyalty_symbol.rb | class PatchLoyaltySymbol < Patch
def call
each_printing do |card|
next unless (card["types"] || []).include?("Planeswalker")
card["originalText"] = card["originalText"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" } # hack to fix all planeswalkers showing up in is:errata
card["text"] = card["text"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" }
end
end
end
| class PatchLoyaltySymbol < Patch
def call
each_printing do |card|
next unless (card["types"] || []).include?("Planeswalker")
card["text"] = card["text"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" }
if card.key?("originalText")
card["originalText"] = card["originalText"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" } # hack to fix all planeswalkers showing up in is:errata
end
end
end
end
| Fix PatchLoyaltySymbol for planeswalkers without originalText | Fix PatchLoyaltySymbol for planeswalkers without originalText
| Ruby | mit | fenhl/lore-seeker,fenhl/lore-seeker,fenhl/lore-seeker,fenhl/lore-seeker,fenhl/lore-seeker | ruby | ## Code Before:
class PatchLoyaltySymbol < Patch
def call
each_printing do |card|
next unless (card["types"] || []).include?("Planeswalker")
card["originalText"] = card["originalText"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" } # hack to fix all planeswalkers showing up in is:errata
card["text"] = card["text"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" }
end
end
end
## Instruction:
Fix PatchLoyaltySymbol for planeswalkers without originalText
## Code After:
class PatchLoyaltySymbol < Patch
def call
each_printing do |card|
next unless (card["types"] || []).include?("Planeswalker")
card["text"] = card["text"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" }
if card.key?("originalText")
card["originalText"] = card["originalText"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" } # hack to fix all planeswalkers showing up in is:errata
end
end
end
end
| class PatchLoyaltySymbol < Patch
def call
each_printing do |card|
next unless (card["types"] || []).include?("Planeswalker")
- card["originalText"] = card["originalText"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" } # hack to fix all planeswalkers showing up in is:errata
card["text"] = card["text"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" }
+ if card.key?("originalText")
+ card["originalText"] = card["originalText"].gsub(%r[^([\+\-\−]?(?:\d+|X)):]) { "[#{$1}]:" } # hack to fix all planeswalkers showing up in is:errata
+ end
end
end
end | 4 | 0.444444 | 3 | 1 |
0ce6d6ab98682ede448176882ac2e2317fc68cff | .travis.yml | .travis.yml | ---
language: node_js
node_js:
- 4.1
before_install:
- export CXX='g++-4.8'
| ---
language: node_js
node_js:
- 4.1
before_install:
- gcc --version
- export CXX='g++-4.8'
| Print gcc version on Travis | Print gcc version on Travis
| YAML | mit | vinsonchuong/dist-es6 | yaml | ## Code Before:
---
language: node_js
node_js:
- 4.1
before_install:
- export CXX='g++-4.8'
## Instruction:
Print gcc version on Travis
## Code After:
---
language: node_js
node_js:
- 4.1
before_install:
- gcc --version
- export CXX='g++-4.8'
| ---
language: node_js
node_js:
- 4.1
before_install:
+ - gcc --version
- export CXX='g++-4.8' | 1 | 0.166667 | 1 | 0 |
918a02d37eb5ba5d036f407cf206f57828b42302 | Cargo.toml | Cargo.toml | [package]
name = "spaceapi"
version = "0.3.1"
documentation = "https://coredump-ch.github.io/rust-docs/spaceapi/spaceapi/index.html"
repository = "https://github.com/coredump-ch/spaceapi-rs/"
license = "MIT OR Apache-2.0"
authors = [
"Raphael Nestler <raphael.nestler@gmail.com>",
"Danilo Bargen <mail@dbrgn.ch>",
"Stefan Schindler <stefan@estada.ch>",
]
description = "Space API types and serialization/deserialization."
readme = "README.md"
keywords = ["spaceapi", "hackerspaces", "status", "api"]
include = [
"**/*.rs",
"Cargo.toml",
"README.md",
"LICENSE-MIT",
"LICENSE-APACHE",
"AUTHORS.md",
]
build="build.rs"
[build-dependencies]
serde_codegen = "*"
syntex = "*"
[dependencies]
log = "^0.3"
serde = "*"
serde_json = "*"
| [package]
name = "spaceapi"
version = "0.3.1"
documentation = "https://coredump-ch.github.io/rust-docs/spaceapi/spaceapi/index.html"
repository = "https://github.com/coredump-ch/spaceapi-rs/"
license = "MIT OR Apache-2.0"
authors = [
"Raphael Nestler <raphael.nestler@gmail.com>",
"Danilo Bargen <mail@dbrgn.ch>",
"Stefan Schindler <stefan@estada.ch>",
]
description = "Space API types and serialization/deserialization."
readme = "README.md"
keywords = ["spaceapi", "hackerspaces", "status", "api"]
include = [
"**/*.rs",
"Cargo.toml",
"README.md",
"LICENSE-MIT",
"LICENSE-APACHE",
"AUTHORS.md",
]
build="build.rs"
[build-dependencies]
serde_codegen = "^0.6"
syntex = "^0.29"
[dependencies]
log = "^0.3"
serde = "^0.6"
serde_json = "^0.6"
| Use semantic versioning for serde dependencies | Use semantic versioning for serde dependencies
| TOML | apache-2.0 | coredump-ch/spaceapi-rs | toml | ## Code Before:
[package]
name = "spaceapi"
version = "0.3.1"
documentation = "https://coredump-ch.github.io/rust-docs/spaceapi/spaceapi/index.html"
repository = "https://github.com/coredump-ch/spaceapi-rs/"
license = "MIT OR Apache-2.0"
authors = [
"Raphael Nestler <raphael.nestler@gmail.com>",
"Danilo Bargen <mail@dbrgn.ch>",
"Stefan Schindler <stefan@estada.ch>",
]
description = "Space API types and serialization/deserialization."
readme = "README.md"
keywords = ["spaceapi", "hackerspaces", "status", "api"]
include = [
"**/*.rs",
"Cargo.toml",
"README.md",
"LICENSE-MIT",
"LICENSE-APACHE",
"AUTHORS.md",
]
build="build.rs"
[build-dependencies]
serde_codegen = "*"
syntex = "*"
[dependencies]
log = "^0.3"
serde = "*"
serde_json = "*"
## Instruction:
Use semantic versioning for serde dependencies
## Code After:
[package]
name = "spaceapi"
version = "0.3.1"
documentation = "https://coredump-ch.github.io/rust-docs/spaceapi/spaceapi/index.html"
repository = "https://github.com/coredump-ch/spaceapi-rs/"
license = "MIT OR Apache-2.0"
authors = [
"Raphael Nestler <raphael.nestler@gmail.com>",
"Danilo Bargen <mail@dbrgn.ch>",
"Stefan Schindler <stefan@estada.ch>",
]
description = "Space API types and serialization/deserialization."
readme = "README.md"
keywords = ["spaceapi", "hackerspaces", "status", "api"]
include = [
"**/*.rs",
"Cargo.toml",
"README.md",
"LICENSE-MIT",
"LICENSE-APACHE",
"AUTHORS.md",
]
build="build.rs"
[build-dependencies]
serde_codegen = "^0.6"
syntex = "^0.29"
[dependencies]
log = "^0.3"
serde = "^0.6"
serde_json = "^0.6"
| [package]
name = "spaceapi"
version = "0.3.1"
documentation = "https://coredump-ch.github.io/rust-docs/spaceapi/spaceapi/index.html"
repository = "https://github.com/coredump-ch/spaceapi-rs/"
license = "MIT OR Apache-2.0"
authors = [
"Raphael Nestler <raphael.nestler@gmail.com>",
"Danilo Bargen <mail@dbrgn.ch>",
"Stefan Schindler <stefan@estada.ch>",
]
description = "Space API types and serialization/deserialization."
readme = "README.md"
keywords = ["spaceapi", "hackerspaces", "status", "api"]
include = [
"**/*.rs",
"Cargo.toml",
"README.md",
"LICENSE-MIT",
"LICENSE-APACHE",
"AUTHORS.md",
]
build="build.rs"
[build-dependencies]
- serde_codegen = "*"
? ^
+ serde_codegen = "^0.6"
? ^^^^
- syntex = "*"
? ^
+ syntex = "^0.29"
? ^^^^^
[dependencies]
log = "^0.3"
- serde = "*"
? ^
+ serde = "^0.6"
? ^^^^
- serde_json = "*"
? ^
+ serde_json = "^0.6"
? ^^^^
| 8 | 0.25 | 4 | 4 |
39bf9d09489750d247553dfc47c1c7b6954a3690 | README.md | README.md |
Note: This project is under development.
Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.
|
Note: This project is under development.
Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.
## Usage
The ``fix`` command tries to fix as much upgrade issues as possible on a given file or directory:
```bash
$ symfony-upgrade-fixer fix /path/to/dir
$ symfony-upgrade-fixer fix /path/to/file
```
| Add usage instructions to readme | Add usage instructions to readme
| Markdown | mit | umpirsky/Symfony-Upgrade-Fixer | markdown | ## Code Before:
Note: This project is under development.
Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.
## Instruction:
Add usage instructions to readme
## Code After:
Note: This project is under development.
Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.
## Usage
The ``fix`` command tries to fix as much upgrade issues as possible on a given file or directory:
```bash
$ symfony-upgrade-fixer fix /path/to/dir
$ symfony-upgrade-fixer fix /path/to/file
```
|
Note: This project is under development.
Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.
+
+ ## Usage
+
+ The ``fix`` command tries to fix as much upgrade issues as possible on a given file or directory:
+
+ ```bash
+ $ symfony-upgrade-fixer fix /path/to/dir
+ $ symfony-upgrade-fixer fix /path/to/file
+ ``` | 9 | 2.25 | 9 | 0 |
563472063abbd7fe56e87c62bf786a1ca82c88f6 | app/views/design_options/_index.html.haml | app/views/design_options/_index.html.haml | -# %form.form-horizontal
.form-horizontal
= render 'design_options/new_button', position: 0
- @design.design_options.each_with_index do |design_option, position|
.interactive-variable-section-container{ id: "design_option_#{design_option.id}_container" }
= render 'design_options/show', design_option: design_option
= render 'design_options/new_button', position: position + 1
| -# %form.form-horizontal
.form-horizontal
= render 'design_options/new_button', position: 0
- @design.design_options.includes(:section, variable: { domain: :domain_options }).each_with_index do |design_option, position|
.interactive-variable-section-container{ id: "design_option_#{design_option.id}_container" }
= render 'design_options/show', design_option: design_option
= render 'design_options/new_button', position: position + 1
| Load design options more efficiently when editing designs | Load design options more efficiently when editing designs
| Haml | mit | remomueller/slice,remomueller/slice,remomueller/slice | haml | ## Code Before:
-# %form.form-horizontal
.form-horizontal
= render 'design_options/new_button', position: 0
- @design.design_options.each_with_index do |design_option, position|
.interactive-variable-section-container{ id: "design_option_#{design_option.id}_container" }
= render 'design_options/show', design_option: design_option
= render 'design_options/new_button', position: position + 1
## Instruction:
Load design options more efficiently when editing designs
## Code After:
-# %form.form-horizontal
.form-horizontal
= render 'design_options/new_button', position: 0
- @design.design_options.includes(:section, variable: { domain: :domain_options }).each_with_index do |design_option, position|
.interactive-variable-section-container{ id: "design_option_#{design_option.id}_container" }
= render 'design_options/show', design_option: design_option
= render 'design_options/new_button', position: position + 1
| -# %form.form-horizontal
.form-horizontal
= render 'design_options/new_button', position: 0
- - @design.design_options.each_with_index do |design_option, position|
+ - @design.design_options.includes(:section, variable: { domain: :domain_options }).each_with_index do |design_option, position|
.interactive-variable-section-container{ id: "design_option_#{design_option.id}_container" }
= render 'design_options/show', design_option: design_option
= render 'design_options/new_button', position: position + 1 | 2 | 0.285714 | 1 | 1 |
b3ec18ae1c9dbb72e27a7e32c93ebdd4a1738789 | README.md | README.md | mbc-user-import
===============
A consumer for the userImport queue that will be used to import
user accounts via inpoort SCV files. Detection of the source is within
the message payloads. Based on the user data and the source activities
are processed:
- Drupal user creation
- Mobile Commons submission
- MailChimp submission
- submission to mb-user-api
- Campaign signup (Drupal site)
Each user submission is checked for existing user accounts in Drupal,
MailChimp and Mobile Commons. Existing detected accounts are logged in
mb-logging.
|
- [Introduction](https://github.com/DoSomething/mbp-user-import/wiki)
- [Architecture](https://github.com/DoSomething/mbp-user-import/wiki/2.-Architecture)
- [Setup](https://github.com/DoSomething/mbp-user-import/wiki/3.-Setup)
- [Operation](https://github.com/DoSomething/mbp-user-import/wiki/4.-Operation)
- [Monitoring](https://github.com/DoSomething/mbp-user-import/wiki/5.-Monitoring)
- [Problems / Solutions](https://github.com/DoSomething/mbp-user-import/wiki/7.-Problems-%5C--Solutions)
#### 1. [mbp-user-import](https://github.com/DoSomething/mbp-user-import)
An application (producer) in the Quicksilver (Message Broker) system. Imports user data from CVS formatted files that create message entries in the `userImportQueue`.
#### 2. [mbc-user-import](https://github.com/DoSomething/mbc-user-import)
An application (consumer) in the Quicksilver (Message Broker) system. Processes user data import messages in the `userImportQueue`.
#### 3. [mbp-logging-reports](https://github.com/DoSomething/Quicksilver-PHP/tree/master/mbp-logging-reports)
Generate reports of the on going user import process. Reports are sent through email and Slack.
---
## mbc-user-import
A consumer for the userImport queue that will be used to import
user accounts via inpoort SCV files. Detection of the source is within
the message payloads. Based on the user data and the source activities
are processed:
- Drupal user creation
- Mobile Commons submission
- MailChimp submission
- submission to mb-user-api
- Campaign signup (Drupal site)
Each user submission is checked for existing user accounts in Drupal,
MailChimp and Mobile Commons. Existing detected accounts are logged in
mb-logging.
### Installation
**Production**
- `$ composer install --no-dev`
**Development**
- `*composer install --dev`
### Update
- `$ composer update` | Add User Import system links | Add User Import system links
| Markdown | mit | DoSomething/mbc-user-import,DoSomething/mbc-user-import,DoSomething/mbc-user-import | markdown | ## Code Before:
mbc-user-import
===============
A consumer for the userImport queue that will be used to import
user accounts via inpoort SCV files. Detection of the source is within
the message payloads. Based on the user data and the source activities
are processed:
- Drupal user creation
- Mobile Commons submission
- MailChimp submission
- submission to mb-user-api
- Campaign signup (Drupal site)
Each user submission is checked for existing user accounts in Drupal,
MailChimp and Mobile Commons. Existing detected accounts are logged in
mb-logging.
## Instruction:
Add User Import system links
## Code After:
- [Introduction](https://github.com/DoSomething/mbp-user-import/wiki)
- [Architecture](https://github.com/DoSomething/mbp-user-import/wiki/2.-Architecture)
- [Setup](https://github.com/DoSomething/mbp-user-import/wiki/3.-Setup)
- [Operation](https://github.com/DoSomething/mbp-user-import/wiki/4.-Operation)
- [Monitoring](https://github.com/DoSomething/mbp-user-import/wiki/5.-Monitoring)
- [Problems / Solutions](https://github.com/DoSomething/mbp-user-import/wiki/7.-Problems-%5C--Solutions)
#### 1. [mbp-user-import](https://github.com/DoSomething/mbp-user-import)
An application (producer) in the Quicksilver (Message Broker) system. Imports user data from CVS formatted files that create message entries in the `userImportQueue`.
#### 2. [mbc-user-import](https://github.com/DoSomething/mbc-user-import)
An application (consumer) in the Quicksilver (Message Broker) system. Processes user data import messages in the `userImportQueue`.
#### 3. [mbp-logging-reports](https://github.com/DoSomething/Quicksilver-PHP/tree/master/mbp-logging-reports)
Generate reports of the on going user import process. Reports are sent through email and Slack.
---
## mbc-user-import
A consumer for the userImport queue that will be used to import
user accounts via inpoort SCV files. Detection of the source is within
the message payloads. Based on the user data and the source activities
are processed:
- Drupal user creation
- Mobile Commons submission
- MailChimp submission
- submission to mb-user-api
- Campaign signup (Drupal site)
Each user submission is checked for existing user accounts in Drupal,
MailChimp and Mobile Commons. Existing detected accounts are logged in
mb-logging.
### Installation
**Production**
- `$ composer install --no-dev`
**Development**
- `*composer install --dev`
### Update
- `$ composer update` | +
+ - [Introduction](https://github.com/DoSomething/mbp-user-import/wiki)
+ - [Architecture](https://github.com/DoSomething/mbp-user-import/wiki/2.-Architecture)
+ - [Setup](https://github.com/DoSomething/mbp-user-import/wiki/3.-Setup)
+ - [Operation](https://github.com/DoSomething/mbp-user-import/wiki/4.-Operation)
+ - [Monitoring](https://github.com/DoSomething/mbp-user-import/wiki/5.-Monitoring)
+ - [Problems / Solutions](https://github.com/DoSomething/mbp-user-import/wiki/7.-Problems-%5C--Solutions)
+
+ #### 1. [mbp-user-import](https://github.com/DoSomething/mbp-user-import)
+
+ An application (producer) in the Quicksilver (Message Broker) system. Imports user data from CVS formatted files that create message entries in the `userImportQueue`.
+
+ #### 2. [mbc-user-import](https://github.com/DoSomething/mbc-user-import)
+
+ An application (consumer) in the Quicksilver (Message Broker) system. Processes user data import messages in the `userImportQueue`.
+
+ #### 3. [mbp-logging-reports](https://github.com/DoSomething/Quicksilver-PHP/tree/master/mbp-logging-reports)
+
+ Generate reports of the on going user import process. Reports are sent through email and Slack.
+
+ ---
+
- mbc-user-import
+ ## mbc-user-import
? +++
- ===============
A consumer for the userImport queue that will be used to import
user accounts via inpoort SCV files. Detection of the source is within
the message payloads. Based on the user data and the source activities
are processed:
- Drupal user creation
- Mobile Commons submission
- MailChimp submission
- submission to mb-user-api
- Campaign signup (Drupal site)
Each user submission is checked for existing user accounts in Drupal,
MailChimp and Mobile Commons. Existing detected accounts are logged in
mb-logging.
+
+ ### Installation
+
+ **Production**
+ - `$ composer install --no-dev`
+ **Development**
+ - `*composer install --dev`
+
+ ### Update
+
+ - `$ composer update` | 36 | 2.117647 | 34 | 2 |
f12197687306c73c8ceb9b52112a06df52468d83 | lib/tasks/lit_tasks.rake | lib/tasks/lit_tasks.rake | namespace :lit do
desc 'Exports translated strings from lit to config/locales/lit.yml file.'
task export: :environment do
if yml = Lit.init.cache.export
path = Rails.root.join('config', 'locales', 'lit.yml')
File.new(path, 'w').write(yml)
puts "Successfully exported #{path}."
end
end
desc 'Reads config/locales/#{ENV["FILES"]} files and calls I18n.t() on keys forcing Lit to import given LOCALE to cache / to display them in UI. Skips nils by default (change by setting ENV["SKIP_NIL"] = false'
task raw_import: :environment do
return 'you need to define FILES env' if ENV['FILES'].blank?
return 'you need to define LOCALE env' if ENV['LOCALE'].blank?
files = ENV['FILES'].to_s.split(',')
locale = ENV['LOCALE'].to_s
I18n.with_locale(locale) do
files.each do |file|
locale_file = File.open(Rails.root.join('config', 'locales', file))
yml = YAML.load(locale_file)[locale]
Hash[*Lit::Cache.flatten_hash(yml)].each do |key, default_translation|
next if default_translation.nil? && ENV.fetch('SKIP_NIL', 'true') == 'true'
puts key
I18n.t(key, default: default_translation)
end
end
end
end
end
| namespace :lit do
desc 'Exports translated strings from lit to config/locales/lit.yml file.'
task export: :environment do
if yml = Lit.init.cache.export
path = Rails.root.join('config', 'locales', 'lit.yml')
File.new(path, 'w').write(yml)
puts "Successfully exported #{path}."
end
end
desc 'Reads config/locales/#{ENV["FILES"]} files and calls I18n.t() on keys forcing Lit to import given LOCALE to cache / to display them in UI. Skips nils by default (change by setting ENV["SKIP_NIL"] = false'
task raw_import: :environment do
return 'you need to define FILES env' if ENV['FILES'].blank?
return 'you need to define LOCALE env' if ENV['LOCALE'].blank?
files = ENV['FILES'].to_s.split(',')
locale = ENV['LOCALE'].to_s
I18n.with_locale(locale) do
files.each do |file|
locale_file = File.open(Rails.root.join('config', 'locales', file))
yml = YAML.load(locale_file)[locale]
Hash[*Lit::Cache.flatten_hash(yml)].each do |key, default_translation|
next if default_translation.nil? && ENV.fetch('SKIP_NIL', 'true') == 'true'
puts key
I18n.t(key, default: default_translation)
end
end
end
end
desc 'Remove all translations'
task clear: :environment do
Lit::LocalizationKey.destroy_all
Lit::IncommingLocalization.destroy_all
Lit.init.cache.reset
end
end
| Add task to remove all translations | Add task to remove all translations
| Ruby | mit | prograils/lit,prograils/lit,prograils/lit | ruby | ## Code Before:
namespace :lit do
desc 'Exports translated strings from lit to config/locales/lit.yml file.'
task export: :environment do
if yml = Lit.init.cache.export
path = Rails.root.join('config', 'locales', 'lit.yml')
File.new(path, 'w').write(yml)
puts "Successfully exported #{path}."
end
end
desc 'Reads config/locales/#{ENV["FILES"]} files and calls I18n.t() on keys forcing Lit to import given LOCALE to cache / to display them in UI. Skips nils by default (change by setting ENV["SKIP_NIL"] = false'
task raw_import: :environment do
return 'you need to define FILES env' if ENV['FILES'].blank?
return 'you need to define LOCALE env' if ENV['LOCALE'].blank?
files = ENV['FILES'].to_s.split(',')
locale = ENV['LOCALE'].to_s
I18n.with_locale(locale) do
files.each do |file|
locale_file = File.open(Rails.root.join('config', 'locales', file))
yml = YAML.load(locale_file)[locale]
Hash[*Lit::Cache.flatten_hash(yml)].each do |key, default_translation|
next if default_translation.nil? && ENV.fetch('SKIP_NIL', 'true') == 'true'
puts key
I18n.t(key, default: default_translation)
end
end
end
end
end
## Instruction:
Add task to remove all translations
## Code After:
namespace :lit do
desc 'Exports translated strings from lit to config/locales/lit.yml file.'
task export: :environment do
if yml = Lit.init.cache.export
path = Rails.root.join('config', 'locales', 'lit.yml')
File.new(path, 'w').write(yml)
puts "Successfully exported #{path}."
end
end
desc 'Reads config/locales/#{ENV["FILES"]} files and calls I18n.t() on keys forcing Lit to import given LOCALE to cache / to display them in UI. Skips nils by default (change by setting ENV["SKIP_NIL"] = false'
task raw_import: :environment do
return 'you need to define FILES env' if ENV['FILES'].blank?
return 'you need to define LOCALE env' if ENV['LOCALE'].blank?
files = ENV['FILES'].to_s.split(',')
locale = ENV['LOCALE'].to_s
I18n.with_locale(locale) do
files.each do |file|
locale_file = File.open(Rails.root.join('config', 'locales', file))
yml = YAML.load(locale_file)[locale]
Hash[*Lit::Cache.flatten_hash(yml)].each do |key, default_translation|
next if default_translation.nil? && ENV.fetch('SKIP_NIL', 'true') == 'true'
puts key
I18n.t(key, default: default_translation)
end
end
end
end
desc 'Remove all translations'
task clear: :environment do
Lit::LocalizationKey.destroy_all
Lit::IncommingLocalization.destroy_all
Lit.init.cache.reset
end
end
| namespace :lit do
desc 'Exports translated strings from lit to config/locales/lit.yml file.'
task export: :environment do
if yml = Lit.init.cache.export
path = Rails.root.join('config', 'locales', 'lit.yml')
File.new(path, 'w').write(yml)
puts "Successfully exported #{path}."
end
end
desc 'Reads config/locales/#{ENV["FILES"]} files and calls I18n.t() on keys forcing Lit to import given LOCALE to cache / to display them in UI. Skips nils by default (change by setting ENV["SKIP_NIL"] = false'
task raw_import: :environment do
return 'you need to define FILES env' if ENV['FILES'].blank?
return 'you need to define LOCALE env' if ENV['LOCALE'].blank?
files = ENV['FILES'].to_s.split(',')
locale = ENV['LOCALE'].to_s
I18n.with_locale(locale) do
files.each do |file|
locale_file = File.open(Rails.root.join('config', 'locales', file))
yml = YAML.load(locale_file)[locale]
Hash[*Lit::Cache.flatten_hash(yml)].each do |key, default_translation|
next if default_translation.nil? && ENV.fetch('SKIP_NIL', 'true') == 'true'
puts key
I18n.t(key, default: default_translation)
end
end
end
end
+
+ desc 'Remove all translations'
+ task clear: :environment do
+ Lit::LocalizationKey.destroy_all
+ Lit::IncommingLocalization.destroy_all
+ Lit.init.cache.reset
+ end
end | 7 | 0.241379 | 7 | 0 |
dbdf5aaddc7d762042279137f00740c231d0957b | requirements.txt | requirements.txt | Flask==0.10.1
Flask-Cors==1.9.0
gevent==1.0.1
uWSGI==2.0.7
python-etcd==0.3.3
future==0.15.0
PyYAML==3.11
boto==2.34.0
celery[mongodb]==3.1.18
pymongo==2.6.3
flower==0.7.2
Jinja2==2.7.3
requests[security]==2.7.0
urllib3==1.11
https://github.com/totem/flask-hyperschema/archive/master.tar.gz
https://github.com/totem/totem-encrypt/archive/master.tar.gz
https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz
| Flask==0.10.1
Flask-Cors==1.9.0
gevent==1.0.1
uWSGI==2.0.7
python-etcd==0.3.3
future==0.15.0
PyYAML==3.11
boto==2.34.0
pymongo==3.0.3
flower==0.7.2
Jinja2==2.7.3
requests[security]==2.7.0
urllib3==1.11
https://github.com/sukrit007/celery/archive/3.1.tar.gz
https://github.com/totem/flask-hyperschema/archive/master.tar.gz
https://github.com/totem/totem-encrypt/archive/master.tar.gz
https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz
| Use patched version for celery (pymongo issue) | Use patched version for celery (pymongo issue)
| Text | mit | totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator | text | ## Code Before:
Flask==0.10.1
Flask-Cors==1.9.0
gevent==1.0.1
uWSGI==2.0.7
python-etcd==0.3.3
future==0.15.0
PyYAML==3.11
boto==2.34.0
celery[mongodb]==3.1.18
pymongo==2.6.3
flower==0.7.2
Jinja2==2.7.3
requests[security]==2.7.0
urllib3==1.11
https://github.com/totem/flask-hyperschema/archive/master.tar.gz
https://github.com/totem/totem-encrypt/archive/master.tar.gz
https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz
## Instruction:
Use patched version for celery (pymongo issue)
## Code After:
Flask==0.10.1
Flask-Cors==1.9.0
gevent==1.0.1
uWSGI==2.0.7
python-etcd==0.3.3
future==0.15.0
PyYAML==3.11
boto==2.34.0
pymongo==3.0.3
flower==0.7.2
Jinja2==2.7.3
requests[security]==2.7.0
urllib3==1.11
https://github.com/sukrit007/celery/archive/3.1.tar.gz
https://github.com/totem/flask-hyperschema/archive/master.tar.gz
https://github.com/totem/totem-encrypt/archive/master.tar.gz
https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz
| Flask==0.10.1
Flask-Cors==1.9.0
gevent==1.0.1
uWSGI==2.0.7
python-etcd==0.3.3
future==0.15.0
PyYAML==3.11
boto==2.34.0
- celery[mongodb]==3.1.18
- pymongo==2.6.3
? ^ ^
+ pymongo==3.0.3
? ^ ^
flower==0.7.2
Jinja2==2.7.3
requests[security]==2.7.0
urllib3==1.11
+ https://github.com/sukrit007/celery/archive/3.1.tar.gz
https://github.com/totem/flask-hyperschema/archive/master.tar.gz
https://github.com/totem/totem-encrypt/archive/master.tar.gz
https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz | 4 | 0.235294 | 2 | 2 |
6355edd510dee4ac6da7e44e60ea80aea89863dd | lib/index.js | lib/index.js | 'use strict';
var cp = require('child_process');
var log = console.log;
module.exports = function () {
module.constructor.prototype.require = function (path) {
var self = this;
try {
return self.constructor._load(path, self);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
// Bail out, something went seriously wrong here!
throw e;
}
// Trying to import local file, not much we can help with here!
else if (path.charAt(0) === '.' || path.charAt(0) === '/' ) {
log('Local module at path ' + path + ' was not found!')
throw e;
}
else {
log('Looks like module ' + path + ' was not found! Installing...');
var results = cp.execSync('npm i ' + path, {stdio : [0, 1, 2]})
if (results && results.err) {
throw results.err;
} else {
return self.constructor._load(path, self);
}
}
}
}
}
| 'use strict';
var cp = require('child_process');
var log = console.log;
module.exports = function (npmOptions) {
if (typeof npmOptions != 'string' && npmOptions.constructor !== Array) {
throw new Error('Parameter must be an array or a single string!')
}
npmOptions = [].concat(npmOptions);
module.constructor.prototype.require = function (path) {
var self = this;
try {
return self.constructor._load(path, self);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
// Bail out, something went seriously wrong here!
throw e;
}
// Trying to import local file, not much we can help with here!
else if (path.charAt(0) === '.' || path.charAt(0) === '/' ) {
log('Local module at path ' + path + ' was not found!')
throw e;
}
else {
log('Looks like module ' + path + ' was not found! Installing...');
var cmdParameters = npmOptions.join(' ');
console.log(cmdParameters);
var results = cp.execSync('npm i ' + cmdParameters + ' ' + path, {stdio : [0, 1, 2]})
if (results && results.err) {
throw results.err;
} else {
return self.constructor._load(path, self);
}
}
}
}
}
| Add support for command line parameters | Add support for command line parameters
| JavaScript | mit | melonmanchan/yolorequire | javascript | ## Code Before:
'use strict';
var cp = require('child_process');
var log = console.log;
module.exports = function () {
module.constructor.prototype.require = function (path) {
var self = this;
try {
return self.constructor._load(path, self);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
// Bail out, something went seriously wrong here!
throw e;
}
// Trying to import local file, not much we can help with here!
else if (path.charAt(0) === '.' || path.charAt(0) === '/' ) {
log('Local module at path ' + path + ' was not found!')
throw e;
}
else {
log('Looks like module ' + path + ' was not found! Installing...');
var results = cp.execSync('npm i ' + path, {stdio : [0, 1, 2]})
if (results && results.err) {
throw results.err;
} else {
return self.constructor._load(path, self);
}
}
}
}
}
## Instruction:
Add support for command line parameters
## Code After:
'use strict';
var cp = require('child_process');
var log = console.log;
module.exports = function (npmOptions) {
if (typeof npmOptions != 'string' && npmOptions.constructor !== Array) {
throw new Error('Parameter must be an array or a single string!')
}
npmOptions = [].concat(npmOptions);
module.constructor.prototype.require = function (path) {
var self = this;
try {
return self.constructor._load(path, self);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
// Bail out, something went seriously wrong here!
throw e;
}
// Trying to import local file, not much we can help with here!
else if (path.charAt(0) === '.' || path.charAt(0) === '/' ) {
log('Local module at path ' + path + ' was not found!')
throw e;
}
else {
log('Looks like module ' + path + ' was not found! Installing...');
var cmdParameters = npmOptions.join(' ');
console.log(cmdParameters);
var results = cp.execSync('npm i ' + cmdParameters + ' ' + path, {stdio : [0, 1, 2]})
if (results && results.err) {
throw results.err;
} else {
return self.constructor._load(path, self);
}
}
}
}
}
| 'use strict';
var cp = require('child_process');
var log = console.log;
- module.exports = function () {
+ module.exports = function (npmOptions) {
? ++++++++++
+
+ if (typeof npmOptions != 'string' && npmOptions.constructor !== Array) {
+ throw new Error('Parameter must be an array or a single string!')
+ }
+ npmOptions = [].concat(npmOptions);
module.constructor.prototype.require = function (path) {
var self = this;
try {
return self.constructor._load(path, self);
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
// Bail out, something went seriously wrong here!
throw e;
}
// Trying to import local file, not much we can help with here!
else if (path.charAt(0) === '.' || path.charAt(0) === '/' ) {
log('Local module at path ' + path + ' was not found!')
throw e;
}
else {
log('Looks like module ' + path + ' was not found! Installing...');
+ var cmdParameters = npmOptions.join(' ');
+
+ console.log(cmdParameters);
- var results = cp.execSync('npm i ' + path, {stdio : [0, 1, 2]})
+ var results = cp.execSync('npm i ' + cmdParameters + ' ' + path, {stdio : [0, 1, 2]})
? ++++++++++++++++++++++
if (results && results.err) {
throw results.err;
} else {
return self.constructor._load(path, self);
}
}
}
}
}
| 12 | 0.324324 | 10 | 2 |
3a2d69ca3c6bce5f45c44263755539fd8e25ef25 | .travis.yml | .travis.yml | rvm:
- 1.9.2
- 1.9.3
before_script: ./spec/ci/before_script
script: ./spec/ci/script
env:
- RADIANT_VERSION=1.0.0 DB=mysql
- RADIANT_VERSION=1.0.0 DB=postgres
- RADIANT_VERSION=master DB=mysql
- RADIANT_VERSION=master DB=postgres
notifications:
recipients:
- sam@samwhited.com
| rvm:
- 1.9.3
before_script: ./spec/ci/before_script
script: ./spec/ci/script
env:
- RADIANT_VERSION=1.1.0 DB=mysql
- RADIANT_VERSION=1.1.0 DB=postgres
- RADIANT_VERSION=master DB=mysql
- RADIANT_VERSION=master DB=postgres
notifications:
recipients:
- sam@samwhited.com
| Use Radiant 1.1.0 and drop Ruby 1.9.2 in Travis | Use Radiant 1.1.0 and drop Ruby 1.9.2 in Travis
| YAML | mit | dramatech/radiant-minutes-extension,dramatech/radiant-minutes-extension | yaml | ## Code Before:
rvm:
- 1.9.2
- 1.9.3
before_script: ./spec/ci/before_script
script: ./spec/ci/script
env:
- RADIANT_VERSION=1.0.0 DB=mysql
- RADIANT_VERSION=1.0.0 DB=postgres
- RADIANT_VERSION=master DB=mysql
- RADIANT_VERSION=master DB=postgres
notifications:
recipients:
- sam@samwhited.com
## Instruction:
Use Radiant 1.1.0 and drop Ruby 1.9.2 in Travis
## Code After:
rvm:
- 1.9.3
before_script: ./spec/ci/before_script
script: ./spec/ci/script
env:
- RADIANT_VERSION=1.1.0 DB=mysql
- RADIANT_VERSION=1.1.0 DB=postgres
- RADIANT_VERSION=master DB=mysql
- RADIANT_VERSION=master DB=postgres
notifications:
recipients:
- sam@samwhited.com
| rvm:
- - 1.9.2
- 1.9.3
before_script: ./spec/ci/before_script
script: ./spec/ci/script
env:
- - RADIANT_VERSION=1.0.0 DB=mysql
? ^
+ - RADIANT_VERSION=1.1.0 DB=mysql
? ^
- - RADIANT_VERSION=1.0.0 DB=postgres
? ^
+ - RADIANT_VERSION=1.1.0 DB=postgres
? ^
- RADIANT_VERSION=master DB=mysql
- RADIANT_VERSION=master DB=postgres
notifications:
recipients:
- sam@samwhited.com | 5 | 0.294118 | 2 | 3 |
7e3c3e5b8d2550a757a900d25db0705fb1b43347 | .travis.yml | .travis.yml | language: python
python:
- "3.5"
- "3.6"
script: python -m unittest currency/bitcoin_test.py
addons:
code_climate:
repo_token: 4acc82347c0826abd052cff6ccd8d2f671bec563e6c42ac2c97f74f75fd96dcd | language: python
python:
- "3.5"
- "3.6"
script: python -m unittest currency/*_test*
addons:
code_climate:
repo_token: 4acc82347c0826abd052cff6ccd8d2f671bec563e6c42ac2c97f74f75fd96dcd | Test all currencies present in the directory | Test all currencies present in the directory
| YAML | mit | rvelhote/bitcoin-indicator,rvelhote/bitcoin-indicator | yaml | ## Code Before:
language: python
python:
- "3.5"
- "3.6"
script: python -m unittest currency/bitcoin_test.py
addons:
code_climate:
repo_token: 4acc82347c0826abd052cff6ccd8d2f671bec563e6c42ac2c97f74f75fd96dcd
## Instruction:
Test all currencies present in the directory
## Code After:
language: python
python:
- "3.5"
- "3.6"
script: python -m unittest currency/*_test*
addons:
code_climate:
repo_token: 4acc82347c0826abd052cff6ccd8d2f671bec563e6c42ac2c97f74f75fd96dcd | language: python
python:
- "3.5"
- "3.6"
- script: python -m unittest currency/bitcoin_test.py
? ^^^^^^^ ^^^
+ script: python -m unittest currency/*_test*
? ^ ^
addons:
code_climate:
repo_token: 4acc82347c0826abd052cff6ccd8d2f671bec563e6c42ac2c97f74f75fd96dcd | 2 | 0.25 | 1 | 1 |
039eda4fbdd9ac750f6cc328ea2a87de12e49876 | containers/run-portainer.sh | containers/run-portainer.sh | docker run \
--rm \
-d \
--name run-portainer \
-p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer
|
NAME=run-portainer
if [ "$(docker ps -q -f name=$NAME)" ]; then
read -p "alread running container $NAME, stop this (yes|no): " yesno
if [ "$yesno" = "yes" ]; then
echo "stop container"
docker stop $NAME
fi
exit 0
fi
docker run \
--rm \
-d \
--name $NAME \
-p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer
| Add option to stop container | Add option to stop container
| Shell | apache-2.0 | filipenos/dotfiles,filipenos/dotfiles,filipenos/dotfiles | shell | ## Code Before:
docker run \
--rm \
-d \
--name run-portainer \
-p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer
## Instruction:
Add option to stop container
## Code After:
NAME=run-portainer
if [ "$(docker ps -q -f name=$NAME)" ]; then
read -p "alread running container $NAME, stop this (yes|no): " yesno
if [ "$yesno" = "yes" ]; then
echo "stop container"
docker stop $NAME
fi
exit 0
fi
docker run \
--rm \
-d \
--name $NAME \
-p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer
| +
+ NAME=run-portainer
+
+ if [ "$(docker ps -q -f name=$NAME)" ]; then
+ read -p "alread running container $NAME, stop this (yes|no): " yesno
+ if [ "$yesno" = "yes" ]; then
+ echo "stop container"
+ docker stop $NAME
+ fi
+ exit 0
+ fi
+
docker run \
--rm \
-d \
- --name run-portainer \
+ --name $NAME \
-p 9000:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer | 14 | 1.75 | 13 | 1 |
9d30c7eb56634efe68b14c490a04ed58d1776a70 | types/react-window/tslint.json | types/react-window/tslint.json | {
"extends": "dtslint/dt.json",
"rules": {
"no-null-undefined-union": false // needed for optional Refs
}
}
| { "extends": "dtslint/dt.json" }
| Revert "react-window: disable no-null-undefined-union rule" | Revert "react-window: disable no-null-undefined-union rule"
This reverts commit ebf5589b09fa3186ff27df7001d626e66df06716.
| JSON | mit | mcliment/DefinitelyTyped,borisyankov/DefinitelyTyped,georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,borisyankov/DefinitelyTyped,georgemarshall/DefinitelyTyped,dsebastien/DefinitelyTyped,dsebastien/DefinitelyTyped,georgemarshall/DefinitelyTyped,markogresak/DefinitelyTyped | json | ## Code Before:
{
"extends": "dtslint/dt.json",
"rules": {
"no-null-undefined-union": false // needed for optional Refs
}
}
## Instruction:
Revert "react-window: disable no-null-undefined-union rule"
This reverts commit ebf5589b09fa3186ff27df7001d626e66df06716.
## Code After:
{ "extends": "dtslint/dt.json" }
| - {
- "extends": "dtslint/dt.json",
? ^^^ ^
+ { "extends": "dtslint/dt.json" }
? ^ ^^
- "rules": {
- "no-null-undefined-union": false // needed for optional Refs
- }
- } | 7 | 1.166667 | 1 | 6 |
a1b8f655343f6d6f530f120d912481aa7c77ba1c | recipes/zalando-cmdb-client/recipe.rb | recipes/zalando-cmdb-client/recipe.rb |
class ZalandoCMDBClient < FPM::Cookery::Recipe
description "Python client library for CMDB REST API."
name "zalando-cmdb-client"
version "1.0.14"
revision @REVISION@
arch "all"
homepage "https://stash.zalando.net/projects/PYMODULES/repos/zalando-cmdb-client/browse"
source "https://stash.zalando.net/scm/pymodules/zalando-cmdb-client.git", :with => :git, :tag => "#{version}"
maintainer "Sören König <soeren.koenig@zalando.de>"
build_depends "python-setuptools"
platforms [:ubuntu, :debian] do
depends "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-yaml >= 3.10"
end
platforms [:centos] do
depends "PyYAML >= 3.10", "python-argparse", "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-setuptools"
end
def build
safesystem 'python setup.py build'
end
def install
safesystem 'python setup.py install --root=../../tmp-dest --no-compile --install-layout=deb'
end
end
|
class ZalandoCMDBClient < FPM::Cookery::Recipe
description "Python client library for CMDB REST API."
name "zalando-cmdb-client"
version "1.0.14"
revision @REVISION@
arch "all"
homepage "https://stash.zalando.net/projects/PYMODULES/repos/zalando-cmdb-client/browse"
source "https://stash.zalando.net/scm/pymodules/zalando-cmdb-client.git", :with => :git, :tag => "#{version}"
maintainer "Sören König <soeren.koenig@zalando.de>"
build_depends "python-setuptools"
platforms [:ubuntu, :debian] do
depends "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-yaml >= 3.10"
end
platforms [:centos] do
depends "PyYAML >= 3.10", "python-argparse", "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-setuptools"
end
def build
safesystem 'python setup.py build'
end
def install
safesystem 'python setup.py install --root=../../tmp-dest --no-compile'
end
end
| Revert "change package content layout" | Revert "change package content layout"
This reverts commit 35b55404a989ad090b51362bef0e696de143d851.
| Ruby | mit | zalando/package-build,zalando/package-build,zalando/package-build | ruby | ## Code Before:
class ZalandoCMDBClient < FPM::Cookery::Recipe
description "Python client library for CMDB REST API."
name "zalando-cmdb-client"
version "1.0.14"
revision @REVISION@
arch "all"
homepage "https://stash.zalando.net/projects/PYMODULES/repos/zalando-cmdb-client/browse"
source "https://stash.zalando.net/scm/pymodules/zalando-cmdb-client.git", :with => :git, :tag => "#{version}"
maintainer "Sören König <soeren.koenig@zalando.de>"
build_depends "python-setuptools"
platforms [:ubuntu, :debian] do
depends "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-yaml >= 3.10"
end
platforms [:centos] do
depends "PyYAML >= 3.10", "python-argparse", "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-setuptools"
end
def build
safesystem 'python setup.py build'
end
def install
safesystem 'python setup.py install --root=../../tmp-dest --no-compile --install-layout=deb'
end
end
## Instruction:
Revert "change package content layout"
This reverts commit 35b55404a989ad090b51362bef0e696de143d851.
## Code After:
class ZalandoCMDBClient < FPM::Cookery::Recipe
description "Python client library for CMDB REST API."
name "zalando-cmdb-client"
version "1.0.14"
revision @REVISION@
arch "all"
homepage "https://stash.zalando.net/projects/PYMODULES/repos/zalando-cmdb-client/browse"
source "https://stash.zalando.net/scm/pymodules/zalando-cmdb-client.git", :with => :git, :tag => "#{version}"
maintainer "Sören König <soeren.koenig@zalando.de>"
build_depends "python-setuptools"
platforms [:ubuntu, :debian] do
depends "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-yaml >= 3.10"
end
platforms [:centos] do
depends "PyYAML >= 3.10", "python-argparse", "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-setuptools"
end
def build
safesystem 'python setup.py build'
end
def install
safesystem 'python setup.py install --root=../../tmp-dest --no-compile'
end
end
|
class ZalandoCMDBClient < FPM::Cookery::Recipe
description "Python client library for CMDB REST API."
name "zalando-cmdb-client"
version "1.0.14"
revision @REVISION@
arch "all"
homepage "https://stash.zalando.net/projects/PYMODULES/repos/zalando-cmdb-client/browse"
source "https://stash.zalando.net/scm/pymodules/zalando-cmdb-client.git", :with => :git, :tag => "#{version}"
maintainer "Sören König <soeren.koenig@zalando.de>"
build_depends "python-setuptools"
platforms [:ubuntu, :debian] do
depends "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-yaml >= 3.10"
end
platforms [:centos] do
depends "PyYAML >= 3.10", "python-argparse", "python-netaddr >= 0.7.5", "python-netifaces", "python-ordereddict", "python-paramiko >= 1.7.0", "python-setuptools"
end
def build
safesystem 'python setup.py build'
end
def install
- safesystem 'python setup.py install --root=../../tmp-dest --no-compile --install-layout=deb'
? ---------------------
+ safesystem 'python setup.py install --root=../../tmp-dest --no-compile'
end
end | 2 | 0.064516 | 1 | 1 |
7e858c84709c5091966eccaedd5809263dc94299 | src/controllers/RestController.php | src/controllers/RestController.php | <?php
class Zenc_EmailLogger_RestController extends Zenc_EmailLogger_Controller_Restful
{
protected $_methods = array('get');
public function getListAction()
{
$this->render(array(
'count' => $this->_getCollection()->count(),
'items' => $this->_getCollection()->walk(function($item) {
return array(
'id' => $item->getId(),
'subject' => $item->getSubject(),
'created_at' => $item->getCreatedAt(),
);
})
));
}
public function getReadAction()
{
$id = $this->getRequest()->get('id');
if ($id == 'last') {
$item = $this->_getCollection()->getLastItem();
} else {
$item = Mage::getModel('zenc_emaillogger/log')->load($id);
}
$this->render($item->getData());
}
private function _getCollection()
{
return Mage::getModel('zenc_emaillogger/log')->getCollection();
}
}
| <?php
class Zenc_EmailLogger_RestController extends Zenc_EmailLogger_Controller_Restful
{
protected $_methods = array('get');
public function getListAction()
{
$this->render(array(
'count' => $this->_getCollection()->count(),
'items' => $this->_getCollection()->walk(function($item) {
return array(
'id' => $item->getId(),
'subject' => $item->getSubject(),
'created_at' => $item->getCreatedAt(),
);
})
));
}
public function getReadAction()
{
$id = $this->getRequest()->get('id');
if ($id == 'last') {
$id = $this->_getCollection()->getLastItem()->getId();
}
$item = Mage::getModel('zenc_emaillogger/log')->load($id);
$this->render($item->getData());
}
private function _getCollection()
{
return Mage::getModel('zenc_emaillogger/log')->getCollection();
}
}
| Fix serialized fields not showing for latest item | Fix serialized fields not showing for latest item
| PHP | mit | technodelight/zenc-email-logger,technodelight/zenc-email-logger | php | ## Code Before:
<?php
class Zenc_EmailLogger_RestController extends Zenc_EmailLogger_Controller_Restful
{
protected $_methods = array('get');
public function getListAction()
{
$this->render(array(
'count' => $this->_getCollection()->count(),
'items' => $this->_getCollection()->walk(function($item) {
return array(
'id' => $item->getId(),
'subject' => $item->getSubject(),
'created_at' => $item->getCreatedAt(),
);
})
));
}
public function getReadAction()
{
$id = $this->getRequest()->get('id');
if ($id == 'last') {
$item = $this->_getCollection()->getLastItem();
} else {
$item = Mage::getModel('zenc_emaillogger/log')->load($id);
}
$this->render($item->getData());
}
private function _getCollection()
{
return Mage::getModel('zenc_emaillogger/log')->getCollection();
}
}
## Instruction:
Fix serialized fields not showing for latest item
## Code After:
<?php
class Zenc_EmailLogger_RestController extends Zenc_EmailLogger_Controller_Restful
{
protected $_methods = array('get');
public function getListAction()
{
$this->render(array(
'count' => $this->_getCollection()->count(),
'items' => $this->_getCollection()->walk(function($item) {
return array(
'id' => $item->getId(),
'subject' => $item->getSubject(),
'created_at' => $item->getCreatedAt(),
);
})
));
}
public function getReadAction()
{
$id = $this->getRequest()->get('id');
if ($id == 'last') {
$id = $this->_getCollection()->getLastItem()->getId();
}
$item = Mage::getModel('zenc_emaillogger/log')->load($id);
$this->render($item->getData());
}
private function _getCollection()
{
return Mage::getModel('zenc_emaillogger/log')->getCollection();
}
}
| <?php
class Zenc_EmailLogger_RestController extends Zenc_EmailLogger_Controller_Restful
{
protected $_methods = array('get');
public function getListAction()
{
$this->render(array(
'count' => $this->_getCollection()->count(),
'items' => $this->_getCollection()->walk(function($item) {
return array(
'id' => $item->getId(),
'subject' => $item->getSubject(),
'created_at' => $item->getCreatedAt(),
);
})
));
}
public function getReadAction()
{
$id = $this->getRequest()->get('id');
if ($id == 'last') {
- $item = $this->_getCollection()->getLastItem();
? ^^^
+ $id = $this->_getCollection()->getLastItem()->getId();
? ^ +++++++++
- } else {
- $item = Mage::getModel('zenc_emaillogger/log')->load($id);
}
+
+ $item = Mage::getModel('zenc_emaillogger/log')->load($id);
$this->render($item->getData());
}
private function _getCollection()
{
return Mage::getModel('zenc_emaillogger/log')->getCollection();
}
} | 6 | 0.162162 | 3 | 3 |
c690898f208bd2e8839f00d744afc49bf0a5ac7d | _includes/_reading_time.html | _includes/_reading_time.html | <span title="Estimated read time">
{% assign words = content | number_of_words %}
{% if words < 360 %}
1 min
{% else %}
{{ words | divided_by:180 }} min
{% endif %}
</span>
| <span title="Estimated read time">
{% if post.content != nil %}
{% assign words = post.content | number_of_words %}
{% else %}
{% assign words = content | number_of_words %}
{% endif %}
{% if words < 360 %}
1 min
{% else %}
{{ words | divided_by:180 }} min
{% endif %}
</span>
| Fix bug where reading time was using excerpt | Fix bug where reading time was using excerpt
| HTML | mit | pmarsceill/stately,pmarsceill/stately,pmarsceill/stately,pmarsceill/stately | html | ## Code Before:
<span title="Estimated read time">
{% assign words = content | number_of_words %}
{% if words < 360 %}
1 min
{% else %}
{{ words | divided_by:180 }} min
{% endif %}
</span>
## Instruction:
Fix bug where reading time was using excerpt
## Code After:
<span title="Estimated read time">
{% if post.content != nil %}
{% assign words = post.content | number_of_words %}
{% else %}
{% assign words = content | number_of_words %}
{% endif %}
{% if words < 360 %}
1 min
{% else %}
{{ words | divided_by:180 }} min
{% endif %}
</span>
| <span title="Estimated read time">
+ {% if post.content != nil %}
+ {% assign words = post.content | number_of_words %}
+ {% else %}
- {% assign words = content | number_of_words %}
+ {% assign words = content | number_of_words %}
? ++
+ {% endif %}
{% if words < 360 %}
1 min
{% else %}
{{ words | divided_by:180 }} min
{% endif %}
</span> | 6 | 0.75 | 5 | 1 |
00d83c1abc883f26b2762c6a1f0ae2997159ad56 | karma.conf.coffee | karma.conf.coffee | webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/helpers/**/*': ['webpack']
'./spec/**/*': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true
| webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
webpackConfig.plugins = []
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/helpers/**/*': ['webpack']
'./spec/**/*': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true
| Remove common chunks plugin when testing | Remove common chunks plugin when testing
| CoffeeScript | mit | juanca/marionette-tree,juanca/marionette-tree | coffeescript | ## Code Before:
webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/helpers/**/*': ['webpack']
'./spec/**/*': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true
## Instruction:
Remove common chunks plugin when testing
## Code After:
webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
webpackConfig.plugins = []
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/helpers/**/*': ['webpack']
'./spec/**/*': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true
| webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
+ webpackConfig.plugins = []
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/helpers/**/*': ['webpack']
'./spec/**/*': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true | 1 | 0.05 | 1 | 0 |
3ffc101a1a8b1ec17e5f2e509a1e5182a1f6f4b9 | fzn/utils.py | fzn/utils.py | import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = None
self.timed_out = False
def run(self, timeout=None):
def target():
self.process = sp.Popen(self.cmd,
stdout=sp.PIPE, stderr=sp.PIPE,
shell=True, preexec_fn=os.setpgrp)
self.stdout, self.stderr = self.process.communicate()
self.exitcode = self.process.returncode
thread = threading.Thread(target=target)
thread.start()
thread.join(float(timeout))
if thread.is_alive():
self.timed_out = True
# Send the TERM signal to all the process groups
os.killpg(self.process.pid, signal.SIGTERM)
thread.join(SIGTERM_TIMEOUT)
if thread.is_alive():
# Send the KILL signal if the process hasn't exited by now.
os.killpg(self.process.pid, signal.SIGKILL)
self.process.kill()
thread.join()
| import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = None
self.timed_out = False
def run(self, timeout=None):
def target():
cmd = self.cmd
if self.memlimit:
cmd = "ulimit -v %d; %s" % (self.memlimit, cmd)
self.process = sp.Popen(cmd,
stdout=sp.PIPE, stderr=sp.PIPE,
shell=True, preexec_fn=os.setpgrp)
self.stdout, self.stderr = self.process.communicate()
self.exitcode = self.process.returncode
thread = threading.Thread(target=target)
thread.start()
thread.join(float(timeout))
if thread.is_alive():
self.timed_out = True
# Send the TERM signal to all the process groups
os.killpg(self.process.pid, signal.SIGTERM)
thread.join(SIGTERM_TIMEOUT)
if thread.is_alive():
# Send the KILL signal if the process hasn't exited by now.
os.killpg(self.process.pid, signal.SIGKILL)
self.process.kill()
thread.join()
| Enable Command to support memory limiting. | Enable Command to support memory limiting.
| Python | lgpl-2.1 | eomahony/Numberjack,eomahony/Numberjack,eomahony/Numberjack,JElchison/Numberjack,JElchison/Numberjack,JElchison/Numberjack,JElchison/Numberjack,JElchison/Numberjack,eomahony/Numberjack,eomahony/Numberjack | python | ## Code Before:
import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = None
self.timed_out = False
def run(self, timeout=None):
def target():
self.process = sp.Popen(self.cmd,
stdout=sp.PIPE, stderr=sp.PIPE,
shell=True, preexec_fn=os.setpgrp)
self.stdout, self.stderr = self.process.communicate()
self.exitcode = self.process.returncode
thread = threading.Thread(target=target)
thread.start()
thread.join(float(timeout))
if thread.is_alive():
self.timed_out = True
# Send the TERM signal to all the process groups
os.killpg(self.process.pid, signal.SIGTERM)
thread.join(SIGTERM_TIMEOUT)
if thread.is_alive():
# Send the KILL signal if the process hasn't exited by now.
os.killpg(self.process.pid, signal.SIGKILL)
self.process.kill()
thread.join()
## Instruction:
Enable Command to support memory limiting.
## Code After:
import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = None
self.timed_out = False
def run(self, timeout=None):
def target():
cmd = self.cmd
if self.memlimit:
cmd = "ulimit -v %d; %s" % (self.memlimit, cmd)
self.process = sp.Popen(cmd,
stdout=sp.PIPE, stderr=sp.PIPE,
shell=True, preexec_fn=os.setpgrp)
self.stdout, self.stderr = self.process.communicate()
self.exitcode = self.process.returncode
thread = threading.Thread(target=target)
thread.start()
thread.join(float(timeout))
if thread.is_alive():
self.timed_out = True
# Send the TERM signal to all the process groups
os.killpg(self.process.pid, signal.SIGTERM)
thread.join(SIGTERM_TIMEOUT)
if thread.is_alive():
# Send the KILL signal if the process hasn't exited by now.
os.killpg(self.process.pid, signal.SIGKILL)
self.process.kill()
thread.join()
| import subprocess as sp
import signal
import threading
import os
SIGTERM_TIMEOUT = 1.0
class Command(object):
def __init__(self, cmd, memlimit=None):
self.cmd = cmd
self.memlimit = memlimit
self.process = None
self.stdout = None
self.stderr = None
self.exitcode = None
self.timed_out = False
def run(self, timeout=None):
def target():
+ cmd = self.cmd
+ if self.memlimit:
+ cmd = "ulimit -v %d; %s" % (self.memlimit, cmd)
- self.process = sp.Popen(self.cmd,
? -----
+ self.process = sp.Popen(cmd,
stdout=sp.PIPE, stderr=sp.PIPE,
shell=True, preexec_fn=os.setpgrp)
self.stdout, self.stderr = self.process.communicate()
self.exitcode = self.process.returncode
thread = threading.Thread(target=target)
thread.start()
thread.join(float(timeout))
if thread.is_alive():
self.timed_out = True
# Send the TERM signal to all the process groups
os.killpg(self.process.pid, signal.SIGTERM)
thread.join(SIGTERM_TIMEOUT)
if thread.is_alive():
# Send the KILL signal if the process hasn't exited by now.
os.killpg(self.process.pid, signal.SIGKILL)
self.process.kill()
thread.join() | 5 | 0.121951 | 4 | 1 |
676f9e0225ae91ce8594824094f144ae817263dc | fixed_array.rb | fixed_array.rb | class FixedArray
attr_reader :size
def initialize(size)
@size = size
size.times do |index|
set(index, nil)
end
end
def get(index)
instance_variable_get(name(index))
end
def set(index, value)
instance_variable_set(name(index), value)
value
end
private
def name(index)
raise IndexError unless (0...size).include?(index)
"@index#{index}"
end
end | class FixedArray
attr_reader :size
def initialize(size)
@size = size
size.times do |index|
set(index, nil)
end
end
def get(index)
instance_variable_get(name(index))
end
def set(index, value)
instance_variable_set(name(index), value)
end
private
def name(index)
raise IndexError unless (0...size).include?(index)
"@index#{index}"
end
end | Remove unnecessary line of code | Remove unnecessary line of code
| Ruby | mit | tra38/algorithms-phase4 | ruby | ## Code Before:
class FixedArray
attr_reader :size
def initialize(size)
@size = size
size.times do |index|
set(index, nil)
end
end
def get(index)
instance_variable_get(name(index))
end
def set(index, value)
instance_variable_set(name(index), value)
value
end
private
def name(index)
raise IndexError unless (0...size).include?(index)
"@index#{index}"
end
end
## Instruction:
Remove unnecessary line of code
## Code After:
class FixedArray
attr_reader :size
def initialize(size)
@size = size
size.times do |index|
set(index, nil)
end
end
def get(index)
instance_variable_get(name(index))
end
def set(index, value)
instance_variable_set(name(index), value)
end
private
def name(index)
raise IndexError unless (0...size).include?(index)
"@index#{index}"
end
end | class FixedArray
attr_reader :size
def initialize(size)
@size = size
size.times do |index|
set(index, nil)
end
end
def get(index)
instance_variable_get(name(index))
end
def set(index, value)
instance_variable_set(name(index), value)
- value
end
private
def name(index)
raise IndexError unless (0...size).include?(index)
"@index#{index}"
end
end | 1 | 0.038462 | 0 | 1 |
2fb97e436ca6a1c2f1a6865d7d8e40a45839ff99 | templates/index.html | templates/index.html | <html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div>
<input type="number" id="setting-value" name="setting" min="15" max="120"/>
<button id="setting">setting</button>
</div>
<div>
<button id="toggleAlarm">test</button>
</div>
<script src="../js/bookmarks.js"></script>
<script src="../js/alarm.js"></script>
<script src="../js/setting.js"></script>
</body>
</html>
| <html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div style="width:120px;">
<div>
Bookmarks Reminder
</div>
<div>
<input type="number" id="setting-value" name="setting" min="15" max="120"/>
<button id="setting">setting</button>
</div>
<div>
<button id="toggleAlarm">test</button>
</div>
</div>
<script src="../js/bookmarks.js"></script>
<script src="../js/alarm.js"></script>
<script src="../js/setting.js"></script>
</body>
</html>
| Add structure & css to browser action html | Add structure & css to browser action html
| HTML | mit | pinetree408/BookmarksReminder,pinetree408/BookmarksReminder | html | ## Code Before:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div>
<input type="number" id="setting-value" name="setting" min="15" max="120"/>
<button id="setting">setting</button>
</div>
<div>
<button id="toggleAlarm">test</button>
</div>
<script src="../js/bookmarks.js"></script>
<script src="../js/alarm.js"></script>
<script src="../js/setting.js"></script>
</body>
</html>
## Instruction:
Add structure & css to browser action html
## Code After:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<div style="width:120px;">
<div>
Bookmarks Reminder
</div>
<div>
<input type="number" id="setting-value" name="setting" min="15" max="120"/>
<button id="setting">setting</button>
</div>
<div>
<button id="toggleAlarm">test</button>
</div>
</div>
<script src="../js/bookmarks.js"></script>
<script src="../js/alarm.js"></script>
<script src="../js/setting.js"></script>
</body>
</html>
| <html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
+ <div style="width:120px;">
- <div>
+ <div>
? ++
+ Bookmarks Reminder
+ </div>
+ <div>
- <input type="number" id="setting-value" name="setting" min="15" max="120"/>
+ <input type="number" id="setting-value" name="setting" min="15" max="120"/>
? ++
- <button id="setting">setting</button>
+ <button id="setting">setting</button>
? ++
- </div>
+ </div>
? ++
- <div>
+ <div>
? ++
- <button id="toggleAlarm">test</button>
+ <button id="toggleAlarm">test</button>
? ++
+ </div>
</div>
<script src="../js/bookmarks.js"></script>
<script src="../js/alarm.js"></script>
<script src="../js/setting.js"></script>
</body>
</html> | 17 | 1 | 11 | 6 |
1eeb5c828567295b134d19ae259d952ef3062b53 | push-payload/server.js | push-payload/server.js | // Use the web-push library to hide the implementation details of the communication
// between the application server and the push service.
// For details, see https://tools.ietf.org/html/draft-ietf-webpush-protocol-01 and
// https://tools.ietf.org/html/draft-thomson-webpush-encryption-01.
var webPush = require('web-push');
webPush.setGCMAPIKey(process.env.GCM_API_KEY);
module.exports = function(app, route) {
app.post(route + 'register', function(req, res) {
// A real world application would store the subscription info.
res.sendStatus(201);
});
app.post(route + 'sendNotification', function(req, res) {
setTimeout(function() {
webPush.sendNotification(req.body.endpoint, req.body.ttl, req.body.key,
req.body.payload)
.then(function() {
res.sendStatus(201);
});
}, req.body.delay * 1000);
});
};
| // Use the web-push library to hide the implementation details of the communication
// between the application server and the push service.
// For details, see https://tools.ietf.org/html/draft-ietf-webpush-protocol-01 and
// https://tools.ietf.org/html/draft-thomson-webpush-encryption-01.
var webPush = require('web-push');
webPush.setGCMAPIKey(process.env.GCM_API_KEY);
module.exports = function(app, route) {
app.post(route + 'register', function(req, res) {
// A real world application would store the subscription info.
res.sendStatus(201);
});
app.post(route + 'sendNotification', function(req, res) {
setTimeout(function() {
webPush.sendNotification(req.body.endpoint, {
TTL: req.body.ttl,
payload: req.body.payload,
userPublicKey: req.body.key,
userAuth: req.body.authSecret,
})
.then(function() {
res.sendStatus(201);
});
}, req.body.delay * 1000);
});
};
| Send notification using the auth secret, if available | Send notification using the auth secret, if available
| JavaScript | mit | mozilla/serviceworker-cookbook,mozilla/serviceworker-cookbook | javascript | ## Code Before:
// Use the web-push library to hide the implementation details of the communication
// between the application server and the push service.
// For details, see https://tools.ietf.org/html/draft-ietf-webpush-protocol-01 and
// https://tools.ietf.org/html/draft-thomson-webpush-encryption-01.
var webPush = require('web-push');
webPush.setGCMAPIKey(process.env.GCM_API_KEY);
module.exports = function(app, route) {
app.post(route + 'register', function(req, res) {
// A real world application would store the subscription info.
res.sendStatus(201);
});
app.post(route + 'sendNotification', function(req, res) {
setTimeout(function() {
webPush.sendNotification(req.body.endpoint, req.body.ttl, req.body.key,
req.body.payload)
.then(function() {
res.sendStatus(201);
});
}, req.body.delay * 1000);
});
};
## Instruction:
Send notification using the auth secret, if available
## Code After:
// Use the web-push library to hide the implementation details of the communication
// between the application server and the push service.
// For details, see https://tools.ietf.org/html/draft-ietf-webpush-protocol-01 and
// https://tools.ietf.org/html/draft-thomson-webpush-encryption-01.
var webPush = require('web-push');
webPush.setGCMAPIKey(process.env.GCM_API_KEY);
module.exports = function(app, route) {
app.post(route + 'register', function(req, res) {
// A real world application would store the subscription info.
res.sendStatus(201);
});
app.post(route + 'sendNotification', function(req, res) {
setTimeout(function() {
webPush.sendNotification(req.body.endpoint, {
TTL: req.body.ttl,
payload: req.body.payload,
userPublicKey: req.body.key,
userAuth: req.body.authSecret,
})
.then(function() {
res.sendStatus(201);
});
}, req.body.delay * 1000);
});
};
| // Use the web-push library to hide the implementation details of the communication
// between the application server and the push service.
// For details, see https://tools.ietf.org/html/draft-ietf-webpush-protocol-01 and
// https://tools.ietf.org/html/draft-thomson-webpush-encryption-01.
var webPush = require('web-push');
webPush.setGCMAPIKey(process.env.GCM_API_KEY);
module.exports = function(app, route) {
app.post(route + 'register', function(req, res) {
// A real world application would store the subscription info.
res.sendStatus(201);
});
app.post(route + 'sendNotification', function(req, res) {
setTimeout(function() {
- webPush.sendNotification(req.body.endpoint, req.body.ttl, req.body.key,
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ webPush.sendNotification(req.body.endpoint, {
? ^
- req.body.payload)
+ TTL: req.body.ttl,
+ payload: req.body.payload,
+ userPublicKey: req.body.key,
+ userAuth: req.body.authSecret,
+ })
.then(function() {
res.sendStatus(201);
});
}, req.body.delay * 1000);
});
}; | 8 | 0.333333 | 6 | 2 |
e0a8e06319d8fefb79f7308c685f4de450002ae1 | sv/run.erb | sv/run.erb | exec 2>&1
exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %><% auth.each_pair do |name, password| %> -u <%= name %>:<%= password %><% end %><%= logger ? logger : '' %>
| exec 2>&1
exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %><% auth.each_pair do |name, password| %> -u <%= name %>:<%= password %><% end %><%= logger ? "-l \"#{logger}\"" : '' %>
| Fix registration of logger option | Fix registration of logger option
| HTML+ERB | mit | Undev/runit-man,Undev/runit-man,akzhan/runit-man,akzhan/runit-man,Undev/runit-man,akzhan/runit-man,Undev/runit-man,akzhan/runit-man | html+erb | ## Code Before:
exec 2>&1
exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %><% auth.each_pair do |name, password| %> -u <%= name %>:<%= password %><% end %><%= logger ? logger : '' %>
## Instruction:
Fix registration of logger option
## Code After:
exec 2>&1
exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %><% auth.each_pair do |name, password| %> -u <%= name %>:<%= password %><% end %><%= logger ? "-l \"#{logger}\"" : '' %>
| exec 2>&1
- exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %><% auth.each_pair do |name, password| %> -u <%= name %>:<%= password %><% end %><%= logger ? logger : '' %>
? ^^^^^^
+ exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %><% auth.each_pair do |name, password| %> -u <%= name %>:<%= password %><% end %><%= logger ? "-l \"#{logger}\"" : '' %>
? ^^^^^^^^^^^^^^^^^^
| 2 | 0.666667 | 1 | 1 |
581f8437e5555ce28d07aeee4baae6b4e9d05755 | Server/AzureLinkboard.Web/app/controllers/signupController.js | Server/AzureLinkboard.Web/app/controllers/signupController.js | 'use strict';
(function(controllers) {
controllers.controller('signupController', [
'$scope', '$location', '$timeout', 'authService', 'webApiValidationService', function ($scope, $location, $timeout, authService, webApiValidationService) {
$scope.message = "";
$scope.registration = {
email: "",
password: "",
confirmPassword: ""
};
$scope.saveResult = webApiValidationService.defaultModel();
$scope.signUp = function () {
if ($scope.regform.$invalid) {
return;
}
authService.saveRegistration($scope.registration).then(function(response) {
$scope.saveResult = response;
$scope.saveResult.message = "You have been registered successfully and will be redicted to login page in 2 seconds.";
startTimer();
},
function(response) {
$scope.saveResult = response;
});
};
var startTimer = function() {
var timer = $timeout(function() {
$timeout.cancel(timer);
$location.path('/login');
}, 2000);
}
}
]);
})(angular.module('linkboardControllers')); | 'use strict';
(function(controllers) {
controllers.controller('signupController', [
'$scope', '$location', '$timeout', 'authService', function ($scope, $location, $timeout, authService) {
$scope.message = "";
$scope.registration = {
email: "",
password: "",
confirmPassword: ""
};
$scope.saveResult = authService.defaultModel();
$scope.signUp = function () {
if ($scope.regform.$invalid) {
return;
}
authService.saveRegistration($scope.registration).then(function(response) {
$scope.saveResult = response;
$scope.saveResult.message = "You have been registered successfully and will be redicted to login page in 2 seconds.";
startTimer();
},
function(response) {
$scope.saveResult = response;
});
};
var startTimer = function() {
var timer = $timeout(function() {
$timeout.cancel(timer);
$location.path('/login');
}, 2000);
}
}
]);
})(angular.module('linkboardControllers')); | Clean up of the sign up controller | Clean up of the sign up controller
| JavaScript | mit | JamesRandall/AzureLinkboard,JamesRandall/AzureLinkboard | javascript | ## Code Before:
'use strict';
(function(controllers) {
controllers.controller('signupController', [
'$scope', '$location', '$timeout', 'authService', 'webApiValidationService', function ($scope, $location, $timeout, authService, webApiValidationService) {
$scope.message = "";
$scope.registration = {
email: "",
password: "",
confirmPassword: ""
};
$scope.saveResult = webApiValidationService.defaultModel();
$scope.signUp = function () {
if ($scope.regform.$invalid) {
return;
}
authService.saveRegistration($scope.registration).then(function(response) {
$scope.saveResult = response;
$scope.saveResult.message = "You have been registered successfully and will be redicted to login page in 2 seconds.";
startTimer();
},
function(response) {
$scope.saveResult = response;
});
};
var startTimer = function() {
var timer = $timeout(function() {
$timeout.cancel(timer);
$location.path('/login');
}, 2000);
}
}
]);
})(angular.module('linkboardControllers'));
## Instruction:
Clean up of the sign up controller
## Code After:
'use strict';
(function(controllers) {
controllers.controller('signupController', [
'$scope', '$location', '$timeout', 'authService', function ($scope, $location, $timeout, authService) {
$scope.message = "";
$scope.registration = {
email: "",
password: "",
confirmPassword: ""
};
$scope.saveResult = authService.defaultModel();
$scope.signUp = function () {
if ($scope.regform.$invalid) {
return;
}
authService.saveRegistration($scope.registration).then(function(response) {
$scope.saveResult = response;
$scope.saveResult.message = "You have been registered successfully and will be redicted to login page in 2 seconds.";
startTimer();
},
function(response) {
$scope.saveResult = response;
});
};
var startTimer = function() {
var timer = $timeout(function() {
$timeout.cancel(timer);
$location.path('/login');
}, 2000);
}
}
]);
})(angular.module('linkboardControllers')); | 'use strict';
(function(controllers) {
controllers.controller('signupController', [
- '$scope', '$location', '$timeout', 'authService', 'webApiValidationService', function ($scope, $location, $timeout, authService, webApiValidationService) {
? --------------------------- -------------------------
+ '$scope', '$location', '$timeout', 'authService', function ($scope, $location, $timeout, authService) {
$scope.message = "";
$scope.registration = {
email: "",
password: "",
confirmPassword: ""
};
- $scope.saveResult = webApiValidationService.defaultModel();
? ------- ^^^^ ^^^
+ $scope.saveResult = authService.defaultModel();
? ^ ^
$scope.signUp = function () {
if ($scope.regform.$invalid) {
return;
}
authService.saveRegistration($scope.registration).then(function(response) {
$scope.saveResult = response;
$scope.saveResult.message = "You have been registered successfully and will be redicted to login page in 2 seconds.";
startTimer();
},
function(response) {
$scope.saveResult = response;
});
};
var startTimer = function() {
var timer = $timeout(function() {
$timeout.cancel(timer);
$location.path('/login');
}, 2000);
}
}
]);
})(angular.module('linkboardControllers')); | 4 | 0.105263 | 2 | 2 |
1154403cfc2c92099959084657a304ef2a54775c | hack/ci.sh | hack/ci.sh | set -o errexit
set -o nounset
set -o pipefail
# Build images while we wait for services to start
make build APP_VERSION=build
# Wait for e2e service dependencies
./hack/test/wait-minikube.sh
# Setup service for nginx ingress controller. A DNS entry for *.certmanager.kubernetes.network has been setup to point to 10.0.0.15 for e2e tests
while true; do if kubectl get rc nginx-ingress-controller -n kube-system; then break; fi; echo "Waiting 5s for nginx-ingress-controller rc to be installed..."; sleep 5; done
kubectl expose -n kube-system --port 80 --target-port 80 --type ClusterIP rc nginx-ingress-controller --cluster-ip 10.0.0.15
while true; do if helm version; then break; fi; echo "Waiting 5s for tiller to be ready..."; sleep 5; done
make e2e_test E2E_NGINX_CERTIFICATE_DOMAIN=certmanager.kubernetes.network
| set -o errexit
set -o nounset
set -o pipefail
# Build images while we wait for services to start
make build APP_VERSION=build
# Wait for e2e service dependencies
./hack/test/wait-minikube.sh
# Setup service for nginx ingress controller. A DNS entry for *.certmanager.kubernetes.network has been setup to point to 10.0.0.15 for e2e tests
while true; do if kubectl get rc nginx-ingress-controller -n kube-system; then break; fi; echo "Waiting 5s for nginx-ingress-controller rc to be installed..."; sleep 5; done
kubectl expose -n kube-system --port 80 --target-port 80 --type ClusterIP rc nginx-ingress-controller --cluster-ip 10.0.0.15
while true; do if timeout 5 helm version; then break; fi; echo "Waiting 5s for tiller to be ready..."; sleep 5; done
make e2e_test E2E_NGINX_CERTIFICATE_DOMAIN=certmanager.kubernetes.network
| Set 5s timeout on helm version command | Set 5s timeout on helm version command
| Shell | apache-2.0 | cert-manager/cert-manager,jetstack/cert-manager,jetstack/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager,jetstack-experimental/cert-manager,jetstack-experimental/cert-manager,cert-manager/cert-manager,jetstack/cert-manager | shell | ## Code Before:
set -o errexit
set -o nounset
set -o pipefail
# Build images while we wait for services to start
make build APP_VERSION=build
# Wait for e2e service dependencies
./hack/test/wait-minikube.sh
# Setup service for nginx ingress controller. A DNS entry for *.certmanager.kubernetes.network has been setup to point to 10.0.0.15 for e2e tests
while true; do if kubectl get rc nginx-ingress-controller -n kube-system; then break; fi; echo "Waiting 5s for nginx-ingress-controller rc to be installed..."; sleep 5; done
kubectl expose -n kube-system --port 80 --target-port 80 --type ClusterIP rc nginx-ingress-controller --cluster-ip 10.0.0.15
while true; do if helm version; then break; fi; echo "Waiting 5s for tiller to be ready..."; sleep 5; done
make e2e_test E2E_NGINX_CERTIFICATE_DOMAIN=certmanager.kubernetes.network
## Instruction:
Set 5s timeout on helm version command
## Code After:
set -o errexit
set -o nounset
set -o pipefail
# Build images while we wait for services to start
make build APP_VERSION=build
# Wait for e2e service dependencies
./hack/test/wait-minikube.sh
# Setup service for nginx ingress controller. A DNS entry for *.certmanager.kubernetes.network has been setup to point to 10.0.0.15 for e2e tests
while true; do if kubectl get rc nginx-ingress-controller -n kube-system; then break; fi; echo "Waiting 5s for nginx-ingress-controller rc to be installed..."; sleep 5; done
kubectl expose -n kube-system --port 80 --target-port 80 --type ClusterIP rc nginx-ingress-controller --cluster-ip 10.0.0.15
while true; do if timeout 5 helm version; then break; fi; echo "Waiting 5s for tiller to be ready..."; sleep 5; done
make e2e_test E2E_NGINX_CERTIFICATE_DOMAIN=certmanager.kubernetes.network
| set -o errexit
set -o nounset
set -o pipefail
# Build images while we wait for services to start
make build APP_VERSION=build
# Wait for e2e service dependencies
./hack/test/wait-minikube.sh
# Setup service for nginx ingress controller. A DNS entry for *.certmanager.kubernetes.network has been setup to point to 10.0.0.15 for e2e tests
while true; do if kubectl get rc nginx-ingress-controller -n kube-system; then break; fi; echo "Waiting 5s for nginx-ingress-controller rc to be installed..."; sleep 5; done
kubectl expose -n kube-system --port 80 --target-port 80 --type ClusterIP rc nginx-ingress-controller --cluster-ip 10.0.0.15
- while true; do if helm version; then break; fi; echo "Waiting 5s for tiller to be ready..."; sleep 5; done
+ while true; do if timeout 5 helm version; then break; fi; echo "Waiting 5s for tiller to be ready..."; sleep 5; done
? ++++++++++
make e2e_test E2E_NGINX_CERTIFICATE_DOMAIN=certmanager.kubernetes.network | 2 | 0.125 | 1 | 1 |
423b33189bad310bad53d08bb5dc7f8f2d0e14ca | config/changes-2017.yml | config/changes-2017.yml | ---
- :date: 04-Jan-2017
:jira_id: '2118'
:description: |-
Allow focus on specific search result record via focus-id param.
- :date: 04-Jan-2017
:jira_id: '2079'
:description: |-
Integrate new tree editing facilities - new Tree tab for instances,
choose a workspace, show workspace status.
| ---
- :date: 04-Jan-2017
:jira_id: '2118'
:description: |-
Allow focus on specific search result record via focus_id param.
- :date: 04-Jan-2017
:jira_id: '2129'
:description: |-
Tree edit typeahead offers accepted names up to next higher major rank.
Also has checkbox to include "higher" ranks.
- :date: 04-Jan-2017
:jira_id: '2079'
:description: |-
Integrate new tree editing facilities - new Tree tab for instances,
choose a workspace, show workspace status.
| Add NSL-2129 to the 2017 changes. | Add NSL-2129 to the 2017 changes.
| YAML | apache-2.0 | bio-org-au/nsl-editor,bio-org-au/nsl-editor,bio-org-au/nsl-editor,bio-org-au/nsl-editor | yaml | ## Code Before:
---
- :date: 04-Jan-2017
:jira_id: '2118'
:description: |-
Allow focus on specific search result record via focus-id param.
- :date: 04-Jan-2017
:jira_id: '2079'
:description: |-
Integrate new tree editing facilities - new Tree tab for instances,
choose a workspace, show workspace status.
## Instruction:
Add NSL-2129 to the 2017 changes.
## Code After:
---
- :date: 04-Jan-2017
:jira_id: '2118'
:description: |-
Allow focus on specific search result record via focus_id param.
- :date: 04-Jan-2017
:jira_id: '2129'
:description: |-
Tree edit typeahead offers accepted names up to next higher major rank.
Also has checkbox to include "higher" ranks.
- :date: 04-Jan-2017
:jira_id: '2079'
:description: |-
Integrate new tree editing facilities - new Tree tab for instances,
choose a workspace, show workspace status.
| ---
- :date: 04-Jan-2017
:jira_id: '2118'
:description: |-
- Allow focus on specific search result record via focus-id param.
? ^
+ Allow focus on specific search result record via focus_id param.
? ^
+ - :date: 04-Jan-2017
+ :jira_id: '2129'
+ :description: |-
+ Tree edit typeahead offers accepted names up to next higher major rank.
+ Also has checkbox to include "higher" ranks.
- :date: 04-Jan-2017
:jira_id: '2079'
:description: |-
Integrate new tree editing facilities - new Tree tab for instances,
choose a workspace, show workspace status. | 7 | 0.7 | 6 | 1 |
17224dcda5230fe81e3fc20f712a322f09a6fe95 | index.js | index.js | module.exports = function oneliner(str) {
return str.replace(/[\r\n\t ]+/g, ' ');
};
| module.exports = function oneliner(str) {
return (str.raw? str.raw[0] : str).replace(/[\r\n\t ]+/g, ' ');
};
| Support calling oneliner with raw string | Support calling oneliner with raw string | JavaScript | mit | chtefi/one-liner | javascript | ## Code Before:
module.exports = function oneliner(str) {
return str.replace(/[\r\n\t ]+/g, ' ');
};
## Instruction:
Support calling oneliner with raw string
## Code After:
module.exports = function oneliner(str) {
return (str.raw? str.raw[0] : str).replace(/[\r\n\t ]+/g, ' ');
};
| module.exports = function oneliner(str) {
- return str.replace(/[\r\n\t ]+/g, ' ');
+ return (str.raw? str.raw[0] : str).replace(/[\r\n\t ]+/g, ' ');
? + +++++++++++++++++++++++
}; | 2 | 0.666667 | 1 | 1 |
4f85489b71b0cb851337e28fdc82a6a1491dcdf1 | src/gist/gist_file.rs | src/gist/gist_file.rs | extern crate rustc_serialize;
use self::rustc_serialize::json::{ToJson, Json};
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
pub struct GistFile {
pub name: String,
pub contents: String,
}
impl GistFile {
pub fn new(name: String) -> GistFile {
GistFile {
name: name,
contents: String::new(),
}
}
// Read standard input to contents buffer.
pub fn read_stdin(&mut self) -> Result<usize, io::Error> {
io::stdin().read_to_string(&mut self.contents)
}
// Read file to contents buffer.
pub fn read_file(&mut self) -> Result<usize, io::Error> {
let path = Path::new(&self.name);
let mut fh = File::open(&path).unwrap();
fh.read_to_string(&mut self.contents)
}
}
impl ToJson for GistFile {
fn to_json(&self) -> Json {
let mut root = BTreeMap::new();
root.insert("content".to_string(), self.contents.to_json());
Json::Object(root)
}
}
| extern crate rustc_serialize;
use self::rustc_serialize::json::{ToJson, Json};
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
pub struct GistFile {
pub name: String,
pub contents: String,
}
impl GistFile {
pub fn new(name: String) -> GistFile {
GistFile {
name: name,
contents: String::new(),
}
}
// Read standard input to contents buffer.
pub fn read_stdin(&mut self) -> io::Result<()> {
try!(io::stdin().read_to_string(&mut self.contents));
Ok(())
}
// Read file to contents buffer.
pub fn read_file(&mut self) -> io::Result<()> {
let path = Path::new(&self.name);
let mut fh = try!(File::open(&path));
try!(fh.read_to_string(&mut self.contents));
Ok(())
}
}
impl ToJson for GistFile {
fn to_json(&self) -> Json {
let mut root = BTreeMap::new();
root.insert("content".to_string(), self.contents.to_json());
Json::Object(root)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn read_invalid_file() {
let mut f = GistFile::new("/not/found.txt".to_string());
assert!(f.read_file().is_err());
}
#[test]
fn read_valid_file() {
let mut f = GistFile::new("Cargo.toml".to_string());
assert!(f.read_file().is_ok());
}
#[test]
fn read_closed_stdin() {
let mut f = GistFile::new("Cargo.toml".to_string());
assert!(f.read_stdin().is_err());
}
}
| Simplify GistFile's read functions return types. | Simplify GistFile's read functions return types.
| Rust | bsd-2-clause | LesPepitos/gist | rust | ## Code Before:
extern crate rustc_serialize;
use self::rustc_serialize::json::{ToJson, Json};
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
pub struct GistFile {
pub name: String,
pub contents: String,
}
impl GistFile {
pub fn new(name: String) -> GistFile {
GistFile {
name: name,
contents: String::new(),
}
}
// Read standard input to contents buffer.
pub fn read_stdin(&mut self) -> Result<usize, io::Error> {
io::stdin().read_to_string(&mut self.contents)
}
// Read file to contents buffer.
pub fn read_file(&mut self) -> Result<usize, io::Error> {
let path = Path::new(&self.name);
let mut fh = File::open(&path).unwrap();
fh.read_to_string(&mut self.contents)
}
}
impl ToJson for GistFile {
fn to_json(&self) -> Json {
let mut root = BTreeMap::new();
root.insert("content".to_string(), self.contents.to_json());
Json::Object(root)
}
}
## Instruction:
Simplify GistFile's read functions return types.
## Code After:
extern crate rustc_serialize;
use self::rustc_serialize::json::{ToJson, Json};
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
pub struct GistFile {
pub name: String,
pub contents: String,
}
impl GistFile {
pub fn new(name: String) -> GistFile {
GistFile {
name: name,
contents: String::new(),
}
}
// Read standard input to contents buffer.
pub fn read_stdin(&mut self) -> io::Result<()> {
try!(io::stdin().read_to_string(&mut self.contents));
Ok(())
}
// Read file to contents buffer.
pub fn read_file(&mut self) -> io::Result<()> {
let path = Path::new(&self.name);
let mut fh = try!(File::open(&path));
try!(fh.read_to_string(&mut self.contents));
Ok(())
}
}
impl ToJson for GistFile {
fn to_json(&self) -> Json {
let mut root = BTreeMap::new();
root.insert("content".to_string(), self.contents.to_json());
Json::Object(root)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn read_invalid_file() {
let mut f = GistFile::new("/not/found.txt".to_string());
assert!(f.read_file().is_err());
}
#[test]
fn read_valid_file() {
let mut f = GistFile::new("Cargo.toml".to_string());
assert!(f.read_file().is_ok());
}
#[test]
fn read_closed_stdin() {
let mut f = GistFile::new("Cargo.toml".to_string());
assert!(f.read_stdin().is_err());
}
}
| extern crate rustc_serialize;
use self::rustc_serialize::json::{ToJson, Json};
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
pub struct GistFile {
pub name: String,
pub contents: String,
}
impl GistFile {
pub fn new(name: String) -> GistFile {
GistFile {
name: name,
contents: String::new(),
}
}
// Read standard input to contents buffer.
- pub fn read_stdin(&mut self) -> Result<usize, io::Error> {
? ^^^^^^^^^^^^^^^^
+ pub fn read_stdin(&mut self) -> io::Result<()> {
? ++++ ^^
- io::stdin().read_to_string(&mut self.contents)
+ try!(io::stdin().read_to_string(&mut self.contents));
? +++++ ++
+ Ok(())
}
// Read file to contents buffer.
- pub fn read_file(&mut self) -> Result<usize, io::Error> {
? ^^^^^^^^^^^^^^^^
+ pub fn read_file(&mut self) -> io::Result<()> {
? ++++ ^^
let path = Path::new(&self.name);
- let mut fh = File::open(&path).unwrap();
? --------
+ let mut fh = try!(File::open(&path));
? +++++
+
- fh.read_to_string(&mut self.contents)
+ try!(fh.read_to_string(&mut self.contents));
? +++++ ++
+ Ok(())
}
}
impl ToJson for GistFile {
fn to_json(&self) -> Json {
let mut root = BTreeMap::new();
root.insert("content".to_string(), self.contents.to_json());
Json::Object(root)
}
}
+ #[cfg(test)]
+ mod tests {
+ use super::*;
+
+ #[test]
+ fn read_invalid_file() {
+ let mut f = GistFile::new("/not/found.txt".to_string());
+ assert!(f.read_file().is_err());
+ }
+
+ #[test]
+ fn read_valid_file() {
+ let mut f = GistFile::new("Cargo.toml".to_string());
+ assert!(f.read_file().is_ok());
+ }
+
+ #[test]
+ fn read_closed_stdin() {
+ let mut f = GistFile::new("Cargo.toml".to_string());
+ assert!(f.read_stdin().is_err());
+ }
+ } | 35 | 0.795455 | 30 | 5 |
56af2dbe7369575a5b7a1fb5202b728d6015846b | app/workers/concerns/waitable_worker.rb | app/workers/concerns/waitable_worker.rb | module WaitableWorker
extend ActiveSupport::Concern
module ClassMethods
# Schedules multiple jobs and waits for them to be completed.
def bulk_perform_and_wait(args_list)
# Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3
waiter = Gitlab::JobWaiter.new(args_list.size)
# Point all the bulk jobs at the same JobWaiter. Converts, [[1], [2], [3]]
# into [[1, "key"], [2, "key"], [3, "key"]]
waiting_args_list = args_list.map { |args| [*args, waiter.key] }
bulk_perform_async(waiting_args_list)
waiter.wait
end
# Performs multiple jobs directly. Failed jobs will be put into sidekiq so
# they can benefit from retries
def bulk_perform_inline(args_list)
failed = []
args_list.each do |args|
begin
new.perform(*args)
rescue
failed << args
end
end
bulk_perform_async(failed) if failed.present?
end
end
def perform(*args)
notify_key = args.pop if Gitlab::JobWaiter.key?(args.last)
super(*args)
ensure
Gitlab::JobWaiter.notify(notify_key, jid) if notify_key
end
end
| module WaitableWorker
extend ActiveSupport::Concern
module ClassMethods
# Schedules multiple jobs and waits for them to be completed.
def bulk_perform_and_wait(args_list, timeout: 10)
# Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3
waiter = Gitlab::JobWaiter.new(args_list.size)
# Point all the bulk jobs at the same JobWaiter. Converts, [[1], [2], [3]]
# into [[1, "key"], [2, "key"], [3, "key"]]
waiting_args_list = args_list.map { |args| [*args, waiter.key] }
bulk_perform_async(waiting_args_list)
waiter.wait(timeout)
end
# Performs multiple jobs directly. Failed jobs will be put into sidekiq so
# they can benefit from retries
def bulk_perform_inline(args_list)
failed = []
args_list.each do |args|
begin
new.perform(*args)
rescue
failed << args
end
end
bulk_perform_async(failed) if failed.present?
end
end
def perform(*args)
notify_key = args.pop if Gitlab::JobWaiter.key?(args.last)
super(*args)
ensure
Gitlab::JobWaiter.notify(notify_key, jid) if notify_key
end
end
| Allow bulk_perform_and_wait wait timeout to be overridden | Allow bulk_perform_and_wait wait timeout to be overridden
| Ruby | mit | stoplightio/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,axilleas/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,axilleas/gitlabhq,iiet/iiet-git,dreampet/gitlab,dreampet/gitlab,iiet/iiet-git,jirutka/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,dreampet/gitlab,stoplightio/gitlabhq,jirutka/gitlabhq | ruby | ## Code Before:
module WaitableWorker
extend ActiveSupport::Concern
module ClassMethods
# Schedules multiple jobs and waits for them to be completed.
def bulk_perform_and_wait(args_list)
# Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3
waiter = Gitlab::JobWaiter.new(args_list.size)
# Point all the bulk jobs at the same JobWaiter. Converts, [[1], [2], [3]]
# into [[1, "key"], [2, "key"], [3, "key"]]
waiting_args_list = args_list.map { |args| [*args, waiter.key] }
bulk_perform_async(waiting_args_list)
waiter.wait
end
# Performs multiple jobs directly. Failed jobs will be put into sidekiq so
# they can benefit from retries
def bulk_perform_inline(args_list)
failed = []
args_list.each do |args|
begin
new.perform(*args)
rescue
failed << args
end
end
bulk_perform_async(failed) if failed.present?
end
end
def perform(*args)
notify_key = args.pop if Gitlab::JobWaiter.key?(args.last)
super(*args)
ensure
Gitlab::JobWaiter.notify(notify_key, jid) if notify_key
end
end
## Instruction:
Allow bulk_perform_and_wait wait timeout to be overridden
## Code After:
module WaitableWorker
extend ActiveSupport::Concern
module ClassMethods
# Schedules multiple jobs and waits for them to be completed.
def bulk_perform_and_wait(args_list, timeout: 10)
# Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3
waiter = Gitlab::JobWaiter.new(args_list.size)
# Point all the bulk jobs at the same JobWaiter. Converts, [[1], [2], [3]]
# into [[1, "key"], [2, "key"], [3, "key"]]
waiting_args_list = args_list.map { |args| [*args, waiter.key] }
bulk_perform_async(waiting_args_list)
waiter.wait(timeout)
end
# Performs multiple jobs directly. Failed jobs will be put into sidekiq so
# they can benefit from retries
def bulk_perform_inline(args_list)
failed = []
args_list.each do |args|
begin
new.perform(*args)
rescue
failed << args
end
end
bulk_perform_async(failed) if failed.present?
end
end
def perform(*args)
notify_key = args.pop if Gitlab::JobWaiter.key?(args.last)
super(*args)
ensure
Gitlab::JobWaiter.notify(notify_key, jid) if notify_key
end
end
| module WaitableWorker
extend ActiveSupport::Concern
module ClassMethods
# Schedules multiple jobs and waits for them to be completed.
- def bulk_perform_and_wait(args_list)
+ def bulk_perform_and_wait(args_list, timeout: 10)
? +++++++++++++
# Short-circuit: it's more efficient to do small numbers of jobs inline
return bulk_perform_inline(args_list) if args_list.size <= 3
waiter = Gitlab::JobWaiter.new(args_list.size)
# Point all the bulk jobs at the same JobWaiter. Converts, [[1], [2], [3]]
# into [[1, "key"], [2, "key"], [3, "key"]]
waiting_args_list = args_list.map { |args| [*args, waiter.key] }
bulk_perform_async(waiting_args_list)
- waiter.wait
+ waiter.wait(timeout)
? +++++++++
end
# Performs multiple jobs directly. Failed jobs will be put into sidekiq so
# they can benefit from retries
def bulk_perform_inline(args_list)
failed = []
args_list.each do |args|
begin
new.perform(*args)
rescue
failed << args
end
end
bulk_perform_async(failed) if failed.present?
end
end
def perform(*args)
notify_key = args.pop if Gitlab::JobWaiter.key?(args.last)
super(*args)
ensure
Gitlab::JobWaiter.notify(notify_key, jid) if notify_key
end
end | 4 | 0.090909 | 2 | 2 |
6a68765feed4b042e7de5a43882c14fb27440f60 | dropwizard-views/src/main/java/io/dropwizard/views/ViewRenderExceptionMapper.java | dropwizard-views/src/main/java/io/dropwizard/views/ViewRenderExceptionMapper.java | package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An {@link ExceptionMapper} that returns a 500 error response with a generic
* HTML error page when a {@link ViewRenderException} is thrown.
*
* @since 1.1.0
*/
@Provider
public class ViewRenderExceptionMapper implements ExceptionMapper<WebApplicationException> {
private static final Logger LOGGER = LoggerFactory.getLogger(ViewRenderExceptionMapper.class);
/**
* The generic HTML error page template.
*/
public static final String TEMPLATE_ERROR_MSG =
"<html>" +
"<head><title>Template Error</title></head>" +
"<body><h1>Template Error</h1><p>Something went wrong rendering the page</p></body>" +
"</html>";
@Override
public Response toResponse(WebApplicationException exception) {
Throwable cause = exception.getCause();
if (cause instanceof ViewRenderException) {
LOGGER.error("Template Error", cause);
return Response.serverError()
.type(MediaType.TEXT_HTML_TYPE)
.entity(TEMPLATE_ERROR_MSG)
.build();
}
return exception.getResponse();
}
}
| package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.glassfish.jersey.spi.ExtendedExceptionMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An {@link ExtendedExceptionMapper} that returns a 500 error response with a generic
* HTML error page when a {@link ViewRenderException} is the cause.
*
* @since 1.1.0
*/
@Provider
public class ViewRenderExceptionMapper implements ExtendedExceptionMapper<WebApplicationException> {
private static final Logger LOGGER = LoggerFactory.getLogger(ViewRenderExceptionMapper.class);
/**
* The generic HTML error page template.
*/
public static final String TEMPLATE_ERROR_MSG =
"<html>" +
"<head><title>Template Error</title></head>" +
"<body><h1>Template Error</h1><p>Something went wrong rendering the page</p></body>" +
"</html>";
@Override
public Response toResponse(WebApplicationException exception) {
LOGGER.error("Template Error", exception);
return Response.serverError()
.type(MediaType.TEXT_HTML_TYPE)
.entity(TEMPLATE_ERROR_MSG)
.build();
}
@Override
public boolean isMappable(WebApplicationException e) {
return ExceptionUtils.indexOfThrowable(e, ViewRenderException.class) != -1;
}
}
| Move ViewExceptionMapper to an ExtendedExceptionMapper | Move ViewExceptionMapper to an ExtendedExceptionMapper
| Java | apache-2.0 | taltmann/dropwizard,micsta/dropwizard,phambryan/dropwizard,kjetilv/dropwizard,cvent/dropwizard,evnm/dropwizard,jplock/dropwizard,aaanders/dropwizard,tburch/dropwizard,tburch/dropwizard,dotCipher/dropwizard,tjcutajar/dropwizard,shawnsmith/dropwizard,cvent/dropwizard,pkwarren/dropwizard,jplock/dropwizard,phambryan/dropwizard,qinfchen/dropwizard,mosoft521/dropwizard,patrox/dropwizard,pkwarren/dropwizard,dotCipher/dropwizard,shawnsmith/dropwizard,nickbabcock/dropwizard,evnm/dropwizard,tjcutajar/dropwizard,Alexey1Gavrilov/dropwizard,pkwarren/dropwizard,dropwizard/dropwizard,mosoft521/dropwizard,nickbabcock/dropwizard,tburch/dropwizard,evnm/dropwizard,dropwizard/dropwizard,taltmann/dropwizard,micsta/dropwizard,kjetilv/dropwizard,jplock/dropwizard,phambryan/dropwizard,tjcutajar/dropwizard,aaanders/dropwizard,Alexey1Gavrilov/dropwizard,takecy/dropwizard,mosoft521/dropwizard,nickbabcock/dropwizard,qinfchen/dropwizard,dotCipher/dropwizard,patrox/dropwizard,aaanders/dropwizard,kjetilv/dropwizard,micsta/dropwizard,takecy/dropwizard,patrox/dropwizard,qinfchen/dropwizard,Alexey1Gavrilov/dropwizard,taltmann/dropwizard,dropwizard/dropwizard,cvent/dropwizard,takecy/dropwizard,shawnsmith/dropwizard | java | ## Code Before:
package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An {@link ExceptionMapper} that returns a 500 error response with a generic
* HTML error page when a {@link ViewRenderException} is thrown.
*
* @since 1.1.0
*/
@Provider
public class ViewRenderExceptionMapper implements ExceptionMapper<WebApplicationException> {
private static final Logger LOGGER = LoggerFactory.getLogger(ViewRenderExceptionMapper.class);
/**
* The generic HTML error page template.
*/
public static final String TEMPLATE_ERROR_MSG =
"<html>" +
"<head><title>Template Error</title></head>" +
"<body><h1>Template Error</h1><p>Something went wrong rendering the page</p></body>" +
"</html>";
@Override
public Response toResponse(WebApplicationException exception) {
Throwable cause = exception.getCause();
if (cause instanceof ViewRenderException) {
LOGGER.error("Template Error", cause);
return Response.serverError()
.type(MediaType.TEXT_HTML_TYPE)
.entity(TEMPLATE_ERROR_MSG)
.build();
}
return exception.getResponse();
}
}
## Instruction:
Move ViewExceptionMapper to an ExtendedExceptionMapper
## Code After:
package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.glassfish.jersey.spi.ExtendedExceptionMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An {@link ExtendedExceptionMapper} that returns a 500 error response with a generic
* HTML error page when a {@link ViewRenderException} is the cause.
*
* @since 1.1.0
*/
@Provider
public class ViewRenderExceptionMapper implements ExtendedExceptionMapper<WebApplicationException> {
private static final Logger LOGGER = LoggerFactory.getLogger(ViewRenderExceptionMapper.class);
/**
* The generic HTML error page template.
*/
public static final String TEMPLATE_ERROR_MSG =
"<html>" +
"<head><title>Template Error</title></head>" +
"<body><h1>Template Error</h1><p>Something went wrong rendering the page</p></body>" +
"</html>";
@Override
public Response toResponse(WebApplicationException exception) {
LOGGER.error("Template Error", exception);
return Response.serverError()
.type(MediaType.TEXT_HTML_TYPE)
.entity(TEMPLATE_ERROR_MSG)
.build();
}
@Override
public boolean isMappable(WebApplicationException e) {
return ExceptionUtils.indexOfThrowable(e, ViewRenderException.class) != -1;
}
}
| package io.dropwizard.views;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
- import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
+ import org.apache.commons.lang3.exception.ExceptionUtils;
+ import org.glassfish.jersey.spi.ExtendedExceptionMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * An {@link ExceptionMapper} that returns a 500 error response with a generic
+ * An {@link ExtendedExceptionMapper} that returns a 500 error response with a generic
? ++++++++
- * HTML error page when a {@link ViewRenderException} is thrown.
? ^^^^
+ * HTML error page when a {@link ViewRenderException} is the cause.
? ^^^^^^^
- *
? -
+ *
* @since 1.1.0
*/
@Provider
- public class ViewRenderExceptionMapper implements ExceptionMapper<WebApplicationException> {
+ public class ViewRenderExceptionMapper implements ExtendedExceptionMapper<WebApplicationException> {
? ++++++++
-
+
private static final Logger LOGGER = LoggerFactory.getLogger(ViewRenderExceptionMapper.class);
/**
* The generic HTML error page template.
*/
public static final String TEMPLATE_ERROR_MSG =
"<html>" +
"<head><title>Template Error</title></head>" +
"<body><h1>Template Error</h1><p>Something went wrong rendering the page</p></body>" +
"</html>";
@Override
public Response toResponse(WebApplicationException exception) {
- Throwable cause = exception.getCause();
- if (cause instanceof ViewRenderException) {
- LOGGER.error("Template Error", cause);
? ---- ---
+ LOGGER.error("Template Error", exception);
? ++ +++++
- return Response.serverError()
? ----
+ return Response.serverError()
- .type(MediaType.TEXT_HTML_TYPE)
? ----
+ .type(MediaType.TEXT_HTML_TYPE)
- .entity(TEMPLATE_ERROR_MSG)
? ----
+ .entity(TEMPLATE_ERROR_MSG)
- .build();
? ----
+ .build();
- }
- return exception.getResponse();
}
+ @Override
+ public boolean isMappable(WebApplicationException e) {
+ return ExceptionUtils.indexOfThrowable(e, ViewRenderException.class) != -1;
+ }
} | 31 | 0.688889 | 16 | 15 |
60352e8a3c41ec804ac1bd6b9f3af4bf611edc0b | profiles/views.py | profiles/views.py | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.views.generic import FormView, TemplateView
from django.utils.datastructures import MultiValueDictKeyError
from incuna.utils import get_class_from_path
from profiles.models import Profile
from profiles.utils import class_view_decorator
try:
ProfileForm = get_class_from_path(settings.PROFILE_FORM_CLASS)
except AttributeError:
from forms import ProfileForm
@class_view_decorator(login_required)
class ProfileView(TemplateView):
template_name = 'profiles/profile.html'
@class_view_decorator(login_required)
class ProfileEdit(FormView):
form_class = ProfileForm
template_name = 'profiles/profile_form.html'
def form_valid(self, form):
instance = super(ProfileEdit, self).form_valid(form)
self.request.user.message_set.create(message='Your profile has been updated.')
return instance
def get_context_data(self, **kwargs):
context = super(ProfileEdit, self).get_context_data(**kwargs)
context['site'] = Site.objects.get_current()
return context
def get_object(self):
if isinstance(self.request.user, Profile):
return self.request.user
return self.request.user.profile
def get_success_url(self):
try:
return self.request.GET['next']
except MultiValueDictKeyError:
return reverse('profile')
| from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
from incuna.utils import get_class_from_path
from profiles.models import Profile
from profiles.utils import class_view_decorator
try:
ProfileForm = get_class_from_path(settings.PROFILE_FORM_CLASS)
except AttributeError:
from forms import ProfileForm
@class_view_decorator(login_required)
class ProfileView(TemplateView):
template_name = 'profiles/profile.html'
@class_view_decorator(login_required)
class ProfileEdit(UpdateView):
form_class = ProfileForm
template_name = 'profiles/profile_form.html'
def form_valid(self, form):
instance = super(ProfileEdit, self).form_valid(form)
self.request.user.message_set.create(message='Your profile has been updated.')
return instance
def get_context_data(self, **kwargs):
context = super(ProfileEdit, self).get_context_data(**kwargs)
context['site'] = Site.objects.get_current()
return context
def get_object(self):
if isinstance(self.request.user, Profile):
return self.request.user
return self.request.user.profile
def get_success_url(self):
try:
return self.request.GET['next']
except MultiValueDictKeyError:
return reverse('profile')
| Use an update view instead of form view | Use an update view instead of form view
| Python | bsd-2-clause | incuna/django-extensible-profiles | python | ## Code Before:
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.views.generic import FormView, TemplateView
from django.utils.datastructures import MultiValueDictKeyError
from incuna.utils import get_class_from_path
from profiles.models import Profile
from profiles.utils import class_view_decorator
try:
ProfileForm = get_class_from_path(settings.PROFILE_FORM_CLASS)
except AttributeError:
from forms import ProfileForm
@class_view_decorator(login_required)
class ProfileView(TemplateView):
template_name = 'profiles/profile.html'
@class_view_decorator(login_required)
class ProfileEdit(FormView):
form_class = ProfileForm
template_name = 'profiles/profile_form.html'
def form_valid(self, form):
instance = super(ProfileEdit, self).form_valid(form)
self.request.user.message_set.create(message='Your profile has been updated.')
return instance
def get_context_data(self, **kwargs):
context = super(ProfileEdit, self).get_context_data(**kwargs)
context['site'] = Site.objects.get_current()
return context
def get_object(self):
if isinstance(self.request.user, Profile):
return self.request.user
return self.request.user.profile
def get_success_url(self):
try:
return self.request.GET['next']
except MultiValueDictKeyError:
return reverse('profile')
## Instruction:
Use an update view instead of form view
## Code After:
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.generic import TemplateView, UpdateView
from incuna.utils import get_class_from_path
from profiles.models import Profile
from profiles.utils import class_view_decorator
try:
ProfileForm = get_class_from_path(settings.PROFILE_FORM_CLASS)
except AttributeError:
from forms import ProfileForm
@class_view_decorator(login_required)
class ProfileView(TemplateView):
template_name = 'profiles/profile.html'
@class_view_decorator(login_required)
class ProfileEdit(UpdateView):
form_class = ProfileForm
template_name = 'profiles/profile_form.html'
def form_valid(self, form):
instance = super(ProfileEdit, self).form_valid(form)
self.request.user.message_set.create(message='Your profile has been updated.')
return instance
def get_context_data(self, **kwargs):
context = super(ProfileEdit, self).get_context_data(**kwargs)
context['site'] = Site.objects.get_current()
return context
def get_object(self):
if isinstance(self.request.user, Profile):
return self.request.user
return self.request.user.profile
def get_success_url(self):
try:
return self.request.GET['next']
except MultiValueDictKeyError:
return reverse('profile')
| from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
- from django.views.generic import FormView, TemplateView
from django.utils.datastructures import MultiValueDictKeyError
+ from django.views.generic import TemplateView, UpdateView
from incuna.utils import get_class_from_path
from profiles.models import Profile
from profiles.utils import class_view_decorator
try:
ProfileForm = get_class_from_path(settings.PROFILE_FORM_CLASS)
except AttributeError:
from forms import ProfileForm
@class_view_decorator(login_required)
class ProfileView(TemplateView):
template_name = 'profiles/profile.html'
@class_view_decorator(login_required)
- class ProfileEdit(FormView):
? ^^^^
+ class ProfileEdit(UpdateView):
? ^^^^^^
form_class = ProfileForm
template_name = 'profiles/profile_form.html'
def form_valid(self, form):
instance = super(ProfileEdit, self).form_valid(form)
self.request.user.message_set.create(message='Your profile has been updated.')
return instance
def get_context_data(self, **kwargs):
context = super(ProfileEdit, self).get_context_data(**kwargs)
context['site'] = Site.objects.get_current()
return context
def get_object(self):
if isinstance(self.request.user, Profile):
return self.request.user
return self.request.user.profile
def get_success_url(self):
try:
return self.request.GET['next']
except MultiValueDictKeyError:
return reverse('profile')
| 4 | 0.083333 | 2 | 2 |
5b74efcb9adf438c264c243238e69c636d1d7420 | cla_public/templates/scope/ineligible.html | cla_public/templates/scope/ineligible.html | {% extends "base.html" %}
{% set title = _('Legal aid is not available for this type of problem') %}
{% block page_title %}{{ title }} - {{ super() }}{% endblock %}
{% block inner_content %}
<h1>Legal aid is not available for this type of problem</h1>
<p class="subtitle">You can still seek advice from a legal adviser - you will have to pay for this advice.</p>
<a class="button button-larger" href="https://www.gov.uk/find-a-legal-adviser">Find a legal adviser</a>
{% include '_help-orgs.html' %}
{% endblock %}
| {% extends "base.html" %}
{% set title = _('Legal aid is not available for this type of problem') %}
{% block page_title %}{{ title }} - {{ super() }}{% endblock %}
{% block inner_content %}
<h1>{{ _('Legal aid is not available for this type of problem') }}</h1>
<p class="subtitle">
{{ _('You can still seek advice from a legal adviser - you will have to pay for this advice.') }}
</p>
<a class="button button-larger" href="https://www.gov.uk/find-a-legal-adviser" target="_blank">
{{ _('Find a legal adviser') }}
</a>
{% include '_help-orgs.html' %}
{% endblock %}
| Add wrap copy in gettext | FE: Add wrap copy in gettext
| HTML | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public | html | ## Code Before:
{% extends "base.html" %}
{% set title = _('Legal aid is not available for this type of problem') %}
{% block page_title %}{{ title }} - {{ super() }}{% endblock %}
{% block inner_content %}
<h1>Legal aid is not available for this type of problem</h1>
<p class="subtitle">You can still seek advice from a legal adviser - you will have to pay for this advice.</p>
<a class="button button-larger" href="https://www.gov.uk/find-a-legal-adviser">Find a legal adviser</a>
{% include '_help-orgs.html' %}
{% endblock %}
## Instruction:
FE: Add wrap copy in gettext
## Code After:
{% extends "base.html" %}
{% set title = _('Legal aid is not available for this type of problem') %}
{% block page_title %}{{ title }} - {{ super() }}{% endblock %}
{% block inner_content %}
<h1>{{ _('Legal aid is not available for this type of problem') }}</h1>
<p class="subtitle">
{{ _('You can still seek advice from a legal adviser - you will have to pay for this advice.') }}
</p>
<a class="button button-larger" href="https://www.gov.uk/find-a-legal-adviser" target="_blank">
{{ _('Find a legal adviser') }}
</a>
{% include '_help-orgs.html' %}
{% endblock %}
| {% extends "base.html" %}
{% set title = _('Legal aid is not available for this type of problem') %}
{% block page_title %}{{ title }} - {{ super() }}{% endblock %}
{% block inner_content %}
- <h1>Legal aid is not available for this type of problem</h1>
+ <h1>{{ _('Legal aid is not available for this type of problem') }}</h1>
? ++++++ +++++
+ <p class="subtitle">
- <p class="subtitle">You can still seek advice from a legal adviser - you will have to pay for this advice.</p>
? -- ^^^^^^^^^^^^^^^^^ ^^^^
+ {{ _('You can still seek advice from a legal adviser - you will have to pay for this advice.') }}
? ^^^^^^^ ^^^^^
+ </p>
- <a class="button button-larger" href="https://www.gov.uk/find-a-legal-adviser">Find a legal adviser</a>
? ------------------------
+ <a class="button button-larger" href="https://www.gov.uk/find-a-legal-adviser" target="_blank">
? ++++++++++++++++
+ {{ _('Find a legal adviser') }}
+ </a>
{% include '_help-orgs.html' %}
{% endblock %} | 10 | 0.666667 | 7 | 3 |
76bc29a237982071a9f84e9c1dec6ea7c235afa4 | .gitlab-ci.yml | .gitlab-ci.yml | stages:
- deploy
deploy:
variables:
DEST_PATH: "/var/www/serubin_net/"
stage: deploy
only:
- master
script:
- npm i
- grunt build
- jekyll build --incremental -d $DEST_PATH
| stages:
- deploy
deploy:
variables:
DEST_PATH: "/var/www/serubin_net/"
stage: deploy
only:
- master
script:
- git pull --recurse-submodules=yes origin master && git submodule init && git submodule update
- npm i
- grunt build
- jekyll build --incremental -d $DEST_PATH
| Enable recursive pull for resume | Fix: Enable recursive pull for resume
| YAML | mit | Serubin/Serubin-net,Serubin/Serubin-net | yaml | ## Code Before:
stages:
- deploy
deploy:
variables:
DEST_PATH: "/var/www/serubin_net/"
stage: deploy
only:
- master
script:
- npm i
- grunt build
- jekyll build --incremental -d $DEST_PATH
## Instruction:
Fix: Enable recursive pull for resume
## Code After:
stages:
- deploy
deploy:
variables:
DEST_PATH: "/var/www/serubin_net/"
stage: deploy
only:
- master
script:
- git pull --recurse-submodules=yes origin master && git submodule init && git submodule update
- npm i
- grunt build
- jekyll build --incremental -d $DEST_PATH
| stages:
- deploy
deploy:
variables:
DEST_PATH: "/var/www/serubin_net/"
stage: deploy
only:
- master
script:
+ - git pull --recurse-submodules=yes origin master && git submodule init && git submodule update
- npm i
- grunt build
- jekyll build --incremental -d $DEST_PATH
| 1 | 0.076923 | 1 | 0 |
cc05dc5668efd807879f62d5f94efa0c264de695 | docs/guide/index.rst | docs/guide/index.rst | Guide
=====
Open Budget is written in Python and JavaScript.
The server is written using Django, a popular web app framework in Python.
For more detailed information, navigate to the appropriate section via the menus below.
For some information on our design goals at this stage of the project, see below.
Features
--------
.. toctree::
:maxdepth: 1
features/accounts
features/admin
features/budgets
features/context
features/data-transport
features/entities
features/interactions
features/internationalization
features/search
Interfaces
----------
.. toctree::
:maxdepth: 1
interfaces/ui
interfaces/api
Management
----------
.. toctree::
:maxdepth: 1
management/project
management/dependencies
management/repositories
Specifications
--------------
.. toctree::
:maxdepth: 1
specifications/data-import
Design goals
------------
Some of the broader design goals that influenced how we approach Open Budget.
* multilingual at the core
* designed for israeli muni budgets
* comparative data analysis as a goal
* discussion and interaction as a goal
| Guide
=====
Open Budget is written in Python and JavaScript.
The server is written using Django, a popular web app framework in Python.
For more detailed information, navigate to the appropriate section via the menus below.
For some information on our design goals at this stage of the project, see below.
Features
--------
.. toctree::
:maxdepth: 1
features/accounts
features/admin
features/budgets
features/context
features/entities
features/import
features/interactions
features/internationalization
features/search
Interfaces
----------
.. toctree::
:maxdepth: 1
interfaces/ui
interfaces/api
Management
----------
.. toctree::
:maxdepth: 1
management/project
management/dependencies
management/repositories
Specifications
--------------
.. toctree::
:maxdepth: 1
specifications/import
Design goals
------------
Some of the broader design goals that influenced how we approach Open Budget.
* multilingual at the core
* designed for israeli muni budgets
* comparative data analysis as a goal
* discussion and interaction as a goal
| Fix path to new filenames | Fix path to new filenames
| reStructuredText | bsd-3-clause | moshe742/openbudgets,openbudgets/openbudgets,pwalsh/openbudgets,pwalsh/openbudgets,moshe742/openbudgets,pwalsh/openbudgets,openbudgets/openbudgets,shaib/openbudgets,openbudgets/openbudgets,shaib/openbudgets | restructuredtext | ## Code Before:
Guide
=====
Open Budget is written in Python and JavaScript.
The server is written using Django, a popular web app framework in Python.
For more detailed information, navigate to the appropriate section via the menus below.
For some information on our design goals at this stage of the project, see below.
Features
--------
.. toctree::
:maxdepth: 1
features/accounts
features/admin
features/budgets
features/context
features/data-transport
features/entities
features/interactions
features/internationalization
features/search
Interfaces
----------
.. toctree::
:maxdepth: 1
interfaces/ui
interfaces/api
Management
----------
.. toctree::
:maxdepth: 1
management/project
management/dependencies
management/repositories
Specifications
--------------
.. toctree::
:maxdepth: 1
specifications/data-import
Design goals
------------
Some of the broader design goals that influenced how we approach Open Budget.
* multilingual at the core
* designed for israeli muni budgets
* comparative data analysis as a goal
* discussion and interaction as a goal
## Instruction:
Fix path to new filenames
## Code After:
Guide
=====
Open Budget is written in Python and JavaScript.
The server is written using Django, a popular web app framework in Python.
For more detailed information, navigate to the appropriate section via the menus below.
For some information on our design goals at this stage of the project, see below.
Features
--------
.. toctree::
:maxdepth: 1
features/accounts
features/admin
features/budgets
features/context
features/entities
features/import
features/interactions
features/internationalization
features/search
Interfaces
----------
.. toctree::
:maxdepth: 1
interfaces/ui
interfaces/api
Management
----------
.. toctree::
:maxdepth: 1
management/project
management/dependencies
management/repositories
Specifications
--------------
.. toctree::
:maxdepth: 1
specifications/import
Design goals
------------
Some of the broader design goals that influenced how we approach Open Budget.
* multilingual at the core
* designed for israeli muni budgets
* comparative data analysis as a goal
* discussion and interaction as a goal
| Guide
=====
Open Budget is written in Python and JavaScript.
The server is written using Django, a popular web app framework in Python.
For more detailed information, navigate to the appropriate section via the menus below.
For some information on our design goals at this stage of the project, see below.
Features
--------
.. toctree::
:maxdepth: 1
features/accounts
features/admin
features/budgets
features/context
- features/data-transport
features/entities
+ features/import
features/interactions
features/internationalization
features/search
Interfaces
----------
.. toctree::
:maxdepth: 1
interfaces/ui
interfaces/api
Management
----------
.. toctree::
:maxdepth: 1
management/project
management/dependencies
management/repositories
Specifications
--------------
.. toctree::
:maxdepth: 1
- specifications/data-import
? -----
+ specifications/import
Design goals
------------
Some of the broader design goals that influenced how we approach Open Budget.
* multilingual at the core
* designed for israeli muni budgets
* comparative data analysis as a goal
* discussion and interaction as a goal | 4 | 0.058824 | 2 | 2 |
f834b0be2656b9ceb6e05d6a0b298b52fc6060ed | apps/mail-postfix-server/docker-compose.tests.yml | apps/mail-postfix-server/docker-compose.tests.yml | version: "3.7"
services:
mail-postfix-server:
image: dockermediacloud/mail-postfix-server:latest
stop_signal: SIGKILL
environment:
MC_MAIL_POSTFIX_DOMAIN: "testmediacloud.ml"
MC_MAIL_POSTFIX_HOSTNAME: "mail"
depends_on:
- mail-opendkim-server
depends_on:
- mail-opendkim-server
mail-opendkim-server:
image: dockermediacloud/mail-opendkim-server:containers_release
environment:
MC_MAIL_OPENDKIM_DOMAIN: "testmediacloud.ml"
MC_MAIL_OPENDKIM_HOSTNAME: "mail"
expose:
- "12301"
volumes:
- type: bind
source: ./../mail-opendkim-server/etc/opendkim.conf
target: /etc/opendkim.conf
- type: bind
source: ./../mail-opendkim-server/etc/opendkim/
target: /etc/opendkim/
| version: "3.7"
services:
# Service to use for testing the mail service
#
# Usage:
#
# host$ ./dev/run.py mail-postfix-server bash
# container$ sendmail "your@email.com"
#
mail-postfix-server:
image: dockermediacloud/common:latest
stop_signal: SIGKILL
depends_on:
- mail-postfix-server-actual
# Actual mail server, operating under "mail-postfix-server" alias
mail-postfix-server-actual:
image: dockermediacloud/mail-postfix-server:latest
stop_signal: SIGKILL
# "docker exec" into a container and run Postfix manually (/postfix.sh):
command: sleep infinity
# To be able to set /proc/sys/kernel/yama/ptrace_scope:
privileged: true
environment:
MC_MAIL_POSTFIX_DOMAIN: "testmediacloud.ml"
MC_MAIL_POSTFIX_HOSTNAME: "mail"
depends_on:
- mail-opendkim-server
networks:
default:
aliases:
- mail-postfix-server
mail-opendkim-server:
image: dockermediacloud/mail-opendkim-server:containers_release
environment:
MC_MAIL_OPENDKIM_DOMAIN: "testmediacloud.ml"
MC_MAIL_OPENDKIM_HOSTNAME: "mail"
expose:
- "12301"
volumes:
- type: bind
source: ./../mail-opendkim-server/etc/opendkim.conf
target: /etc/opendkim.conf
- type: bind
source: ./../mail-opendkim-server/etc/opendkim/
target: /etc/opendkim/
networks:
default:
attachable: true
| Add some hacks to mail-postfix-server testing setup | Add some hacks to mail-postfix-server testing setup
| YAML | agpl-3.0 | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | yaml | ## Code Before:
version: "3.7"
services:
mail-postfix-server:
image: dockermediacloud/mail-postfix-server:latest
stop_signal: SIGKILL
environment:
MC_MAIL_POSTFIX_DOMAIN: "testmediacloud.ml"
MC_MAIL_POSTFIX_HOSTNAME: "mail"
depends_on:
- mail-opendkim-server
depends_on:
- mail-opendkim-server
mail-opendkim-server:
image: dockermediacloud/mail-opendkim-server:containers_release
environment:
MC_MAIL_OPENDKIM_DOMAIN: "testmediacloud.ml"
MC_MAIL_OPENDKIM_HOSTNAME: "mail"
expose:
- "12301"
volumes:
- type: bind
source: ./../mail-opendkim-server/etc/opendkim.conf
target: /etc/opendkim.conf
- type: bind
source: ./../mail-opendkim-server/etc/opendkim/
target: /etc/opendkim/
## Instruction:
Add some hacks to mail-postfix-server testing setup
## Code After:
version: "3.7"
services:
# Service to use for testing the mail service
#
# Usage:
#
# host$ ./dev/run.py mail-postfix-server bash
# container$ sendmail "your@email.com"
#
mail-postfix-server:
image: dockermediacloud/common:latest
stop_signal: SIGKILL
depends_on:
- mail-postfix-server-actual
# Actual mail server, operating under "mail-postfix-server" alias
mail-postfix-server-actual:
image: dockermediacloud/mail-postfix-server:latest
stop_signal: SIGKILL
# "docker exec" into a container and run Postfix manually (/postfix.sh):
command: sleep infinity
# To be able to set /proc/sys/kernel/yama/ptrace_scope:
privileged: true
environment:
MC_MAIL_POSTFIX_DOMAIN: "testmediacloud.ml"
MC_MAIL_POSTFIX_HOSTNAME: "mail"
depends_on:
- mail-opendkim-server
networks:
default:
aliases:
- mail-postfix-server
mail-opendkim-server:
image: dockermediacloud/mail-opendkim-server:containers_release
environment:
MC_MAIL_OPENDKIM_DOMAIN: "testmediacloud.ml"
MC_MAIL_OPENDKIM_HOSTNAME: "mail"
expose:
- "12301"
volumes:
- type: bind
source: ./../mail-opendkim-server/etc/opendkim.conf
target: /etc/opendkim.conf
- type: bind
source: ./../mail-opendkim-server/etc/opendkim/
target: /etc/opendkim/
networks:
default:
attachable: true
| version: "3.7"
services:
+ # Service to use for testing the mail service
+ #
+ # Usage:
+ #
+ # host$ ./dev/run.py mail-postfix-server bash
+ # container$ sendmail "your@email.com"
+ #
mail-postfix-server:
+ image: dockermediacloud/common:latest
+ stop_signal: SIGKILL
+ depends_on:
+ - mail-postfix-server-actual
+
+ # Actual mail server, operating under "mail-postfix-server" alias
+ mail-postfix-server-actual:
image: dockermediacloud/mail-postfix-server:latest
stop_signal: SIGKILL
+ # "docker exec" into a container and run Postfix manually (/postfix.sh):
+ command: sleep infinity
+ # To be able to set /proc/sys/kernel/yama/ptrace_scope:
+ privileged: true
environment:
MC_MAIL_POSTFIX_DOMAIN: "testmediacloud.ml"
MC_MAIL_POSTFIX_HOSTNAME: "mail"
depends_on:
- mail-opendkim-server
- depends_on:
- - mail-opendkim-server
+ networks:
+ default:
+ aliases:
+ - mail-postfix-server
mail-opendkim-server:
image: dockermediacloud/mail-opendkim-server:containers_release
environment:
MC_MAIL_OPENDKIM_DOMAIN: "testmediacloud.ml"
MC_MAIL_OPENDKIM_HOSTNAME: "mail"
expose:
- "12301"
volumes:
- type: bind
source: ./../mail-opendkim-server/etc/opendkim.conf
target: /etc/opendkim.conf
- type: bind
source: ./../mail-opendkim-server/etc/opendkim/
target: /etc/opendkim/
+
+ networks:
+ default:
+ attachable: true | 28 | 0.965517 | 26 | 2 |
56ee9f3bd29767a2bdf74597ae8e8eb7425a4bc9 | tools/testing/karma.conf.js | tools/testing/karma.conf.js | /* eslint func-names:0 */
const path = require('path');
const webpackConfig = require('../webpack');
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
singleRun: true,
frameworks: ['mocha'],
files: ['./test-bundler.js'],
preprocessors: {
'./test-bundler.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
webpack: webpackConfig,
// Make Webpack bundle generation quiet
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// Set the format of reporter
coverageReporter: {
dir: path.join(process.cwd(), 'coverage'),
reporters: [
{ type: 'html', subdir: 'html' },
{ type: 'lcov', subdir: 'lcov' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
],
},
});
};
| /* eslint-disable */
var path = require('path');
var webpackConfig = require('../webpack');
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
singleRun: true,
frameworks: ['mocha'],
files: ['./test-bundler.js'],
preprocessors: {
'./test-bundler.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
webpack: webpackConfig,
// Make Webpack bundle generation quiet
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// Set the format of reporter
coverageReporter: {
dir: path.join(process.cwd(), 'coverage'),
reporters: [
{ type: 'html', subdir: 'html' },
{ type: 'lcov', subdir: 'lcov' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
],
},
});
};
| Fix es6 error on node 5 | Fix es6 error on node 5
| JavaScript | mit | wellyshen/react-cool-starter,wellyshen/react-cool-starter,not-bad-react/not-bad-react-starter,wellyshen/react-cool-starter,zolcman/calendartest | javascript | ## Code Before:
/* eslint func-names:0 */
const path = require('path');
const webpackConfig = require('../webpack');
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
singleRun: true,
frameworks: ['mocha'],
files: ['./test-bundler.js'],
preprocessors: {
'./test-bundler.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
webpack: webpackConfig,
// Make Webpack bundle generation quiet
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// Set the format of reporter
coverageReporter: {
dir: path.join(process.cwd(), 'coverage'),
reporters: [
{ type: 'html', subdir: 'html' },
{ type: 'lcov', subdir: 'lcov' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
],
},
});
};
## Instruction:
Fix es6 error on node 5
## Code After:
/* eslint-disable */
var path = require('path');
var webpackConfig = require('../webpack');
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
singleRun: true,
frameworks: ['mocha'],
files: ['./test-bundler.js'],
preprocessors: {
'./test-bundler.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
webpack: webpackConfig,
// Make Webpack bundle generation quiet
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// Set the format of reporter
coverageReporter: {
dir: path.join(process.cwd(), 'coverage'),
reporters: [
{ type: 'html', subdir: 'html' },
{ type: 'lcov', subdir: 'lcov' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
],
},
});
};
| - /* eslint func-names:0 */
+ /* eslint-disable */
- const path = require('path');
? ^^^^^
+ var path = require('path');
? ^^^
- const webpackConfig = require('../webpack');
? ^^^^^
+ var webpackConfig = require('../webpack');
? ^^^
module.exports = function (config) {
config.set({
browsers: ['PhantomJS'],
singleRun: true,
frameworks: ['mocha'],
files: ['./test-bundler.js'],
preprocessors: {
'./test-bundler.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
webpack: webpackConfig,
// Make Webpack bundle generation quiet
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// Set the format of reporter
coverageReporter: {
dir: path.join(process.cwd(), 'coverage'),
reporters: [
{ type: 'html', subdir: 'html' },
{ type: 'lcov', subdir: 'lcov' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
],
},
});
}; | 6 | 0.15 | 3 | 3 |
65feb132f79ca84ce570def810693505dfe14de9 | lib/capistrano_deploy_webhook/notifier.rb | lib/capistrano_deploy_webhook/notifier.rb | require 'net/http'
require 'uri'
unless Capistrano::Configuration.respond_to?(:instance)
abort "capistrano_deploy_webhook requires Capistrano 2"
end
Capistrano::Configuration.instance.load do
after :deploy, "notify:post_request"
namespace :notify do
task :post_request do
application_name = `pwd`.chomp.split('/').last
puts "*** Notification POST to #{self[:notify_url]} for #{application_name}"
url = URI.parse("#{self[:notify_url]}")
req = Net::HTTP::Post.new(url.path)
req.set_form_data(
{'app' => application_name,
'user' => self[:user],
'sha' => self[:current_revision],
'prev_sha' => self[:previous_revision],
'url' => self[:url]},
';')
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
end
end
end
| require 'net/http'
require 'uri'
unless Capistrano::Configuration.respond_to?(:instance)
abort "capistrano_deploy_webhook requires Capistrano 2"
end
Capistrano::Configuration.instance.load do
after :deploy, "notify:post_request"
namespace :notify do
task :post_request do
application_name = `pwd`.chomp.split('/').last
git_user_email = `git config --get user.email`
puts "*** Notification POST to #{self[:notify_url]} for #{application_name}"
url = URI.parse("#{self[:notify_url]}")
req = Net::HTTP::Post.new(url.path)
req.set_form_data(
{'app' => application_name,
'user' => git_user_email,
'sha' => self[:current_revision],
'prev_sha' => self[:previous_revision],
'url' => self[:url]},
';')
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
end
end
end
| Deploy hook can now get git user email | Deploy hook can now get git user email
| Ruby | mit | rumblelabs/capistrano_deploy_webhook | ruby | ## Code Before:
require 'net/http'
require 'uri'
unless Capistrano::Configuration.respond_to?(:instance)
abort "capistrano_deploy_webhook requires Capistrano 2"
end
Capistrano::Configuration.instance.load do
after :deploy, "notify:post_request"
namespace :notify do
task :post_request do
application_name = `pwd`.chomp.split('/').last
puts "*** Notification POST to #{self[:notify_url]} for #{application_name}"
url = URI.parse("#{self[:notify_url]}")
req = Net::HTTP::Post.new(url.path)
req.set_form_data(
{'app' => application_name,
'user' => self[:user],
'sha' => self[:current_revision],
'prev_sha' => self[:previous_revision],
'url' => self[:url]},
';')
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
end
end
end
## Instruction:
Deploy hook can now get git user email
## Code After:
require 'net/http'
require 'uri'
unless Capistrano::Configuration.respond_to?(:instance)
abort "capistrano_deploy_webhook requires Capistrano 2"
end
Capistrano::Configuration.instance.load do
after :deploy, "notify:post_request"
namespace :notify do
task :post_request do
application_name = `pwd`.chomp.split('/').last
git_user_email = `git config --get user.email`
puts "*** Notification POST to #{self[:notify_url]} for #{application_name}"
url = URI.parse("#{self[:notify_url]}")
req = Net::HTTP::Post.new(url.path)
req.set_form_data(
{'app' => application_name,
'user' => git_user_email,
'sha' => self[:current_revision],
'prev_sha' => self[:previous_revision],
'url' => self[:url]},
';')
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
end
end
end
| require 'net/http'
require 'uri'
unless Capistrano::Configuration.respond_to?(:instance)
abort "capistrano_deploy_webhook requires Capistrano 2"
end
Capistrano::Configuration.instance.load do
after :deploy, "notify:post_request"
namespace :notify do
task :post_request do
application_name = `pwd`.chomp.split('/').last
+ git_user_email = `git config --get user.email`
+
puts "*** Notification POST to #{self[:notify_url]} for #{application_name}"
url = URI.parse("#{self[:notify_url]}")
req = Net::HTTP::Post.new(url.path)
req.set_form_data(
{'app' => application_name,
- 'user' => self[:user],
+ 'user' => git_user_email,
'sha' => self[:current_revision],
'prev_sha' => self[:previous_revision],
'url' => self[:url]},
';')
res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }
end
end
end
| 4 | 0.137931 | 3 | 1 |
e69520b11402b32d1cdfc0f58eb6a9ed2b659707 | tenacity-testing/src/main/java/com/yammer/tenacity/testing/TenacityTest.java | tenacity-testing/src/main/java/com/yammer/tenacity/testing/TenacityTest.java | package com.yammer.tenacity.testing;
import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.Hystrix;
import com.netflix.hystrix.contrib.yammermetricspublisher.HystrixYammerMetricsPublisher;
import com.netflix.hystrix.strategy.HystrixPlugins;
import org.junit.After;
import java.util.concurrent.TimeUnit;
public abstract class TenacityTest {
static {
initialization();
}
private static void initialization() {
HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
ConfigurationManager
.getConfigInstance()
.setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", "1");
}
@After
public void testTeardown() {
Hystrix.reset(1, TimeUnit.SECONDS);
}
} | package com.yammer.tenacity.testing;
import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.Hystrix;
import com.netflix.hystrix.contrib.yammermetricspublisher.HystrixYammerMetricsPublisher;
import com.netflix.hystrix.strategy.HystrixPlugins;
import org.junit.After;
import org.junit.Before;
import java.util.concurrent.TimeUnit;
public abstract class TenacityTest {
static {
HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
}
@Before
public void testInitialization() {
ConfigurationManager
.getConfigInstance()
.setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", "1");
}
@After
public void testTeardown() {
Hystrix.reset(1, TimeUnit.SECONDS);
ConfigurationManager.getConfigInstance().clear();
}
} | Reset the ConfigurationManager when testing Tenacity | Reset the ConfigurationManager when testing Tenacity
| Java | apache-2.0 | skinzer/tenacity,yonglehou/tenacity,yammer/tenacity,jplock/tenacity,mauricionr/tenacity,samaitra/tenacity,Trundle/tenacity | java | ## Code Before:
package com.yammer.tenacity.testing;
import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.Hystrix;
import com.netflix.hystrix.contrib.yammermetricspublisher.HystrixYammerMetricsPublisher;
import com.netflix.hystrix.strategy.HystrixPlugins;
import org.junit.After;
import java.util.concurrent.TimeUnit;
public abstract class TenacityTest {
static {
initialization();
}
private static void initialization() {
HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
ConfigurationManager
.getConfigInstance()
.setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", "1");
}
@After
public void testTeardown() {
Hystrix.reset(1, TimeUnit.SECONDS);
}
}
## Instruction:
Reset the ConfigurationManager when testing Tenacity
## Code After:
package com.yammer.tenacity.testing;
import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.Hystrix;
import com.netflix.hystrix.contrib.yammermetricspublisher.HystrixYammerMetricsPublisher;
import com.netflix.hystrix.strategy.HystrixPlugins;
import org.junit.After;
import org.junit.Before;
import java.util.concurrent.TimeUnit;
public abstract class TenacityTest {
static {
HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
}
@Before
public void testInitialization() {
ConfigurationManager
.getConfigInstance()
.setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", "1");
}
@After
public void testTeardown() {
Hystrix.reset(1, TimeUnit.SECONDS);
ConfigurationManager.getConfigInstance().clear();
}
} | package com.yammer.tenacity.testing;
import com.netflix.config.ConfigurationManager;
import com.netflix.hystrix.Hystrix;
import com.netflix.hystrix.contrib.yammermetricspublisher.HystrixYammerMetricsPublisher;
import com.netflix.hystrix.strategy.HystrixPlugins;
import org.junit.After;
+ import org.junit.Before;
import java.util.concurrent.TimeUnit;
public abstract class TenacityTest {
static {
- initialization();
+ HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
}
+ @Before
- private static void initialization() {
? ^^^^^^^^^^^ ^
+ public void testInitialization() {
? ^^^ ^^^^^
- HystrixPlugins.getInstance().registerMetricsPublisher(new HystrixYammerMetricsPublisher());
ConfigurationManager
.getConfigInstance()
.setProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", "1");
}
@After
public void testTeardown() {
Hystrix.reset(1, TimeUnit.SECONDS);
+ ConfigurationManager.getConfigInstance().clear();
}
} | 8 | 0.296296 | 5 | 3 |
679ce7c3942f7b6d150653ba3a8e9cfda3af1b99 | extensions/tools/targets/myCreeps.js | extensions/tools/targets/myCreeps.js | 'use strict';
var all = false;
var cache = {};
function getCache(room) {
if (all === false) {
all = [];
for (var i in Game.creeps) {
if (!Game.creeps.spawning) {
if (cache[Game.creeps[i].room] === undefined) {
cache[Game.creeps[i].room] = [Game.creeps[i]];
} else {
cache[Game.creeps[i].room].push(Game.creeps[i]);
}
}
all.push(Game.creeps[i]);
}
}
if (room === undefined) {
return all;
}
if (cache[room] === undefined) {
return [];
}
return cache[room];
}
function get(room, options) {
if (options === undefined) {
options = {};
}
return getCache(room);
}
function filter(creep, options) {
options = options || {};
return {
filter: function(obj) {
if (!(obj instanceof Creep)) {
return false;
}
if (obj.my !== true) {
return false;
}
if (options.spawningOnly === true) {
return creep.spawning === true;
}
if (options.spawning !== true) {
return creep.spawning === false;
}
return true;
}
};
}
module.exports = {
get: get,
filter: filter
}; | 'use strict';
var all = false;
var cache = {};
function getCache(room) {
if (all === false) {
all = [];
for (var i in Game.creeps) {
if (!Game.creeps.spawning) {
if (cache[Game.creeps[i].room.name] === undefined) {
cache[Game.creeps[i].room.name] = [Game.creeps[i]];
} else {
cache[Game.creeps[i].room.name].push(Game.creeps[i]);
}
}
all.push(Game.creeps[i]);
}
}
if (room === undefined) {
return all;
}
if (room instanceof Room) {
room = room.name;
}
if (cache[room] === undefined) {
return [];
}
return cache[room];
}
function get(room, options) {
if (options === undefined) {
options = {};
}
return getCache(room);
}
function filter(creep, options) {
options = options || {};
return {
filter: function(obj) {
if (!(obj instanceof Creep)) {
return false;
}
if (obj.my !== true) {
return false;
}
if (options.spawningOnly === true) {
return creep.spawning === true;
}
if (options.spawning !== true) {
return creep.spawning === false;
}
return true;
}
};
}
module.exports = {
get: get,
filter: filter
}; | Use room name as string, instead as object for key value | Use room name as string, instead as object for key value
| JavaScript | mit | avdg/screeps | javascript | ## Code Before:
'use strict';
var all = false;
var cache = {};
function getCache(room) {
if (all === false) {
all = [];
for (var i in Game.creeps) {
if (!Game.creeps.spawning) {
if (cache[Game.creeps[i].room] === undefined) {
cache[Game.creeps[i].room] = [Game.creeps[i]];
} else {
cache[Game.creeps[i].room].push(Game.creeps[i]);
}
}
all.push(Game.creeps[i]);
}
}
if (room === undefined) {
return all;
}
if (cache[room] === undefined) {
return [];
}
return cache[room];
}
function get(room, options) {
if (options === undefined) {
options = {};
}
return getCache(room);
}
function filter(creep, options) {
options = options || {};
return {
filter: function(obj) {
if (!(obj instanceof Creep)) {
return false;
}
if (obj.my !== true) {
return false;
}
if (options.spawningOnly === true) {
return creep.spawning === true;
}
if (options.spawning !== true) {
return creep.spawning === false;
}
return true;
}
};
}
module.exports = {
get: get,
filter: filter
};
## Instruction:
Use room name as string, instead as object for key value
## Code After:
'use strict';
var all = false;
var cache = {};
function getCache(room) {
if (all === false) {
all = [];
for (var i in Game.creeps) {
if (!Game.creeps.spawning) {
if (cache[Game.creeps[i].room.name] === undefined) {
cache[Game.creeps[i].room.name] = [Game.creeps[i]];
} else {
cache[Game.creeps[i].room.name].push(Game.creeps[i]);
}
}
all.push(Game.creeps[i]);
}
}
if (room === undefined) {
return all;
}
if (room instanceof Room) {
room = room.name;
}
if (cache[room] === undefined) {
return [];
}
return cache[room];
}
function get(room, options) {
if (options === undefined) {
options = {};
}
return getCache(room);
}
function filter(creep, options) {
options = options || {};
return {
filter: function(obj) {
if (!(obj instanceof Creep)) {
return false;
}
if (obj.my !== true) {
return false;
}
if (options.spawningOnly === true) {
return creep.spawning === true;
}
if (options.spawning !== true) {
return creep.spawning === false;
}
return true;
}
};
}
module.exports = {
get: get,
filter: filter
}; | 'use strict';
var all = false;
var cache = {};
function getCache(room) {
if (all === false) {
all = [];
for (var i in Game.creeps) {
if (!Game.creeps.spawning) {
- if (cache[Game.creeps[i].room] === undefined) {
+ if (cache[Game.creeps[i].room.name] === undefined) {
? +++++
- cache[Game.creeps[i].room] = [Game.creeps[i]];
+ cache[Game.creeps[i].room.name] = [Game.creeps[i]];
? +++++
} else {
- cache[Game.creeps[i].room].push(Game.creeps[i]);
+ cache[Game.creeps[i].room.name].push(Game.creeps[i]);
? +++++
}
}
all.push(Game.creeps[i]);
}
}
if (room === undefined) {
return all;
+ }
+
+ if (room instanceof Room) {
+ room = room.name;
}
if (cache[room] === undefined) {
return [];
}
return cache[room];
}
function get(room, options) {
if (options === undefined) {
options = {};
}
return getCache(room);
}
function filter(creep, options) {
options = options || {};
return {
filter: function(obj) {
if (!(obj instanceof Creep)) {
return false;
}
if (obj.my !== true) {
return false;
}
if (options.spawningOnly === true) {
return creep.spawning === true;
}
if (options.spawning !== true) {
return creep.spawning === false;
}
return true;
}
};
}
module.exports = {
get: get,
filter: filter
}; | 10 | 0.144928 | 7 | 3 |
3483929b3b5610bc2ff17369bdcf356c1d05cc9e | cdn/src/app.js | cdn/src/app.js | import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
export default app;
| import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
app.get('/', function (req, res) {
res.send('The CDN is working');
});
export default app;
| Add text to test the server is working | Add text to test the server is working
| JavaScript | mit | worona/worona-dashboard,worona/worona,worona/worona,worona/worona-core,worona/worona-dashboard,worona/worona-core,worona/worona | javascript | ## Code Before:
import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
export default app;
## Instruction:
Add text to test the server is working
## Code After:
import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
app.get('/', function (req, res) {
res.send('The CDN is working');
});
export default app;
| import express from 'express';
import extensions from './extensions';
const app = express();
app.use('/extensions', extensions);
+ app.get('/', function (req, res) {
+ res.send('The CDN is working');
+ });
export default app; | 3 | 0.375 | 3 | 0 |
ee43bafd678e636947768df3a9d14da31aebb1b9 | app/views/common/SafeImage.js | app/views/common/SafeImage.js | import React from 'react'
import { ImageBackground, ActivityIndicator, View } from 'react-native'
import css from '../../styles/css'
class SafeImage extends React.Component {
constructor(props) {
super(props)
this.state = { validImage: true, loading: true }
}
_handleError = (event) => {
console.log(`Error loading image ${this.props.source.uri}:`, event.nativeEvent.error)
this.setState({ validImage: false })
}
_handleOnLoadEnd = () => {
this.setState({ loading: false })
}
render() {
let selectedResizeMode = 'contain'
if (this.props.resizeMode) {
selectedResizeMode = this.props.resizeMode
}
if (this.props.source && this.props.source.uri && this.state.validImage) {
return (
<View>
<ImageBackground
{...this.props}
onError={this._handleError}
resizeMode={selectedResizeMode}
onLoadEnd={this._handleOnLoadEnd}
>
{this.state.loading ? <ActivityIndicator size="small" style={css.safe_image_loading_activity_indicator} /> : null}
</ImageBackground>
</View>
)
} else if (this.props.onFailure) {
return this.props.onFailure
} else {
return null
}
}
}
export default SafeImage
| import React from 'react'
import { ImageBackground, ActivityIndicator, View } from 'react-native'
import css from '../../styles/css'
class SafeImage extends React.Component {
constructor(props) {
super(props)
this.state = { validImage: true, loading: true }
}
_handleError = (event) => {
console.log(`Error loading image ${this.props.source.uri}:`, event.nativeEvent.error)
this.setState({ validImage: false })
}
_handleOnLoadEnd = () => {
this.setState({ loading: false })
}
render() {
let selectedResizeMode = 'contain'
if (this.props.resizeMode) {
selectedResizeMode = this.props.resizeMode
}
if (this.props.source && this.props.source.uri && this.state.validImage) {
return (
<ImageBackground
{...this.props}
onError={this._handleError}
resizeMode={selectedResizeMode}
onLoadEnd={this._handleOnLoadEnd}
>
{this.state.loading ? <ActivityIndicator size="small" style={css.safe_image_loading_activity_indicator} /> : null}
</ImageBackground>
)
} else if (this.props.onFailure) {
return this.props.onFailure
} else {
return null
}
}
}
export default SafeImage
| Remove extra view from safeImage component | Remove extra view from safeImage component
| JavaScript | mit | UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/now-mobile,UCSD/now-mobile | javascript | ## Code Before:
import React from 'react'
import { ImageBackground, ActivityIndicator, View } from 'react-native'
import css from '../../styles/css'
class SafeImage extends React.Component {
constructor(props) {
super(props)
this.state = { validImage: true, loading: true }
}
_handleError = (event) => {
console.log(`Error loading image ${this.props.source.uri}:`, event.nativeEvent.error)
this.setState({ validImage: false })
}
_handleOnLoadEnd = () => {
this.setState({ loading: false })
}
render() {
let selectedResizeMode = 'contain'
if (this.props.resizeMode) {
selectedResizeMode = this.props.resizeMode
}
if (this.props.source && this.props.source.uri && this.state.validImage) {
return (
<View>
<ImageBackground
{...this.props}
onError={this._handleError}
resizeMode={selectedResizeMode}
onLoadEnd={this._handleOnLoadEnd}
>
{this.state.loading ? <ActivityIndicator size="small" style={css.safe_image_loading_activity_indicator} /> : null}
</ImageBackground>
</View>
)
} else if (this.props.onFailure) {
return this.props.onFailure
} else {
return null
}
}
}
export default SafeImage
## Instruction:
Remove extra view from safeImage component
## Code After:
import React from 'react'
import { ImageBackground, ActivityIndicator, View } from 'react-native'
import css from '../../styles/css'
class SafeImage extends React.Component {
constructor(props) {
super(props)
this.state = { validImage: true, loading: true }
}
_handleError = (event) => {
console.log(`Error loading image ${this.props.source.uri}:`, event.nativeEvent.error)
this.setState({ validImage: false })
}
_handleOnLoadEnd = () => {
this.setState({ loading: false })
}
render() {
let selectedResizeMode = 'contain'
if (this.props.resizeMode) {
selectedResizeMode = this.props.resizeMode
}
if (this.props.source && this.props.source.uri && this.state.validImage) {
return (
<ImageBackground
{...this.props}
onError={this._handleError}
resizeMode={selectedResizeMode}
onLoadEnd={this._handleOnLoadEnd}
>
{this.state.loading ? <ActivityIndicator size="small" style={css.safe_image_loading_activity_indicator} /> : null}
</ImageBackground>
)
} else if (this.props.onFailure) {
return this.props.onFailure
} else {
return null
}
}
}
export default SafeImage
| import React from 'react'
import { ImageBackground, ActivityIndicator, View } from 'react-native'
import css from '../../styles/css'
class SafeImage extends React.Component {
constructor(props) {
super(props)
this.state = { validImage: true, loading: true }
}
_handleError = (event) => {
console.log(`Error loading image ${this.props.source.uri}:`, event.nativeEvent.error)
this.setState({ validImage: false })
}
_handleOnLoadEnd = () => {
this.setState({ loading: false })
}
render() {
let selectedResizeMode = 'contain'
if (this.props.resizeMode) {
selectedResizeMode = this.props.resizeMode
}
if (this.props.source && this.props.source.uri && this.state.validImage) {
return (
- <View>
- <ImageBackground
? -
+ <ImageBackground
- {...this.props}
? -
+ {...this.props}
- onError={this._handleError}
? -
+ onError={this._handleError}
- resizeMode={selectedResizeMode}
? -
+ resizeMode={selectedResizeMode}
- onLoadEnd={this._handleOnLoadEnd}
? -
+ onLoadEnd={this._handleOnLoadEnd}
- >
? -
+ >
- {this.state.loading ? <ActivityIndicator size="small" style={css.safe_image_loading_activity_indicator} /> : null}
? -
+ {this.state.loading ? <ActivityIndicator size="small" style={css.safe_image_loading_activity_indicator} /> : null}
- </ImageBackground>
? -
+ </ImageBackground>
- </View>
)
} else if (this.props.onFailure) {
return this.props.onFailure
} else {
return null
}
}
}
export default SafeImage | 18 | 0.382979 | 8 | 10 |
38f174c69b5e4debca13673ac648f9a4466b1769 | README.md | README.md |
Training and detecting facial models base on Opencv
## Requirements
* WebCamera
* Windows 7 or later
* OpenCV 3.0(with opencv_contrib) or later
* Microsoft Visual Studio 2015
In my test, folder [ORLface]() contains facial samples of 40 people (each person has 10 picture samples).
You can train your own samples by placing the samples in the specified folder and editing the file at.txt.(This process is not reasonable and will be improved later)
## Progress
* 2017-07-01 The code can train the model successfully. Through the test, the models is available.
* 2017-07-02 Improved the logic of loading facial samples. The directory structure such as -->SampleDIR-->label(int)-->xxx.bmp
## Usage
* Click the *.sln file
* Configure the Opencv environment
* F5 Run !
## Install
Compiling Opencv_Contrib is more complex, see [opencv/opencv_contrib](https://github.com/opencv/opencv_contrib)
## Reference
[OpenCVʵ��֮·��������ʶ��֮��ģ��ѵ��](http://blog.csdn.net/xingchenbingbuyu/article/details/51407336)
## Licence
[MIT](https://github.com/horacework/FaceTrainAndDetect/blob/master/LICENSE)
|
Training and detecting facial models base on Opencv
## Requirements
* WebCamera
* Windows 7 or later
* OpenCV 3.0(with opencv_contrib) or later
* Microsoft Visual Studio 2015
In my test, folder [ORLface]() contains facial samples of 40 people (each person has 10 picture samples).
You can train your own samples by placing the samples in the specified folder and editing the file at.txt.(This process is not reasonable and will be improved later)
## Progress
* 2017-07-01 The code can train the model successfully. Through the test, the models is available.
* 2017-07-02 Improved the logic of loading facial samples. The directory structure such as -->SampleDIR-->label(int)-->xxx.bmp
## Usage
* Click the *.sln file
* Configure the Opencv environment
* F5 Run !
## Install
Compiling Opencv_Contrib is more complex, see [opencv/opencv_contrib](https://github.com/opencv/opencv_contrib)
## Reference
[OpenCV实践之路——人脸识别之二模型训练](http://blog.csdn.net/xingchenbingbuyu/article/details/51407336)
## Licence
[MIT](https://github.com/horacework/FaceTrainAndDetect/blob/master/LICENSE)
| Solve the readme.md Chinese messy problem | Solve the readme.md Chinese messy problem
| Markdown | mit | horacework/FaceTrainAndDetect,horacework/FaceTrainAndDetect | markdown | ## Code Before:
Training and detecting facial models base on Opencv
## Requirements
* WebCamera
* Windows 7 or later
* OpenCV 3.0(with opencv_contrib) or later
* Microsoft Visual Studio 2015
In my test, folder [ORLface]() contains facial samples of 40 people (each person has 10 picture samples).
You can train your own samples by placing the samples in the specified folder and editing the file at.txt.(This process is not reasonable and will be improved later)
## Progress
* 2017-07-01 The code can train the model successfully. Through the test, the models is available.
* 2017-07-02 Improved the logic of loading facial samples. The directory structure such as -->SampleDIR-->label(int)-->xxx.bmp
## Usage
* Click the *.sln file
* Configure the Opencv environment
* F5 Run !
## Install
Compiling Opencv_Contrib is more complex, see [opencv/opencv_contrib](https://github.com/opencv/opencv_contrib)
## Reference
[OpenCVʵ��֮·��������ʶ��֮��ģ��ѵ��](http://blog.csdn.net/xingchenbingbuyu/article/details/51407336)
## Licence
[MIT](https://github.com/horacework/FaceTrainAndDetect/blob/master/LICENSE)
## Instruction:
Solve the readme.md Chinese messy problem
## Code After:
Training and detecting facial models base on Opencv
## Requirements
* WebCamera
* Windows 7 or later
* OpenCV 3.0(with opencv_contrib) or later
* Microsoft Visual Studio 2015
In my test, folder [ORLface]() contains facial samples of 40 people (each person has 10 picture samples).
You can train your own samples by placing the samples in the specified folder and editing the file at.txt.(This process is not reasonable and will be improved later)
## Progress
* 2017-07-01 The code can train the model successfully. Through the test, the models is available.
* 2017-07-02 Improved the logic of loading facial samples. The directory structure such as -->SampleDIR-->label(int)-->xxx.bmp
## Usage
* Click the *.sln file
* Configure the Opencv environment
* F5 Run !
## Install
Compiling Opencv_Contrib is more complex, see [opencv/opencv_contrib](https://github.com/opencv/opencv_contrib)
## Reference
[OpenCV实践之路——人脸识别之二模型训练](http://blog.csdn.net/xingchenbingbuyu/article/details/51407336)
## Licence
[MIT](https://github.com/horacework/FaceTrainAndDetect/blob/master/LICENSE)
|
Training and detecting facial models base on Opencv
## Requirements
* WebCamera
* Windows 7 or later
* OpenCV 3.0(with opencv_contrib) or later
* Microsoft Visual Studio 2015
In my test, folder [ORLface]() contains facial samples of 40 people (each person has 10 picture samples).
You can train your own samples by placing the samples in the specified folder and editing the file at.txt.(This process is not reasonable and will be improved later)
## Progress
* 2017-07-01 The code can train the model successfully. Through the test, the models is available.
* 2017-07-02 Improved the logic of loading facial samples. The directory structure such as -->SampleDIR-->label(int)-->xxx.bmp
## Usage
* Click the *.sln file
* Configure the Opencv environment
* F5 Run !
## Install
Compiling Opencv_Contrib is more complex, see [opencv/opencv_contrib](https://github.com/opencv/opencv_contrib)
## Reference
- [OpenCVʵ��֮·��������ʶ��֮��ģ��ѵ��](http://blog.csdn.net/xingchenbingbuyu/article/details/51407336)
? ^^^^^^^^^^^^^^^^^^^^^^^^^
+ [OpenCV实践之路——人脸识别之二模型训练](http://blog.csdn.net/xingchenbingbuyu/article/details/51407336)
? ^^^^^^^^^^^^^^^^
## Licence
[MIT](https://github.com/horacework/FaceTrainAndDetect/blob/master/LICENSE)
| 2 | 0.047619 | 1 | 1 |
4c2316bedbc6d4521729121d1a47f885fb2df829 | app/models/taxon_ancestor.rb | app/models/taxon_ancestor.rb | class TaxonAncestor < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :parent, :class_name => "Taxon"
belongs_to :child, :class_name => "Taxon"
end
| class TaxonAncestor < ActiveRecord::Base
attr_accessible :parent_id, :child_id
belongs_to :parent, :class_name => "Taxon"
belongs_to :child, :class_name => "Taxon"
end
| Make parent_id and child_id assignable | Make parent_id and child_id assignable
| Ruby | mit | NESCent/TraitDB,NESCent/TraitDB,NESCent/TraitDB | ruby | ## Code Before:
class TaxonAncestor < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :parent, :class_name => "Taxon"
belongs_to :child, :class_name => "Taxon"
end
## Instruction:
Make parent_id and child_id assignable
## Code After:
class TaxonAncestor < ActiveRecord::Base
attr_accessible :parent_id, :child_id
belongs_to :parent, :class_name => "Taxon"
belongs_to :child, :class_name => "Taxon"
end
| class TaxonAncestor < ActiveRecord::Base
- # attr_accessible :title, :body
+ attr_accessible :parent_id, :child_id
belongs_to :parent, :class_name => "Taxon"
belongs_to :child, :class_name => "Taxon"
end | 2 | 0.333333 | 1 | 1 |
928270df47dd7a3ff6e66c6254b67a196fe59708 | hack-at-brown-2015/static/css/base.css | hack-at-brown-2015/static/css/base.css | * {margin:0;padding:0;}
body, html {
color: #111;
margin:0;
padding:0;
width:100%;
/* font-size: 12pt;*/
}
body, input {
font-family: 'Brown', sans-serif;
}
.vertically-centered {
display: table;
}
.vertically-centered-content {
display: table-cell;
vertical-align: middle;
text-align: center;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Brown', sans-serif;
font-weight: normal;
}
:active, :focus, :hover {
outline: 0;
} | * {margin:0;padding:0;}
body, html {
color: #111;
margin:0;
padding:0;
width:100%;
/* font-size: 12pt;*/
}
body, input {
font-family: 'Brown', sans-serif;
}
.vertically-centered {
display: table;
}
.vertically-centered-content {
display: table-cell;
vertical-align: middle;
text-align: center;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Brown', sans-serif;
font-weight: normal;
}
a:active, a:focus, a:hover {
outline: 0 !important;
} | Fix anchor link dotted line issue | Fix anchor link dotted line issue
| CSS | mit | hackatbrown/2015.hackatbrown.org,hackatbrown/2015.hackatbrown.org,hackatbrown/2015.hackatbrown.org | css | ## Code Before:
* {margin:0;padding:0;}
body, html {
color: #111;
margin:0;
padding:0;
width:100%;
/* font-size: 12pt;*/
}
body, input {
font-family: 'Brown', sans-serif;
}
.vertically-centered {
display: table;
}
.vertically-centered-content {
display: table-cell;
vertical-align: middle;
text-align: center;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Brown', sans-serif;
font-weight: normal;
}
:active, :focus, :hover {
outline: 0;
}
## Instruction:
Fix anchor link dotted line issue
## Code After:
* {margin:0;padding:0;}
body, html {
color: #111;
margin:0;
padding:0;
width:100%;
/* font-size: 12pt;*/
}
body, input {
font-family: 'Brown', sans-serif;
}
.vertically-centered {
display: table;
}
.vertically-centered-content {
display: table-cell;
vertical-align: middle;
text-align: center;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Brown', sans-serif;
font-weight: normal;
}
a:active, a:focus, a:hover {
outline: 0 !important;
} | * {margin:0;padding:0;}
body, html {
color: #111;
margin:0;
padding:0;
width:100%;
/* font-size: 12pt;*/
}
body, input {
font-family: 'Brown', sans-serif;
}
.vertically-centered {
display: table;
}
.vertically-centered-content {
display: table-cell;
vertical-align: middle;
text-align: center;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Brown', sans-serif;
font-weight: normal;
}
- :active, :focus, :hover {
+ a:active, a:focus, a:hover {
? + + +
- outline: 0;
+ outline: 0 !important;
} | 4 | 0.125 | 2 | 2 |
2bc6ed738107cf6a2e1612276d6d7780f4698d22 | windows/setup/main.iss | windows/setup/main.iss |
[Setup]
AppName=FIRST LEGO League TMS
AppVersion=0.1
DefaultDirName=C:\FIRST_Lego_League_TMS
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
[Components]
Name: "Basic"; Description: "Basic installation" ; Types: full custom; Flags: fixed
[Dirs]
Name: "{app}\data"
Name: "{app}\logs"
Name: "{app}\tmp"
[Files]
Source: "{#app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: "Basic";
Source: "{#modules}\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs; Components: "Basic";
Source: "{#internals}\*"; DestDir: "{app}\internals"; Flags: ignoreversion recursesubdirs; Components: "Basic";
[Icons]
Name: "{commondesktop}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
Name: "{commonprograms}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
[UninstallDelete]
Type: filesandordirs; Name: "{app}\data"
|
[Setup]
AppName=FIRST LEGO League TMS
AppVersion=0.1
DefaultDirName=C:\FIRST_Lego_League_TMS
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
[Dirs]
Name: "{app}\data"
Name: "{app}\logs"
Name: "{app}\tmp"
[Files]
Source: "{#app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "{#modules}\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs;
Source: "{#internals}\*"; DestDir: "{app}\internals"; Flags: ignoreversion recursesubdirs;
[Icons]
Name: "{commondesktop}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
Name: "{commonprograms}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
[UninstallDelete]
Type: filesandordirs; Name: "{app}\data"
Type: filesandordirs; Name: "{app}\logs"
Type: filesandordirs; Name: "{app}\tmp"
| Remove component from innosetup install file | Remove component from innosetup install file
| Inno Setup | mit | FirstLegoLeague/Launcher,FirstLegoLeague/Launcher | inno-setup | ## Code Before:
[Setup]
AppName=FIRST LEGO League TMS
AppVersion=0.1
DefaultDirName=C:\FIRST_Lego_League_TMS
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
[Components]
Name: "Basic"; Description: "Basic installation" ; Types: full custom; Flags: fixed
[Dirs]
Name: "{app}\data"
Name: "{app}\logs"
Name: "{app}\tmp"
[Files]
Source: "{#app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: "Basic";
Source: "{#modules}\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs; Components: "Basic";
Source: "{#internals}\*"; DestDir: "{app}\internals"; Flags: ignoreversion recursesubdirs; Components: "Basic";
[Icons]
Name: "{commondesktop}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
Name: "{commonprograms}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
[UninstallDelete]
Type: filesandordirs; Name: "{app}\data"
## Instruction:
Remove component from innosetup install file
## Code After:
[Setup]
AppName=FIRST LEGO League TMS
AppVersion=0.1
DefaultDirName=C:\FIRST_Lego_League_TMS
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
[Dirs]
Name: "{app}\data"
Name: "{app}\logs"
Name: "{app}\tmp"
[Files]
Source: "{#app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "{#modules}\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs;
Source: "{#internals}\*"; DestDir: "{app}\internals"; Flags: ignoreversion recursesubdirs;
[Icons]
Name: "{commondesktop}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
Name: "{commonprograms}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
[UninstallDelete]
Type: filesandordirs; Name: "{app}\data"
Type: filesandordirs; Name: "{app}\logs"
Type: filesandordirs; Name: "{app}\tmp"
|
[Setup]
AppName=FIRST LEGO League TMS
AppVersion=0.1
DefaultDirName=C:\FIRST_Lego_League_TMS
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
- [Components]
- Name: "Basic"; Description: "Basic installation" ; Types: full custom; Flags: fixed
-
[Dirs]
Name: "{app}\data"
Name: "{app}\logs"
Name: "{app}\tmp"
[Files]
- Source: "{#app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: "Basic";
? ---------------------
+ Source: "{#app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
- Source: "{#modules}\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs; Components: "Basic";
? ---------------------
+ Source: "{#modules}\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs;
- Source: "{#internals}\*"; DestDir: "{app}\internals"; Flags: ignoreversion recursesubdirs; Components: "Basic";
? ---------------------
+ Source: "{#internals}\*"; DestDir: "{app}\internals"; Flags: ignoreversion recursesubdirs;
[Icons]
Name: "{commondesktop}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
Name: "{commonprograms}\FIRST LEGO League TMS"; Filename: "{app}\FIRST LEGO League TMS.exe"
[UninstallDelete]
Type: filesandordirs; Name: "{app}\data"
+ Type: filesandordirs; Name: "{app}\logs"
+ Type: filesandordirs; Name: "{app}\tmp" | 11 | 0.392857 | 5 | 6 |
38c1b9a1d5d34a480ae40d210dac1bf8e50bf889 | README.md | README.md |
Autoscale images or videos to fill a container div.
|
Autoscale images or videos to fill a container div.
## Usage
HTML Markup:
```html
<div class="Autoscale-parent">
<img class="Autoscale" data-autoscale src="aranja-is-awesome.png">
</div>
```
Note that the classes `.Autoscale` and `.Autoscale-parent` are optional
but they are configured so that the plugin behaves correctly.
The only requirement for styling is that the `data-autoscale` element has
these styles applied:
```css
element {
left: 50%;
position: absolute;
top: 50%;
}
```
The same element is also required to be within an positioned container with
overflow hidden:
```css
container {
overflow: hidden;
position: relative;
}
```
| Add a hint of documentation | Add a hint of documentation
| Markdown | mit | aranja/tux-autoscale,aranja/tux-autoscale | markdown | ## Code Before:
Autoscale images or videos to fill a container div.
## Instruction:
Add a hint of documentation
## Code After:
Autoscale images or videos to fill a container div.
## Usage
HTML Markup:
```html
<div class="Autoscale-parent">
<img class="Autoscale" data-autoscale src="aranja-is-awesome.png">
</div>
```
Note that the classes `.Autoscale` and `.Autoscale-parent` are optional
but they are configured so that the plugin behaves correctly.
The only requirement for styling is that the `data-autoscale` element has
these styles applied:
```css
element {
left: 50%;
position: absolute;
top: 50%;
}
```
The same element is also required to be within an positioned container with
overflow hidden:
```css
container {
overflow: hidden;
position: relative;
}
```
|
Autoscale images or videos to fill a container div.
+
+ ## Usage
+
+ HTML Markup:
+
+ ```html
+ <div class="Autoscale-parent">
+ <img class="Autoscale" data-autoscale src="aranja-is-awesome.png">
+ </div>
+ ```
+
+ Note that the classes `.Autoscale` and `.Autoscale-parent` are optional
+ but they are configured so that the plugin behaves correctly.
+
+ The only requirement for styling is that the `data-autoscale` element has
+ these styles applied:
+
+ ```css
+ element {
+ left: 50%;
+ position: absolute;
+ top: 50%;
+ }
+ ```
+
+ The same element is also required to be within an positioned container with
+ overflow hidden:
+
+ ```css
+ container {
+ overflow: hidden;
+ position: relative;
+ }
+ ``` | 34 | 17 | 34 | 0 |
8b17c3bf36485720d89560bb12a5dce471aba100 | config/routes.rb | config/routes.rb | Rails.application.routes.draw do
root to: 'organizations#index'
resources :organizations do
resources :events do
member do
post :activate
post :deactivate
end
end
end
resource :user
# Authentication
get 'login' => 'sessions#new'
post 'login' => 'sessions#create'
post 'logout' => 'sessions#destroy'
namespace :twilio do
resources :text_messages
end
namespace :admin do
mount Resque::Server, at: 'resque'
end
mount Easymon::Engine, at: 'monitoring/up'
end
| Rails.application.routes.draw do
root to: 'organizations#index'
resources :organizations do
resources :events do
member do
post :activate
post :deactivate
end
end
end
resource :user
# Authentication
get 'login', to: 'sessions#new'
post 'login', to: 'sessions#create'
post 'logout', to: 'sessions#destroy'
namespace :twilio do
resources :text_messages
end
namespace :admin do
mount Resque::Server, at: 'resque'
end
mount Easymon::Engine, at: 'monitoring/up'
end
| Use new route definition style | Use new route definition style
| Ruby | mit | Pitt-CSC/handy,Pitt-CSC/handy,Pitt-CSC/handy | ruby | ## Code Before:
Rails.application.routes.draw do
root to: 'organizations#index'
resources :organizations do
resources :events do
member do
post :activate
post :deactivate
end
end
end
resource :user
# Authentication
get 'login' => 'sessions#new'
post 'login' => 'sessions#create'
post 'logout' => 'sessions#destroy'
namespace :twilio do
resources :text_messages
end
namespace :admin do
mount Resque::Server, at: 'resque'
end
mount Easymon::Engine, at: 'monitoring/up'
end
## Instruction:
Use new route definition style
## Code After:
Rails.application.routes.draw do
root to: 'organizations#index'
resources :organizations do
resources :events do
member do
post :activate
post :deactivate
end
end
end
resource :user
# Authentication
get 'login', to: 'sessions#new'
post 'login', to: 'sessions#create'
post 'logout', to: 'sessions#destroy'
namespace :twilio do
resources :text_messages
end
namespace :admin do
mount Resque::Server, at: 'resque'
end
mount Easymon::Engine, at: 'monitoring/up'
end
| Rails.application.routes.draw do
root to: 'organizations#index'
resources :organizations do
resources :events do
member do
post :activate
post :deactivate
end
end
end
resource :user
# Authentication
- get 'login' => 'sessions#new'
? ^^
+ get 'login', to: 'sessions#new'
? + ^^^
- post 'login' => 'sessions#create'
? ^^
+ post 'login', to: 'sessions#create'
? + ^^^
- post 'logout' => 'sessions#destroy'
? ^^
+ post 'logout', to: 'sessions#destroy'
? + ^^^
namespace :twilio do
resources :text_messages
end
namespace :admin do
mount Resque::Server, at: 'resque'
end
mount Easymon::Engine, at: 'monitoring/up'
end | 6 | 0.206897 | 3 | 3 |
1a211c264de52fbd4719aaa130129f73388a5dd4 | fore/hotswap.py | fore/hotswap.py | import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
self.args = args
self.kwargs = kwargs
threading.Thread.__init__(self)
self.daemon = True
@property
def current_modtime(self):
return os.path.getmtime(self.mod.__file__.replace("pyc", "py"))
def run(self):
while True:
if self.current_modtime != self.loaded:
log.info("Hot-swapping module: %s", self.mod.__name__)
# self.mod = reload(self.mod)
self.loaded = self.current_modtime
self.gen = self.mod.generate(*self.args, **self.kwargs)
self.handle(self.gen.next())
def handle(self, elem):
self.out(elem)
| import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self):
while True:
self.handle(self.gen.next())
def handle(self, elem):
self.out(elem)
| Remove all references to actually swapping | Hotswap: Remove all references to actually swapping
| Python | artistic-2.0 | Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension,Rosuav/appension | python | ## Code Before:
import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.mod = mod
self.gen = mod.generate(*args, **kwargs)
self.loaded = self.current_modtime
self.args = args
self.kwargs = kwargs
threading.Thread.__init__(self)
self.daemon = True
@property
def current_modtime(self):
return os.path.getmtime(self.mod.__file__.replace("pyc", "py"))
def run(self):
while True:
if self.current_modtime != self.loaded:
log.info("Hot-swapping module: %s", self.mod.__name__)
# self.mod = reload(self.mod)
self.loaded = self.current_modtime
self.gen = self.mod.generate(*self.args, **self.kwargs)
self.handle(self.gen.next())
def handle(self, elem):
self.out(elem)
## Instruction:
Hotswap: Remove all references to actually swapping
## Code After:
import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
self.gen = mod.generate(*args, **kwargs)
threading.Thread.__init__(self)
self.daemon = True
def run(self):
while True:
self.handle(self.gen.next())
def handle(self, elem):
self.out(elem)
| import os
import logging
import threading
log = logging.getLogger(__name__)
class Hotswap(threading.Thread):
def __init__(self, out, mod, *args, **kwargs):
self.out = out
- self.mod = mod
self.gen = mod.generate(*args, **kwargs)
- self.loaded = self.current_modtime
- self.args = args
- self.kwargs = kwargs
threading.Thread.__init__(self)
self.daemon = True
- @property
- def current_modtime(self):
- return os.path.getmtime(self.mod.__file__.replace("pyc", "py"))
-
def run(self):
while True:
- if self.current_modtime != self.loaded:
- log.info("Hot-swapping module: %s", self.mod.__name__)
- # self.mod = reload(self.mod)
- self.loaded = self.current_modtime
- self.gen = self.mod.generate(*self.args, **self.kwargs)
self.handle(self.gen.next())
def handle(self, elem):
self.out(elem) | 13 | 0.382353 | 0 | 13 |
ae84b8c79dedb37f2edbecdb68f9dc1a34423b4b | package.json | package.json | {
"version": "0.0.0",
"main": "index.js",
"author": "Hoàng Văn Khải <hvksmr1996@gmail.com>",
"devDependencies": {
"standard": "10.0.2"
},
"scripts": {
"remake-package-json": "node sh/remake-package-json",
"clean": "bash 'sh/clean.sh'",
"fix": "bash 'sh/fix.sh'",
"test": "bash 'sh/test.sh'"
}
}
| {
"version": "0.0.0",
"main": "index.js",
"author": "Hoàng Văn Khải <hvksmr1996@gmail.com>",
"devDependencies": {
"standard": "10.0.2"
},
"scripts": {
"sh": "sh",
"bash": "bash",
"zsh": "zsh",
"command-prompt": "cmd",
"exec": "sh -c",
"remake-package-json": "node sh/remake-package-json",
"clean": "bash 'sh/clean.sh'",
"fix": "bash 'sh/fix.sh'",
"test": "bash 'sh/test.sh'"
}
}
| Create some command to execute arbitrary shell/command | Create some command to execute arbitrary shell/command
$ npm run exec <command> # execute <command>
$ npm run sh # start sh session
$ npm run bash # start bash session
$ npm run zsh # start zsh session
$ npm run command-prompt # start cmd.exe session
| JSON | mit | KSXGitHub/react-hello-world,KSXGitHub/react-hello-world,KSXGitHub/react-hello-world | json | ## Code Before:
{
"version": "0.0.0",
"main": "index.js",
"author": "Hoàng Văn Khải <hvksmr1996@gmail.com>",
"devDependencies": {
"standard": "10.0.2"
},
"scripts": {
"remake-package-json": "node sh/remake-package-json",
"clean": "bash 'sh/clean.sh'",
"fix": "bash 'sh/fix.sh'",
"test": "bash 'sh/test.sh'"
}
}
## Instruction:
Create some command to execute arbitrary shell/command
$ npm run exec <command> # execute <command>
$ npm run sh # start sh session
$ npm run bash # start bash session
$ npm run zsh # start zsh session
$ npm run command-prompt # start cmd.exe session
## Code After:
{
"version": "0.0.0",
"main": "index.js",
"author": "Hoàng Văn Khải <hvksmr1996@gmail.com>",
"devDependencies": {
"standard": "10.0.2"
},
"scripts": {
"sh": "sh",
"bash": "bash",
"zsh": "zsh",
"command-prompt": "cmd",
"exec": "sh -c",
"remake-package-json": "node sh/remake-package-json",
"clean": "bash 'sh/clean.sh'",
"fix": "bash 'sh/fix.sh'",
"test": "bash 'sh/test.sh'"
}
}
| {
"version": "0.0.0",
"main": "index.js",
"author": "Hoàng Văn Khải <hvksmr1996@gmail.com>",
"devDependencies": {
"standard": "10.0.2"
},
"scripts": {
+ "sh": "sh",
+ "bash": "bash",
+ "zsh": "zsh",
+ "command-prompt": "cmd",
+ "exec": "sh -c",
"remake-package-json": "node sh/remake-package-json",
"clean": "bash 'sh/clean.sh'",
"fix": "bash 'sh/fix.sh'",
"test": "bash 'sh/test.sh'"
}
} | 5 | 0.357143 | 5 | 0 |
268509076af5987e46cc3c6449e07270d8e8c33d | spec/default_spec.rb | spec/default_spec.rb | require 'chefspec'
describe 'The recipe skeleton::default' do
let (:chef_run) { ChefSpec::ChefRunner.new.converge 'skeleton::default' }
it 'should converge' do
chef_run.should be
end
it 'should do something' do
pending 'Add recipe examples here'
end
end
| require 'chefspec'
describe 'The recipe skeleton::default' do
let (:chef_run) do
chef_run = ChefSpec::ChefRunner.new(:platform => 'ubuntu')
chef_run.converge 'skeleton::default'
chef_run
end
it 'converges' do
expect(chef_run).to be
end
it 'does something' do
pending 'Add recipe examples here'
end
end
| Update spec to use Fauxhai and RSpec's new "expect" syntax | Update spec to use Fauxhai and RSpec's new "expect" syntax
| Ruby | apache-2.0 | sebbrandt87/packagist,mlafeldt/skeleton-cookbook,arknoll/drupal-nfs,arknoll/drupal-solr,zts/test-cookbook,sebbrandt87/packagist,sebbrandt87/packagist,darron/skeleton-cookbook,arknoll/drupal-codeception | ruby | ## Code Before:
require 'chefspec'
describe 'The recipe skeleton::default' do
let (:chef_run) { ChefSpec::ChefRunner.new.converge 'skeleton::default' }
it 'should converge' do
chef_run.should be
end
it 'should do something' do
pending 'Add recipe examples here'
end
end
## Instruction:
Update spec to use Fauxhai and RSpec's new "expect" syntax
## Code After:
require 'chefspec'
describe 'The recipe skeleton::default' do
let (:chef_run) do
chef_run = ChefSpec::ChefRunner.new(:platform => 'ubuntu')
chef_run.converge 'skeleton::default'
chef_run
end
it 'converges' do
expect(chef_run).to be
end
it 'does something' do
pending 'Add recipe examples here'
end
end
| require 'chefspec'
describe 'The recipe skeleton::default' do
- let (:chef_run) { ChefSpec::ChefRunner.new.converge 'skeleton::default' }
-
- it 'should converge' do
- chef_run.should be
+ let (:chef_run) do
+ chef_run = ChefSpec::ChefRunner.new(:platform => 'ubuntu')
+ chef_run.converge 'skeleton::default'
+ chef_run
end
+ it 'converges' do
+ expect(chef_run).to be
+ end
+
- it 'should do something' do
? -------
+ it 'does something' do
? ++
pending 'Add recipe examples here'
end
end | 14 | 1.076923 | 9 | 5 |
6e6216c2b2cdc3f7950b0e7f093963977367cdb7 | app/src/main/res/layout/item_pull_request.xml | app/src/main/res/layout/item_pull_request.xml | <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/gray_dark"
android:textSize="16sp"
tools:text="Some heavy stuff" />
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/gray_light"
android:textSize="14sp"
tools:text="This is the body for this awesome pull request" />
</LinearLayout> | <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/gray_dark"
android:textSize="16sp"
tools:text="Some heavy stuff" />
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/gray_light"
android:textSize="14sp"
tools:text="This is the body for this awesome pull request" />
</LinearLayout> | Add space between PR title and body | Add space between PR title and body
| XML | apache-2.0 | amasciulli/GmPR-Android | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/gray_dark"
android:textSize="16sp"
tools:text="Some heavy stuff" />
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/gray_light"
android:textSize="14sp"
tools:text="This is the body for this awesome pull request" />
</LinearLayout>
## Instruction:
Add space between PR title and body
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/gray_dark"
android:textSize="16sp"
tools:text="Some heavy stuff" />
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/gray_light"
android:textSize="14sp"
tools:text="This is the body for this awesome pull request" />
</LinearLayout> | <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
- android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/gray_dark"
android:textSize="16sp"
tools:text="Some heavy stuff" />
<TextView
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginTop="2dp"
android:ellipsize="end"
- android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@color/gray_light"
android:textSize="14sp"
tools:text="This is the body for this awesome pull request" />
</LinearLayout> | 3 | 0.085714 | 1 | 2 |
e042c519b9f4a163ceb0e322e6dfd4994bf5185b | lib/miq_automation_engine/service_models/miq_ae_service_orchestration_template_vnfd.rb | lib/miq_automation_engine/service_models/miq_ae_service_orchestration_template_vnfd.rb | module MiqAeMethodService
class MiqAeServiceOrchestrationTemplateVnfd < MiqAeServiceOrchestrationTemplate; end
end
| module MiqAeMethodService
class MiqAeServiceOrchestrationTemplateVnfd < MiqAeServiceOrchestrationTemplate
CREATE_ATTRIBUTES = [:name, :description, :content, :draft, :orderable, :ems_id]
def self.create(options = {})
attributes = options.symbolize_keys.slice(*CREATE_ATTRIBUTES)
attributes[:remote_proxy] = true
ar_method { MiqAeServiceOrchestrationTemplateVnfd.wrap_results(OrchestrationTemplateVnfd.create!(attributes)) }
end
end
end
| Make Vnfd template creatable from automate | Make Vnfd template creatable from automate
Make Vnfd template creatable from automate
(transferred from ManageIQ/manageiq@88a6e5b4527a1946c7115cb7f78c113ae47bd3db)
| Ruby | apache-2.0 | bdunne/manageiq-automation_engine | ruby | ## Code Before:
module MiqAeMethodService
class MiqAeServiceOrchestrationTemplateVnfd < MiqAeServiceOrchestrationTemplate; end
end
## Instruction:
Make Vnfd template creatable from automate
Make Vnfd template creatable from automate
(transferred from ManageIQ/manageiq@88a6e5b4527a1946c7115cb7f78c113ae47bd3db)
## Code After:
module MiqAeMethodService
class MiqAeServiceOrchestrationTemplateVnfd < MiqAeServiceOrchestrationTemplate
CREATE_ATTRIBUTES = [:name, :description, :content, :draft, :orderable, :ems_id]
def self.create(options = {})
attributes = options.symbolize_keys.slice(*CREATE_ATTRIBUTES)
attributes[:remote_proxy] = true
ar_method { MiqAeServiceOrchestrationTemplateVnfd.wrap_results(OrchestrationTemplateVnfd.create!(attributes)) }
end
end
end
| module MiqAeMethodService
- class MiqAeServiceOrchestrationTemplateVnfd < MiqAeServiceOrchestrationTemplate; end
? -----
+ class MiqAeServiceOrchestrationTemplateVnfd < MiqAeServiceOrchestrationTemplate
+ CREATE_ATTRIBUTES = [:name, :description, :content, :draft, :orderable, :ems_id]
+
+ def self.create(options = {})
+ attributes = options.symbolize_keys.slice(*CREATE_ATTRIBUTES)
+ attributes[:remote_proxy] = true
+
+ ar_method { MiqAeServiceOrchestrationTemplateVnfd.wrap_results(OrchestrationTemplateVnfd.create!(attributes)) }
+ end
+ end
end | 11 | 3.666667 | 10 | 1 |
e22ba948ab78a74b3e2c7db21a9539940a4fcc9c | README.md | README.md |
The same friendly python Requests interface for Lua!
Under construction... Stay tuned.
| lua-requests
====
The same friendly python Requests interface for Lua!
Under construction... Stay tuned.
Licensing
====
`lua-requests' is licensed under the MIT license. See LICENSE.md for details on the MIT license.
| Make the readme a little better | Make the readme a little better
| Markdown | mit | JakobGreen/lua-requests | markdown | ## Code Before:
The same friendly python Requests interface for Lua!
Under construction... Stay tuned.
## Instruction:
Make the readme a little better
## Code After:
lua-requests
====
The same friendly python Requests interface for Lua!
Under construction... Stay tuned.
Licensing
====
`lua-requests' is licensed under the MIT license. See LICENSE.md for details on the MIT license.
| + lua-requests
+ ====
The same friendly python Requests interface for Lua!
Under construction... Stay tuned.
+
+ Licensing
+ ====
+
+ `lua-requests' is licensed under the MIT license. See LICENSE.md for details on the MIT license. | 7 | 1.75 | 7 | 0 |
b6efe101949b170fd6e6b7254d8891316f2874a1 | .github/workflows/release.yml | .github/workflows/release.yml | name: Release
on:
# New release tagged.
push:
tags:
- 'v[0-9]+.[0-9]+.*'
# Manual trigger.
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
# This is broad, but unfortunately it is required for creating
# releases.
contents: write
steps:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- run: bazel build ...
- run: bazel test --test_output=errors ...
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
chrome-ssh-agent.zip
- name: Publish to Webstore
run: bazel run release:publish
env:
EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }}
| name: Release
on:
# New release tagged.
push:
tags:
- 'v[0-9]+.[0-9]+.*'
# Manual trigger.
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
# This is broad, but unfortunately it is required for creating
# releases.
contents: write
steps:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- run: bazel build ...
- run: bazel test --test_output=errors ...
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
fail_on_unmatched_files: true
files: |
bazel-bin/chrome-ssh-agent.zip
- name: Publish to Webstore
run: bazel run release:publish
env:
EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }}
| Fix path to produced zip file | Fix path to produced zip file
| YAML | apache-2.0 | google/chrome-ssh-agent,google/chrome-ssh-agent,google/chrome-ssh-agent,google/chrome-ssh-agent | yaml | ## Code Before:
name: Release
on:
# New release tagged.
push:
tags:
- 'v[0-9]+.[0-9]+.*'
# Manual trigger.
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
# This is broad, but unfortunately it is required for creating
# releases.
contents: write
steps:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- run: bazel build ...
- run: bazel test --test_output=errors ...
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
chrome-ssh-agent.zip
- name: Publish to Webstore
run: bazel run release:publish
env:
EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }}
## Instruction:
Fix path to produced zip file
## Code After:
name: Release
on:
# New release tagged.
push:
tags:
- 'v[0-9]+.[0-9]+.*'
# Manual trigger.
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
# This is broad, but unfortunately it is required for creating
# releases.
contents: write
steps:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- run: bazel build ...
- run: bazel test --test_output=errors ...
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
fail_on_unmatched_files: true
files: |
bazel-bin/chrome-ssh-agent.zip
- name: Publish to Webstore
run: bazel run release:publish
env:
EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }}
| name: Release
on:
# New release tagged.
push:
tags:
- 'v[0-9]+.[0-9]+.*'
# Manual trigger.
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
# This is broad, but unfortunately it is required for creating
# releases.
contents: write
steps:
- uses: actions/checkout@v3
- uses: bazelbuild/setup-bazelisk@v2
- run: bazel build ...
- run: bazel test --test_output=errors ...
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
+ fail_on_unmatched_files: true
files: |
- chrome-ssh-agent.zip
+ bazel-bin/chrome-ssh-agent.zip
? ++++++++++
- name: Publish to Webstore
run: bazel run release:publish
env:
EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }} | 3 | 0.083333 | 2 | 1 |
2f03fc1dce817afce4e7bcba83200e9f52416edb | Cargo.toml | Cargo.toml | [package]
name = "calx"
version = "0.0.1"
authors = ["Risto Saarelma <risto.saarelma@iki.fi>"]
description = "Rust game development helper library collection"
keywords = ["gamedev"]
license = "MIT"
[[example]]
name = "demo"
path = "examples/demo.rs"
[[example]]
name = "grid"
path = "examples/grid.rs"
[[example]]
name = "isoworld"
path = "examples/isoworld.rs"
[[example]]
name = "hexworld"
path = "examples/hexworld.rs"
[dependencies.rand]
[dependencies.rustc-serialize]
[dependencies.time]
[dependencies.num]
[dependencies.vec_map]
[dependencies.image]
[dependencies.nalgebra]
[dependencies.tiled]
[dependencies.glutin]
[dependencies.glium]
| [package]
name = "calx"
version = "0.0.1"
authors = ["Risto Saarelma <risto.saarelma@iki.fi>"]
description = "Rust game development helper library collection"
keywords = ["gamedev"]
license = "MIT"
[[example]]
name = "demo"
path = "examples/demo.rs"
[[example]]
name = "grid"
path = "examples/grid.rs"
[[example]]
name = "isoworld"
path = "examples/isoworld.rs"
[[example]]
name = "hexworld"
path = "examples/hexworld.rs"
[dev-dependencies.tiled]
[dependencies.rand]
[dependencies.rustc-serialize]
[dependencies.time]
[dependencies.num]
[dependencies.vec_map]
[dependencies.image]
[dependencies.nalgebra]
[dependencies.glutin]
[dependencies.glium]
| Mark Tiled as non-propagating dev dependency | Mark Tiled as non-propagating dev dependency
| TOML | agpl-3.0 | rsaarelm/magog,rsaarelm/magog,rsaarelm/magog | toml | ## Code Before:
[package]
name = "calx"
version = "0.0.1"
authors = ["Risto Saarelma <risto.saarelma@iki.fi>"]
description = "Rust game development helper library collection"
keywords = ["gamedev"]
license = "MIT"
[[example]]
name = "demo"
path = "examples/demo.rs"
[[example]]
name = "grid"
path = "examples/grid.rs"
[[example]]
name = "isoworld"
path = "examples/isoworld.rs"
[[example]]
name = "hexworld"
path = "examples/hexworld.rs"
[dependencies.rand]
[dependencies.rustc-serialize]
[dependencies.time]
[dependencies.num]
[dependencies.vec_map]
[dependencies.image]
[dependencies.nalgebra]
[dependencies.tiled]
[dependencies.glutin]
[dependencies.glium]
## Instruction:
Mark Tiled as non-propagating dev dependency
## Code After:
[package]
name = "calx"
version = "0.0.1"
authors = ["Risto Saarelma <risto.saarelma@iki.fi>"]
description = "Rust game development helper library collection"
keywords = ["gamedev"]
license = "MIT"
[[example]]
name = "demo"
path = "examples/demo.rs"
[[example]]
name = "grid"
path = "examples/grid.rs"
[[example]]
name = "isoworld"
path = "examples/isoworld.rs"
[[example]]
name = "hexworld"
path = "examples/hexworld.rs"
[dev-dependencies.tiled]
[dependencies.rand]
[dependencies.rustc-serialize]
[dependencies.time]
[dependencies.num]
[dependencies.vec_map]
[dependencies.image]
[dependencies.nalgebra]
[dependencies.glutin]
[dependencies.glium]
| [package]
name = "calx"
version = "0.0.1"
authors = ["Risto Saarelma <risto.saarelma@iki.fi>"]
description = "Rust game development helper library collection"
keywords = ["gamedev"]
license = "MIT"
[[example]]
name = "demo"
path = "examples/demo.rs"
[[example]]
name = "grid"
path = "examples/grid.rs"
[[example]]
name = "isoworld"
path = "examples/isoworld.rs"
[[example]]
name = "hexworld"
path = "examples/hexworld.rs"
+ [dev-dependencies.tiled]
+
[dependencies.rand]
[dependencies.rustc-serialize]
[dependencies.time]
[dependencies.num]
[dependencies.vec_map]
[dependencies.image]
[dependencies.nalgebra]
- [dependencies.tiled]
-
[dependencies.glutin]
[dependencies.glium] | 4 | 0.093023 | 2 | 2 |
efbfcff8a12b9081400e72a4683865d865c02ded | README.md | README.md | [](https://travis-ci.org/justinj/reconstruction-database)
[](https://codeclimate.com/github/justinj/reconstruction-database)
<p align="center">
<img src="https://raw.github.com/justinj/reconstruction-database/master/public/images/logo.png">
</p>
RCDB
====
RCDB is a <b>R</b>e<b>c</b>onstruction <b>D</b>ata<b>b</b>ase.
The goal is to document and categorize reconstructions of important or interesting solves of the Rubik's Cube and related puzzles.
Contributing to RCDB
====================
RCDB uses Ruby 2.0.0, so make sure you have that installed.
```shell
$ git clone git@github.com:justinj/reconstruction-database.git
$ cd reconstruction-database
$ rake test
$ shotgun app.rb
```
Then point your browser to `localhost:9393` and you should be good!
Thanks
======
Favicon was made by Kristopher De Asis
| [](https://travis-ci.org/justinj/reconstruction-database)
[](https://codeclimate.com/github/justinj/reconstruction-database)
<p align="center">
<img src="https://raw.github.com/justinj/reconstruction-database/master/public/images/logo.png">
</p>
RCDB
====
RCDB is a <b>R</b>e<b>c</b>onstruction <b>D</b>ata<b>b</b>ase.
The goal is to document and categorize reconstructions of important or interesting solves of the Rubik's Cube and related puzzles.
[RCDB](http://www.rcdb.justinjaffray.com/)
[SpeedSolving Thread](http://www.speedsolving.com/forum/showthread.php?43580-Reconstruction-Database-RCDB)
Contributing to RCDB
====================
RCDB uses Ruby 2.0.0, so make sure you have that installed.
```shell
$ git clone git@github.com:justinj/reconstruction-database.git
$ cd reconstruction-database
$ rake test
$ shotgun app.rb
```
Then point your browser to `localhost:9393` and you should be good!
Thanks
======
Favicon was made by Kristopher De Asis
| Add link to rcdb and speedsolving thread to readme | Add link to rcdb and speedsolving thread to readme
| Markdown | mit | justinj/reconstruction-database,justinj/reconstruction-database,justinj/reconstruction-database | markdown | ## Code Before:
[](https://travis-ci.org/justinj/reconstruction-database)
[](https://codeclimate.com/github/justinj/reconstruction-database)
<p align="center">
<img src="https://raw.github.com/justinj/reconstruction-database/master/public/images/logo.png">
</p>
RCDB
====
RCDB is a <b>R</b>e<b>c</b>onstruction <b>D</b>ata<b>b</b>ase.
The goal is to document and categorize reconstructions of important or interesting solves of the Rubik's Cube and related puzzles.
Contributing to RCDB
====================
RCDB uses Ruby 2.0.0, so make sure you have that installed.
```shell
$ git clone git@github.com:justinj/reconstruction-database.git
$ cd reconstruction-database
$ rake test
$ shotgun app.rb
```
Then point your browser to `localhost:9393` and you should be good!
Thanks
======
Favicon was made by Kristopher De Asis
## Instruction:
Add link to rcdb and speedsolving thread to readme
## Code After:
[](https://travis-ci.org/justinj/reconstruction-database)
[](https://codeclimate.com/github/justinj/reconstruction-database)
<p align="center">
<img src="https://raw.github.com/justinj/reconstruction-database/master/public/images/logo.png">
</p>
RCDB
====
RCDB is a <b>R</b>e<b>c</b>onstruction <b>D</b>ata<b>b</b>ase.
The goal is to document and categorize reconstructions of important or interesting solves of the Rubik's Cube and related puzzles.
[RCDB](http://www.rcdb.justinjaffray.com/)
[SpeedSolving Thread](http://www.speedsolving.com/forum/showthread.php?43580-Reconstruction-Database-RCDB)
Contributing to RCDB
====================
RCDB uses Ruby 2.0.0, so make sure you have that installed.
```shell
$ git clone git@github.com:justinj/reconstruction-database.git
$ cd reconstruction-database
$ rake test
$ shotgun app.rb
```
Then point your browser to `localhost:9393` and you should be good!
Thanks
======
Favicon was made by Kristopher De Asis
| [](https://travis-ci.org/justinj/reconstruction-database)
[](https://codeclimate.com/github/justinj/reconstruction-database)
<p align="center">
<img src="https://raw.github.com/justinj/reconstruction-database/master/public/images/logo.png">
</p>
RCDB
====
RCDB is a <b>R</b>e<b>c</b>onstruction <b>D</b>ata<b>b</b>ase.
The goal is to document and categorize reconstructions of important or interesting solves of the Rubik's Cube and related puzzles.
+
+ [RCDB](http://www.rcdb.justinjaffray.com/)
+
+ [SpeedSolving Thread](http://www.speedsolving.com/forum/showthread.php?43580-Reconstruction-Database-RCDB)
Contributing to RCDB
====================
RCDB uses Ruby 2.0.0, so make sure you have that installed.
```shell
$ git clone git@github.com:justinj/reconstruction-database.git
$ cd reconstruction-database
$ rake test
$ shotgun app.rb
```
Then point your browser to `localhost:9393` and you should be good!
Thanks
======
Favicon was made by Kristopher De Asis | 4 | 0.129032 | 4 | 0 |
28c311702b30dd1f98a1055129afb74c77c954ea | app/views/pages/_new_user.html.erb | app/views/pages/_new_user.html.erb | <div id="dialog">
<h2>Welcome to WebNews!</h2>
<p>Your WebNews account has been created and you're all set to party like it's 1987. If you find yourself wondering about news etiquette or what each newsgroup is for, the <a href="https://wiki.csh.rit.edu/wiki/News">wiki page on News</a> has you covered.</p>
<p>All posts up to this moment have been marked read for you. Newsgroups with unread posts will appear <span class="unread">bold</span>. You can quickly jump through your unread posts using the <b>Next Unread</b> button or by pressing the <span class="keyboard">n</span> key (check the <b>?</b> button in the upper-right for the full list of hotkeys).</p>
<p>By default, <i>all</i> new posts made from this point on (except those in csh.lists.* and csh.test) will be marked unread for you. To change this and other options, use the <b>Settings</b> button in the upper-right.</p>
<div class="buttons">
<a href="#" class="button dialog_cancel">Continue to WebNews</a>
</div>
</div>
| <div id="dialog">
<h2>Welcome to WebNews!</h2>
<p>Your WebNews account has been created and you're all set to party like it's 1987. If you find yourself wondering about news etiquette or what each newsgroup is for, the <a href="https://wiki.csh.rit.edu/wiki/News">wiki page on News</a> has you covered.</p>
<p>All posts up to this moment have been marked read for you. Newsgroups with unread posts will appear <span class="unread">bold</span>. You can quickly jump through your unread posts using the <b>Next Unread</b> button or by pressing the <span class="keyboard">n</span> key (check the <b>?</b> button in the upper-right for the full list of hotkeys).</p>
<p>By default, <i>all</i> new posts made from this point on (except those in control.cancel and csh.test) will be marked unread for you. To change this and other options, use the <b>Settings</b> button in the upper-right.</p>
<div class="buttons">
<a href="#" class="button dialog_cancel">Continue to WebNews</a>
</div>
</div>
| Update wording on new user dialog | Update wording on new user dialog
| HTML+ERB | isc | liam-middlebrook/CSH-WebNews,liam-middlebrook/CSH-WebNews,grantovich/CSH-WebNews,liam-middlebrook/CSH-WebNews,grantovich/CSH-WebNews,grantovich/CSH-WebNews | html+erb | ## Code Before:
<div id="dialog">
<h2>Welcome to WebNews!</h2>
<p>Your WebNews account has been created and you're all set to party like it's 1987. If you find yourself wondering about news etiquette or what each newsgroup is for, the <a href="https://wiki.csh.rit.edu/wiki/News">wiki page on News</a> has you covered.</p>
<p>All posts up to this moment have been marked read for you. Newsgroups with unread posts will appear <span class="unread">bold</span>. You can quickly jump through your unread posts using the <b>Next Unread</b> button or by pressing the <span class="keyboard">n</span> key (check the <b>?</b> button in the upper-right for the full list of hotkeys).</p>
<p>By default, <i>all</i> new posts made from this point on (except those in csh.lists.* and csh.test) will be marked unread for you. To change this and other options, use the <b>Settings</b> button in the upper-right.</p>
<div class="buttons">
<a href="#" class="button dialog_cancel">Continue to WebNews</a>
</div>
</div>
## Instruction:
Update wording on new user dialog
## Code After:
<div id="dialog">
<h2>Welcome to WebNews!</h2>
<p>Your WebNews account has been created and you're all set to party like it's 1987. If you find yourself wondering about news etiquette or what each newsgroup is for, the <a href="https://wiki.csh.rit.edu/wiki/News">wiki page on News</a> has you covered.</p>
<p>All posts up to this moment have been marked read for you. Newsgroups with unread posts will appear <span class="unread">bold</span>. You can quickly jump through your unread posts using the <b>Next Unread</b> button or by pressing the <span class="keyboard">n</span> key (check the <b>?</b> button in the upper-right for the full list of hotkeys).</p>
<p>By default, <i>all</i> new posts made from this point on (except those in control.cancel and csh.test) will be marked unread for you. To change this and other options, use the <b>Settings</b> button in the upper-right.</p>
<div class="buttons">
<a href="#" class="button dialog_cancel">Continue to WebNews</a>
</div>
</div>
| <div id="dialog">
<h2>Welcome to WebNews!</h2>
<p>Your WebNews account has been created and you're all set to party like it's 1987. If you find yourself wondering about news etiquette or what each newsgroup is for, the <a href="https://wiki.csh.rit.edu/wiki/News">wiki page on News</a> has you covered.</p>
<p>All posts up to this moment have been marked read for you. Newsgroups with unread posts will appear <span class="unread">bold</span>. You can quickly jump through your unread posts using the <b>Next Unread</b> button or by pressing the <span class="keyboard">n</span> key (check the <b>?</b> button in the upper-right for the full list of hotkeys).</p>
- <p>By default, <i>all</i> new posts made from this point on (except those in csh.lists.* and csh.test) will be marked unread for you. To change this and other options, use the <b>Settings</b> button in the upper-right.</p>
? ^^^^^^^^^^
+ <p>By default, <i>all</i> new posts made from this point on (except those in control.cancel and csh.test) will be marked unread for you. To change this and other options, use the <b>Settings</b> button in the upper-right.</p>
? ^^^^^^^^^^^^^
<div class="buttons">
<a href="#" class="button dialog_cancel">Continue to WebNews</a>
</div>
</div> | 2 | 0.153846 | 1 | 1 |
eae8176edf38ea026cd7e4e1d27fc4623a92e591 | _posts/redmond_rg/2018-06-27-NAACL18_papers.md | _posts/redmond_rg/2018-06-27-NAACL18_papers.md | ---
layout: post
title: "Paper Reading List"
author: Guanlin Li
tag: redmond_rg
---
### June 27, 2018
This week's reading list is below:
- [Diverse Few-shot Text Classification with Multiple Metrics](http://www.aclweb.org/anthology/N18-1109).
- Presenter: Guanlin Li
- [Learning Word Embeddings for Low-resource Languages by PU Learning](http://aclweb.org/anthology/N18-1093).
- Presenter: Xin-Tong Li
- []
| ---
layout: post
title: "Paper Reading List"
author: Guanlin Li
tag: redmond_rg
---
### June 27, 2018
This week's reading list is below:
- [Diverse Few-shot Text Classification with Multiple Metrics](http://www.aclweb.org/anthology/N18-1109). NAACL 2018.
- Presenter: Guanlin Li
- [Learning Word Embeddings for Low-resource Languages by PU Learning](http://aclweb.org/anthology/N18-1093). NAACL 2018.
- Presenter: Xin-Tong Li
- [End-to-End Memory Networks](https://arxiv.org/abs/1503.08895), 2015.
- Presenter: Yu Liu
| Add Yu Liu's presenting paper | Add Yu Liu's presenting paper
| Markdown | mit | Epsilon-Lee/epsilon-lee.github.io,Epsilon-Lee/epsilon-lee.github.io,Epsilon-Lee/epsilon-lee.github.io | markdown | ## Code Before:
---
layout: post
title: "Paper Reading List"
author: Guanlin Li
tag: redmond_rg
---
### June 27, 2018
This week's reading list is below:
- [Diverse Few-shot Text Classification with Multiple Metrics](http://www.aclweb.org/anthology/N18-1109).
- Presenter: Guanlin Li
- [Learning Word Embeddings for Low-resource Languages by PU Learning](http://aclweb.org/anthology/N18-1093).
- Presenter: Xin-Tong Li
- []
## Instruction:
Add Yu Liu's presenting paper
## Code After:
---
layout: post
title: "Paper Reading List"
author: Guanlin Li
tag: redmond_rg
---
### June 27, 2018
This week's reading list is below:
- [Diverse Few-shot Text Classification with Multiple Metrics](http://www.aclweb.org/anthology/N18-1109). NAACL 2018.
- Presenter: Guanlin Li
- [Learning Word Embeddings for Low-resource Languages by PU Learning](http://aclweb.org/anthology/N18-1093). NAACL 2018.
- Presenter: Xin-Tong Li
- [End-to-End Memory Networks](https://arxiv.org/abs/1503.08895), 2015.
- Presenter: Yu Liu
| ---
layout: post
title: "Paper Reading List"
author: Guanlin Li
tag: redmond_rg
---
### June 27, 2018
This week's reading list is below:
- - [Diverse Few-shot Text Classification with Multiple Metrics](http://www.aclweb.org/anthology/N18-1109).
+ - [Diverse Few-shot Text Classification with Multiple Metrics](http://www.aclweb.org/anthology/N18-1109). NAACL 2018.
? ++++++++++++
- Presenter: Guanlin Li
- - [Learning Word Embeddings for Low-resource Languages by PU Learning](http://aclweb.org/anthology/N18-1093).
+ - [Learning Word Embeddings for Low-resource Languages by PU Learning](http://aclweb.org/anthology/N18-1093). NAACL 2018.
? +++++++++++++
- Presenter: Xin-Tong Li
- - []
+ - [End-to-End Memory Networks](https://arxiv.org/abs/1503.08895), 2015.
+ - Presenter: Yu Liu
| 7 | 0.411765 | 4 | 3 |
5c62ac4f8aed26112aafbbbb8ee5ac9816dbb4a3 | services/web/app/coffee/Features/Errors/Errors.coffee | services/web/app/coffee/Features/Errors/Errors.coffee | NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__proto__ = ServiceNotConfiguredError.prototype
return error
ServiceNotConfiguredError.prototype.__proto__ = Error.prototype
TooManyRequestsError = (message) ->
error = new Error(message)
error.name = "TooManyRequestsError"
error.__proto__ = TooManyRequestsError.prototype
return error
TooManyRequestsError.prototype.__proto__ = Error.prototype
InvalidNameError = (message) ->
error = new Error(message)
error.name = "InvalidNameError"
error.__proto__ = InvalidNameError.prototype
return error
InvalidNameError.prototype.__proto__ = Error.prototype
UnsupportedFileType = (message) ->
error = new Error(message)
error.name = "UnsupportedFileType"
error.__proto__ = UnsupportedFileType.prototype
return error
UnsupportedFileType.prototype.__proto___ = Error.prototype
module.exports = Errors =
NotFoundError: NotFoundError
ServiceNotConfiguredError: ServiceNotConfiguredError
TooManyRequestsError: TooManyRequestsError
InvalidNameError: InvalidNameError
UnsupportedFileType: UnsupportedFileType
| NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__proto__ = ServiceNotConfiguredError.prototype
return error
ServiceNotConfiguredError.prototype.__proto__ = Error.prototype
TooManyRequestsError = (message) ->
error = new Error(message)
error.name = "TooManyRequestsError"
error.__proto__ = TooManyRequestsError.prototype
return error
TooManyRequestsError.prototype.__proto__ = Error.prototype
InvalidNameError = (message) ->
error = new Error(message)
error.name = "InvalidNameError"
error.__proto__ = InvalidNameError.prototype
return error
InvalidNameError.prototype.__proto__ = Error.prototype
UnsupportedFileTypeError = (message) ->
error = new Error(message)
error.name = "UnsupportedFileTypeError"
error.__proto__ = UnsupportedFileTypeError.prototype
return error
UnsupportedFileTypeError.prototype.__proto___ = Error.prototype
module.exports = Errors =
NotFoundError: NotFoundError
ServiceNotConfiguredError: ServiceNotConfiguredError
TooManyRequestsError: TooManyRequestsError
InvalidNameError: InvalidNameError
UnsupportedFileTypeError: UnsupportedFileTypeError
| Change error type for consistency | Change error type for consistency
| CoffeeScript | agpl-3.0 | sharelatex/sharelatex | coffeescript | ## Code Before:
NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__proto__ = ServiceNotConfiguredError.prototype
return error
ServiceNotConfiguredError.prototype.__proto__ = Error.prototype
TooManyRequestsError = (message) ->
error = new Error(message)
error.name = "TooManyRequestsError"
error.__proto__ = TooManyRequestsError.prototype
return error
TooManyRequestsError.prototype.__proto__ = Error.prototype
InvalidNameError = (message) ->
error = new Error(message)
error.name = "InvalidNameError"
error.__proto__ = InvalidNameError.prototype
return error
InvalidNameError.prototype.__proto__ = Error.prototype
UnsupportedFileType = (message) ->
error = new Error(message)
error.name = "UnsupportedFileType"
error.__proto__ = UnsupportedFileType.prototype
return error
UnsupportedFileType.prototype.__proto___ = Error.prototype
module.exports = Errors =
NotFoundError: NotFoundError
ServiceNotConfiguredError: ServiceNotConfiguredError
TooManyRequestsError: TooManyRequestsError
InvalidNameError: InvalidNameError
UnsupportedFileType: UnsupportedFileType
## Instruction:
Change error type for consistency
## Code After:
NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__proto__ = ServiceNotConfiguredError.prototype
return error
ServiceNotConfiguredError.prototype.__proto__ = Error.prototype
TooManyRequestsError = (message) ->
error = new Error(message)
error.name = "TooManyRequestsError"
error.__proto__ = TooManyRequestsError.prototype
return error
TooManyRequestsError.prototype.__proto__ = Error.prototype
InvalidNameError = (message) ->
error = new Error(message)
error.name = "InvalidNameError"
error.__proto__ = InvalidNameError.prototype
return error
InvalidNameError.prototype.__proto__ = Error.prototype
UnsupportedFileTypeError = (message) ->
error = new Error(message)
error.name = "UnsupportedFileTypeError"
error.__proto__ = UnsupportedFileTypeError.prototype
return error
UnsupportedFileTypeError.prototype.__proto___ = Error.prototype
module.exports = Errors =
NotFoundError: NotFoundError
ServiceNotConfiguredError: ServiceNotConfiguredError
TooManyRequestsError: TooManyRequestsError
InvalidNameError: InvalidNameError
UnsupportedFileTypeError: UnsupportedFileTypeError
| NotFoundError = (message) ->
error = new Error(message)
error.name = "NotFoundError"
error.__proto__ = NotFoundError.prototype
return error
NotFoundError.prototype.__proto__ = Error.prototype
ServiceNotConfiguredError = (message) ->
error = new Error(message)
error.name = "ServiceNotConfiguredError"
error.__proto__ = ServiceNotConfiguredError.prototype
return error
ServiceNotConfiguredError.prototype.__proto__ = Error.prototype
TooManyRequestsError = (message) ->
error = new Error(message)
error.name = "TooManyRequestsError"
error.__proto__ = TooManyRequestsError.prototype
return error
TooManyRequestsError.prototype.__proto__ = Error.prototype
InvalidNameError = (message) ->
error = new Error(message)
error.name = "InvalidNameError"
error.__proto__ = InvalidNameError.prototype
return error
InvalidNameError.prototype.__proto__ = Error.prototype
- UnsupportedFileType = (message) ->
+ UnsupportedFileTypeError = (message) ->
? +++++
error = new Error(message)
- error.name = "UnsupportedFileType"
+ error.name = "UnsupportedFileTypeError"
? +++++
- error.__proto__ = UnsupportedFileType.prototype
+ error.__proto__ = UnsupportedFileTypeError.prototype
? +++++
return error
- UnsupportedFileType.prototype.__proto___ = Error.prototype
+ UnsupportedFileTypeError.prototype.__proto___ = Error.prototype
? +++++
module.exports = Errors =
NotFoundError: NotFoundError
ServiceNotConfiguredError: ServiceNotConfiguredError
TooManyRequestsError: TooManyRequestsError
InvalidNameError: InvalidNameError
- UnsupportedFileType: UnsupportedFileType
+ UnsupportedFileTypeError: UnsupportedFileTypeError
? +++++ +++++
| 10 | 0.243902 | 5 | 5 |
bccba58c3263248ef2d2289fb102c8d492fecaa6 | pkgs/applications/networking/browsers/chromium/sources.nix | pkgs/applications/networking/browsers/chromium/sources.nix | {
dev = {
version = "30.0.1581.2";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1581.2.tar.xz";
sha256 = "16l0gprinxbhdsx67yaq6qwy45018v6vww0hnyji4wdzd5drkf9r";
};
beta = {
version = "29.0.1547.32";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.32.tar.xz";
sha256 = "14p5s1xn15mdrlf87hv4y9kczw5r8s461a56kkdzb5xzyq25ph8w";
};
stable = {
version = "28.0.1500.95";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.95.tar.xz";
sha256 = "0d6pj57nyx7wfgxws98f6ly749flcyv7zg5sc3w16ggdxf5qhf1w";
};
}
| {
dev = {
version = "30.0.1581.2";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1581.2.tar.xz";
sha256 = "16l0gprinxbhdsx67yaq6qwy45018v6vww0hnyji4wdzd5drkf9r";
};
beta = {
version = "29.0.1547.41";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.41.tar.xz";
sha256 = "0xb2y7n3qyakg08606zdaw6wf60ypx9p61g56sqhxamgd5byfsg1";
};
stable = {
version = "28.0.1500.95";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.95.tar.xz";
sha256 = "0d6pj57nyx7wfgxws98f6ly749flcyv7zg5sc3w16ggdxf5qhf1w";
};
}
| Update beta channel to v29.0.1547.41. | chromium: Update beta channel to v29.0.1547.41.
Builds fine on my machine and tested with a bunch of web sites.
Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org>
| Nix | mit | triton/triton,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{
dev = {
version = "30.0.1581.2";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1581.2.tar.xz";
sha256 = "16l0gprinxbhdsx67yaq6qwy45018v6vww0hnyji4wdzd5drkf9r";
};
beta = {
version = "29.0.1547.32";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.32.tar.xz";
sha256 = "14p5s1xn15mdrlf87hv4y9kczw5r8s461a56kkdzb5xzyq25ph8w";
};
stable = {
version = "28.0.1500.95";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.95.tar.xz";
sha256 = "0d6pj57nyx7wfgxws98f6ly749flcyv7zg5sc3w16ggdxf5qhf1w";
};
}
## Instruction:
chromium: Update beta channel to v29.0.1547.41.
Builds fine on my machine and tested with a bunch of web sites.
Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org>
## Code After:
{
dev = {
version = "30.0.1581.2";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1581.2.tar.xz";
sha256 = "16l0gprinxbhdsx67yaq6qwy45018v6vww0hnyji4wdzd5drkf9r";
};
beta = {
version = "29.0.1547.41";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.41.tar.xz";
sha256 = "0xb2y7n3qyakg08606zdaw6wf60ypx9p61g56sqhxamgd5byfsg1";
};
stable = {
version = "28.0.1500.95";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.95.tar.xz";
sha256 = "0d6pj57nyx7wfgxws98f6ly749flcyv7zg5sc3w16ggdxf5qhf1w";
};
}
| {
dev = {
version = "30.0.1581.2";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1581.2.tar.xz";
sha256 = "16l0gprinxbhdsx67yaq6qwy45018v6vww0hnyji4wdzd5drkf9r";
};
beta = {
- version = "29.0.1547.32";
? ^^
+ version = "29.0.1547.41";
? ^^
- url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.32.tar.xz";
? ^^
+ url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.41.tar.xz";
? ^^
- sha256 = "14p5s1xn15mdrlf87hv4y9kczw5r8s461a56kkdzb5xzyq25ph8w";
+ sha256 = "0xb2y7n3qyakg08606zdaw6wf60ypx9p61g56sqhxamgd5byfsg1";
};
stable = {
version = "28.0.1500.95";
url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.95.tar.xz";
sha256 = "0d6pj57nyx7wfgxws98f6ly749flcyv7zg5sc3w16ggdxf5qhf1w";
};
} | 6 | 0.352941 | 3 | 3 |
2672605949c37b9cf48df7858a4a7da0c6360e44 | community/cypher/src/docs/dev/comments.txt | community/cypher/src/docs/dev/comments.txt | [[cypher-comments]]
Comments
========
To add comments to your queries, use double slash. Examples:
+START n=node(1) RETURN b //This is a end of line comment +
+START n=node(1)
//This is a whole line comment
RETURN b+
+START n=node(1) WHERE n.property = "//This is NOT a comment" RETURN b+
| [[cypher-comments]]
Comments
========
To add comments to your queries, use double slash. Examples:
[source,cypher]
----
START n=node(1) RETURN b //This is an end of line comment
----
[source,cypher]
----
START n=node(1)
//This is a whole line comment
RETURN b
----
[source,cypher]
----
START n=node(1) WHERE n.property = "//This is NOT a comment" RETURN b
----
| Use syntax highlighting for cypher comment examples. | Use syntax highlighting for cypher comment examples.
| Text | apache-2.0 | HuangLS/neo4j,HuangLS/neo4j,HuangLS/neo4j,HuangLS/neo4j,HuangLS/neo4j | text | ## Code Before:
[[cypher-comments]]
Comments
========
To add comments to your queries, use double slash. Examples:
+START n=node(1) RETURN b //This is a end of line comment +
+START n=node(1)
//This is a whole line comment
RETURN b+
+START n=node(1) WHERE n.property = "//This is NOT a comment" RETURN b+
## Instruction:
Use syntax highlighting for cypher comment examples.
## Code After:
[[cypher-comments]]
Comments
========
To add comments to your queries, use double slash. Examples:
[source,cypher]
----
START n=node(1) RETURN b //This is an end of line comment
----
[source,cypher]
----
START n=node(1)
//This is a whole line comment
RETURN b
----
[source,cypher]
----
START n=node(1) WHERE n.property = "//This is NOT a comment" RETURN b
----
| [[cypher-comments]]
Comments
========
To add comments to your queries, use double slash. Examples:
+ [source,cypher]
+ ----
- +START n=node(1) RETURN b //This is a end of line comment +
? - --
+ START n=node(1) RETURN b //This is an end of line comment
? +
+ ----
+ [source,cypher]
+ ----
- +START n=node(1)
? -
+ START n=node(1)
//This is a whole line comment
- RETURN b+
? -
+ RETURN b
+ ----
+ [source,cypher]
+ ----
- +START n=node(1) WHERE n.property = "//This is NOT a comment" RETURN b+
? - -
+ START n=node(1) WHERE n.property = "//This is NOT a comment" RETURN b
+ ----
+
+ | 19 | 1.461538 | 15 | 4 |
f899f8185095d3184df76b52855476a864a5b18e | .travis.yml | .travis.yml | language: rust
rust:
- nightly
addons:
apt:
packages:
- tree
install:
- git clone --depth 1 https://github.com/steveklabnik/rustbook.git
- cd rustbook && cargo build --release && cd ..
script:
- rustbook/target/release/rustbook build text/ book/
after_success:
- tree book
- zip -r too-many-lists book
| language: rust
rust:
- nightly
addons:
apt:
packages:
- tree
install:
- git clone --depth 1 https://github.com/steveklabnik/rustbook.git
- cd rustbook && cargo build --release && cd ..
script:
- rustbook/target/release/rustbook build text/ book/
after_success:
- tree book
- zip -r too-many-lists.zip book
deploy:
provider: releases
api_key: "$GH_DEPLOY_TOKEN"
file: "too-many-lists.zip"
skip_cleanup: true
on:
tags: true
| Add Travis to Github Release deploy config | Add Travis to Github Release deploy config | YAML | mit | rust-unofficial/too-many-lists,Gankro/too-many-lists | yaml | ## Code Before:
language: rust
rust:
- nightly
addons:
apt:
packages:
- tree
install:
- git clone --depth 1 https://github.com/steveklabnik/rustbook.git
- cd rustbook && cargo build --release && cd ..
script:
- rustbook/target/release/rustbook build text/ book/
after_success:
- tree book
- zip -r too-many-lists book
## Instruction:
Add Travis to Github Release deploy config
## Code After:
language: rust
rust:
- nightly
addons:
apt:
packages:
- tree
install:
- git clone --depth 1 https://github.com/steveklabnik/rustbook.git
- cd rustbook && cargo build --release && cd ..
script:
- rustbook/target/release/rustbook build text/ book/
after_success:
- tree book
- zip -r too-many-lists.zip book
deploy:
provider: releases
api_key: "$GH_DEPLOY_TOKEN"
file: "too-many-lists.zip"
skip_cleanup: true
on:
tags: true
| language: rust
rust:
- nightly
addons:
apt:
packages:
- tree
install:
- git clone --depth 1 https://github.com/steveklabnik/rustbook.git
- cd rustbook && cargo build --release && cd ..
script:
- rustbook/target/release/rustbook build text/ book/
after_success:
- tree book
- - zip -r too-many-lists book
+ - zip -r too-many-lists.zip book
? ++++
+
+ deploy:
+ provider: releases
+ api_key: "$GH_DEPLOY_TOKEN"
+ file: "too-many-lists.zip"
+ skip_cleanup: true
+ on:
+ tags: true | 10 | 0.526316 | 9 | 1 |
d0f8882231c6b9bac621928aef1522cf792b71d1 | README.md | README.md | Python library to make bin width selection for histograms very simple
| Python library to make bin width selection for histograms very simple
```
from histobin import Histobin
hb = Histobin(df.column)
```
## Square-root choice
```
df.column.plot(kind='hist', bins=hb.sqrt)
df.hist(column='column', by='group', bins=hb.sqrt)
```
## Sturges' formula
```
df.column.plot(kind='hist', bins=hb.sturges)
df.hist(column='column', by='group', bins=hb.sturges)
```
## Rice Rule
```
df.column.plot(kind='hist', bins=hb.rice_rule)
df.hist(column='column', by='group', bins=hb.rice_rule)
```
## Doane's formula
```
df.column.plot(kind='hist', bins=hb.doane)
df.hist(column='column', by='group', bins=hb.doane)
```
## Scott's normal reference rule
```
df.column.plot(kind='hist', bins=hb.scott)
df.hist(column='column', by='group', bins=hb.scott)
```
## Freedman–Diaconis' choice
```
df.column.plot(kind='hist', bins=hb.freedman_diaconis)
df.hist(column='column', by='group', bins=hb.freedman_diaconis)
```
| Add a loose description of the API | Add a loose description of the API | Markdown | mit | aegorenkov/histobin | markdown | ## Code Before:
Python library to make bin width selection for histograms very simple
## Instruction:
Add a loose description of the API
## Code After:
Python library to make bin width selection for histograms very simple
```
from histobin import Histobin
hb = Histobin(df.column)
```
## Square-root choice
```
df.column.plot(kind='hist', bins=hb.sqrt)
df.hist(column='column', by='group', bins=hb.sqrt)
```
## Sturges' formula
```
df.column.plot(kind='hist', bins=hb.sturges)
df.hist(column='column', by='group', bins=hb.sturges)
```
## Rice Rule
```
df.column.plot(kind='hist', bins=hb.rice_rule)
df.hist(column='column', by='group', bins=hb.rice_rule)
```
## Doane's formula
```
df.column.plot(kind='hist', bins=hb.doane)
df.hist(column='column', by='group', bins=hb.doane)
```
## Scott's normal reference rule
```
df.column.plot(kind='hist', bins=hb.scott)
df.hist(column='column', by='group', bins=hb.scott)
```
## Freedman–Diaconis' choice
```
df.column.plot(kind='hist', bins=hb.freedman_diaconis)
df.hist(column='column', by='group', bins=hb.freedman_diaconis)
```
| Python library to make bin width selection for histograms very simple
+
+ ```
+ from histobin import Histobin
+ hb = Histobin(df.column)
+ ```
+
+ ## Square-root choice
+ ```
+ df.column.plot(kind='hist', bins=hb.sqrt)
+ df.hist(column='column', by='group', bins=hb.sqrt)
+ ```
+ ## Sturges' formula
+ ```
+ df.column.plot(kind='hist', bins=hb.sturges)
+ df.hist(column='column', by='group', bins=hb.sturges)
+ ```
+ ## Rice Rule
+ ```
+ df.column.plot(kind='hist', bins=hb.rice_rule)
+ df.hist(column='column', by='group', bins=hb.rice_rule)
+ ```
+ ## Doane's formula
+ ```
+ df.column.plot(kind='hist', bins=hb.doane)
+ df.hist(column='column', by='group', bins=hb.doane)
+ ```
+ ## Scott's normal reference rule
+ ```
+ df.column.plot(kind='hist', bins=hb.scott)
+ df.hist(column='column', by='group', bins=hb.scott)
+ ```
+ ## Freedman–Diaconis' choice
+ ```
+ df.column.plot(kind='hist', bins=hb.freedman_diaconis)
+ df.hist(column='column', by='group', bins=hb.freedman_diaconis)
+ ``` | 36 | 36 | 36 | 0 |
a65ea2df5583571035db8b8fcee4cef73b50b197 | src/Gfx/EngineState.hs | src/Gfx/EngineState.hs | module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..))
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseState = EngineState {
fillColours = [Color4 1 1 1 1]
, strokeColours = [Color4 0 0 0 1]
, drawTransparencies = False
}
pushFillColour :: Color4 Double -> EngineState -> EngineState
pushFillColour c es = es { fillColours = c : fillColours es }
currentFillColour :: EngineState -> Color4 Double
currentFillColour = head . fillColours
popFillColour :: EngineState -> EngineState
popFillColour es = es { fillColours = tail $ fillColours es }
pushStrokeColour :: Color4 Double -> EngineState -> EngineState
pushStrokeColour c es = es { strokeColours = c : strokeColours es }
currentStrokeColour :: EngineState -> Color4 Double
currentStrokeColour = head . strokeColours
popStrokeColour :: EngineState -> EngineState
popStrokeColour es = es { strokeColours = tail $ strokeColours es }
| module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..))
import Gfx.Ast (Block)
data Scene = Scene {
sceneBackground :: Color4 Float,
sceneGfx :: Block
}
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseState = EngineState {
fillColours = [Color4 1 1 1 1]
, strokeColours = [Color4 0 0 0 1]
, drawTransparencies = False
}
pushFillColour :: Color4 Double -> EngineState -> EngineState
pushFillColour c es = es { fillColours = c : fillColours es }
currentFillColour :: EngineState -> Color4 Double
currentFillColour = head . fillColours
popFillColour :: EngineState -> EngineState
popFillColour es = es { fillColours = tail $ fillColours es }
pushStrokeColour :: Color4 Double -> EngineState -> EngineState
pushStrokeColour c es = es { strokeColours = c : strokeColours es }
currentStrokeColour :: EngineState -> Color4 Double
currentStrokeColour = head . strokeColours
popStrokeColour :: EngineState -> EngineState
popStrokeColour es = es { strokeColours = tail $ strokeColours es }
| Add Scene structure for gfx Scenes | Add Scene structure for gfx Scenes
| Haskell | bsd-3-clause | rumblesan/improviz,rumblesan/improviz | haskell | ## Code Before:
module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..))
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseState = EngineState {
fillColours = [Color4 1 1 1 1]
, strokeColours = [Color4 0 0 0 1]
, drawTransparencies = False
}
pushFillColour :: Color4 Double -> EngineState -> EngineState
pushFillColour c es = es { fillColours = c : fillColours es }
currentFillColour :: EngineState -> Color4 Double
currentFillColour = head . fillColours
popFillColour :: EngineState -> EngineState
popFillColour es = es { fillColours = tail $ fillColours es }
pushStrokeColour :: Color4 Double -> EngineState -> EngineState
pushStrokeColour c es = es { strokeColours = c : strokeColours es }
currentStrokeColour :: EngineState -> Color4 Double
currentStrokeColour = head . strokeColours
popStrokeColour :: EngineState -> EngineState
popStrokeColour es = es { strokeColours = tail $ strokeColours es }
## Instruction:
Add Scene structure for gfx Scenes
## Code After:
module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..))
import Gfx.Ast (Block)
data Scene = Scene {
sceneBackground :: Color4 Float,
sceneGfx :: Block
}
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseState = EngineState {
fillColours = [Color4 1 1 1 1]
, strokeColours = [Color4 0 0 0 1]
, drawTransparencies = False
}
pushFillColour :: Color4 Double -> EngineState -> EngineState
pushFillColour c es = es { fillColours = c : fillColours es }
currentFillColour :: EngineState -> Color4 Double
currentFillColour = head . fillColours
popFillColour :: EngineState -> EngineState
popFillColour es = es { fillColours = tail $ fillColours es }
pushStrokeColour :: Color4 Double -> EngineState -> EngineState
pushStrokeColour c es = es { strokeColours = c : strokeColours es }
currentStrokeColour :: EngineState -> Color4 Double
currentStrokeColour = head . strokeColours
popStrokeColour :: EngineState -> EngineState
popStrokeColour es = es { strokeColours = tail $ strokeColours es }
| module Gfx.EngineState where
import Graphics.Rendering.OpenGL (Color4(..))
+
+ import Gfx.Ast (Block)
+
+ data Scene = Scene {
+ sceneBackground :: Color4 Float,
+ sceneGfx :: Block
+ }
data EngineState = EngineState {
fillColours :: [ Color4 Double ]
, strokeColours :: [ Color4 Double ]
, drawTransparencies :: Bool
} deriving (Show, Eq)
baseState :: EngineState
baseState = EngineState {
fillColours = [Color4 1 1 1 1]
, strokeColours = [Color4 0 0 0 1]
, drawTransparencies = False
}
pushFillColour :: Color4 Double -> EngineState -> EngineState
pushFillColour c es = es { fillColours = c : fillColours es }
currentFillColour :: EngineState -> Color4 Double
currentFillColour = head . fillColours
popFillColour :: EngineState -> EngineState
popFillColour es = es { fillColours = tail $ fillColours es }
pushStrokeColour :: Color4 Double -> EngineState -> EngineState
pushStrokeColour c es = es { strokeColours = c : strokeColours es }
currentStrokeColour :: EngineState -> Color4 Double
currentStrokeColour = head . strokeColours
popStrokeColour :: EngineState -> EngineState
popStrokeColour es = es { strokeColours = tail $ strokeColours es } | 7 | 0.2 | 7 | 0 |
698d14a2d060a3606f43116b879d773a0446d315 | src/com/gh4a/loader/IsCollaboratorLoader.java | src/com/gh4a/loader/IsCollaboratorLoader.java | package com.gh4a.loader;
import java.io.IOException;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.client.RequestException;
import org.eclipse.egit.github.core.service.CollaboratorService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class IsCollaboratorLoader extends BaseLoader<Boolean> {
private String mRepoOwner;
private String mRepoName;
public IsCollaboratorLoader(Context context, String repoOwner, String repoName) {
super(context);
mRepoOwner = repoOwner;
mRepoName = repoName;
}
@Override
public Boolean doLoadInBackground() throws IOException {
Gh4Application app = Gh4Application.get();
CollaboratorService collabService =
(CollaboratorService) app.getService(Gh4Application.COLLAB_SERVICE);
try {
RepositoryId repoId = new RepositoryId(mRepoOwner, mRepoName);
return collabService.isCollaborator(repoId, app.getAuthLogin());
} catch (RequestException e) {
if (e.getStatus() == 403) {
// the API returns 403 if the user doesn't have push access,
// which in turn means he isn't a collaborator
return false;
}
throw e;
}
}
}
| package com.gh4a.loader;
import java.io.IOException;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.client.RequestException;
import org.eclipse.egit.github.core.service.CollaboratorService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class IsCollaboratorLoader extends BaseLoader<Boolean> {
private String mRepoOwner;
private String mRepoName;
public IsCollaboratorLoader(Context context, String repoOwner, String repoName) {
super(context);
mRepoOwner = repoOwner;
mRepoName = repoName;
}
@Override
public Boolean doLoadInBackground() throws IOException {
Gh4Application app = Gh4Application.get();
String login = app.getAuthLogin();
if (login == null) {
return false;
}
CollaboratorService collabService =
(CollaboratorService) app.getService(Gh4Application.COLLAB_SERVICE);
try {
RepositoryId repoId = new RepositoryId(mRepoOwner, mRepoName);
return collabService.isCollaborator(repoId, login);
} catch (RequestException e) {
if (e.getStatus() == 403) {
// the API returns 403 if the user doesn't have push access,
// which in turn means he isn't a collaborator
return false;
}
throw e;
}
}
}
| Fix load failure if not logged in. | Fix load failure if not logged in.
| Java | apache-2.0 | edyesed/gh4a,DeLaSalleUniversity-Manila/octodroid-ToastyKrabstix,Bloody-Badboy/gh4a,Bloody-Badboy/gh4a,shineM/gh4a,edyesed/gh4a,slapperwan/gh4a,slapperwan/gh4a,shekibobo/gh4a,AKiniyalocts/gh4a,sauloaguiar/gh4a,shineM/gh4a,AKiniyalocts/gh4a,sauloaguiar/gh4a,DeLaSalleUniversity-Manila/octodroid-ToastyKrabstix,shekibobo/gh4a | java | ## Code Before:
package com.gh4a.loader;
import java.io.IOException;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.client.RequestException;
import org.eclipse.egit.github.core.service.CollaboratorService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class IsCollaboratorLoader extends BaseLoader<Boolean> {
private String mRepoOwner;
private String mRepoName;
public IsCollaboratorLoader(Context context, String repoOwner, String repoName) {
super(context);
mRepoOwner = repoOwner;
mRepoName = repoName;
}
@Override
public Boolean doLoadInBackground() throws IOException {
Gh4Application app = Gh4Application.get();
CollaboratorService collabService =
(CollaboratorService) app.getService(Gh4Application.COLLAB_SERVICE);
try {
RepositoryId repoId = new RepositoryId(mRepoOwner, mRepoName);
return collabService.isCollaborator(repoId, app.getAuthLogin());
} catch (RequestException e) {
if (e.getStatus() == 403) {
// the API returns 403 if the user doesn't have push access,
// which in turn means he isn't a collaborator
return false;
}
throw e;
}
}
}
## Instruction:
Fix load failure if not logged in.
## Code After:
package com.gh4a.loader;
import java.io.IOException;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.client.RequestException;
import org.eclipse.egit.github.core.service.CollaboratorService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class IsCollaboratorLoader extends BaseLoader<Boolean> {
private String mRepoOwner;
private String mRepoName;
public IsCollaboratorLoader(Context context, String repoOwner, String repoName) {
super(context);
mRepoOwner = repoOwner;
mRepoName = repoName;
}
@Override
public Boolean doLoadInBackground() throws IOException {
Gh4Application app = Gh4Application.get();
String login = app.getAuthLogin();
if (login == null) {
return false;
}
CollaboratorService collabService =
(CollaboratorService) app.getService(Gh4Application.COLLAB_SERVICE);
try {
RepositoryId repoId = new RepositoryId(mRepoOwner, mRepoName);
return collabService.isCollaborator(repoId, login);
} catch (RequestException e) {
if (e.getStatus() == 403) {
// the API returns 403 if the user doesn't have push access,
// which in turn means he isn't a collaborator
return false;
}
throw e;
}
}
}
| package com.gh4a.loader;
import java.io.IOException;
import org.eclipse.egit.github.core.RepositoryId;
import org.eclipse.egit.github.core.client.RequestException;
import org.eclipse.egit.github.core.service.CollaboratorService;
import android.content.Context;
import com.gh4a.Gh4Application;
public class IsCollaboratorLoader extends BaseLoader<Boolean> {
private String mRepoOwner;
private String mRepoName;
public IsCollaboratorLoader(Context context, String repoOwner, String repoName) {
super(context);
mRepoOwner = repoOwner;
mRepoName = repoName;
}
@Override
public Boolean doLoadInBackground() throws IOException {
Gh4Application app = Gh4Application.get();
+ String login = app.getAuthLogin();
+ if (login == null) {
+ return false;
+ }
+
CollaboratorService collabService =
(CollaboratorService) app.getService(Gh4Application.COLLAB_SERVICE);
try {
RepositoryId repoId = new RepositoryId(mRepoOwner, mRepoName);
- return collabService.isCollaborator(repoId, app.getAuthLogin());
? ^^^^^^^^^^^^ --
+ return collabService.isCollaborator(repoId, login);
? ^
} catch (RequestException e) {
if (e.getStatus() == 403) {
// the API returns 403 if the user doesn't have push access,
// which in turn means he isn't a collaborator
return false;
}
throw e;
}
}
} | 7 | 0.170732 | 6 | 1 |
58a95535893c11bc228d3b5a3991e3a52782fa43 | README.md | README.md |
This projects tries to solve common issue with documentations. It turns your issue tracker into project documentation.
It requires you to rethink the way you create issues. Instead of "this button should save currently opened document " you write it as already implemented fact - "the save button saves currently opened document".
Also documentation starts to reflect current state of the application. So it's becomes visible what part of the app is done and working, what are in progress, what is broken.
## How to run
### Start mongo
```
C:\mongodb\bin\mongod.exe --dbpath C:\mongodb\bin\data
```
### Start express server
from server folder:
```
npm start
```
### Go to http://localhost:3000/
## License
Facts is Apache licensed. |
This projects tries to solve common issue with documentations. It turns your issue tracker into project documentation.
It requires you to rethink the way you create issues. Instead of "this button should save currently opened document " you write it as already implemented fact - "the save button saves currently opened document".
Also documentation starts to reflect current state of the application. So it's becomes visible what part of the app is done and working, what are in progress, what is broken.
## How to run
### Compile client app
From `client` folder:
```
gulp default
```
### Start database server
```
C:\mongodb\bin\mongod.exe --dbpath C:\mongodb\bin\data
```
### Start web server
From `server` folder:
```
npm start
```
### Go to http://localhost:3000/
## License
Facts is Apache licensed. | Add details on how to run the app | Add details on how to run the app
| Markdown | apache-2.0 | funkyOne/facts,funkyOne/facts,funkyOne/facts | markdown | ## Code Before:
This projects tries to solve common issue with documentations. It turns your issue tracker into project documentation.
It requires you to rethink the way you create issues. Instead of "this button should save currently opened document " you write it as already implemented fact - "the save button saves currently opened document".
Also documentation starts to reflect current state of the application. So it's becomes visible what part of the app is done and working, what are in progress, what is broken.
## How to run
### Start mongo
```
C:\mongodb\bin\mongod.exe --dbpath C:\mongodb\bin\data
```
### Start express server
from server folder:
```
npm start
```
### Go to http://localhost:3000/
## License
Facts is Apache licensed.
## Instruction:
Add details on how to run the app
## Code After:
This projects tries to solve common issue with documentations. It turns your issue tracker into project documentation.
It requires you to rethink the way you create issues. Instead of "this button should save currently opened document " you write it as already implemented fact - "the save button saves currently opened document".
Also documentation starts to reflect current state of the application. So it's becomes visible what part of the app is done and working, what are in progress, what is broken.
## How to run
### Compile client app
From `client` folder:
```
gulp default
```
### Start database server
```
C:\mongodb\bin\mongod.exe --dbpath C:\mongodb\bin\data
```
### Start web server
From `server` folder:
```
npm start
```
### Go to http://localhost:3000/
## License
Facts is Apache licensed. |
This projects tries to solve common issue with documentations. It turns your issue tracker into project documentation.
It requires you to rethink the way you create issues. Instead of "this button should save currently opened document " you write it as already implemented fact - "the save button saves currently opened document".
Also documentation starts to reflect current state of the application. So it's becomes visible what part of the app is done and working, what are in progress, what is broken.
## How to run
- ### Start mongo
+ ### Compile client app
+ From `client` folder:
+ ```
+ gulp default
+ ```
+
+ ### Start database server
```
C:\mongodb\bin\mongod.exe --dbpath C:\mongodb\bin\data
```
- ### Start express server
? ^^^^^^
+ ### Start web server
? + ^
- from server folder:
? ^
+ From `server` folder:
? ^ + +
```
npm start
```
### Go to http://localhost:3000/
## License
Facts is Apache licensed. | 12 | 0.5 | 9 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.