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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ea39c4ebba3d5ab42dfa202f88f7d76386e505fe | plugins/MeshView/MeshView.py | plugins/MeshView/MeshView.py | from Cura.View.View import View
class MeshView(View):
def __init__(self):
super(MeshView, self).__init__()
def render(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._renderObject(scene.getRoot(), renderer)
def _renderObject(self, object, renderer):
if object.getMeshData():
renderer.renderMesh(object.getGlobalTransformation(), object.getMeshData())
for child in object.getChildren():
self._renderObject(child, renderer)
| from Cura.View.View import View
class MeshView(View):
def __init__(self):
super(MeshView, self).__init__()
def render(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._renderObject(scene.getRoot(), renderer)
def _renderObject(self, object, renderer):
if not object.render():
if object.getMeshData():
renderer.renderMesh(object.getGlobalTransformation(), object.getMeshData())
for child in object.getChildren():
self._renderObject(child, renderer)
| Allow SceneObjects to render themselves | Allow SceneObjects to render themselves
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | python | ## Code Before:
from Cura.View.View import View
class MeshView(View):
def __init__(self):
super(MeshView, self).__init__()
def render(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._renderObject(scene.getRoot(), renderer)
def _renderObject(self, object, renderer):
if object.getMeshData():
renderer.renderMesh(object.getGlobalTransformation(), object.getMeshData())
for child in object.getChildren():
self._renderObject(child, renderer)
## Instruction:
Allow SceneObjects to render themselves
## Code After:
from Cura.View.View import View
class MeshView(View):
def __init__(self):
super(MeshView, self).__init__()
def render(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._renderObject(scene.getRoot(), renderer)
def _renderObject(self, object, renderer):
if not object.render():
if object.getMeshData():
renderer.renderMesh(object.getGlobalTransformation(), object.getMeshData())
for child in object.getChildren():
self._renderObject(child, renderer)
| from Cura.View.View import View
class MeshView(View):
def __init__(self):
super(MeshView, self).__init__()
def render(self):
scene = self.getController().getScene()
renderer = self.getRenderer()
self._renderObject(scene.getRoot(), renderer)
def _renderObject(self, object, renderer):
+ if not object.render():
- if object.getMeshData():
+ if object.getMeshData():
? ++++
- renderer.renderMesh(object.getGlobalTransformation(), object.getMeshData())
+ renderer.renderMesh(object.getGlobalTransformation(), object.getMeshData())
? ++++
for child in object.getChildren():
self._renderObject(child, renderer) | 5 | 0.277778 | 3 | 2 |
3781aab6c0006cafac24f2a8c514d2908d80a428 | structurizr-core/src/com/structurizr/componentfinder/ComponentFinder.java | structurizr-core/src/com/structurizr/componentfinder/ComponentFinder.java | package com.structurizr.componentfinder;
import com.structurizr.model.Component;
import com.structurizr.model.Container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
public class ComponentFinder {
private Container container;
private String packageToScan;
private List<ComponentFinderStrategy> componentFinderStrategies = new ArrayList<>();
public ComponentFinder(Container container, String packageToScan, ComponentFinderStrategy... componentFinderStrategies) {
this.container = container;
this.packageToScan = packageToScan;
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
this.componentFinderStrategies.add(componentFinderStrategy);
componentFinderStrategy.setComponentFinder(this);
}
}
public Collection<Component> findComponents() throws Exception {
Collection<Component> componentsFound = new LinkedList<>();
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findComponents();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findDependencies();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentsFound.addAll(componentFinderStrategy.getComponents());
}
return componentsFound;
}
Container getContainer() {
return this.container;
}
String getPackageToScan() {
return packageToScan;
}
}
| package com.structurizr.componentfinder;
import com.structurizr.model.Component;
import com.structurizr.model.Container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
public class ComponentFinder {
private Container container;
private String packageToScan;
private List<ComponentFinderStrategy> componentFinderStrategies = new ArrayList<>();
public ComponentFinder(Container container, String packageToScan, ComponentFinderStrategy... componentFinderStrategies) {
this.container = container;
this.packageToScan = packageToScan;
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
this.componentFinderStrategies.add(componentFinderStrategy);
componentFinderStrategy.setComponentFinder(this);
}
}
public Collection<Component> findComponents() throws Exception {
Collection<Component> componentsFound = new LinkedList<>();
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findComponents();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findDependencies();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentsFound.addAll(componentFinderStrategy.getComponents());
}
return componentsFound;
}
public Container getContainer() {
return this.container;
}
public String getPackageToScan() {
return packageToScan;
}
}
| Make getContainer and getPackagesToScan public. 3rd party component finder strategies living in different packages can now use those functions. | Make getContainer and getPackagesToScan public.
3rd party component finder strategies living in different packages can now use
those functions.
| Java | apache-2.0 | structurizr/java,klu2/structurizr-java | java | ## Code Before:
package com.structurizr.componentfinder;
import com.structurizr.model.Component;
import com.structurizr.model.Container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
public class ComponentFinder {
private Container container;
private String packageToScan;
private List<ComponentFinderStrategy> componentFinderStrategies = new ArrayList<>();
public ComponentFinder(Container container, String packageToScan, ComponentFinderStrategy... componentFinderStrategies) {
this.container = container;
this.packageToScan = packageToScan;
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
this.componentFinderStrategies.add(componentFinderStrategy);
componentFinderStrategy.setComponentFinder(this);
}
}
public Collection<Component> findComponents() throws Exception {
Collection<Component> componentsFound = new LinkedList<>();
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findComponents();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findDependencies();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentsFound.addAll(componentFinderStrategy.getComponents());
}
return componentsFound;
}
Container getContainer() {
return this.container;
}
String getPackageToScan() {
return packageToScan;
}
}
## Instruction:
Make getContainer and getPackagesToScan public.
3rd party component finder strategies living in different packages can now use
those functions.
## Code After:
package com.structurizr.componentfinder;
import com.structurizr.model.Component;
import com.structurizr.model.Container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
public class ComponentFinder {
private Container container;
private String packageToScan;
private List<ComponentFinderStrategy> componentFinderStrategies = new ArrayList<>();
public ComponentFinder(Container container, String packageToScan, ComponentFinderStrategy... componentFinderStrategies) {
this.container = container;
this.packageToScan = packageToScan;
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
this.componentFinderStrategies.add(componentFinderStrategy);
componentFinderStrategy.setComponentFinder(this);
}
}
public Collection<Component> findComponents() throws Exception {
Collection<Component> componentsFound = new LinkedList<>();
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findComponents();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findDependencies();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentsFound.addAll(componentFinderStrategy.getComponents());
}
return componentsFound;
}
public Container getContainer() {
return this.container;
}
public String getPackageToScan() {
return packageToScan;
}
}
| package com.structurizr.componentfinder;
import com.structurizr.model.Component;
import com.structurizr.model.Container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
public class ComponentFinder {
private Container container;
private String packageToScan;
private List<ComponentFinderStrategy> componentFinderStrategies = new ArrayList<>();
public ComponentFinder(Container container, String packageToScan, ComponentFinderStrategy... componentFinderStrategies) {
this.container = container;
this.packageToScan = packageToScan;
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
this.componentFinderStrategies.add(componentFinderStrategy);
componentFinderStrategy.setComponentFinder(this);
}
}
public Collection<Component> findComponents() throws Exception {
Collection<Component> componentsFound = new LinkedList<>();
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findComponents();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentFinderStrategy.findDependencies();
}
for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
componentsFound.addAll(componentFinderStrategy.getComponents());
}
return componentsFound;
}
- Container getContainer() {
+ public Container getContainer() {
? +++++++
return this.container;
}
- String getPackageToScan() {
+ public String getPackageToScan() {
? +++++++
return packageToScan;
}
} | 4 | 0.074074 | 2 | 2 |
6adbbe71dcde926fbd9288b4a43b45ff1a339cdc | turbustat/statistics/stats_utils.py | turbustat/statistics/stats_utils.py |
import numpy as np
def hellinger(data1, data2):
'''
Calculate the Hellinger Distance between two datasets.
Parameters
----------
data1 : numpy.ndarray
1D array.
data2 : numpy.ndarray
1D array.
Returns
-------
distance : float
Distance value.
'''
distance = (1 / np.sqrt(2)) * \
np.sqrt(np.nansum((np.sqrt(data1) - np.sqrt(data2)) ** 2.))
return distance
def standardize(x):
return (x - np.nanmean(x)) / np.nanstd(x)
|
import numpy as np
def hellinger(data1, data2):
'''
Calculate the Hellinger Distance between two datasets.
Parameters
----------
data1 : numpy.ndarray
1D array.
data2 : numpy.ndarray
1D array.
Returns
-------
distance : float
Distance value.
'''
distance = (1 / np.sqrt(2)) * \
np.sqrt(np.nansum((np.sqrt(data1) - np.sqrt(data2)) ** 2.))
return distance
def standardize(x):
return (x - np.nanmean(x)) / np.nanstd(x)
def kl_divergence(P, Q):
'''
Kullback Leidler Divergence
Parameters
----------
P,Q : numpy.ndarray
Two Discrete Probability distributions
Returns
-------
kl_divergence : float
'''
P = P[~np.isnan(P)]
Q = Q[~np.isnan(Q)]
P = P[np.isfinite(P)]
Q = Q[np.isfinite(Q)]
return np.nansum(np.where(Q != 0, P * np.log(P / Q), 0))
| Move KL Div to utils file | Move KL Div to utils file
| Python | mit | e-koch/TurbuStat,Astroua/TurbuStat | python | ## Code Before:
import numpy as np
def hellinger(data1, data2):
'''
Calculate the Hellinger Distance between two datasets.
Parameters
----------
data1 : numpy.ndarray
1D array.
data2 : numpy.ndarray
1D array.
Returns
-------
distance : float
Distance value.
'''
distance = (1 / np.sqrt(2)) * \
np.sqrt(np.nansum((np.sqrt(data1) - np.sqrt(data2)) ** 2.))
return distance
def standardize(x):
return (x - np.nanmean(x)) / np.nanstd(x)
## Instruction:
Move KL Div to utils file
## Code After:
import numpy as np
def hellinger(data1, data2):
'''
Calculate the Hellinger Distance between two datasets.
Parameters
----------
data1 : numpy.ndarray
1D array.
data2 : numpy.ndarray
1D array.
Returns
-------
distance : float
Distance value.
'''
distance = (1 / np.sqrt(2)) * \
np.sqrt(np.nansum((np.sqrt(data1) - np.sqrt(data2)) ** 2.))
return distance
def standardize(x):
return (x - np.nanmean(x)) / np.nanstd(x)
def kl_divergence(P, Q):
'''
Kullback Leidler Divergence
Parameters
----------
P,Q : numpy.ndarray
Two Discrete Probability distributions
Returns
-------
kl_divergence : float
'''
P = P[~np.isnan(P)]
Q = Q[~np.isnan(Q)]
P = P[np.isfinite(P)]
Q = Q[np.isfinite(Q)]
return np.nansum(np.where(Q != 0, P * np.log(P / Q), 0))
|
import numpy as np
def hellinger(data1, data2):
'''
Calculate the Hellinger Distance between two datasets.
Parameters
----------
data1 : numpy.ndarray
1D array.
data2 : numpy.ndarray
1D array.
Returns
-------
distance : float
Distance value.
'''
distance = (1 / np.sqrt(2)) * \
np.sqrt(np.nansum((np.sqrt(data1) - np.sqrt(data2)) ** 2.))
return distance
def standardize(x):
return (x - np.nanmean(x)) / np.nanstd(x)
+
+
+ def kl_divergence(P, Q):
+ '''
+ Kullback Leidler Divergence
+
+ Parameters
+ ----------
+
+ P,Q : numpy.ndarray
+ Two Discrete Probability distributions
+
+ Returns
+ -------
+
+ kl_divergence : float
+ '''
+ P = P[~np.isnan(P)]
+ Q = Q[~np.isnan(Q)]
+ P = P[np.isfinite(P)]
+ Q = Q[np.isfinite(Q)]
+ return np.nansum(np.where(Q != 0, P * np.log(P / Q), 0)) | 22 | 0.814815 | 22 | 0 |
8e83da29f42e3b0f918779db904fec2274a45092 | lib/plugins/console/deploy.js | lib/plugins/console/deploy.js | var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
/*
var generate = function(callback){
spawn({
command: hexo.core_dir + 'bin/hexo',
args: ['generate'],
exit: function(code){
if (code === 0) callback();
}
});
};
*/
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.generate){
generate(next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
generate(next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
}); | var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.g || args.generate){
hexo.call('generate', next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
hexo.call('generate', next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
}); | Use call API to call generate console | Deploy: Use call API to call generate console
| JavaScript | mit | glabcn/hexo,elegantwww/hexo,amobiz/hexo,sailtoy/hexo,chenbojian/hexo,JasonMPE/hexo,zhipengyan/hexo,wyfyyy818818/hexo,nextexit/hexo,Richardphp/hexo,lknny/hexo,HiWong/hexo,hugoxia/hexo,0111001101111010/hexo,cjwind/hexx,meaverick/hexo,kennethlyn/hexo,DevinLow/DevinLow.github.io,allengaller/hexo,zoubin/hexo,zongkelong/hexo,biezhihua/hexo,wangjordy/wangjordy.github.io,DevinLow/DevinLow.github.io,hanhailong/hexo,delkyd/hexo,maominghui/hexo,tzq668766/hexo,jonesgithub/hexo,wenzhucjy/hexo,xushuwei202/hexo,kywk/hexi,gaojinhua/hexo,Bob1993/hexo,r4-keisuke/hexo,SampleLiao/hexo,fuchao2012/hexo,crystalwm/hexo,tibic/hexo,wwff/hexo,ppker/hexo,karenpeng/hexo,magicdawn/hexo,liuhongjiang/hexo,leikegeek/hexo,dieface/hexo,zhangg/hexo,ChaofengZhou/hexo,kywk/hexi,hexojs/hexo,luodengxiong/hexo,0111001101111010/blog,wangjordy/wangjordy.github.io,oomusou/hexo,hexojs/hexo,noikiy/hexo,wflmax/hexo,G-g-beringei/hexo,xiaoliuzi/hexo,liukaijv/hexo,ppker/hexo,dreamren/hexo,hackjustu/hexo,jp1017/hexo,memezilla/hexo,chenzaichun/hexo,viethang/hexo,znanl/znanl,haoyuchen1992/hexo,lukw00/hexo,XGHeaven/hexo,initiumlab/hexo,beni55/hexo,iamprasad88/hexo,aulphar/hexo,xcatliu/hexo,sundyxfan/hexo,imjerrybao/hexo,Carbs0126/hexo,Gtskk/hexo,zhi1ong/hexo,keeleys/hexo,GGuang/hexo,registercosmo/hexo,zhipengyan/hexo,luinnx/hexo,noname007/hexo-1,BruceChao/hexo,zhoulingjun/hexo,logonmy/hexo,leelynd/tapohuck,k2byew/hexo,Jeremy017/hexo,will-zhangweilin/myhexo,SaiNadh001/hexo,HcySunYang/hexo,jollylulu/hexo,Regis25489/hexo,DanielHit/hexo,runlevelsix/hexo,littledogboy/hexo,lookii/looki | javascript | ## Code Before:
var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
/*
var generate = function(callback){
spawn({
command: hexo.core_dir + 'bin/hexo',
args: ['generate'],
exit: function(code){
if (code === 0) callback();
}
});
};
*/
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.generate){
generate(next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
generate(next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
});
## Instruction:
Deploy: Use call API to call generate console
## Code After:
var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.g || args.generate){
hexo.call('generate', next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
hexo.call('generate', next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
}); | var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
+
- /*
- var generate = function(callback){
- spawn({
- command: hexo.core_dir + 'bin/hexo',
- args: ['generate'],
- exit: function(code){
- if (code === 0) callback();
- }
- });
- };
- */
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
- if (args.generate){
+ if (args.g || args.generate){
? ++++++++++
- generate(next);
? ^
+ hexo.call('generate', next);
? +++++++++++ ^^^
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
- generate(next);
? ^
+ hexo.call('generate', next);
? +++++++++++ ^^^
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
}); | 18 | 0.418605 | 4 | 14 |
6c24090da50d6d4600754246b78630bfbb7384cd | django_backend/templates/floppyforms/rows/bootstrap.html | django_backend/templates/floppyforms/rows/bootstrap.html | {% load floppyforms %}{% block row %}{% for field in fields %}
<div class="form-group{% if field.errors %} error{% endif %}">
{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text %}
{% if not inline_label %}
{% block label %}
{% if field|id %}<label for="{{ field|id }}">{% endif %}
{{ label }}
{% if label|last not in ".:!?" %}:{% endif %}
{% block help_text %}{% if field.help_text %}
<span data-content="{{ field.help_text }}" data-toggle="popover" data-trigger="hover" data-placement="top">(?)</span>
{% endif %}{% endblock %}
{% if field|id %}</label>{% endif %}
{% endblock %}
{% endif %}
{% block field %}
<div class="field-content">
{% block widget %}
{% if inline_label %}
{% formfield field with placeholder=label %}
{% else %}
{% formfield field %}
{% endif %}
{% endblock %}
{% block errors %}{% include "floppyforms/errors.html" with errors=field.errors %}{% endblock %}
{% block hidden_fields %}{% for field in hidden_fields %}{{ field.as_hidden }}{% endfor %}{% endblock %}
</div>
{% endblock %}
{% endwith %}
</div><!--- .control-group{% if field.errors %}.error{% endif %} -->
{% endfor %}{% endblock %}
| {% load floppyforms %}{% block row %}{% for field in fields %}
<div class="form-group{% if field.errors %} error{% endif %}">
{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text %}
{% if not inline_label %}
{% block label %}
{% if field|id %}<label for="{{ field|id }}">{% endif %}
{{ label }}{% if label|last not in ".:!?" %}:{% endif %}
{% block help_text %}{% if field.help_text %}
<span data-content="{{ field.help_text }}" data-toggle="popover" data-trigger="hover" data-placement="top"><span class="glyphicon glyphicon-question-sign"></span></span>
{% endif %}{% endblock %}
{% if field|id %}</label>{% endif %}
{% endblock %}
{% endif %}
{% block field %}
<div class="field-content">
{% block widget %}
{% if inline_label %}
{% formfield field with placeholder=label %}
{% else %}
{% formfield field %}
{% endif %}
{% endblock %}
{% block errors %}{% include "floppyforms/errors.html" with errors=field.errors %}{% endblock %}
{% block hidden_fields %}{% for field in hidden_fields %}{{ field.as_hidden }}{% endfor %}{% endblock %}
</div>
{% endblock %}
{% endwith %}
</div><!--- .control-group{% if field.errors %}.error{% endif %} -->
{% endfor %}{% endblock %}
| Improve styling in inlineformsets for help text and labels | Improve styling in inlineformsets for help text and labels
| HTML | bsd-3-clause | team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend | html | ## Code Before:
{% load floppyforms %}{% block row %}{% for field in fields %}
<div class="form-group{% if field.errors %} error{% endif %}">
{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text %}
{% if not inline_label %}
{% block label %}
{% if field|id %}<label for="{{ field|id }}">{% endif %}
{{ label }}
{% if label|last not in ".:!?" %}:{% endif %}
{% block help_text %}{% if field.help_text %}
<span data-content="{{ field.help_text }}" data-toggle="popover" data-trigger="hover" data-placement="top">(?)</span>
{% endif %}{% endblock %}
{% if field|id %}</label>{% endif %}
{% endblock %}
{% endif %}
{% block field %}
<div class="field-content">
{% block widget %}
{% if inline_label %}
{% formfield field with placeholder=label %}
{% else %}
{% formfield field %}
{% endif %}
{% endblock %}
{% block errors %}{% include "floppyforms/errors.html" with errors=field.errors %}{% endblock %}
{% block hidden_fields %}{% for field in hidden_fields %}{{ field.as_hidden }}{% endfor %}{% endblock %}
</div>
{% endblock %}
{% endwith %}
</div><!--- .control-group{% if field.errors %}.error{% endif %} -->
{% endfor %}{% endblock %}
## Instruction:
Improve styling in inlineformsets for help text and labels
## Code After:
{% load floppyforms %}{% block row %}{% for field in fields %}
<div class="form-group{% if field.errors %} error{% endif %}">
{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text %}
{% if not inline_label %}
{% block label %}
{% if field|id %}<label for="{{ field|id }}">{% endif %}
{{ label }}{% if label|last not in ".:!?" %}:{% endif %}
{% block help_text %}{% if field.help_text %}
<span data-content="{{ field.help_text }}" data-toggle="popover" data-trigger="hover" data-placement="top"><span class="glyphicon glyphicon-question-sign"></span></span>
{% endif %}{% endblock %}
{% if field|id %}</label>{% endif %}
{% endblock %}
{% endif %}
{% block field %}
<div class="field-content">
{% block widget %}
{% if inline_label %}
{% formfield field with placeholder=label %}
{% else %}
{% formfield field %}
{% endif %}
{% endblock %}
{% block errors %}{% include "floppyforms/errors.html" with errors=field.errors %}{% endblock %}
{% block hidden_fields %}{% for field in hidden_fields %}{{ field.as_hidden }}{% endfor %}{% endblock %}
</div>
{% endblock %}
{% endwith %}
</div><!--- .control-group{% if field.errors %}.error{% endif %} -->
{% endfor %}{% endblock %}
| {% load floppyforms %}{% block row %}{% for field in fields %}
<div class="form-group{% if field.errors %} error{% endif %}">
{% with classes=field.css_classes label=label|default:field.label help_text=help_text|default:field.help_text %}
{% if not inline_label %}
{% block label %}
{% if field|id %}<label for="{{ field|id }}">{% endif %}
- {{ label }}
- {% if label|last not in ".:!?" %}:{% endif %}
+ {{ label }}{% if label|last not in ".:!?" %}:{% endif %}
? +++++++++++
{% block help_text %}{% if field.help_text %}
- <span data-content="{{ field.help_text }}" data-toggle="popover" data-trigger="hover" data-placement="top">(?)</span>
? ^^^
+ <span data-content="{{ field.help_text }}" data-toggle="popover" data-trigger="hover" data-placement="top"><span class="glyphicon glyphicon-question-sign"></span></span>
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +++++++
{% endif %}{% endblock %}
{% if field|id %}</label>{% endif %}
{% endblock %}
{% endif %}
{% block field %}
<div class="field-content">
{% block widget %}
{% if inline_label %}
{% formfield field with placeholder=label %}
{% else %}
{% formfield field %}
{% endif %}
{% endblock %}
{% block errors %}{% include "floppyforms/errors.html" with errors=field.errors %}{% endblock %}
{% block hidden_fields %}{% for field in hidden_fields %}{{ field.as_hidden }}{% endfor %}{% endblock %}
</div>
{% endblock %}
{% endwith %}
</div><!--- .control-group{% if field.errors %}.error{% endif %} -->
{% endfor %}{% endblock %}
- | 6 | 0.193548 | 2 | 4 |
6415710a254f6dd4515b397a52b53aa3d7bb8c1b | src/providers/notificationCatcherProvider.js | src/providers/notificationCatcherProvider.js | /* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
return channels.reduce((config, channel: any) => ({
...config,
[channel]: {
providers: [{type: 'notificationcatcher'}],
multiProviderStrategy: 'no-fallback'
}
}), {})
}
constructor (channel: ChannelType) {
this.id = `${channel}-notificationcatcher-provider`
this.provider = new EmailSmtpProvider({
port: 1025,
ignoreTLS: true
})
}
async sendToCatcher (request: EmailRequestType): Promise<string> {
return this.provider.send(request)
}
}
| /* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
return channels.reduce((config, channel: any) => ({
...config,
[channel]: {
providers: [{type: 'notificationcatcher'}],
multiProviderStrategy: 'no-fallback'
}
}), {})
}
constructor (channel: ChannelType) {
this.id = `${channel}-notificationcatcher-provider`
const options = process.env.NOTIFME_CATCHER_OPTIONS || {
port: 1025,
ignoreTLS: true
}
this.provider = new EmailSmtpProvider(options)
}
async sendToCatcher (request: EmailRequestType): Promise<string> {
return this.provider.send(request)
}
}
| Add custom config for notifier catcher | Add custom config for notifier catcher
| JavaScript | mit | notifme/notifme-sdk | javascript | ## Code Before:
/* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
return channels.reduce((config, channel: any) => ({
...config,
[channel]: {
providers: [{type: 'notificationcatcher'}],
multiProviderStrategy: 'no-fallback'
}
}), {})
}
constructor (channel: ChannelType) {
this.id = `${channel}-notificationcatcher-provider`
this.provider = new EmailSmtpProvider({
port: 1025,
ignoreTLS: true
})
}
async sendToCatcher (request: EmailRequestType): Promise<string> {
return this.provider.send(request)
}
}
## Instruction:
Add custom config for notifier catcher
## Code After:
/* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
return channels.reduce((config, channel: any) => ({
...config,
[channel]: {
providers: [{type: 'notificationcatcher'}],
multiProviderStrategy: 'no-fallback'
}
}), {})
}
constructor (channel: ChannelType) {
this.id = `${channel}-notificationcatcher-provider`
const options = process.env.NOTIFME_CATCHER_OPTIONS || {
port: 1025,
ignoreTLS: true
}
this.provider = new EmailSmtpProvider(options)
}
async sendToCatcher (request: EmailRequestType): Promise<string> {
return this.provider.send(request)
}
}
| /* @flow */
import EmailSmtpProvider from './email/smtp'
// Types
import type {ChannelType} from '../index'
import type {EmailRequestType} from '../models/notification-request'
export default class NotificationCatcherProvider {
id: string
provider: EmailSmtpProvider
static getConfig (channels: ChannelType[]) {
return channels.reduce((config, channel: any) => ({
...config,
[channel]: {
providers: [{type: 'notificationcatcher'}],
multiProviderStrategy: 'no-fallback'
}
}), {})
}
constructor (channel: ChannelType) {
this.id = `${channel}-notificationcatcher-provider`
- this.provider = new EmailSmtpProvider({
+
+ const options = process.env.NOTIFME_CATCHER_OPTIONS || {
port: 1025,
ignoreTLS: true
- })
? -
+ }
+
+ this.provider = new EmailSmtpProvider(options)
}
async sendToCatcher (request: EmailRequestType): Promise<string> {
return this.provider.send(request)
}
} | 7 | 0.21875 | 5 | 2 |
017776eba67faea78c5f57f8271477610a88bd44 | spec/models/reaction_spec.rb | spec/models/reaction_spec.rb | require 'spec_helper'
describe Reaction do
let(:user) { User.create! login: 'some_guy', password: '123', password_confirmation: '123' }
let(:reaction) do
Reaction.new(
user: user,
title: 'Something happens',
image: Rack::Test::UploadedFile.new('spec/support/images/magic.gif', 'image/gif')
)
end
it "is valid when has user, title and image" do
expect(reaction).to be_valid
end
it "is invalid without user" do
reaction.user = nil
expect(reaction).not_to be_valid
end
it "is invalid without title" do
reaction.title = ' '
expect(reaction).not_to be_valid
end
it "trims title before validating" do
reaction.title = ' When I trim '
reaction.valid?
expect(reaction.title).to eq('When I trim')
end
it "is invalid without image" do
reaction = Reaction.new(user: user, title: 'No image')
expect(reaction).not_to be_valid
end
it "can have only image/gif as image" do
reaction.image = Rack::Test::UploadedFile.new('spec/support/images/man.jpg', 'image/jpg')
expect{reaction.save}.not_to change{ reaction.image }
end
end
| require 'spec_helper'
describe Reaction do
let(:user) { User.create! login: 'some_guy', password: '123', password_confirmation: '123' }
let(:reaction) do
Reaction.new(
user: user,
title: 'Something happens',
image: Rack::Test::UploadedFile.new('spec/support/images/magic.gif', 'image/gif')
)
end
it "is valid when has user, title and image" do
expect(reaction).to be_valid
end
it "is invalid without user" do
reaction.user = nil
expect(reaction).not_to be_valid
end
it "is invalid without title" do
reaction.title = ' '
expect(reaction).not_to be_valid
end
it "trims title before validating" do
reaction.title = ' When I trim '
reaction.valid?
expect(reaction.title).to eq('When I trim')
end
it "is invalid without image" do
reaction = Reaction.new(user: user, title: 'No image')
expect(reaction).not_to be_valid
end
it "can have only image/gif as image" do
reaction.image = Rack::Test::UploadedFile.new('spec/support/images/man.jpg', 'image/jpg')
expect(reaction).not_to be_valid
end
end
| Change of logic in image test | Change of logic in image test
| Ruby | mit | ozgg/reactiongifs,ozgg/reactiongifs | ruby | ## Code Before:
require 'spec_helper'
describe Reaction do
let(:user) { User.create! login: 'some_guy', password: '123', password_confirmation: '123' }
let(:reaction) do
Reaction.new(
user: user,
title: 'Something happens',
image: Rack::Test::UploadedFile.new('spec/support/images/magic.gif', 'image/gif')
)
end
it "is valid when has user, title and image" do
expect(reaction).to be_valid
end
it "is invalid without user" do
reaction.user = nil
expect(reaction).not_to be_valid
end
it "is invalid without title" do
reaction.title = ' '
expect(reaction).not_to be_valid
end
it "trims title before validating" do
reaction.title = ' When I trim '
reaction.valid?
expect(reaction.title).to eq('When I trim')
end
it "is invalid without image" do
reaction = Reaction.new(user: user, title: 'No image')
expect(reaction).not_to be_valid
end
it "can have only image/gif as image" do
reaction.image = Rack::Test::UploadedFile.new('spec/support/images/man.jpg', 'image/jpg')
expect{reaction.save}.not_to change{ reaction.image }
end
end
## Instruction:
Change of logic in image test
## Code After:
require 'spec_helper'
describe Reaction do
let(:user) { User.create! login: 'some_guy', password: '123', password_confirmation: '123' }
let(:reaction) do
Reaction.new(
user: user,
title: 'Something happens',
image: Rack::Test::UploadedFile.new('spec/support/images/magic.gif', 'image/gif')
)
end
it "is valid when has user, title and image" do
expect(reaction).to be_valid
end
it "is invalid without user" do
reaction.user = nil
expect(reaction).not_to be_valid
end
it "is invalid without title" do
reaction.title = ' '
expect(reaction).not_to be_valid
end
it "trims title before validating" do
reaction.title = ' When I trim '
reaction.valid?
expect(reaction.title).to eq('When I trim')
end
it "is invalid without image" do
reaction = Reaction.new(user: user, title: 'No image')
expect(reaction).not_to be_valid
end
it "can have only image/gif as image" do
reaction.image = Rack::Test::UploadedFile.new('spec/support/images/man.jpg', 'image/jpg')
expect(reaction).not_to be_valid
end
end
| require 'spec_helper'
describe Reaction do
let(:user) { User.create! login: 'some_guy', password: '123', password_confirmation: '123' }
let(:reaction) do
Reaction.new(
user: user,
title: 'Something happens',
image: Rack::Test::UploadedFile.new('spec/support/images/magic.gif', 'image/gif')
)
end
it "is valid when has user, title and image" do
expect(reaction).to be_valid
end
it "is invalid without user" do
reaction.user = nil
expect(reaction).not_to be_valid
end
it "is invalid without title" do
reaction.title = ' '
expect(reaction).not_to be_valid
end
it "trims title before validating" do
reaction.title = ' When I trim '
reaction.valid?
expect(reaction.title).to eq('When I trim')
end
it "is invalid without image" do
reaction = Reaction.new(user: user, title: 'No image')
expect(reaction).not_to be_valid
end
it "can have only image/gif as image" do
reaction.image = Rack::Test::UploadedFile.new('spec/support/images/man.jpg', 'image/jpg')
- expect{reaction.save}.not_to change{ reaction.image }
+ expect(reaction).not_to be_valid
end
end | 2 | 0.047619 | 1 | 1 |
b76330bb5311749e995fd3cf3449742dc30da4be | script/src/main/java/com/madisp/bad/expr/AssignExpression.java | script/src/main/java/com/madisp/bad/expr/AssignExpression.java | package com.madisp.bad.expr;
import com.madisp.bad.eval.BadConverter;
import com.madisp.bad.eval.Scope;
import com.madisp.bad.eval.Watcher;
/**
* Created with IntelliJ IDEA.
* User: madis
* Date: 3/27/13
* Time: 7:02 PM
*/
public class AssignExpression implements Expression {
private final Expression expr;
private final VarExpression var;
public AssignExpression(VarExpression var, Expression expr) {
this.var = var;
this.expr = expr;
}
@Override
public Object value(Scope scope) {
Object newValue = BadConverter.object(expr.value(scope));
scope.setVar(var.getBase(scope), var.getIdentifier(), newValue);
return newValue;
}
@Override
public void addWatcher(Scope scope, Watcher w) {
expr.addWatcher(scope, w);
var.addWatcher(scope, w);
}
}
| package com.madisp.bad.expr;
import com.madisp.bad.eval.BadConverter;
import com.madisp.bad.eval.Scope;
import com.madisp.bad.eval.Watcher;
/**
* Created with IntelliJ IDEA.
* User: madis
* Date: 3/27/13
* Time: 7:02 PM
*/
public class AssignExpression implements Expression {
private final Expression expr;
private final VarExpression var;
public AssignExpression(VarExpression var, Expression expr) {
this.var = var;
this.expr = expr;
}
@Override
public Object value(Scope scope) {
Object newValue = BadConverter.object(expr.value(scope));
scope.setVar(var.getBase(scope), var.getIdentifier(), newValue);
return newValue;
}
@Override
public void addWatcher(Scope scope, Watcher w) {
expr.addWatcher(scope, w);
// we don't need to watch var as it will trigger re-evaluation loop when this expression is watched
// var.addWatcher(scope, w);
}
}
| Fix re-evaluation loop with assignment expression | Fix re-evaluation loop with assignment expression
| Java | mit | madisp/bad,madisp/bad | java | ## Code Before:
package com.madisp.bad.expr;
import com.madisp.bad.eval.BadConverter;
import com.madisp.bad.eval.Scope;
import com.madisp.bad.eval.Watcher;
/**
* Created with IntelliJ IDEA.
* User: madis
* Date: 3/27/13
* Time: 7:02 PM
*/
public class AssignExpression implements Expression {
private final Expression expr;
private final VarExpression var;
public AssignExpression(VarExpression var, Expression expr) {
this.var = var;
this.expr = expr;
}
@Override
public Object value(Scope scope) {
Object newValue = BadConverter.object(expr.value(scope));
scope.setVar(var.getBase(scope), var.getIdentifier(), newValue);
return newValue;
}
@Override
public void addWatcher(Scope scope, Watcher w) {
expr.addWatcher(scope, w);
var.addWatcher(scope, w);
}
}
## Instruction:
Fix re-evaluation loop with assignment expression
## Code After:
package com.madisp.bad.expr;
import com.madisp.bad.eval.BadConverter;
import com.madisp.bad.eval.Scope;
import com.madisp.bad.eval.Watcher;
/**
* Created with IntelliJ IDEA.
* User: madis
* Date: 3/27/13
* Time: 7:02 PM
*/
public class AssignExpression implements Expression {
private final Expression expr;
private final VarExpression var;
public AssignExpression(VarExpression var, Expression expr) {
this.var = var;
this.expr = expr;
}
@Override
public Object value(Scope scope) {
Object newValue = BadConverter.object(expr.value(scope));
scope.setVar(var.getBase(scope), var.getIdentifier(), newValue);
return newValue;
}
@Override
public void addWatcher(Scope scope, Watcher w) {
expr.addWatcher(scope, w);
// we don't need to watch var as it will trigger re-evaluation loop when this expression is watched
// var.addWatcher(scope, w);
}
}
| package com.madisp.bad.expr;
import com.madisp.bad.eval.BadConverter;
import com.madisp.bad.eval.Scope;
import com.madisp.bad.eval.Watcher;
/**
* Created with IntelliJ IDEA.
* User: madis
* Date: 3/27/13
* Time: 7:02 PM
*/
public class AssignExpression implements Expression {
private final Expression expr;
private final VarExpression var;
public AssignExpression(VarExpression var, Expression expr) {
this.var = var;
this.expr = expr;
}
@Override
public Object value(Scope scope) {
Object newValue = BadConverter.object(expr.value(scope));
scope.setVar(var.getBase(scope), var.getIdentifier(), newValue);
return newValue;
}
@Override
public void addWatcher(Scope scope, Watcher w) {
expr.addWatcher(scope, w);
+ // we don't need to watch var as it will trigger re-evaluation loop when this expression is watched
- var.addWatcher(scope, w);
+ // var.addWatcher(scope, w);
? ++
}
} | 3 | 0.088235 | 2 | 1 |
938f0401bf240607c050e1d5f66daaf38e5c3f4d | vim/syntax/fresh.vim | vim/syntax/fresh.vim | " Fresh Syntax Vim
" Author : Quinten Palmer
highlight link freshStatement Statement
highlight link freshFunction Function
highlight link freshNumber Number
highlight link freshBool Number
hi def link freshBuiltin freshStatement
hi def link freshTokens freshStatement
hi def link freshExpressionDelimiter freshFunction
hi def link freshDec freshNumber
if exists("b:current_syntax")
finish
endif
syn keyword freshBuiltin var type function lambda if not and or
syn match freshTokens "[*+><=]"
syn match freshExpressionDelimiter "[()\[\]]"
syn match freshDec "\<\d\+\>"
| " Fresh Syntax Vim
" Author : Quinten Palmer
highlight link freshStatement Statement
highlight link freshFunction Function
highlight link freshNumber Number
highlight link freshBool Number
hi def link freshBuiltin freshStatement
hi def link freshTokens freshStatement
hi def link freshExpressionDelimiter freshFunction
hi def link freshDec freshNumber
if exists("b:current_syntax")
finish
endif
syn keyword freshBuiltin var type function lambda if not and or package member
syn match freshTokens "[*+><=]"
syn match freshExpressionDelimiter "[()\[\]]"
syn match freshDec "\<\d\+\>"
| Include package and member in vim keywords | Include package and member in vim keywords
| VimL | mit | quintenpalmer/fresh | viml | ## Code Before:
" Fresh Syntax Vim
" Author : Quinten Palmer
highlight link freshStatement Statement
highlight link freshFunction Function
highlight link freshNumber Number
highlight link freshBool Number
hi def link freshBuiltin freshStatement
hi def link freshTokens freshStatement
hi def link freshExpressionDelimiter freshFunction
hi def link freshDec freshNumber
if exists("b:current_syntax")
finish
endif
syn keyword freshBuiltin var type function lambda if not and or
syn match freshTokens "[*+><=]"
syn match freshExpressionDelimiter "[()\[\]]"
syn match freshDec "\<\d\+\>"
## Instruction:
Include package and member in vim keywords
## Code After:
" Fresh Syntax Vim
" Author : Quinten Palmer
highlight link freshStatement Statement
highlight link freshFunction Function
highlight link freshNumber Number
highlight link freshBool Number
hi def link freshBuiltin freshStatement
hi def link freshTokens freshStatement
hi def link freshExpressionDelimiter freshFunction
hi def link freshDec freshNumber
if exists("b:current_syntax")
finish
endif
syn keyword freshBuiltin var type function lambda if not and or package member
syn match freshTokens "[*+><=]"
syn match freshExpressionDelimiter "[()\[\]]"
syn match freshDec "\<\d\+\>"
| " Fresh Syntax Vim
" Author : Quinten Palmer
highlight link freshStatement Statement
highlight link freshFunction Function
highlight link freshNumber Number
highlight link freshBool Number
hi def link freshBuiltin freshStatement
hi def link freshTokens freshStatement
hi def link freshExpressionDelimiter freshFunction
hi def link freshDec freshNumber
if exists("b:current_syntax")
finish
endif
- syn keyword freshBuiltin var type function lambda if not and or
+ syn keyword freshBuiltin var type function lambda if not and or package member
? +++++++++++++++
syn match freshTokens "[*+><=]"
syn match freshExpressionDelimiter "[()\[\]]"
syn match freshDec "\<\d\+\>" | 2 | 0.090909 | 1 | 1 |
847fdb21f0afaa9c7d5b49d8b7f7158670b1ca8e | NaoTHSoccer/Config/scheme/RC18/BallCandidateDetector.cfg | NaoTHSoccer/Config/scheme/RC18/BallCandidateDetector.cfg | [BallCandidateDetector]
blackKeysCheck.enable=false
blackKeysCheck.minSizeToCheck=60
blackKeysCheck.minValue=20
brightnessMultiplierBottom=2
brightnessMultiplierTop=1
classifier=dortmund2018_keras
cnn.threshold=0.9
cnn.thresholdClose=0.9
contrastMinimum=10
contrastUse=true
contrastVariant=1
haarDetector.execute=true
haarDetector.minNeighbors=2
haarDetector.model_file=haar6.xml
haarDetector.windowSize=18
heuristic.blackDotsMinCount=1
heuristic.maxGreenInsideRatio=0.3
heuristic.minBlackDetectionSize=20
heuristic.minGreenBelowRatio=0.5
keyDetector.borderRadiusFactorClose=0.5
keyDetector.borderRadiusFactorFar=0.8
maxNumberOfKeys=7
numberOfExportBestPatches=2
postBorderFactorClose=0.2
postBorderFactorFar=0
postMaxCloseSize=60
| [BallCandidateDetector]
blackKeysCheck.enable=false
blackKeysCheck.minSizeToCheck=60
blackKeysCheck.minValue=20
brightnessMultiplierBottom=1
brightnessMultiplierTop=1
classifier=dortmund2018_keras
cnn.threshold=0.9
cnn.thresholdClose=0.9
contrastMinimum=10
contrastMinimumClose=50
contrastUse=true
contrastVariant=1
haarDetector.execute=true
haarDetector.minNeighbors=2
haarDetector.model_file=haar6.xml
haarDetector.windowSize=18
heuristic.blackDotsMinCount=1
heuristic.maxGreenInsideRatio=0.3
heuristic.minBlackDetectionSize=20
heuristic.minGreenBelowRatio=0.5
keyDetector.borderRadiusFactorClose=0.5
keyDetector.borderRadiusFactorFar=0.8
maxNumberOfKeys=7
numberOfExportBestPatches=2
postBorderFactorClose=0.2
postBorderFactorFar=0
postMaxCloseSize=60
| Make use of the new "contrastMinimumClose" parameter (configured on Field C) | Make use of the new "contrastMinimumClose" parameter (configured on Field C)
| INI | apache-2.0 | BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH | ini | ## Code Before:
[BallCandidateDetector]
blackKeysCheck.enable=false
blackKeysCheck.minSizeToCheck=60
blackKeysCheck.minValue=20
brightnessMultiplierBottom=2
brightnessMultiplierTop=1
classifier=dortmund2018_keras
cnn.threshold=0.9
cnn.thresholdClose=0.9
contrastMinimum=10
contrastUse=true
contrastVariant=1
haarDetector.execute=true
haarDetector.minNeighbors=2
haarDetector.model_file=haar6.xml
haarDetector.windowSize=18
heuristic.blackDotsMinCount=1
heuristic.maxGreenInsideRatio=0.3
heuristic.minBlackDetectionSize=20
heuristic.minGreenBelowRatio=0.5
keyDetector.borderRadiusFactorClose=0.5
keyDetector.borderRadiusFactorFar=0.8
maxNumberOfKeys=7
numberOfExportBestPatches=2
postBorderFactorClose=0.2
postBorderFactorFar=0
postMaxCloseSize=60
## Instruction:
Make use of the new "contrastMinimumClose" parameter (configured on Field C)
## Code After:
[BallCandidateDetector]
blackKeysCheck.enable=false
blackKeysCheck.minSizeToCheck=60
blackKeysCheck.minValue=20
brightnessMultiplierBottom=1
brightnessMultiplierTop=1
classifier=dortmund2018_keras
cnn.threshold=0.9
cnn.thresholdClose=0.9
contrastMinimum=10
contrastMinimumClose=50
contrastUse=true
contrastVariant=1
haarDetector.execute=true
haarDetector.minNeighbors=2
haarDetector.model_file=haar6.xml
haarDetector.windowSize=18
heuristic.blackDotsMinCount=1
heuristic.maxGreenInsideRatio=0.3
heuristic.minBlackDetectionSize=20
heuristic.minGreenBelowRatio=0.5
keyDetector.borderRadiusFactorClose=0.5
keyDetector.borderRadiusFactorFar=0.8
maxNumberOfKeys=7
numberOfExportBestPatches=2
postBorderFactorClose=0.2
postBorderFactorFar=0
postMaxCloseSize=60
| [BallCandidateDetector]
blackKeysCheck.enable=false
blackKeysCheck.minSizeToCheck=60
blackKeysCheck.minValue=20
- brightnessMultiplierBottom=2
? ^
+ brightnessMultiplierBottom=1
? ^
brightnessMultiplierTop=1
classifier=dortmund2018_keras
cnn.threshold=0.9
cnn.thresholdClose=0.9
contrastMinimum=10
+ contrastMinimumClose=50
contrastUse=true
contrastVariant=1
haarDetector.execute=true
haarDetector.minNeighbors=2
haarDetector.model_file=haar6.xml
haarDetector.windowSize=18
heuristic.blackDotsMinCount=1
heuristic.maxGreenInsideRatio=0.3
heuristic.minBlackDetectionSize=20
heuristic.minGreenBelowRatio=0.5
keyDetector.borderRadiusFactorClose=0.5
keyDetector.borderRadiusFactorFar=0.8
maxNumberOfKeys=7
numberOfExportBestPatches=2
postBorderFactorClose=0.2
postBorderFactorFar=0
postMaxCloseSize=60 | 3 | 0.111111 | 2 | 1 |
316ee44c2a0b3e236f8ec4603114490d01063037 | styles/index.less | styles/index.less | .syntax--text.syntax--tex.syntax--latex .syntax--markup.syntax--other.syntax--math {
color: @syntax-color-snippet
}
| .syntax--markup.syntax--other.syntax--math.syntax--latex {
color: @syntax-color-snippet
}
| Apply style when also embedded | Apply style when also embedded
| Less | mit | Aerijo/language-latex2e | less | ## Code Before:
.syntax--text.syntax--tex.syntax--latex .syntax--markup.syntax--other.syntax--math {
color: @syntax-color-snippet
}
## Instruction:
Apply style when also embedded
## Code After:
.syntax--markup.syntax--other.syntax--math.syntax--latex {
color: @syntax-color-snippet
}
| - .syntax--text.syntax--tex.syntax--latex .syntax--markup.syntax--other.syntax--math {
+ .syntax--markup.syntax--other.syntax--math.syntax--latex {
color: @syntax-color-snippet
} | 2 | 0.666667 | 1 | 1 |
020612f33d33d691d490b99e9a9c8d88cae64f18 | src/Extension/StratifyExtension.php | src/Extension/StratifyExtension.php | <?php
namespace Stratify\TwigModule\Extension;
use Stratify\Router\UrlGenerator;
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Twig extension that registers Stratify-specific functions and helpers.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class StratifyExtension extends Twig_Extension
{
/**
* @var UrlGenerator
*/
private $urlGenerator;
public function __construct(UrlGenerator $urlGenerator)
{
$this->urlGenerator = $urlGenerator;
}
public function getFunctions()
{
return [
new Twig_SimpleFunction('path', [$this, 'generatePath']),
];
}
public function generatePath(string $name, array $parameters = []) : string
{
return $this->urlGenerator->generate($name, $parameters);
}
public function getName()
{
return 'stratify';
}
}
| <?php
namespace Stratify\TwigModule\Extension;
use Interop\Container\ContainerInterface;
use Stratify\Router\UrlGenerator;
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Twig extension that registers Stratify-specific functions and helpers.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class StratifyExtension extends Twig_Extension
{
/**
* @var ContainerInterface
*/
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function getFunctions()
{
return [
new Twig_SimpleFunction('path', [$this, 'generatePath']),
];
}
public function generatePath(string $name, array $parameters = []) : string
{
$urlGenerator = $this->container->get(UrlGenerator::class);
return $urlGenerator->generate($name, $parameters);
}
public function getName()
{
return 'stratify';
}
}
| Resolve the dependency lazily to avoid resolving the UrlGenerator (and all Puli) when not used | Resolve the dependency lazily to avoid resolving the UrlGenerator (and all Puli) when not used
The container is injected but it's fine because the Twig extension is a glue class…
| PHP | mit | stratifyphp/twig-module,stratifyphp/twig-module | php | ## Code Before:
<?php
namespace Stratify\TwigModule\Extension;
use Stratify\Router\UrlGenerator;
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Twig extension that registers Stratify-specific functions and helpers.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class StratifyExtension extends Twig_Extension
{
/**
* @var UrlGenerator
*/
private $urlGenerator;
public function __construct(UrlGenerator $urlGenerator)
{
$this->urlGenerator = $urlGenerator;
}
public function getFunctions()
{
return [
new Twig_SimpleFunction('path', [$this, 'generatePath']),
];
}
public function generatePath(string $name, array $parameters = []) : string
{
return $this->urlGenerator->generate($name, $parameters);
}
public function getName()
{
return 'stratify';
}
}
## Instruction:
Resolve the dependency lazily to avoid resolving the UrlGenerator (and all Puli) when not used
The container is injected but it's fine because the Twig extension is a glue class…
## Code After:
<?php
namespace Stratify\TwigModule\Extension;
use Interop\Container\ContainerInterface;
use Stratify\Router\UrlGenerator;
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Twig extension that registers Stratify-specific functions and helpers.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class StratifyExtension extends Twig_Extension
{
/**
* @var ContainerInterface
*/
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function getFunctions()
{
return [
new Twig_SimpleFunction('path', [$this, 'generatePath']),
];
}
public function generatePath(string $name, array $parameters = []) : string
{
$urlGenerator = $this->container->get(UrlGenerator::class);
return $urlGenerator->generate($name, $parameters);
}
public function getName()
{
return 'stratify';
}
}
| <?php
namespace Stratify\TwigModule\Extension;
+ use Interop\Container\ContainerInterface;
use Stratify\Router\UrlGenerator;
use Twig_Extension;
use Twig_SimpleFunction;
/**
* Twig extension that registers Stratify-specific functions and helpers.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class StratifyExtension extends Twig_Extension
{
/**
- * @var UrlGenerator
+ * @var ContainerInterface
*/
- private $urlGenerator;
+ private $container;
- public function __construct(UrlGenerator $urlGenerator)
+ public function __construct(ContainerInterface $container)
{
- $this->urlGenerator = $urlGenerator;
+ $this->container = $container;
}
public function getFunctions()
{
return [
new Twig_SimpleFunction('path', [$this, 'generatePath']),
];
}
public function generatePath(string $name, array $parameters = []) : string
{
+ $urlGenerator = $this->container->get(UrlGenerator::class);
- return $this->urlGenerator->generate($name, $parameters);
? ------
+ return $urlGenerator->generate($name, $parameters);
}
public function getName()
{
return 'stratify';
}
} | 12 | 0.285714 | 7 | 5 |
cc385f4094901f41da2eb90f1ac66476ef4d9498 | updates/0.0.1-admins.js | updates/0.0.1-admins.js | /**
* This script automatically creates a default Admin user when an
* empty database is used for the first time. You can use this
* technique to insert data into any List you have defined.
*
* Alternatively, you can export a custom function for the update:
* module.exports = function(done) { ... }
*/
exports.create = {
User: [
{ 'name.first': 'Admin', 'name.last': 'User', email: 'admin@keystonejs.com', password: 'admin', isAdmin: true }
]
};
/*
// This is the long-hand version of the functionality above:
var keystone = require('keystone'),
async = require('async'),
User = keystone.list('User');
var admins = [
{ email: 'user@keystonejs.com', password: 'admin', name: { first: 'Admin', last: 'User' } }
];
function createAdmin(admin, done) {
var newAdmin = new User.model(admin);
newAdmin.isAdmin = true;
newAdmin.save(function(err) {
if (err) {
console.error("Error adding admin " + admin.email + " to the database:");
console.error(err);
} else {
console.log("Added admin " + admin.email + " to the database.");
}
done(err);
});
}
exports = module.exports = function(done) {
async.forEach(admins, createAdmin, done);
};
*/
| /**
* This script automatically creates a default Admin user when an
* empty database is used for the first time. You can use this
* technique to insert data into any List you have defined.
*
* Alternatively, you can export a custom function for the update:
* module.exports = function(done) { ... }
*/
exports.create = {
User: [{
userType: 'Administrator',
name: {
first: 'Admin',
last: 'User'
},
email: 'admin@keystonejs.com',
password: 'admin'
}]
};
/*
// This is the long-hand version of the functionality above:
var keystone = require('keystone'),
async = require('async'),
User = keystone.list('User');
var admins = [
{ email: 'user@keystonejs.com', password: 'admin', name: { first: 'Admin', last: 'User' } }
];
function createAdmin(admin, done) {
var newAdmin = new User.model(admin);
newAdmin.isAdmin = true;
newAdmin.save(function(err) {
if (err) {
console.error("Error adding admin " + admin.email + " to the database:");
console.error(err);
} else {
console.log("Added admin " + admin.email + " to the database.");
}
done(err);
});
}
exports = module.exports = function(done) {
async.forEach(admins, createAdmin, done);
};
*/
| Update the initial admin creation object when executing the environment for the first time with no User models. This update keeps the model consistent with the changes made to the User model. | Update the initial admin creation object when executing the environment for the first time with no User models. This update keeps the model consistent with the changes made to the User model.
| JavaScript | mit | autoboxer/MARE,autoboxer/MARE | javascript | ## Code Before:
/**
* This script automatically creates a default Admin user when an
* empty database is used for the first time. You can use this
* technique to insert data into any List you have defined.
*
* Alternatively, you can export a custom function for the update:
* module.exports = function(done) { ... }
*/
exports.create = {
User: [
{ 'name.first': 'Admin', 'name.last': 'User', email: 'admin@keystonejs.com', password: 'admin', isAdmin: true }
]
};
/*
// This is the long-hand version of the functionality above:
var keystone = require('keystone'),
async = require('async'),
User = keystone.list('User');
var admins = [
{ email: 'user@keystonejs.com', password: 'admin', name: { first: 'Admin', last: 'User' } }
];
function createAdmin(admin, done) {
var newAdmin = new User.model(admin);
newAdmin.isAdmin = true;
newAdmin.save(function(err) {
if (err) {
console.error("Error adding admin " + admin.email + " to the database:");
console.error(err);
} else {
console.log("Added admin " + admin.email + " to the database.");
}
done(err);
});
}
exports = module.exports = function(done) {
async.forEach(admins, createAdmin, done);
};
*/
## Instruction:
Update the initial admin creation object when executing the environment for the first time with no User models. This update keeps the model consistent with the changes made to the User model.
## Code After:
/**
* This script automatically creates a default Admin user when an
* empty database is used for the first time. You can use this
* technique to insert data into any List you have defined.
*
* Alternatively, you can export a custom function for the update:
* module.exports = function(done) { ... }
*/
exports.create = {
User: [{
userType: 'Administrator',
name: {
first: 'Admin',
last: 'User'
},
email: 'admin@keystonejs.com',
password: 'admin'
}]
};
/*
// This is the long-hand version of the functionality above:
var keystone = require('keystone'),
async = require('async'),
User = keystone.list('User');
var admins = [
{ email: 'user@keystonejs.com', password: 'admin', name: { first: 'Admin', last: 'User' } }
];
function createAdmin(admin, done) {
var newAdmin = new User.model(admin);
newAdmin.isAdmin = true;
newAdmin.save(function(err) {
if (err) {
console.error("Error adding admin " + admin.email + " to the database:");
console.error(err);
} else {
console.log("Added admin " + admin.email + " to the database.");
}
done(err);
});
}
exports = module.exports = function(done) {
async.forEach(admins, createAdmin, done);
};
*/
| /**
* This script automatically creates a default Admin user when an
* empty database is used for the first time. You can use this
* technique to insert data into any List you have defined.
*
* Alternatively, you can export a custom function for the update:
* module.exports = function(done) { ... }
*/
exports.create = {
- User: [
+ User: [{
? +
- { 'name.first': 'Admin', 'name.last': 'User', email: 'admin@keystonejs.com', password: 'admin', isAdmin: true }
+ userType: 'Administrator',
+ name: {
+ first: 'Admin',
+ last: 'User'
+ },
+ email: 'admin@keystonejs.com',
+ password: 'admin'
- ]
+ }]
? +
};
/*
// This is the long-hand version of the functionality above:
var keystone = require('keystone'),
async = require('async'),
User = keystone.list('User');
var admins = [
{ email: 'user@keystonejs.com', password: 'admin', name: { first: 'Admin', last: 'User' } }
];
function createAdmin(admin, done) {
var newAdmin = new User.model(admin);
newAdmin.isAdmin = true;
newAdmin.save(function(err) {
if (err) {
console.error("Error adding admin " + admin.email + " to the database:");
console.error(err);
} else {
console.log("Added admin " + admin.email + " to the database.");
}
done(err);
});
}
exports = module.exports = function(done) {
async.forEach(admins, createAdmin, done);
};
*/ | 12 | 0.244898 | 9 | 3 |
4cfc0967cef576ab5d6ddd0fff7d648e77739727 | test_scriptrunner.py | test_scriptrunner.py | from antZoo.ant import AntJobRunner
ant = AntJobRunner( None )
ant.start()
class Job:
def __init__( self, source ):
self.source = source
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is a test\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
| from antZoo.ant import AntJobRunner
ant = AntJobRunner( None )
ant.start()
class Job:
def __init__( self, source ):
self.source = source
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is a test\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is another test that is to be run :D\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
| Test runs two jobs and 200 tasks | Test runs two jobs and 200 tasks
| Python | mit | streed/antZoo,streed/antZoo | python | ## Code Before:
from antZoo.ant import AntJobRunner
ant = AntJobRunner( None )
ant.start()
class Job:
def __init__( self, source ):
self.source = source
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is a test\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
## Instruction:
Test runs two jobs and 200 tasks
## Code After:
from antZoo.ant import AntJobRunner
ant = AntJobRunner( None )
ant.start()
class Job:
def __init__( self, source ):
self.source = source
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is a test\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is another test that is to be run :D\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
| from antZoo.ant import AntJobRunner
ant = AntJobRunner( None )
ant.start()
class Job:
def __init__( self, source ):
self.source = source
j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
ant.push( j )
for i in range( 100 ):
ant.new_task( "this is a test\n" )
print "Done sending tasks."
ant.finish()
ant._runner.join()
+
+ j = Job( "/Users/elchupa/code/school/antZoo/localenv/bin/python /Users/elchupa/code/school/antZoo/example_code/word_count.py" )
+
+ ant.push( j )
+
+ for i in range( 100 ):
+ ant.new_task( "this is another test that is to be run :D\n" )
+
+ print "Done sending tasks."
+ ant.finish()
+ ant._runner.join() | 11 | 0.55 | 11 | 0 |
8c16f86f8d23fe2cf7979d6fc83b5828a673be70 | PXCTestKit/Environment.swift | PXCTestKit/Environment.swift | //
// Environment.swift
// pxctest
//
// Created by Johannes Plunien on 28/11/16.
// Copyright © 2016 Johannes Plunien. All rights reserved.
//
import Foundation
final class Environment {
private static let prefix = "PXCTEST_CHILD_"
private static let insertLibrariesKey = "DYLD_INSERT_LIBRARIES"
static func injectPrefixedVariables(from source: [String: String], into destination: [String: String]?, workingDirectoryURL: URL) -> [String: String] {
var result = destination ?? [:]
for (key, value) in source {
if !key.hasPrefix(prefix) {
continue
}
result[key.replacingOccurrences(of: prefix, with: "")] = value
}
["IMAGE_DIFF_DIR", "KIF_SCREENSHOTS"].forEach { result[$0] = workingDirectoryURL.path }
return result
}
static func injectLibrary(atPath libraryPath: String, into environment: [String: String]?) -> [String: String] {
var result = environment ?? [:]
var insertLibraries = (result[insertLibrariesKey] ?? "").components(separatedBy: ":").filter { $0.characters.count > 0 }
insertLibraries.append(libraryPath)
result[insertLibrariesKey] = insertLibraries.joined(separator: ":")
return result
}
}
| //
// Environment.swift
// pxctest
//
// Created by Johannes Plunien on 28/11/16.
// Copyright © 2016 Johannes Plunien. All rights reserved.
//
import Foundation
final class Environment {
private static let prefix = "PXCTEST_CHILD_"
private static let insertLibrariesKey = "DYLD_INSERT_LIBRARIES"
static func injectPrefixedVariables(from source: [String: String], into destination: [String: String]?, workingDirectoryURL: URL) -> [String: String] {
var result = destination ?? [:]
for (key, value) in source {
if !key.hasPrefix(prefix) {
continue
}
result[key.replacingOccurrences(of: prefix, with: "")] = value
}
["IMAGE_DIFF_DIR", "KIF_SCREENSHOTS"].forEach { result[$0] = workingDirectoryURL.path }
result["LLVM_PROFILE_FILE"] = workingDirectoryURL.appendingPathComponent("test-coverage.%p.profraw").path
result["__XPC_LLVM_PROFILE_FILE"] = workingDirectoryURL.appendingPathComponent("test-coverage.%p.profraw").path
return result
}
static func injectLibrary(atPath libraryPath: String, into environment: [String: String]?) -> [String: String] {
var result = environment ?? [:]
var insertLibraries = (result[insertLibrariesKey] ?? "").components(separatedBy: ":").filter { $0.characters.count > 0 }
insertLibraries.append(libraryPath)
result[insertLibrariesKey] = insertLibraries.joined(separator: ":")
return result
}
}
| Set environment variables to generate (raw) test coverage data | Set environment variables to generate (raw) test coverage data
| Swift | mit | plu/pxctest,davetobin/pxctest,plu/pxctest,davetobin/pxctest,plu/pxctest | swift | ## Code Before:
//
// Environment.swift
// pxctest
//
// Created by Johannes Plunien on 28/11/16.
// Copyright © 2016 Johannes Plunien. All rights reserved.
//
import Foundation
final class Environment {
private static let prefix = "PXCTEST_CHILD_"
private static let insertLibrariesKey = "DYLD_INSERT_LIBRARIES"
static func injectPrefixedVariables(from source: [String: String], into destination: [String: String]?, workingDirectoryURL: URL) -> [String: String] {
var result = destination ?? [:]
for (key, value) in source {
if !key.hasPrefix(prefix) {
continue
}
result[key.replacingOccurrences(of: prefix, with: "")] = value
}
["IMAGE_DIFF_DIR", "KIF_SCREENSHOTS"].forEach { result[$0] = workingDirectoryURL.path }
return result
}
static func injectLibrary(atPath libraryPath: String, into environment: [String: String]?) -> [String: String] {
var result = environment ?? [:]
var insertLibraries = (result[insertLibrariesKey] ?? "").components(separatedBy: ":").filter { $0.characters.count > 0 }
insertLibraries.append(libraryPath)
result[insertLibrariesKey] = insertLibraries.joined(separator: ":")
return result
}
}
## Instruction:
Set environment variables to generate (raw) test coverage data
## Code After:
//
// Environment.swift
// pxctest
//
// Created by Johannes Plunien on 28/11/16.
// Copyright © 2016 Johannes Plunien. All rights reserved.
//
import Foundation
final class Environment {
private static let prefix = "PXCTEST_CHILD_"
private static let insertLibrariesKey = "DYLD_INSERT_LIBRARIES"
static func injectPrefixedVariables(from source: [String: String], into destination: [String: String]?, workingDirectoryURL: URL) -> [String: String] {
var result = destination ?? [:]
for (key, value) in source {
if !key.hasPrefix(prefix) {
continue
}
result[key.replacingOccurrences(of: prefix, with: "")] = value
}
["IMAGE_DIFF_DIR", "KIF_SCREENSHOTS"].forEach { result[$0] = workingDirectoryURL.path }
result["LLVM_PROFILE_FILE"] = workingDirectoryURL.appendingPathComponent("test-coverage.%p.profraw").path
result["__XPC_LLVM_PROFILE_FILE"] = workingDirectoryURL.appendingPathComponent("test-coverage.%p.profraw").path
return result
}
static func injectLibrary(atPath libraryPath: String, into environment: [String: String]?) -> [String: String] {
var result = environment ?? [:]
var insertLibraries = (result[insertLibrariesKey] ?? "").components(separatedBy: ":").filter { $0.characters.count > 0 }
insertLibraries.append(libraryPath)
result[insertLibrariesKey] = insertLibraries.joined(separator: ":")
return result
}
}
| //
// Environment.swift
// pxctest
//
// Created by Johannes Plunien on 28/11/16.
// Copyright © 2016 Johannes Plunien. All rights reserved.
//
import Foundation
final class Environment {
private static let prefix = "PXCTEST_CHILD_"
private static let insertLibrariesKey = "DYLD_INSERT_LIBRARIES"
static func injectPrefixedVariables(from source: [String: String], into destination: [String: String]?, workingDirectoryURL: URL) -> [String: String] {
var result = destination ?? [:]
for (key, value) in source {
if !key.hasPrefix(prefix) {
continue
}
result[key.replacingOccurrences(of: prefix, with: "")] = value
}
["IMAGE_DIFF_DIR", "KIF_SCREENSHOTS"].forEach { result[$0] = workingDirectoryURL.path }
+ result["LLVM_PROFILE_FILE"] = workingDirectoryURL.appendingPathComponent("test-coverage.%p.profraw").path
+ result["__XPC_LLVM_PROFILE_FILE"] = workingDirectoryURL.appendingPathComponent("test-coverage.%p.profraw").path
return result
}
static func injectLibrary(atPath libraryPath: String, into environment: [String: String]?) -> [String: String] {
var result = environment ?? [:]
var insertLibraries = (result[insertLibrariesKey] ?? "").components(separatedBy: ":").filter { $0.characters.count > 0 }
insertLibraries.append(libraryPath)
result[insertLibrariesKey] = insertLibraries.joined(separator: ":")
return result
}
} | 2 | 0.055556 | 2 | 0 |
38f2db891a38ec5766bc08bb34b6e680cd006153 | README.md | README.md | Tiny Java utility to incrementally calculate Mean and Standard Deviation.
Contains a simple utility class to incrementally calculate moving average and moving
standard deviation of a data series.
| Tiny Java utility to incrementally calculate Mean and Standard Deviation with a numerically stable algorithm.
Contains a simple utility class to incrementally calculate moving average and moving
standard deviation of a data series.
#### More Information
* [MeanVarianceSampler.java](https://github.com/tools4j/meanvar/blob/master/src/main/java/org/tools4j/meanvar/MeanVarianceSampler.java): Utility to add, remove or replace values in a running calculation of mean and variance
* * [MeanVarianceSlidingWindow.java](https://github.com/tools4j/meanvar/blob/master/src/main/java/org/tools4j/meanvar/MeanVarianceSlidingWindow.java): A sliding window of a fixed length to calculate moving average and moving standard deviation of a data series
| Add links to readme page | Add links to readme page
| Markdown | mit | tools4j/meanvar,tools4j/spockito,tools4j/meanvar | markdown | ## Code Before:
Tiny Java utility to incrementally calculate Mean and Standard Deviation.
Contains a simple utility class to incrementally calculate moving average and moving
standard deviation of a data series.
## Instruction:
Add links to readme page
## Code After:
Tiny Java utility to incrementally calculate Mean and Standard Deviation with a numerically stable algorithm.
Contains a simple utility class to incrementally calculate moving average and moving
standard deviation of a data series.
#### More Information
* [MeanVarianceSampler.java](https://github.com/tools4j/meanvar/blob/master/src/main/java/org/tools4j/meanvar/MeanVarianceSampler.java): Utility to add, remove or replace values in a running calculation of mean and variance
* * [MeanVarianceSlidingWindow.java](https://github.com/tools4j/meanvar/blob/master/src/main/java/org/tools4j/meanvar/MeanVarianceSlidingWindow.java): A sliding window of a fixed length to calculate moving average and moving standard deviation of a data series
| - Tiny Java utility to incrementally calculate Mean and Standard Deviation.
+ Tiny Java utility to incrementally calculate Mean and Standard Deviation with a numerically stable algorithm.
? ++++++++++++++++++++++++++++++++++++
+
Contains a simple utility class to incrementally calculate moving average and moving
standard deviation of a data series.
+
+ #### More Information
+ * [MeanVarianceSampler.java](https://github.com/tools4j/meanvar/blob/master/src/main/java/org/tools4j/meanvar/MeanVarianceSampler.java): Utility to add, remove or replace values in a running calculation of mean and variance
+ * * [MeanVarianceSlidingWindow.java](https://github.com/tools4j/meanvar/blob/master/src/main/java/org/tools4j/meanvar/MeanVarianceSlidingWindow.java): A sliding window of a fixed length to calculate moving average and moving standard deviation of a data series | 7 | 2.333333 | 6 | 1 |
4738e0957debf28d55df50f711e76a0fed8bedc1 | composer.json | composer.json | {
"name": "simplesamlphp/simplesamlphp",
"description": "A PHP implementation of SAML 2.0 service provider and identity provider functionality. And is also compatible with Shibboleth 1.3 and 2.0.",
"type": "project",
"keywords": [ "saml2", "shibboleth","aselect","openid","oauth","ws-federation","sp","idp" ],
"homepage": "http://simplesamlphp.org",
"license": "LGPL-2.1",
"authors": [
{
"name": "Andreas Åkre Solberg",
"email": "andreas.solberg@uninett.no"
},
{
"name": "Olav Morken",
"email": "olav.morken@uninett.no"
}
],
"autoload": {
"psr-0": {
"SimpleSAML_": "lib/"
},
"files": ["lib/_autoload_modules.php"]
},
"require": {
"php": "~5.3",
"simplesamlphp/saml2": "~0.3",
"simplesamlphp/xmlseclibs": "~1.3.2"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"satooshi/php-coveralls": "dev-master"
},
"support": {
"issues": "https://github.com/simplesamlphp/simplesamlphp/issues",
"source": "https://github.com/simplesamlphp/simplesamlphp"
}
}
| {
"name": "simplesamlphp/simplesamlphp",
"description": "A PHP implementation of SAML 2.0 service provider and identity provider functionality. And is also compatible with Shibboleth 1.3 and 2.0.",
"type": "project",
"keywords": [ "saml2", "shibboleth","aselect","openid","oauth","ws-federation","sp","idp" ],
"homepage": "http://simplesamlphp.org",
"license": "LGPL-2.1",
"authors": [
{
"name": "Andreas Åkre Solberg",
"email": "andreas.solberg@uninett.no"
},
{
"name": "Olav Morken",
"email": "olav.morken@uninett.no"
}
],
"autoload": {
"psr-0": {
"SimpleSAML_": "lib/"
},
"files": ["lib/_autoload_modules.php"]
},
"require": {
"php": "~5.3",
"simplesamlphp/saml2": "~0.3",
"simplesamlphp/xmlseclibs": "~1.3.2",
"whitehat101/apr1-md5": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"satooshi/php-coveralls": "dev-master"
},
"support": {
"issues": "https://github.com/simplesamlphp/simplesamlphp/issues",
"source": "https://github.com/simplesamlphp/simplesamlphp"
}
}
| Add whitehat101/apr1-md5 as a dependency for Apache htpasswd. | Add whitehat101/apr1-md5 as a dependency for Apache htpasswd.
| JSON | lgpl-2.1 | madmatt/simplesamlphp,sitya/simplesamlphp,jschlyter/simplesamlphp,dialogik/simplesamlphp,jschlyter/simplesamlphp,sitya/simplesamlphp,gtkrug/simplesamlphp,ghalse/simplesamlphp,ghalse/simplesamlphp,jschlyter/simplesamlphp,dialogik/simplesamlphp,maytechnet/simplesamlphp,maytechnet/simplesamlphp,simplesamlphp/simplesamlphp,jschlyter/simplesamlphp,gtkrug/simplesamlphp,girgen/simplesamlphp,ghalse/simplesamlphp,shoaibali/simplesamlphp,shoaibali/simplesamlphp,dialogik/simplesamlphp,dzuelke/simplesamlphp,gtkrug/simplesamlphp,BrettMerrick/simplesamlphp,BrettMerrick/simplesamlphp,girgen/simplesamlphp,madmatt/simplesamlphp,dzuelke/simplesamlphp,maytechnet/simplesamlphp,sitya/simplesamlphp,gtkrug/simplesamlphp,cwaldbieser/simplesamlphp,BrettMerrick/simplesamlphp,cwaldbieser/simplesamlphp,girgen/simplesamlphp,madmatt/simplesamlphp,grnet/simplesamlphp,ghalse/simplesamlphp,dzuelke/simplesamlphp,dnmvisser/simplesamlphp,cwaldbieser/simplesamlphp,simplesamlphp/simplesamlphp,cwaldbieser/simplesamlphp,jschlyter/simplesamlphp,dnmvisser/simplesamlphp,dialogik/simplesamlphp,dnmvisser/simplesamlphp,dnmvisser/simplesamlphp,girgen/simplesamlphp,girgen/simplesamlphp,BrettMerrick/simplesamlphp,grnet/simplesamlphp,madmatt/simplesamlphp,shoaibali/simplesamlphp,shoaibali/simplesamlphp,grnet/simplesamlphp,simplesamlphp/simplesamlphp,dzuelke/simplesamlphp,grnet/simplesamlphp,dialogik/simplesamlphp,maytechnet/simplesamlphp,sitya/simplesamlphp,simplesamlphp/simplesamlphp | json | ## Code Before:
{
"name": "simplesamlphp/simplesamlphp",
"description": "A PHP implementation of SAML 2.0 service provider and identity provider functionality. And is also compatible with Shibboleth 1.3 and 2.0.",
"type": "project",
"keywords": [ "saml2", "shibboleth","aselect","openid","oauth","ws-federation","sp","idp" ],
"homepage": "http://simplesamlphp.org",
"license": "LGPL-2.1",
"authors": [
{
"name": "Andreas Åkre Solberg",
"email": "andreas.solberg@uninett.no"
},
{
"name": "Olav Morken",
"email": "olav.morken@uninett.no"
}
],
"autoload": {
"psr-0": {
"SimpleSAML_": "lib/"
},
"files": ["lib/_autoload_modules.php"]
},
"require": {
"php": "~5.3",
"simplesamlphp/saml2": "~0.3",
"simplesamlphp/xmlseclibs": "~1.3.2"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"satooshi/php-coveralls": "dev-master"
},
"support": {
"issues": "https://github.com/simplesamlphp/simplesamlphp/issues",
"source": "https://github.com/simplesamlphp/simplesamlphp"
}
}
## Instruction:
Add whitehat101/apr1-md5 as a dependency for Apache htpasswd.
## Code After:
{
"name": "simplesamlphp/simplesamlphp",
"description": "A PHP implementation of SAML 2.0 service provider and identity provider functionality. And is also compatible with Shibboleth 1.3 and 2.0.",
"type": "project",
"keywords": [ "saml2", "shibboleth","aselect","openid","oauth","ws-federation","sp","idp" ],
"homepage": "http://simplesamlphp.org",
"license": "LGPL-2.1",
"authors": [
{
"name": "Andreas Åkre Solberg",
"email": "andreas.solberg@uninett.no"
},
{
"name": "Olav Morken",
"email": "olav.morken@uninett.no"
}
],
"autoload": {
"psr-0": {
"SimpleSAML_": "lib/"
},
"files": ["lib/_autoload_modules.php"]
},
"require": {
"php": "~5.3",
"simplesamlphp/saml2": "~0.3",
"simplesamlphp/xmlseclibs": "~1.3.2",
"whitehat101/apr1-md5": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"satooshi/php-coveralls": "dev-master"
},
"support": {
"issues": "https://github.com/simplesamlphp/simplesamlphp/issues",
"source": "https://github.com/simplesamlphp/simplesamlphp"
}
}
| {
"name": "simplesamlphp/simplesamlphp",
"description": "A PHP implementation of SAML 2.0 service provider and identity provider functionality. And is also compatible with Shibboleth 1.3 and 2.0.",
"type": "project",
"keywords": [ "saml2", "shibboleth","aselect","openid","oauth","ws-federation","sp","idp" ],
"homepage": "http://simplesamlphp.org",
"license": "LGPL-2.1",
"authors": [
{
"name": "Andreas Åkre Solberg",
"email": "andreas.solberg@uninett.no"
},
{
"name": "Olav Morken",
"email": "olav.morken@uninett.no"
}
],
"autoload": {
"psr-0": {
"SimpleSAML_": "lib/"
},
"files": ["lib/_autoload_modules.php"]
},
"require": {
"php": "~5.3",
"simplesamlphp/saml2": "~0.3",
- "simplesamlphp/xmlseclibs": "~1.3.2"
+ "simplesamlphp/xmlseclibs": "~1.3.2",
? +
+ "whitehat101/apr1-md5": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"satooshi/php-coveralls": "dev-master"
},
"support": {
"issues": "https://github.com/simplesamlphp/simplesamlphp/issues",
"source": "https://github.com/simplesamlphp/simplesamlphp"
}
} | 3 | 0.081081 | 2 | 1 |
074b908bf5fd48b3484d4d1b15535bb247cd6f2d | README.md | README.md | pptf-to-jsufon
==============
Convert "prototypo parametric typeface folder" to "javascript uniform font notation"
| generator-pptf
==============
Yeoman generator that creates a "Prototypo Parametric TypeFace" folder and the gulpfile to convert it to a "Javascript Uniform Font Object Notation" file.
Install
-------
npm install -g generator-pptf
What is a pptf?
---------------
A pptf is the folder and file structure we use to easily "hand-write" parametric typefaces for Prototypo. Ultimately we want to make it possible to design such a typeface inside Prototypo.
**Anatomy of a pptf** (highly unstable)
.
├── src
| ├── glyphs
| | ├── a-cap.js
| | ├── b-cap.js
| | └── ...
| ├── parameters.js
| ├── presets.js
| └── typeface.js
├── .gitignore
├── .jshintrc
├── LICENSE
├── gulpfile.json
└── package.json
**Anatomy of a glyph file**
This loosely follows the robofab object model
```javascript
// glyph: A
contours[0] = {
nodes: {
0: {
x: 100,
y: 50,
Class: 'bottom left',
oType: 'line'
},
1: {
x: width + nodes[0].x,
y: height,
type: 'smooth'
}
},
transform: [
{rotate: 15, u: deg}
]
}
components[0] = 'another-glyph';
anchors[0] = {
x: 100,
y: 50
}
```
| Add description of a glyph file | Add description of a glyph file | Markdown | mit | byte-foundry/generator-ptf | markdown | ## Code Before:
pptf-to-jsufon
==============
Convert "prototypo parametric typeface folder" to "javascript uniform font notation"
## Instruction:
Add description of a glyph file
## Code After:
generator-pptf
==============
Yeoman generator that creates a "Prototypo Parametric TypeFace" folder and the gulpfile to convert it to a "Javascript Uniform Font Object Notation" file.
Install
-------
npm install -g generator-pptf
What is a pptf?
---------------
A pptf is the folder and file structure we use to easily "hand-write" parametric typefaces for Prototypo. Ultimately we want to make it possible to design such a typeface inside Prototypo.
**Anatomy of a pptf** (highly unstable)
.
├── src
| ├── glyphs
| | ├── a-cap.js
| | ├── b-cap.js
| | └── ...
| ├── parameters.js
| ├── presets.js
| └── typeface.js
├── .gitignore
├── .jshintrc
├── LICENSE
├── gulpfile.json
└── package.json
**Anatomy of a glyph file**
This loosely follows the robofab object model
```javascript
// glyph: A
contours[0] = {
nodes: {
0: {
x: 100,
y: 50,
Class: 'bottom left',
oType: 'line'
},
1: {
x: width + nodes[0].x,
y: height,
type: 'smooth'
}
},
transform: [
{rotate: 15, u: deg}
]
}
components[0] = 'another-glyph';
anchors[0] = {
x: 100,
y: 50
}
```
| - pptf-to-jsufon
+ generator-pptf
==============
- Convert "prototypo parametric typeface folder" to "javascript uniform font notation"
+ Yeoman generator that creates a "Prototypo Parametric TypeFace" folder and the gulpfile to convert it to a "Javascript Uniform Font Object Notation" file.
+
+ Install
+ -------
+
+ npm install -g generator-pptf
+
+
+ What is a pptf?
+ ---------------
+
+ A pptf is the folder and file structure we use to easily "hand-write" parametric typefaces for Prototypo. Ultimately we want to make it possible to design such a typeface inside Prototypo.
+
+ **Anatomy of a pptf** (highly unstable)
+
+ .
+ ├── src
+ | ├── glyphs
+ | | ├── a-cap.js
+ | | ├── b-cap.js
+ | | └── ...
+ | ├── parameters.js
+ | ├── presets.js
+ | └── typeface.js
+ ├── .gitignore
+ ├── .jshintrc
+ ├── LICENSE
+ ├── gulpfile.json
+ └── package.json
+
+ **Anatomy of a glyph file**
+ This loosely follows the robofab object model
+
+ ```javascript
+ // glyph: A
+
+ contours[0] = {
+ nodes: {
+ 0: {
+ x: 100,
+ y: 50,
+ Class: 'bottom left',
+ oType: 'line'
+ },
+ 1: {
+ x: width + nodes[0].x,
+ y: height,
+ type: 'smooth'
+ }
+ },
+ transform: [
+ {rotate: 15, u: deg}
+ ]
+ }
+
+ components[0] = 'another-glyph';
+
+ anchors[0] = {
+ x: 100,
+ y: 50
+ }
+ ``` | 65 | 16.25 | 63 | 2 |
135b2afb6537db6e76b1ef74061eb1582e3a201c | tests/reasoning/RuleEngine/simple-predicates.scm | tests/reasoning/RuleEngine/simple-predicates.scm | ; Define 2 dummy predicates
(PredicateNode "A")
(PredicateNode "B")
| ; Define 2 dummy predicates
(PredicateNode "A" (stv 0.2 1))
(PredicateNode "B" (stv 0.6 1))
| Add TVs to the test predicates | Add TVs to the test predicates
| Scheme | agpl-3.0 | cosmoharrigan/atomspace,yantrabuddhi/opencog,printedheart/atomspace,AmeBel/opencog,roselleebarle04/opencog,kim135797531/opencog,shujingke/opencog,misgeatgit/opencog,eddiemonroe/opencog,misgeatgit/opencog,jlegendary/opencog,AmeBel/opencog,ArvinPan/opencog,printedheart/opencog,roselleebarle04/opencog,virneo/opencog,ruiting/opencog,andre-senna/opencog,UIKit0/atomspace,ArvinPan/atomspace,eddiemonroe/opencog,rodsol/atomspace,kim135797531/opencog,prateeksaxena2809/opencog,gaapt/opencog,jlegendary/opencog,yantrabuddhi/atomspace,gavrieltal/opencog,kim135797531/opencog,inflector/opencog,tim777z/opencog,prateeksaxena2809/opencog,tim777z/opencog,rodsol/atomspace,gavrieltal/opencog,sumitsourabh/opencog,tim777z/opencog,cosmoharrigan/opencog,williampma/opencog,UIKit0/atomspace,inflector/opencog,eddiemonroe/opencog,printedheart/atomspace,rodsol/atomspace,AmeBel/atomspace,AmeBel/opencog,Selameab/opencog,sumitsourabh/opencog,tim777z/opencog,andre-senna/opencog,AmeBel/atomspace,ruiting/opencog,Allend575/opencog,TheNameIsNigel/opencog,rohit12/atomspace,ArvinPan/opencog,ruiting/opencog,rodsol/opencog,ArvinPan/atomspace,sumitsourabh/opencog,AmeBel/opencog,eddiemonroe/atomspace,printedheart/opencog,iAMr00t/opencog,Tiggels/opencog,UIKit0/atomspace,AmeBel/opencog,virneo/opencog,rodsol/opencog,jlegendary/opencog,ArvinPan/atomspace,ruiting/opencog,andre-senna/opencog,Allend575/opencog,Selameab/opencog,ceefour/opencog,gaapt/opencog,kim135797531/opencog,virneo/opencog,MarcosPividori/atomspace,rodsol/opencog,ruiting/opencog,shujingke/opencog,kinoc/opencog,iAMr00t/opencog,eddiemonroe/opencog,Selameab/opencog,roselleebarle04/opencog,sumitsourabh/opencog,andre-senna/opencog,jlegendary/opencog,inflector/opencog,rohit12/atomspace,cosmoharrigan/opencog,cosmoharrigan/opencog,rohit12/opencog,shujingke/opencog,cosmoharrigan/opencog,gavrieltal/opencog,jswiergo/atomspace,shujingke/opencog,sumitsourabh/opencog,roselleebarle04/opencog,Allend575/opencog,ArvinPan/opencog,printedheart/atomspace,rohit12/opencog,iAMr00t/opencog,prateeksaxena2809/opencog,Tiggels/opencog,printedheart/opencog,AmeBel/opencog,Selameab/opencog,rohit12/opencog,kim135797531/opencog,eddiemonroe/opencog,kinoc/opencog,williampma/atomspace,sanuj/opencog,anitzkin/opencog,williampma/opencog,yantrabuddhi/opencog,gavrieltal/opencog,kinoc/opencog,inflector/atomspace,anitzkin/opencog,gaapt/opencog,Selameab/opencog,anitzkin/opencog,jlegendary/opencog,jswiergo/atomspace,yantrabuddhi/opencog,misgeatgit/opencog,Selameab/atomspace,rodsol/opencog,Tiggels/opencog,misgeatgit/opencog,yantrabuddhi/opencog,Allend575/opencog,Allend575/opencog,inflector/opencog,rohit12/opencog,AmeBel/atomspace,virneo/opencog,rodsol/atomspace,cosmoharrigan/atomspace,sanuj/opencog,misgeatgit/atomspace,Tiggels/opencog,cosmoharrigan/opencog,printedheart/opencog,eddiemonroe/atomspace,misgeatgit/opencog,eddiemonroe/atomspace,yantrabuddhi/atomspace,MarcosPividori/atomspace,misgeatgit/opencog,sanuj/opencog,ArvinPan/opencog,sanuj/opencog,gavrieltal/opencog,gaapt/opencog,prateeksaxena2809/opencog,ArvinPan/opencog,inflector/opencog,inflector/atomspace,prateeksaxena2809/opencog,Selameab/atomspace,shujingke/opencog,gaapt/opencog,rohit12/opencog,MarcosPividori/atomspace,ceefour/opencog,inflector/opencog,kinoc/opencog,kim135797531/opencog,ceefour/opencog,kinoc/opencog,virneo/opencog,prateeksaxena2809/opencog,inflector/atomspace,kim135797531/opencog,jlegendary/opencog,anitzkin/opencog,virneo/atomspace,rTreutlein/atomspace,williampma/atomspace,rTreutlein/atomspace,ArvinPan/atomspace,gavrieltal/opencog,misgeatgit/atomspace,eddiemonroe/atomspace,roselleebarle04/opencog,virneo/atomspace,yantrabuddhi/opencog,eddiemonroe/opencog,Selameab/atomspace,rohit12/atomspace,misgeatgit/opencog,rTreutlein/atomspace,yantrabuddhi/opencog,TheNameIsNigel/opencog,virneo/opencog,inflector/opencog,anitzkin/opencog,Allend575/opencog,virneo/opencog,MarcosPividori/atomspace,virneo/atomspace,tim777z/opencog,iAMr00t/opencog,cosmoharrigan/atomspace,sanuj/opencog,TheNameIsNigel/opencog,williampma/atomspace,inflector/opencog,AmeBel/atomspace,gaapt/opencog,misgeatgit/opencog,ruiting/opencog,eddiemonroe/opencog,jlegendary/opencog,rodsol/opencog,ceefour/opencog,Selameab/opencog,andre-senna/opencog,iAMr00t/opencog,jswiergo/atomspace,inflector/atomspace,williampma/atomspace,ceefour/atomspace,ceefour/atomspace,gaapt/opencog,misgeatgit/atomspace,eddiemonroe/atomspace,virneo/atomspace,inflector/atomspace,rTreutlein/atomspace,williampma/opencog,Tiggels/opencog,printedheart/opencog,sumitsourabh/opencog,williampma/opencog,ruiting/opencog,yantrabuddhi/atomspace,anitzkin/opencog,UIKit0/atomspace,roselleebarle04/opencog,ceefour/atomspace,ceefour/atomspace,cosmoharrigan/atomspace,ceefour/opencog,rohit12/opencog,TheNameIsNigel/opencog,sumitsourabh/opencog,iAMr00t/opencog,Tiggels/opencog,ceefour/opencog,ceefour/opencog,kinoc/opencog,Selameab/atomspace,rohit12/atomspace,rodsol/opencog,yantrabuddhi/atomspace,TheNameIsNigel/opencog,ArvinPan/opencog,andre-senna/opencog,williampma/opencog,andre-senna/opencog,AmeBel/atomspace,shujingke/opencog,sanuj/opencog,rTreutlein/atomspace,kinoc/opencog,anitzkin/opencog,gavrieltal/opencog,yantrabuddhi/atomspace,cosmoharrigan/opencog,tim777z/opencog,roselleebarle04/opencog,misgeatgit/atomspace,misgeatgit/opencog,prateeksaxena2809/opencog,williampma/opencog,jswiergo/atomspace,AmeBel/opencog,Allend575/opencog,TheNameIsNigel/opencog,printedheart/opencog,printedheart/atomspace,misgeatgit/atomspace,shujingke/opencog,yantrabuddhi/opencog | scheme | ## Code Before:
; Define 2 dummy predicates
(PredicateNode "A")
(PredicateNode "B")
## Instruction:
Add TVs to the test predicates
## Code After:
; Define 2 dummy predicates
(PredicateNode "A" (stv 0.2 1))
(PredicateNode "B" (stv 0.6 1))
| ; Define 2 dummy predicates
- (PredicateNode "A")
+ (PredicateNode "A" (stv 0.2 1))
? +++++++++++ +
- (PredicateNode "B")
+ (PredicateNode "B" (stv 0.6 1))
? +++++++++++ +
| 4 | 1 | 2 | 2 |
30686bbb7075be412b23c6c2feb02bce784d6a86 | packages/fis/fis_1.0.bb | packages/fis/fis_1.0.bb | DESCRIPTION = "Tool to edit the Redboot FIS partition layout from userspace"
SRC_URI = "http://svn.chezphil.org/utils/trunk/fis.cc \
svn://svn.chezphil.org/;module=libpbe;proto=http"
do_compile() {
${CXX} -Os -W -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
${STRIP} ${WORKDIR}/fis-${PV}/fis
# ${CXX} -Os -W -static -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis-static ${WORKDIR}/fis.cc \
# ${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
# ${STRIP} ${WORKDIR}/fis-${PV}/fis-static
} | DESCRIPTION = "Tool to edit the Redboot FIS partition layout from userspace"
PR = "r1"
SRC_URI = "http://svn.chezphil.org/utils/trunk/fis.cc \
svn://svn.chezphil.org/;module=libpbe;proto=http"
PACKAGES =+ "fis-static"
FILES_${PN}-static = "${sbindir}/fis-static"
FILES_${PN} = "${sbindir}/fis"
do_compile() {
${CXX} -Os -W -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
# Work around boost threading issue when compiling static
# We're singlethreading anyway
echo "#define BOOST_SP_DISABLE_THREADS" > ${WORKDIR}/tmpfile
cat ${WORKDIR}/tmpfile ${WORKDIR}/fis.cc > ${WORKDIR}/fis.new
mv ${WORKDIR}/fis.new ${WORKDIR}/fis.cc
rm ${WORKDIR}/tmpfile
${CXX} -Os -W -static -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis-static ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
}
do_install() {
${STRIP} ${WORKDIR}/fis-${PV}/fis-static
${STRIP} ${WORKDIR}/fis-${PV}/fis
install -d ${D}/${sbindir}
install -m 755 ${WORKDIR}/fis-${PV}/fis-static ${D}/${sbindir}
install -m 755 ${WORKDIR}/fis-${PV}/fis ${D}/${sbindir}
}
| Make one shared and one static version, split into two packages | fis: Make one shared and one static version, split into two packages
| BitBake | mit | openembedded/openembedded,sutajiokousagi/openembedded,openpli-arm/openembedded,demsey/openembedded,buglabs/oe-buglabs,BlackPole/bp-openembedded,popazerty/openembedded-cuberevo,sentient-energy/emsw-oe-mirror,sampov2/audio-openembedded,troth/oe-ts7xxx,dellysunnymtech/sakoman-oe,libo/openembedded,nx111/openembeded_openpli2.1_nx111,trini/openembedded,yyli/overo-oe,demsey/openembedded,SIFTeam/openembedded,philb/pbcl-oe-2010,dave-billin/overo-ui-moos-auv,anguslees/openembedded-android,YtvwlD/od-oe,bticino/openembedded,dellysunnymtech/sakoman-oe,giobauermeister/openembedded,anguslees/openembedded-android,sampov2/audio-openembedded,dellysunnymtech/sakoman-oe,sutajiokousagi/openembedded,openembedded/openembedded,JrCs/opendreambox,sentient-energy/emsw-oe-mirror,JamesAng/oe,trini/openembedded,SIFTeam/openembedded,dellysunnymtech/sakoman-oe,openpli-arm/openembedded,sentient-energy/emsw-oe-mirror,scottellis/overo-oe,JrCs/opendreambox,SIFTeam/openembedded,buglabs/oe-buglabs,xifengchuo/openembedded,giobauermeister/openembedded,sledz/oe,BlackPole/bp-openembedded,thebohemian/openembedded,dave-billin/overo-ui-moos-auv,xifengchuo/openembedded,yyli/overo-oe,John-NY/overo-oe,SIFTeam/openembedded,SIFTeam/openembedded,BlackPole/bp-openembedded,xifengchuo/openembedded,hulifox008/openembedded,xifengchuo/openembedded,crystalfontz/openembedded,nvl1109/openembeded,openembedded/openembedded,thebohemian/openembedded,xifengchuo/openembedded,mrchapp/arago-oe-dev,JrCs/opendreambox,libo/openembedded,giobauermeister/openembedded,sutajiokousagi/openembedded,thebohemian/openembedded,openembedded/openembedded,mrchapp/arago-oe-dev,nx111/openembeded_openpli2.1_nx111,bticino/openembedded,nx111/openembeded_openpli2.1_nx111,trini/openembedded,giobauermeister/openembedded,scottellis/overo-oe,nvl1109/openembeded,Martix/Eonos,JrCs/opendreambox,YtvwlD/od-oe,openpli-arm/openembedded,YtvwlD/od-oe,philb/pbcl-oe-2010,sentient-energy/emsw-oe-mirror,libo/openembedded,popazerty/openembedded-cuberevo,mrchapp/arago-oe-dev,sledz/oe,openembedded/openembedded,rascalmicro/openembedded-rascal,xifengchuo/openembedded,dellysunnymtech/sakoman-oe,John-NY/overo-oe,nlebedenco/mini2440,popazerty/openembedded-cuberevo,libo/openembedded,giobauermeister/openembedded,nzjrs/overo-openembedded,philb/pbcl-oe-2010,scottellis/overo-oe,sutajiokousagi/openembedded,yyli/overo-oe,KDAB/OpenEmbedded-Archos,sentient-energy/emsw-oe-mirror,JamesAng/oe,nx111/openembeded_openpli2.1_nx111,hulifox008/openembedded,JamesAng/goe,rascalmicro/openembedded-rascal,crystalfontz/openembedded,YtvwlD/od-oe,JamesAng/goe,troth/oe-ts7xxx,sledz/oe,BlackPole/bp-openembedded,sampov2/audio-openembedded,demsey/openembedded,JamesAng/goe,philb/pbcl-oe-2010,demsey/openenigma2,JamesAng/goe,mrchapp/arago-oe-dev,bticino/openembedded,bticino/openembedded,nx111/openembeded_openpli2.1_nx111,popazerty/openembedded-cuberevo,anguslees/openembedded-android,demsey/openenigma2,giobauermeister/openembedded,popazerty/openembedded-cuberevo,SIFTeam/openembedded,thebohemian/openembedded,nvl1109/openembeded,JamesAng/goe,sutajiokousagi/openembedded,philb/pbcl-oe-2010,popazerty/openembedded-cuberevo,mrchapp/arago-oe-dev,rascalmicro/openembedded-rascal,JamesAng/oe,troth/oe-ts7xxx,openpli-arm/openembedded,anguslees/openembedded-android,scottellis/overo-oe,John-NY/overo-oe,hulifox008/openembedded,John-NY/overo-oe,YtvwlD/od-oe,crystalfontz/openembedded,JrCs/opendreambox,BlackPole/bp-openembedded,buglabs/oe-buglabs,sampov2/audio-openembedded,giobauermeister/openembedded,rascalmicro/openembedded-rascal,crystalfontz/openembedded,openembedded/openembedded,giobauermeister/openembedded,bticino/openembedded,demsey/openembedded,nvl1109/openembeded,giobauermeister/openembedded,Martix/Eonos,philb/pbcl-oe-2010,xifengchuo/openembedded,dave-billin/overo-ui-moos-auv,thebohemian/openembedded,yyli/overo-oe,openpli-arm/openembedded,dave-billin/overo-ui-moos-auv,demsey/openembedded,anguslees/openembedded-android,YtvwlD/od-oe,anguslees/openembedded-android,trini/openembedded,sledz/oe,JrCs/opendreambox,Martix/Eonos,hulifox008/openembedded,KDAB/OpenEmbedded-Archos,JamesAng/oe,demsey/openenigma2,sledz/oe,thebohemian/openembedded,nzjrs/overo-openembedded,openembedded/openembedded,KDAB/OpenEmbedded-Archos,demsey/openembedded,JrCs/opendreambox,Martix/Eonos,dellysunnymtech/sakoman-oe,nlebedenco/mini2440,mrchapp/arago-oe-dev,libo/openembedded,nlebedenco/mini2440,buglabs/oe-buglabs,openpli-arm/openembedded,JamesAng/oe,libo/openembedded,troth/oe-ts7xxx,crystalfontz/openembedded,rascalmicro/openembedded-rascal,sentient-energy/emsw-oe-mirror,nlebedenco/mini2440,demsey/openenigma2,nzjrs/overo-openembedded,dave-billin/overo-ui-moos-auv,rascalmicro/openembedded-rascal,demsey/openenigma2,dellysunnymtech/sakoman-oe,rascalmicro/openembedded-rascal,Martix/Eonos,KDAB/OpenEmbedded-Archos,nvl1109/openembeded,crystalfontz/openembedded,crystalfontz/openembedded,yyli/overo-oe,dellysunnymtech/sakoman-oe,popazerty/openembedded-cuberevo,JamesAng/oe,scottellis/overo-oe,bticino/openembedded,nzjrs/overo-openembedded,thebohemian/openembedded,BlackPole/bp-openembedded,John-NY/overo-oe,nvl1109/openembeded,nzjrs/overo-openembedded,buglabs/oe-buglabs,dellysunnymtech/sakoman-oe,Martix/Eonos,YtvwlD/od-oe,nlebedenco/mini2440,scottellis/overo-oe,sutajiokousagi/openembedded,hulifox008/openembedded,JamesAng/goe,KDAB/OpenEmbedded-Archos,nlebedenco/mini2440,KDAB/OpenEmbedded-Archos,dave-billin/overo-ui-moos-auv,JamesAng/oe,troth/oe-ts7xxx,hulifox008/openembedded,hulifox008/openembedded,openembedded/openembedded,troth/oe-ts7xxx,mrchapp/arago-oe-dev,yyli/overo-oe,JrCs/opendreambox,SIFTeam/openembedded,nlebedenco/mini2440,trini/openembedded,xifengchuo/openembedded,anguslees/openembedded-android,openembedded/openembedded,yyli/overo-oe,Martix/Eonos,openembedded/openembedded,buglabs/oe-buglabs,nzjrs/overo-openembedded,troth/oe-ts7xxx,nx111/openembeded_openpli2.1_nx111,yyli/overo-oe,popazerty/openembedded-cuberevo,JrCs/opendreambox,sledz/oe,nx111/openembeded_openpli2.1_nx111,xifengchuo/openembedded,trini/openembedded,demsey/openenigma2,JamesAng/goe,rascalmicro/openembedded-rascal,sledz/oe,bticino/openembedded,demsey/openembedded,sentient-energy/emsw-oe-mirror,dave-billin/overo-ui-moos-auv,sampov2/audio-openembedded,sampov2/audio-openembedded,John-NY/overo-oe,nx111/openembeded_openpli2.1_nx111,openembedded/openembedded,YtvwlD/od-oe,openpli-arm/openembedded,nvl1109/openembeded,BlackPole/bp-openembedded,philb/pbcl-oe-2010,John-NY/overo-oe,scottellis/overo-oe,libo/openembedded,sutajiokousagi/openembedded,KDAB/OpenEmbedded-Archos,buglabs/oe-buglabs,demsey/openenigma2,sampov2/audio-openembedded,buglabs/oe-buglabs,nzjrs/overo-openembedded,trini/openembedded | bitbake | ## Code Before:
DESCRIPTION = "Tool to edit the Redboot FIS partition layout from userspace"
SRC_URI = "http://svn.chezphil.org/utils/trunk/fis.cc \
svn://svn.chezphil.org/;module=libpbe;proto=http"
do_compile() {
${CXX} -Os -W -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
${STRIP} ${WORKDIR}/fis-${PV}/fis
# ${CXX} -Os -W -static -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis-static ${WORKDIR}/fis.cc \
# ${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
# ${STRIP} ${WORKDIR}/fis-${PV}/fis-static
}
## Instruction:
fis: Make one shared and one static version, split into two packages
## Code After:
DESCRIPTION = "Tool to edit the Redboot FIS partition layout from userspace"
PR = "r1"
SRC_URI = "http://svn.chezphil.org/utils/trunk/fis.cc \
svn://svn.chezphil.org/;module=libpbe;proto=http"
PACKAGES =+ "fis-static"
FILES_${PN}-static = "${sbindir}/fis-static"
FILES_${PN} = "${sbindir}/fis"
do_compile() {
${CXX} -Os -W -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
# Work around boost threading issue when compiling static
# We're singlethreading anyway
echo "#define BOOST_SP_DISABLE_THREADS" > ${WORKDIR}/tmpfile
cat ${WORKDIR}/tmpfile ${WORKDIR}/fis.cc > ${WORKDIR}/fis.new
mv ${WORKDIR}/fis.new ${WORKDIR}/fis.cc
rm ${WORKDIR}/tmpfile
${CXX} -Os -W -static -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis-static ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
}
do_install() {
${STRIP} ${WORKDIR}/fis-${PV}/fis-static
${STRIP} ${WORKDIR}/fis-${PV}/fis
install -d ${D}/${sbindir}
install -m 755 ${WORKDIR}/fis-${PV}/fis-static ${D}/${sbindir}
install -m 755 ${WORKDIR}/fis-${PV}/fis ${D}/${sbindir}
}
| DESCRIPTION = "Tool to edit the Redboot FIS partition layout from userspace"
+ PR = "r1"
SRC_URI = "http://svn.chezphil.org/utils/trunk/fis.cc \
svn://svn.chezphil.org/;module=libpbe;proto=http"
+ PACKAGES =+ "fis-static"
+ FILES_${PN}-static = "${sbindir}/fis-static"
+ FILES_${PN} = "${sbindir}/fis"
+
do_compile() {
${CXX} -Os -W -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis ${WORKDIR}/fis.cc \
${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
+
+ # Work around boost threading issue when compiling static
+ # We're singlethreading anyway
+
+ echo "#define BOOST_SP_DISABLE_THREADS" > ${WORKDIR}/tmpfile
+ cat ${WORKDIR}/tmpfile ${WORKDIR}/fis.cc > ${WORKDIR}/fis.new
+ mv ${WORKDIR}/fis.new ${WORKDIR}/fis.cc
+ rm ${WORKDIR}/tmpfile
+
+ ${CXX} -Os -W -static -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis-static ${WORKDIR}/fis.cc \
+ ${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
+ }
+
+ do_install() {
+ ${STRIP} ${WORKDIR}/fis-${PV}/fis-static
${STRIP} ${WORKDIR}/fis-${PV}/fis
- # ${CXX} -Os -W -static -I${STAGING_INCDIR} -I${WORKDIR}/libpbe/trunk/include -o fis-static ${WORKDIR}/fis.cc \
- # ${WORKDIR}/libpbe/trunk/src/Exception.cc ${WORKDIR}/libpbe/trunk/src/utils.cc
- # ${STRIP} ${WORKDIR}/fis-${PV}/fis-static
+
+ install -d ${D}/${sbindir}
+ install -m 755 ${WORKDIR}/fis-${PV}/fis-static ${D}/${sbindir}
+ install -m 755 ${WORKDIR}/fis-${PV}/fis ${D}/${sbindir}
} | 27 | 2.076923 | 24 | 3 |
83ddfe0408fa1fc4af9ab7f63764bb36fa8a5cc6 | src/Regis/Domain/Event/PullRequestOpened.php | src/Regis/Domain/Event/PullRequestOpened.php | <?php
namespace Regis\Domain\Event;
use Regis\Domain\Model\Github\PullRequest;
class PullRequestOpened
{
private $pullRequest;
public function __construct(PullRequest $pullRequest)
{
$this->pullRequest = $pullRequest;
}
public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
} | <?php
declare(strict_types=1);
namespace Regis\Domain\Event;
use Regis\Domain\Model\Github\PullRequest;
class PullRequestOpened
{
private $pullRequest;
public function __construct(PullRequest $pullRequest)
{
$this->pullRequest = $pullRequest;
}
public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
} | Add a missing strict type declaration | Add a missing strict type declaration
| PHP | agpl-3.0 | K-Phoen/regis,K-Phoen/regis,K-Phoen/regis,K-Phoen/regis | php | ## Code Before:
<?php
namespace Regis\Domain\Event;
use Regis\Domain\Model\Github\PullRequest;
class PullRequestOpened
{
private $pullRequest;
public function __construct(PullRequest $pullRequest)
{
$this->pullRequest = $pullRequest;
}
public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
}
## Instruction:
Add a missing strict type declaration
## Code After:
<?php
declare(strict_types=1);
namespace Regis\Domain\Event;
use Regis\Domain\Model\Github\PullRequest;
class PullRequestOpened
{
private $pullRequest;
public function __construct(PullRequest $pullRequest)
{
$this->pullRequest = $pullRequest;
}
public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
} | <?php
+
+ declare(strict_types=1);
namespace Regis\Domain\Event;
use Regis\Domain\Model\Github\PullRequest;
class PullRequestOpened
{
private $pullRequest;
public function __construct(PullRequest $pullRequest)
{
$this->pullRequest = $pullRequest;
}
public function getPullRequest(): PullRequest
{
return $this->pullRequest;
}
} | 2 | 0.1 | 2 | 0 |
f8860cd283a3c4852049feaf10a094d5e9f98ab6 | lib/streamy/message_buses/rabbit_message_bus.rb | lib/streamy/message_buses/rabbit_message_bus.rb | require "hutch"
module Streamy
module MessageBuses
class RabbitMessageBus
def initialize(uri:, topic_prefix: Streamy::DEFAULT_TOPIC_PREFIX)
@topic_prefix = topic_prefix
Hutch::Config.set(:uri, uri)
Hutch::Config.set(:enable_http_api_use, false)
Hutch.connect
end
def deliver(*args)
deliver_now(*args)
end
def deliver_now(key:, topic:, type:, body:, event_time:)
Hutch.publish(
"#{topic_prefix}.#{topic}.#{type}",
topic: topic,
key: key,
body: body,
type: type,
event_time: event_time
)
end
private
attr_reader :topic_prefix
end
end
end
| require "hutch"
module Streamy
module MessageBuses
class RabbitMessageBus
def initialize(uri:, topic_prefix: Streamy::DEFAULT_TOPIC_PREFIX)
@topic_prefix = topic_prefix
Hutch::Config.set(:uri, uri)
Hutch::Config.set(:enable_http_api_use, false)
end
def deliver(*args)
deliver_now(*args)
end
def deliver_now(key:, topic:, type:, body:, event_time:)
Hutch.connect
Hutch.publish(
"#{topic_prefix}.#{topic}.#{type}",
topic: topic,
key: key,
body: body,
type: type,
event_time: event_time
)
end
private
attr_reader :topic_prefix
end
end
end
| Move the hutch connection out of message bus initializer | Move the hutch connection out of message bus initializer
| Ruby | mit | cookpad/streamy,cookpad/streamy | ruby | ## Code Before:
require "hutch"
module Streamy
module MessageBuses
class RabbitMessageBus
def initialize(uri:, topic_prefix: Streamy::DEFAULT_TOPIC_PREFIX)
@topic_prefix = topic_prefix
Hutch::Config.set(:uri, uri)
Hutch::Config.set(:enable_http_api_use, false)
Hutch.connect
end
def deliver(*args)
deliver_now(*args)
end
def deliver_now(key:, topic:, type:, body:, event_time:)
Hutch.publish(
"#{topic_prefix}.#{topic}.#{type}",
topic: topic,
key: key,
body: body,
type: type,
event_time: event_time
)
end
private
attr_reader :topic_prefix
end
end
end
## Instruction:
Move the hutch connection out of message bus initializer
## Code After:
require "hutch"
module Streamy
module MessageBuses
class RabbitMessageBus
def initialize(uri:, topic_prefix: Streamy::DEFAULT_TOPIC_PREFIX)
@topic_prefix = topic_prefix
Hutch::Config.set(:uri, uri)
Hutch::Config.set(:enable_http_api_use, false)
end
def deliver(*args)
deliver_now(*args)
end
def deliver_now(key:, topic:, type:, body:, event_time:)
Hutch.connect
Hutch.publish(
"#{topic_prefix}.#{topic}.#{type}",
topic: topic,
key: key,
body: body,
type: type,
event_time: event_time
)
end
private
attr_reader :topic_prefix
end
end
end
| require "hutch"
module Streamy
module MessageBuses
class RabbitMessageBus
def initialize(uri:, topic_prefix: Streamy::DEFAULT_TOPIC_PREFIX)
@topic_prefix = topic_prefix
Hutch::Config.set(:uri, uri)
Hutch::Config.set(:enable_http_api_use, false)
- Hutch.connect
end
def deliver(*args)
deliver_now(*args)
end
def deliver_now(key:, topic:, type:, body:, event_time:)
+ Hutch.connect
Hutch.publish(
"#{topic_prefix}.#{topic}.#{type}",
topic: topic,
key: key,
body: body,
type: type,
event_time: event_time
)
end
private
attr_reader :topic_prefix
end
end
end | 2 | 0.060606 | 1 | 1 |
8bcaebcf6fd9909651f7f6f9db19d96304a408a9 | source/Model/Model.swift | source/Model/Model.swift | import CoreData
public protocol Model: class, Equatable, Hashable
{
associatedtype Configuration: ModelConfiguration
var id: Object.Id? { get set }
}
extension Model
{
public var identified: Bool {
return self.id != nil
}
}
extension Model
{
public var hashValue: Int {
return ObjectIdentifier(self).hashValue
}
}
public func ==<Lhs:Model, Rhs:Model>(lhs: Lhs, rhs: Rhs) -> Bool {
return lhs === rhs
}
// MARK: -
public protocol ModelInitialiser
{
init(id: Object.Id?)
}
| import CoreData
public protocol Identified: class
{
var id: Object.Id? { get set }
}
extension Identified
{
public var identified: Bool {
return self.id != nil
}
}
// MARK: -
public protocol Model: class, Identified, Equatable, Hashable
{
associatedtype Configuration: ModelConfiguration
}
extension Model
{
public var hashValue: Int {
return ObjectIdentifier(self).hashValue
}
}
public func ==<Lhs:Model, Rhs:Model>(lhs: Lhs, rhs: Rhs) -> Bool {
return lhs === rhs
}
// MARK: -
public protocol ModelInitialiser
{
init(id: Object.Id?)
}
| Add identified protocol underneath model | Add identified protocol underneath model
| Swift | mit | swifteroid/store,swifteroid/store | swift | ## Code Before:
import CoreData
public protocol Model: class, Equatable, Hashable
{
associatedtype Configuration: ModelConfiguration
var id: Object.Id? { get set }
}
extension Model
{
public var identified: Bool {
return self.id != nil
}
}
extension Model
{
public var hashValue: Int {
return ObjectIdentifier(self).hashValue
}
}
public func ==<Lhs:Model, Rhs:Model>(lhs: Lhs, rhs: Rhs) -> Bool {
return lhs === rhs
}
// MARK: -
public protocol ModelInitialiser
{
init(id: Object.Id?)
}
## Instruction:
Add identified protocol underneath model
## Code After:
import CoreData
public protocol Identified: class
{
var id: Object.Id? { get set }
}
extension Identified
{
public var identified: Bool {
return self.id != nil
}
}
// MARK: -
public protocol Model: class, Identified, Equatable, Hashable
{
associatedtype Configuration: ModelConfiguration
}
extension Model
{
public var hashValue: Int {
return ObjectIdentifier(self).hashValue
}
}
public func ==<Lhs:Model, Rhs:Model>(lhs: Lhs, rhs: Rhs) -> Bool {
return lhs === rhs
}
// MARK: -
public protocol ModelInitialiser
{
init(id: Object.Id?)
}
| import CoreData
- public protocol Model: class, Equatable, Hashable
+ public protocol Identified: class
{
- associatedtype Configuration: ModelConfiguration
-
var id: Object.Id? { get set }
}
- extension Model
+ extension Identified
{
public var identified: Bool {
return self.id != nil
}
+ }
+
+ // MARK: -
+
+ public protocol Model: class, Identified, Equatable, Hashable
+ {
+ associatedtype Configuration: ModelConfiguration
}
extension Model
{
public var hashValue: Int {
return ObjectIdentifier(self).hashValue
}
}
public func ==<Lhs:Model, Rhs:Model>(lhs: Lhs, rhs: Rhs) -> Bool {
return lhs === rhs
}
// MARK: -
public protocol ModelInitialiser
{
init(id: Object.Id?)
} | 13 | 0.393939 | 9 | 4 |
8877489ac6640e3f5e701f64cfe7296e710262b9 | triangle.md | triangle.md | The program should raise an error if the triangle cannot exist.
## Hint
The sum of the lengths of any two sides of a triangle always exceeds the
length of the third side, a principle known as the _triangle
inequality_.
| The program should raise an error if the triangle cannot exist.
## Hint
The sum of the lengths of any two sides of a triangle always exceeds or
is equal to the length of the third side, a principle known as the _triangle
inequality_.
| Correct definition for the Triangle inequality | Correct definition for the Triangle inequality
"or equal to" was missing.
In mathematics, the triangle inequality states that for any triangle,
the sum of the lengths of any two sides must be greater than or equal to
the length of the remaining side.
Source: https://en.wikipedia.org/wiki/Triangle_inequality
| Markdown | mit | exercism/x-common,kgengler/x-common,jmluy/x-common,jmluy/x-common,rpottsoh/x-common,Vankog/problem-specifications,exercism/x-common,ErikSchierboom/x-common,Vankog/problem-specifications,rpottsoh/x-common,kgengler/x-common,petertseng/x-common,ErikSchierboom/x-common,jmluy/x-common,petertseng/x-common | markdown | ## Code Before:
The program should raise an error if the triangle cannot exist.
## Hint
The sum of the lengths of any two sides of a triangle always exceeds the
length of the third side, a principle known as the _triangle
inequality_.
## Instruction:
Correct definition for the Triangle inequality
"or equal to" was missing.
In mathematics, the triangle inequality states that for any triangle,
the sum of the lengths of any two sides must be greater than or equal to
the length of the remaining side.
Source: https://en.wikipedia.org/wiki/Triangle_inequality
## Code After:
The program should raise an error if the triangle cannot exist.
## Hint
The sum of the lengths of any two sides of a triangle always exceeds or
is equal to the length of the third side, a principle known as the _triangle
inequality_.
| The program should raise an error if the triangle cannot exist.
## Hint
- The sum of the lengths of any two sides of a triangle always exceeds the
? ^^^
+ The sum of the lengths of any two sides of a triangle always exceeds or
? ^^^
- length of the third side, a principle known as the _triangle
+ is equal to the length of the third side, a principle known as the _triangle
? ++++++++++++++++
inequality_. | 4 | 0.571429 | 2 | 2 |
807f331a11a7cde61d6c2f0df2abd2b2b60810f2 | src/test/scala/com/mindcandy/waterfall/actor/DropWorkerSpec.scala | src/test/scala/com/mindcandy/waterfall/actor/DropWorkerSpec.scala | package com.mindcandy.waterfall.actor
import org.specs2.specification.After
import akka.testkit.TestKit
import org.specs2.time.NoTimeConversions
import akka.actor.ActorSystem
import org.specs2.SpecificationLike
import akka.testkit.TestProbe
import akka.actor.ActorRef
import akka.actor.Props
import scala.util.Success
import com.mindcandy.waterfall.actor.DropWorker.RunDrop
import com.mindcandy.waterfall.actor.DropSupervisor.JobResult
class DropWorkerSpec extends TestKit(ActorSystem("DropWorkerSpec")) with SpecificationLike with After with NoTimeConversions {
override def is = s2"""
DropWorker should
run a drop and return success $runDrop
"""
override def after: Any = TestKit.shutdownActorSystem(system)
def runDrop = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult]).result must_== Success()
}
} | package com.mindcandy.waterfall.actor
import org.specs2.specification.After
import akka.testkit.TestKit
import org.specs2.time.NoTimeConversions
import akka.actor.{Terminated, ActorSystem, ActorRef, Props}
import org.specs2.SpecificationLike
import akka.testkit.TestProbe
import scala.util.Success
import com.mindcandy.waterfall.actor.DropWorker.RunDrop
import com.mindcandy.waterfall.actor.DropSupervisor.JobResult
import scala.concurrent.duration._
class DropWorkerSpec extends TestKit(ActorSystem("DropWorkerSpec")) with SpecificationLike with After with NoTimeConversions {
override def is = s2"""
DropWorker should
run a drop and return success $runDrop
stop after running a job $stopActor
"""
override def after: Any = TestKit.shutdownActorSystem(system)
def runDrop = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult]).result must_== Success()
}
def stopActor = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.watch(actor)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult])
probe.expectTerminated(actor, FiniteDuration(5, SECONDS)) match {
case Terminated(actor) => success
case _ => failure
}
}
} | Add unit test to ensure the worker actor is stopped. | Add unit test to ensure the worker actor is stopped.
| Scala | mit | mindcandy/waterfall,mindcandy/waterfall | scala | ## Code Before:
package com.mindcandy.waterfall.actor
import org.specs2.specification.After
import akka.testkit.TestKit
import org.specs2.time.NoTimeConversions
import akka.actor.ActorSystem
import org.specs2.SpecificationLike
import akka.testkit.TestProbe
import akka.actor.ActorRef
import akka.actor.Props
import scala.util.Success
import com.mindcandy.waterfall.actor.DropWorker.RunDrop
import com.mindcandy.waterfall.actor.DropSupervisor.JobResult
class DropWorkerSpec extends TestKit(ActorSystem("DropWorkerSpec")) with SpecificationLike with After with NoTimeConversions {
override def is = s2"""
DropWorker should
run a drop and return success $runDrop
"""
override def after: Any = TestKit.shutdownActorSystem(system)
def runDrop = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult]).result must_== Success()
}
}
## Instruction:
Add unit test to ensure the worker actor is stopped.
## Code After:
package com.mindcandy.waterfall.actor
import org.specs2.specification.After
import akka.testkit.TestKit
import org.specs2.time.NoTimeConversions
import akka.actor.{Terminated, ActorSystem, ActorRef, Props}
import org.specs2.SpecificationLike
import akka.testkit.TestProbe
import scala.util.Success
import com.mindcandy.waterfall.actor.DropWorker.RunDrop
import com.mindcandy.waterfall.actor.DropSupervisor.JobResult
import scala.concurrent.duration._
class DropWorkerSpec extends TestKit(ActorSystem("DropWorkerSpec")) with SpecificationLike with After with NoTimeConversions {
override def is = s2"""
DropWorker should
run a drop and return success $runDrop
stop after running a job $stopActor
"""
override def after: Any = TestKit.shutdownActorSystem(system)
def runDrop = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult]).result must_== Success()
}
def stopActor = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.watch(actor)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult])
probe.expectTerminated(actor, FiniteDuration(5, SECONDS)) match {
case Terminated(actor) => success
case _ => failure
}
}
} | package com.mindcandy.waterfall.actor
import org.specs2.specification.After
import akka.testkit.TestKit
import org.specs2.time.NoTimeConversions
- import akka.actor.ActorSystem
+ import akka.actor.{Terminated, ActorSystem, ActorRef, Props}
import org.specs2.SpecificationLike
import akka.testkit.TestProbe
- import akka.actor.ActorRef
- import akka.actor.Props
import scala.util.Success
import com.mindcandy.waterfall.actor.DropWorker.RunDrop
import com.mindcandy.waterfall.actor.DropSupervisor.JobResult
+ import scala.concurrent.duration._
class DropWorkerSpec extends TestKit(ActorSystem("DropWorkerSpec")) with SpecificationLike with After with NoTimeConversions {
override def is = s2"""
DropWorker should
run a drop and return success $runDrop
+ stop after running a job $stopActor
"""
override def after: Any = TestKit.shutdownActorSystem(system)
def runDrop = {
val dropUID = "test1"
val probe: TestProbe = TestProbe()
val actor: ActorRef = system.actorOf(DropWorker.props)
val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
probe.send(actor, request)
probe.expectMsgClass(classOf[JobResult]).result must_== Success()
}
+
+ def stopActor = {
+ val dropUID = "test1"
+ val probe: TestProbe = TestProbe()
+ val actor: ActorRef = system.actorOf(DropWorker.props)
+ val request = RunDrop(dropUID, TestWaterfallDropFactory.getDropByUID(dropUID).get)
+ probe.watch(actor)
+
+ probe.send(actor, request)
+ probe.expectMsgClass(classOf[JobResult])
+ probe.expectTerminated(actor, FiniteDuration(5, SECONDS)) match {
+ case Terminated(actor) => success
+ case _ => failure
+ }
+ }
} | 21 | 0.636364 | 18 | 3 |
fc626eaf4ceaaab3ac7844ef8db1791abf5c84f5 | packages/google-oauth/package.js | packages/google-oauth/package.js | Package.describe({
summary: "Google OAuth flow",
version: "1.2.1-rc.6"
});
Cordova.depends({
"cordova-plugin-googleplus": "5.1.1"
});
Package.onUse(function(api) {
api.use("modules");
api.use("promise");
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use(['underscore', 'service-configuration'], ['client', 'server']);
api.use('random', 'client');
api.addFiles('google_server.js', 'server');
api.addFiles('google_client.js', 'client');
api.addFiles('google_sign-in.js', 'web.cordova');
api.mainModule('namespace.js');
api.export('Google');
});
| Package.describe({
summary: "Google OAuth flow",
version: "1.2.1-rc.6"
});
var cordovaPluginGooglePlusURL =
// This revision is from the "update-entitlements-plist-files" branch.
// This logic can be reverted when/if this PR is merged:
// https://github.com/EddyVerbruggen/cordova-plugin-googleplus/pull/366
"https://github.com/meteor/cordova-plugin-googleplus.git#3095abe327e710ab04059ae9d3521bd4037c5a37";
Cordova.depends({
"cordova-plugin-googleplus": cordovaPluginGooglePlusURL
});
Package.onUse(function(api) {
api.use("modules");
api.use("promise");
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use(['underscore', 'service-configuration'], ['client', 'server']);
api.use('random', 'client');
api.addFiles('google_server.js', 'server');
api.addFiles('google_client.js', 'client');
api.addFiles('google_sign-in.js', 'web.cordova');
api.mainModule('namespace.js');
api.export('Google');
});
| Use fork of cordova-plugin-googleplus to ease iOS keychain sharing. | Use fork of cordova-plugin-googleplus to ease iOS keychain sharing.
https://github.com/meteor/meteor/issues/8253
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/pull/366
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | javascript | ## Code Before:
Package.describe({
summary: "Google OAuth flow",
version: "1.2.1-rc.6"
});
Cordova.depends({
"cordova-plugin-googleplus": "5.1.1"
});
Package.onUse(function(api) {
api.use("modules");
api.use("promise");
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use(['underscore', 'service-configuration'], ['client', 'server']);
api.use('random', 'client');
api.addFiles('google_server.js', 'server');
api.addFiles('google_client.js', 'client');
api.addFiles('google_sign-in.js', 'web.cordova');
api.mainModule('namespace.js');
api.export('Google');
});
## Instruction:
Use fork of cordova-plugin-googleplus to ease iOS keychain sharing.
https://github.com/meteor/meteor/issues/8253
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/pull/366
## Code After:
Package.describe({
summary: "Google OAuth flow",
version: "1.2.1-rc.6"
});
var cordovaPluginGooglePlusURL =
// This revision is from the "update-entitlements-plist-files" branch.
// This logic can be reverted when/if this PR is merged:
// https://github.com/EddyVerbruggen/cordova-plugin-googleplus/pull/366
"https://github.com/meteor/cordova-plugin-googleplus.git#3095abe327e710ab04059ae9d3521bd4037c5a37";
Cordova.depends({
"cordova-plugin-googleplus": cordovaPluginGooglePlusURL
});
Package.onUse(function(api) {
api.use("modules");
api.use("promise");
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use(['underscore', 'service-configuration'], ['client', 'server']);
api.use('random', 'client');
api.addFiles('google_server.js', 'server');
api.addFiles('google_client.js', 'client');
api.addFiles('google_sign-in.js', 'web.cordova');
api.mainModule('namespace.js');
api.export('Google');
});
| Package.describe({
summary: "Google OAuth flow",
version: "1.2.1-rc.6"
});
+ var cordovaPluginGooglePlusURL =
+ // This revision is from the "update-entitlements-plist-files" branch.
+ // This logic can be reverted when/if this PR is merged:
+ // https://github.com/EddyVerbruggen/cordova-plugin-googleplus/pull/366
+ "https://github.com/meteor/cordova-plugin-googleplus.git#3095abe327e710ab04059ae9d3521bd4037c5a37";
+
Cordova.depends({
- "cordova-plugin-googleplus": "5.1.1"
+ "cordova-plugin-googleplus": cordovaPluginGooglePlusURL
});
Package.onUse(function(api) {
api.use("modules");
api.use("promise");
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use(['underscore', 'service-configuration'], ['client', 'server']);
api.use('random', 'client');
api.addFiles('google_server.js', 'server');
api.addFiles('google_client.js', 'client');
api.addFiles('google_sign-in.js', 'web.cordova');
api.mainModule('namespace.js');
api.export('Google');
}); | 8 | 0.307692 | 7 | 1 |
20f0d90f5c64322864ad5fda4b4c9314e6c1cb11 | run.py | run.py |
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)
open_log("output.log")
logger = getLogger("System")
logger.info("Starting up..")
try:
manager = Manager()
except Exception:
logger.critical("Runtime error - process cannot continue!")
output_exception(logger)
finally:
close_log("output.log")
try:
raw_input("Press enter to exit.")
except:
pass
|
import os
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)
if not os.path.exists("logs"):
os.mkdir("logs")
open_log("output.log")
logger = getLogger("System")
logger.info("Starting up..")
try:
manager = Manager()
except Exception:
logger.critical("Runtime error - process cannot continue!")
output_exception(logger)
finally:
close_log("output.log")
try:
raw_input("Press enter to exit.")
except:
pass
| Create logs folder if it doesn't exist (to prevent errors) | Create logs folder if it doesn't exist (to prevent errors)
| Python | artistic-2.0 | UltrosBot/Ultros,UltrosBot/Ultros | python | ## Code Before:
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)
open_log("output.log")
logger = getLogger("System")
logger.info("Starting up..")
try:
manager = Manager()
except Exception:
logger.critical("Runtime error - process cannot continue!")
output_exception(logger)
finally:
close_log("output.log")
try:
raw_input("Press enter to exit.")
except:
pass
## Instruction:
Create logs folder if it doesn't exist (to prevent errors)
## Code After:
import os
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)
if not os.path.exists("logs"):
os.mkdir("logs")
open_log("output.log")
logger = getLogger("System")
logger.info("Starting up..")
try:
manager = Manager()
except Exception:
logger.critical("Runtime error - process cannot continue!")
output_exception(logger)
finally:
close_log("output.log")
try:
raw_input("Press enter to exit.")
except:
pass
|
+ import os
import sys
from kitchen.text.converters import getwriter
from utils.log import getLogger, open_log, close_log
from utils.misc import output_exception
from system.factory_manager import Manager
sys.stdout = getwriter('utf-8')(sys.stdout)
sys.stderr = getwriter('utf-8')(sys.stderr)
+
+ if not os.path.exists("logs"):
+ os.mkdir("logs")
open_log("output.log")
logger = getLogger("System")
logger.info("Starting up..")
try:
manager = Manager()
except Exception:
logger.critical("Runtime error - process cannot continue!")
output_exception(logger)
finally:
close_log("output.log")
try:
raw_input("Press enter to exit.")
except:
pass | 4 | 0.133333 | 4 | 0 |
7ee347a510561b38b48fcaf62aebe0de3b8ecf34 | lib/click/clicker.rb | lib/click/clicker.rb | module Click
class Clicker
def click!
observers.each { |o| o.before_click(self) }
ObjectSpace.garbage_collect
@state = Hash.new(0)
ObjectSpace.each_object do |object|
@state[object.class] += 1
end
@state[Symbol] = Symbol.all_symbols.count
observers.each { |o| o.after_click(self) }
end
def object_counts
@state.dup
end
def instance_count(klass)
@state.fetch(klass, 0)
end
def add_observer(observer)
observers << observer
end
private
def observers
@observers ||= []
end
end
end
| module Click
class Clicker
def click!
observers.each { |o| o.before_click(self) }
ObjectSpace.garbage_collect
@state = Hash.new(0)
ObjectSpace.each_object do |object|
begin
klass = object.class
next unless klass.is_a?(Class)
rescue NoMethodError
next
end
@state[klass] += 1
end
@state[Symbol] = Symbol.all_symbols.count
observers.each { |o| o.after_click(self) }
end
def object_counts
@state.dup
end
def instance_count(klass)
@state.fetch(klass, 0)
end
def add_observer(observer)
observers << observer
end
private
def observers
@observers ||= []
end
end
end
| Make click! more resilient against unclassy things | Make click! more resilient against unclassy things
| Ruby | mit | mark-rushakoff/click | ruby | ## Code Before:
module Click
class Clicker
def click!
observers.each { |o| o.before_click(self) }
ObjectSpace.garbage_collect
@state = Hash.new(0)
ObjectSpace.each_object do |object|
@state[object.class] += 1
end
@state[Symbol] = Symbol.all_symbols.count
observers.each { |o| o.after_click(self) }
end
def object_counts
@state.dup
end
def instance_count(klass)
@state.fetch(klass, 0)
end
def add_observer(observer)
observers << observer
end
private
def observers
@observers ||= []
end
end
end
## Instruction:
Make click! more resilient against unclassy things
## Code After:
module Click
class Clicker
def click!
observers.each { |o| o.before_click(self) }
ObjectSpace.garbage_collect
@state = Hash.new(0)
ObjectSpace.each_object do |object|
begin
klass = object.class
next unless klass.is_a?(Class)
rescue NoMethodError
next
end
@state[klass] += 1
end
@state[Symbol] = Symbol.all_symbols.count
observers.each { |o| o.after_click(self) }
end
def object_counts
@state.dup
end
def instance_count(klass)
@state.fetch(klass, 0)
end
def add_observer(observer)
observers << observer
end
private
def observers
@observers ||= []
end
end
end
| module Click
class Clicker
def click!
observers.each { |o| o.before_click(self) }
ObjectSpace.garbage_collect
@state = Hash.new(0)
ObjectSpace.each_object do |object|
+ begin
+ klass = object.class
+ next unless klass.is_a?(Class)
+ rescue NoMethodError
+ next
+ end
+
- @state[object.class] += 1
? ^^^^^^^^
+ @state[klass] += 1
? ^
end
@state[Symbol] = Symbol.all_symbols.count
observers.each { |o| o.after_click(self) }
end
def object_counts
@state.dup
end
def instance_count(klass)
@state.fetch(klass, 0)
end
def add_observer(observer)
observers << observer
end
private
def observers
@observers ||= []
end
end
end | 9 | 0.257143 | 8 | 1 |
f987f3d8dac6c40aa034dfd13fdbd00964e693fe | circle.yml | circle.yml | machine:
timezone:
Europe/Paris
node:
version: 8
services:
- docker
dependencies:
pre:
- npm uninstall -g npm
- curl -o- -L https://yarnpkg.com/install.sh | bash
override:
- yarn
test:
override:
- yarn run coverage
deployment:
production:
branch: master
owner: mdcarter
commands:
- yarn run deploy;
- yarn run coverage:publish; | machine:
timezone:
Europe/Paris
node:
version: 8
services:
- docker
dependencies:
pre:
- npm uninstall -g npm
- curl -o- -L https://yarnpkg.com/install.sh | bash
override:
- yarn
test:
override:
- yarn run build-css
- yarn run coverage
deployment:
production:
branch: master
owner: mdcarter
commands:
- yarn run deploy
- yarn run coverage:publish | Add css build into CI | Add css build into CI
| YAML | mit | mdcarter/lunchfinder.io,mdcarter/lunchfinder.io | yaml | ## Code Before:
machine:
timezone:
Europe/Paris
node:
version: 8
services:
- docker
dependencies:
pre:
- npm uninstall -g npm
- curl -o- -L https://yarnpkg.com/install.sh | bash
override:
- yarn
test:
override:
- yarn run coverage
deployment:
production:
branch: master
owner: mdcarter
commands:
- yarn run deploy;
- yarn run coverage:publish;
## Instruction:
Add css build into CI
## Code After:
machine:
timezone:
Europe/Paris
node:
version: 8
services:
- docker
dependencies:
pre:
- npm uninstall -g npm
- curl -o- -L https://yarnpkg.com/install.sh | bash
override:
- yarn
test:
override:
- yarn run build-css
- yarn run coverage
deployment:
production:
branch: master
owner: mdcarter
commands:
- yarn run deploy
- yarn run coverage:publish | machine:
timezone:
Europe/Paris
node:
version: 8
services:
- docker
dependencies:
pre:
- npm uninstall -g npm
- curl -o- -L https://yarnpkg.com/install.sh | bash
override:
- yarn
test:
override:
+ - yarn run build-css
- yarn run coverage
deployment:
production:
branch: master
owner: mdcarter
commands:
- - yarn run deploy;
? -
+ - yarn run deploy
- - yarn run coverage:publish;
? -
+ - yarn run coverage:publish | 5 | 0.192308 | 3 | 2 |
7a52222117a13e470a62a33afd05891ce4e44334 | src/middlewares/redux-pouchdb.js | src/middlewares/redux-pouchdb.js | import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const applyChanges = async (nextState, prevState) => {
try {
const storedDocument = await getDocument(prevState.pouchdb.docId);
await updateDocument({
...nextState.ebudgie,
_rev: storedDocument._rev,
});
} catch (e) {
if (e.status === 409) {
await applyChanges(nextState, prevState);
} else {
throw e;
}
}
}
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);
const nextState = store.getState();
const isNotLoadAction = action.type !== NEW_POUCHDB && action.type !== LOAD_EBUDGIE;
const documentHasChanged = !isEqual(prevState.ebudgie, nextState.ebudgie);
if (isNotLoadAction && documentHasChanged) {
try {
if (action.type === INITIAL_LOAD) {
await updateDocument({
...nextState.ebudgie,
});
} else {
await applyChanges(nextState, prevState);
}
} catch (e) {
}
}
return result;
};
export default storage;
| import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const applyChanges = async (nextState, prevState, action) => {
try {
const storedDocument = await getDocument(prevState.pouchdb.docId);
const storedChanges = storedDocument.changes || [];
await updateDocument({
...nextState.ebudgie,
_rev: storedDocument._rev,
changes: [
...storedChanges,
{
_rev: storedDocument._rev,
actions: [{
...action
}]
}
]
});
} catch (e) {
if (e.status === 409) {
await applyChanges(nextState, prevState, action);
} else {
throw e;
}
}
}
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);
const nextState = store.getState();
const isNotLoadAction = action.type !== NEW_POUCHDB && action.type !== LOAD_EBUDGIE;
const documentHasChanged = !isEqual(prevState.ebudgie, nextState.ebudgie);
if (isNotLoadAction && documentHasChanged) {
try {
if (action.type === INITIAL_LOAD) {
await updateDocument({
...nextState.ebudgie,
});
} else {
await applyChanges(nextState, prevState, action);
}
} catch (e) {
}
}
return result;
};
export default storage;
| Add changes property before saving document to pouchdb | Add changes property before saving document to pouchdb
| JavaScript | mit | nikolay-radkov/EBudgie,nikolay-radkov/EBudgie,nikolay-radkov/EBudgie | javascript | ## Code Before:
import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const applyChanges = async (nextState, prevState) => {
try {
const storedDocument = await getDocument(prevState.pouchdb.docId);
await updateDocument({
...nextState.ebudgie,
_rev: storedDocument._rev,
});
} catch (e) {
if (e.status === 409) {
await applyChanges(nextState, prevState);
} else {
throw e;
}
}
}
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);
const nextState = store.getState();
const isNotLoadAction = action.type !== NEW_POUCHDB && action.type !== LOAD_EBUDGIE;
const documentHasChanged = !isEqual(prevState.ebudgie, nextState.ebudgie);
if (isNotLoadAction && documentHasChanged) {
try {
if (action.type === INITIAL_LOAD) {
await updateDocument({
...nextState.ebudgie,
});
} else {
await applyChanges(nextState, prevState);
}
} catch (e) {
}
}
return result;
};
export default storage;
## Instruction:
Add changes property before saving document to pouchdb
## Code After:
import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
const applyChanges = async (nextState, prevState, action) => {
try {
const storedDocument = await getDocument(prevState.pouchdb.docId);
const storedChanges = storedDocument.changes || [];
await updateDocument({
...nextState.ebudgie,
_rev: storedDocument._rev,
changes: [
...storedChanges,
{
_rev: storedDocument._rev,
actions: [{
...action
}]
}
]
});
} catch (e) {
if (e.status === 409) {
await applyChanges(nextState, prevState, action);
} else {
throw e;
}
}
}
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);
const nextState = store.getState();
const isNotLoadAction = action.type !== NEW_POUCHDB && action.type !== LOAD_EBUDGIE;
const documentHasChanged = !isEqual(prevState.ebudgie, nextState.ebudgie);
if (isNotLoadAction && documentHasChanged) {
try {
if (action.type === INITIAL_LOAD) {
await updateDocument({
...nextState.ebudgie,
});
} else {
await applyChanges(nextState, prevState, action);
}
} catch (e) {
}
}
return result;
};
export default storage;
| import { getDocument, updateDocument } from '../services/pouchdbService';
import { isEqual } from 'lodash';
import {
NEW_POUCHDB,
LOAD_EBUDGIE,
INITIAL_LOAD,
} from '../constants/ActionTypes';
- const applyChanges = async (nextState, prevState) => {
+ const applyChanges = async (nextState, prevState, action) => {
? ++++++++
try {
const storedDocument = await getDocument(prevState.pouchdb.docId);
+ const storedChanges = storedDocument.changes || [];
await updateDocument({
...nextState.ebudgie,
_rev: storedDocument._rev,
+ changes: [
+ ...storedChanges,
+ {
+ _rev: storedDocument._rev,
+ actions: [{
+ ...action
+ }]
+ }
+ ]
});
} catch (e) {
if (e.status === 409) {
- await applyChanges(nextState, prevState);
+ await applyChanges(nextState, prevState, action);
? ++++++++
} else {
throw e;
}
}
}
const storage = store => next => async action => {
const prevState = store.getState();
const result = next(action);
const nextState = store.getState();
const isNotLoadAction = action.type !== NEW_POUCHDB && action.type !== LOAD_EBUDGIE;
const documentHasChanged = !isEqual(prevState.ebudgie, nextState.ebudgie);
if (isNotLoadAction && documentHasChanged) {
try {
if (action.type === INITIAL_LOAD) {
await updateDocument({
...nextState.ebudgie,
});
} else {
- await applyChanges(nextState, prevState);
+ await applyChanges(nextState, prevState, action);
? ++++++++
}
} catch (e) {
}
}
return result;
};
export default storage; | 16 | 0.313725 | 13 | 3 |
6c9a9fd1dbdedbd16ade0ddf090cd5034ad25494 | README.rdoc | README.rdoc | = Minx
Massive and pervasive concurrency with Minx!
Minx uses the powerful concurrency primitives outlined by Tony Hoare in his
famous book "Communicating Sequential Processes".
== Usage
Minx lets you easily create concurrent programs using the notion of *processes*
and *channels*.
# Very contrived example...
chan = Minx.channel
Minx.spawn { chan.send("Hello, World!") }
Minx.spawn { puts chan.receive("Hello, World!") }
These primitives, although simple, are incredibly powerful. When reading from
or writing to a channel, a process yields execution -- and thus blocks until
another process also participates in the communication. An example of when
this would be useful is a simple network server:
def worker(requests)
Minx.spawn do
requests.each {|request| handle_request(request) }
end
end
# Create a channel for the incoming requests.
requests = Minx.channel
# Spawn 10 workers.
10.times { worker(requests) }
In the near future, evented IO will be implemented, allowing for highly
performant network and file applications.
== Copyright
Copyright (c) 2010 Daniel Schierbeck. See LICENSE for details.
| = Minx
Massive and pervasive concurrency with Minx!
Minx uses the powerful concurrency primitives outlined by Tony Hoare in his
famous book "Communicating Sequential Processes".
== Usage
Minx lets you easily create concurrent programs using the notion of *processes*
and *channels*.
# Very contrived example...
chan = Minx.channel
Minx.spawn { chan.send("Hello, World!") }
Minx.spawn { puts chan.receive("Hello, World!") }
These primitives, although simple, are incredibly powerful. When reading from
or writing to a channel, a process yields execution -- and thus blocks until
another process also participates in the communication. An example of when
this would be useful is a simple network server:
def worker(requests)
Minx.spawn do
requests.each {|request| handle_request(request) }
end
end
# Create a channel for the incoming requests.
requests = Minx.channel
# Spawn 10 workers.
10.times { worker(requests) }
In the near future, evented IO will be implemented, allowing for highly
performant network and file applications.
== Documentation
See http://yardoc.org/docs/dasch-minx/file:README.rdoc for full documentation.
== Copyright
Copyright (c) 2010 Daniel Schierbeck. See LICENSE for details.
| Add a link to the YARD docs | Add a link to the YARD docs
| RDoc | mit | dasch/minx | rdoc | ## Code Before:
= Minx
Massive and pervasive concurrency with Minx!
Minx uses the powerful concurrency primitives outlined by Tony Hoare in his
famous book "Communicating Sequential Processes".
== Usage
Minx lets you easily create concurrent programs using the notion of *processes*
and *channels*.
# Very contrived example...
chan = Minx.channel
Minx.spawn { chan.send("Hello, World!") }
Minx.spawn { puts chan.receive("Hello, World!") }
These primitives, although simple, are incredibly powerful. When reading from
or writing to a channel, a process yields execution -- and thus blocks until
another process also participates in the communication. An example of when
this would be useful is a simple network server:
def worker(requests)
Minx.spawn do
requests.each {|request| handle_request(request) }
end
end
# Create a channel for the incoming requests.
requests = Minx.channel
# Spawn 10 workers.
10.times { worker(requests) }
In the near future, evented IO will be implemented, allowing for highly
performant network and file applications.
== Copyright
Copyright (c) 2010 Daniel Schierbeck. See LICENSE for details.
## Instruction:
Add a link to the YARD docs
## Code After:
= Minx
Massive and pervasive concurrency with Minx!
Minx uses the powerful concurrency primitives outlined by Tony Hoare in his
famous book "Communicating Sequential Processes".
== Usage
Minx lets you easily create concurrent programs using the notion of *processes*
and *channels*.
# Very contrived example...
chan = Minx.channel
Minx.spawn { chan.send("Hello, World!") }
Minx.spawn { puts chan.receive("Hello, World!") }
These primitives, although simple, are incredibly powerful. When reading from
or writing to a channel, a process yields execution -- and thus blocks until
another process also participates in the communication. An example of when
this would be useful is a simple network server:
def worker(requests)
Minx.spawn do
requests.each {|request| handle_request(request) }
end
end
# Create a channel for the incoming requests.
requests = Minx.channel
# Spawn 10 workers.
10.times { worker(requests) }
In the near future, evented IO will be implemented, allowing for highly
performant network and file applications.
== Documentation
See http://yardoc.org/docs/dasch-minx/file:README.rdoc for full documentation.
== Copyright
Copyright (c) 2010 Daniel Schierbeck. See LICENSE for details.
| = Minx
Massive and pervasive concurrency with Minx!
Minx uses the powerful concurrency primitives outlined by Tony Hoare in his
famous book "Communicating Sequential Processes".
== Usage
Minx lets you easily create concurrent programs using the notion of *processes*
and *channels*.
# Very contrived example...
chan = Minx.channel
Minx.spawn { chan.send("Hello, World!") }
Minx.spawn { puts chan.receive("Hello, World!") }
These primitives, although simple, are incredibly powerful. When reading from
or writing to a channel, a process yields execution -- and thus blocks until
another process also participates in the communication. An example of when
this would be useful is a simple network server:
def worker(requests)
Minx.spawn do
requests.each {|request| handle_request(request) }
end
end
# Create a channel for the incoming requests.
requests = Minx.channel
# Spawn 10 workers.
10.times { worker(requests) }
In the near future, evented IO will be implemented, allowing for highly
performant network and file applications.
+
+ == Documentation
+
+ See http://yardoc.org/docs/dasch-minx/file:README.rdoc for full documentation.
+
+
== Copyright
Copyright (c) 2010 Daniel Schierbeck. See LICENSE for details. | 6 | 0.142857 | 6 | 0 |
1b5553f72c1058aeb21a63608f37979c517176bc | spec/helper.rb | spec/helper.rb | require 'yaccl'
require 'json'
YACCL.init('http://localhost:8080/browser')
def create_repository(id)
meta = YACCL::Model::Server.repository('meta')
repo_type = meta.type('repository')
property_definitions = repo_type.property_definitions.keys
f = meta.new_folder
f.name = id
f.object_type_id = repo_type.id
f.properties[:supportsRelationships] = true if property_definitions.include?(:supportsRelationships)
f.properties[:supportsPolicies] = true if property_definitions.include?(:supportsPolicies)
f.properties[:supportsItems] = true if property_definitions.include?(:supportsItems)
meta.root.create(f)
YACCL::Model::Server.repository(id)
end
def delete_repository(id)
YACCL::Model::Server.repository('meta').object(id).delete
end
| require 'yaccl'
require 'json'
YACCL.init('http://33.33.33.100:8080/browser', 'metaadmin', 'metaadmin')
def create_repository(id)
meta = YACCL::Model::Server.repository('meta')
repo_type = meta.type('repository')
property_definitions = repo_type.property_definitions.keys
f = meta.new_folder
f.name = id
f.properties[:id] = id
f.object_type_id = repo_type.id
f.properties[:supportsRelationships] = true if property_definitions.include?(:supportsRelationships)
f.properties[:supportsPolicies] = true if property_definitions.include?(:supportsPolicies)
f.properties[:supportsItems] = true if property_definitions.include?(:supportsItems)
meta.root.create(f)
YACCL::Model::Server.repository(id)
end
def delete_repository(id)
YACCL::Model::Server.repository('meta').object(id).delete
end
| Fix test: repository permissions and pass id. | Fix test: repository permissions and pass id.
| Ruby | apache-2.0 | UP-nxt/cmis-ruby | ruby | ## Code Before:
require 'yaccl'
require 'json'
YACCL.init('http://localhost:8080/browser')
def create_repository(id)
meta = YACCL::Model::Server.repository('meta')
repo_type = meta.type('repository')
property_definitions = repo_type.property_definitions.keys
f = meta.new_folder
f.name = id
f.object_type_id = repo_type.id
f.properties[:supportsRelationships] = true if property_definitions.include?(:supportsRelationships)
f.properties[:supportsPolicies] = true if property_definitions.include?(:supportsPolicies)
f.properties[:supportsItems] = true if property_definitions.include?(:supportsItems)
meta.root.create(f)
YACCL::Model::Server.repository(id)
end
def delete_repository(id)
YACCL::Model::Server.repository('meta').object(id).delete
end
## Instruction:
Fix test: repository permissions and pass id.
## Code After:
require 'yaccl'
require 'json'
YACCL.init('http://33.33.33.100:8080/browser', 'metaadmin', 'metaadmin')
def create_repository(id)
meta = YACCL::Model::Server.repository('meta')
repo_type = meta.type('repository')
property_definitions = repo_type.property_definitions.keys
f = meta.new_folder
f.name = id
f.properties[:id] = id
f.object_type_id = repo_type.id
f.properties[:supportsRelationships] = true if property_definitions.include?(:supportsRelationships)
f.properties[:supportsPolicies] = true if property_definitions.include?(:supportsPolicies)
f.properties[:supportsItems] = true if property_definitions.include?(:supportsItems)
meta.root.create(f)
YACCL::Model::Server.repository(id)
end
def delete_repository(id)
YACCL::Model::Server.repository('meta').object(id).delete
end
| require 'yaccl'
require 'json'
- YACCL.init('http://localhost:8080/browser')
+ YACCL.init('http://33.33.33.100:8080/browser', 'metaadmin', 'metaadmin')
def create_repository(id)
meta = YACCL::Model::Server.repository('meta')
repo_type = meta.type('repository')
property_definitions = repo_type.property_definitions.keys
f = meta.new_folder
f.name = id
+ f.properties[:id] = id
f.object_type_id = repo_type.id
f.properties[:supportsRelationships] = true if property_definitions.include?(:supportsRelationships)
f.properties[:supportsPolicies] = true if property_definitions.include?(:supportsPolicies)
f.properties[:supportsItems] = true if property_definitions.include?(:supportsItems)
meta.root.create(f)
YACCL::Model::Server.repository(id)
end
def delete_repository(id)
YACCL::Model::Server.repository('meta').object(id).delete
end | 3 | 0.12 | 2 | 1 |
51ffba827c9a91dcc583663148396b3772ba9e4b | opsworks_application/recipes/deploy.rb | opsworks_application/recipes/deploy.rb | include_recipe 'aws'
node[:deploy].each do |app_name, deploy_config|
aws_s3_file "#{deploy_config[:deploy_to]}/current/config/apple_push_notification.pem" do
bucket 'mingle-apn'
remote_path 'apple_push_notification.pem'
aws_access_key_id deploy_config[:application][:aws_access_key_id]
aws_secret_access_key deploy_config[:application][:aws_secret_access_key]
end
template "#{deploy_config[:deploy_to]}/current/config/application.yml" do
source "application.yml.erb"
cookbook "opsworks_application"
mode "0660"
group deploy_config[:group]
owner deploy_config[:user]
variables(:application => deploy_config[:application] || {})
not_if do
deploy_config[:application].blank?
end
end
end
| include_recipe 'aws'
node[:deploy].each do |app_name, deploy_config|
aws_s3_file "#{deploy_config[:deploy_to]}/current/config/apple_push_notification.pem" do
bucket 'mingle-apn'
remote_path 'apple_push_notification.pem'
aws_access_key_id deploy_config[:application_variables][:aws_access_key_id]
aws_secret_access_key deploy_config[:application_variables][:aws_secret_access_key]
end
template "#{deploy_config[:deploy_to]}/current/config/application.yml" do
source "application.yml.erb"
cookbook "opsworks_application"
mode "0660"
group deploy_config[:group]
owner deploy_config[:user]
variables(:application => deploy_config[:application_variables] || {})
not_if do
deploy_config[:application_variables].blank?
end
end
end
| Change variable from 'application' to 'application_variables' | Change variable from 'application' to 'application_variables'
| Ruby | mit | nextc/jsh-chef,nextc/mingle-chef,chautoni/mingle-chef,nextc/mingle-chef,nextc/jsh-chef | ruby | ## Code Before:
include_recipe 'aws'
node[:deploy].each do |app_name, deploy_config|
aws_s3_file "#{deploy_config[:deploy_to]}/current/config/apple_push_notification.pem" do
bucket 'mingle-apn'
remote_path 'apple_push_notification.pem'
aws_access_key_id deploy_config[:application][:aws_access_key_id]
aws_secret_access_key deploy_config[:application][:aws_secret_access_key]
end
template "#{deploy_config[:deploy_to]}/current/config/application.yml" do
source "application.yml.erb"
cookbook "opsworks_application"
mode "0660"
group deploy_config[:group]
owner deploy_config[:user]
variables(:application => deploy_config[:application] || {})
not_if do
deploy_config[:application].blank?
end
end
end
## Instruction:
Change variable from 'application' to 'application_variables'
## Code After:
include_recipe 'aws'
node[:deploy].each do |app_name, deploy_config|
aws_s3_file "#{deploy_config[:deploy_to]}/current/config/apple_push_notification.pem" do
bucket 'mingle-apn'
remote_path 'apple_push_notification.pem'
aws_access_key_id deploy_config[:application_variables][:aws_access_key_id]
aws_secret_access_key deploy_config[:application_variables][:aws_secret_access_key]
end
template "#{deploy_config[:deploy_to]}/current/config/application.yml" do
source "application.yml.erb"
cookbook "opsworks_application"
mode "0660"
group deploy_config[:group]
owner deploy_config[:user]
variables(:application => deploy_config[:application_variables] || {})
not_if do
deploy_config[:application_variables].blank?
end
end
end
| include_recipe 'aws'
node[:deploy].each do |app_name, deploy_config|
aws_s3_file "#{deploy_config[:deploy_to]}/current/config/apple_push_notification.pem" do
bucket 'mingle-apn'
remote_path 'apple_push_notification.pem'
- aws_access_key_id deploy_config[:application][:aws_access_key_id]
+ aws_access_key_id deploy_config[:application_variables][:aws_access_key_id]
? ++++++++++
- aws_secret_access_key deploy_config[:application][:aws_secret_access_key]
+ aws_secret_access_key deploy_config[:application_variables][:aws_secret_access_key]
? ++++++++++
end
template "#{deploy_config[:deploy_to]}/current/config/application.yml" do
source "application.yml.erb"
cookbook "opsworks_application"
mode "0660"
group deploy_config[:group]
owner deploy_config[:user]
- variables(:application => deploy_config[:application] || {})
+ variables(:application => deploy_config[:application_variables] || {})
? ++++++++++
not_if do
- deploy_config[:application].blank?
+ deploy_config[:application_variables].blank?
? ++++++++++
end
end
end | 8 | 0.333333 | 4 | 4 |
4bac706c8c1b123c2aa1111b88ec5df30821a07d | lib/csv2avro/storage.rb | lib/csv2avro/storage.rb | require 'aws-sdk'
require 'uri'
class CSV2Avro
class Storage
attr_reader :uri
def initialize(uri)
@uri = URI(uri)
end
def read
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new(region: 'us-east-1')
resp = s3.get_object(bucket: uri.host, key: uri.path[1..-1])
resp.body.read
when 'file'
File.open(uri.path, 'r').read
else
raise Exception.new("Unsupported schema on read: '#{uri}'")
end
end
def write(io)
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new(region: 'us-east-1')
md5 = Digest::MD5.base64digest(io.string)
s3.put_object(bucket: uri.host, key: uri.path[1..-1], body: io, content_md5: md5)
when 'file'
File.write(uri.path, io.string)
else
raise Exception.new("Unsupported schema on write: '#{uri}'")
end
end
end
end
| require 'aws-sdk'
require 'uri'
class CSV2Avro
class Storage
attr_reader :uri
def initialize(uri)
@uri = URI(uri)
end
def read
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new
resp = s3.get_object(bucket: uri.host, key: uri.path[1..-1])
resp.body.read
when 'file'
File.open(uri.path, 'r').read
else
raise Exception.new("Unsupported schema on read: '#{uri}'")
end
end
def write(io)
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new
md5 = Digest::MD5.base64digest(io.string)
s3.put_object(bucket: uri.host, key: uri.path[1..-1], body: io, content_md5: md5)
when 'file'
File.write(uri.path, io.string)
else
raise Exception.new("Unsupported schema on write: '#{uri}'")
end
end
end
end
| Use the AWS_DEFAULT_REGION env variable | Use the AWS_DEFAULT_REGION env variable | Ruby | mit | sspinc/csv2avro | ruby | ## Code Before:
require 'aws-sdk'
require 'uri'
class CSV2Avro
class Storage
attr_reader :uri
def initialize(uri)
@uri = URI(uri)
end
def read
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new(region: 'us-east-1')
resp = s3.get_object(bucket: uri.host, key: uri.path[1..-1])
resp.body.read
when 'file'
File.open(uri.path, 'r').read
else
raise Exception.new("Unsupported schema on read: '#{uri}'")
end
end
def write(io)
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new(region: 'us-east-1')
md5 = Digest::MD5.base64digest(io.string)
s3.put_object(bucket: uri.host, key: uri.path[1..-1], body: io, content_md5: md5)
when 'file'
File.write(uri.path, io.string)
else
raise Exception.new("Unsupported schema on write: '#{uri}'")
end
end
end
end
## Instruction:
Use the AWS_DEFAULT_REGION env variable
## Code After:
require 'aws-sdk'
require 'uri'
class CSV2Avro
class Storage
attr_reader :uri
def initialize(uri)
@uri = URI(uri)
end
def read
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new
resp = s3.get_object(bucket: uri.host, key: uri.path[1..-1])
resp.body.read
when 'file'
File.open(uri.path, 'r').read
else
raise Exception.new("Unsupported schema on read: '#{uri}'")
end
end
def write(io)
case uri.scheme
when 's3'
s3 = Aws::S3::Client.new
md5 = Digest::MD5.base64digest(io.string)
s3.put_object(bucket: uri.host, key: uri.path[1..-1], body: io, content_md5: md5)
when 'file'
File.write(uri.path, io.string)
else
raise Exception.new("Unsupported schema on write: '#{uri}'")
end
end
end
end
| require 'aws-sdk'
require 'uri'
class CSV2Avro
class Storage
attr_reader :uri
def initialize(uri)
@uri = URI(uri)
end
def read
case uri.scheme
when 's3'
- s3 = Aws::S3::Client.new(region: 'us-east-1')
? ---------------------
+ s3 = Aws::S3::Client.new
resp = s3.get_object(bucket: uri.host, key: uri.path[1..-1])
resp.body.read
when 'file'
File.open(uri.path, 'r').read
else
raise Exception.new("Unsupported schema on read: '#{uri}'")
end
end
def write(io)
case uri.scheme
when 's3'
- s3 = Aws::S3::Client.new(region: 'us-east-1')
? ---------------------
+ s3 = Aws::S3::Client.new
md5 = Digest::MD5.base64digest(io.string)
s3.put_object(bucket: uri.host, key: uri.path[1..-1], body: io, content_md5: md5)
when 'file'
File.write(uri.path, io.string)
else
raise Exception.new("Unsupported schema on write: '#{uri}'")
end
end
end
end | 4 | 0.102564 | 2 | 2 |
e73a24745615b4ee41207b2489d7b7518cb285b7 | openstack_dashboard/dashboards/help_about/help_about/templates/help_about/about.html | openstack_dashboard/dashboards/help_about/help_about/templates/help_about/about.html | <p>FIWARE Accounts. 2015 © <a href="http://www.fiware.org/" target="_blank">FIWARE</a>.</p>
<p>The use of FIWARE Lab services is subject to the acceptance of the <a class="" href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_LAB_Terms_and_Conditions" target="a_blank">Terms and Conditions</a>, <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_Privacy_Policy" target="a_blank">Privacy Policy</a> and <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Cookies_Policy_FIWARE" target="a_blank">Cookies Policy</a>.</p>
<p>Visit <a href="http://help.lab.fiware.org/" target="a_blank">FIWARE Lab Help & Info</a> if you want to learn more about FIWARE Lab services.</p>
| <p>FIWARE Accounts. 2015 © <a href="http://www.fiware.org/" target="_blank">FIWARE</a>.</p>
<p>The use of FIWARE Lab services is subject to the acceptance of the <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_LAB_Terms_and_Conditions" target="_blank">Terms and Conditions</a>, <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_Privacy_Policy" target="_blank">Privacy Policy</a> and <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Cookies_Policy_FIWARE" target="_blank">Cookies Policy</a>.</p>
<p>Visit <a href="http://help.lab.fiware.org/" target="_blank">FIWARE Lab Help & Info</a> if you want to learn more about FIWARE Lab services.</p>
| Fix typo in Help&About panel | Fix typo in Help&About panel
| HTML | apache-2.0 | ging/horizon,ging/horizon,ging/horizon,ging/horizon | html | ## Code Before:
<p>FIWARE Accounts. 2015 © <a href="http://www.fiware.org/" target="_blank">FIWARE</a>.</p>
<p>The use of FIWARE Lab services is subject to the acceptance of the <a class="" href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_LAB_Terms_and_Conditions" target="a_blank">Terms and Conditions</a>, <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_Privacy_Policy" target="a_blank">Privacy Policy</a> and <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Cookies_Policy_FIWARE" target="a_blank">Cookies Policy</a>.</p>
<p>Visit <a href="http://help.lab.fiware.org/" target="a_blank">FIWARE Lab Help & Info</a> if you want to learn more about FIWARE Lab services.</p>
## Instruction:
Fix typo in Help&About panel
## Code After:
<p>FIWARE Accounts. 2015 © <a href="http://www.fiware.org/" target="_blank">FIWARE</a>.</p>
<p>The use of FIWARE Lab services is subject to the acceptance of the <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_LAB_Terms_and_Conditions" target="_blank">Terms and Conditions</a>, <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_Privacy_Policy" target="_blank">Privacy Policy</a> and <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Cookies_Policy_FIWARE" target="_blank">Cookies Policy</a>.</p>
<p>Visit <a href="http://help.lab.fiware.org/" target="_blank">FIWARE Lab Help & Info</a> if you want to learn more about FIWARE Lab services.</p>
| <p>FIWARE Accounts. 2015 © <a href="http://www.fiware.org/" target="_blank">FIWARE</a>.</p>
- <p>The use of FIWARE Lab services is subject to the acceptance of the <a class="" href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_LAB_Terms_and_Conditions" target="a_blank">Terms and Conditions</a>, <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_Privacy_Policy" target="a_blank">Privacy Policy</a> and <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Cookies_Policy_FIWARE" target="a_blank">Cookies Policy</a>.</p>
? --------- - - -
+ <p>The use of FIWARE Lab services is subject to the acceptance of the <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_LAB_Terms_and_Conditions" target="_blank">Terms and Conditions</a>, <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE_Privacy_Policy" target="_blank">Privacy Policy</a> and <a href="http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Cookies_Policy_FIWARE" target="_blank">Cookies Policy</a>.</p>
- <p>Visit <a href="http://help.lab.fiware.org/" target="a_blank">FIWARE Lab Help & Info</a> if you want to learn more about FIWARE Lab services.</p>
? -
+ <p>Visit <a href="http://help.lab.fiware.org/" target="_blank">FIWARE Lab Help & Info</a> if you want to learn more about FIWARE Lab services.</p> | 4 | 0.8 | 2 | 2 |
46791c039204d778c6fd3e8bf4d24ac4be34463d | update-gh-pages.sh | update-gh-pages.sh | if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
cp -R build $HOME
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Ookami86/event-sourcing-in-practice.git gh-pages
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/build/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages
echo -e "Done publishing to gh-pages.\n"
fi
| if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
cp -R build $HOME
cp -R static $HOME/build
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Ookami86/event-sourcing-in-practice.git gh-pages
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/build/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages
echo -e "Done publishing to gh-pages.\n"
fi
| Update deploy script to include static files | Update deploy script to include static files
| Shell | mit | priyatransbit/event-sourcing-in-practice,priyatransbit/event-sourcing-in-practice,fpape/event-sourcing-in-practice,fpape/event-sourcing-in-practice,fpape/event-sourcing-in-practice,priyatransbit/event-sourcing-in-practice,priyatransbit/event-sourcing-in-practice,fpape/event-sourcing-in-practice | shell | ## Code Before:
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
cp -R build $HOME
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Ookami86/event-sourcing-in-practice.git gh-pages
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/build/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages
echo -e "Done publishing to gh-pages.\n"
fi
## Instruction:
Update deploy script to include static files
## Code After:
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
cp -R build $HOME
cp -R static $HOME/build
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Ookami86/event-sourcing-in-practice.git gh-pages
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/build/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages
echo -e "Done publishing to gh-pages.\n"
fi
| if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo -e "Starting to update gh-pages\n"
#copy data we're interested in to other place
cp -R build $HOME
+ cp -R static $HOME/build
#go to home and setup git
cd $HOME
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
#using token clone gh-pages branch
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/Ookami86/event-sourcing-in-practice.git gh-pages
#go into diractory and copy data we're interested in to that directory
cd gh-pages
cp -Rf $HOME/build/* .
#add, commit and push files
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed to gh-pages"
git push -fq origin gh-pages
echo -e "Done publishing to gh-pages.\n"
fi | 1 | 0.04 | 1 | 0 |
8701fc4075b56ef31d87ef2a99a7c3917b51e5be | www/js/main.js | www/js/main.js | var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
var nama = document.pesan.nama.value;
var name = "Andre Christoga";
if ((name == nama)) {
window.location.href = "rs.html";
return true;
};
else {
alert("Harap mendaftar terlebih dahulu")
return false;
}
}
| var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
}
| Remove everything from login function | Remove everything from login function
| JavaScript | mit | cepatsembuh/cordova,christoga/cepatsembuh,mercysmart/cepatsembuh,christoga/cepatsembuh,mercysmart/cepatsembuh,cepatsembuh/cordova,cepatsembuh/cordova,christoga/cepatsembuh,christoga/cepatsembuh,mercysmart/cepatsembuh,mercysmart/cepatsembuh,cepatsembuh/cordova,christoga/cepatsembuh,mercysmart/cepatsembuh,cepatsembuh/cordova | javascript | ## Code Before:
var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
var nama = document.pesan.nama.value;
var name = "Andre Christoga";
if ((name == nama)) {
window.location.href = "rs.html";
return true;
};
else {
alert("Harap mendaftar terlebih dahulu")
return false;
}
}
## Instruction:
Remove everything from login function
## Code After:
var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
}
| var cordova = require("cordova");
window.onload = action
var action = document.pesan.action = login();
var rs = ["Royal Progress", "RSUP Dr Cipto Mangunkusumo", "RSUP Fatmawati", "RSUP Persahabatan"]
function login() {
+
- var nama = document.pesan.nama.value;
- var name = "Andre Christoga";
-
- if ((name == nama)) {
- window.location.href = "rs.html";
- return true;
- };
- else {
- alert("Harap mendaftar terlebih dahulu")
- return false;
- }
} | 12 | 0.666667 | 1 | 11 |
9748546c0a633af0720204b4f283af01931bb470 | recipes/ui.rb | recipes/ui.rb |
include_recipe 'ark::default'
install_version = [node['consul']['version'], 'web_ui'].join('_')
install_checksum = node['consul']['checksums'].fetch(install_version)
ark 'consul_ui' do
path node['consul']['data_dir']
home_dir node['consul']['ui_dir']
version node['consul']['version']
checksum install_checksum
url ::URI.join(node['consul']['base_url'], "#{install_version}.zip").to_s
end
|
include_recipe 'ark::default'
install_version = [node['consul']['version'], 'web_ui'].join('_')
install_checksum = node['consul']['checksums'].fetch(install_version)
ark 'consul_ui' do
path node['consul']['data_dir']
home_dir node['consul']['ui_dir']
version node['consul']['version']
checksum install_checksum
url node['consul']['base_url'] % { version: install_version }
end
| Fix UI recipe to use string interpolation for base url. | Fix UI recipe to use string interpolation for base url.
| Ruby | apache-2.0 | johnbellone/consul-cookbook,johnbellone/consul-cookbook,johnbellone/consul-cookbook | ruby | ## Code Before:
include_recipe 'ark::default'
install_version = [node['consul']['version'], 'web_ui'].join('_')
install_checksum = node['consul']['checksums'].fetch(install_version)
ark 'consul_ui' do
path node['consul']['data_dir']
home_dir node['consul']['ui_dir']
version node['consul']['version']
checksum install_checksum
url ::URI.join(node['consul']['base_url'], "#{install_version}.zip").to_s
end
## Instruction:
Fix UI recipe to use string interpolation for base url.
## Code After:
include_recipe 'ark::default'
install_version = [node['consul']['version'], 'web_ui'].join('_')
install_checksum = node['consul']['checksums'].fetch(install_version)
ark 'consul_ui' do
path node['consul']['data_dir']
home_dir node['consul']['ui_dir']
version node['consul']['version']
checksum install_checksum
url node['consul']['base_url'] % { version: install_version }
end
|
include_recipe 'ark::default'
install_version = [node['consul']['version'], 'web_ui'].join('_')
install_checksum = node['consul']['checksums'].fetch(install_version)
ark 'consul_ui' do
path node['consul']['data_dir']
home_dir node['consul']['ui_dir']
version node['consul']['version']
checksum install_checksum
- url ::URI.join(node['consul']['base_url'], "#{install_version}.zip").to_s
+ url node['consul']['base_url'] % { version: install_version }
end | 2 | 0.153846 | 1 | 1 |
57dd4e20c02964aeca1ce75727d0c728bfd36a2a | README.md | README.md | Convert Go deps managed by [glide](https://github.com/Masterminds/glide) to [Homebrew](http://brew.sh/) resources to help you make brew formulas for you Go programs. The resulting config can be used in Homebrew formulas to have brew share your Go dependencies as brew resources.
See Homebrew's [documentation on resources](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-gems-python-modules-go-projects-etc-as-dependencies) for instructions on how to use them.
# usage
Install with:
```bash
go get github.com/heewa/glide-brew
```
Then run `glide brew` from your Go repo, where you have your `glide.yaml` and `glide.lock` files.
## troubleshooting
If glide complains like: `[ERROR] Command glide-brew does not exist.`, then you probably don't have wherever you installed `glide-brew` into from `go get` in your `PATH`. Either add `$GOPATH/bin` to your `PATH`, or symlink wherever `glide-brew` was installed to something that is, like `/usr/local/bin/`.
| Convert Go deps managed by [glide](https://github.com/Masterminds/glide) to [Homebrew](http://brew.sh/) resources to help you make brew formulas for you Go programs. The resulting config can be used in Homebrew formulas to have brew share your Go dependencies as brew resources.
See Homebrew's [documentation on resources](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-gems-python-modules-go-projects-etc-as-dependencies) for instructions on how to use them.
# usage
You can either install with Homebrew:
```
brew install heewa/tap/glide-brew
```
Or with Go:
```
go get github.com/heewa/glide-brew
```
Then run `glide brew` from your Go repo, where you have your `glide.yaml` and `glide.lock` files.
## troubleshooting
If glide complains like: `[ERROR] Command glide-brew does not exist.`, then you probably don't have wherever you installed `glide-brew` into from `go get` in your `PATH`. Either add `$GOPATH/bin` to your `PATH`, or symlink wherever `glide-brew` was installed to something that is, like `/usr/local/bin/`.
| Add brew instructions to readme | Add brew instructions to readme | Markdown | mit | heewa/glide-brew | markdown | ## Code Before:
Convert Go deps managed by [glide](https://github.com/Masterminds/glide) to [Homebrew](http://brew.sh/) resources to help you make brew formulas for you Go programs. The resulting config can be used in Homebrew formulas to have brew share your Go dependencies as brew resources.
See Homebrew's [documentation on resources](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-gems-python-modules-go-projects-etc-as-dependencies) for instructions on how to use them.
# usage
Install with:
```bash
go get github.com/heewa/glide-brew
```
Then run `glide brew` from your Go repo, where you have your `glide.yaml` and `glide.lock` files.
## troubleshooting
If glide complains like: `[ERROR] Command glide-brew does not exist.`, then you probably don't have wherever you installed `glide-brew` into from `go get` in your `PATH`. Either add `$GOPATH/bin` to your `PATH`, or symlink wherever `glide-brew` was installed to something that is, like `/usr/local/bin/`.
## Instruction:
Add brew instructions to readme
## Code After:
Convert Go deps managed by [glide](https://github.com/Masterminds/glide) to [Homebrew](http://brew.sh/) resources to help you make brew formulas for you Go programs. The resulting config can be used in Homebrew formulas to have brew share your Go dependencies as brew resources.
See Homebrew's [documentation on resources](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-gems-python-modules-go-projects-etc-as-dependencies) for instructions on how to use them.
# usage
You can either install with Homebrew:
```
brew install heewa/tap/glide-brew
```
Or with Go:
```
go get github.com/heewa/glide-brew
```
Then run `glide brew` from your Go repo, where you have your `glide.yaml` and `glide.lock` files.
## troubleshooting
If glide complains like: `[ERROR] Command glide-brew does not exist.`, then you probably don't have wherever you installed `glide-brew` into from `go get` in your `PATH`. Either add `$GOPATH/bin` to your `PATH`, or symlink wherever `glide-brew` was installed to something that is, like `/usr/local/bin/`.
| Convert Go deps managed by [glide](https://github.com/Masterminds/glide) to [Homebrew](http://brew.sh/) resources to help you make brew formulas for you Go programs. The resulting config can be used in Homebrew formulas to have brew share your Go dependencies as brew resources.
See Homebrew's [documentation on resources](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md#specifying-gems-python-modules-go-projects-etc-as-dependencies) for instructions on how to use them.
# usage
- Install with:
- ```bash
+ You can either install with Homebrew:
+ ```
+ brew install heewa/tap/glide-brew
+ ```
+
+ Or with Go:
+ ```
go get github.com/heewa/glide-brew
```
Then run `glide brew` from your Go repo, where you have your `glide.yaml` and `glide.lock` files.
## troubleshooting
If glide complains like: `[ERROR] Command glide-brew does not exist.`, then you probably don't have wherever you installed `glide-brew` into from `go get` in your `PATH`. Either add `$GOPATH/bin` to your `PATH`, or symlink wherever `glide-brew` was installed to something that is, like `/usr/local/bin/`. | 9 | 0.5625 | 7 | 2 |
fc924966d24dc059ab7700e6de32321177d539ee | .circleci/config.yml | .circleci/config.yml | version: 2
jobs:
build:
docker:
- image: golang
working_directory: /go/src/github.com/cloe-lang/cloe
steps:
- checkout
- run:
name: OS Setup
command: |
apt -y update --fix-missing
apt -y install rake bundler
- run:
name: Dependencies
command: rake deps
- run:
name: Lint
command: rake lint
- run:
name: Unit test
command: rake unit_test
- run:
name: Command test
command: rake command_test
- run:
name: Performance test
command: rake performance_test
- run:
name: Data race test
command: rake data_race_test
- run:
name: Coverage report
command: |
bash <(curl -s https://codecov.io/bash)
goveralls -coverprofile=coverage.txt -service=circle-ci -repotoken $COVERALLS_TOKEN
- run:
name: Benchmark
command: rake bench
- run:
name: Installation
command: rake install
| version: 2
jobs:
build:
docker:
- image: golang
working_directory: /go/src/github.com/cloe-lang/cloe
steps:
- checkout
- run:
name: OS Setup
command: |
apt -y update --fix-missing
apt -y install rake bundler
- run:
name: Dependencies
command: rake deps
- run:
name: Lint
command: rake lint
- run:
name: Unit test
command: rake unit_test
- run:
name: Command test
command: rake command_test
- run:
name: Performance test
command: rake performance_test
- run:
name: Data race test
command: rake data_race_test
- run:
name: Coverage report
command: |
curl -s https://codecov.io/bash | bash
goveralls -coverprofile=coverage.txt -service=circle-ci -repotoken $COVERALLS_TOKEN
- run:
name: Benchmark
command: rake bench
- run:
name: Installation
command: rake install
| Use normal shell script syntax | Use normal shell script syntax
| YAML | mit | tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp | yaml | ## Code Before:
version: 2
jobs:
build:
docker:
- image: golang
working_directory: /go/src/github.com/cloe-lang/cloe
steps:
- checkout
- run:
name: OS Setup
command: |
apt -y update --fix-missing
apt -y install rake bundler
- run:
name: Dependencies
command: rake deps
- run:
name: Lint
command: rake lint
- run:
name: Unit test
command: rake unit_test
- run:
name: Command test
command: rake command_test
- run:
name: Performance test
command: rake performance_test
- run:
name: Data race test
command: rake data_race_test
- run:
name: Coverage report
command: |
bash <(curl -s https://codecov.io/bash)
goveralls -coverprofile=coverage.txt -service=circle-ci -repotoken $COVERALLS_TOKEN
- run:
name: Benchmark
command: rake bench
- run:
name: Installation
command: rake install
## Instruction:
Use normal shell script syntax
## Code After:
version: 2
jobs:
build:
docker:
- image: golang
working_directory: /go/src/github.com/cloe-lang/cloe
steps:
- checkout
- run:
name: OS Setup
command: |
apt -y update --fix-missing
apt -y install rake bundler
- run:
name: Dependencies
command: rake deps
- run:
name: Lint
command: rake lint
- run:
name: Unit test
command: rake unit_test
- run:
name: Command test
command: rake command_test
- run:
name: Performance test
command: rake performance_test
- run:
name: Data race test
command: rake data_race_test
- run:
name: Coverage report
command: |
curl -s https://codecov.io/bash | bash
goveralls -coverprofile=coverage.txt -service=circle-ci -repotoken $COVERALLS_TOKEN
- run:
name: Benchmark
command: rake bench
- run:
name: Installation
command: rake install
| version: 2
jobs:
build:
docker:
- image: golang
working_directory: /go/src/github.com/cloe-lang/cloe
steps:
- checkout
- run:
name: OS Setup
command: |
apt -y update --fix-missing
apt -y install rake bundler
- run:
name: Dependencies
command: rake deps
- run:
name: Lint
command: rake lint
- run:
name: Unit test
command: rake unit_test
- run:
name: Command test
command: rake command_test
- run:
name: Performance test
command: rake performance_test
- run:
name: Data race test
command: rake data_race_test
- run:
name: Coverage report
command: |
- bash <(curl -s https://codecov.io/bash)
? ------- ^
+ curl -s https://codecov.io/bash | bash
? ^^^^^^^
goveralls -coverprofile=coverage.txt -service=circle-ci -repotoken $COVERALLS_TOKEN
- run:
name: Benchmark
command: rake bench
- run:
name: Installation
command: rake install | 2 | 0.038462 | 1 | 1 |
79a100e1d22574ef3675738ba5a303f1edebe1f5 | www/logout.php | www/logout.php | <?php
# $Id: logout.php,v 1.3 2011-10-02 18:58:36 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php');
syslog(LOG_ERROR, 'you clicked logout');
freshports_CookieClear();
syslog(LOG_ERROR, 'logging out');
if (IsSet($_COOKIE["visitor"])) {
$visitor = $_COOKIE["visitor"];
$sql = "UPDATE users SET cookie = 'nocookie' WHERE cookie = '" . pg_escape_string($_COOKIE["visitor"]) . "'";
# echo $sql;
syslog(LOG_ERROR, $sql);
$result = pg_exec($db, $sql);
if (!$result) {
syslog(LOG_ERROR, "$sql -> " . pg_errormessage());
}
}
if (IsSet($_GET['origin'])) {
$origin = $_GET['origin'];
} else {
$origin = '';
}
if ($origin == '/index.php') {
$origin = '';
}
header("Location: /$origin"); /* Redirect browser to PHP web site */
exit; /* Make sure that code below does not get executed when we redirect. */
| <?php
# $Id: logout.php,v 1.3 2011-10-02 18:58:36 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php');
freshports_CookieClear();
if (IsSet($_COOKIE["visitor"])) {
$visitor = $_COOKIE["visitor"];
$sql = "UPDATE users SET cookie = 'nocookie' WHERE cookie = '" . pg_escape_string($_COOKIE["visitor"]) . "'";
# echo $sql;
$result = pg_exec($db, $sql);
if (!$result) {
}
}
if (IsSet($_GET['origin'])) {
$origin = $_GET['origin'];
} else {
$origin = '';
}
if ($origin == '/index.php') {
$origin = '';
}
header("Location: /$origin"); /* Redirect browser to PHP web site */
exit; /* Make sure that code below does not get executed when we redirect. */
| Remove syslog entries which used an invalid first parameter. | Remove syslog entries which used an invalid first parameter.
| PHP | bsd-2-clause | FreshPorts/freshports,FreshPorts/freshports,dlangille/freshports-1,dlangille/freshports-1,dlangille/freshports-1,FreshPorts/freshports,dlangille/freshports-1,FreshPorts/freshports,dlangille/freshports-1 | php | ## Code Before:
<?php
# $Id: logout.php,v 1.3 2011-10-02 18:58:36 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php');
syslog(LOG_ERROR, 'you clicked logout');
freshports_CookieClear();
syslog(LOG_ERROR, 'logging out');
if (IsSet($_COOKIE["visitor"])) {
$visitor = $_COOKIE["visitor"];
$sql = "UPDATE users SET cookie = 'nocookie' WHERE cookie = '" . pg_escape_string($_COOKIE["visitor"]) . "'";
# echo $sql;
syslog(LOG_ERROR, $sql);
$result = pg_exec($db, $sql);
if (!$result) {
syslog(LOG_ERROR, "$sql -> " . pg_errormessage());
}
}
if (IsSet($_GET['origin'])) {
$origin = $_GET['origin'];
} else {
$origin = '';
}
if ($origin == '/index.php') {
$origin = '';
}
header("Location: /$origin"); /* Redirect browser to PHP web site */
exit; /* Make sure that code below does not get executed when we redirect. */
## Instruction:
Remove syslog entries which used an invalid first parameter.
## Code After:
<?php
# $Id: logout.php,v 1.3 2011-10-02 18:58:36 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php');
freshports_CookieClear();
if (IsSet($_COOKIE["visitor"])) {
$visitor = $_COOKIE["visitor"];
$sql = "UPDATE users SET cookie = 'nocookie' WHERE cookie = '" . pg_escape_string($_COOKIE["visitor"]) . "'";
# echo $sql;
$result = pg_exec($db, $sql);
if (!$result) {
}
}
if (IsSet($_GET['origin'])) {
$origin = $_GET['origin'];
} else {
$origin = '';
}
if ($origin == '/index.php') {
$origin = '';
}
header("Location: /$origin"); /* Redirect browser to PHP web site */
exit; /* Make sure that code below does not get executed when we redirect. */
| <?php
# $Id: logout.php,v 1.3 2011-10-02 18:58:36 dan Exp $
#
# Copyright (c) 1998-2003 DVL Software Limited
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/common.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php');
- syslog(LOG_ERROR, 'you clicked logout');
-
freshports_CookieClear();
- syslog(LOG_ERROR, 'logging out');
if (IsSet($_COOKIE["visitor"])) {
$visitor = $_COOKIE["visitor"];
$sql = "UPDATE users SET cookie = 'nocookie' WHERE cookie = '" . pg_escape_string($_COOKIE["visitor"]) . "'";
# echo $sql;
- syslog(LOG_ERROR, $sql);
$result = pg_exec($db, $sql);
if (!$result) {
- syslog(LOG_ERROR, "$sql -> " . pg_errormessage());
}
}
if (IsSet($_GET['origin'])) {
$origin = $_GET['origin'];
} else {
$origin = '';
}
if ($origin == '/index.php') {
$origin = '';
}
header("Location: /$origin"); /* Redirect browser to PHP web site */
exit; /* Make sure that code below does not get executed when we redirect. */ | 5 | 0.119048 | 0 | 5 |
8eb41d6d0c7056d9524ed6454512e1e5aab3ebac | app/assets/stylesheets/utils/_utils.scss | app/assets/stylesheets/utils/_utils.scss | @mixin color($font-color, $bg-color, $is_imp: false) {
@if $is_imp == false {
color: $font-color;
background-color: $bg-color;
} @else {
color: $font-color !important;
background-color: $bg-color !important;
}
}
//buttons
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
}
.table-cell{
display: table-cell;
} | @mixin color($font-color, $bg-color, $is_imp: false) {
@if $is_imp == false {
color: $font-color;
background-color: $bg-color;
} @else {
color: $font-color !important;
background-color: $bg-color !important;
}
}
//buttons
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
} | Move table-cell style into page layout | Move table-cell style into page layout
| SCSS | mit | trendever/bitshares-ui,trendever/bitshares-ui,trendever/bitshares-ui,trendever/bitshares-ui | scss | ## Code Before:
@mixin color($font-color, $bg-color, $is_imp: false) {
@if $is_imp == false {
color: $font-color;
background-color: $bg-color;
} @else {
color: $font-color !important;
background-color: $bg-color !important;
}
}
//buttons
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
}
.table-cell{
display: table-cell;
}
## Instruction:
Move table-cell style into page layout
## Code After:
@mixin color($font-color, $bg-color, $is_imp: false) {
@if $is_imp == false {
color: $font-color;
background-color: $bg-color;
} @else {
color: $font-color !important;
background-color: $bg-color !important;
}
}
//buttons
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
} | @mixin color($font-color, $bg-color, $is_imp: false) {
@if $is_imp == false {
color: $font-color;
background-color: $bg-color;
} @else {
color: $font-color !important;
background-color: $bg-color !important;
}
}
//buttons
@mixin button-focus($color, $bg-color, $number) {
color: lighten($color, $number);
background-color: lighten($bg-color, $number);
//not good in dark theme
//border-color: lighten($color, $number);
}
-
- .table-cell{
- display: table-cell;
- } | 4 | 0.190476 | 0 | 4 |
ef8d5112accd73d4e32d476a2b25eaef08b5f025 | metadata/net.nhiroki.bluesquarespeedometer.yml | metadata/net.nhiroki.bluesquarespeedometer.yml | Categories:
- Navigation
License: Apache-2.0
AuthorName: nhirokinet
AuthorWebSite: https://nhiroki.net/
SourceCode: https://github.com/nhirokinet/bluesquarespeedometer
IssueTracker: https://github.com/nhirokinet/bluesquarespeedometer/issues
AutoName: Blue Square Speedometer
RepoType: git
Repo: https://github.com/nhirokinet/bluesquarespeedometer
Builds:
- versionName: 0.1.0
versionCode: 1
commit: dbc516214ef4b556f2105c4b57e3f463f6112644
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 0.1.0
CurrentVersionCode: 1
| Categories:
- Navigation
License: Apache-2.0
AuthorName: nhirokinet
AuthorWebSite: https://nhiroki.net/
SourceCode: https://github.com/nhirokinet/bluesquarespeedometer
IssueTracker: https://github.com/nhirokinet/bluesquarespeedometer/issues
AutoName: Blue Square Speedometer
RepoType: git
Repo: https://github.com/nhirokinet/bluesquarespeedometer
Builds:
- versionName: 0.1.0
versionCode: 1
commit: dbc516214ef4b556f2105c4b57e3f463f6112644
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
- versionName: 0.1.1
versionCode: 2
commit: 7df55870909f61581ee2f9fd51a48e5aee32dd55
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 0.1.1
CurrentVersionCode: 2
| Update Blue Square Speedometer to 0.1.1 (2) | Update Blue Square Speedometer to 0.1.1 (2)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Navigation
License: Apache-2.0
AuthorName: nhirokinet
AuthorWebSite: https://nhiroki.net/
SourceCode: https://github.com/nhirokinet/bluesquarespeedometer
IssueTracker: https://github.com/nhirokinet/bluesquarespeedometer/issues
AutoName: Blue Square Speedometer
RepoType: git
Repo: https://github.com/nhirokinet/bluesquarespeedometer
Builds:
- versionName: 0.1.0
versionCode: 1
commit: dbc516214ef4b556f2105c4b57e3f463f6112644
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 0.1.0
CurrentVersionCode: 1
## Instruction:
Update Blue Square Speedometer to 0.1.1 (2)
## Code After:
Categories:
- Navigation
License: Apache-2.0
AuthorName: nhirokinet
AuthorWebSite: https://nhiroki.net/
SourceCode: https://github.com/nhirokinet/bluesquarespeedometer
IssueTracker: https://github.com/nhirokinet/bluesquarespeedometer/issues
AutoName: Blue Square Speedometer
RepoType: git
Repo: https://github.com/nhirokinet/bluesquarespeedometer
Builds:
- versionName: 0.1.0
versionCode: 1
commit: dbc516214ef4b556f2105c4b57e3f463f6112644
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
- versionName: 0.1.1
versionCode: 2
commit: 7df55870909f61581ee2f9fd51a48e5aee32dd55
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
CurrentVersion: 0.1.1
CurrentVersionCode: 2
| Categories:
- Navigation
License: Apache-2.0
AuthorName: nhirokinet
AuthorWebSite: https://nhiroki.net/
SourceCode: https://github.com/nhirokinet/bluesquarespeedometer
IssueTracker: https://github.com/nhirokinet/bluesquarespeedometer/issues
AutoName: Blue Square Speedometer
RepoType: git
Repo: https://github.com/nhirokinet/bluesquarespeedometer
Builds:
- versionName: 0.1.0
versionCode: 1
commit: dbc516214ef4b556f2105c4b57e3f463f6112644
subdir: app
sudo:
- apt install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
+ - versionName: 0.1.1
+ versionCode: 2
+ commit: 7df55870909f61581ee2f9fd51a48e5aee32dd55
+ subdir: app
+ sudo:
+ - apt install -y openjdk-11-jdk
+ - update-alternatives --auto java
+ gradle:
+ - yes
+
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
- CurrentVersion: 0.1.0
? ^
+ CurrentVersion: 0.1.1
? ^
- CurrentVersionCode: 1
? ^
+ CurrentVersionCode: 2
? ^
| 14 | 0.5 | 12 | 2 |
2355b5383501e705d0f4924d6a8fabf2a92917da | downloads/updates/version.js | downloads/updates/version.js | {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"development": {
"CSIDE_version": "1.3.0",
"nw_version": "0.21.4",
"desc": "v1.3.0 Feature release: User dictionary improvements, custom themes and bug fixes.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/130.zip"
},
"accessible": {
"CSIDE_version": "1.1.2",
"nw_version": "0.21.4",
"desc": "",
"target": ""
}
}
| {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"development": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"accessible": {
"CSIDE_version": "1.1.2",
"nw_version": "0.21.4",
"desc": "",
"target": ""
}
}
| Revert "Enable v1.3.0 on the development channel" | Revert "Enable v1.3.0 on the development channel"
This reverts commit a252c7d19a9149b8c1d9bc0ec4788ae1bb3c6b22.
| JavaScript | mit | ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io | javascript | ## Code Before:
{
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"development": {
"CSIDE_version": "1.3.0",
"nw_version": "0.21.4",
"desc": "v1.3.0 Feature release: User dictionary improvements, custom themes and bug fixes.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/130.zip"
},
"accessible": {
"CSIDE_version": "1.1.2",
"nw_version": "0.21.4",
"desc": "",
"target": ""
}
}
## Instruction:
Revert "Enable v1.3.0 on the development channel"
This reverts commit a252c7d19a9149b8c1d9bc0ec4788ae1bb3c6b22.
## Code After:
{
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"development": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"accessible": {
"CSIDE_version": "1.1.2",
"nw_version": "0.21.4",
"desc": "",
"target": ""
}
}
| {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"development": {
- "CSIDE_version": "1.3.0",
? ^ ^
+ "CSIDE_version": "1.2.1",
? ^ ^
"nw_version": "0.21.4",
- "desc": "v1.3.0 Feature release: User dictionary improvements, custom themes and bug fixes.",
+ "desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
- "target": "https://choicescriptide.github.io/downloads/updates/targets/130.zip"
? ^^
+ "target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
? ^^
},
"accessible": {
"CSIDE_version": "1.1.2",
"nw_version": "0.21.4",
"desc": "",
"target": ""
}
} | 6 | 0.230769 | 3 | 3 |
5eea3a9cee629468d272574bcc24358ed29e12a8 | unify/application/skeleton/unify/source/phonegap.tmpl.html | unify/application/skeleton/unify/source/phonegap.tmpl.html | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>
<title>${Name}</title>
<link rel="stylesheet" type="text/css" href="resource/${Namespace}/style.css" />
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="script/${Namespace}-webkit-False.js"></script>
</head>
<body>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>${Name}</title>
<style type="text/css">
* { box-sizing: border-box; }
</style>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="script/${Namespace}-webkit-False.js"></script>
</head>
<body>
</body>
</html>
| Change phonegap html file also to new styling | Change phonegap html file also to new styling
| HTML | mit | unify/unify,unify/unify,unify/unify,unify/unify,unify/unify,unify/unify | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>
<title>${Name}</title>
<link rel="stylesheet" type="text/css" href="resource/${Namespace}/style.css" />
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="script/${Namespace}-webkit-False.js"></script>
</head>
<body>
</body>
</html>
## Instruction:
Change phonegap html file also to new styling
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>${Name}</title>
<style type="text/css">
* { box-sizing: border-box; }
</style>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="script/${Namespace}-webkit-False.js"></script>
</head>
<body>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
? --
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>
? - -
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>${Name}</title>
- <link rel="stylesheet" type="text/css" href="resource/${Namespace}/style.css" />
+ <style type="text/css">
+ * { box-sizing: border-box; }
+ </style>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="script/${Namespace}-webkit-False.js"></script>
</head>
<body>
</body>
</html> | 8 | 0.615385 | 5 | 3 |
0b05ae7d0ecf4180630e329a7d2510c5a2619553 | vagrant/debian/setup-dummy.sh | vagrant/debian/setup-dummy.sh |
rm -rf /etc/openxpki/ssl/
if [ -x /opt/myperl/bin/openxpkiadm ]; then
export PATH=/opt/myperl/bin:$PATH
fi
echo "
DROP database if exists openxpki;
CREATE database openxpki CHARSET utf8;
CREATE USER 'openxpki'@'localhost' IDENTIFIED BY 'openxpki';
GRANT ALL ON openxpki.* TO 'openxpki'@'localhost';
flush privileges;" | mysql -u root
if [ -d /opt/myperl/share/examples/ ]; then
BASE=/opt/myperl/share/examples
else
BASE=/usr/share/doc/libopenxpki-perl/examples
fi
# same for SQL dump
if [ -f "$BASE/schema-mysql.sql.gz" ]; then
zcat "$BASE/schema-mysql.sql.gz" | mysql -u root openxpki
else
mysql -u root openxpki < "$BASE/schema-mysql.sql"
fi
# example script might be packed or not
if [ -f "$BASE/sampleconfig.sh.gz" ]; then
zcat "$BASE/sampleconfig.sh.gz" | /bin/bash
else
/bin/bash "$BASE/sampleconfig.sh"
fi
# Need to pickup new group
/etc/init.d/apache2 restart
# Start
openxpkictl start
|
rm -rf /etc/openxpki/ssl/
if [ -x /opt/myperl/bin/openxpkiadm ]; then
export PATH=/opt/myperl/bin:$PATH
fi
echo "
DROP database if exists openxpki;
CREATE database openxpki CHARSET utf8;
CREATE USER 'openxpki'@'localhost' IDENTIFIED BY 'openxpki';
GRANT ALL ON openxpki.* TO 'openxpki'@'localhost';
CREATE USER 'openxpki_session'@'localhost' IDENTIFIED BY 'mysecret';
GRANT SELECT, INSERT, UPDATE, DELETE ON openxpki.frontend_session TO 'openxpki_session'@'localhost';
flush privileges;" | mysql -u root
if [ -d /opt/myperl/share/examples/ ]; then
BASE=/opt/myperl/share/examples
else
BASE=/usr/share/doc/libopenxpki-perl/examples
fi
# same for SQL dump
if [ -f "$BASE/schema-mysql.sql.gz" ]; then
zcat "$BASE/schema-mysql.sql.gz" | mysql -u root openxpki
else
mysql -u root openxpki < "$BASE/schema-mysql.sql"
fi
# example script might be packed or not
if [ -f "$BASE/sampleconfig.sh.gz" ]; then
zcat "$BASE/sampleconfig.sh.gz" | /bin/bash
else
/bin/bash "$BASE/sampleconfig.sh"
fi
# Need to pickup new group
/etc/init.d/apache2 restart
# Start
openxpkictl start
| Create session user in vagrant setup script | Create session user in vagrant setup script
| Shell | apache-2.0 | openxpki/openxpki,openxpki/openxpki,oliwel/openxpki,oliwel/openxpki,oliwel/openxpki,oliwel/openxpki,openxpki/openxpki,openxpki/openxpki,oliwel/openxpki,oliwel/openxpki | shell | ## Code Before:
rm -rf /etc/openxpki/ssl/
if [ -x /opt/myperl/bin/openxpkiadm ]; then
export PATH=/opt/myperl/bin:$PATH
fi
echo "
DROP database if exists openxpki;
CREATE database openxpki CHARSET utf8;
CREATE USER 'openxpki'@'localhost' IDENTIFIED BY 'openxpki';
GRANT ALL ON openxpki.* TO 'openxpki'@'localhost';
flush privileges;" | mysql -u root
if [ -d /opt/myperl/share/examples/ ]; then
BASE=/opt/myperl/share/examples
else
BASE=/usr/share/doc/libopenxpki-perl/examples
fi
# same for SQL dump
if [ -f "$BASE/schema-mysql.sql.gz" ]; then
zcat "$BASE/schema-mysql.sql.gz" | mysql -u root openxpki
else
mysql -u root openxpki < "$BASE/schema-mysql.sql"
fi
# example script might be packed or not
if [ -f "$BASE/sampleconfig.sh.gz" ]; then
zcat "$BASE/sampleconfig.sh.gz" | /bin/bash
else
/bin/bash "$BASE/sampleconfig.sh"
fi
# Need to pickup new group
/etc/init.d/apache2 restart
# Start
openxpkictl start
## Instruction:
Create session user in vagrant setup script
## Code After:
rm -rf /etc/openxpki/ssl/
if [ -x /opt/myperl/bin/openxpkiadm ]; then
export PATH=/opt/myperl/bin:$PATH
fi
echo "
DROP database if exists openxpki;
CREATE database openxpki CHARSET utf8;
CREATE USER 'openxpki'@'localhost' IDENTIFIED BY 'openxpki';
GRANT ALL ON openxpki.* TO 'openxpki'@'localhost';
CREATE USER 'openxpki_session'@'localhost' IDENTIFIED BY 'mysecret';
GRANT SELECT, INSERT, UPDATE, DELETE ON openxpki.frontend_session TO 'openxpki_session'@'localhost';
flush privileges;" | mysql -u root
if [ -d /opt/myperl/share/examples/ ]; then
BASE=/opt/myperl/share/examples
else
BASE=/usr/share/doc/libopenxpki-perl/examples
fi
# same for SQL dump
if [ -f "$BASE/schema-mysql.sql.gz" ]; then
zcat "$BASE/schema-mysql.sql.gz" | mysql -u root openxpki
else
mysql -u root openxpki < "$BASE/schema-mysql.sql"
fi
# example script might be packed or not
if [ -f "$BASE/sampleconfig.sh.gz" ]; then
zcat "$BASE/sampleconfig.sh.gz" | /bin/bash
else
/bin/bash "$BASE/sampleconfig.sh"
fi
# Need to pickup new group
/etc/init.d/apache2 restart
# Start
openxpkictl start
|
rm -rf /etc/openxpki/ssl/
if [ -x /opt/myperl/bin/openxpkiadm ]; then
export PATH=/opt/myperl/bin:$PATH
fi
- echo "
? -
+ echo "
DROP database if exists openxpki;
CREATE database openxpki CHARSET utf8;
CREATE USER 'openxpki'@'localhost' IDENTIFIED BY 'openxpki';
GRANT ALL ON openxpki.* TO 'openxpki'@'localhost';
+ CREATE USER 'openxpki_session'@'localhost' IDENTIFIED BY 'mysecret';
+ GRANT SELECT, INSERT, UPDATE, DELETE ON openxpki.frontend_session TO 'openxpki_session'@'localhost';
flush privileges;" | mysql -u root
if [ -d /opt/myperl/share/examples/ ]; then
BASE=/opt/myperl/share/examples
else
BASE=/usr/share/doc/libopenxpki-perl/examples
fi
# same for SQL dump
if [ -f "$BASE/schema-mysql.sql.gz" ]; then
zcat "$BASE/schema-mysql.sql.gz" | mysql -u root openxpki
else
mysql -u root openxpki < "$BASE/schema-mysql.sql"
fi
# example script might be packed or not
if [ -f "$BASE/sampleconfig.sh.gz" ]; then
- zcat "$BASE/sampleconfig.sh.gz" | /bin/bash
? --
+ zcat "$BASE/sampleconfig.sh.gz" | /bin/bash
else
/bin/bash "$BASE/sampleconfig.sh"
fi
# Need to pickup new group
/etc/init.d/apache2 restart
# Start
openxpkictl start | 6 | 0.153846 | 4 | 2 |
631977019821deb26edd6fee5147be5e25872216 | src/generators/textStyle.js | src/generators/textStyle.js | import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'italic': { 'font-style': 'italic' },
'normal': { 'font-style': 'normal' },
'uppercase': { 'text-transform': 'uppercase' },
'lowercase': { 'text-transform': 'lowercase' },
'capitalize': { 'text-transform': 'capitalize' },
'transform-none': { 'text-transform': 'none' },
'underline': { 'text-decoration': 'underline' },
'line-through': { 'text-decoration': 'line-through' },
'decoration-none': { 'text-decoration': 'none' },
'antialiased': {
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale'
},
})
}
| import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'italic': { 'font-style': 'italic' },
'not-italic': { 'font-style': 'normal' },
'uppercase': { 'text-transform': 'uppercase' },
'lowercase': { 'text-transform': 'lowercase' },
'capitalize': { 'text-transform': 'capitalize' },
'normal-case': { 'text-transform': 'none' },
'underline': { 'text-decoration': 'underline' },
'line-through': { 'text-decoration': 'line-through' },
'no-underline': { 'text-decoration': 'none' },
'antialiased': {
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale'
},
'subpixel-antialiased': {
'-webkit-font-smoothing': 'auto',
'-moz-osx-font-smoothing': 'auto'
}
})
}
| Use more human names for text style utilities | Use more human names for text style utilities
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss,tailwindlabs/tailwindcss | javascript | ## Code Before:
import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'italic': { 'font-style': 'italic' },
'normal': { 'font-style': 'normal' },
'uppercase': { 'text-transform': 'uppercase' },
'lowercase': { 'text-transform': 'lowercase' },
'capitalize': { 'text-transform': 'capitalize' },
'transform-none': { 'text-transform': 'none' },
'underline': { 'text-decoration': 'underline' },
'line-through': { 'text-decoration': 'line-through' },
'decoration-none': { 'text-decoration': 'none' },
'antialiased': {
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale'
},
})
}
## Instruction:
Use more human names for text style utilities
## Code After:
import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'italic': { 'font-style': 'italic' },
'not-italic': { 'font-style': 'normal' },
'uppercase': { 'text-transform': 'uppercase' },
'lowercase': { 'text-transform': 'lowercase' },
'capitalize': { 'text-transform': 'capitalize' },
'normal-case': { 'text-transform': 'none' },
'underline': { 'text-decoration': 'underline' },
'line-through': { 'text-decoration': 'line-through' },
'no-underline': { 'text-decoration': 'none' },
'antialiased': {
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale'
},
'subpixel-antialiased': {
'-webkit-font-smoothing': 'auto',
'-moz-osx-font-smoothing': 'auto'
}
})
}
| import defineClasses from '../util/defineClasses'
export default function() {
return defineClasses({
'italic': { 'font-style': 'italic' },
- 'normal': { 'font-style': 'normal' },
? ^^
+ 'not-italic': { 'font-style': 'normal' },
? ^^^^ ++
+
'uppercase': { 'text-transform': 'uppercase' },
'lowercase': { 'text-transform': 'lowercase' },
'capitalize': { 'text-transform': 'capitalize' },
- 'transform-none': { 'text-transform': 'none' },
? --- -- ^^^
+ 'normal-case': { 'text-transform': 'none' },
? ++ ^^^
+
'underline': { 'text-decoration': 'underline' },
'line-through': { 'text-decoration': 'line-through' },
- 'decoration-none': { 'text-decoration': 'none' },
? -- ^^ -----
+ 'no-underline': { 'text-decoration': 'none' },
? +++++ ^
+
'antialiased': {
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale'
},
+ 'subpixel-antialiased': {
+ '-webkit-font-smoothing': 'auto',
+ '-moz-osx-font-smoothing': 'auto'
+ }
})
} | 13 | 0.684211 | 10 | 3 |
84829640afc478d1717418895b8872e2a6ee4e25 | .travis.yml | .travis.yml | language: go
go:
- 1.4
install:
- go get -u github.com/c-fs/Jerasure
- go get -u github.com/BurntSushi/toml
- go get -u github.com/qiniu/log
- go get -u github.com/spf13/cobra
- go get -u golang.org/x/net/context
- go get -u github.com/codahale/metrics
- go get -u google.golang.org/grpc
- curl -o cadvisor-0.16.0.1.zip https://codeload.github.com/google/cadvisor/zip/0.16.0.1
- unzip cadvisor-0.16.0.1.zip >/dev/null
- mkdir -p "$GOPATH/src/github.com/google"
- mv cadvisor-0.16.0.1 "$GOPATH/src/github.com/google/cadvisor"
- export GOPATH="$GOPATH:$GOPATH/src/github.com/google/cadvisor/Godeps/_workspace"
script:
- make test
| language: go
go:
- 1.4
install:
- go get -u github.com/c-fs/Jerasure
- go get -u github.com/BurntSushi/toml
- go get -u github.com/qiniu/log
- go get -u github.com/spf13/cobra
- go get -u golang.org/x/net/context
- go get -u github.com/codahale/metrics
- go get -u github.com/influxdb/influxdb/client
- go get -u google.golang.org/grpc
- curl -o cadvisor-0.16.0.1.zip https://codeload.github.com/google/cadvisor/zip/0.16.0.1
- unzip cadvisor-0.16.0.1.zip >/dev/null
- mkdir -p "$GOPATH/src/github.com/google"
- mv cadvisor-0.16.0.1 "$GOPATH/src/github.com/google/cadvisor"
- export GOPATH="$GOPATH:$GOPATH/src/github.com/google/cadvisor/Godeps/_workspace"
script:
- make test
| Add go get github.com/influxdb/influxdb/client for ci. | Add go get github.com/influxdb/influxdb/client for ci.
| YAML | apache-2.0 | c-fs/cfs,wangtuanjie/cfs,c-fs/cfs,wangtuanjie/cfs | yaml | ## Code Before:
language: go
go:
- 1.4
install:
- go get -u github.com/c-fs/Jerasure
- go get -u github.com/BurntSushi/toml
- go get -u github.com/qiniu/log
- go get -u github.com/spf13/cobra
- go get -u golang.org/x/net/context
- go get -u github.com/codahale/metrics
- go get -u google.golang.org/grpc
- curl -o cadvisor-0.16.0.1.zip https://codeload.github.com/google/cadvisor/zip/0.16.0.1
- unzip cadvisor-0.16.0.1.zip >/dev/null
- mkdir -p "$GOPATH/src/github.com/google"
- mv cadvisor-0.16.0.1 "$GOPATH/src/github.com/google/cadvisor"
- export GOPATH="$GOPATH:$GOPATH/src/github.com/google/cadvisor/Godeps/_workspace"
script:
- make test
## Instruction:
Add go get github.com/influxdb/influxdb/client for ci.
## Code After:
language: go
go:
- 1.4
install:
- go get -u github.com/c-fs/Jerasure
- go get -u github.com/BurntSushi/toml
- go get -u github.com/qiniu/log
- go get -u github.com/spf13/cobra
- go get -u golang.org/x/net/context
- go get -u github.com/codahale/metrics
- go get -u github.com/influxdb/influxdb/client
- go get -u google.golang.org/grpc
- curl -o cadvisor-0.16.0.1.zip https://codeload.github.com/google/cadvisor/zip/0.16.0.1
- unzip cadvisor-0.16.0.1.zip >/dev/null
- mkdir -p "$GOPATH/src/github.com/google"
- mv cadvisor-0.16.0.1 "$GOPATH/src/github.com/google/cadvisor"
- export GOPATH="$GOPATH:$GOPATH/src/github.com/google/cadvisor/Godeps/_workspace"
script:
- make test
| language: go
go:
- 1.4
install:
- go get -u github.com/c-fs/Jerasure
- go get -u github.com/BurntSushi/toml
- go get -u github.com/qiniu/log
- go get -u github.com/spf13/cobra
- go get -u golang.org/x/net/context
- go get -u github.com/codahale/metrics
+ - go get -u github.com/influxdb/influxdb/client
- go get -u google.golang.org/grpc
- curl -o cadvisor-0.16.0.1.zip https://codeload.github.com/google/cadvisor/zip/0.16.0.1
- unzip cadvisor-0.16.0.1.zip >/dev/null
- mkdir -p "$GOPATH/src/github.com/google"
- mv cadvisor-0.16.0.1 "$GOPATH/src/github.com/google/cadvisor"
- export GOPATH="$GOPATH:$GOPATH/src/github.com/google/cadvisor/Godeps/_workspace"
script:
- - make test
+ - make test
? +
| 3 | 0.142857 | 2 | 1 |
731909a26785f1eb0863ab85bfa3b3f5312db690 | .esdoc.json | .esdoc.json | {
"source": "src",
"destination": "docs/docs",
"plugins": [{
"name": "esdoc-standard-plugin",
"option": {
"lint": {"enable": false}
}
}]
}
| {
"source": "src",
"destination": "docs/docs",
"plugins": [{
"name": "esdoc-standard-plugin",
"option": {
"lint": {"enable": false},
"accessor": {
"access": ["public", "protected"],
"autoPrivate": true
}
}
}]
}
| Remove provate members from auto-generated documentation | Remove provate members from auto-generated documentation
| JSON | mit | koalyptus/TableFilter,koalyptus/TableFilter | json | ## Code Before:
{
"source": "src",
"destination": "docs/docs",
"plugins": [{
"name": "esdoc-standard-plugin",
"option": {
"lint": {"enable": false}
}
}]
}
## Instruction:
Remove provate members from auto-generated documentation
## Code After:
{
"source": "src",
"destination": "docs/docs",
"plugins": [{
"name": "esdoc-standard-plugin",
"option": {
"lint": {"enable": false},
"accessor": {
"access": ["public", "protected"],
"autoPrivate": true
}
}
}]
}
| {
"source": "src",
"destination": "docs/docs",
"plugins": [{
"name": "esdoc-standard-plugin",
"option": {
- "lint": {"enable": false}
+ "lint": {"enable": false},
? +
+ "accessor": {
+ "access": ["public", "protected"],
+ "autoPrivate": true
+ }
}
}]
} | 6 | 0.6 | 5 | 1 |
d2f1b9311b546c079490e5f0bdb45b9c9d570bb1 | system/test_coupling_fields.py | system/test_coupling_fields.py |
from __future__ import print_function
import os
import netCDF4 as nc
from model_test_helper import ModelTestHelper
class TestCouplingFields(ModelTestHelper):
def __init__(self):
super(TestCouplingFields, self).__init__()
def test_swflx(self):
"""
Compare short wave flux over a geographic area between low and hi res
models.
"""
hi_fields = os.path.join(self.paths['cm_1440x1080-test']['output'], 'ice',
'fields_a2i_in_ice.nc')
lo_fields = os.path.join(self.paths['cm_360x300-test']['output'], 'ice',
'fields_a2i_in_ice.nc')
f_hi = nc.Dataset(hi_fields)
f_hi.close()
f_lo = nc.Dataset(lo_fields)
f_lo.close()
|
from __future__ import print_function
import os
import netCDF4 as nc
from model_test_helper import ModelTestHelper
class TestCouplingFields(ModelTestHelper):
def __init__(self):
super(TestCouplingFields, self).__init__()
def test_swflx(self):
"""
Compare short wave flux over a geographic area between low and hi res
models.
"""
hi_paths = self.make_paths('cm_1440x1080-test')
lo_paths = self.make_paths('cm_360x300-test')
hi_fields = os.path.join(hi_paths['output'], 'ice',
'fields_a2i_in_ice.nc')
lo_fields = os.path.join(lo_paths['output'], 'ice',
'fields_a2i_in_ice.nc')
f_hi = nc.Dataset(hi_fields)
f_hi.close()
f_lo = nc.Dataset(lo_fields)
f_lo.close()
| Fix up paths in system test. | Fix up paths in system test.
| Python | apache-2.0 | CWSL/access-om | python | ## Code Before:
from __future__ import print_function
import os
import netCDF4 as nc
from model_test_helper import ModelTestHelper
class TestCouplingFields(ModelTestHelper):
def __init__(self):
super(TestCouplingFields, self).__init__()
def test_swflx(self):
"""
Compare short wave flux over a geographic area between low and hi res
models.
"""
hi_fields = os.path.join(self.paths['cm_1440x1080-test']['output'], 'ice',
'fields_a2i_in_ice.nc')
lo_fields = os.path.join(self.paths['cm_360x300-test']['output'], 'ice',
'fields_a2i_in_ice.nc')
f_hi = nc.Dataset(hi_fields)
f_hi.close()
f_lo = nc.Dataset(lo_fields)
f_lo.close()
## Instruction:
Fix up paths in system test.
## Code After:
from __future__ import print_function
import os
import netCDF4 as nc
from model_test_helper import ModelTestHelper
class TestCouplingFields(ModelTestHelper):
def __init__(self):
super(TestCouplingFields, self).__init__()
def test_swflx(self):
"""
Compare short wave flux over a geographic area between low and hi res
models.
"""
hi_paths = self.make_paths('cm_1440x1080-test')
lo_paths = self.make_paths('cm_360x300-test')
hi_fields = os.path.join(hi_paths['output'], 'ice',
'fields_a2i_in_ice.nc')
lo_fields = os.path.join(lo_paths['output'], 'ice',
'fields_a2i_in_ice.nc')
f_hi = nc.Dataset(hi_fields)
f_hi.close()
f_lo = nc.Dataset(lo_fields)
f_lo.close()
|
from __future__ import print_function
import os
import netCDF4 as nc
from model_test_helper import ModelTestHelper
class TestCouplingFields(ModelTestHelper):
def __init__(self):
super(TestCouplingFields, self).__init__()
def test_swflx(self):
"""
Compare short wave flux over a geographic area between low and hi res
models.
"""
+ hi_paths = self.make_paths('cm_1440x1080-test')
+ lo_paths = self.make_paths('cm_360x300-test')
+
- hi_fields = os.path.join(self.paths['cm_1440x1080-test']['output'], 'ice',
? ^^^^^ ---------------------
+ hi_fields = os.path.join(hi_paths['output'], 'ice',
? ^^^
'fields_a2i_in_ice.nc')
- lo_fields = os.path.join(self.paths['cm_360x300-test']['output'], 'ice',
? -- ^^ -------------------
+ lo_fields = os.path.join(lo_paths['output'], 'ice',
? ^^
'fields_a2i_in_ice.nc')
f_hi = nc.Dataset(hi_fields)
f_hi.close()
f_lo = nc.Dataset(lo_fields)
f_lo.close() | 7 | 0.259259 | 5 | 2 |
629bea96ff1e9ee7d5eba61bc395188585ee4a9c | bin/deploy.sh | bin/deploy.sh | set -e
SERVICE_NAME="weblab/fillo"
DOCKER_REGISTRY="141759028186.dkr.ecr.us-east-1.amazonaws.com/$SERVICE_NAME"
# Get Docker Registry login token
eval "$(aws ecr get-login)"
# Get new version
SERVICE_VERSION=`node -e 'console.log(require("./package.json").version)'`
# Build docker image
docker build -t $SERVICE_NAME .
# Tag docker container
docker tag $SERVICE_NAME:latest $DOCKER_REGISTRY:$SERVICE_VERSION
# Push to new tag to private Docker Registry
docker push $DOCKER_REGISTRY:$SERVICE_VERSION
# Deploy to servers
servers=$(echo $SERVERS | tr ':' "\n")
for server in "${servers[@]}"
do
ssh ec2-user@$server << EOF
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
docker pull $DOCKER_REGISTRY:$SERVICE_VERSION
docker stop $SERVICE_NAME
docker rm -f $SERVICE_NAME
docker run -d \
--restart=always \
-e MONGO_URI=$MONGO_URI \
-p 5002:3000 \
--name $SERVICE_NAME \
-e DOCKER_HOST=tcp://$IP:4000 \
$DOCKER_REGISTRY:$SERVICE_VERSION
EOF
done
| set -e
SERVICE_NAME="weblab/fillo"
DOCKER_REGISTRY="141759028186.dkr.ecr.us-east-1.amazonaws.com/$SERVICE_NAME"
# Get Docker Registry login token
eval "$(aws ecr get-login --region us-east-1)"
# Get new version
SERVICE_VERSION=`node -e 'console.log(require("./package.json").version)'`
# Build docker image
docker build -t $SERVICE_NAME .
# Tag docker container
docker tag $SERVICE_NAME:latest $DOCKER_REGISTRY:$SERVICE_VERSION
# Push to new tag to private Docker Registry
docker push $DOCKER_REGISTRY:$SERVICE_VERSION
# Deploy to servers
servers=$(echo $SERVERS | tr ':' "\n")
for server in "${servers[@]}"
do
ssh ec2-user@$server << EOF
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
docker pull $DOCKER_REGISTRY:$SERVICE_VERSION
docker stop $SERVICE_NAME
docker rm -f $SERVICE_NAME
docker run -d \
--restart=always \
-e MONGO_URI=$MONGO_URI \
-p 5002:3000 \
--name $SERVICE_NAME \
-e DOCKER_HOST=tcp://$IP:4000 \
$DOCKER_REGISTRY:$SERVICE_VERSION
EOF
done
| Add default region for aws ecr | [Infra] Add default region for aws ecr
| Shell | mit | weblabhq/fillo,weblabhq/fillo | shell | ## Code Before:
set -e
SERVICE_NAME="weblab/fillo"
DOCKER_REGISTRY="141759028186.dkr.ecr.us-east-1.amazonaws.com/$SERVICE_NAME"
# Get Docker Registry login token
eval "$(aws ecr get-login)"
# Get new version
SERVICE_VERSION=`node -e 'console.log(require("./package.json").version)'`
# Build docker image
docker build -t $SERVICE_NAME .
# Tag docker container
docker tag $SERVICE_NAME:latest $DOCKER_REGISTRY:$SERVICE_VERSION
# Push to new tag to private Docker Registry
docker push $DOCKER_REGISTRY:$SERVICE_VERSION
# Deploy to servers
servers=$(echo $SERVERS | tr ':' "\n")
for server in "${servers[@]}"
do
ssh ec2-user@$server << EOF
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
docker pull $DOCKER_REGISTRY:$SERVICE_VERSION
docker stop $SERVICE_NAME
docker rm -f $SERVICE_NAME
docker run -d \
--restart=always \
-e MONGO_URI=$MONGO_URI \
-p 5002:3000 \
--name $SERVICE_NAME \
-e DOCKER_HOST=tcp://$IP:4000 \
$DOCKER_REGISTRY:$SERVICE_VERSION
EOF
done
## Instruction:
[Infra] Add default region for aws ecr
## Code After:
set -e
SERVICE_NAME="weblab/fillo"
DOCKER_REGISTRY="141759028186.dkr.ecr.us-east-1.amazonaws.com/$SERVICE_NAME"
# Get Docker Registry login token
eval "$(aws ecr get-login --region us-east-1)"
# Get new version
SERVICE_VERSION=`node -e 'console.log(require("./package.json").version)'`
# Build docker image
docker build -t $SERVICE_NAME .
# Tag docker container
docker tag $SERVICE_NAME:latest $DOCKER_REGISTRY:$SERVICE_VERSION
# Push to new tag to private Docker Registry
docker push $DOCKER_REGISTRY:$SERVICE_VERSION
# Deploy to servers
servers=$(echo $SERVERS | tr ':' "\n")
for server in "${servers[@]}"
do
ssh ec2-user@$server << EOF
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
docker pull $DOCKER_REGISTRY:$SERVICE_VERSION
docker stop $SERVICE_NAME
docker rm -f $SERVICE_NAME
docker run -d \
--restart=always \
-e MONGO_URI=$MONGO_URI \
-p 5002:3000 \
--name $SERVICE_NAME \
-e DOCKER_HOST=tcp://$IP:4000 \
$DOCKER_REGISTRY:$SERVICE_VERSION
EOF
done
| set -e
SERVICE_NAME="weblab/fillo"
DOCKER_REGISTRY="141759028186.dkr.ecr.us-east-1.amazonaws.com/$SERVICE_NAME"
# Get Docker Registry login token
- eval "$(aws ecr get-login)"
+ eval "$(aws ecr get-login --region us-east-1)"
# Get new version
SERVICE_VERSION=`node -e 'console.log(require("./package.json").version)'`
# Build docker image
docker build -t $SERVICE_NAME .
# Tag docker container
docker tag $SERVICE_NAME:latest $DOCKER_REGISTRY:$SERVICE_VERSION
# Push to new tag to private Docker Registry
docker push $DOCKER_REGISTRY:$SERVICE_VERSION
# Deploy to servers
servers=$(echo $SERVERS | tr ':' "\n")
for server in "${servers[@]}"
do
ssh ec2-user@$server << EOF
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
docker pull $DOCKER_REGISTRY:$SERVICE_VERSION
docker stop $SERVICE_NAME
docker rm -f $SERVICE_NAME
docker run -d \
--restart=always \
-e MONGO_URI=$MONGO_URI \
-p 5002:3000 \
--name $SERVICE_NAME \
-e DOCKER_HOST=tcp://$IP:4000 \
$DOCKER_REGISTRY:$SERVICE_VERSION
EOF
done | 2 | 0.052632 | 1 | 1 |
6355ee5c326b2bc4a756ca5442fdc7e9235ccc15 | packages/ph/phonetic-languages-simplified-generalized-properties-array.yaml | packages/ph/phonetic-languages-simplified-generalized-properties-array.yaml | homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array
changelog-type: markdown
hash: 9c5f66728ee6481f93cfe6907bc68879c6b3255ca372b7ab6e3692f0c00505b3
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Generalization of the functionality of the phonetic-languages-simplified-properties-array.
changelog: "# Revision history for phonetic-languages-simplified-generalized-properties-array\n\n##
0.1.0.0 -- 2021-05-04\n\n* First version. Released on an unsuspecting world. \n"
basic-deps:
phonetic-languages-rhythmicity: '>=0.2 && <1'
base: '>=4.8 && <4.15'
phonetic-languages-simplified-base: '>=0.2 && <1'
phonetic-languages-phonetics-basics: '>=0.6.0.1 && <1'
all-versions:
- 0.1.0.0
author: Oleksandr Zhabenko
latest: 0.1.0.0
description-type: haddock
description: Is intended to be used with the general phonetic languages approach.
license-name: MIT
| homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array
changelog-type: markdown
hash: 7a923986718a4ecedeb279282f726f79fc1fee256a712571a6b7b2b98c513e28
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Generalization of the functionality of the phonetic-languages-simplified-properties-array.
changelog: "# Revision history for phonetic-languages-simplified-generalized-properties-array\n\n##
0.1.0.0 -- 2021-05-04\n\n* First version. Released on an unsuspecting world. \n\n##
0.1.0.1 -- 2021-05-06\n\n* First version revised A. Some code improvements.\n"
basic-deps:
phonetic-languages-rhythmicity: '>=0.2 && <1'
base: '>=4.8 && <4.15'
phonetic-languages-simplified-base: '>=0.2 && <1'
phonetic-languages-phonetics-basics: '>=0.6.0.1 && <1'
all-versions:
- 0.1.0.1
author: Oleksandr Zhabenko
latest: 0.1.0.1
description-type: haddock
description: Is intended to be used with the general phonetic languages approach.
license-name: MIT
| Update from Hackage at 2021-05-05T22:45:59Z | Update from Hackage at 2021-05-05T22:45:59Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array
changelog-type: markdown
hash: 9c5f66728ee6481f93cfe6907bc68879c6b3255ca372b7ab6e3692f0c00505b3
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Generalization of the functionality of the phonetic-languages-simplified-properties-array.
changelog: "# Revision history for phonetic-languages-simplified-generalized-properties-array\n\n##
0.1.0.0 -- 2021-05-04\n\n* First version. Released on an unsuspecting world. \n"
basic-deps:
phonetic-languages-rhythmicity: '>=0.2 && <1'
base: '>=4.8 && <4.15'
phonetic-languages-simplified-base: '>=0.2 && <1'
phonetic-languages-phonetics-basics: '>=0.6.0.1 && <1'
all-versions:
- 0.1.0.0
author: Oleksandr Zhabenko
latest: 0.1.0.0
description-type: haddock
description: Is intended to be used with the general phonetic languages approach.
license-name: MIT
## Instruction:
Update from Hackage at 2021-05-05T22:45:59Z
## Code After:
homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array
changelog-type: markdown
hash: 7a923986718a4ecedeb279282f726f79fc1fee256a712571a6b7b2b98c513e28
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Generalization of the functionality of the phonetic-languages-simplified-properties-array.
changelog: "# Revision history for phonetic-languages-simplified-generalized-properties-array\n\n##
0.1.0.0 -- 2021-05-04\n\n* First version. Released on an unsuspecting world. \n\n##
0.1.0.1 -- 2021-05-06\n\n* First version revised A. Some code improvements.\n"
basic-deps:
phonetic-languages-rhythmicity: '>=0.2 && <1'
base: '>=4.8 && <4.15'
phonetic-languages-simplified-base: '>=0.2 && <1'
phonetic-languages-phonetics-basics: '>=0.6.0.1 && <1'
all-versions:
- 0.1.0.1
author: Oleksandr Zhabenko
latest: 0.1.0.1
description-type: haddock
description: Is intended to be used with the general phonetic languages approach.
license-name: MIT
| homepage: https://hackage.haskell.org/package/phonetic-languages-simplified-generalized-properties-array
changelog-type: markdown
- hash: 9c5f66728ee6481f93cfe6907bc68879c6b3255ca372b7ab6e3692f0c00505b3
+ hash: 7a923986718a4ecedeb279282f726f79fc1fee256a712571a6b7b2b98c513e28
test-bench-deps: {}
maintainer: olexandr543@yahoo.com
synopsis: Generalization of the functionality of the phonetic-languages-simplified-properties-array.
changelog: "# Revision history for phonetic-languages-simplified-generalized-properties-array\n\n##
- 0.1.0.0 -- 2021-05-04\n\n* First version. Released on an unsuspecting world. \n"
? ^
+ 0.1.0.0 -- 2021-05-04\n\n* First version. Released on an unsuspecting world. \n\n##
? ^^^^
+ 0.1.0.1 -- 2021-05-06\n\n* First version revised A. Some code improvements.\n"
basic-deps:
phonetic-languages-rhythmicity: '>=0.2 && <1'
base: '>=4.8 && <4.15'
phonetic-languages-simplified-base: '>=0.2 && <1'
phonetic-languages-phonetics-basics: '>=0.6.0.1 && <1'
all-versions:
- - 0.1.0.0
? ^
+ - 0.1.0.1
? ^
author: Oleksandr Zhabenko
- latest: 0.1.0.0
? ^
+ latest: 0.1.0.1
? ^
description-type: haddock
description: Is intended to be used with the general phonetic languages approach.
license-name: MIT | 9 | 0.45 | 5 | 4 |
71e969919e3550f760b534fe3b5b8972769e0b6a | .scripts/publish-to-sonatype.sh | .scripts/publish-to-sonatype.sh |
if [ "$TRAVIS_REPO_SLUG" == "testinfected/molecule" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
if [[ $(gradle -q version) != *SNAPSHOT* ]]; then
echo 'Travis will only publish snapshots. instance.'
exit 0
fi
echo -e "Publishing to Sonatype OSS Maven Repository...\n"
gradle uploadArchives -PnexusUsername="${SONATYPE_USERNAME}" -PnexusPassword="${SONATYPE_PASSWORD}"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo -e '\nPublished!'
exit 0
else
echo -e '\nPublish failed.'
exit 1
fi
fi |
if [ "$TRAVIS_REPO_SLUG" == "testinfected/molecule" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
if [[ $(gradle -q version) != *SNAPSHOT* ]]; then
echo 'Travis will only publish snapshots.'
exit 0
fi
echo -e "Publishing to Sonatype OSS Maven Repository..."
gradle uploadArchives -PnexusUsername="${SONATYPE_USERNAME}" -PnexusPassword="${SONATYPE_PASSWORD}"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo -e '\nPublished!'
exit 0
else
echo -e '\nPublication failed.'
exit 1
fi
fi | Fix typo in publish script | Fix typo in publish script
| Shell | mit | testinfected/molecule,ensonik/molecule,ensonik/molecule,testinfected/molecule,testinfected/molecule,ensonik/molecule,testinfected/molecule,testinfected/molecule,ensonik/molecule,ensonik/molecule | shell | ## Code Before:
if [ "$TRAVIS_REPO_SLUG" == "testinfected/molecule" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
if [[ $(gradle -q version) != *SNAPSHOT* ]]; then
echo 'Travis will only publish snapshots. instance.'
exit 0
fi
echo -e "Publishing to Sonatype OSS Maven Repository...\n"
gradle uploadArchives -PnexusUsername="${SONATYPE_USERNAME}" -PnexusPassword="${SONATYPE_PASSWORD}"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo -e '\nPublished!'
exit 0
else
echo -e '\nPublish failed.'
exit 1
fi
fi
## Instruction:
Fix typo in publish script
## Code After:
if [ "$TRAVIS_REPO_SLUG" == "testinfected/molecule" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
if [[ $(gradle -q version) != *SNAPSHOT* ]]; then
echo 'Travis will only publish snapshots.'
exit 0
fi
echo -e "Publishing to Sonatype OSS Maven Repository..."
gradle uploadArchives -PnexusUsername="${SONATYPE_USERNAME}" -PnexusPassword="${SONATYPE_PASSWORD}"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo -e '\nPublished!'
exit 0
else
echo -e '\nPublication failed.'
exit 1
fi
fi |
if [ "$TRAVIS_REPO_SLUG" == "testinfected/molecule" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
if [[ $(gradle -q version) != *SNAPSHOT* ]]; then
- echo 'Travis will only publish snapshots. instance.'
? ----------
+ echo 'Travis will only publish snapshots.'
exit 0
fi
- echo -e "Publishing to Sonatype OSS Maven Repository...\n"
? --
+ echo -e "Publishing to Sonatype OSS Maven Repository..."
gradle uploadArchives -PnexusUsername="${SONATYPE_USERNAME}" -PnexusPassword="${SONATYPE_PASSWORD}"
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo -e '\nPublished!'
exit 0
else
- echo -e '\nPublish failed.'
? ^^
+ echo -e '\nPublication failed.'
? ^^^^^^
exit 1
fi
fi | 6 | 0.285714 | 3 | 3 |
3cd5a7649adbb7a227f849c4cf73ec2ef553ae6d | app/scripts/services/MockFetchService.js | app/scripts/services/MockFetchService.js | "use strict";
angular.module("angular-mobile-docs")
.factory("MockFetchService", function ($http, $q) {
var config = {
url: "http://localhost:8080/assets/code.angularjs.org/"
};
var getVersionList = function (version) {
return $http.get(config.url+"versions.json");
}
var getFileList = function (version) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/filelist.json");
}
var getPartial = function (version, name) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/" + name);
}
var getAllPartials = function (version) {
var promises = [];
var fileNameList = getFileList(version);
angular.forEach(fileNameList, function (fileName) {
promises.push(getPartial(fileName, version));
})
return $q.all(promises);
}
return {
getVersionList: function () {
return getVersionList();
},
getFileList : function (version) {
return getFileList(version);
},
getPartial : function (version, name) {
return getPartial(version, name);
},
getAllPartials: function (version) {
return getAllPartials(version);
}
};
}); | "use strict";
angular.module("angular-mobile-docs")
.factory("MockFetchService", function ($http, $q) {
var config = {
url: "http://apidocs.angularjs.de/code.angularjs.org/"
};
var getVersionList = function (version) {
return $http.get(config.url+"versions.json");
}
var getFileList = function (version) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/filelist.json");
}
var getPartial = function (version, name) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/" + name);
}
var getAllPartials = function (version) {
var promises = [];
var fileNameList = getFileList(version);
angular.forEach(fileNameList, function (fileName) {
promises.push(getPartial(fileName, version));
})
return $q.all(promises);
}
return {
getVersionList: function () {
return getVersionList();
},
getFileList : function (version) {
return getFileList(version);
},
getPartial : function (version, name) {
return getPartial(version, name);
},
getAllPartials: function (version) {
return getAllPartials(version);
}
};
}); | Change URL to our online apidocs server | Change URL to our online apidocs server
| JavaScript | apache-2.0 | robinboehm/angular-mobile-docs,robinboehm/angular-mobile-docs,robinboehm/angular-mobile-docs,robinboehm/angular-mobile-docs | javascript | ## Code Before:
"use strict";
angular.module("angular-mobile-docs")
.factory("MockFetchService", function ($http, $q) {
var config = {
url: "http://localhost:8080/assets/code.angularjs.org/"
};
var getVersionList = function (version) {
return $http.get(config.url+"versions.json");
}
var getFileList = function (version) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/filelist.json");
}
var getPartial = function (version, name) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/" + name);
}
var getAllPartials = function (version) {
var promises = [];
var fileNameList = getFileList(version);
angular.forEach(fileNameList, function (fileName) {
promises.push(getPartial(fileName, version));
})
return $q.all(promises);
}
return {
getVersionList: function () {
return getVersionList();
},
getFileList : function (version) {
return getFileList(version);
},
getPartial : function (version, name) {
return getPartial(version, name);
},
getAllPartials: function (version) {
return getAllPartials(version);
}
};
});
## Instruction:
Change URL to our online apidocs server
## Code After:
"use strict";
angular.module("angular-mobile-docs")
.factory("MockFetchService", function ($http, $q) {
var config = {
url: "http://apidocs.angularjs.de/code.angularjs.org/"
};
var getVersionList = function (version) {
return $http.get(config.url+"versions.json");
}
var getFileList = function (version) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/filelist.json");
}
var getPartial = function (version, name) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/" + name);
}
var getAllPartials = function (version) {
var promises = [];
var fileNameList = getFileList(version);
angular.forEach(fileNameList, function (fileName) {
promises.push(getPartial(fileName, version));
})
return $q.all(promises);
}
return {
getVersionList: function () {
return getVersionList();
},
getFileList : function (version) {
return getFileList(version);
},
getPartial : function (version, name) {
return getPartial(version, name);
},
getAllPartials: function (version) {
return getAllPartials(version);
}
};
}); | "use strict";
angular.module("angular-mobile-docs")
.factory("MockFetchService", function ($http, $q) {
var config = {
- url: "http://localhost:8080/assets/code.angularjs.org/"
? ^ ^^ ^^^^^^^^^^ --
+ url: "http://apidocs.angularjs.de/code.angularjs.org/"
? ^^^^ ++ +++ ^^^ ^^
};
var getVersionList = function (version) {
return $http.get(config.url+"versions.json");
}
var getFileList = function (version) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/filelist.json");
}
var getPartial = function (version, name) {
return $http.get(
config.url
+ version
+ "/docs/partials/api/" + name);
}
var getAllPartials = function (version) {
var promises = [];
var fileNameList = getFileList(version);
angular.forEach(fileNameList, function (fileName) {
promises.push(getPartial(fileName, version));
})
return $q.all(promises);
}
return {
getVersionList: function () {
return getVersionList();
},
getFileList : function (version) {
return getFileList(version);
},
getPartial : function (version, name) {
return getPartial(version, name);
},
getAllPartials: function (version) {
return getAllPartials(version);
}
};
}); | 2 | 0.036364 | 1 | 1 |
0eb6f617cf73e68db19bbb4898871885936f0dfd | app/assets/javascripts/reimagine2/foundation.js | app/assets/javascripts/reimagine2/foundation.js | //= require foundation/foundation
//= require foundation/foundation.alerts
//= require foundation/foundation.interchange
//= require foundation/foundation.orbit
//= require foundation/foundation.reveal
//= require foundation/foundation.tooltips
//= require foundation/foundation.topbar
| // The order matters
//= require foundation/foundation
//= require foundation/foundation.alerts
//= require foundation/foundation.interchange
//= require foundation/foundation.orbit
//= require foundation/foundation.reveal
//= require foundation/foundation.topbar
//= require foundation/foundation.tooltips
| Fix test where order matters | Fix test where order matters
| JavaScript | mit | challengepost/reimagine,challengepost/reimagine,challengepost/reimagine | javascript | ## Code Before:
//= require foundation/foundation
//= require foundation/foundation.alerts
//= require foundation/foundation.interchange
//= require foundation/foundation.orbit
//= require foundation/foundation.reveal
//= require foundation/foundation.tooltips
//= require foundation/foundation.topbar
## Instruction:
Fix test where order matters
## Code After:
// The order matters
//= require foundation/foundation
//= require foundation/foundation.alerts
//= require foundation/foundation.interchange
//= require foundation/foundation.orbit
//= require foundation/foundation.reveal
//= require foundation/foundation.topbar
//= require foundation/foundation.tooltips
| + // The order matters
+
//= require foundation/foundation
//= require foundation/foundation.alerts
//= require foundation/foundation.interchange
//= require foundation/foundation.orbit
//= require foundation/foundation.reveal
+ //= require foundation/foundation.topbar
//= require foundation/foundation.tooltips
- //= require foundation/foundation.topbar | 4 | 0.571429 | 3 | 1 |
ca642e7be5e5e84d1e40d3b14f667f403aedda56 | index.html | index.html | <!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="dist/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="dist/playbackname.js"></script>
<title>clappr-playback-name-plugin Test Page</title>
<script type="text/javascript" charset="utf-8">
window.onload = function() {
var player = new Clappr.Player({
sources: ['http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4'],
plugins: {
container: [PlaybackName]
},
width: 640, height: 360,
});
player.attachTo(document.getElementById('player-wrapper'));
}
</script>
</head>
<body>
<div align="center">
<div id="player-wrapper">
</div>
</div>
</body>
</html>
| <!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="dist/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="dist/playbackname.js"></script>
<title>clappr-playback-name-plugin Test Page</title>
<script type="text/javascript" charset="utf-8">
window.addEventListener('DOMContentLoaded', function() {
var player = new Clappr.Player({
sources: ['http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4'],
plugins: {
container: [PlaybackName]
},
width: 640, height: 360,
});
player.attachTo(document.getElementById('player-wrapper'));
});
</script>
</head>
<body>
<div align="center">
<div id="player-wrapper">
</div>
</div>
</body>
</html>
| Use DOMContentLoaded to instantiate player | Use DOMContentLoaded to instantiate player
Listen to `DOMContentLoaded` instead of overwriting `window.onload` handler. | HTML | apache-2.0 | clappr/clappr-playback-name-plugin,clappr/clappr-playback-name-plugin | html | ## Code Before:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="dist/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="dist/playbackname.js"></script>
<title>clappr-playback-name-plugin Test Page</title>
<script type="text/javascript" charset="utf-8">
window.onload = function() {
var player = new Clappr.Player({
sources: ['http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4'],
plugins: {
container: [PlaybackName]
},
width: 640, height: 360,
});
player.attachTo(document.getElementById('player-wrapper'));
}
</script>
</head>
<body>
<div align="center">
<div id="player-wrapper">
</div>
</div>
</body>
</html>
## Instruction:
Use DOMContentLoaded to instantiate player
Listen to `DOMContentLoaded` instead of overwriting `window.onload` handler.
## Code After:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="dist/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="dist/playbackname.js"></script>
<title>clappr-playback-name-plugin Test Page</title>
<script type="text/javascript" charset="utf-8">
window.addEventListener('DOMContentLoaded', function() {
var player = new Clappr.Player({
sources: ['http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4'],
plugins: {
container: [PlaybackName]
},
width: 640, height: 360,
});
player.attachTo(document.getElementById('player-wrapper'));
});
</script>
</head>
<body>
<div align="center">
<div id="player-wrapper">
</div>
</div>
</body>
</html>
| <!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" charset="utf-8" src="dist/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="dist/playbackname.js"></script>
<title>clappr-playback-name-plugin Test Page</title>
<script type="text/javascript" charset="utf-8">
- window.onload = function() {
+ window.addEventListener('DOMContentLoaded', function() {
var player = new Clappr.Player({
sources: ['http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4'],
plugins: {
container: [PlaybackName]
},
width: 640, height: 360,
});
player.attachTo(document.getElementById('player-wrapper'));
- }
+ });
</script>
</head>
<body>
<div align="center">
<div id="player-wrapper">
</div>
</div>
</body>
</html>
| 4 | 0.142857 | 2 | 2 |
8125b95b389c29f051b8fc045258b337fbc8f071 | salt/top.sls | salt/top.sls | base:
'*':
- common
- common.docker
'vm-ship,vm-devops':
- match: list
- common.nsenter
'dfb,vm-devops':
- match: list
- elk
- elk.configserver
- elk.pulled
- elk.dockerized
- elk.dockerlog-forwarder
'wombat,vm-ship':
- match: list
- elk
- elk.dockerlog-forwarder
- mysql.pulled
- koha.pulled
- mysql.dockerized
- koha.dockerized
- migration.dockerized
| base:
'*':
- common
- common.docker
'vm-ship,vm-devops':
- match: list
- common.nsenter
'dfb,vm-devops':
- match: list
- elk
- elk.configserver
- elk.pulled
- elk.dockerized
'wombat,vm-ship':
- match: list
- elk
- elk.dockerlog-forwarder
- mysql.pulled
- koha.pulled
- mysql.dockerized
- koha.dockerized
- migration.dockerized
| Remove dockerlog forwarder from devops. | Remove dockerlog forwarder from devops.
Causes a loop in logging as elk_container logging is picked up by
the dockerlog forwarder which puts log messages in the elk_container
... ad inifinitum.
Will have to look closer at this later.
| SaltStack | mit | digibib/ls.ext,digibib/ls.ext,digibib/ls.ext,digibib/ls.ext | saltstack | ## Code Before:
base:
'*':
- common
- common.docker
'vm-ship,vm-devops':
- match: list
- common.nsenter
'dfb,vm-devops':
- match: list
- elk
- elk.configserver
- elk.pulled
- elk.dockerized
- elk.dockerlog-forwarder
'wombat,vm-ship':
- match: list
- elk
- elk.dockerlog-forwarder
- mysql.pulled
- koha.pulled
- mysql.dockerized
- koha.dockerized
- migration.dockerized
## Instruction:
Remove dockerlog forwarder from devops.
Causes a loop in logging as elk_container logging is picked up by
the dockerlog forwarder which puts log messages in the elk_container
... ad inifinitum.
Will have to look closer at this later.
## Code After:
base:
'*':
- common
- common.docker
'vm-ship,vm-devops':
- match: list
- common.nsenter
'dfb,vm-devops':
- match: list
- elk
- elk.configserver
- elk.pulled
- elk.dockerized
'wombat,vm-ship':
- match: list
- elk
- elk.dockerlog-forwarder
- mysql.pulled
- koha.pulled
- mysql.dockerized
- koha.dockerized
- migration.dockerized
| base:
'*':
- common
- common.docker
'vm-ship,vm-devops':
- match: list
- common.nsenter
'dfb,vm-devops':
- match: list
- elk
- elk.configserver
- elk.pulled
- elk.dockerized
- - elk.dockerlog-forwarder
'wombat,vm-ship':
- match: list
- elk
- elk.dockerlog-forwarder
- mysql.pulled
- koha.pulled
- mysql.dockerized
- koha.dockerized
- migration.dockerized | 1 | 0.038462 | 0 | 1 |
899882be398f8a31e706a590c0a7e297c1589c25 | threat_intel/util/error_messages.py | threat_intel/util/error_messages.py | import sys
from traceback import extract_tb
from traceback import format_list
def write_exception(e):
exc_type, __, exc_traceback = sys.exc_info()
sys.stderr.write('[ERROR] {0} {1}\n'.format(exc_type.__name__, e.message if e.message else ''))
for line in format_list(extract_tb(exc_traceback)):
sys.stderr.write(line)
def write_error_message(message):
sys.stderr.write('[ERROR] ')
sys.stderr.write(message)
sys.stderr.write('\n')
| import sys
from traceback import extract_tb
from traceback import format_list
def write_exception(e):
exc_type, __, exc_traceback = sys.exc_info()
sys.stderr.write('[ERROR] {0} {1}\n'.format(exc_type.__name__, str(e)))
for line in format_list(extract_tb(exc_traceback)):
sys.stderr.write(line)
def write_error_message(message):
sys.stderr.write('[ERROR] ')
sys.stderr.write(message)
sys.stderr.write('\n')
| Fix deprecation warning interfering with tests | Fix deprecation warning interfering with tests
| Python | mit | Yelp/threat_intel,megancarney/threat_intel,SYNchroACK/threat_intel | python | ## Code Before:
import sys
from traceback import extract_tb
from traceback import format_list
def write_exception(e):
exc_type, __, exc_traceback = sys.exc_info()
sys.stderr.write('[ERROR] {0} {1}\n'.format(exc_type.__name__, e.message if e.message else ''))
for line in format_list(extract_tb(exc_traceback)):
sys.stderr.write(line)
def write_error_message(message):
sys.stderr.write('[ERROR] ')
sys.stderr.write(message)
sys.stderr.write('\n')
## Instruction:
Fix deprecation warning interfering with tests
## Code After:
import sys
from traceback import extract_tb
from traceback import format_list
def write_exception(e):
exc_type, __, exc_traceback = sys.exc_info()
sys.stderr.write('[ERROR] {0} {1}\n'.format(exc_type.__name__, str(e)))
for line in format_list(extract_tb(exc_traceback)):
sys.stderr.write(line)
def write_error_message(message):
sys.stderr.write('[ERROR] ')
sys.stderr.write(message)
sys.stderr.write('\n')
| import sys
from traceback import extract_tb
from traceback import format_list
def write_exception(e):
exc_type, __, exc_traceback = sys.exc_info()
- sys.stderr.write('[ERROR] {0} {1}\n'.format(exc_type.__name__, e.message if e.message else ''))
? -----------------------------
+ sys.stderr.write('[ERROR] {0} {1}\n'.format(exc_type.__name__, str(e)))
? ++++ +
for line in format_list(extract_tb(exc_traceback)):
sys.stderr.write(line)
def write_error_message(message):
sys.stderr.write('[ERROR] ')
sys.stderr.write(message)
sys.stderr.write('\n') | 2 | 0.125 | 1 | 1 |
ee0f42c4f48dcb03fee514b4620c2fc0901598e2 | lib/twentyfour_seven_office/services/authentication.rb | lib/twentyfour_seven_office/services/authentication.rb | module TwentyfourSevenOffice
module Services
class Authentication < Service
wsdl "https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl"
api_operation :login, input_data_types: { credential: Credential }
api_operation :has_session
def self.login(credentials_hash)
unless credentials_hash.has_key?(:credential)
credentials_hash = { credential: credentials_hash }
end
session_id = new(nil).login(credentials_hash)
SessionId.new(session_id: session_id)
end
def self.has_session(session_id)
new(session_id).has_session
end
class << self
alias_method :has_session?, :has_session
end
end
end
end
| module TwentyfourSevenOffice
module Services
class Authentication < Service
wsdl "https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl"
api_operation :login, input_data_types: { credential: Credential }
api_operation :has_session
def self.login(credentials)
if credentials.is_a?(TwentyfourSevenOffice::DataTypes::Credential)
credentials = { credential: TwentyfourSevenOffice::DataTypes::Credential.new(credentials) }
elsif credentials.is_a?(Hash)
unless credentials.has_key?(:credential)
credentials = { credential: credentials }
end
else
raise ArgumentError, "credential must be a Hash or a TwentyfourSevenOffice::DataTypes::Credential"
end
session_id = new(nil).login(credentials)
SessionId.new(session_id: session_id)
end
def self.has_session(session_id)
new(session_id).has_session
end
class << self
alias_method :has_session?, :has_session
end
end
end
end
| Make Authentication.login input recognition more robust | Make Authentication.login input recognition more robust | Ruby | mit | Skalar/twentyfour_seven_office | ruby | ## Code Before:
module TwentyfourSevenOffice
module Services
class Authentication < Service
wsdl "https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl"
api_operation :login, input_data_types: { credential: Credential }
api_operation :has_session
def self.login(credentials_hash)
unless credentials_hash.has_key?(:credential)
credentials_hash = { credential: credentials_hash }
end
session_id = new(nil).login(credentials_hash)
SessionId.new(session_id: session_id)
end
def self.has_session(session_id)
new(session_id).has_session
end
class << self
alias_method :has_session?, :has_session
end
end
end
end
## Instruction:
Make Authentication.login input recognition more robust
## Code After:
module TwentyfourSevenOffice
module Services
class Authentication < Service
wsdl "https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl"
api_operation :login, input_data_types: { credential: Credential }
api_operation :has_session
def self.login(credentials)
if credentials.is_a?(TwentyfourSevenOffice::DataTypes::Credential)
credentials = { credential: TwentyfourSevenOffice::DataTypes::Credential.new(credentials) }
elsif credentials.is_a?(Hash)
unless credentials.has_key?(:credential)
credentials = { credential: credentials }
end
else
raise ArgumentError, "credential must be a Hash or a TwentyfourSevenOffice::DataTypes::Credential"
end
session_id = new(nil).login(credentials)
SessionId.new(session_id: session_id)
end
def self.has_session(session_id)
new(session_id).has_session
end
class << self
alias_method :has_session?, :has_session
end
end
end
end
| module TwentyfourSevenOffice
module Services
class Authentication < Service
wsdl "https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl"
api_operation :login, input_data_types: { credential: Credential }
api_operation :has_session
- def self.login(credentials_hash)
? -----
+ def self.login(credentials)
+ if credentials.is_a?(TwentyfourSevenOffice::DataTypes::Credential)
+ credentials = { credential: TwentyfourSevenOffice::DataTypes::Credential.new(credentials) }
+ elsif credentials.is_a?(Hash)
- unless credentials_hash.has_key?(:credential)
? -----
+ unless credentials.has_key?(:credential)
? ++
- credentials_hash = { credential: credentials_hash }
? ----- -----
+ credentials = { credential: credentials }
? ++
+ end
+ else
+ raise ArgumentError, "credential must be a Hash or a TwentyfourSevenOffice::DataTypes::Credential"
end
- session_id = new(nil).login(credentials_hash)
? -----
+ session_id = new(nil).login(credentials)
SessionId.new(session_id: session_id)
end
def self.has_session(session_id)
new(session_id).has_session
end
class << self
alias_method :has_session?, :has_session
end
end
end
end | 14 | 0.518519 | 10 | 4 |
b629df2df4d015e84d6e7141ac6eb6f495b8985d | spec/models/admin_user_spec.rb | spec/models/admin_user_spec.rb | require 'spec_helper'
describe AdminUser do
pending "add some examples to (or delete) #{__FILE__}"
end
| require 'spec_helper'
describe AdminUser do
[:email, :password].each do |attr|
it { should validate_presence_of(attr) }
end
end
| Add incredibly basic AdminUser spec | Add incredibly basic AdminUser spec
| Ruby | mit | robotmay/photographer-io,xuewenfei/photographer-io,wangjun/photographer-io,laputaer/photographer-io,arnkorty/photographer-io,damoguyan8844/photographer-io,arnkorty/photographer-io,wangjun/photographer-io,robotmay/photographer-io,wangjun/photographer-io,arnkorty/photographer-io,laputaer/photographer-io,xuewenfei/photographer-io,xuewenfei/photographer-io,laputaer/photographer-io,damoguyan8844/photographer-io,robotmay/photographer-io,damoguyan8844/photographer-io | ruby | ## Code Before:
require 'spec_helper'
describe AdminUser do
pending "add some examples to (or delete) #{__FILE__}"
end
## Instruction:
Add incredibly basic AdminUser spec
## Code After:
require 'spec_helper'
describe AdminUser do
[:email, :password].each do |attr|
it { should validate_presence_of(attr) }
end
end
| require 'spec_helper'
describe AdminUser do
- pending "add some examples to (or delete) #{__FILE__}"
+ [:email, :password].each do |attr|
+ it { should validate_presence_of(attr) }
+ end
end | 4 | 0.8 | 3 | 1 |
60b89eb9412912f73c2bc8c76e2f1545e2c77c34 | tools/_posts/2000-01-02-github-cheatsheet.markdown | tools/_posts/2000-01-02-github-cheatsheet.markdown | ---
title: GitHub Cheatsheet
layout: course_page
---
# How to fork a repository
| ---
title: GitHub Cheatsheet
layout: course_page
---
# Github cheatsheet
## How to fork a repository
## How to submit a pull request
## How to upload an image
## How to create a new repository
| Add outline to GitHub cheatsheet | Add outline to GitHub cheatsheet
| Markdown | mit | Montana-Media-Arts/mart341-webDev,Montana-Media-Arts/mart341-webDev | markdown | ## Code Before:
---
title: GitHub Cheatsheet
layout: course_page
---
# How to fork a repository
## Instruction:
Add outline to GitHub cheatsheet
## Code After:
---
title: GitHub Cheatsheet
layout: course_page
---
# Github cheatsheet
## How to fork a repository
## How to submit a pull request
## How to upload an image
## How to create a new repository
| ---
title: GitHub Cheatsheet
layout: course_page
---
+ # Github cheatsheet
+
- # How to fork a repository
+ ## How to fork a repository
? +
+
+ ## How to submit a pull request
+
+ ## How to upload an image
+
+ ## How to create a new repository | 10 | 1.666667 | 9 | 1 |
4fe5a5caf5c51db4a52e58c37dd056418e185a95 | samples/elasticsearch-java/project/Build.scala | samples/elasticsearch-java/project/Build.scala | import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "elasticsearch-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"com.github.nboire" % "elasticsearch_2.9.1" % "1.0"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Local Play Repository" at "file://Users/nboire/dev/java/play/play-2.0/repository/local"
//resolvers += "Local Play Repository" at "file://path/to/play-2.0/repository/local"
)
}
| import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "elasticsearch-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"com.github.nboire" % "elasticsearch_2.9.1" % "1.0"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Local Play Repository" at "file://Users/nboire/dev/java/play/play-2.0/repository/local"
//resolvers += Resolver.url("GitHub Play2-elasticsearch Repository", url("http://nboire.github.com/play2-elasticsearch/releases/"))(Resolver.ivyStylePatterns)
)
}
| Test sample with local repository | Test sample with local repository
| Scala | mit | 7thsense/play2-elasticsearch,zephyrdeveloper/play2-elasticsearch,jtammen/play2-elasticsearch,cleverage/play2-elasticsearch,carlosFattor/play2-elasticsearch,zephyrdeveloper/play2-elasticsearch,carlosFattor/play2-elasticsearch,jtammen/play2-elasticsearch,cleverage/play2-elasticsearch,CedricGatay/play2-elasticsearch-jest,7thsense/play2-elasticsearch | scala | ## Code Before:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "elasticsearch-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"com.github.nboire" % "elasticsearch_2.9.1" % "1.0"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Local Play Repository" at "file://Users/nboire/dev/java/play/play-2.0/repository/local"
//resolvers += "Local Play Repository" at "file://path/to/play-2.0/repository/local"
)
}
## Instruction:
Test sample with local repository
## Code After:
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "elasticsearch-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"com.github.nboire" % "elasticsearch_2.9.1" % "1.0"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Local Play Repository" at "file://Users/nboire/dev/java/play/play-2.0/repository/local"
//resolvers += Resolver.url("GitHub Play2-elasticsearch Repository", url("http://nboire.github.com/play2-elasticsearch/releases/"))(Resolver.ivyStylePatterns)
)
}
| import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "elasticsearch-sample"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
"com.github.nboire" % "elasticsearch_2.9.1" % "1.0"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
// Add your own project settings here
resolvers += "Local Play Repository" at "file://Users/nboire/dev/java/play/play-2.0/repository/local"
+ //resolvers += Resolver.url("GitHub Play2-elasticsearch Repository", url("http://nboire.github.com/play2-elasticsearch/releases/"))(Resolver.ivyStylePatterns)
- //resolvers += "Local Play Repository" at "file://path/to/play-2.0/repository/local"
-
)
} | 3 | 0.136364 | 1 | 2 |
76282970dee80c9a0ed499c56e8a4a0898a9fa9c | metadata/org.smerty.zooborns.txt | metadata/org.smerty.zooborns.txt | Category:Multimedia
License:NewBSD
Web Site:https://github.com/Smerty/zooborns.android
Source Code:https://github.com/Smerty/zooborns.android
Summary:View photos of newly-borns
Description:
View the recent photos from [http://zooborns.com zooborns.com]. Menu key in fullscreen for sharing
/ fullstory / wallpaper. Menu key on thumbnail list to enable / disable push
notifications etc.
.
Repo Type:git
Repo:https://github.com/Smerty/zooborns.android.git
Build Version:1.4.4,14,a5db1955358465c77c80cffdfc47d,target=android-15
Update Check Mode:RepoManifest
Current Version:1.4.4
Current Version Code:14
| Category:Multimedia
License:NewBSD
Web Site:https://github.com/Smerty/zooborns.android
Source Code:https://github.com/Smerty/zooborns.android
Summary:Watch cute animals
Description:
View the recent photos from [http://zooborns.com zooborns.com], site
dedicated to raising awareness of wildlife recreation efforts. Menu key
in fullscreen for sharing / fullstory / wallpaper. Menu key on thumbnail
list to enable / disable push notifications etc.
.
Repo Type:git
Repo:https://github.com/Smerty/zooborns.android.git
Build Version:1.4.4,14,a5db1955358465c77c80cffdfc47d,target=android-15
Update Check Mode:RepoManifest
Current Version:1.4.4
Current Version Code:14
| Make it obvious that it's about animals. | ZooBorns: Make it obvious that it's about animals.
"Zoo" kinda gives a hint, but nowadays site names and content correlate
randomly enough to not rely on naming. All in all, I didn't have an
idea what it was about, until I check it out directly, hence description
changes.
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroid-data,f-droid/fdroiddata | text | ## Code Before:
Category:Multimedia
License:NewBSD
Web Site:https://github.com/Smerty/zooborns.android
Source Code:https://github.com/Smerty/zooborns.android
Summary:View photos of newly-borns
Description:
View the recent photos from [http://zooborns.com zooborns.com]. Menu key in fullscreen for sharing
/ fullstory / wallpaper. Menu key on thumbnail list to enable / disable push
notifications etc.
.
Repo Type:git
Repo:https://github.com/Smerty/zooborns.android.git
Build Version:1.4.4,14,a5db1955358465c77c80cffdfc47d,target=android-15
Update Check Mode:RepoManifest
Current Version:1.4.4
Current Version Code:14
## Instruction:
ZooBorns: Make it obvious that it's about animals.
"Zoo" kinda gives a hint, but nowadays site names and content correlate
randomly enough to not rely on naming. All in all, I didn't have an
idea what it was about, until I check it out directly, hence description
changes.
## Code After:
Category:Multimedia
License:NewBSD
Web Site:https://github.com/Smerty/zooborns.android
Source Code:https://github.com/Smerty/zooborns.android
Summary:Watch cute animals
Description:
View the recent photos from [http://zooborns.com zooborns.com], site
dedicated to raising awareness of wildlife recreation efforts. Menu key
in fullscreen for sharing / fullstory / wallpaper. Menu key on thumbnail
list to enable / disable push notifications etc.
.
Repo Type:git
Repo:https://github.com/Smerty/zooborns.android.git
Build Version:1.4.4,14,a5db1955358465c77c80cffdfc47d,target=android-15
Update Check Mode:RepoManifest
Current Version:1.4.4
Current Version Code:14
| Category:Multimedia
License:NewBSD
Web Site:https://github.com/Smerty/zooborns.android
Source Code:https://github.com/Smerty/zooborns.android
- Summary:View photos of newly-borns
+ Summary:Watch cute animals
Description:
- View the recent photos from [http://zooborns.com zooborns.com]. Menu key in fullscreen for sharing
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- ^^
+ View the recent photos from [http://zooborns.com zooborns.com], site
? ^ ^^
- / fullstory / wallpaper. Menu key on thumbnail list to enable / disable push
- notifications etc.
+ dedicated to raising awareness of wildlife recreation efforts. Menu key
+ in fullscreen for sharing / fullstory / wallpaper. Menu key on thumbnail
+ list to enable / disable push notifications etc.
.
Repo Type:git
Repo:https://github.com/Smerty/zooborns.android.git
Build Version:1.4.4,14,a5db1955358465c77c80cffdfc47d,target=android-15
Update Check Mode:RepoManifest
Current Version:1.4.4
Current Version Code:14
| 9 | 0.428571 | 5 | 4 |
7608a6edc9179d915b541076a1c2d909e688dbf4 | examples/room/Cargo.toml | examples/room/Cargo.toml | [package]
name = "room_example"
version = "0.1.0"
authors = ["Imanol Fernandez <mortimergoro@gmail.com>"]
build = "build.rs"
[dependencies]
glutin = "0.7.4"
gleam = "0.4"
cgmath = "0.12"
image = "0.12"
android_glue = "0.2"
[target.'cfg(target_os = "android")'.dependencies]
android_injected_glue = {git = "https://github.com/mmatyas/android-rs-injected-glue"}
[dependencies.rust-webvr]
path = "../.."
| [package]
name = "room_example"
version = "0.1.0"
authors = ["Imanol Fernandez <mortimergoro@gmail.com>"]
build = "build.rs"
[dependencies]
glutin = { git = "https://github.com/MortimerGoro/glutin/", branch = "android_fixes" }
gleam = "0.4"
cgmath = "0.12"
image = "0.12"
android_glue = "0.2"
[target.'cfg(target_os = "android")'.dependencies]
android_injected_glue = {git = "https://github.com/mmatyas/android-rs-injected-glue"}
[dependencies.rust-webvr]
path = "../.."
| Use a custom fork of glutin for a correct Android life cycle | Use a custom fork of glutin for a correct Android life cycle
| TOML | mit | MortimerGoro/rust-webvr,MortimerGoro/rust-webvr,MortimerGoro/rust-webvr | toml | ## Code Before:
[package]
name = "room_example"
version = "0.1.0"
authors = ["Imanol Fernandez <mortimergoro@gmail.com>"]
build = "build.rs"
[dependencies]
glutin = "0.7.4"
gleam = "0.4"
cgmath = "0.12"
image = "0.12"
android_glue = "0.2"
[target.'cfg(target_os = "android")'.dependencies]
android_injected_glue = {git = "https://github.com/mmatyas/android-rs-injected-glue"}
[dependencies.rust-webvr]
path = "../.."
## Instruction:
Use a custom fork of glutin for a correct Android life cycle
## Code After:
[package]
name = "room_example"
version = "0.1.0"
authors = ["Imanol Fernandez <mortimergoro@gmail.com>"]
build = "build.rs"
[dependencies]
glutin = { git = "https://github.com/MortimerGoro/glutin/", branch = "android_fixes" }
gleam = "0.4"
cgmath = "0.12"
image = "0.12"
android_glue = "0.2"
[target.'cfg(target_os = "android")'.dependencies]
android_injected_glue = {git = "https://github.com/mmatyas/android-rs-injected-glue"}
[dependencies.rust-webvr]
path = "../.."
| [package]
name = "room_example"
version = "0.1.0"
authors = ["Imanol Fernandez <mortimergoro@gmail.com>"]
build = "build.rs"
[dependencies]
- glutin = "0.7.4"
+ glutin = { git = "https://github.com/MortimerGoro/glutin/", branch = "android_fixes" }
gleam = "0.4"
cgmath = "0.12"
image = "0.12"
android_glue = "0.2"
[target.'cfg(target_os = "android")'.dependencies]
android_injected_glue = {git = "https://github.com/mmatyas/android-rs-injected-glue"}
[dependencies.rust-webvr]
path = "../.."
| 2 | 0.105263 | 1 | 1 |
0aa61fb32df9ae3ef9c465f4b246edf04897cd14 | staticfiles/views.py | staticfiles/views.py | from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
"""
Serve static files from locations inferred from INSTALLED_APPS and
STATICFILES_DIRS.
To use, put a URL pattern such as::
(r'^(?P<path>.*)$', 'staticfiles.views.serve')
in your URLconf. You may also set ``show_indexes`` to ``True`` if you'd
like to serve a basic index of the directory. This index view will use the
template hardcoded below, but if you'd like to override it, you can create
a template called ``static/directory_index``.
"""
return django_serve(request, path='', document_root=resolve(path),
show_indexes=show_indexes)
| from django import http
from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
"""
Serve static files from locations inferred from INSTALLED_APPS and
STATICFILES_DIRS.
To use, put a URL pattern such as::
(r'^(?P<path>.*)$', 'staticfiles.views.serve')
in your URLconf. You may also set ``show_indexes`` to ``True`` if you'd
like to serve a basic index of the directory. This index view will use the
template hardcoded below, but if you'd like to override it, you can create
a template called ``static/directory_index``.
"""
absolute_path = resolve(path)
if not absolute_path:
raise http.Http404('%r could not be resolved to a static file.' % path)
return django_serve(request, path='', document_root=absolute_path,
show_indexes=show_indexes)
| Make the staticfiles serve view raise a 404 for paths which could not be resolved. | Make the staticfiles serve view raise a 404 for paths which could not be resolved.
| Python | bsd-3-clause | tusbar/django-staticfiles,jezdez-archive/django-staticfiles,tusbar/django-staticfiles | python | ## Code Before:
from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
"""
Serve static files from locations inferred from INSTALLED_APPS and
STATICFILES_DIRS.
To use, put a URL pattern such as::
(r'^(?P<path>.*)$', 'staticfiles.views.serve')
in your URLconf. You may also set ``show_indexes`` to ``True`` if you'd
like to serve a basic index of the directory. This index view will use the
template hardcoded below, but if you'd like to override it, you can create
a template called ``static/directory_index``.
"""
return django_serve(request, path='', document_root=resolve(path),
show_indexes=show_indexes)
## Instruction:
Make the staticfiles serve view raise a 404 for paths which could not be resolved.
## Code After:
from django import http
from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
"""
Serve static files from locations inferred from INSTALLED_APPS and
STATICFILES_DIRS.
To use, put a URL pattern such as::
(r'^(?P<path>.*)$', 'staticfiles.views.serve')
in your URLconf. You may also set ``show_indexes`` to ``True`` if you'd
like to serve a basic index of the directory. This index view will use the
template hardcoded below, but if you'd like to override it, you can create
a template called ``static/directory_index``.
"""
absolute_path = resolve(path)
if not absolute_path:
raise http.Http404('%r could not be resolved to a static file.' % path)
return django_serve(request, path='', document_root=absolute_path,
show_indexes=show_indexes)
| + from django import http
from django.views.static import serve as django_serve
from staticfiles.resolvers import resolve
def serve(request, path, show_indexes=False):
"""
Serve static files from locations inferred from INSTALLED_APPS and
STATICFILES_DIRS.
To use, put a URL pattern such as::
(r'^(?P<path>.*)$', 'staticfiles.views.serve')
in your URLconf. You may also set ``show_indexes`` to ``True`` if you'd
like to serve a basic index of the directory. This index view will use the
template hardcoded below, but if you'd like to override it, you can create
a template called ``static/directory_index``.
"""
+ absolute_path = resolve(path)
+ if not absolute_path:
+ raise http.Http404('%r could not be resolved to a static file.' % path)
- return django_serve(request, path='', document_root=resolve(path),
? ^^ ^ ^ -
+ return django_serve(request, path='', document_root=absolute_path,
? ^^ ^^ ^
show_indexes=show_indexes) | 6 | 0.285714 | 5 | 1 |
cc012c0ea255b0fe308a74d3e9094ec87c18e0bc | .travis.yml | .travis.yml | rvm:
- 1.9.3
- jruby-19mode
- rbx-2
- 2.0.0
- 2.1.1
install:
- "travis_retry bundle install"
script: "bundle exec rake clean spec cucumber"
gemfile:
- gemfiles/3.2.gemfile
- gemfiles/4.0.gemfile
- gemfiles/4.1.gemfile
matrix:
fast_finish: true
allow_failures:
- rvm: jruby-19mode
- rvm: rbx-2
sudo: false
cache: bundler
| rvm:
- 1.9.3
- jruby-19mode
- rbx-2
- 2.0.0
- 2.1.1
- 2.2.2
install:
- "travis_retry bundle install"
script: "bundle exec rake clean spec cucumber"
gemfile:
- gemfiles/3.2.gemfile
- gemfiles/4.0.gemfile
- gemfiles/4.1.gemfile
- gemfiles/4.2.gemfile
matrix:
fast_finish: true
allow_failures:
- rvm: jruby-19mode
- rvm: rbx-2
sudo: false
cache: bundler
| Test against Ruby 2.2 on Travis. | Test against Ruby 2.2 on Travis. | YAML | mit | frankpinto/paperclip,betesh/paperclip,manorie/paperclip,joshisa/paperclip,soramugi/paperclip,Cohealo/paperclip,victorngkp/paperclip,betesh/paperclip,alexandrz/paperclip,aditya01933/paperclip,zurb/paperclip,greatbody/paperclip,ScotterC/paperclip,sopheak-se/paperclip,pandamako/paperclip,keathley/paperclip,aditya01933/paperclip,bdewater/paperclip,tiegz/paperclip,bdewater/paperclip,zurb/paperclip,alexandrz/paperclip,justanshulsharma/paperclip,Cohealo/paperclip,mrgilman/paperclip,tiegz/paperclip,mrgilman/paperclip,dgynn/paperclip,InesCARodrigues/paperclip,ScotterC/paperclip,mrb/paperclip,cmaion/paperclip,frankpinto/paperclip,mdkalish/paperclip,raow/paperclip,justanshulsharma/paperclip,freeslugs/paperclip,gfvcastro/paperclip,pandamako/paperclip,rpbaptist/paperclip,rpbaptist/paperclip,keathley/paperclip,greatbody/paperclip,raow/paperclip,mrb/paperclip,soramugi/paperclip,sopheak-se/paperclip,gfvcastro/paperclip,tylerwillingham/paperclip,mdkalish/paperclip,freeslugs/paperclip,dgynn/paperclip,onursarikaya/paperclip,onursarikaya/paperclip,cmaion/paperclip,victorngkp/paperclip,InesCARodrigues/paperclip,manorie/paperclip,joshisa/paperclip,tylerwillingham/paperclip | yaml | ## Code Before:
rvm:
- 1.9.3
- jruby-19mode
- rbx-2
- 2.0.0
- 2.1.1
install:
- "travis_retry bundle install"
script: "bundle exec rake clean spec cucumber"
gemfile:
- gemfiles/3.2.gemfile
- gemfiles/4.0.gemfile
- gemfiles/4.1.gemfile
matrix:
fast_finish: true
allow_failures:
- rvm: jruby-19mode
- rvm: rbx-2
sudo: false
cache: bundler
## Instruction:
Test against Ruby 2.2 on Travis.
## Code After:
rvm:
- 1.9.3
- jruby-19mode
- rbx-2
- 2.0.0
- 2.1.1
- 2.2.2
install:
- "travis_retry bundle install"
script: "bundle exec rake clean spec cucumber"
gemfile:
- gemfiles/3.2.gemfile
- gemfiles/4.0.gemfile
- gemfiles/4.1.gemfile
- gemfiles/4.2.gemfile
matrix:
fast_finish: true
allow_failures:
- rvm: jruby-19mode
- rvm: rbx-2
sudo: false
cache: bundler
| rvm:
- 1.9.3
- jruby-19mode
- rbx-2
- 2.0.0
- 2.1.1
+ - 2.2.2
install:
- "travis_retry bundle install"
script: "bundle exec rake clean spec cucumber"
gemfile:
- gemfiles/3.2.gemfile
- gemfiles/4.0.gemfile
- gemfiles/4.1.gemfile
+ - gemfiles/4.2.gemfile
matrix:
fast_finish: true
allow_failures:
- rvm: jruby-19mode
- rvm: rbx-2
sudo: false
cache: bundler | 2 | 0.08 | 2 | 0 |
d88a1b91bb0213308a3ef0405f2e7703d42e69b9 | doc/macbuild_master_setup.txt | doc/macbuild_master_setup.txt | passenger-install-nginx-module
## Changes to nginx configuration ##
# Up the maximum size allowed for requests (allows us to POST large log files)
client_max_body_size 100M;
# Increase the http timeout above 60 seconds; necessary for large uploads
client_body_timeout 90;
# Transmit all of the .gz files under log_files as plain/text (renders then inside the browser)
location ~* log_files.*?\.gz$ {
types { text/plain gz; }
add_header Content-Encoding gzip;
}
|
cd /Users/square
curl http://nginx.org/download/nginx-1.2.4.tar.gz | tar xvz
# Install the passenger gem into the 1.9.3@kochiku gemset
$ cd ~/kochiku/current
$ gem install passenger -v 3.0.18
$ which passenger-install-nginx-module
# => /Users/square/.rvm/gems/ruby-1.9.3-p194@kochiku/bin/passenger-install-nginx-module
Run the passenger nginx install
rvmsudo passenger-install-nginx-module
Select the advanced install (number 2)
Provide the path the nginx source (/Users/square/nginx-1.2.4)
Use the default install dir (/opt/nginx)
Ensure that nginx is configured with the following additional options:
--with-http_gzip_static_module --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib
Explanation for extra options:
The http_gzip_static_module is used by kochiku to when serving the
log files. The cc-opt and ld-opt are needed on Snow Leopard to avoid
using the system's pcre install and use the one installed by Homebrew
instead. The compile fails with the system pcre.
After the new version finishes compiling tell nginx to reload
sudo /opt/nginx/sbin/nginx -s reload
Now upgrade the passenger gem in the Kochiku repo and deploy it. That
gem is installed in a different location than the one above and doesn't
actually get used (which is ok). We bump the gem in the kochiku project
just to show what version is running on the server.
## Changes to nginx configuration ##
Nginx configuration for Kochiku on macbuild-master is at:
/Users/square/.nginx/http/macbuild-master.local.conf
Up the maximum size allowed for requests (allows us to POST large log files)
client_max_body_size 100M;
Increase the http timeout above 60 seconds; necessary for large uploads
client_body_timeout 120;
Transmit all of the .gz files under log_files as plain/text (renders then inside the browser)
location ~* log_files.*?\.gz$ {
types { text/plain gz; }
add_header Content-Encoding gzip;
}
| Update the documentation for upgrading nginx+passenger | Update the documentation for upgrading nginx+passenger
| Text | apache-2.0 | square/kochiku,square/kochiku,square/kochiku,rudle/kochiku,moshez/kochiku,IoraHealth/kochiku,rudle/kochiku,square/kochiku,moshez/kochiku,moshez/kochiku,rudle/kochiku,rudle/kochiku,IoraHealth/kochiku,IoraHealth/kochiku,moshez/kochiku | text | ## Code Before:
passenger-install-nginx-module
## Changes to nginx configuration ##
# Up the maximum size allowed for requests (allows us to POST large log files)
client_max_body_size 100M;
# Increase the http timeout above 60 seconds; necessary for large uploads
client_body_timeout 90;
# Transmit all of the .gz files under log_files as plain/text (renders then inside the browser)
location ~* log_files.*?\.gz$ {
types { text/plain gz; }
add_header Content-Encoding gzip;
}
## Instruction:
Update the documentation for upgrading nginx+passenger
## Code After:
cd /Users/square
curl http://nginx.org/download/nginx-1.2.4.tar.gz | tar xvz
# Install the passenger gem into the 1.9.3@kochiku gemset
$ cd ~/kochiku/current
$ gem install passenger -v 3.0.18
$ which passenger-install-nginx-module
# => /Users/square/.rvm/gems/ruby-1.9.3-p194@kochiku/bin/passenger-install-nginx-module
Run the passenger nginx install
rvmsudo passenger-install-nginx-module
Select the advanced install (number 2)
Provide the path the nginx source (/Users/square/nginx-1.2.4)
Use the default install dir (/opt/nginx)
Ensure that nginx is configured with the following additional options:
--with-http_gzip_static_module --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib
Explanation for extra options:
The http_gzip_static_module is used by kochiku to when serving the
log files. The cc-opt and ld-opt are needed on Snow Leopard to avoid
using the system's pcre install and use the one installed by Homebrew
instead. The compile fails with the system pcre.
After the new version finishes compiling tell nginx to reload
sudo /opt/nginx/sbin/nginx -s reload
Now upgrade the passenger gem in the Kochiku repo and deploy it. That
gem is installed in a different location than the one above and doesn't
actually get used (which is ok). We bump the gem in the kochiku project
just to show what version is running on the server.
## Changes to nginx configuration ##
Nginx configuration for Kochiku on macbuild-master is at:
/Users/square/.nginx/http/macbuild-master.local.conf
Up the maximum size allowed for requests (allows us to POST large log files)
client_max_body_size 100M;
Increase the http timeout above 60 seconds; necessary for large uploads
client_body_timeout 120;
Transmit all of the .gz files under log_files as plain/text (renders then inside the browser)
location ~* log_files.*?\.gz$ {
types { text/plain gz; }
add_header Content-Encoding gzip;
}
| +
+ cd /Users/square
+ curl http://nginx.org/download/nginx-1.2.4.tar.gz | tar xvz
+
+ # Install the passenger gem into the 1.9.3@kochiku gemset
+
+ $ cd ~/kochiku/current
+ $ gem install passenger -v 3.0.18
- passenger-install-nginx-module
+ $ which passenger-install-nginx-module
? ++++++++++++
+ # => /Users/square/.rvm/gems/ruby-1.9.3-p194@kochiku/bin/passenger-install-nginx-module
+
+ Run the passenger nginx install
+
+ rvmsudo passenger-install-nginx-module
+
+ Select the advanced install (number 2)
+ Provide the path the nginx source (/Users/square/nginx-1.2.4)
+ Use the default install dir (/opt/nginx)
+ Ensure that nginx is configured with the following additional options:
+
+ --with-http_gzip_static_module --with-cc-opt=-I/usr/local/include --with-ld-opt=-L/usr/local/lib
+
+ Explanation for extra options:
+ The http_gzip_static_module is used by kochiku to when serving the
+ log files. The cc-opt and ld-opt are needed on Snow Leopard to avoid
+ using the system's pcre install and use the one installed by Homebrew
+ instead. The compile fails with the system pcre.
+
+ After the new version finishes compiling tell nginx to reload
+
+ sudo /opt/nginx/sbin/nginx -s reload
+
+ Now upgrade the passenger gem in the Kochiku repo and deploy it. That
+ gem is installed in a different location than the one above and doesn't
+ actually get used (which is ok). We bump the gem in the kochiku project
+ just to show what version is running on the server.
## Changes to nginx configuration ##
+ Nginx configuration for Kochiku on macbuild-master is at:
- # Up the maximum size allowed for requests (allows us to POST large log files)
- client_max_body_size 100M;
+ /Users/square/.nginx/http/macbuild-master.local.conf
- # Increase the http timeout above 60 seconds; necessary for large uploads
- client_body_timeout 90;
+ Up the maximum size allowed for requests (allows us to POST large log files)
+
+ client_max_body_size 100M;
+
+ Increase the http timeout above 60 seconds; necessary for large uploads
+
+ client_body_timeout 120;
+
- # Transmit all of the .gz files under log_files as plain/text (renders then inside the browser)
? --
+ Transmit all of the .gz files under log_files as plain/text (renders then inside the browser)
+
- location ~* log_files.*?\.gz$ {
+ location ~* log_files.*?\.gz$ {
? ++++
- types { text/plain gz; }
+ types { text/plain gz; }
? ++++
- add_header Content-Encoding gzip;
+ add_header Content-Encoding gzip;
? ++++
- }
+ } | 62 | 4.133333 | 52 | 10 |
c992de45a34141c1e3c57a22524e4c04e2929ab8 | build.sh | build.sh | set -e
NO_COLOR="\x1b[0m"
OK_COLOR="\x1b[32;01m"
ERROR_COLOR="\x1b[31;01m"
WARN_COLOR="\x1b[33;01m"
# Compile the main Packer app
echo "${OK_COLOR}--> Compiling Packer${NO_COLOR}"
go build -v -o bin/packer .
# Go over each plugin and build it
for PLUGIN in $(find ./plugin -type d -mindepth 1 -maxdepth 1); do
PLUGIN_NAME=$(basename ${PLUGIN})
echo "${OK_COLOR}--> Compiling Plugin: ${PLUGIN_NAME}${NO_COLOR}"
go build -v -o bin/packer-${PLUGIN_NAME} ${PLUGIN}
done
| set -e
NO_COLOR="\x1b[0m"
OK_COLOR="\x1b[32;01m"
ERROR_COLOR="\x1b[31;01m"
WARN_COLOR="\x1b[33;01m"
# Compile the main Packer app
echo "${OK_COLOR}--> Compiling Packer${NO_COLOR}"
go build -v -o bin/packer .
# Go over each plugin and build it
for PLUGIN in $(find ./plugin -mindepth 1 -maxdepth 1 -type d); do
PLUGIN_NAME=$(basename ${PLUGIN})
echo "${OK_COLOR}--> Compiling Plugin: ${PLUGIN_NAME}${NO_COLOR}"
go build -v -o bin/packer-${PLUGIN_NAME} ${PLUGIN}
done
| Fix for find in Linux | Fix for find in Linux
| Shell | mpl-2.0 | suma/packer,Kaixiang/packer,TranscendComputing/packer,zyegfryed/packer,smerrill/packer,TranscendComputing/packer,smerrill/packer,patricklucas/packer,patricklucas/packer,patricklucas/packer,Kaixiang/packer,smerrill/packer,Kaixiang/packer,suma/packer,Kaixiang/packer,msabramo/packer,suma/packer,zyegfryed/packer,TranscendComputing/packer,suma/packer,patricklucas/packer,zyegfryed/packer,msabramo/packer,msabramo/packer,zyegfryed/packer,TranscendComputing/packer,msabramo/packer,smerrill/packer | shell | ## Code Before:
set -e
NO_COLOR="\x1b[0m"
OK_COLOR="\x1b[32;01m"
ERROR_COLOR="\x1b[31;01m"
WARN_COLOR="\x1b[33;01m"
# Compile the main Packer app
echo "${OK_COLOR}--> Compiling Packer${NO_COLOR}"
go build -v -o bin/packer .
# Go over each plugin and build it
for PLUGIN in $(find ./plugin -type d -mindepth 1 -maxdepth 1); do
PLUGIN_NAME=$(basename ${PLUGIN})
echo "${OK_COLOR}--> Compiling Plugin: ${PLUGIN_NAME}${NO_COLOR}"
go build -v -o bin/packer-${PLUGIN_NAME} ${PLUGIN}
done
## Instruction:
Fix for find in Linux
## Code After:
set -e
NO_COLOR="\x1b[0m"
OK_COLOR="\x1b[32;01m"
ERROR_COLOR="\x1b[31;01m"
WARN_COLOR="\x1b[33;01m"
# Compile the main Packer app
echo "${OK_COLOR}--> Compiling Packer${NO_COLOR}"
go build -v -o bin/packer .
# Go over each plugin and build it
for PLUGIN in $(find ./plugin -mindepth 1 -maxdepth 1 -type d); do
PLUGIN_NAME=$(basename ${PLUGIN})
echo "${OK_COLOR}--> Compiling Plugin: ${PLUGIN_NAME}${NO_COLOR}"
go build -v -o bin/packer-${PLUGIN_NAME} ${PLUGIN}
done
| set -e
NO_COLOR="\x1b[0m"
OK_COLOR="\x1b[32;01m"
ERROR_COLOR="\x1b[31;01m"
WARN_COLOR="\x1b[33;01m"
# Compile the main Packer app
echo "${OK_COLOR}--> Compiling Packer${NO_COLOR}"
go build -v -o bin/packer .
# Go over each plugin and build it
- for PLUGIN in $(find ./plugin -type d -mindepth 1 -maxdepth 1); do
? --------
+ for PLUGIN in $(find ./plugin -mindepth 1 -maxdepth 1 -type d); do
? ++++++++
PLUGIN_NAME=$(basename ${PLUGIN})
echo "${OK_COLOR}--> Compiling Plugin: ${PLUGIN_NAME}${NO_COLOR}"
go build -v -o bin/packer-${PLUGIN_NAME} ${PLUGIN}
done | 2 | 0.111111 | 1 | 1 |
ac3b791799341bdae72e7347fbefe762d4f8c481 | spot-light.js | spot-light.js | const Signal = require('signals')
function SpotLight (opts) {
this.type = 'SpotLight'
this.enabled = true
this.changed = new Signal()
this.target = [0, 0, 0]
this.color = [1, 1, 1, 1]
this.intensity = 1
this.angle = Math.PI / 4
this.innerAngle = Math.PI / 6
this.range = 10
this.castShadows = false
this.set(opts)
}
SpotLight.prototype.init = function (entity) {
this.entity = entity
}
SpotLight.prototype.set = function (opts) {
Object.assign(this, opts)
if (opts.color !== undefined || opts.intensity !== undefined) {
this.color[3] = this.intensity
}
Object.keys(opts).forEach((prop) => this.changed.dispatch(prop))
}
module.exports = function (opts) {
return new SpotLight(opts)
}
| const Signal = require('signals')
function SpotLight (opts) {
this.type = 'SpotLight'
this.enabled = true
this.changed = new Signal()
this.target = [0, 0, 0]
this.color = [1, 1, 1, 1]
this.intensity = 1
this.angle = Math.PI / 4
this.innerAngle = 0
this.range = 10
this.castShadows = false
this.set(opts)
}
SpotLight.prototype.init = function (entity) {
this.entity = entity
}
SpotLight.prototype.set = function (opts) {
Object.assign(this, opts)
if (opts.color !== undefined || opts.intensity !== undefined) {
this.color[3] = this.intensity
}
Object.keys(opts).forEach((prop) => this.changed.dispatch(prop))
}
module.exports = function (opts) {
return new SpotLight(opts)
}
| Set spotlight inner angle to glTF defaults | Set spotlight inner angle to glTF defaults
| JavaScript | mit | pex-gl/pex-renderer,pex-gl/pex-renderer | javascript | ## Code Before:
const Signal = require('signals')
function SpotLight (opts) {
this.type = 'SpotLight'
this.enabled = true
this.changed = new Signal()
this.target = [0, 0, 0]
this.color = [1, 1, 1, 1]
this.intensity = 1
this.angle = Math.PI / 4
this.innerAngle = Math.PI / 6
this.range = 10
this.castShadows = false
this.set(opts)
}
SpotLight.prototype.init = function (entity) {
this.entity = entity
}
SpotLight.prototype.set = function (opts) {
Object.assign(this, opts)
if (opts.color !== undefined || opts.intensity !== undefined) {
this.color[3] = this.intensity
}
Object.keys(opts).forEach((prop) => this.changed.dispatch(prop))
}
module.exports = function (opts) {
return new SpotLight(opts)
}
## Instruction:
Set spotlight inner angle to glTF defaults
## Code After:
const Signal = require('signals')
function SpotLight (opts) {
this.type = 'SpotLight'
this.enabled = true
this.changed = new Signal()
this.target = [0, 0, 0]
this.color = [1, 1, 1, 1]
this.intensity = 1
this.angle = Math.PI / 4
this.innerAngle = 0
this.range = 10
this.castShadows = false
this.set(opts)
}
SpotLight.prototype.init = function (entity) {
this.entity = entity
}
SpotLight.prototype.set = function (opts) {
Object.assign(this, opts)
if (opts.color !== undefined || opts.intensity !== undefined) {
this.color[3] = this.intensity
}
Object.keys(opts).forEach((prop) => this.changed.dispatch(prop))
}
module.exports = function (opts) {
return new SpotLight(opts)
}
| const Signal = require('signals')
function SpotLight (opts) {
this.type = 'SpotLight'
this.enabled = true
this.changed = new Signal()
this.target = [0, 0, 0]
this.color = [1, 1, 1, 1]
this.intensity = 1
this.angle = Math.PI / 4
- this.innerAngle = Math.PI / 6
? ^^^^^^^^^^^
+ this.innerAngle = 0
? ^
this.range = 10
this.castShadows = false
this.set(opts)
}
SpotLight.prototype.init = function (entity) {
this.entity = entity
}
SpotLight.prototype.set = function (opts) {
Object.assign(this, opts)
if (opts.color !== undefined || opts.intensity !== undefined) {
this.color[3] = this.intensity
}
Object.keys(opts).forEach((prop) => this.changed.dispatch(prop))
}
module.exports = function (opts) {
return new SpotLight(opts)
} | 2 | 0.058824 | 1 | 1 |
0705308125f4346a93075756165cdfae5965bab7 | version.json | version.json | {
"$schema": "src\\NerdBank.GitVersioning\\version.schema.json",
"version": "1.4",
"assemblyVersion": {
"precision": "revision"
},
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/tags/v\\d\\.\\d" // we also release tags starting with vN.N
]
}
| {
"$schema": "src\\NerdBank.GitVersioning\\version.schema.json",
"version": "1.4",
"assemblyVersion": {
"precision": "revision"
},
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/tags/v\\d\\.\\d" // we also release tags starting with vN.N
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}
| Enable setting the cloud build number for this very project. | Enable setting the cloud build number for this very project.
| JSON | mit | AArnott/Nerdbank.GitVersioning,AArnott/Nerdbank.GitVersioning,jeremyhaubold/Nerdbank.GitVersioning,AArnott/Nerdbank.GitVersioning | json | ## Code Before:
{
"$schema": "src\\NerdBank.GitVersioning\\version.schema.json",
"version": "1.4",
"assemblyVersion": {
"precision": "revision"
},
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/tags/v\\d\\.\\d" // we also release tags starting with vN.N
]
}
## Instruction:
Enable setting the cloud build number for this very project.
## Code After:
{
"$schema": "src\\NerdBank.GitVersioning\\version.schema.json",
"version": "1.4",
"assemblyVersion": {
"precision": "revision"
},
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/tags/v\\d\\.\\d" // we also release tags starting with vN.N
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}
| {
"$schema": "src\\NerdBank.GitVersioning\\version.schema.json",
"version": "1.4",
"assemblyVersion": {
"precision": "revision"
},
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/tags/v\\d\\.\\d" // we also release tags starting with vN.N
- ]
+ ],
? +
+ "cloudBuild": {
+ "buildNumber": {
+ "enabled": true
+ }
+ }
} | 7 | 0.636364 | 6 | 1 |
a93001f87a85441009cbd5429300da8789b18f08 | src/lib.rs | src/lib.rs | extern crate libc;
pub mod instruction;
pub mod constants;
pub mod ffi;
pub mod capstone;
pub use instruction::*;
pub use constants::*;
pub use capstone::Capstone;
/// An opaque reference to a capstone engine.
///
/// bindgen by default used this type name everywhere, so it is easier to leave it with a confusing
/// name.
///
/// It should not be exported, rust's new visibility rules make tackling this not immediately
/// obvious
#[allow(non_camel_case_types)]
pub type csh = libc::size_t;
| extern crate libc;
pub mod instruction;
pub mod constants;
pub mod ffi;
pub mod capstone;
pub use instruction::*;
pub use constants::*;
pub use capstone::Capstone;
/// An opaque reference to a capstone engine.
///
/// bindgen by default used this type name everywhere, so it is easier to leave it with a confusing
/// name.
///
/// It should not be exported, rust's new visibility rules make tackling this not immediately
/// obvious
#[allow(non_camel_case_types)]
pub type csh = libc::size_t;
#[cfg(test)]
mod test {
use super::*;
static CODE: &'static [u8] = b"\x55\x48\x8b\x05\xb8\x13\x00\x00";
#[test]
fn test_x86_simple() {
match capstone::Capstone::new(constants::CsArch::ARCH_X86,
constants::CsMode::MODE_64) {
Some(cs) => {
if let Some(insns) = cs.disasm(CODE, 0x1000, 0) {
assert_eq!(insns.len(), 2);
let is: Vec<_> = insns.iter().collect();
assert_eq!(is[0].mnemonic().unwrap(), "push");
assert_eq!(is[1].mnemonic().unwrap(), "mov");
assert_eq!(is[0].address, 0x1000);
assert_eq!(is[1].address, 0x1001);
} else {
assert!(false, "Couldn't disasm instructions")
}
},
None => {
assert!(false, "Couldn't create a cs engine");
}
}
}
}
| Add demo as a test | Add demo as a test
| Rust | mit | richo/capstone-rs | rust | ## Code Before:
extern crate libc;
pub mod instruction;
pub mod constants;
pub mod ffi;
pub mod capstone;
pub use instruction::*;
pub use constants::*;
pub use capstone::Capstone;
/// An opaque reference to a capstone engine.
///
/// bindgen by default used this type name everywhere, so it is easier to leave it with a confusing
/// name.
///
/// It should not be exported, rust's new visibility rules make tackling this not immediately
/// obvious
#[allow(non_camel_case_types)]
pub type csh = libc::size_t;
## Instruction:
Add demo as a test
## Code After:
extern crate libc;
pub mod instruction;
pub mod constants;
pub mod ffi;
pub mod capstone;
pub use instruction::*;
pub use constants::*;
pub use capstone::Capstone;
/// An opaque reference to a capstone engine.
///
/// bindgen by default used this type name everywhere, so it is easier to leave it with a confusing
/// name.
///
/// It should not be exported, rust's new visibility rules make tackling this not immediately
/// obvious
#[allow(non_camel_case_types)]
pub type csh = libc::size_t;
#[cfg(test)]
mod test {
use super::*;
static CODE: &'static [u8] = b"\x55\x48\x8b\x05\xb8\x13\x00\x00";
#[test]
fn test_x86_simple() {
match capstone::Capstone::new(constants::CsArch::ARCH_X86,
constants::CsMode::MODE_64) {
Some(cs) => {
if let Some(insns) = cs.disasm(CODE, 0x1000, 0) {
assert_eq!(insns.len(), 2);
let is: Vec<_> = insns.iter().collect();
assert_eq!(is[0].mnemonic().unwrap(), "push");
assert_eq!(is[1].mnemonic().unwrap(), "mov");
assert_eq!(is[0].address, 0x1000);
assert_eq!(is[1].address, 0x1001);
} else {
assert!(false, "Couldn't disasm instructions")
}
},
None => {
assert!(false, "Couldn't create a cs engine");
}
}
}
}
| extern crate libc;
pub mod instruction;
pub mod constants;
pub mod ffi;
pub mod capstone;
pub use instruction::*;
pub use constants::*;
pub use capstone::Capstone;
/// An opaque reference to a capstone engine.
///
/// bindgen by default used this type name everywhere, so it is easier to leave it with a confusing
/// name.
///
/// It should not be exported, rust's new visibility rules make tackling this not immediately
/// obvious
#[allow(non_camel_case_types)]
pub type csh = libc::size_t;
+
+ #[cfg(test)]
+ mod test {
+ use super::*;
+ static CODE: &'static [u8] = b"\x55\x48\x8b\x05\xb8\x13\x00\x00";
+
+ #[test]
+ fn test_x86_simple() {
+ match capstone::Capstone::new(constants::CsArch::ARCH_X86,
+ constants::CsMode::MODE_64) {
+ Some(cs) => {
+ if let Some(insns) = cs.disasm(CODE, 0x1000, 0) {
+ assert_eq!(insns.len(), 2);
+ let is: Vec<_> = insns.iter().collect();
+ assert_eq!(is[0].mnemonic().unwrap(), "push");
+ assert_eq!(is[1].mnemonic().unwrap(), "mov");
+
+ assert_eq!(is[0].address, 0x1000);
+ assert_eq!(is[1].address, 0x1001);
+ } else {
+ assert!(false, "Couldn't disasm instructions")
+ }
+ },
+ None => {
+ assert!(false, "Couldn't create a cs engine");
+ }
+ }
+ }
+ } | 29 | 1.380952 | 29 | 0 |
f9b88d84706a0d0e1f8d48c29d38d45563c93c14 | metadata/com.u17od.upm.txt | metadata/com.u17od.upm.txt | Categories:System
License:GPLv3
Web Site:http://upm.sourceforge.net
Source Code:https://github.com/adrian/upm-android
Issue Tracker:https://github.com/adrian/upm-android/issues
Auto Name:UPM
Summary:Cross platform password manager
Description:
* Uses AES for database encryption
* Database sync across multiple PCs/devices
* Android, Windows and Mac OS X native feeling versions available
* Fast account searching
.
Repo Type:git
Repo:https://github.com/adrian/upm-android.git
Build:1.14,15
commit=v1.14
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.15
Current Version Code:20
| Categories:System
License:GPLv3
Web Site:http://upm.sourceforge.net
Source Code:https://github.com/adrian/upm-android
Issue Tracker:https://github.com/adrian/upm-android/issues
Auto Name:UPM
Summary:Cross platform password manager
Description:
* Uses AES for database encryption
* Database sync across multiple PCs/devices
* Android, Windows and Mac OS X native feeling versions available
* Fast account searching
.
Repo Type:git
Repo:https://github.com/adrian/upm-android.git
Build:1.14,15
commit=v1.14
Build:1.15,20
commit=v1.15
scanignore=jssecacerts
Maintainer Notes:
Includes jar files, especially dropbox-sdk which is most likely non free.
However, app was added years ago...
.
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.15
Current Version Code:20
| Update UPM to 1.15 (20) | Update UPM to 1.15 (20)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data | text | ## Code Before:
Categories:System
License:GPLv3
Web Site:http://upm.sourceforge.net
Source Code:https://github.com/adrian/upm-android
Issue Tracker:https://github.com/adrian/upm-android/issues
Auto Name:UPM
Summary:Cross platform password manager
Description:
* Uses AES for database encryption
* Database sync across multiple PCs/devices
* Android, Windows and Mac OS X native feeling versions available
* Fast account searching
.
Repo Type:git
Repo:https://github.com/adrian/upm-android.git
Build:1.14,15
commit=v1.14
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.15
Current Version Code:20
## Instruction:
Update UPM to 1.15 (20)
## Code After:
Categories:System
License:GPLv3
Web Site:http://upm.sourceforge.net
Source Code:https://github.com/adrian/upm-android
Issue Tracker:https://github.com/adrian/upm-android/issues
Auto Name:UPM
Summary:Cross platform password manager
Description:
* Uses AES for database encryption
* Database sync across multiple PCs/devices
* Android, Windows and Mac OS X native feeling versions available
* Fast account searching
.
Repo Type:git
Repo:https://github.com/adrian/upm-android.git
Build:1.14,15
commit=v1.14
Build:1.15,20
commit=v1.15
scanignore=jssecacerts
Maintainer Notes:
Includes jar files, especially dropbox-sdk which is most likely non free.
However, app was added years ago...
.
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.15
Current Version Code:20
| Categories:System
License:GPLv3
Web Site:http://upm.sourceforge.net
Source Code:https://github.com/adrian/upm-android
Issue Tracker:https://github.com/adrian/upm-android/issues
Auto Name:UPM
Summary:Cross platform password manager
Description:
* Uses AES for database encryption
* Database sync across multiple PCs/devices
* Android, Windows and Mac OS X native feeling versions available
* Fast account searching
.
Repo Type:git
Repo:https://github.com/adrian/upm-android.git
Build:1.14,15
commit=v1.14
+ Build:1.15,20
+ commit=v1.15
+ scanignore=jssecacerts
+
+ Maintainer Notes:
+ Includes jar files, especially dropbox-sdk which is most likely non free.
+ However, app was added years ago...
+ .
+
Auto Update Mode:None
Update Check Mode:Tags
Current Version:1.15
Current Version Code:20 | 9 | 0.36 | 9 | 0 |
16117afed4ebc4e9f33c2f2ff0826aadcfdf8465 | app/views/layouts/doorkeeper/application.html.erb | app/views/layouts/doorkeeper/application.html.erb | <!DOCTYPE html>
<html>
<head>
<title>Doorkeeper</title>
<%= stylesheet_link_tag "doorkeeper/application" %>
<%= javascript_include_tag "doorkeeper/application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>Doorkeeper</title>
<%= stylesheet_link_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css" %>
<%= stylesheet_link_tag "doorkeeper/application" %>
<%= javascript_include_tag "doorkeeper/application" %>
<%= csrf_meta_tags %>
</head>
<body>
<section id="main" class="container">
<div class="content">
<div class="row">
<% flash.each do |key, message| %>
<div class="span16">
<div class="alert-message <%= key %>" data-alert><a class="close" href="#">×</a><p><%= message %></p></div>
</div>
<% end %>
<%= yield %>
</div>
</div>
</section>
</body>
</html>
| Add twitter bootstrap stylesheet to layout | Add twitter bootstrap stylesheet to layout
| HTML+ERB | mit | 6fusion/doorkeeper,EasterAndJay/doorkeeper,daande/doorkeeper,lalithr95/doorkeeper,outstand/doorkeeper,outstand/doorkeeper,dollarshaveclub/doorkeeper,telekomatrix/doorkeeper,mavenlink/doorkeeper,pmdeazeta/doorkeeper,telekomatrix/doorkeeper,kolorahl/doorkeeper,ValMilkevich/doorkeeper,doorkeeper-gem/doorkeeper,AICIDNN/doorkeeper,ukasiu/doorkeeper,vovimayhem/doorkeeper,ifeelgoods/doorkeeper,vanboom/doorkeeper,6fusion/doorkeeper,dk1234567/doorkeeper,stormz/doorkeeper,calfzhou/doorkeeper,ezilocchi/doorkeeper,dk1234567/doorkeeper,kolorahl/doorkeeper,CloudTags/doorkeeper,Tout/doorkeeper,dollarshaveclub/doorkeeper,moneytree/doorkeeper,vanboom/doorkeeper,stefania11/doorkeeper,mavenlink/doorkeeper,CloudTags/doorkeeper,Uysim/doorkeeper,jasl/doorkeeper,ukasiu/doorkeeper,EasterAndJay/doorkeeper,nbulaj/doorkeeper,GeekOnCoffee/doorkeeper,calfzhou/doorkeeper,AdStage/doorkeeper,AICIDNN/doorkeeper,jasl/doorkeeper,identification-io/doorkeeper,mavenlink/doorkeeper,Tout/doorkeeper,pmdeazeta/doorkeeper,shivakumaarmgs/doorkeeper,jasl/doorkeeper,CloudTags/doorkeeper,Uysim/doorkeeper,CloudTags/doorkeeper,phillbaker/doorkeeper,doorkeeper-gem/doorkeeper,ezilocchi/doorkeeper,vovimayhem/doorkeeper,ifeelgoods/doorkeeper,moneytree/doorkeeper,coinbase/modified-doorkeeper,Tout/doorkeeper,ValMilkevich/doorkeeper,stefania11/doorkeeper,lalithr95/doorkeeper,ifeelgoods/doorkeeper,coinbase/modified-doorkeeper,GeekOnCoffee/doorkeeper,coinbase/modified-doorkeeper,stormz/doorkeeper,nbulaj/doorkeeper,ngpestelos/doorkeeper,ministryofjustice/doorkeeper,identification-io/doorkeeper,ngpestelos/doorkeeper,daande/doorkeeper,AdStage/doorkeeper,shivakumaarmgs/doorkeeper,ministryofjustice/doorkeeper,outstand/doorkeeper,doorkeeper-gem/doorkeeper | html+erb | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>Doorkeeper</title>
<%= stylesheet_link_tag "doorkeeper/application" %>
<%= javascript_include_tag "doorkeeper/application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
## Instruction:
Add twitter bootstrap stylesheet to layout
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>Doorkeeper</title>
<%= stylesheet_link_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css" %>
<%= stylesheet_link_tag "doorkeeper/application" %>
<%= javascript_include_tag "doorkeeper/application" %>
<%= csrf_meta_tags %>
</head>
<body>
<section id="main" class="container">
<div class="content">
<div class="row">
<% flash.each do |key, message| %>
<div class="span16">
<div class="alert-message <%= key %>" data-alert><a class="close" href="#">×</a><p><%= message %></p></div>
</div>
<% end %>
<%= yield %>
</div>
</div>
</section>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>Doorkeeper</title>
+ <%= stylesheet_link_tag "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css" %>
<%= stylesheet_link_tag "doorkeeper/application" %>
<%= javascript_include_tag "doorkeeper/application" %>
<%= csrf_meta_tags %>
</head>
<body>
+ <section id="main" class="container">
+ <div class="content">
+ <div class="row">
+ <% flash.each do |key, message| %>
+ <div class="span16">
+ <div class="alert-message <%= key %>" data-alert><a class="close" href="#">×</a><p><%= message %></p></div>
+ </div>
+ <% end %>
- <%= yield %>
+ <%= yield %>
? ++++++++
-
+ </div>
+ </div>
+ </section>
</body>
</html> | 15 | 1.071429 | 13 | 2 |
dcdfe91570e185df19daef49be9a368276e20483 | src/core/migrations/0039_fix_reviewer_url.py | src/core/migrations/0039_fix_reviewer_url.py | from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
SettingValueTranslation = apps.get_model('core', 'SettingValueTranslation')
settings = SettingValueTranslation.objects.all()
for setting in settings:
setting.value = re.sub(REGEX, OUTPUT, setting.value)
setting.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0038_xslt_1-3-8'),
]
operations = [
migrations.RunPython(replace_template, reverse_code=migrations.RunPython.noop)
]
| from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
SettingValueTranslation = apps.get_model('core', 'SettingValueTranslation')
settings = SettingValueTranslation.objects.all()
for setting in settings:
if isinstance(setting.value, str):
setting.value = re.sub(REGEX, OUTPUT, setting.value)
setting.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0038_xslt_1-3-8'),
]
operations = [
migrations.RunPython(replace_template, reverse_code=migrations.RunPython.noop)
]
| Handle migrating non-string values (i.e.: NULL) | Handle migrating non-string values (i.e.: NULL)
| Python | agpl-3.0 | BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway | python | ## Code Before:
from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
SettingValueTranslation = apps.get_model('core', 'SettingValueTranslation')
settings = SettingValueTranslation.objects.all()
for setting in settings:
setting.value = re.sub(REGEX, OUTPUT, setting.value)
setting.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0038_xslt_1-3-8'),
]
operations = [
migrations.RunPython(replace_template, reverse_code=migrations.RunPython.noop)
]
## Instruction:
Handle migrating non-string values (i.e.: NULL)
## Code After:
from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
SettingValueTranslation = apps.get_model('core', 'SettingValueTranslation')
settings = SettingValueTranslation.objects.all()
for setting in settings:
if isinstance(setting.value, str):
setting.value = re.sub(REGEX, OUTPUT, setting.value)
setting.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0038_xslt_1-3-8'),
]
operations = [
migrations.RunPython(replace_template, reverse_code=migrations.RunPython.noop)
]
| from __future__ import unicode_literals
import re
from django.db import migrations
REGEX = re.compile("({%\ ?journal_url 'do_review' review_assignment.id\ ?%})")
OUTPUT = "{{ review_url }}"
def replace_template(apps, schema_editor):
SettingValueTranslation = apps.get_model('core', 'SettingValueTranslation')
settings = SettingValueTranslation.objects.all()
for setting in settings:
+ if isinstance(setting.value, str):
- setting.value = re.sub(REGEX, OUTPUT, setting.value)
+ setting.value = re.sub(REGEX, OUTPUT, setting.value)
? ++++
- setting.save()
+ setting.save()
? ++++
class Migration(migrations.Migration):
dependencies = [
('core', '0038_xslt_1-3-8'),
]
operations = [
migrations.RunPython(replace_template, reverse_code=migrations.RunPython.noop)
] | 5 | 0.192308 | 3 | 2 |
72417e35a56964ff3a97f307387de8bd2e253dca | lib/que/adapters/pg.rb | lib/que/adapters/pg.rb | module Que
class PG < Adapter
def initialize(pg)
@pg = pg
@mutex = Mutex.new
end
def checkout
@mutex.synchronize { yield @pg }
end
end
end
| require 'monitor'
module Que
class PG < Adapter
def initialize(pg)
@pg = pg
@monitor = Monitor.new
end
def checkout
@monitor.synchronize { yield @pg }
end
end
end
| Make sure that locking the bare PG connection is reentrant. | Make sure that locking the bare PG connection is reentrant.
| Ruby | mit | goddamnhippie/que,brandur/que,chanks/que,gocardless/que,zloydadka/que,hardbap/que,gocardless/que,godfat/que,joevandyk/que,heroku/que | ruby | ## Code Before:
module Que
class PG < Adapter
def initialize(pg)
@pg = pg
@mutex = Mutex.new
end
def checkout
@mutex.synchronize { yield @pg }
end
end
end
## Instruction:
Make sure that locking the bare PG connection is reentrant.
## Code After:
require 'monitor'
module Que
class PG < Adapter
def initialize(pg)
@pg = pg
@monitor = Monitor.new
end
def checkout
@monitor.synchronize { yield @pg }
end
end
end
| + require 'monitor'
+
module Que
class PG < Adapter
def initialize(pg)
- @pg = pg
+ @pg = pg
? ++
- @mutex = Mutex.new
+ @monitor = Monitor.new
end
def checkout
- @mutex.synchronize { yield @pg }
? ^ ^^
+ @monitor.synchronize { yield @pg }
? ^^^ ^^
end
end
end | 8 | 0.666667 | 5 | 3 |
78f99881275427d9b18b1d86bf1fa8b72abf1cae | README.md | README.md |
> A modern Arch workflow with an emphasis on functionality.
|
> A modern Arch workflow with an emphasis on functionality.
## Table of Contents
- Philosophy
- GNU/Linux
- Arch Linux
- Use Case
- Features
- Installation
- Installing From Source
- Using a Pre-Compiled Image
- Post-Installation
- Workflow
- Help
- Contributing
| Add general overview of the table of contents | Add general overview of the table of contents
| Markdown | mit | GloverDonovan/new-start | markdown | ## Code Before:
> A modern Arch workflow with an emphasis on functionality.
## Instruction:
Add general overview of the table of contents
## Code After:
> A modern Arch workflow with an emphasis on functionality.
## Table of Contents
- Philosophy
- GNU/Linux
- Arch Linux
- Use Case
- Features
- Installation
- Installing From Source
- Using a Pre-Compiled Image
- Post-Installation
- Workflow
- Help
- Contributing
|
> A modern Arch workflow with an emphasis on functionality.
+ ## Table of Contents
+
+ - Philosophy
+ - GNU/Linux
+ - Arch Linux
+ - Use Case
+ - Features
+ - Installation
+ - Installing From Source
+ - Using a Pre-Compiled Image
+ - Post-Installation
+ - Workflow
+ - Help
+ - Contributing
+ | 15 | 5 | 15 | 0 |
8bd08f09812d756760f1854ae227ba0353969f80 | concrete/src/Updater/Migrations/Migrations/Version20181112211702.php | concrete/src/Updater/Migrations/Migrations/Version20181112211702.php | <?php
namespace Concrete\Core\Updater\Migrations\Migrations;
use Concrete\Core\Updater\Migrations\AbstractMigration;
class Version20181112211702 extends AbstractMigration
{
public function upgradeDatabase()
{
$this->refreshEntities([
'Concrete\Core\Entity\Express\Control\AssociationControl',
]);
}
} | <?php
namespace Concrete\Core\Updater\Migrations\Migrations;
use Concrete\Core\Updater\Migrations\AbstractMigration;
use Concrete\Core\Updater\Migrations\RepeatableMigrationInterface;
class Version20181112211702 extends AbstractMigration implements RepeatableMigrationInterface
{
public function upgradeDatabase()
{
$this->refreshEntities([
'Concrete\Core\Entity\Express\Control\AssociationControl',
]);
}
}
| Mark migration 20181112211702 as repeatable | Mark migration 20181112211702 as repeatable
| PHP | mit | deek87/concrete5,concrete5/concrete5,jaromirdalecky/concrete5,haeflimi/concrete5,rikzuiderlicht/concrete5,jaromirdalecky/concrete5,olsgreen/concrete5,rikzuiderlicht/concrete5,hissy/concrete5,mainio/concrete5,rikzuiderlicht/concrete5,haeflimi/concrete5,mlocati/concrete5,concrete5/concrete5,mlocati/concrete5,biplobice/concrete5,hissy/concrete5,olsgreen/concrete5,haeflimi/concrete5,haeflimi/concrete5,MrKarlDilkington/concrete5,jaromirdalecky/concrete5,hissy/concrete5,deek87/concrete5,biplobice/concrete5,biplobice/concrete5,jaromirdalecky/concrete5,olsgreen/concrete5,concrete5/concrete5,mainio/concrete5,concrete5/concrete5,mlocati/concrete5,MrKarlDilkington/concrete5,hissy/concrete5,deek87/concrete5,biplobice/concrete5,mainio/concrete5,mlocati/concrete5,deek87/concrete5,MrKarlDilkington/concrete5 | php | ## Code Before:
<?php
namespace Concrete\Core\Updater\Migrations\Migrations;
use Concrete\Core\Updater\Migrations\AbstractMigration;
class Version20181112211702 extends AbstractMigration
{
public function upgradeDatabase()
{
$this->refreshEntities([
'Concrete\Core\Entity\Express\Control\AssociationControl',
]);
}
}
## Instruction:
Mark migration 20181112211702 as repeatable
## Code After:
<?php
namespace Concrete\Core\Updater\Migrations\Migrations;
use Concrete\Core\Updater\Migrations\AbstractMigration;
use Concrete\Core\Updater\Migrations\RepeatableMigrationInterface;
class Version20181112211702 extends AbstractMigration implements RepeatableMigrationInterface
{
public function upgradeDatabase()
{
$this->refreshEntities([
'Concrete\Core\Entity\Express\Control\AssociationControl',
]);
}
}
| <?php
namespace Concrete\Core\Updater\Migrations\Migrations;
use Concrete\Core\Updater\Migrations\AbstractMigration;
+ use Concrete\Core\Updater\Migrations\RepeatableMigrationInterface;
- class Version20181112211702 extends AbstractMigration
+ class Version20181112211702 extends AbstractMigration implements RepeatableMigrationInterface
{
-
public function upgradeDatabase()
{
$this->refreshEntities([
'Concrete\Core\Entity\Express\Control\AssociationControl',
]);
}
} | 4 | 0.25 | 2 | 2 |
ffb3d0a6054df0a4cc74400ba6f8c3ad98475d8f | lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_slack_message.rb | lib/slack-ruby-bot/rspec/support/slack-ruby-bot/respond_with_slack_message.rb | require 'rspec/expectations'
RSpec::Matchers.define :respond_with_slack_message do |expected|
match do |actual|
channel, user, message = parse(actual)
allow(Giphy).to receive(:random)
client = double(Slack::RealTime::Client)
expect(SlackRubyBot::Commands::Base).to receive(:send_client_message).with(client, channel: channel, text: expected)
app.send(:message, client, text: message, channel: channel, user: user)
true
end
private
def parse(actual)
actual = { message: actual } unless actual.is_a?(Hash)
[actual[:channel] || 'channel', actual[:user] || 'user', actual[:message]]
end
end
| require 'rspec/expectations'
RSpec::Matchers.define :respond_with_slack_message do |expected|
match do |actual|
channel, user, message = parse(actual)
allow(Giphy).to receive(:random)
client = app.send(:client)
expect(SlackRubyBot::Commands::Base).to receive(:send_client_message).with(client, channel: channel, text: expected)
app.send(:message, client, text: message, channel: channel, user: user)
true
end
private
def parse(actual)
actual = { message: actual } unless actual.is_a?(Hash)
[actual[:channel] || 'channel', actual[:user] || 'user', actual[:message]]
end
end
| Use a real client method to avoid stumbling on an unmet expectation. | Use a real client method to avoid stumbling on an unmet expectation.
| Ruby | mit | dblock/slack-ruby-bot,maclover7/slack-ruby-bot,orta/slack-ruby-bot,MarkySmarky/slack-ruby-bot,cakejelly/slack-ruby-bot,ZubKonst/slack-ruby-bot,slack-ruby/slack-ruby-bot | ruby | ## Code Before:
require 'rspec/expectations'
RSpec::Matchers.define :respond_with_slack_message do |expected|
match do |actual|
channel, user, message = parse(actual)
allow(Giphy).to receive(:random)
client = double(Slack::RealTime::Client)
expect(SlackRubyBot::Commands::Base).to receive(:send_client_message).with(client, channel: channel, text: expected)
app.send(:message, client, text: message, channel: channel, user: user)
true
end
private
def parse(actual)
actual = { message: actual } unless actual.is_a?(Hash)
[actual[:channel] || 'channel', actual[:user] || 'user', actual[:message]]
end
end
## Instruction:
Use a real client method to avoid stumbling on an unmet expectation.
## Code After:
require 'rspec/expectations'
RSpec::Matchers.define :respond_with_slack_message do |expected|
match do |actual|
channel, user, message = parse(actual)
allow(Giphy).to receive(:random)
client = app.send(:client)
expect(SlackRubyBot::Commands::Base).to receive(:send_client_message).with(client, channel: channel, text: expected)
app.send(:message, client, text: message, channel: channel, user: user)
true
end
private
def parse(actual)
actual = { message: actual } unless actual.is_a?(Hash)
[actual[:channel] || 'channel', actual[:user] || 'user', actual[:message]]
end
end
| require 'rspec/expectations'
RSpec::Matchers.define :respond_with_slack_message do |expected|
match do |actual|
channel, user, message = parse(actual)
allow(Giphy).to receive(:random)
- client = double(Slack::RealTime::Client)
+ client = app.send(:client)
expect(SlackRubyBot::Commands::Base).to receive(:send_client_message).with(client, channel: channel, text: expected)
app.send(:message, client, text: message, channel: channel, user: user)
true
end
private
def parse(actual)
actual = { message: actual } unless actual.is_a?(Hash)
[actual[:channel] || 'channel', actual[:user] || 'user', actual[:message]]
end
end | 2 | 0.105263 | 1 | 1 |
cb9c3257a41c8cae8217f7260651a953ecf65cac | ceph/cephx.sls | ceph/cephx.sls | ceph:
service.running:
- enable: True
volumes-user:
file.managed:
- name: /etc/ceph/ceph.client.volumes.keyring
- mode: 440
- require:
- cmd: volumes-user
cmd.run:
- name: >-
ceph auth get-or-create client.volumes \
mon 'allow r' \
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=volumes,
allow rx pool=images' > /etc/ceph/ceph.client.volumes.keyring
images-user:
file.managed:
- name: /etc/ceph/ceph.client.images.keyring
- mode: 440
- require:
- cmd: images-user
cmd.run:
- name: >-
ceph auth get-or-create client.images \
mon 'allow r' \
mds 'allow' \
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=images' > /etc/ceph/ceph.client.images.keyring
instances-user:
file.managed:
- name: /etc/ceph/ceph.client.instances.keyring
- mode: 440
- require:
- cmd: instances-user
cmd.run:
- name: >-
ceph auth get-or-create client.images \
mon 'allow r' \
mds 'allow' \
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=instances' > /etc/ceph/ceph.client.instances.keyring
| ceph:
service.running:
- enable: True
volumes-user:
file.managed:
- name: /etc/ceph/ceph.client.volumes.keyring
- mode: 440
- require:
- cmd: volumes-user
cmd.run:
- name: >-
ceph auth get-or-create client.volumes
mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=volumes,
allow rx pool=images' > /etc/ceph/ceph.client.volumes.keyring
images-user:
file.managed:
- name: /etc/ceph/ceph.client.images.keyring
- mode: 440
- require:
- cmd: images-user
cmd.run:
- name: >-
ceph auth get-or-create client.images
mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=images' > /etc/ceph/ceph.client.images.keyring
instances-user:
file.managed:
- name: /etc/ceph/ceph.client.instances.keyring
- mode: 440
- require:
- cmd: instances-user
cmd.run:
- name: >-
ceph auth get-or-create client.images
mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=instances' > /etc/ceph/ceph.client.instances.keyring
| Change cmd to not use \ for line separation, its not necessary. | Change cmd to not use \ for line separation, its not necessary.
| SaltStack | bsd-2-clause | jahkeup/salt-openstack,jahkeup/salt-openstack | saltstack | ## Code Before:
ceph:
service.running:
- enable: True
volumes-user:
file.managed:
- name: /etc/ceph/ceph.client.volumes.keyring
- mode: 440
- require:
- cmd: volumes-user
cmd.run:
- name: >-
ceph auth get-or-create client.volumes \
mon 'allow r' \
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=volumes,
allow rx pool=images' > /etc/ceph/ceph.client.volumes.keyring
images-user:
file.managed:
- name: /etc/ceph/ceph.client.images.keyring
- mode: 440
- require:
- cmd: images-user
cmd.run:
- name: >-
ceph auth get-or-create client.images \
mon 'allow r' \
mds 'allow' \
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=images' > /etc/ceph/ceph.client.images.keyring
instances-user:
file.managed:
- name: /etc/ceph/ceph.client.instances.keyring
- mode: 440
- require:
- cmd: instances-user
cmd.run:
- name: >-
ceph auth get-or-create client.images \
mon 'allow r' \
mds 'allow' \
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=instances' > /etc/ceph/ceph.client.instances.keyring
## Instruction:
Change cmd to not use \ for line separation, its not necessary.
## Code After:
ceph:
service.running:
- enable: True
volumes-user:
file.managed:
- name: /etc/ceph/ceph.client.volumes.keyring
- mode: 440
- require:
- cmd: volumes-user
cmd.run:
- name: >-
ceph auth get-or-create client.volumes
mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=volumes,
allow rx pool=images' > /etc/ceph/ceph.client.volumes.keyring
images-user:
file.managed:
- name: /etc/ceph/ceph.client.images.keyring
- mode: 440
- require:
- cmd: images-user
cmd.run:
- name: >-
ceph auth get-or-create client.images
mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=images' > /etc/ceph/ceph.client.images.keyring
instances-user:
file.managed:
- name: /etc/ceph/ceph.client.instances.keyring
- mode: 440
- require:
- cmd: instances-user
cmd.run:
- name: >-
ceph auth get-or-create client.images
mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=instances' > /etc/ceph/ceph.client.instances.keyring
| ceph:
service.running:
- enable: True
volumes-user:
file.managed:
- name: /etc/ceph/ceph.client.volumes.keyring
- mode: 440
- require:
- cmd: volumes-user
cmd.run:
- name: >-
- ceph auth get-or-create client.volumes \
? --
+ ceph auth get-or-create client.volumes
- mon 'allow r' \
? --
+ mon 'allow r'
mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=volumes,
allow rx pool=images' > /etc/ceph/ceph.client.volumes.keyring
images-user:
file.managed:
- name: /etc/ceph/ceph.client.images.keyring
- mode: 440
- require:
- cmd: images-user
cmd.run:
- name: >-
- ceph auth get-or-create client.images \
? --
+ ceph auth get-or-create client.images
- mon 'allow r' \
? --
+ mon 'allow r'
- mds 'allow' \
? --
+ mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=images' > /etc/ceph/ceph.client.images.keyring
instances-user:
file.managed:
- name: /etc/ceph/ceph.client.instances.keyring
- mode: 440
- require:
- cmd: instances-user
cmd.run:
- name: >-
- ceph auth get-or-create client.images \
? --
+ ceph auth get-or-create client.images
- mon 'allow r' \
? --
+ mon 'allow r'
- mds 'allow' \
? --
+ mds 'allow'
osd 'allow class-read object_prefix rbd_children,
allow rwx pool=instances' > /etc/ceph/ceph.client.instances.keyring
| 16 | 0.326531 | 8 | 8 |
3bb9350eac58e23af2e77d1fae26c1bf003c5656 | composer.json | composer.json | {
"require": {
"php": ">=7.0",
"ext-curl": "*",
"slim/slim": "^3.5",
"slim/twig-view": "^2.1",
"php-di/slim-bridge": "^1.0",
"vlucas/phpdotenv": "^2.3",
"doctrine/cache": "^1.6",
"zendframework/zend-authentication": "^2.5",
"zendframework/zend-session": "^2.7"
},
"autoload": {
"psr-4": {
"Map\\": "src/Map/"
}
}
}
| {
"require": {
"php": ">=7.0",
"ext-curl": "*",
"ext-xml": "*",
"slim/slim": "^3.5",
"slim/twig-view": "^2.1",
"php-di/slim-bridge": "^1.0",
"vlucas/phpdotenv": "^2.3",
"doctrine/cache": "^1.6",
"zendframework/zend-authentication": "^2.5",
"zendframework/zend-session": "^2.7"
},
"autoload": {
"psr-4": {
"Map\\": "src/Map/"
}
}
}
| Add php-xml as a dependency | Add php-xml as a dependency
| JSON | mit | samgreenwood/nodemap,samgreenwood/nodemap,samgreenwood/nodemap | json | ## Code Before:
{
"require": {
"php": ">=7.0",
"ext-curl": "*",
"slim/slim": "^3.5",
"slim/twig-view": "^2.1",
"php-di/slim-bridge": "^1.0",
"vlucas/phpdotenv": "^2.3",
"doctrine/cache": "^1.6",
"zendframework/zend-authentication": "^2.5",
"zendframework/zend-session": "^2.7"
},
"autoload": {
"psr-4": {
"Map\\": "src/Map/"
}
}
}
## Instruction:
Add php-xml as a dependency
## Code After:
{
"require": {
"php": ">=7.0",
"ext-curl": "*",
"ext-xml": "*",
"slim/slim": "^3.5",
"slim/twig-view": "^2.1",
"php-di/slim-bridge": "^1.0",
"vlucas/phpdotenv": "^2.3",
"doctrine/cache": "^1.6",
"zendframework/zend-authentication": "^2.5",
"zendframework/zend-session": "^2.7"
},
"autoload": {
"psr-4": {
"Map\\": "src/Map/"
}
}
}
| {
"require": {
"php": ">=7.0",
"ext-curl": "*",
+ "ext-xml": "*",
"slim/slim": "^3.5",
"slim/twig-view": "^2.1",
"php-di/slim-bridge": "^1.0",
"vlucas/phpdotenv": "^2.3",
"doctrine/cache": "^1.6",
"zendframework/zend-authentication": "^2.5",
"zendframework/zend-session": "^2.7"
},
"autoload": {
"psr-4": {
"Map\\": "src/Map/"
}
}
} | 1 | 0.055556 | 1 | 0 |
4078743923befac99672b67ea53fd1fe11af2e8c | tests/test_mjviewer.py | tests/test_mjviewer.py | import unittest
from mujoco_py import mjviewer, mjcore
class MjLibTest(unittest.TestCase):
xml_path = 'tests/models/cartpole.xml'
def setUp(self):
self.width = 100
self.height = 100
self.viewer = mjviewer.MjViewer(visible=False,
init_width=self.width,
init_height=self.height)
def tearDown(self):
self.viewer.finish()
self.viewer = None
def test_start(self):
self.viewer.start()
self.assertTrue(self.viewer.running)
def test_render(self):
self.viewer.start()
model = mjcore.MjModel(self.xml_path)
self.viewer.set_model(model)
(data, width, height) = self.viewer.get_image()
# check image size is consistent
# note that width and height may not equal self.width and self.height
# e.g. on a computer with retina screen,
# the width and height are scaled
self.assertEqual(len(data), 3 * width * height)
# make sure the image is not pitch black
self.assertTrue(any(map(ord, data)))
| import unittest
from mujoco_py import mjviewer, mjcore
class MjLibTest(unittest.TestCase):
xml_path = 'tests/models/cartpole.xml'
def setUp(self):
self.width = 100
self.height = 100
self.viewer = mjviewer.MjViewer(visible=False,
init_width=self.width,
init_height=self.height)
def tearDown(self):
self.viewer.finish()
self.viewer = None
def test_start(self):
self.viewer.start()
self.assertTrue(self.viewer.running)
def test_render(self):
self.viewer.start()
model = mjcore.MjModel(self.xml_path)
self.viewer.set_model(model)
(data, width, height) = self.viewer.get_image()
# check image size is consistent
# note that width and height may not equal self.width and self.height
# e.g. on a computer with retina screen,
# the width and height are scaled
self.assertEqual(len(data), 3 * width * height)
# make sure the image is not pitch black
self.assertTrue(any(map(lambda x: x > 0, data)))
| Stop using ord with ints | Stop using ord with ints
| Python | mit | pulkitag/mujoco140-py,pulkitag/mujoco140-py,pulkitag/mujoco140-py | python | ## Code Before:
import unittest
from mujoco_py import mjviewer, mjcore
class MjLibTest(unittest.TestCase):
xml_path = 'tests/models/cartpole.xml'
def setUp(self):
self.width = 100
self.height = 100
self.viewer = mjviewer.MjViewer(visible=False,
init_width=self.width,
init_height=self.height)
def tearDown(self):
self.viewer.finish()
self.viewer = None
def test_start(self):
self.viewer.start()
self.assertTrue(self.viewer.running)
def test_render(self):
self.viewer.start()
model = mjcore.MjModel(self.xml_path)
self.viewer.set_model(model)
(data, width, height) = self.viewer.get_image()
# check image size is consistent
# note that width and height may not equal self.width and self.height
# e.g. on a computer with retina screen,
# the width and height are scaled
self.assertEqual(len(data), 3 * width * height)
# make sure the image is not pitch black
self.assertTrue(any(map(ord, data)))
## Instruction:
Stop using ord with ints
## Code After:
import unittest
from mujoco_py import mjviewer, mjcore
class MjLibTest(unittest.TestCase):
xml_path = 'tests/models/cartpole.xml'
def setUp(self):
self.width = 100
self.height = 100
self.viewer = mjviewer.MjViewer(visible=False,
init_width=self.width,
init_height=self.height)
def tearDown(self):
self.viewer.finish()
self.viewer = None
def test_start(self):
self.viewer.start()
self.assertTrue(self.viewer.running)
def test_render(self):
self.viewer.start()
model = mjcore.MjModel(self.xml_path)
self.viewer.set_model(model)
(data, width, height) = self.viewer.get_image()
# check image size is consistent
# note that width and height may not equal self.width and self.height
# e.g. on a computer with retina screen,
# the width and height are scaled
self.assertEqual(len(data), 3 * width * height)
# make sure the image is not pitch black
self.assertTrue(any(map(lambda x: x > 0, data)))
| import unittest
from mujoco_py import mjviewer, mjcore
class MjLibTest(unittest.TestCase):
xml_path = 'tests/models/cartpole.xml'
def setUp(self):
self.width = 100
self.height = 100
self.viewer = mjviewer.MjViewer(visible=False,
init_width=self.width,
init_height=self.height)
def tearDown(self):
self.viewer.finish()
self.viewer = None
def test_start(self):
self.viewer.start()
self.assertTrue(self.viewer.running)
def test_render(self):
self.viewer.start()
model = mjcore.MjModel(self.xml_path)
self.viewer.set_model(model)
(data, width, height) = self.viewer.get_image()
# check image size is consistent
# note that width and height may not equal self.width and self.height
# e.g. on a computer with retina screen,
# the width and height are scaled
self.assertEqual(len(data), 3 * width * height)
# make sure the image is not pitch black
- self.assertTrue(any(map(ord, data)))
? ^^
+ self.assertTrue(any(map(lambda x: x > 0, data)))
? ^^^^ ++++++++++
| 2 | 0.052632 | 1 | 1 |
b39c8f7da37752578ee3e33264251a3025b1bb9a | public/examples/Intermediate/Clock.elm | public/examples/Intermediate/Clock.elm |
main = lift clock (every second)
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
, outlined (solid grey) (ngon 12 110)
, hand orange 100 t
, hand charcoal 100 (t/60)
, hand charcoal 60 (t/720) ]
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle) | main = lift clock (every second)
radius = 100
shortHandLength = radius * 0.6
longHandLength = radius * 0.9
clock t = collage 400 400 [ filled lightGrey (circle radius)
, outlined (solid grey) (circle radius)
, hand orange longHandLength t
, hand charcoal longHandLength (t/60)
, hand charcoal shortHandLength (t/720) ]
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle)
| Make the clock a circle and extract constants | Make the clock a circle and extract constants | Elm | bsd-3-clause | thSoft/elm-lang.org | elm | ## Code Before:
main = lift clock (every second)
clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
, outlined (solid grey) (ngon 12 110)
, hand orange 100 t
, hand charcoal 100 (t/60)
, hand charcoal 60 (t/720) ]
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle)
## Instruction:
Make the clock a circle and extract constants
## Code After:
main = lift clock (every second)
radius = 100
shortHandLength = radius * 0.6
longHandLength = radius * 0.9
clock t = collage 400 400 [ filled lightGrey (circle radius)
, outlined (solid grey) (circle radius)
, hand orange longHandLength t
, hand charcoal longHandLength (t/60)
, hand charcoal shortHandLength (t/720) ]
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle)
| -
main = lift clock (every second)
+ radius = 100
+ shortHandLength = radius * 0.6
+ longHandLength = radius * 0.9
+
- clock t = collage 400 400 [ filled lightGrey (ngon 12 110)
? --- ^^^^^^^^^^^^^
+ clock t = collage 400 400 [ filled lightGrey (circle radius)
? +++++++ ^^^^^^
- , outlined (solid grey) (ngon 12 110)
? ^^^^ ^^^^^^
+ , outlined (solid grey) (circle radius)
? ^^^^^^ ^^^^^^
- , hand orange 100 t
? ^^^^^^
+ , hand orange longHandLength t
? ^^^^^^^^^^^^^^
- , hand charcoal 100 (t/60)
? ^^^
+ , hand charcoal longHandLength (t/60)
? ^^^^^^^^^^^^^^
- , hand charcoal 60 (t/720) ]
? ^^^
+ , hand charcoal shortHandLength (t/720) ]
? ^^^^^^^^^^^^^^^
hand clr len time =
let angle = degrees (90 - 6 * inSeconds time)
- in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle)
? -
+ in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle) | 17 | 1.416667 | 10 | 7 |
f024e340a6a443bb765b67bbdb811fa44fd3d19b | tests/test_resources.py | tests/test_resources.py | from flask import json
from helper import TestCase
from models import db, Major
class StudentsTestCase(TestCase):
def setUp(self):
super(StudentsTestCase, self).setUp()
with self.appx.app_context():
db.session.add(Major(id=1, university_id=1, name='Major1'))
db.session.add(Major(id=2, university_id=1, name='Major2'))
db.session.commit()
def test_students_patch(self):
headers = {
'Authorization': 'Bearer ' + self.jwt,
'Content-Type': 'application/json'
}
data = {
'graduation_year': 2018,
'gender': 'm',
'majors': [1, 2]
}
rv = self.app.patch('/students/0', headers=headers, data=json.dumps(data))
self.assertEqual(rv.status_code, 200)
| from flask import json
from helper import TestCase
from models import db, Major, Student
class StudentsTestCase(TestCase):
def setUp(self):
super(StudentsTestCase, self).setUp()
with self.appx.app_context():
db.session.add(Major(id=1, university_id=1, name='Major1'))
db.session.add(Major(id=2, university_id=1, name='Major2'))
db.session.commit()
def test_students_patch(self):
headers = {
'Authorization': 'Bearer ' + self.jwt,
'Content-Type': 'application/json'
}
data = {
'graduation_year': 2018,
'gender': 'm',
'majors': [1, 2]
}
rv = self.app.patch('/students/0', headers=headers, data=json.dumps(data))
self.assertEqual(rv.status_code, 200)
with self.appx.app_context():
student = Student.query.get(0)
self.assertEqual(student.graduation_year, data['graduation_year'])
self.assertEqual(student.gender, data['gender'])
self.assertEqual(student.majors_list, data['majors'])
| Improve testing of student patching | Improve testing of student patching
| Python | agpl-3.0 | SCUEvals/scuevals-api,SCUEvals/scuevals-api | python | ## Code Before:
from flask import json
from helper import TestCase
from models import db, Major
class StudentsTestCase(TestCase):
def setUp(self):
super(StudentsTestCase, self).setUp()
with self.appx.app_context():
db.session.add(Major(id=1, university_id=1, name='Major1'))
db.session.add(Major(id=2, university_id=1, name='Major2'))
db.session.commit()
def test_students_patch(self):
headers = {
'Authorization': 'Bearer ' + self.jwt,
'Content-Type': 'application/json'
}
data = {
'graduation_year': 2018,
'gender': 'm',
'majors': [1, 2]
}
rv = self.app.patch('/students/0', headers=headers, data=json.dumps(data))
self.assertEqual(rv.status_code, 200)
## Instruction:
Improve testing of student patching
## Code After:
from flask import json
from helper import TestCase
from models import db, Major, Student
class StudentsTestCase(TestCase):
def setUp(self):
super(StudentsTestCase, self).setUp()
with self.appx.app_context():
db.session.add(Major(id=1, university_id=1, name='Major1'))
db.session.add(Major(id=2, university_id=1, name='Major2'))
db.session.commit()
def test_students_patch(self):
headers = {
'Authorization': 'Bearer ' + self.jwt,
'Content-Type': 'application/json'
}
data = {
'graduation_year': 2018,
'gender': 'm',
'majors': [1, 2]
}
rv = self.app.patch('/students/0', headers=headers, data=json.dumps(data))
self.assertEqual(rv.status_code, 200)
with self.appx.app_context():
student = Student.query.get(0)
self.assertEqual(student.graduation_year, data['graduation_year'])
self.assertEqual(student.gender, data['gender'])
self.assertEqual(student.majors_list, data['majors'])
| from flask import json
from helper import TestCase
- from models import db, Major
+ from models import db, Major, Student
? +++++++++
class StudentsTestCase(TestCase):
def setUp(self):
super(StudentsTestCase, self).setUp()
with self.appx.app_context():
db.session.add(Major(id=1, university_id=1, name='Major1'))
db.session.add(Major(id=2, university_id=1, name='Major2'))
db.session.commit()
def test_students_patch(self):
headers = {
'Authorization': 'Bearer ' + self.jwt,
'Content-Type': 'application/json'
}
data = {
'graduation_year': 2018,
'gender': 'm',
'majors': [1, 2]
}
rv = self.app.patch('/students/0', headers=headers, data=json.dumps(data))
self.assertEqual(rv.status_code, 200)
+
+ with self.appx.app_context():
+ student = Student.query.get(0)
+ self.assertEqual(student.graduation_year, data['graduation_year'])
+ self.assertEqual(student.gender, data['gender'])
+ self.assertEqual(student.majors_list, data['majors']) | 8 | 0.266667 | 7 | 1 |
7621bb7a65b4b2ad411d506dc219dabb6a1b2d5d | Todo-Redux/app/store/configureStore.jsx | Todo-Redux/app/store/configureStore.jsx | import {combineReducers, createStore, compose} from 'redux';
import {searchTextReducer, showCompletedReducer, tasksReducer} from 'reducers';
export var configure = () => {
var reducer = combineReducers({
searchText: searchTextReducer,
showCompleted: showCompletedReducer,
tasks: tasksReducer
});
var store = createStore(reducer, compose(
window.devToolsExtension ? window.devToolsExtension() : f => f
));
return store;
};
| import {combineReducers, createStore, compose} from 'redux';
import {searchTextReducer, showCompletedReducer, tasksReducer} from 'reducers';
export var configure = (initialState = {}) => {
var reducer = combineReducers({
searchText: searchTextReducer,
showCompleted: showCompletedReducer,
tasks: tasksReducer
});
var store = createStore(reducer, initialState, compose(
window.devToolsExtension ? window.devToolsExtension() : f => f
));
return store;
};
| Add initialState to store configure | Add initialState to store configure
| JSX | mit | JulianNicholls/Complete-React-Web-App,JulianNicholls/Complete-React-Web-App | jsx | ## Code Before:
import {combineReducers, createStore, compose} from 'redux';
import {searchTextReducer, showCompletedReducer, tasksReducer} from 'reducers';
export var configure = () => {
var reducer = combineReducers({
searchText: searchTextReducer,
showCompleted: showCompletedReducer,
tasks: tasksReducer
});
var store = createStore(reducer, compose(
window.devToolsExtension ? window.devToolsExtension() : f => f
));
return store;
};
## Instruction:
Add initialState to store configure
## Code After:
import {combineReducers, createStore, compose} from 'redux';
import {searchTextReducer, showCompletedReducer, tasksReducer} from 'reducers';
export var configure = (initialState = {}) => {
var reducer = combineReducers({
searchText: searchTextReducer,
showCompleted: showCompletedReducer,
tasks: tasksReducer
});
var store = createStore(reducer, initialState, compose(
window.devToolsExtension ? window.devToolsExtension() : f => f
));
return store;
};
| import {combineReducers, createStore, compose} from 'redux';
import {searchTextReducer, showCompletedReducer, tasksReducer} from 'reducers';
- export var configure = () => {
+ export var configure = (initialState = {}) => {
? +++++++++++++++++
var reducer = combineReducers({
searchText: searchTextReducer,
showCompleted: showCompletedReducer,
tasks: tasksReducer
});
- var store = createStore(reducer, compose(
+ var store = createStore(reducer, initialState, compose(
? ++++++++++++++
window.devToolsExtension ? window.devToolsExtension() : f => f
));
return store;
}; | 4 | 0.25 | 2 | 2 |
a7f467589c49020977328e45eed4eff5b607231f | checker/tests/downstream/test_check_files_menu_agreements.py | checker/tests/downstream/test_check_files_menu_agreements.py | import magic
import os.path as op
from checker.base import BakeryTestCase as TestCase, tags
from checker.metadata import Metadata
class CheckFontsMenuAgreements(TestCase):
path = '.'
name = __name__
targets = ['metadata']
tool = 'lint'
def menufile(self, font_metadata):
return '%s.menu' % font_metadata.post_script_name
@tags('required')
def test_menu_file_agreement(self):
""" Menu file have font-name-style.menu format """
contents = self.read_metadata_contents()
fm = Metadata.get_family_metadata(contents)
for font_metadata in fm.fonts:
menufile = self.menufile(font_metadata)
path = op.join(op.dirname(self.path), menufile)
if not op.exists(path):
self.fail('%s does not exist' % menufile)
if magic.from_file("%s.menu" % self.fname) != 'TrueType font data':
self.fail('%s is not actual TTF file' % menufile)
| import magic
import os.path as op
from checker.base import BakeryTestCase as TestCase, tags
from checker.metadata import Metadata
class CheckFontsMenuAgreements(TestCase):
path = '.'
name = __name__
targets = ['metadata']
tool = 'lint'
def read_metadata_contents(self):
return open(self.path).read()
def menufile(self, font_metadata):
return '%s.menu' % font_metadata.post_script_name
@tags('required')
def test_menu_file_agreement(self):
""" Menu file have font-name-style.menu format """
contents = self.read_metadata_contents()
fm = Metadata.get_family_metadata(contents)
for font_metadata in fm.fonts:
menufile = self.menufile(font_metadata)
path = op.join(op.dirname(self.path), menufile)
if not op.exists(path):
self.fail('%s does not exist' % menufile)
if magic.from_file("%s.menu" % self.fname) != 'TrueType font data':
self.fail('%s is not actual TTF file' % menufile)
| Fix check menu files agreement test | Fix check menu files agreement test
| Python | apache-2.0 | davelab6/fontbakery,googlefonts/fontbakery,moyogo/fontbakery,moyogo/fontbakery,graphicore/fontbakery,jessamynsmith/fontbakery,graphicore/fontbakery,googlefonts/fontbakery,graphicore/fontbakery,moyogo/fontbakery,googlefonts/fontbakery | python | ## Code Before:
import magic
import os.path as op
from checker.base import BakeryTestCase as TestCase, tags
from checker.metadata import Metadata
class CheckFontsMenuAgreements(TestCase):
path = '.'
name = __name__
targets = ['metadata']
tool = 'lint'
def menufile(self, font_metadata):
return '%s.menu' % font_metadata.post_script_name
@tags('required')
def test_menu_file_agreement(self):
""" Menu file have font-name-style.menu format """
contents = self.read_metadata_contents()
fm = Metadata.get_family_metadata(contents)
for font_metadata in fm.fonts:
menufile = self.menufile(font_metadata)
path = op.join(op.dirname(self.path), menufile)
if not op.exists(path):
self.fail('%s does not exist' % menufile)
if magic.from_file("%s.menu" % self.fname) != 'TrueType font data':
self.fail('%s is not actual TTF file' % menufile)
## Instruction:
Fix check menu files agreement test
## Code After:
import magic
import os.path as op
from checker.base import BakeryTestCase as TestCase, tags
from checker.metadata import Metadata
class CheckFontsMenuAgreements(TestCase):
path = '.'
name = __name__
targets = ['metadata']
tool = 'lint'
def read_metadata_contents(self):
return open(self.path).read()
def menufile(self, font_metadata):
return '%s.menu' % font_metadata.post_script_name
@tags('required')
def test_menu_file_agreement(self):
""" Menu file have font-name-style.menu format """
contents = self.read_metadata_contents()
fm = Metadata.get_family_metadata(contents)
for font_metadata in fm.fonts:
menufile = self.menufile(font_metadata)
path = op.join(op.dirname(self.path), menufile)
if not op.exists(path):
self.fail('%s does not exist' % menufile)
if magic.from_file("%s.menu" % self.fname) != 'TrueType font data':
self.fail('%s is not actual TTF file' % menufile)
| import magic
import os.path as op
from checker.base import BakeryTestCase as TestCase, tags
from checker.metadata import Metadata
class CheckFontsMenuAgreements(TestCase):
path = '.'
name = __name__
targets = ['metadata']
tool = 'lint'
+
+ def read_metadata_contents(self):
+ return open(self.path).read()
def menufile(self, font_metadata):
return '%s.menu' % font_metadata.post_script_name
@tags('required')
def test_menu_file_agreement(self):
""" Menu file have font-name-style.menu format """
contents = self.read_metadata_contents()
fm = Metadata.get_family_metadata(contents)
for font_metadata in fm.fonts:
menufile = self.menufile(font_metadata)
path = op.join(op.dirname(self.path), menufile)
if not op.exists(path):
self.fail('%s does not exist' % menufile)
if magic.from_file("%s.menu" % self.fname) != 'TrueType font data':
self.fail('%s is not actual TTF file' % menufile) | 3 | 0.103448 | 3 | 0 |
f05208f9ecfb3781c60a5212190f74efce655e10 | .travis.yml | .travis.yml | before_install:
- sudo apt-get install python3-dev luarocks npm
- gem install rake-compiler
- curl https://bootstrap.pypa.io/get-pip.py | sudo python3
- sudo luarocks install busted
install:
- make
- rm -f *.o
- sudo luarocks make
- rm -f *.o
- python3 setup.py build
- sudo python3 setup.py install
- rm -rf build
- sudo npm install
- rake
- rm -rf tmp
script:
- rethinkdb --daemon
- busted
| before_install:
- source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
- wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install python3-dev luarocks npm rethinkdb
- gem install rake-compiler
- curl https://bootstrap.pypa.io/get-pip.py | sudo python3
- sudo luarocks install busted
install:
- make
- rm -f *.o
- sudo luarocks make
- rm -f *.o
- python3 setup.py build
- sudo python3 setup.py install
- rm -rf build
- sudo npm install
- rake
- rm -rf tmp
script:
- rethinkdb --daemon
- busted
| Add RethinkDB to the CI dependencies. | Add RethinkDB to the CI dependencies.
| YAML | apache-2.0 | grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core,grandquista/ReQL-Core | yaml | ## Code Before:
before_install:
- sudo apt-get install python3-dev luarocks npm
- gem install rake-compiler
- curl https://bootstrap.pypa.io/get-pip.py | sudo python3
- sudo luarocks install busted
install:
- make
- rm -f *.o
- sudo luarocks make
- rm -f *.o
- python3 setup.py build
- sudo python3 setup.py install
- rm -rf build
- sudo npm install
- rake
- rm -rf tmp
script:
- rethinkdb --daemon
- busted
## Instruction:
Add RethinkDB to the CI dependencies.
## Code After:
before_install:
- source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
- wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install python3-dev luarocks npm rethinkdb
- gem install rake-compiler
- curl https://bootstrap.pypa.io/get-pip.py | sudo python3
- sudo luarocks install busted
install:
- make
- rm -f *.o
- sudo luarocks make
- rm -f *.o
- python3 setup.py build
- sudo python3 setup.py install
- rm -rf build
- sudo npm install
- rake
- rm -rf tmp
script:
- rethinkdb --daemon
- busted
| before_install:
+ - source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
+ - wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
+ - sudo apt-get update
- - sudo apt-get install python3-dev luarocks npm
+ - sudo apt-get install python3-dev luarocks npm rethinkdb
? ++++++++++
- gem install rake-compiler
- curl https://bootstrap.pypa.io/get-pip.py | sudo python3
- sudo luarocks install busted
install:
- make
- rm -f *.o
- sudo luarocks make
- rm -f *.o
- python3 setup.py build
- sudo python3 setup.py install
- rm -rf build
- sudo npm install
- rake
- rm -rf tmp
script:
- rethinkdb --daemon
- busted | 5 | 0.238095 | 4 | 1 |
fcabaa75717086e923ec90969929795fc3da81ac | .idea/artifacts/RE_HeufyBot_jar.xml | .idea/artifacts/RE_HeufyBot_jar.xml | <component name="ArtifactManager">
<artifact type="jar" name="RE_HeufyBot:jar">
<output-path>$PROJECT_DIR$/out/artifacts/RE_HeufyBot_jar</output-path>
<root id="archive" name="RE_HeufyBot.jar">
<element id="module-output" name="RE_HeufyBot" />
<element id="extracted-dir" path="$PROJECT_DIR$/json-simple-1.1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/commons-lang3-3.3.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/microsoft-translator-java-api-0.6.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/snakeyaml-1.11.jar" path-in-jar="/" />
</root>
</artifact>
</component> | <component name="ArtifactManager">
<artifact type="jar" name="RE_HeufyBot:jar">
<output-path>$PROJECT_DIR$/out/artifacts/</output-path>
<root id="archive" name="RE_HeufyBot.jar">
<element id="module-output" name="RE_HeufyBot" />
<element id="extracted-dir" path="$PROJECT_DIR$/json-simple-1.1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/commons-lang3-3.3.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/microsoft-translator-java-api-0.6.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/snakeyaml-1.11.jar" path-in-jar="/" />
</root>
</artifact>
</component> | Fix main JAR artifact location | Fix main JAR artifact location
| XML | mit | Heufneutje/RE_HeufyBot,Heufneutje/RE_HeufyBot | xml | ## Code Before:
<component name="ArtifactManager">
<artifact type="jar" name="RE_HeufyBot:jar">
<output-path>$PROJECT_DIR$/out/artifacts/RE_HeufyBot_jar</output-path>
<root id="archive" name="RE_HeufyBot.jar">
<element id="module-output" name="RE_HeufyBot" />
<element id="extracted-dir" path="$PROJECT_DIR$/json-simple-1.1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/commons-lang3-3.3.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/microsoft-translator-java-api-0.6.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/snakeyaml-1.11.jar" path-in-jar="/" />
</root>
</artifact>
</component>
## Instruction:
Fix main JAR artifact location
## Code After:
<component name="ArtifactManager">
<artifact type="jar" name="RE_HeufyBot:jar">
<output-path>$PROJECT_DIR$/out/artifacts/</output-path>
<root id="archive" name="RE_HeufyBot.jar">
<element id="module-output" name="RE_HeufyBot" />
<element id="extracted-dir" path="$PROJECT_DIR$/json-simple-1.1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/commons-lang3-3.3.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/microsoft-translator-java-api-0.6.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/snakeyaml-1.11.jar" path-in-jar="/" />
</root>
</artifact>
</component> | <component name="ArtifactManager">
<artifact type="jar" name="RE_HeufyBot:jar">
- <output-path>$PROJECT_DIR$/out/artifacts/RE_HeufyBot_jar</output-path>
? ---------------
+ <output-path>$PROJECT_DIR$/out/artifacts/</output-path>
<root id="archive" name="RE_HeufyBot.jar">
<element id="module-output" name="RE_HeufyBot" />
<element id="extracted-dir" path="$PROJECT_DIR$/json-simple-1.1.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/commons-lang3-3.3.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/microsoft-translator-java-api-0.6.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/snakeyaml-1.11.jar" path-in-jar="/" />
</root>
</artifact>
</component> | 2 | 0.166667 | 1 | 1 |
9aadb4378eb007d7116ffea50848f18f0b06a6da | test/TestPrologue.h | test/TestPrologue.h |
using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;
inline bool AreClose(
const CalPoint4& p1,
const CalPoint4& p2,
float tolerance
) {
return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
}
|
// The old version of clang currently used on the Mac builder requires some
// operator<<() declarations to precede their use in the UnitTest++
// templates/macros. -- jlee - 2014-11-21
#include <cal3d/streamops.h>
#include <TestFramework/TestFramework.h>
#include <cal3d/vector4.h>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/scoped_array.hpp>
using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;
inline bool AreClose(
const CalPoint4& p1,
const CalPoint4& p2,
float tolerance
) {
return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
}
| Rearrange output operator declarations in tests to make old OSX clang happy | cal3d: Rearrange output operator declarations in tests to make old OSX clang happy
Maybe fixing Mac buildbot.
git-svn-id: febc42a3fd39fb08e5ae2b2182bc5ab0a583559c@207440 07c76cb3-cb09-0410-85de-c24d39f1912e
| C | lgpl-2.1 | imvu/cal3d,imvu/cal3d,imvu/cal3d,imvu/cal3d | c | ## Code Before:
using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;
inline bool AreClose(
const CalPoint4& p1,
const CalPoint4& p2,
float tolerance
) {
return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
}
## Instruction:
cal3d: Rearrange output operator declarations in tests to make old OSX clang happy
Maybe fixing Mac buildbot.
git-svn-id: febc42a3fd39fb08e5ae2b2182bc5ab0a583559c@207440 07c76cb3-cb09-0410-85de-c24d39f1912e
## Code After:
// The old version of clang currently used on the Mac builder requires some
// operator<<() declarations to precede their use in the UnitTest++
// templates/macros. -- jlee - 2014-11-21
#include <cal3d/streamops.h>
#include <TestFramework/TestFramework.h>
#include <cal3d/vector4.h>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/scoped_array.hpp>
using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;
inline bool AreClose(
const CalPoint4& p1,
const CalPoint4& p2,
float tolerance
) {
return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
}
| +
+ // The old version of clang currently used on the Mac builder requires some
+ // operator<<() declarations to precede their use in the UnitTest++
+ // templates/macros. -- jlee - 2014-11-21
+ #include <cal3d/streamops.h>
+
+ #include <TestFramework/TestFramework.h>
+ #include <cal3d/vector4.h>
+ #include <boost/shared_ptr.hpp>
+ #include <boost/scoped_ptr.hpp>
+ #include <boost/lexical_cast.hpp>
+ #include <boost/scoped_array.hpp>
using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;
inline bool AreClose(
const CalPoint4& p1,
const CalPoint4& p2,
float tolerance
) {
return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
} | 12 | 0.923077 | 12 | 0 |
72d64e30e50d16cedd6a63513a630d7fc40e9cf4 | .github/workflows/twine-check.yml | .github/workflows/twine-check.yml | name: Twine Check
on: [push, pull_request]
jobs:
Twine-Check:
name: Run 'twine check' Against Salt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('README.rst') }}-${{ hashFiles('.github/workflows/twine-check.yml') }}
- name: Install dependencies
run: |
pip install twine>=3.4.1
- name: Python setup
run: |
python3 setup.py sdist
- name: Twine check
run: |
python3 -m twine check dist/*
| name: Twine Check
on: [push, pull_request]
jobs:
Twine-Check:
name: Run 'twine check' Against Salt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('README.rst') }}-${{ hashFiles('.github/workflows/twine-check.yml') }}
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install twine>=3.4.1
- name: Python setup
run: |
python3 setup.py sdist
- name: Twine check
run: |
python3 -m twine check dist/*
| Reimplement update of pip and others | Reimplement update of pip and others
| YAML | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | yaml | ## Code Before:
name: Twine Check
on: [push, pull_request]
jobs:
Twine-Check:
name: Run 'twine check' Against Salt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('README.rst') }}-${{ hashFiles('.github/workflows/twine-check.yml') }}
- name: Install dependencies
run: |
pip install twine>=3.4.1
- name: Python setup
run: |
python3 setup.py sdist
- name: Twine check
run: |
python3 -m twine check dist/*
## Instruction:
Reimplement update of pip and others
## Code After:
name: Twine Check
on: [push, pull_request]
jobs:
Twine-Check:
name: Run 'twine check' Against Salt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('README.rst') }}-${{ hashFiles('.github/workflows/twine-check.yml') }}
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install twine>=3.4.1
- name: Python setup
run: |
python3 setup.py sdist
- name: Twine check
run: |
python3 -m twine check dist/*
| name: Twine Check
on: [push, pull_request]
jobs:
Twine-Check:
name: Run 'twine check' Against Salt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('README.rst') }}-${{ hashFiles('.github/workflows/twine-check.yml') }}
- name: Install dependencies
run: |
+ pip install --upgrade pip setuptools wheel
pip install twine>=3.4.1
- name: Python setup
run: |
python3 setup.py sdist
- name: Twine check
run: |
python3 -m twine check dist/* | 1 | 0.034483 | 1 | 0 |
03fa0ab7def7f9a4a45100d8e8b95188f79fc92b | app/controllers/tracks_controller.rb | app/controllers/tracks_controller.rb | class TracksController < ApplicationController
def index
@word = "coffee"
url = "http://api.musicgraph.com/api/v2/track/search?api_key=" + ENV['MUSIC_GRAPH_API_KEY'] + "&lyrics_phrase=" + @word
uri = URI(url)
response = Net::HTTP.get(uri)
@tracks = JSON.parse(response)
# happy_api_call = JSON.parse(Net::HTTP.get(URI("http://api.musicgraph.com/api/v2/track/search?api_key=1aeb0c665ce5e2a00bf34da9ec035877&lyrics_phrase=" + @word)))
# @tracks = happy_api_call
end
end
| class TracksController < ApplicationController
def index
@word = "coffee"
url = "http://api.musicgraph.com/api/v2/track/search?api_key=" + ENV['MUSIC_GRAPH_API_KEY'] + "&lyrics_phrase=" + @word
uri = URI(url)
response = Net::HTTP.get(uri)
@tracks = JSON.parse(response)
end
end
| Refactor tracks controller; remove comments | Refactor tracks controller; remove comments
| Ruby | mit | FridaSjoholm/lyrically-challenged,FridaSjoholm/lyrically-challenged,FridaSjoholm/lyrically-challenged | ruby | ## Code Before:
class TracksController < ApplicationController
def index
@word = "coffee"
url = "http://api.musicgraph.com/api/v2/track/search?api_key=" + ENV['MUSIC_GRAPH_API_KEY'] + "&lyrics_phrase=" + @word
uri = URI(url)
response = Net::HTTP.get(uri)
@tracks = JSON.parse(response)
# happy_api_call = JSON.parse(Net::HTTP.get(URI("http://api.musicgraph.com/api/v2/track/search?api_key=1aeb0c665ce5e2a00bf34da9ec035877&lyrics_phrase=" + @word)))
# @tracks = happy_api_call
end
end
## Instruction:
Refactor tracks controller; remove comments
## Code After:
class TracksController < ApplicationController
def index
@word = "coffee"
url = "http://api.musicgraph.com/api/v2/track/search?api_key=" + ENV['MUSIC_GRAPH_API_KEY'] + "&lyrics_phrase=" + @word
uri = URI(url)
response = Net::HTTP.get(uri)
@tracks = JSON.parse(response)
end
end
| class TracksController < ApplicationController
def index
@word = "coffee"
url = "http://api.musicgraph.com/api/v2/track/search?api_key=" + ENV['MUSIC_GRAPH_API_KEY'] + "&lyrics_phrase=" + @word
uri = URI(url)
response = Net::HTTP.get(uri)
@tracks = JSON.parse(response)
-
- # happy_api_call = JSON.parse(Net::HTTP.get(URI("http://api.musicgraph.com/api/v2/track/search?api_key=1aeb0c665ce5e2a00bf34da9ec035877&lyrics_phrase=" + @word)))
- # @tracks = happy_api_call
end
end | 3 | 0.214286 | 0 | 3 |
131033fa3ab170ac2a66c1dd89074ea74702fb52 | icekit/page_types/articles/migrations/0002_auto_20161012_2231.py | icekit/page_types/articles/migrations/0002_auto_20161012_2231.py | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name='slug',
field=models.SlugField(max_length=255, default='woo'),
preserve_default=False,
),
migrations.AddField(
model_name='article',
name='title',
field=models.CharField(max_length=255, default='woo'),
preserve_default=False,
),
]
| from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name='slug',
field=models.SlugField(max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='article',
name='title',
field=models.CharField(max_length=255),
preserve_default=False,
),
]
| Remove vestigial (?) "woo" default for article slug and title fields. | Remove vestigial (?) "woo" default for article slug and title fields.
| Python | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | python | ## Code Before:
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name='slug',
field=models.SlugField(max_length=255, default='woo'),
preserve_default=False,
),
migrations.AddField(
model_name='article',
name='title',
field=models.CharField(max_length=255, default='woo'),
preserve_default=False,
),
]
## Instruction:
Remove vestigial (?) "woo" default for article slug and title fields.
## Code After:
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name='slug',
field=models.SlugField(max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='article',
name='title',
field=models.CharField(max_length=255),
preserve_default=False,
),
]
| from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_articles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name='slug',
- field=models.SlugField(max_length=255, default='woo'),
? ---------------
+ field=models.SlugField(max_length=255),
preserve_default=False,
),
migrations.AddField(
model_name='article',
name='title',
- field=models.CharField(max_length=255, default='woo'),
? ---------------
+ field=models.CharField(max_length=255),
preserve_default=False,
),
] | 4 | 0.16 | 2 | 2 |
86491aff7f5c85d1ff23b8bbc0b715826142403d | src/rewrite/rewrite.cc | src/rewrite/rewrite.cc |
namespace rewrite
{
// FIXME: template-factor those two
ast::rNary
rewrite(ast::rConstNary nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Nary>();
}
ast::rExp
rewrite(ast::rConstExp nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Exp>();
}
}
|
namespace rewrite
{
ast::rNary
rewrite(ast::rConstNary nary)
{
return rewrite(ast::rConstExp(nary)).unsafe_cast<ast::Nary>();
}
ast::rExp
rewrite(ast::rConstExp nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Exp>();
}
}
| Make inner call instead of duplicating the code. | Make inner call instead of duplicating the code.
* src/rewrite/rewrite.cc (rewrite(ast::rConstNary)): Put
appropriate type casts around an inner call rather than
duplicate the code.
| C++ | bsd-3-clause | aldebaran/urbi,aldebaran/urbi,aldebaran/urbi,urbiforge/urbi,urbiforge/urbi,aldebaran/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,urbiforge/urbi,aldebaran/urbi,urbiforge/urbi,aldebaran/urbi,aldebaran/urbi,urbiforge/urbi,urbiforge/urbi,aldebaran/urbi | c++ | ## Code Before:
namespace rewrite
{
// FIXME: template-factor those two
ast::rNary
rewrite(ast::rConstNary nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Nary>();
}
ast::rExp
rewrite(ast::rConstExp nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Exp>();
}
}
## Instruction:
Make inner call instead of duplicating the code.
* src/rewrite/rewrite.cc (rewrite(ast::rConstNary)): Put
appropriate type casts around an inner call rather than
duplicate the code.
## Code After:
namespace rewrite
{
ast::rNary
rewrite(ast::rConstNary nary)
{
return rewrite(ast::rConstExp(nary)).unsafe_cast<ast::Nary>();
}
ast::rExp
rewrite(ast::rConstExp nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Exp>();
}
}
|
namespace rewrite
{
- // FIXME: template-factor those two
ast::rNary
rewrite(ast::rConstNary nary)
{
- Desugarer desugar;
- Rescoper rescope;
- ast::rAst res;
-
- desugar(nary.get());
- res = desugar.result_get();
-
- rescope(res.get());
- res = rescope.result_get();
-
- return res.unsafe_cast<ast::Nary>();
+ return rewrite(ast::rConstExp(nary)).unsafe_cast<ast::Nary>();
? +++++++ +++++++++++++++++++
}
ast::rExp
rewrite(ast::rConstExp nary)
{
Desugarer desugar;
Rescoper rescope;
ast::rAst res;
desugar(nary.get());
res = desugar.result_get();
rescope(res.get());
res = rescope.result_get();
return res.unsafe_cast<ast::Exp>();
}
} | 13 | 0.361111 | 1 | 12 |
d8c66b0ba4a2d2ecf283e26e07db6f955a587a45 | src/screens/Supporters/styles.module.sass | src/screens/Supporters/styles.module.sass | @import 'styles/colors'
.container
padding: 5rem 2.5rem
h1
margin: 1rem 0
text-transform: uppercase
overflow-wrap: anywhere
hyphens: auto
p
font-size: 1.1rem
margin: 1.1rem 0
.buttonsContainer
display: grid
grid-template-columns: auto auto
gap: 1rem
justify-content: center
.matchMedia
h1
font-size: 6vw
a.matchMedia
font-size: 3.5vw
min-width: 100%
.buttonsContainer
grid-template-columns: 1fr
gap: unset | @import 'styles/colors'
.container
padding: 5rem 2.5rem
h1
margin: 1rem 0
text-transform: uppercase
overflow-wrap: anywhere
hyphens: auto
p
font-size: 1.1rem
margin: 1.1rem 0
.buttonsContainer
display: grid
grid-template-columns: auto auto
gap: 1rem
justify-content: center
.matchMedia
h1
font-size: 6vw
a.matchMedia
font-size: 3.5vw
min-width: 100%
justify-content: center
.buttonsContainer
grid-template-columns: 1fr
gap: unset | Update a.matchMedia buttons to be justified to the center | Update a.matchMedia buttons to be justified to the center
| Sass | mit | daltonmenezes/daltonmenezes.github.io,daltonmenezes/daltonmenezes.github.io,daltonmenezes/daltonmenezes.github.io | sass | ## Code Before:
@import 'styles/colors'
.container
padding: 5rem 2.5rem
h1
margin: 1rem 0
text-transform: uppercase
overflow-wrap: anywhere
hyphens: auto
p
font-size: 1.1rem
margin: 1.1rem 0
.buttonsContainer
display: grid
grid-template-columns: auto auto
gap: 1rem
justify-content: center
.matchMedia
h1
font-size: 6vw
a.matchMedia
font-size: 3.5vw
min-width: 100%
.buttonsContainer
grid-template-columns: 1fr
gap: unset
## Instruction:
Update a.matchMedia buttons to be justified to the center
## Code After:
@import 'styles/colors'
.container
padding: 5rem 2.5rem
h1
margin: 1rem 0
text-transform: uppercase
overflow-wrap: anywhere
hyphens: auto
p
font-size: 1.1rem
margin: 1.1rem 0
.buttonsContainer
display: grid
grid-template-columns: auto auto
gap: 1rem
justify-content: center
.matchMedia
h1
font-size: 6vw
a.matchMedia
font-size: 3.5vw
min-width: 100%
justify-content: center
.buttonsContainer
grid-template-columns: 1fr
gap: unset | @import 'styles/colors'
.container
padding: 5rem 2.5rem
h1
margin: 1rem 0
text-transform: uppercase
overflow-wrap: anywhere
hyphens: auto
p
font-size: 1.1rem
margin: 1.1rem 0
.buttonsContainer
display: grid
grid-template-columns: auto auto
gap: 1rem
justify-content: center
.matchMedia
h1
font-size: 6vw
a.matchMedia
font-size: 3.5vw
min-width: 100%
+ justify-content: center
.buttonsContainer
grid-template-columns: 1fr
gap: unset | 1 | 0.035714 | 1 | 0 |
941d71ce0c7e61dc461382c3a4972aaa169e9db9 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Environment :: Plugins'])
| from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Environment :: Plugins'],
entry_points = {
'pygments.lexers': [
'hack_asm=hackasmlexer:HackAsmLexer']
})
| Fix issue with extension point | Fix issue with extension point
| Python | mit | cprieto/pygments_hack_asm | python | ## Code Before:
from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Environment :: Plugins'])
## Instruction:
Fix issue with extension point
## Code After:
from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
'Environment :: Plugins'],
entry_points = {
'pygments.lexers': [
'hack_asm=hackasmlexer:HackAsmLexer']
})
| from setuptools import setup, find_packages
setup(name='pygments-hackasm-lexer',
version='0.1',
description='Pygments lexer for the Nand2Tetris Hack Assembler',
packages = setuptools.find_packages(),
url='https://github.com/cprieto/pygments_hack_asm',
author='Cristian Prieto',
author_email='me@cprieto.com',
license='MIT',
install_requires = ['pygments'],
keywords = [
'syntax highlighting',
'pygments',
'lexer',
'hack',
'assembler',
'nand2tetris'],
classifiers =[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
'License :: OSI Approved :: MIT License',
- 'Environment :: Plugins'])
? ^
+ 'Environment :: Plugins'],
? ^
-
+ entry_points = {
+ 'pygments.lexers': [
+ 'hack_asm=hackasmlexer:HackAsmLexer']
+ }) | 7 | 0.25 | 5 | 2 |
b4fbe0d7ec26ab9ce794ad1cc32cb58688b35054 | scripts/launch_job.sh | scripts/launch_job.sh |
elastic-mapreduce \
--create \
--name "test" \
--jar s3n://kdd12/parallel.jar \
--arg .1 \
--arg .1 \
--arg 20 \
--arg 10 \
--arg 100000 \
--arg 64 \
--arg 1 \
--arg s3n://kdd12/input/ \
--arg s3n://kdd12/output/output1/ \
--arg s3n://kdd12/output/output2/ \
--log-uri s3n://kdd12/logs/ \
--num-instances 2 \
--instance-type m1.xlarge \
--master-instance-type m1.xlarge \
--bootstrap-action s3://elasticmapreduce/bootstrap-actions/configurations/latest/memory-intensive
|
elastic-mapreduce \
--create \
--name "test" \
--jar s3n://kdd12/parallel.jar \
--arg .02 \
--arg .02 \
--arg 20 \
--arg 10 \
--arg 100000 \
--arg 64 \
--arg 0.1 \
--arg 4 \
--arg s3n://kdd12/input/ \
--arg s3n://kdd12/output/output1/ \
--arg s3n://kdd12/output/output2/ \
--log-uri s3n://kdd12/logs/ \
--num-instances 2 \
--instance-type m1.xlarge \
--master-instance-type m1.xlarge \
--bootstrap-action s3://elasticmapreduce/bootstrap-actions/configurations/latest/memory-intensive
| Modify Amazon EC2 mapreduce script to include the added argument for the local confidence parameter phi. (Mock values) | Modify Amazon EC2 mapreduce script to include the added argument for the local
confidence parameter phi. (Mock values)
| Shell | apache-2.0 | jdebrabant/parallel_arules,jdebrabant/parallel_arules,jdebrabant/parallel_arules,jdebrabant/parallel_arules | shell | ## Code Before:
elastic-mapreduce \
--create \
--name "test" \
--jar s3n://kdd12/parallel.jar \
--arg .1 \
--arg .1 \
--arg 20 \
--arg 10 \
--arg 100000 \
--arg 64 \
--arg 1 \
--arg s3n://kdd12/input/ \
--arg s3n://kdd12/output/output1/ \
--arg s3n://kdd12/output/output2/ \
--log-uri s3n://kdd12/logs/ \
--num-instances 2 \
--instance-type m1.xlarge \
--master-instance-type m1.xlarge \
--bootstrap-action s3://elasticmapreduce/bootstrap-actions/configurations/latest/memory-intensive
## Instruction:
Modify Amazon EC2 mapreduce script to include the added argument for the local
confidence parameter phi. (Mock values)
## Code After:
elastic-mapreduce \
--create \
--name "test" \
--jar s3n://kdd12/parallel.jar \
--arg .02 \
--arg .02 \
--arg 20 \
--arg 10 \
--arg 100000 \
--arg 64 \
--arg 0.1 \
--arg 4 \
--arg s3n://kdd12/input/ \
--arg s3n://kdd12/output/output1/ \
--arg s3n://kdd12/output/output2/ \
--log-uri s3n://kdd12/logs/ \
--num-instances 2 \
--instance-type m1.xlarge \
--master-instance-type m1.xlarge \
--bootstrap-action s3://elasticmapreduce/bootstrap-actions/configurations/latest/memory-intensive
|
elastic-mapreduce \
--create \
--name "test" \
--jar s3n://kdd12/parallel.jar \
- --arg .1 \
? ^
+ --arg .02 \
? ^^
- --arg .1 \
? ^
+ --arg .02 \
? ^^
--arg 20 \
--arg 10 \
--arg 100000 \
--arg 64 \
- --arg 1 \
+ --arg 0.1 \
? ++
+ --arg 4 \
--arg s3n://kdd12/input/ \
--arg s3n://kdd12/output/output1/ \
--arg s3n://kdd12/output/output2/ \
--log-uri s3n://kdd12/logs/ \
--num-instances 2 \
--instance-type m1.xlarge \
--master-instance-type m1.xlarge \
--bootstrap-action s3://elasticmapreduce/bootstrap-actions/configurations/latest/memory-intensive | 7 | 0.35 | 4 | 3 |
5132a8f2c96dc778614e5a49a3fd1d7ec9be2beb | audit.go | audit.go | package scipipe
import (
"time"
)
// AuditInfo contains structured audit/provenance logging information to go with an IP
type AuditInfo struct {
Command string
Params map[string]string
Keys map[string]string
ExecTimeMS time.Duration
Upstream map[string]*AuditInfo
}
// NewAuditInfo returns a new AuditInfo struct
func NewAuditInfo() *AuditInfo {
return &AuditInfo{
Command: "",
Params: make(map[string]string),
Keys: make(map[string]string),
ExecTimeMS: -1,
Upstream: make(map[string]*AuditInfo),
}
}
| package scipipe
import (
"time"
)
// AuditInfo contains structured audit/provenance logging information for a
// particular task (invocation), to go with all outgoing IPs from that task
type AuditInfo struct {
ID string
Command string
Params map[string]string
Keys map[string]string
ExecTimeMS time.Duration
Upstream map[string]*AuditInfo
}
// NewAuditInfo returns a new AuditInfo struct
func NewAuditInfo() *AuditInfo {
return &AuditInfo{
ID: randSeqLC(20),
Command: "",
Params: make(map[string]string),
Keys: make(map[string]string),
ExecTimeMS: -1,
Upstream: make(map[string]*AuditInfo),
}
}
| Add an ID field to AuditInfo | Add an ID field to AuditInfo
| Go | mit | scipipe/scipipe,scipipe/scipipe,samuell/scipipe | go | ## Code Before:
package scipipe
import (
"time"
)
// AuditInfo contains structured audit/provenance logging information to go with an IP
type AuditInfo struct {
Command string
Params map[string]string
Keys map[string]string
ExecTimeMS time.Duration
Upstream map[string]*AuditInfo
}
// NewAuditInfo returns a new AuditInfo struct
func NewAuditInfo() *AuditInfo {
return &AuditInfo{
Command: "",
Params: make(map[string]string),
Keys: make(map[string]string),
ExecTimeMS: -1,
Upstream: make(map[string]*AuditInfo),
}
}
## Instruction:
Add an ID field to AuditInfo
## Code After:
package scipipe
import (
"time"
)
// AuditInfo contains structured audit/provenance logging information for a
// particular task (invocation), to go with all outgoing IPs from that task
type AuditInfo struct {
ID string
Command string
Params map[string]string
Keys map[string]string
ExecTimeMS time.Duration
Upstream map[string]*AuditInfo
}
// NewAuditInfo returns a new AuditInfo struct
func NewAuditInfo() *AuditInfo {
return &AuditInfo{
ID: randSeqLC(20),
Command: "",
Params: make(map[string]string),
Keys: make(map[string]string),
ExecTimeMS: -1,
Upstream: make(map[string]*AuditInfo),
}
}
| package scipipe
import (
"time"
)
- // AuditInfo contains structured audit/provenance logging information to go with an IP
? ^ ^^^^^^^^ ----
+ // AuditInfo contains structured audit/provenance logging information for a
? ^ ^
+ // particular task (invocation), to go with all outgoing IPs from that task
type AuditInfo struct {
+ ID string
Command string
Params map[string]string
Keys map[string]string
ExecTimeMS time.Duration
Upstream map[string]*AuditInfo
}
// NewAuditInfo returns a new AuditInfo struct
func NewAuditInfo() *AuditInfo {
return &AuditInfo{
+ ID: randSeqLC(20),
Command: "",
Params: make(map[string]string),
Keys: make(map[string]string),
ExecTimeMS: -1,
Upstream: make(map[string]*AuditInfo),
}
} | 5 | 0.2 | 4 | 1 |
112cb9be329dc3394a5f197628363d003dda885e | site-cookbooks/netatalk/templates/default/afp.conf.erb | site-cookbooks/netatalk/templates/default/afp.conf.erb | [Global]
hostname = File Server
mimic model = RackMac
uam list = uams_dhx2.so uams_guest.so
log file = /var/log/netatalk.log
log level = default:error
guest account = netatalk
[Backups]
path = /shared/Backups
aclinherit = passthrough
aclmode = passthrough
vol size limit = 512000
time machine = yes
[Media]
path = /shared/Media
aclinherit = passthrough
aclmode = passthrough
[Downloads]
path = /shared/Downloads
aclinherit = passthrough
aclmode = passthrough
[Documents]
path = /shared/Documents
aclinherit = passthrough
aclmode = passthrough
| [Global]
hostname = File Server
mimic model = RackMac
uam list = uams_dhx2.so uams_guest.so
log file = /var/log/netatalk.log
log level = default:error
guest account = netatalk
[Backups]
path = /shared/Backups
vol size limit = 512000
time machine = yes
unix priv = no
[Media]
path = /shared/Media
unix priv = no
[Downloads]
path = /shared/Downloads
unix priv = no
[Documents]
path = /shared/Documents
unix priv = no
| Fix ACL issues with ZFS... by ignoring them. | Fix ACL issues with ZFS... by ignoring them.
| HTML+ERB | apache-2.0 | skingry/chef,skingry/media-server,skingry/chef,skingry/media-server,skingry/chef,skingry/media-server | html+erb | ## Code Before:
[Global]
hostname = File Server
mimic model = RackMac
uam list = uams_dhx2.so uams_guest.so
log file = /var/log/netatalk.log
log level = default:error
guest account = netatalk
[Backups]
path = /shared/Backups
aclinherit = passthrough
aclmode = passthrough
vol size limit = 512000
time machine = yes
[Media]
path = /shared/Media
aclinherit = passthrough
aclmode = passthrough
[Downloads]
path = /shared/Downloads
aclinherit = passthrough
aclmode = passthrough
[Documents]
path = /shared/Documents
aclinherit = passthrough
aclmode = passthrough
## Instruction:
Fix ACL issues with ZFS... by ignoring them.
## Code After:
[Global]
hostname = File Server
mimic model = RackMac
uam list = uams_dhx2.so uams_guest.so
log file = /var/log/netatalk.log
log level = default:error
guest account = netatalk
[Backups]
path = /shared/Backups
vol size limit = 512000
time machine = yes
unix priv = no
[Media]
path = /shared/Media
unix priv = no
[Downloads]
path = /shared/Downloads
unix priv = no
[Documents]
path = /shared/Documents
unix priv = no
| [Global]
hostname = File Server
mimic model = RackMac
uam list = uams_dhx2.so uams_guest.so
log file = /var/log/netatalk.log
log level = default:error
guest account = netatalk
[Backups]
path = /shared/Backups
- aclinherit = passthrough
- aclmode = passthrough
vol size limit = 512000
time machine = yes
+ unix priv = no
[Media]
path = /shared/Media
+ unix priv = no
- aclinherit = passthrough
- aclmode = passthrough
[Downloads]
path = /shared/Downloads
+ unix priv = no
- aclinherit = passthrough
- aclmode = passthrough
[Documents]
path = /shared/Documents
+ unix priv = no
- aclinherit = passthrough
- aclmode = passthrough
| 12 | 0.4 | 4 | 8 |
50855c7e379c8664f40b99dfeebf7eb0baefdbe1 | pkgs/tools/networking/xl2tpd/default.nix | pkgs/tools/networking/xl2tpd/default.nix | { stdenv, fetchFromGitHub, libpcap }:
let version = "1.3.6";
in stdenv.mkDerivation {
name = "xl2tpd-${version}";
src = fetchFromGitHub {
owner = "xelerance";
repo = "xl2tpd";
rev = "v${version}";
sha256 = "17lnsk9fsyfp2g5hha7psim6047wj9qs8x4y4w06gl6bbf36jm9z";
};
buildInputs = [ libpcap ];
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
homepage = http://www.xelerance.com/software/xl2tpd/;
description = "Layer 2 Tunnelling Protocol Daemon (RFC 2661)";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
};
}
| { stdenv, fetchFromGitHub, libpcap, ppp }:
let version = "1.3.6";
in stdenv.mkDerivation {
name = "xl2tpd-${version}";
src = fetchFromGitHub {
owner = "xelerance";
repo = "xl2tpd";
rev = "v${version}";
sha256 = "17lnsk9fsyfp2g5hha7psim6047wj9qs8x4y4w06gl6bbf36jm9z";
};
buildInputs = [ libpcap ];
postPatch = ''
substituteInPlace l2tp.h --replace /usr/sbin/pppd ${ppp}/sbin/pppd
'';
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
homepage = http://www.xelerance.com/software/xl2tpd/;
description = "Layer 2 Tunnelling Protocol Daemon (RFC 2661)";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
};
}
| Add ability to use pppd to xl2tpd | Add ability to use pppd to xl2tpd
| Nix | mit | SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{ stdenv, fetchFromGitHub, libpcap }:
let version = "1.3.6";
in stdenv.mkDerivation {
name = "xl2tpd-${version}";
src = fetchFromGitHub {
owner = "xelerance";
repo = "xl2tpd";
rev = "v${version}";
sha256 = "17lnsk9fsyfp2g5hha7psim6047wj9qs8x4y4w06gl6bbf36jm9z";
};
buildInputs = [ libpcap ];
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
homepage = http://www.xelerance.com/software/xl2tpd/;
description = "Layer 2 Tunnelling Protocol Daemon (RFC 2661)";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
};
}
## Instruction:
Add ability to use pppd to xl2tpd
## Code After:
{ stdenv, fetchFromGitHub, libpcap, ppp }:
let version = "1.3.6";
in stdenv.mkDerivation {
name = "xl2tpd-${version}";
src = fetchFromGitHub {
owner = "xelerance";
repo = "xl2tpd";
rev = "v${version}";
sha256 = "17lnsk9fsyfp2g5hha7psim6047wj9qs8x4y4w06gl6bbf36jm9z";
};
buildInputs = [ libpcap ];
postPatch = ''
substituteInPlace l2tp.h --replace /usr/sbin/pppd ${ppp}/sbin/pppd
'';
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
homepage = http://www.xelerance.com/software/xl2tpd/;
description = "Layer 2 Tunnelling Protocol Daemon (RFC 2661)";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
};
}
| - { stdenv, fetchFromGitHub, libpcap }:
+ { stdenv, fetchFromGitHub, libpcap, ppp }:
? +++++
let version = "1.3.6";
in stdenv.mkDerivation {
name = "xl2tpd-${version}";
src = fetchFromGitHub {
owner = "xelerance";
repo = "xl2tpd";
rev = "v${version}";
sha256 = "17lnsk9fsyfp2g5hha7psim6047wj9qs8x4y4w06gl6bbf36jm9z";
};
buildInputs = [ libpcap ];
+ postPatch = ''
+ substituteInPlace l2tp.h --replace /usr/sbin/pppd ${ppp}/sbin/pppd
+ '';
+
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
homepage = http://www.xelerance.com/software/xl2tpd/;
description = "Layer 2 Tunnelling Protocol Daemon (RFC 2661)";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
};
} | 6 | 0.24 | 5 | 1 |
ea401c179323512c05d9922331cbc6f961e7e471 | lib/import/pftrack.rb | lib/import/pftrack.rb | class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
def self.human_name
"PFTrack .2dt file"
end
def self.distinct_file_ext
".2dt"
end
CHARACTERS_OR_QUOTES = /[AZaz"]/
def parse(io)
trackers = []
until io.eof?
line = io.gets
next if (!line || line =~ /^#/)
if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
report_progress("Reading tracker #{t.name}")
parse_tracker(t, io)
trackers << t
end
end
trackers
end
private
def parse_tracker(t, io)
first_tracker_line = io.gets.chomp
if first_tracker_line =~ CHARACTERS_OR_QUOTES # PFTrack version 5 format
first_tracker_line = io.gets.chomp
end
num_of_keyframes = first_tracker_line.to_i
t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
Tracksperanto::Keyframe.new do |k|
f, x, y, residual = io.gets.chomp.split
k.frame, k.abs_x, k.abs_y, k.residual = f, x, y, residual
end
end
end
end | class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
def self.human_name
"PFTrack .2dt file"
end
def self.distinct_file_ext
".2dt"
end
CHARACTERS_OR_QUOTES = /[AZaz"]/
def parse(io)
trackers = []
until io.eof?
line = io.gets
next if (!line || line =~ /^#/)
if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
report_progress("Reading tracker #{t.name}")
parse_tracker(t, io)
trackers << t
end
end
trackers
end
private
def parse_tracker(t, io)
first_tracker_line = io.gets.chomp
if first_tracker_line =~ CHARACTERS_OR_QUOTES # PFTrack version 5 format
first_tracker_line = io.gets.chomp
end
num_of_keyframes = first_tracker_line.to_i
t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
f, x, y, residual = io.gets.chomp.split
Tracksperanto::Keyframe.new(:frame => f, :abs_x => x, :abs_y => y, :residual => residual.to_f * 8)
end
end
end | Revert PFTrack residual computation on import | Revert PFTrack residual computation on import
| Ruby | mit | guerilla-di/tracksperanto,guerilla-di/tracksperanto,guerilla-di/tracksperanto | ruby | ## Code Before:
class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
def self.human_name
"PFTrack .2dt file"
end
def self.distinct_file_ext
".2dt"
end
CHARACTERS_OR_QUOTES = /[AZaz"]/
def parse(io)
trackers = []
until io.eof?
line = io.gets
next if (!line || line =~ /^#/)
if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
report_progress("Reading tracker #{t.name}")
parse_tracker(t, io)
trackers << t
end
end
trackers
end
private
def parse_tracker(t, io)
first_tracker_line = io.gets.chomp
if first_tracker_line =~ CHARACTERS_OR_QUOTES # PFTrack version 5 format
first_tracker_line = io.gets.chomp
end
num_of_keyframes = first_tracker_line.to_i
t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
Tracksperanto::Keyframe.new do |k|
f, x, y, residual = io.gets.chomp.split
k.frame, k.abs_x, k.abs_y, k.residual = f, x, y, residual
end
end
end
end
## Instruction:
Revert PFTrack residual computation on import
## Code After:
class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
def self.human_name
"PFTrack .2dt file"
end
def self.distinct_file_ext
".2dt"
end
CHARACTERS_OR_QUOTES = /[AZaz"]/
def parse(io)
trackers = []
until io.eof?
line = io.gets
next if (!line || line =~ /^#/)
if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
report_progress("Reading tracker #{t.name}")
parse_tracker(t, io)
trackers << t
end
end
trackers
end
private
def parse_tracker(t, io)
first_tracker_line = io.gets.chomp
if first_tracker_line =~ CHARACTERS_OR_QUOTES # PFTrack version 5 format
first_tracker_line = io.gets.chomp
end
num_of_keyframes = first_tracker_line.to_i
t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
f, x, y, residual = io.gets.chomp.split
Tracksperanto::Keyframe.new(:frame => f, :abs_x => x, :abs_y => y, :residual => residual.to_f * 8)
end
end
end | class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
def self.human_name
"PFTrack .2dt file"
end
def self.distinct_file_ext
".2dt"
end
CHARACTERS_OR_QUOTES = /[AZaz"]/
def parse(io)
trackers = []
until io.eof?
line = io.gets
next if (!line || line =~ /^#/)
if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
report_progress("Reading tracker #{t.name}")
parse_tracker(t, io)
trackers << t
end
end
trackers
end
private
def parse_tracker(t, io)
first_tracker_line = io.gets.chomp
if first_tracker_line =~ CHARACTERS_OR_QUOTES # PFTrack version 5 format
first_tracker_line = io.gets.chomp
end
num_of_keyframes = first_tracker_line.to_i
t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
- Tracksperanto::Keyframe.new do |k|
- f, x, y, residual = io.gets.chomp.split
? --
+ f, x, y, residual = io.gets.chomp.split
+ Tracksperanto::Keyframe.new(:frame => f, :abs_x => x, :abs_y => y, :residual => residual.to_f * 8)
- k.frame, k.abs_x, k.abs_y, k.residual = f, x, y, residual
- end
end
end
end | 6 | 0.130435 | 2 | 4 |
178d64ce518d7ee6b91809e1c8026f0235e76915 | app/models/user.rb | app/models/user.rb | class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :confirmable, :validatable
enum locale: [:de, :en]
has_secure_token :api_token #That's a rails feature!
has_many :languages_users
has_many :languages, through: :languages_users
has_many :abilities_users
has_many :abilities, through: :abilities_users
validates :first_name, length: { in: 1..50 }
validates :last_name, length: { in: 1..50 }
end
| class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :confirmable, :validatable
enum locale: { de: 0, en: 1 }
has_secure_token :api_token #That's a rails feature!
has_many :languages_users
has_many :languages, through: :languages_users
has_many :abilities_users
has_many :abilities, through: :abilities_users
validates :first_name, length: { in: 1..50 }
validates :last_name, length: { in: 1..50 }
end
| Change locale enum to hash with integers | Change locale enum to hash with integers
| Ruby | agpl-3.0 | where2help/where2help,where2help/where2help,where2help/where2help | ruby | ## Code Before:
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :confirmable, :validatable
enum locale: [:de, :en]
has_secure_token :api_token #That's a rails feature!
has_many :languages_users
has_many :languages, through: :languages_users
has_many :abilities_users
has_many :abilities, through: :abilities_users
validates :first_name, length: { in: 1..50 }
validates :last_name, length: { in: 1..50 }
end
## Instruction:
Change locale enum to hash with integers
## Code After:
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :confirmable, :validatable
enum locale: { de: 0, en: 1 }
has_secure_token :api_token #That's a rails feature!
has_many :languages_users
has_many :languages, through: :languages_users
has_many :abilities_users
has_many :abilities, through: :abilities_users
validates :first_name, length: { in: 1..50 }
validates :last_name, length: { in: 1..50 }
end
| class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :confirmable, :validatable
- enum locale: [:de, :en]
? ^^ - ^
+ enum locale: { de: 0, en: 1 }
? ^^ +++ ^^^^^
has_secure_token :api_token #That's a rails feature!
has_many :languages_users
has_many :languages, through: :languages_users
has_many :abilities_users
has_many :abilities, through: :abilities_users
validates :first_name, length: { in: 1..50 }
validates :last_name, length: { in: 1..50 }
end | 2 | 0.125 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.