commit
stringlengths 40
40
| old_file
stringlengths 4
264
| new_file
stringlengths 4
264
| old_contents
stringlengths 0
3.26k
| new_contents
stringlengths 1
4.43k
| subject
stringlengths 15
624
| message
stringlengths 15
4.7k
| lang
stringclasses 3
values | license
stringclasses 13
values | repos
stringlengths 5
91.5k
|
---|---|---|---|---|---|---|---|---|---|
7d84aa5b1d0c2af75abf70e556470cb67b79b19a | spec/filesize-view-spec.js | spec/filesize-view-spec.js | 'use babel';
import filesizeView from '../lib/filesize-view';
describe('View', () => {
// Disable tooltip for these tests
atom.config.set('filesize.EnablePopupAppearance', false);
const workspaceView = atom.views.getView(atom.workspace);
const view = filesizeView(workspaceView);
describe('when refreshing the view', () => {
it('should display the human readable size', () => {
workspaceView.appendChild(view.container);
const filesizeElement = workspaceView.querySelector('.current-size');
view.refresh({ size: 5 });
expect(filesizeElement.innerHTML).toEqual('5 bytes');
});
});
describe('when cleaning the view', () => {
it('should wipe the filesize contents', () => {
view.clean();
const filesizeElement = workspaceView.querySelector('.current-size');
expect(filesizeElement.innerHTML).toEqual('');
});
});
describe('when destroying the view', () => {
it('should remove the file-size element', () => {
view.destroy();
const filesizeElement = workspaceView.querySelector('.file-size');
expect(filesizeElement).toEqual(null);
});
});
});
| 'use babel';
import filesizeView from '../lib/filesize-view';
describe('View', () => {
const workspaceView = atom.views.getView(atom.workspace);
const view = filesizeView(workspaceView);
describe('when refreshing the view', () => {
it('should display the human readable size', () => {
workspaceView.appendChild(view.container);
const filesizeElement = workspaceView.querySelector('.current-size');
view.refresh({ size: 5 });
expect(filesizeElement.innerHTML).toEqual('5 bytes');
});
it('should react to config changes', () => {
atom.config.set('filesize.KibibyteRepresentation', false);
const filesizeElement = workspaceView.querySelector('.current-size');
view.refresh({ size: 1024 });
expect(filesizeElement.innerHTML).toEqual('1.02 KB');
});
});
describe('Tooltip', () => {
it('should display on click', () => {
const filesizeLink = workspaceView.querySelector('.file-size-link');
filesizeLink.click();
waitsFor(() => workspaceView.querySelector('.tooltip'));
runs(() => expect(tooltip).not.toEqual(null));
});
});
describe('when cleaning the view', () => {
it('should wipe the filesize contents', () => {
view.clean();
const filesizeElement = workspaceView.querySelector('.current-size');
expect(filesizeElement.innerHTML).toEqual('');
});
});
describe('when destroying the view', () => {
it('should remove the file-size element', () => {
view.destroy();
const filesizeElement = workspaceView.querySelector('.file-size');
expect(filesizeElement).toEqual(null);
});
});
});
| Add config change test to the View spec | Add config change test to the View spec
| JavaScript | mit | mkautzmann/atom-filesize |
05b14b3f817f0cffb06ade8f1ff82bfff177c6bd | starting-angular/starting-angular/cards/cards_usesStaticJSON_cleanestVersion/js/directives.js | starting-angular/starting-angular/cards/cards_usesStaticJSON_cleanestVersion/js/directives.js | /*global cardApp*/
/*jslint unparam: true */
(function () {
'use strict';
// Implements custom validation for card number.
var INTEGER_REGEXP = /^([aAkKjJQq23456789]{1}|(10){1})$/;
cardApp.directive('integer', function () {
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function (viewValue) {
if (INTEGER_REGEXP.test(viewValue)) {
// it is valid
ctrl.$setValidity('integer', true);
return viewValue;
}
// it is invalid, return undefined (no model update)
ctrl.$setValidity('integer', false);
return undefined;
});
}
};
});
}()); | /*global cardApp*/
/*jslint unparam: true */
cardApp.directive('integer', function () {
'use strict';
// Implements custom validation for card number.
var INTEGER_REGEXP = /^([aAkKjJQq23456789]{1}|(10){1})$/;
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
ctrl.$parsers.unshift(function (viewValue) {
if (INTEGER_REGEXP.test(viewValue)) {
// it is valid
ctrl.$setValidity('integer', true);
return viewValue;
}
// it is invalid, return undefined (no model update)
ctrl.$setValidity('integer', false);
return undefined;
});
}
};
});
| Use the angular module pattern instead of using a closure. | Use the angular module pattern instead of using a closure.
| JavaScript | unlicense | bigfont/DevTeach2013,bigfont/DevTeach2013 |
749b9d4b89c9e34808b4d4e8ce5600703ce16464 | clientapp/views/pathway.js | clientapp/views/pathway.js | var HumanView = require('human-view');
var templates = require('../templates');
module.exports = HumanView.extend({
template: templates.pathway,
events: {
'dragstart .columns': 'drag',
'dragover .columns': 'over',
'dragenter .columns': 'enter',
'dragleave .columns': 'leave',
'drop .columns': 'drop'
},
render: function () {
this.renderAndBind({pathway: this.model});
this.model.once('move', this.render, this);
return this;
},
drag: function (e) {
var start = $(e.currentTarget).data('cell-coords');
e.originalEvent.dataTransfer.setData('text/plain', start);
},
over: function (e) {
e.originalEvent.dataTransfer.effectAllowed = 'move';
e.originalEvent.dataTransfer.dropEffect = 'move';
if (!$(e.currentTarget).find('.badge').length) {
e.preventDefault();
return false;
}
},
enter: function (e) {
if (!$(e.currentTarget).find('.badge').length) {
$(e.currentTarget).addClass('drop');
}
},
leave: function (e) {
$(e.currentTarget).removeClass('drop');
},
drop: function (e) {
var end = $(e.currentTarget).data('cell-coords');
var start = e.originalEvent.dataTransfer.getData('text/plain');
this.model.move(start, end);
e.preventDefault();
}
});
| var HumanView = require('human-view');
var templates = require('../templates');
module.exports = HumanView.extend({
template: templates.pathway,
events: {
'dragstart .columns': 'drag',
'dragover .columns': 'over',
'dragenter .columns': 'enter',
'dragleave .columns': 'leave',
'drop .columns': 'drop'
},
render: function () {
this.renderAndBind({pathway: this.model});
this.model.once('move', this.render, this);
return this;
},
drag: function (e) {
var start = $(e.currentTarget).data('cell-coords');
e.originalEvent.dataTransfer.setData('Text', start);
},
over: function (e) {
e.originalEvent.dataTransfer.effectAllowed = 'move';
e.originalEvent.dataTransfer.dropEffect = 'move';
if (!$(e.currentTarget).find('.badge').length) {
e.preventDefault();
e.stopPropagation();
}
},
enter: function (e) {
if (!$(e.currentTarget).find('.badge').length) {
$(e.currentTarget).addClass('drop');
}
},
leave: function (e) {
$(e.currentTarget).removeClass('drop');
},
drop: function (e) {
var end = $(e.currentTarget).data('cell-coords');
var start = e.originalEvent.dataTransfer.getData('Text');
this.model.move(start, end);
e.preventDefault();
e.stopPropagation();
}
});
| Make it work in IE10 | Make it work in IE10
| JavaScript | mpl-2.0 | mozilla/openbadges-discovery |
19a0c4401e5185b71d5ca715d54d13c31cab7559 | lib/sequence/binlog.js | lib/sequence/binlog.js | var Util = require('util');
var Packet = require('../packet');
var capture = require('../capture');
module.exports = function(options) {
var self = this; // ZongJi instance
var Sequence = capture(self.connection).Sequence;
var BinlogHeader = Packet.initBinlogHeader.call(self, options);
function Binlog(callback) {
Sequence.call(this, callback);
}
Util.inherits(Binlog, Sequence);
Binlog.prototype.start = function() {
this.emit('packet', new Packet.ComBinlog(options));
};
Binlog.prototype.determinePacket = function(firstByte) {
switch (firstByte) {
case 0xfe:
return Packet.Eof;
case 0xff:
return Packet.Error;
default:
return BinlogHeader;
}
};
Binlog.prototype['OkPacket'] = function(packet) {
console.log('Received one OkPacket ...');
};
Binlog.prototype['BinlogHeader'] = function(packet) {
if (this._callback) {
var event, error;
try{
event = packet.getEvent();
}catch(err){
error = err;
}
this._callback.call(this, error, event);
}
};
return Binlog;
};
| var Util = require('util');
var Packet = require('../packet');
var capture = require('../capture');
module.exports = function(options) {
var self = this; // ZongJi instance
var Sequence = capture(self.connection).Sequence;
var BinlogHeader = Packet.initBinlogHeader.call(self, options);
function Binlog(callback) {
Sequence.call(this, callback);
}
Util.inherits(Binlog, Sequence);
Binlog.prototype.start = function() {
this.emit('packet', new Packet.ComBinlog(options));
};
Binlog.prototype.determinePacket = function(firstByte) {
switch (firstByte) {
case 0xfe:
return Packet.Eof;
case 0xff:
return Packet.Error;
default:
return BinlogHeader;
}
};
Binlog.prototype['OkPacket'] = function(packet) {
// TODO: Remove console statements to make module ready for widespread use
console.log('Received one OkPacket ...');
};
Binlog.prototype['BinlogHeader'] = function(packet) {
if (this._callback) {
var event, error;
try{
event = packet.getEvent();
}catch(err){
error = err;
}
this._callback.call(this, error, event);
}
};
return Binlog;
};
| Add TODO to remove console.log from non-dump functions | Add TODO to remove console.log from non-dump functions
| JavaScript | mit | jmealo/zongji,jmealo/zongji |
85168befaaab2563b91345867087d51789a88dff | client/app/common/global-events/global-events.factory.js | client/app/common/global-events/global-events.factory.js | let GlobalEvents = () => {
let events = {};
return {
off: (eventHandle) => {
let index = events[eventHandle.eventName].findIndex((singleEventHandler) => {
return singleEventHandler.id !== eventHandle.handlerId;
});
events[eventHandle.eventName].splice(index, 1);
},
on: (eventName, handlerCallback) => {
if (!events[eventName]) {
events[eventName] = [];
}
let handlers = events[eventName];
let newHandlerId = new Date().getTime();
handlers.push({
id: newHandlerId,
callback: handlerCallback
});
return {
id: newHandlerId,
eventName
};
},
trigger: (eventName, data) => {
events[eventName].forEach((singleHandler) => {
singleHandler.callback(data);
});
}
};
}
export default GlobalEvents; | let GlobalEvents = () => {
let events = {};
return {
off: (eventHandle) => {
let index = events[eventHandle.eventName].findIndex((singleEventHandler) => {
return singleEventHandler.id !== eventHandle.handlerId;
});
events[eventHandle.eventName].splice(index, 1);
},
on: (eventName, handlerCallback) => {
if (!events[eventName]) {
events[eventName] = [];
}
let handlers = events[eventName];
let newHandlerId = new Date().getTime();
handlers.push({
id: newHandlerId,
callback: handlerCallback
});
return {
id: newHandlerId,
eventName
};
},
trigger: (eventName, data) => {
if (events[eventName]) {
events[eventName].forEach((singleHandler) => {
singleHandler.callback(data);
});
}
}
};
}
export default GlobalEvents; | Fix trigger exception when no listeners specified | Fix trigger exception when no listeners specified
| JavaScript | apache-2.0 | zbicin/word-game,zbicin/word-game |
2eeb2979a6d7dc1ce5f5559f7437b90b2246c72f | src/DynamicCodeRegistry.js | src/DynamicCodeRegistry.js | /*
Keep track of
*/
import Backbone from "backbone"
import _ from "underscore"
export default class DynamicCodeRegistry {
constructor(){
_.extend(this, Backbone.Events)
this._content = {};
this._origins = {}
}
register(filename, content, origin){
this._content[filename] = content
if (origin) {
this._origins[filename] = origin
}
this.trigger("register", {
[filename]: content
})
}
getContent(filename){
return this._content[filename]
}
getOrigin(filename){
return this._origins[filename]
}
fileIsDynamicCode(filename){
return this._content[filename] !== undefined
}
}
| /*
Keep track of
*/
import Backbone from "backbone"
import _ from "underscore"
export default class DynamicCodeRegistry {
constructor(){
_.extend(this, Backbone.Events)
this._content = {};
this._origins = {}
}
register(filename, content, origin){
this._content[filename] = content
if (origin) {
this._origins[filename] = origin
}
this.trigger("register", {
[filename]: content
})
}
getContent(filename){
return this._content[filename]
}
getOrigin(filename){
return this._origins[filename]
}
fileIsDynamicCode(filename){
return filename.indexOf("DynamicFunction") !== -1;
}
}
| Fix detecting if it's a dynamic files... script tags from the original html were previously incorrectly identified as dynamic files. | Fix detecting if it's a dynamic files... script tags from the original html were previously incorrectly identified as dynamic files.
| JavaScript | mit | mattzeunert/FromJS,mattzeunert/FromJS,mattzeunert/FromJS,mattzeunert/FromJS |
efd680a34c23ec2727a3033e37517e309ba29a0c | client/webcomponents/nn-annotable.js | client/webcomponents/nn-annotable.js | /* jshint camelcase:false */
Polymer('nn-annotable', {
ready: function(){
this.baseapi = this.baseapi || window.location.origin;
this.tokens = this.baseapi.split('://');
this.wsurl = this.tokens.shift() === 'https' ? 'wss' : 'ws' + '://' + this.tokens.shift();
this.domain = window.location.hostname;
this.connect = (this.connect !== undefined) ? this.connect : true;
this.comments = [];
},
attached: function(){
if(!this.nid){
throw 'Attribute missing: nid';
}
this.$.websocket.addEventListener('message', this.updateComments.bind(this));
this.$.get_comments.go();
},
populateComments: function(evt){
this.comments = evt.detail.response;
},
updateComments: function(evt){
this.comments.push(evt.detail);
},
newComment: function(evt){
this.message = '';
evt.preventDefault();
if(!this.author || !this.text){
this.message = 'completa tutti i campi';
return;
}
this.$.new_comment.go();
},
resetForm: function(){
this.author = this.text = '';
}
});
| /* jshint camelcase:false */
Polymer('nn-annotable', {
ready: function(){
this.baseapi = this.baseapi || window.location.origin;
this.tokens = this.baseapi.split('://');
this.wsurl = (this.tokens.shift() === 'https' ? 'wss' : 'ws') + '://' + this.tokens.shift();
this.domain = window.location.hostname;
this.connect = (this.connect !== undefined) ? this.connect : true;
this.comments = [];
},
attached: function(){
if(!this.nid){
throw 'Attribute missing: nid';
}
this.$.websocket.addEventListener('message', this.updateComments.bind(this));
this.$.get_comments.go();
},
populateComments: function(evt){
this.comments = evt.detail.response;
},
updateComments: function(evt){
this.comments.push(evt.detail);
},
newComment: function(evt){
this.message = '';
evt.preventDefault();
if(!this.author || !this.text){
this.message = 'completa tutti i campi';
return;
}
this.$.new_comment.go();
},
resetForm: function(){
this.author = this.text = '';
}
});
| Fix how to calculate ws URL from baseapi URL | Fix how to calculate ws URL from baseapi URL
| JavaScript | mit | sandropaganotti/annotate |
447241fc88b42a03b9091da7066e7e58a414e3a2 | src/geojson.js | src/geojson.js | module.exports.point = justType('Point', 'POINT');
module.exports.line = justType('LineString', 'POLYLINE');
module.exports.polygon = justType('Polygon', 'POLYGON');
function justType(type, TYPE) {
return function(gj) {
var oftype = gj.features.filter(isType(type));
return {
geometries: oftype.map(justCoords),
properties: oftype.map(justProps),
type: TYPE
};
};
}
function justCoords(t) {
if (t.geometry.coordinates[0] !== undefined &&
t.geometry.coordinates[0][0] !== undefined &&
t.geometry.coordinates[0][0][0] !== undefined) {
return t.geometry.coordinates[0];
} else {
return t.geometry.coordinates;
}
}
function justProps(t) {
return t.properties;
}
function isType(t) {
return function(f) { return f.geometry.type === t; };
}
| module.exports.point = justType('Point', 'POINT');
module.exports.line = justType('LineString', 'POLYLINE');
module.exports.polygon = justType('Polygon', 'POLYGON');
function justType(type, TYPE) {
return function(gj) {
var oftype = gj.features.filter(isType(type));
return {
geometries: (TYPE === 'POLYGON' || TYPE === 'POLYLINE') ? [oftype.map(justCoords)] : oftype.map(justCoords),
properties: oftype.map(justProps),
type: TYPE
};
};
}
function justCoords(t) {
if (t.geometry.coordinates[0] !== undefined &&
t.geometry.coordinates[0][0] !== undefined &&
t.geometry.coordinates[0][0][0] !== undefined) {
return t.geometry.coordinates[0];
} else {
return t.geometry.coordinates;
}
}
function justProps(t) {
return t.properties;
}
function isType(t) {
return function(f) { return f.geometry.type === t; };
}
| Add type check for polygon and polyline arrays | fix(output): Add type check for polygon and polyline arrays
Added a type check to properly wrap polygon and polyline arrays | JavaScript | bsd-3-clause | mapbox/shp-write,mapbox/shp-write |
d62ccfd234f702b66124a673e54076dbdfe693be | lib/util/endpointParser.js | lib/util/endpointParser.js | var semver = require('semver');
var createError = require('./createError');
function decompose(endpoint) {
var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)\|)?([^\|#]+)(?:#(.*))?$/;
var matches = endpoint.match(regExp);
if (!matches) {
throw createError('Invalid endpoint: "' + endpoint + '"', 'EINVEND');
}
return {
name: matches[1] || '',
source: matches[2],
target: matches[3] || '*'
};
}
function compose(decEndpoint) {
var composed = '';
if (decEndpoint.name) {
composed += decEndpoint.name + '|';
}
composed += decEndpoint.source;
if (decEndpoint.target) {
composed += '#' + decEndpoint.target;
}
return composed;
}
function json2decomposed(key, value) {
var endpoint = key + '|';
if (semver.valid(value) != null || semver.validRange(value) != null) {
endpoint += key + '#' + value;
} else {
endpoint += value;
}
return decompose(endpoint);
}
module.exports.decompose = decompose;
module.exports.compose = compose;
module.exports.json2decomposed = json2decomposed;
| var semver = require('semver');
var createError = require('./createError');
function decompose(endpoint) {
var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/;
var matches = endpoint.match(regExp);
if (!matches) {
throw createError('Invalid endpoint: "' + endpoint + '"', 'EINVEND');
}
return {
name: matches[1] || '',
source: matches[2],
target: matches[3] || '*'
};
}
function compose(decEndpoint) {
var composed = '';
if (decEndpoint.name) {
composed += decEndpoint.name + '=';
}
composed += decEndpoint.source;
if (decEndpoint.target) {
composed += '#' + decEndpoint.target;
}
return composed;
}
function json2decomposed(key, value) {
var endpoint = key + '=';
if (semver.valid(value) != null || semver.validRange(value) != null) {
endpoint += key + '#' + value;
} else {
endpoint += value;
}
return decompose(endpoint);
}
module.exports.decompose = decompose;
module.exports.compose = compose;
module.exports.json2decomposed = json2decomposed;
| Change name separator of the endpoint (can't use pipe duh). | Change name separator of the endpoint (can't use pipe duh).
| JavaScript | mit | dreamauya/bower,jisaacks/bower,Blackbaud-EricSlater/bower,DrRataplan/bower,rlugojr/bower,grigorkh/bower,omurbilgili/bower,yinhe007/bower,XCage15/bower,gronke/bower,amilaonbitlab/bower,jodytate/bower,Teino1978-Corp/bower,prometheansacrifice/bower,adriaanthomas/bower,unilynx/bower,watilde/bower,rajzshkr/bower,jvkops/bower,gorcz/bower,cgvarela/bower,magnetech/bower,Backbase/bower,supriyantomaftuh/bower,hyperweb2/upt,pjump/bower,skinzer/bower,fernandomoraes/bower,Jeremy017/bower,msbit/bower,sanyueyu/bower,akaash-nigam/bower,liorhson/bower,wenyanw/bower,mex/bower,M4gn4tor/bower,pertrai1/bower,Connectlegendary/bower,ThiagoGarciaAlves/bower,angeliaz/bower,JFrogDev/bower-art,krahman/bower,insanehong/bower,buildsample/bower,bower/bower,kodypeterson/bower,thinkxl/bower,kevinjdinicola/hg-bower,mattpugh/bower,yuhualingfeng/bower,DevVersion/bower,return02/bower,fewspider/bower,xfstudio/bower,TooHTooH/bower,kruppel/bower,pwang2/bower,Teino1978-Corp/Teino1978-Corp-bower,lukemelia/bower,haolee1990/bower,Jinkwon/naver-bower-cli,vladikoff/bower,cnbin/bower,PimsJay01/bower,twalpole/bower |
0b7ec05717cf6c89e9cbe307bec611326c19ae43 | js/metronome.js | js/metronome.js | function Metronome(tempo, beatsPerMeasure){
this.tempo = Number(tempo);
this.beatsPerMeasure = Number(beatsPerMeasure);
this.interval = null;
}
Metronome.prototype.start = function(){
var millisecondsToWait = this.tempoToMilliseconds(this.tempo);
this.interval = window.setInterval(soundAndCounter, millisecondsToWait, this);
}
Metronome.prototype.tempoToMilliseconds = function(tempo){
return (1000 * 60)/tempo;
}
soundAndCounter = function(metronome){
updateCounterView(metronome);
}
updateCounterView = function(metronome){
var counter = document.getElementById("metronome-counter");
var pastBeat = Number(counter.innerHTML);
if (pastBeat < metronome.beatsPerMeasure){
counter.innerHTML = pastBeat + 1;
} else {
counter.innerHTML = 1;
}
}
Metronome.prototype.stop = function(){
window.clearInterval(this.interval);
counter.innerHTML = "";
} | function Metronome(tempo, beatsPerMeasure){
this.tempo = Number(tempo);
this.beatsPerMeasure = Number(beatsPerMeasure);
this.interval = null;
}
Metronome.prototype.start = function(){
var millisecondsToWait = this.tempoToMilliseconds(this.tempo);
this.interval = window.setInterval(soundAndCounter, millisecondsToWait, this);
}
Metronome.prototype.tempoToMilliseconds = function(tempo){
return (1000 * 60)/tempo;
}
Metronome.prototype.stop = function(){
window.clearInterval(this.interval);
var counter = document.getElementById("metronome-counter");
counter.innerHTML = "";
}
soundAndCounter = function(metronome){
updateCounterView(metronome);
}
updateCounterView = function(metronome){
var counter = document.getElementById("metronome-counter");
var pastBeat = Number(counter.innerHTML);
if (pastBeat < metronome.beatsPerMeasure){
counter.innerHTML = pastBeat + 1;
} else {
counter.innerHTML = 1;
}
}
| Add reference to counter in stop method | Add reference to counter in stop method
| JavaScript | mit | dmilburn/beatrice,dmilburn/beatrice |
ab53bc3e982b21a24fa7a0b36d43d98213ffbb7c | lib/winston-syslog-ain2.js | lib/winston-syslog-ain2.js | /*
* MIT LICENCE
*/
var util = require('util'),
winston = require('winston'),
SysLogger = require("ain2");
var ain;
var SyslogAin2 = exports.SyslogAin2 = function (options) {
winston.Transport.call(this, options);
options = options || {};
ain = new SysLogger(options);
};
util.inherits(SyslogAin2, winston.Transport);
SyslogAin2.prototype.name = 'SyslogAin2';
SyslogAin2.prototype.log = function (level, msg, meta, callback) {
ain[level](msg + (null!=meta ? ' '+util.inspect(meta) : ''));
callback();
};
| /*
* MIT LICENCE
*/
var util = require('util'),
winston = require('winston'),
SysLogger = require("ain2");
var SyslogAin2 = exports.SyslogAin2 = function (options) {
winston.Transport.call(this, options);
options = options || {};
this.ain = new SysLogger(options);
};
util.inherits(SyslogAin2, winston.Transport);
SyslogAin2.prototype.name = 'SyslogAin2';
SyslogAin2.prototype.log = function (level, msg, meta, callback) {
this.ain[level](msg + (null!=meta ? ' '+util.inspect(meta) : ''));
callback();
};
| Fix bug that the old settings of the ain2 is got replaced | Fix bug that the old settings of the ain2 is got replaced
| JavaScript | mit | lamtha/winston-syslog-ain2 |
ec7c6848b01a3e6288b3d5326ca9df677052f7da | lib/action.js | lib/action.js | var _ = require('lodash-node');
var Action = function(name, two, three, four) {
var options, run, helpers;
// Syntax .extend('action#method', function() { ... }, {})
if ( typeof two == 'function' ) {
options = {};
run = two;
helpers = three;
}
// Syntax .extend('action#method', {}, function() { ... }, {})
if ( typeof three == 'function' ) {
options = two;
run = three;
helpers = four;
}
var presets = {
name: name,
description: name + ' description',
inputs: {
required: [],
optional: []
},
blockedConnectionTypes: [],
outputExample: {},
run: function(api, conn, next){
this.api = api;
this.next = function(success) {
next(conn, success);
};
this.json = conn.response;
this.params = conn.params;
this.req = conn.request;
run.apply(this, arguments);
}
};
return _.merge(presets, options, helpers);
};
module.exports = Action; | var _ = require('lodash-node');
var Action = function(name, two, three, four) {
var options, run, helpers;
// Syntax .extend('action#method', function() { ... }, {})
if ( typeof two == 'function' ) {
options = {};
run = two;
helpers = three;
}
// Syntax .extend('action#method', {}, function() { ... }, {})
if ( typeof three == 'function' ) {
options = two;
run = three;
helpers = four;
}
var presets = {
name: name,
description: name + ' description',
inputs: {
required: [],
optional: []
},
blockedConnectionTypes: [],
outputExample: {},
run: function(api, conn, next){
this.api = api;
this.connection = conn;
this.next = function(success) {
next(conn, success);
};
this.json = conn.response;
this.params = conn.params;
this.request = conn.request;
run.apply(this, arguments);
}
};
return _.merge(presets, options, helpers);
};
module.exports = Action; | Add connection parameter and change req to request | Add connection parameter and change req to request
| JavaScript | mit | alexparker/actionpack |
cd0341613c11d07d2c9990adb12635f4e7809dfc | list/source/package.js | list/source/package.js | enyo.depends(
"Selection.js",
"FlyweightRepeater.js",
"List.css",
"List.js",
"PulldownList.css",
"PulldownList.js"
); | enyo.depends(
"FlyweightRepeater.js",
"List.css",
"List.js",
"PulldownList.css",
"PulldownList.js"
); | Remove enyo.Selection from layout library, moved into enyo base-UI | Remove enyo.Selection from layout library, moved into enyo base-UI
| JavaScript | apache-2.0 | enyojs/layout |
465e33e170a10ad39c3948cb9bcb852bd5705f91 | src/ol/style/fillstyle.js | src/ol/style/fillstyle.js | goog.provide('ol.style.Fill');
goog.require('ol.color');
/**
* @constructor
* @param {olx.style.FillOptions} options Options.
*/
ol.style.Fill = function(options) {
/**
* @type {ol.Color|string}
*/
this.color = goog.isDef(options.color) ? options.color : null;
};
| goog.provide('ol.style.Fill');
goog.require('ol.color');
/**
* @constructor
* @param {olx.style.FillOptions=} opt_options Options.
*/
ol.style.Fill = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
/**
* @type {ol.Color|string}
*/
this.color = goog.isDef(options.color) ? options.color : null;
};
| Make options argument to ol.style.Fill optional | Make options argument to ol.style.Fill optional
| JavaScript | bsd-2-clause | das-peter/ol3,adube/ol3,mzur/ol3,xiaoqqchen/ol3,Distem/ol3,gingerik/ol3,antonio83moura/ol3,gingerik/ol3,itayod/ol3,bjornharrtell/ol3,tsauerwein/ol3,Antreasgr/ol3,klokantech/ol3raster,pmlrsg/ol3,das-peter/ol3,landonb/ol3,t27/ol3,kkuunnddaannkk/ol3,freylis/ol3,fredj/ol3,Andrey-Pavlov/ol3,kjelderg/ol3,geonux/ol3,elemoine/ol3,thhomas/ol3,t27/ol3,klokantech/ol3,mechdrew/ol3,bogdanvaduva/ol3,klokantech/ol3,stweil/ol3,tschaub/ol3,bill-chadwick/ol3,landonb/ol3,stweil/ol3,stweil/ol3,antonio83moura/ol3,xiaoqqchen/ol3,Distem/ol3,mzur/ol3,geekdenz/openlayers,fredj/ol3,fblackburn/ol3,llambanna/ol3,freylis/ol3,thhomas/ol3,ahocevar/openlayers,alvinlindstam/ol3,hafenr/ol3,pmlrsg/ol3,NOAA-ORR-ERD/ol3,bill-chadwick/ol3,thomasmoelhave/ol3,thhomas/ol3,CandoImage/ol3,t27/ol3,NOAA-ORR-ERD/ol3,kjelderg/ol3,fblackburn/ol3,richstoner/ol3,xiaoqqchen/ol3,geonux/ol3,NOAA-ORR-ERD/ol3,ahocevar/ol3,tschaub/ol3,llambanna/ol3,gingerik/ol3,pmlrsg/ol3,oterral/ol3,Morgul/ol3,planetlabs/ol3,tamarmot/ol3,richstoner/ol3,tsauerwein/ol3,pmlrsg/ol3,jacmendt/ol3,geonux/ol3,jacmendt/ol3,Morgul/ol3,gingerik/ol3,antonio83moura/ol3,alvinlindstam/ol3,ahocevar/ol3,openlayers/openlayers,bjornharrtell/ol3,mechdrew/ol3,Distem/ol3,CandoImage/ol3,bjornharrtell/ol3,itayod/ol3,klokantech/ol3raster,elemoine/ol3,thomasmoelhave/ol3,stweil/openlayers,kkuunnddaannkk/ol3,denilsonsa/ol3,elemoine/ol3,klokantech/ol3,stweil/openlayers,Antreasgr/ol3,llambanna/ol3,mzur/ol3,wlerner/ol3,Andrey-Pavlov/ol3,alvinlindstam/ol3,tsauerwein/ol3,Morgul/ol3,t27/ol3,denilsonsa/ol3,NOAA-ORR-ERD/ol3,klokantech/ol3,fblackburn/ol3,tsauerwein/ol3,jacmendt/ol3,bartvde/ol3,itayod/ol3,richstoner/ol3,ahocevar/ol3,adube/ol3,aisaacs/ol3,planetlabs/ol3,jmiller-boundless/ol3,Andrey-Pavlov/ol3,thomasmoelhave/ol3,geekdenz/openlayers,geekdenz/ol3,Antreasgr/ol3,geekdenz/ol3,aisaacs/ol3,tamarmot/ol3,mechdrew/ol3,denilsonsa/ol3,hafenr/ol3,bill-chadwick/ol3,llambanna/ol3,freylis/ol3,jmiller-boundless/ol3,fperucic/ol3,jmiller-boundless/ol3,tschaub/ol3,ahocevar/openlayers,bartvde/ol3,wlerner/ol3,thhomas/ol3,Andrey-Pavlov/ol3,elemoine/ol3,ahocevar/ol3,jacmendt/ol3,itayod/ol3,kkuunnddaannkk/ol3,fperucic/ol3,klokantech/ol3raster,ahocevar/openlayers,adube/ol3,bill-chadwick/ol3,aisaacs/ol3,alexbrault/ol3,bogdanvaduva/ol3,wlerner/ol3,openlayers/openlayers,fredj/ol3,jmiller-boundless/ol3,geekdenz/ol3,fredj/ol3,stweil/openlayers,jmiller-boundless/ol3,tschaub/ol3,geekdenz/openlayers,oterral/ol3,landonb/ol3,alexbrault/ol3,kjelderg/ol3,oterral/ol3,tamarmot/ol3,wlerner/ol3,freylis/ol3,richstoner/ol3,bogdanvaduva/ol3,alvinlindstam/ol3,landonb/ol3,alexbrault/ol3,CandoImage/ol3,xiaoqqchen/ol3,das-peter/ol3,Distem/ol3,thomasmoelhave/ol3,bogdanvaduva/ol3,denilsonsa/ol3,planetlabs/ol3,openlayers/openlayers,CandoImage/ol3,mzur/ol3,epointal/ol3,bartvde/ol3,epointal/ol3,fperucic/ol3,hafenr/ol3,planetlabs/ol3,stweil/ol3,das-peter/ol3,antonio83moura/ol3,mechdrew/ol3,tamarmot/ol3,geonux/ol3,epointal/ol3,aisaacs/ol3,Antreasgr/ol3,epointal/ol3,fblackburn/ol3,kkuunnddaannkk/ol3,kjelderg/ol3,alexbrault/ol3,hafenr/ol3,bartvde/ol3,klokantech/ol3raster,geekdenz/ol3,fperucic/ol3,Morgul/ol3 |
4f2ecb38e7eed9706dd4709915a532bdb5a943f2 | rcmet/src/main/ui/test/unit/services/RegionSelectParamsTest.js | rcmet/src/main/ui/test/unit/services/RegionSelectParamsTest.js | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http: *www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
**/
'use strict';
describe('OCW Services', function() {
beforeEach(module('ocw.services'));
describe('RegionSelectParams', function() {
it('should initialize the regionSelectParams service', function() {
inject(function(regionSelectParams) {
expect(regionSelectParams).not.toEqual(null);
});
});
});
});
| /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http: *www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
**/
'use strict';
describe('OCW Services', function() {
beforeEach(module('ocw.services'));
describe('RegionSelectParams', function() {
it('should initialize the regionSelectParams service', function() {
inject(function(regionSelectParams) {
expect(regionSelectParams).not.toEqual(null);
});
});
it('should provide the getParameters function', function() {
inject(function(regionSelectParams) {
expect(regionSelectParams.getParameters()).not.toEqual(null);
});
});
});
});
| Resolve CLIMATE-147 - Add tests for regionSelectParams service | Resolve CLIMATE-147 - Add tests for regionSelectParams service
- Add getParameters test.
git-svn-id: https://svn.apache.org/repos/asf/incubator/climate/trunk@1496037 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: 3d2be98562f344323a5532ca5757850d175ba25c | JavaScript | apache-2.0 | jarifibrahim/climate,apache/climate,Omkar20895/climate,huikyole/climate,MJJoyce/climate,lewismc/climate,MJJoyce/climate,jarifibrahim/climate,kwhitehall/climate,pwcberry/climate,riverma/climate,MJJoyce/climate,agoodm/climate,riverma/climate,agoodm/climate,MBoustani/climate,MBoustani/climate,riverma/climate,lewismc/climate,pwcberry/climate,lewismc/climate,apache/climate,MBoustani/climate,agoodm/climate,huikyole/climate,huikyole/climate,lewismc/climate,apache/climate,MJJoyce/climate,kwhitehall/climate,lewismc/climate,Omkar20895/climate,pwcberry/climate,apache/climate,agoodm/climate,jarifibrahim/climate,Omkar20895/climate,MBoustani/climate,riverma/climate,huikyole/climate,kwhitehall/climate,pwcberry/climate,apache/climate,Omkar20895/climate,kwhitehall/climate,agoodm/climate,pwcberry/climate,jarifibrahim/climate,riverma/climate,MJJoyce/climate,Omkar20895/climate,jarifibrahim/climate,MBoustani/climate,huikyole/climate |
9750b5683e1a545a66251e78e07ef6b362a8b6d8 | browser/main.js | browser/main.js | const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Menu = electron.Menu;
var menu = require('./menu');
var argv = require('optimist').argv;
let mainWindow;
app.on('ready', function() {
mainWindow = new BrowserWindow({
center: true,
title: 'JBrowseDesktop',
width: 1024,
height: 768
});
var queryString = Object.keys(argv).map(key => key + '=' + argv[key]).join('&');
mainWindow.loadURL('file://' + require('path').resolve(__dirname, '../index.html?'+queryString));
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
mainWindow.on('closed', function () {
mainWindow = null;
});
});
// Quit when all windows are closed.
app.on('window-all-closed', function () {
app.quit();
});
| const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const Menu = electron.Menu;
var menu = require('./menu');
var argv = require('optimist').argv;
let mainWindow;
app.on('ready', function() {
mainWindow = new BrowserWindow({
center: true,
title: 'JBrowseDesktop',
width: 1024,
height: 768,
icon: require('path').resolve(__dirname, 'icons/jbrowse.png')
});
var queryString = Object.keys(argv).map(key => key + '=' + argv[key]).join('&');
mainWindow.loadURL('file://' + require('path').resolve(__dirname, '../index.html?'+queryString));
Menu.setApplicationMenu(Menu.buildFromTemplate(menu));
mainWindow.on('closed', function () {
mainWindow = null;
});
});
// Quit when all windows are closed.
app.on('window-all-closed', function () {
app.quit();
});
| Add icon that works for linux apps also | Add icon that works for linux apps also
| JavaScript | lgpl-2.1 | GMOD/jbrowse,GMOD/jbrowse,GMOD/jbrowse,nathandunn/jbrowse,nathandunn/jbrowse,nathandunn/jbrowse,GMOD/jbrowse,GMOD/jbrowse,nathandunn/jbrowse,nathandunn/jbrowse |
f5d144abff50c9044cbfeeec16c8169a361aec1c | packages/@sanity/server/src/configs/postcssPlugins.js | packages/@sanity/server/src/configs/postcssPlugins.js | import lost from 'lost'
import postcssUrl from 'postcss-url'
import postcssImport from 'postcss-import'
import postcssCssnext from 'postcss-cssnext'
import resolveStyleImport from '../util/resolveStyleImport'
export default options => {
const styleResolver = resolveStyleImport({from: options.basePath})
const importer = postcssImport({resolve: styleResolver})
return wp => {
return [
importer,
postcssCssnext,
postcssUrl({url: 'rebase'}),
lost
]
}
}
| import path from 'path'
import lost from 'lost'
import postcssUrl from 'postcss-url'
import postcssImport from 'postcss-import'
import postcssCssnext from 'postcss-cssnext'
import resolveStyleImport from '../util/resolveStyleImport'
const absolute = /^(\/|\w+:\/\/)/
const isAbsolute = url => absolute.test(url)
export default options => {
const styleResolver = resolveStyleImport({from: options.basePath})
const importer = postcssImport({resolve: styleResolver})
const resolveUrl = (url, decl, from, dirname) => (
isAbsolute(url) ? url : path.resolve(dirname, url)
)
return wp => {
return [
importer,
postcssCssnext,
postcssUrl({url: resolveUrl}),
lost
]
}
}
| Use custom way to resolve URLs for file assets that are relative | [server] Use custom way to resolve URLs for file assets that are relative
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
f0d73e072691c7ae4ee848c7ef0868aebd6c8ce4 | components/prism-docker.js | components/prism-docker.js | Prism.languages.docker = {
'keyword': {
pattern: /(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|LABEL|ENTRYPOINT)(?=\s)/mi,
lookbehind: true
},
'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,
'comment': /#.*/,
'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/
};
Prism.languages.dockerfile = Prism.languages.docker;
| Prism.languages.docker = {
'keyword': {
pattern: /(^\s*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)/mi,
lookbehind: true
},
'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,
'comment': /#.*/,
'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/
};
Prism.languages.dockerfile = Prism.languages.docker;
| Update the list of keywords for dockerfiles | Update the list of keywords for dockerfiles
| JavaScript | mit | PrismJS/prism,mAAdhaTTah/prism,PrismJS/prism,CupOfTea696/prism,mAAdhaTTah/prism,PrismJS/prism,byverdu/prism,PrismJS/prism,byverdu/prism,CupOfTea696/prism,mAAdhaTTah/prism,mAAdhaTTah/prism,mAAdhaTTah/prism,PrismJS/prism,CupOfTea696/prism,byverdu/prism,byverdu/prism,CupOfTea696/prism,CupOfTea696/prism,byverdu/prism |
c6db2d07bbda721d18ebce6c3526ec393b61e5b2 | src/ol/geom.js | src/ol/geom.js | /**
* @module ol/geom
*/
export {default as Circle} from './geom/Circle.js';
export {default as Geometry} from './geom/Geometry.js';
export {default as GeometryCollection} from './geom/GeometryCollection';
export {default as LineString} from './geom/LineString.js';
export {default as MultiLineString} from './geom/MultiLineString.js';
export {default as MultiPoint} from './geom/MultiPoint.js';
export {default as MultiPolygon} from './geom/MultiPolygon.js';
export {default as Point} from './geom/Point.js';
export {default as Polygon} from './geom/Polygon.js';
| /**
* @module ol/geom
*/
export {default as Circle} from './geom/Circle.js';
export {default as Geometry} from './geom/Geometry.js';
export {default as GeometryCollection} from './geom/GeometryCollection.js';
export {default as LineString} from './geom/LineString.js';
export {default as MultiLineString} from './geom/MultiLineString.js';
export {default as MultiPoint} from './geom/MultiPoint.js';
export {default as MultiPolygon} from './geom/MultiPolygon.js';
export {default as Point} from './geom/Point.js';
export {default as Polygon} from './geom/Polygon.js';
| Use .js extension for import | Use .js extension for import
Co-Authored-By: ahocevar <02d02e811da4fb4f389e866b67c0fe930c3e5051@gmail.com> | JavaScript | bsd-2-clause | adube/ol3,tschaub/ol3,stweil/openlayers,bjornharrtell/ol3,tschaub/ol3,tschaub/ol3,openlayers/openlayers,stweil/openlayers,stweil/ol3,bjornharrtell/ol3,geekdenz/openlayers,geekdenz/openlayers,geekdenz/ol3,oterral/ol3,oterral/ol3,ahocevar/ol3,geekdenz/ol3,ahocevar/openlayers,geekdenz/ol3,adube/ol3,geekdenz/ol3,bjornharrtell/ol3,stweil/ol3,openlayers/openlayers,oterral/ol3,ahocevar/ol3,ahocevar/ol3,ahocevar/ol3,stweil/ol3,ahocevar/openlayers,ahocevar/openlayers,geekdenz/openlayers,stweil/ol3,adube/ol3,tschaub/ol3,openlayers/openlayers,stweil/openlayers |
030b97c50a57e1487b8459f91ee4a220810a8a63 | babel.config.js | babel.config.js | require("@babel/register")({
only: [
"src",
/node_modules\/alekhine/
]
})
module.exports = {
presets: [
"@babel/preset-env"
],
plugins: [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"add-filehash", [
"transform-imports",
{
vuetify: {
transform: "vuetify/src/components/${member}",
preventFullImport: false
}
}
]
],
env: {
development: {
"sourceMaps": "inline"
}
}
}
| module.exports = {
presets: [
"@babel/preset-env"
],
plugins: [
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-object-rest-spread",
"add-filehash", [
"transform-imports",
{
vuetify: {
transform: "vuetify/src/components/${member}",
preventFullImport: false
}
}
]
],
env: {
development: {
"sourceMaps": "inline"
}
}
}
| Revert "compile alekhine as needed in development" | Revert "compile alekhine as needed in development"
This reverts commit 917d5d50fd6ef0bbf845efa0bf13a2adba2fe58a.
| JavaScript | mit | sonnym/bughouse,sonnym/bughouse |
27982b6392b8dcd2adc22fb0db7eb0aecab0f62a | test/algorithms/sorting/testHeapSort.js | test/algorithms/sorting/testHeapSort.js | /* eslint-env mocha */
const HeapSort = require('../../../src').algorithms.Sorting.HeapSort;
const assert = require('assert');
describe('HeapSort', () => {
it('should have no data when empty initialization', () => {
const inst = new HeapSort();
assert.equal(inst.size, 0);
assert.deepEqual(inst.unsortedList, []);
assert.deepEqual(inst.sortedList, []);
});
it('should sort the array', () => {
const inst = new HeapSort([2, 1, 3, 4]);
assert.equal(inst.size, 4);
assert.deepEqual(inst.unsortedList, [2, 1, 3, 4]);
assert.deepEqual(inst.sortedList, [1, 2, 3, 4]);
assert.equal(inst.toString(), '1, 2, 3, 4');
});
});
| /* eslint-env mocha */
const HeapSort = require('../../../src').algorithms.Sorting.HeapSort;
const assert = require('assert');
describe('HeapSort', () => {
it('should have no data when empty initialization', () => {
const inst = new HeapSort();
assert.equal(inst.size, 0);
assert.deepEqual(inst.unsortedList, []);
assert.deepEqual(inst.sortedList, []);
});
it('should sort the array', () => {
const inst = new HeapSort([2, 1, 3, 4]);
assert.equal(inst.size, 4);
assert.deepEqual(inst.unsortedList, [2, 1, 3, 4]);
assert.deepEqual(inst.sortedList, [1, 2, 3, 4]);
assert.equal(inst.toString(), '1, 2, 3, 4');
});
it('should sort the array in ascending order with few equal vals', () => {
const inst = new HeapSort([2, 1, 3, 4, 2], (a, b) => a < b);
assert.equal(inst.size, 5);
assert.deepEqual(inst.unsortedList, [2, 1, 3, 4, 2]);
assert.deepEqual(inst.sortedList, [1, 2, 2, 3, 4]);
assert.equal(inst.toString(), '1, 2, 2, 3, 4');
});
});
| Test Heap Sort: Sort array with equal vals | Test Heap Sort: Sort array with equal vals
| JavaScript | mit | ManrajGrover/algorithms-js |
6a408d16822f596bedeb524912471845ced74048 | ckanext/ckanext-apicatalog_ui/ckanext/apicatalog_ui/fanstatic/cookieconsent/ckan-cookieconsent.js | ckanext/ckanext-apicatalog_ui/ckanext/apicatalog_ui/fanstatic/cookieconsent/ckan-cookieconsent.js | window.cookieconsent.initialise({
container: document.getElementById("cookie_consent"),
position: "top",
type: "opt-in",
static: false,
theme: "suomifi",
onInitialise: function (status){
let type = this.options.type;
let didConsent = this.hasConsented();
if (type === 'opt-in' && didConsent) {
console.log("enable cookies")
}
if (type === 'opt-out' && !didConsent) {
console.log("disable cookies")
}
},
onStatusChange: function(status, chosenBefore) {
let type = this.options.type;
let didConsent = this.hasConsented();
if (type === 'opt-in' && didConsent) {
console.log("enable cookies")
window.location.reload();
}
if (type === 'opt-in' && !didConsent) {
console.log("disable cookies")
window.location.reload();
}
}
}) | ckan.module('cookie_consent', function (jQuery){
return {
initialize: function() {
window.cookieconsent.initialise({
container: document.getElementById("cookie_consent"),
position: "top",
type: "opt-in",
static: false,
theme: "suomifi",
content: {
policy: this._('Cookie Policy'),
message: this._('This website uses cookies to ensure you get the best experience on our website.'),
allow: this._('Allow cookies'),
deny: this._('Decline'),
link: this._('Learn more')
},
onStatusChange: function(status, chosenBefore) {
let type = this.options.type;
let didConsent = this.hasConsented();
if (type === 'opt-in' && didConsent) {
console.log("enable cookies")
window.location.reload();
}
if (type === 'opt-in' && !didConsent) {
console.log("disable cookies")
window.location.reload();
}
}
})
}
}
}) | Add translations to cookie popup | LIKA-244: Add translations to cookie popup
| JavaScript | mit | vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog,vrk-kpa/api-catalog |
771e7c0d485a6a0e45d550d555beb500e256ebde | react/react-practice/src/actions/lifeCycleActions.js | react/react-practice/src/actions/lifeCycleActions.js | import {firebaseApp,firebaseAuth,firebaseDb, firebaseStorage, firebaseAuthInstance } from '../components/Firebase.js'
import { browserHistory } from 'react-router';
export function goToNextState() {
return function(dispatch) {
dispatch({type: "GET_SCHEDULE"})
}
}
export function testPromise() {
let response = new Promise()
return function(dispatch) {
dispatch({type: "TEST_PROMISE"})
}
} | import {firebaseApp,firebaseAuth,firebaseDb, firebaseStorage, firebaseAuthInstance } from '../components/Firebase.js'
import { browserHistory } from 'react-router';
export function goToNextState() {
return function(dispatch) {
dispatch({type: "GET_SCHEDULE"})
}
}
export function testPromise() {
let response = new Promise((resolve, reject) => {
function(dispatch) {
dispatch({type: "TEST_PROMISE"})
}
})
return function(dispatch) {
dispatch({type: "TEST_PROMISE"})
}
}
| Test promise in the actions | Test promise in the actions | JavaScript | mit | jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm,jeremykid/FunAlgorithm |
b9ed588780e616228d133b91117b80930d658140 | src/components/PlaybackCtrl/PlaybackCtrlContainer.js | src/components/PlaybackCtrl/PlaybackCtrlContainer.js | import { connect } from 'react-redux'
import PlaybackCtrl from './PlaybackCtrl'
import { requestPlay, requestPause, requestVolume, requestPlayNext } from 'store/modules/status'
// Object of action creators (can also be function that returns object).
const mapActionCreators = {
requestPlay,
requestPlayNext,
requestPause,
requestVolume,
}
const mapStateToProps = (state) => {
return {
isAdmin: state.user.isAdmin,
isInRoom: state.user.roomId !== null,
isPlaying: state.status.isPlaying,
isAtQueueEnd: state.status.isAtQueueEnd,
volume: state.status.volume,
}
}
export default connect(mapStateToProps, mapActionCreators)(PlaybackCtrl)
| import { connect } from 'react-redux'
import PlaybackCtrl from './PlaybackCtrl'
import { requestPlay, requestPause, requestVolume, requestPlayNext } from 'store/modules/status'
// Object of action creators (can also be function that returns object).
const mapActionCreators = {
requestPlay,
requestPlayNext,
requestPause,
requestVolume,
}
const mapStateToProps = (state) => {
return {
isAdmin: state.user.isAdmin,
isInRoom: state.user.roomId !== null,
isPlaying: state.status.isPlaying,
isAtQueueEnd: state.status.isAtQueueEnd,
volume: state.status.volume,
isPlayerPresent: state.status.isPlayerPresent,
}
}
export default connect(mapStateToProps, mapActionCreators)(PlaybackCtrl)
| Add missing status prop for PlaybackCtrl | Add missing status prop for PlaybackCtrl
| JavaScript | isc | bhj/karaoke-forever,bhj/karaoke-forever |
66b91190f513893efbe7eef9beba1925e32a44d5 | lib/build-navigation/index.js | lib/build-navigation/index.js | 'use strict';
const path = require('path');
const buildNavigation = function(styleguideArray) {
let options = this;
options.navigation = {};
styleguideArray.forEach((obj) => {
let fileName = (obj.writeName || obj.title).replace(/ /g, '_').toLowerCase() + '.html';
options.navigation[obj.title] = fileName;
});
return styleguideArray;
};
module.exports = buildNavigation;
| 'use strict';
const buildNavigation = function(styleguideArray) {
let options = this,
_nav = {};
options.navigation = {};
styleguideArray.forEach((obj) => {
let fileName = (obj.writeName || obj.title).replace(/ /g, '_').toLowerCase() + '.html';
_nav[obj.title] = fileName;
});
Object.keys(_nav)
.sort()
.forEach(function(v, i) {
options.navigation[v] = _nav[v];
});
return styleguideArray;
};
module.exports = buildNavigation;
| Update navigation to be in alphabetical order | Update navigation to be in alphabetical order
| JavaScript | mit | tbremer/live-guide,tbremer/live-guide |
de7a0b64dcd24892e0333f9e77f56ca6117cae5a | cli/main.js | cli/main.js | #!/usr/bin/env node
'use strict'
process.title = 'ucompiler'
require('debug').enable('UCompiler:*')
const UCompiler = require('..')
const knownCommands = ['go', 'watch']
const parameters = process.argv.slice(2)
if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) {
console.log('Usage: ucompiler go|watch [path]')
process.exit(0)
}
if (parameters[0] === 'go') {
UCompiler.compile(parameters[1] || null, {cwd: process.cwd()}).catch(function(e) {
console.error(e)
process.exit(1)
})
} else if (parameters[0] === 'watch') {
if (!parameters[1]) {
console.error('You must specify a path to watch')
process.exit(1)
}
UCompiler.watch(parameters[1])
}
| #!/usr/bin/env node
'use strict'
process.title = 'ucompiler'
require('debug').enable('UCompiler:*')
var UCompiler = require('..')
var knownCommands = ['go', 'watch']
var parameters = process.argv.slice(2)
if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) {
console.log('Usage: ucompiler go|watch [path]')
process.exit(0)
}
if (parameters[0] === 'go') {
UCompiler.compile(parameters[1] || null, {cwd: process.cwd()}).catch(function(e) {
console.error(e)
process.exit(1)
})
} else if (parameters[0] === 'watch') {
if (!parameters[1]) {
console.error('You must specify a path to watch')
process.exit(1)
}
UCompiler.watch(parameters[1])
}
| Use art instead of const in cli file | :art: Use art instead of const in cli file
| JavaScript | mit | steelbrain/UCompiler |
ac0c31a94428c1180ef7b309c79410bfc28ccdf0 | config.js | config.js | var env = process.env.NODE_ENV || 'development';
var defaults = {
"static": {
port: 3003
},
"socket": {
options: {
origins: '*:*',
log: true,
heartbeats: false,
authorization: false,
transports: [
'websocket',
'flashsocket',
'htmlfile',
'xhr-polling',
'jsonp-polling'
],
'log level': 1,
'flash policy server': true,
'flash policy port': 3013,
'destroy upgrade': true,
'browser client': true,
'browser client minification': true,
'browser client etag': true,
'browser client gzip': false
}
},
"nohm": {
url: 'localhost',
port: 6379,
db: 2,
prefix: 'admin'
},
"redis": {
url: 'localhost',
port: 6379,
db: 2
},
"sessions": {
secret: "super secret cat",
db: 1
}
};
if (env === 'production' || env === 'staging') {
defaults["static"].port = 80;
}
if (env === 'staging') {
defaults['static'].port = 3004;
}
module.exports = defaults;
| var env = process.env.NODE_ENV || 'development';
var defaults = {
"static": {
port: 3003
},
"socket": {
options: {
origins: '*:*',
log: true,
heartbeats: false,
authorization: false,
transports: [
'websocket',
'flashsocket',
'htmlfile',
'xhr-polling',
'jsonp-polling'
],
'log level': 1,
'flash policy server': true,
'flash policy port': 3013,
'destroy upgrade': true,
'browser client': true,
'browser client minification': true,
'browser client etag': true,
'browser client gzip': false
}
},
"nohm": {
url: 'localhost',
port: 6379,
db: 2,
prefix: 'admin'
},
"redis": {
url: 'localhost',
port: 6379,
db: 2
},
"sessions": {
secret: "super secret cat",
db: 1
}
};
module.exports = defaults;
| Remove prod/staging ports so people don't get the idea to run this on these environments | Remove prod/staging ports so people don't get the idea to run this on these environments
| JavaScript | mit | maritz/nohm-admin,maritz/nohm-admin |
fb0993fb10b597884fb37f819743bce9d63accb0 | src/main/webapp/resources/js/apis/galaxy/galaxy.js | src/main/webapp/resources/js/apis/galaxy/galaxy.js | import axios from "axios";
export const getGalaxyClientAuthentication = clientId =>
axios
.get(
`${window.TL.BASE_URL}ajax/galaxy-export/authorized?clientId=${clientId}`
)
.then(({ data }) => data);
export const getGalaxySamples = () =>
axios
.get(`${window.TL.BASE_URL}ajax/galaxy-export/samples`)
.then(({ data }) => data);
export const exportToGalaxy = (
email,
makepairedcollection,
oauthCode,
oauthRedirect,
samples
) => {
const name = `IRIDA-${Math.random()
.toString()
.slice(2, 14)}`;
const params = {
_embedded: {
library: { name },
user: { email },
addtohistory: true, // Default according to Phil Mabon
makepairedcollection,
oauth2: {
code: oauthCode,
redirect: oauthRedirect
},
samples
}
};
const form = document.forms["js-galaxy-form"];
if (typeof form === "undefined") {
throw new Error(`Expecting the galaxy form with name "js-galaxy-form"`);
} else {
const input = form.elements["js-query"];
input.value = JSON.stringify(params);
form.submit();
}
};
| import axios from "axios";
export const getGalaxyClientAuthentication = clientId =>
axios
.get(
`${window.TL.BASE_URL}ajax/galaxy-export/authorized?clientId=${clientId}`
)
.then(({ data }) => data);
export const getGalaxySamples = () =>
axios
.get(`${window.TL.BASE_URL}ajax/galaxy-export/samples`)
.then(({ data }) => data);
export const exportToGalaxy = (
email,
makepairedcollection,
oauthCode,
oauthRedirect,
samples
) => {
const name = `IRIDA-${Date.now()}`;
/*
This structure is expected by galaxy.
*/
const params = {
_embedded: {
library: { name },
user: { email },
addtohistory: true, // Default according to Phil Mabon
makepairedcollection,
oauth2: {
code: oauthCode,
redirect: oauthRedirect
},
samples
}
};
const form = document.forms["js-galaxy-form"];
if (typeof form === "undefined") {
throw new Error(`Expecting the galaxy form with name "js-galaxy-form"`);
} else {
const input = form.elements["js-query"];
input.value = JSON.stringify(params);
form.submit();
}
};
| Update library name to be a timestamp | Update library name to be a timestamp
Signed-off-by: Josh Adam <8493dc4643ddc08e2ef6b4cf76c12d4ffb7203d1@canada.ca>
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida |
6c8ce552cf95452c35a9e5d4a322960bfdf94572 | src/helpers/replacePath.js | src/helpers/replacePath.js | import resolveNode from "../helpers/resolveNode";
import match from "../helpers/matchRedirect";
import {relative, dirname} from "path";
export default function (t, originalPath, {opts: {root, extensions}, file: {opts: {filename}}}, regexps) {
const requiredFilename = resolveNode(dirname(filename), originalPath.node.value, extensions);
console.log("requiredFilename:", requiredFilename);
// console.log("Options:", {regexps, root});
const {redirect, redirected} = match(requiredFilename, regexps, root, extensions);
console.log("CALCULATED REDIRECT:", redirected);
// args[0] = t.stringLiteral("PPAth");
// path has a corresponing redirect
if(redirected !== null) {
// console.log("from:", dirname(filename));
// console.log("rel:", relative(dirname(filename), redirected));
// args[0] = t.stringLiteral(redirected);
if(redirected.includes("/node_modules/")) {
if(resolveNode(dirname(filename), redirect, extensions)) {
console.log("FINAL -- MODULE", redirect);
originalPath.replaceWith(t.stringLiteral(redirect));
return;
}
}
let relativeRedirect = relative(dirname(filename), redirected);
if(!relativeRedirect.startsWith(".")) relativeRedirect = "./" + relativeRedirect;
originalPath.replaceWith(t.stringLiteral(relativeRedirect));
}
} | import resolveNode from "../helpers/resolveNode";
import match from "../helpers/matchRedirect";
import {relative, dirname, extname} from "path";
export default function (t, originalPath, {opts: {root, extensions}, file: {opts: {filename}}}, regexps) {
const requiredFilename = resolveNode(dirname(filename), originalPath.node.value, extensions);
console.log("requiredFilename:", requiredFilename);
// console.log("Options:", {regexps, root});
const {redirect, redirected} = match(requiredFilename, regexps, root, extensions);
console.log("CALCULATED REDIRECT:", redirected);
// args[0] = t.stringLiteral("PPAth");
// path has a corresponing redirect
if(redirected !== null) {
// console.log("from:", dirname(filename));
// console.log("rel:", relative(dirname(filename), redirected));
// args[0] = t.stringLiteral(redirected);
if(redirected.includes("/node_modules/")) {
if(resolveNode(dirname(filename), redirect, extensions)) {
console.log("FINAL -- MODULE", redirect);
originalPath.replaceWith(t.stringLiteral(redirect));
return;
}
}
let relativeRedirect = relative(dirname(filename), redirected);
if(!relativeRedirect.startsWith(".")) relativeRedirect = "./" + relativeRedirect;
if(!extname(redirect)) {
const ext = extname(relativeRedirect);
if(ext) relativeRedirect = relativeRedirect.slice(0, -ext.length);
}
originalPath.replaceWith(t.stringLiteral(relativeRedirect));
}
} | Fix file extension added when redirect didn't have one | fix(replacement): Fix file extension added when redirect didn't have one
| JavaScript | mit | Velenir/babel-plugin-import-redirect |
3ba06c96a3181c46b2c52a1849bfc284f05e9596 | experiments/GitHubGistUserCreator.js | experiments/GitHubGistUserCreator.js | const bcrypt = require('bcrypt');
const GitHub = require('github-api');
const crypto = require('crypto');
const { User } = require('../models');
const { email } = require('../utils');
const GITHUB_API_TOKEN = process.env.GITHUB_TOKEN;
const GITHUB_GIST_ID = process.env.GITHUB_GIST_ID;
// Authenticate using a GitHub Token
const ghClient = new GitHub({
token: GITHUB_API_TOKEN
});
const userGist = ghClient.getGist(GITHUB_GIST_ID);
userGist.read((err, gist) => {
if (err) {
console.error(err);
return;
}
JSON.parse(gist['files']['users.json']['content']).forEach((user) => { // eslint-disable-line dot-notation
const current_date = (new Date()).valueOf().toString();
const random = Math.random().toString();
const password = crypto.createHmac('sha1', current_date).update(random).digest('hex');
user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(1)); // eslint-disable-line no-sync
return User.create(user.name, user.nameNumber, user.instrument, user.part, user.role, user.spotId, user.email, user.password)
.then(() => {
email.sendUserCreateEmail(user.email, user.nameNumber, password);
return;
})
.catch(console.error);
});
});
| const bcrypt = require('bcrypt');
const GitHub = require('github-api');
const crypto = require('crypto');
const { Spot, User } = require('../models');
const { email } = require('../utils');
const GITHUB_API_TOKEN = process.env.GITHUB_TOKEN;
const GITHUB_GIST_ID = process.env.GITHUB_GIST_ID;
// Authenticate using a GitHub Token
const ghClient = new GitHub({
token: GITHUB_API_TOKEN
});
const userGist = ghClient.getGist(GITHUB_GIST_ID);
userGist.read((err, gist) => {
if (err) {
console.error(err);
return;
}
JSON.parse(gist['files']['users.json']['content']).forEach((user) => { // eslint-disable-line dot-notation
const current_date = (new Date()).valueOf().toString();
const random = Math.random().toString();
const password = crypto.createHmac('sha1', current_date).update(random).digest('hex');
user.password = bcrypt.hashSync(password, bcrypt.genSaltSync(1)); // eslint-disable-line no-sync
return Spot.create(user.spotId)
.then(() => User.create(user.name, user.nameNumber, user.instrument, user.part, user.role, user.spotId, user.email, user.password))
.then(() => {
email.sendUserCreateEmail(user.email, user.nameNumber, password);
return;
})
.catch((err) => {
console.error(err);
console.log(user);
});
});
});
| Create spot along with user | Create spot along with user
| JavaScript | mit | osumb/challenges,osumb/challenges,osumb/challenges,osumb/challenges |
b4801f092fde031842c4858dda1794863ecaf2d9 | app/assets/javascripts/replies.js | app/assets/javascripts/replies.js | jQuery(function() {
jQuery('a[href=#preview]').click(function(e) {
var form = jQuery('#new_reply');
jQuery.ajax({
url: form.attr('action'),
type: 'post',
data: {
reply: {
content: form.find('#reply_content').val()
}
},
success: function(data) {
var html = jQuery(data).find('#preview').html();
jQuery('#preview').html(html);
}
});
});
});
| jQuery(function() {
jQuery('a[href=#preview]').click(function(e) {
var form = jQuery(this).parents('form');
jQuery.ajax({
url: '/previews/new',
type: 'get',
data: {
content: form.find('textarea').val(),
},
success: function(data) {
jQuery('#preview').html(data);
}
});
});
});
| Switch to preview rendering in seperate controller | Switch to preview rendering in seperate controller
| JavaScript | agpl-3.0 | paradime/brimir,Gitlab11/brimir,johnsmithpoten/brimir,mbchandar/brimir,himeshp/brimir,viddypiddy/brimir,git-jls/brimir,hadifarnoud/brimir,ask4prasath/brimir_clone,Gitlab11/brimir,fiedl/brimir,johnsmithpoten/brimir,viddypiddy/brimir,fiedl/brimir,Gitlab11/brimir,ask4prasath/madGeeksAimWeb,paradime/brimir,mbchandar/brimir,ask4prasath/brimirclone,paradime/brimir,mbchandar/brimir,git-jls/brimir,viddypiddy/brimir,vartana/brimir,Gitlab11/brimir,ivaldi/brimir,fiedl/brimir,johnsmithpoten/brimir,vartana/brimir,ivaldi/brimir,hadifarnoud/brimir,ask4prasath/brimirclone,git-jls/brimir,mbchandar/brimir,fiedl/brimir,hadifarnoud/brimir,vartana/brimir,ivaldi/brimir,ivaldi/brimir,git-jls/brimir,himeshp/brimir,ask4prasath/madGeeksAimWeb,himeshp/brimir,vartana/brimir,ask4prasath/brimir_clone,himeshp/brimir,hadifarnoud/brimir,ask4prasath/brimir_clone,paradime/brimir,ask4prasath/madGeeksAimWeb,ask4prasath/brimirclone,viddypiddy/brimir |
3c84d34e41b14f43b8229fadbce86312ac19f964 | ast/call.js | ast/call.js | module.exports = class Call {
constructor(callee, args) {
this.callee = callee;
this.args = args;
}
analyze(context) {
this.callee.analyze(context);
context.assertIsFunction(this.callee.referent);
this.checkNumberOfArguments(this.callee.referent);
this.checkArgumentNamesAndPositionalRules(this.callee.referent);
}
checkNumberOfArguments(callee) {
const numArgs = this.args.length;
const numRequiredParams = callee.requiredParameterNames.size;
const numParams = callee.allParameterNames.size;
if (numArgs < numRequiredParams) {
// We have to at least cover all the required parameters
throw new Error(`Expected at least ${numRequiredParams} arguments but called with ${numArgs}`);
}
if (numArgs > numParams) {
// We can't pass more arguments than the total number of parameters
throw new Error(`Expected at most ${numParams} arguments but called with ${numArgs}`);
}
}
checkArgumentNamesAndPositionalRules(callee) {
let keywordArgumentSeen = false;
this.args.forEach((arg) => {
if (arg.id) {
// This is a keyword argument, record that fact and check that it's okay
keywordArgumentSeen = true;
if (!callee.allParameterNames.has(arg.id)) {
throw new Error(`Function does not have a parameter called ${arg.id}`);
}
} else if (keywordArgumentSeen) {
// This is a positional argument, but a prior one was a keyword one
throw new Error('Positional argument in call after keyword argument');
}
});
}
};
| module.exports = class Call {
constructor(callee, args) {
this.callee = callee;
this.args = args;
}
analyze(context) {
this.callee.analyze(context);
context.assertIsFunction(this.callee.referent);
this.checkArgumentMatching(this.callee.referent);
}
checkArgumentMatching(callee) {
let keywordArgumentSeen = false;
const matchedParameterNames = new Set([]);
this.args.forEach((arg, index) => {
if (index >= callee.params.length) {
throw new Error('Too many arguments in call');
}
if (arg.id) {
keywordArgumentSeen = true;
} else if (keywordArgumentSeen) {
throw new Error('Positional argument in call after keyword argument');
}
const parameterName = arg.id ? arg.id : callee.params[index].id;
if (!callee.allParameterNames.has(parameterName)) {
throw new Error(`Function does not have a parameter called ${parameterName}`);
}
if (matchedParameterNames.has(parameterName)) {
throw new Error(`Multiple arguments for parameter ${parameterName}`);
}
matchedParameterNames.add(parameterName);
});
// Look for and report a required parameter that is not matched
const miss = [...callee.requiredParameterNames].find(name => !matchedParameterNames.has(name));
if (miss) {
throw new Error(`Required parameter ${miss} is not matched in call`);
}
}
};
| Implement proper parameter matching rules | Implement proper parameter matching rules
| JavaScript | mit | rtoal/plainscript |
1d59470c25001556346e252ca344fa7f4d26c453 | jquery.observe_field.js | jquery.observe_field.js | // jquery.observe_field.js
(function( $ ){
jQuery.fn.observe_field = function(frequency, callback) {
frequency = frequency * 1000; // translate to milliseconds
return this.each(function(){
var $this = $(this);
var prev = $this.val();
var check = function() {
var val = $this.val();
if(prev != val){
prev = val;
$this.map(callback); // invokes the callback on $this
}
};
var reset = function() {
if(ti){
clearInterval(ti);
ti = setInterval(check, frequency);
}
};
check();
var ti = setInterval(check, frequency); // invoke check periodically
// reset counter after user interaction
$this.bind('keyup click mousemove', reset); //mousemove is for selects
});
};
})( jQuery );
| // jquery.observe_field.js
(function( $ ){
jQuery.fn.observe_field = function(frequency, callback) {
frequency = frequency * 1000; // translate to milliseconds
return this.each(function(){
var $this = $(this);
var prev = $this.val();
var check = function() {
if(removed()){ // if removed clear the interval and don't fire the callback
if(ti) clearInterval(ti);
return;
}
var val = $this.val();
if(prev != val){
prev = val;
$this.map(callback); // invokes the callback on $this
}
};
var removed = function() {
return $this.closest('html').length == 0
};
var reset = function() {
if(ti){
clearInterval(ti);
ti = setInterval(check, frequency);
}
};
check();
var ti = setInterval(check, frequency); // invoke check periodically
// reset counter after user interaction
$this.bind('keyup click mousemove', reset); //mousemove is for selects
});
};
})( jQuery );
| Fix bug in IE9 when observed elements are removed from the DOM | Fix bug in IE9 when observed elements are removed from the DOM
| JavaScript | mit | splendeo/jquery.observe_field,splendeo/jquery.observe_field |
30a3ce599413db184f2ccc19ec362ea8d88f60e6 | js/component-graphic.js | js/component-graphic.js | define([], function () {
'use strict';
var ComponentGraphic = function (options) {
this.color = options.color || "#dc322f";
};
ComponentGraphic.prototype.paint = function paint(gc) {
gc.fillStyle = this.color;
gc.fillRect(0, 0, 15, 15);
};
return ComponentGraphic;
});
| define([], function () {
'use strict';
var ComponentGraphic = function (options) {
options = options || {};
this.color = options.color || "#dc322f";
};
ComponentGraphic.prototype.paint = function paint(gc) {
gc.fillStyle = this.color;
gc.fillRect(0, 0, 15, 15);
};
return ComponentGraphic;
});
| Set default options for graphic component | Set default options for graphic component
| JavaScript | mit | floriico/onyx,floriico/onyx |
69d2d2a7450b91b3533a18ad2c51e009dd3c58f7 | frontend/webpack.config.js | frontend/webpack.config.js | const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
// Extract CSS into a separate file
const extractSass = new ExtractTextPlugin({
filename: "../css/main.css",
});
// Minify JavaScript
const UglifyJsPlugin = new webpack.optimize.UglifyJsPlugin();
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: './client/js/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'static/js'),
},
module: {
rules: [
// Process Sass files
{
test: /\.scss$/,
use: extractSass.extract({
use: [{
loader: "css-loader",
options: {
minimize: true,
}
}, {
loader: "postcss-loader",
}, {
loader: "sass-loader"
}],
fallback: "style-loader"
})
},
// Transpile JavaScript files
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
// JavaScript linter
{
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader",
},
// Process images
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'url-loader',
}
]
}
]
},
plugins: [
extractSass,
UglifyJsPlugin,
]
}
| const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
// Extract CSS into a separate file
const extractSass = new ExtractTextPlugin({
filename: "../css/main.css",
});
// Minify JavaScript
const UglifyJsPlugin = new webpack.optimize.UglifyJsPlugin();
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: './js/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'static/js'),
},
module: {
rules: [
// Process Sass files
{
test: /\.scss$/,
use: extractSass.extract({
use: [{
loader: "css-loader",
options: {
minimize: true,
}
}, {
loader: "postcss-loader",
}, {
loader: "sass-loader"
}],
fallback: "style-loader"
})
},
// Transpile JavaScript files
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
// JavaScript linter
{
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader",
},
// Process images
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'url-loader',
}
]
}
]
},
plugins: [
extractSass,
UglifyJsPlugin,
]
}
| Fix Webpack entry module path | Fix Webpack entry module path
| JavaScript | bsd-2-clause | rub/alessiorapini.me,rub/alessiorapini.me |
1e928e64d6ea914870e2240a12bf33b8b2cf09b0 | src/openfisca-proptypes.js | src/openfisca-proptypes.js | import PropTypes from 'prop-types'
const valuesShape = PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.bool,
PropTypes.number,
PropTypes.string,
]))
export const parameterShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
normalizedDescription: PropTypes.string,
values: valuesShape,
brackets: PropTypes.objectOf(valuesShape),
})
export const variableShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
definitionPeriod: PropTypes.string,
entity: PropTypes.string,
formulas: PropTypes.object,
normalizedDescription: PropTypes.string,
source: PropTypes.string,
})
| import PropTypes from 'prop-types'
const valuesShape = PropTypes.objectOf(PropTypes.oneOfType([
PropTypes.bool,
PropTypes.number,
PropTypes.string,
]))
export const parameterShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
documentation: PropTypes.string,
normalizedDescription: PropTypes.string,
values: valuesShape,
brackets: PropTypes.objectOf(valuesShape),
})
export const variableShape = PropTypes.shape({
id: PropTypes.string,
description: PropTypes.string,
definitionPeriod: PropTypes.string,
documentation: PropTypes.string,
entity: PropTypes.string,
formulas: PropTypes.object,
normalizedDescription: PropTypes.string,
source: PropTypes.string,
})
| Update parameters and variables shapes | Update parameters and variables shapes
| JavaScript | agpl-3.0 | openfisca/legislation-explorer |
b24727fabb21448e8771e072f8be6ec2716e52ad | deploy/electron/Gruntfile.js | deploy/electron/Gruntfile.js | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"download-electron": {
version: "1.8.8",
outputDir: "./electron",
rebuild: true
}
});
grunt.loadNpmTasks('grunt-download-electron');
}; | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
"download-electron": {
version: "2.0.18",
outputDir: "./electron",
rebuild: true
}
});
grunt.loadNpmTasks('grunt-download-electron');
}; | Update electron version fixing security issues | Update electron version fixing security issues
| JavaScript | mit | LightTable/LightTable,LightTable/LightTable,LightTable/LightTable |
d0d13e5feea4aa2c3d7f35be31dcbd0299f9a4d3 | client/components/App/App.js | client/components/App/App.js | // @flow
import React from 'react'
import 'normalize.css/normalize.css'
import Footer from 'components/Footer/Footer'
import Nav from '../Nav/Nav'
import MobileFooterToolbar from '../Nav/MobileFooterToolbar/MobileFooterToolbar'
import styles from './App.scss'
import '../../styles/global.scss'
import Content from 'react-mdc-web/lib/Content/Content'
const title = 'Reango'
type AppPropsType = {
viewer: Object,
children: Object
}
let App = (props: AppPropsType) =>
<div className={styles.root} >
<Nav
title={title}
viewer={props.viewer}
/>
<Content className={`${styles.wrap}`} >
<div className={styles.content} >
{props.children}
</div>
</Content>
{props.viewer.isAuthenticated ?
<div className={styles.mobile_footer_wrap} >
<MobileFooterToolbar />
</div> : null}
<div className={`${styles.footer_wrap} ${!props.viewer.isAuthenticated ? styles.hidden_mobile_footer_wrap: null}`} >
<div className={styles.footer} >
<Footer
title={title}
/>
</div>
</div>
</div>
export default App
| // @flow
import React from 'react'
import 'normalize.css/normalize.css'
import Footer from 'components/Footer/Footer'
import Nav from '../Nav/Nav'
import MobileFooterToolbar from '../Nav/MobileFooterNav/MobileFooterNav'
import styles from './App.scss'
import '../../styles/global.scss'
import Content from 'react-mdc-web/lib/Content/Content'
const title = 'Reango'
type AppPropsType = {
viewer: Object,
children: Object
}
let App = (props: AppPropsType) =>
<div className={styles.root} >
<Nav
title={title}
viewer={props.viewer}
/>
<Content className={`${styles.wrap}`} >
<div className={styles.content} >
{props.children}
</div>
</Content>
{props.viewer.isAuthenticated ?
<div className={styles.mobile_footer_wrap} >
<MobileFooterToolbar />
</div> : null}
<div className={`${styles.footer_wrap} ${!props.viewer.isAuthenticated ? styles.hidden_mobile_footer_wrap: null}`} >
<div className={styles.footer} >
<Footer
title={title}
/>
</div>
</div>
</div>
export default App
| Fix mobile footer toolbar import rename | Fix mobile footer toolbar import rename
| JavaScript | mit | ncrmro/reango,ncrmro/ango,ncrmro/reango,ncrmro/ango,ncrmro/ango,ncrmro/reango |
edd29b9bcb894ed1fd6511f2e748a87a14d792f3 | assets/site.js | assets/site.js | (function(){
"use strict";
var d = document, inits = [];
window.initializers = inits;
// initializer to manipulate all hyperlinks
inits.push(function(){
var x, h = location.host;
for (var xs = d.links, i = xs.length; i--; ){
var x = xs[i], m = x.getAttribute('data-m');
if (m) {
// de-obfuscate e-mail hyperlink
m = m.replace(/[\/]/g, '@').replace(/,/g, '.');
x.href = 'mailto:' + m;
if ((x = x.firstChild) && x.nodeType == 3){
x.data = m;
}
} else if (x.host != h){
// set target to _blank for all external hyperlinks
x.target = '_blank';
}
}
});
// initializer to set current year in copyright footer
inits.push(function(){
if (d.querySelector){
var x = d.querySelector('body>footer>time');
if (x){
x.innerHTML = (new Date()).getFullYear();
}
}
});
function initPage(){
// call all initializers
for(var i = 0, n = inits.length; i < n; i++){
inits[i]();
}
}
initPage();
}()) | (function(){
"use strict";
var d = document, inits = [];
window.initializers = inits;
// initializer to manipulate all hyperlinks
inits.push(function(){
var x, h = location.host;
for (var xs = d.links, i = xs.length; i--; ){
var x = xs[i], m = x.getAttribute('data-m');
if (m) {
// de-obfuscate e-mail hyperlink
m = m.replace(/[\/]/g, '@').replace(/,/g, '.');
x.href = 'mailto:' + m;
if ((x = x.firstChild) && x.nodeType == 3){
x.data = m;
}
} else if (x.host != h){
// set target to _blank for all external hyperlinks
x.target = '_blank';
}
}
});
// initializer to set active tab in page header
inits.push(function(){
if (d.querySelectorAll){
var xs = d.querySelectorAll('body>header>nav>a'), href = location.href;
for(var i = 1, n = xs.length; i < n; i++){
var x = xs[i];
if (href.startsWith(x.href)){
x.classList.add('active');
} else {
x.classList.remove('active');
}
}
}
});
// initializer to set current year in copyright footer
inits.push(function(){
if (d.querySelector){
var x = d.querySelector('body>footer>time');
if (x){
x.innerHTML = (new Date()).getFullYear();
}
}
});
function initPage(){
// call all initializers
for(var i = 0, n = inits.length; i < n; i++){
inits[i]();
}
}
initPage();
}())
| Add initializer to set active tab in page header | Add initializer to set active tab in page header | JavaScript | mit | tommy-carlier/www.tcx.be,tommy-carlier/www.tcx.be,tommy-carlier/www.tcx.be |
fd360a1315640847c249b3422790ce0bbd57d0d9 | lib/package/plugins/checkConditionTruth.js | lib/package/plugins/checkConditionTruth.js | /*
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
//checkConditionTruth.js
var plugin = {
ruleId: "CC006",
name: "Detect Logical Absurdities",
message: "Conditions should not have internal logic conflicts.",
fatal: false,
severity: 2, //error
nodeType: "Condition",
enabled: true
};
var onCondition = function(condition, cb) {
var truthTable = condition.getTruthTable(),
hadErr = false;
//truthTable will be null if no condition was present
if (truthTable && truthTable.getEvaluation() !== "valid") {
condition.addMessage({
source: condition.getExpression(),
line: condition.getElement().lineNumber,
column: condition.getElement().columnNumber,
plugin,
message: "Condition may be a logical absuridty."
});
hadErr = true;
}
if (typeof cb == "function") {
cb(null, hadErr);
}
};
module.exports = {
plugin,
onCondition
};
| /*
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
//checkConditionTruth.js
var plugin = {
ruleId: "CC006",
name: "Detect Logical Absurdities",
message: "Conditions should not have internal logic conflicts.",
fatal: false,
severity: 2, //error
nodeType: "Condition",
enabled: true
};
var onCondition = function(condition, cb) {
var truthTable = condition.getTruthTable(),
hadErr = false;
//truthTable will be null if no condition was present
if (truthTable && truthTable.getEvaluation() !== "valid") {
condition.addMessage({
source: condition.getExpression(),
line: condition.getElement().lineNumber,
column: condition.getElement().columnNumber,
plugin,
message: "Condition may be a logical absurdity."
});
hadErr = true;
}
if (typeof cb == "function") {
cb(null, hadErr);
}
};
module.exports = {
plugin,
onCondition
};
| Fix a typing mistake in 'logical absurdity' message | Fix a typing mistake in 'logical absurdity' message
| JavaScript | apache-2.0 | apigee/apigeelint,apigeecs/bundle-linter |
d1293e868ed3d7187423a56717f406e052da41a2 | config/index.js | config/index.js | import defaults from 'defaults'
const API_GLOBAL = '_IMDIKATOR'
const env = process.env.NODE_ENV || 'development'
const DEFAULTS = {
port: 3000,
reduxDevTools: false
}
const globalConfig = (typeof window !== 'undefined' && window[API_GLOBAL] || {})
export default defaults({
env,
port: process.env.PORT,
// nodeApiHost: 'localhost:8080',
nodeApiHost: 'https://atindikatornode.azurewebsites.net',
apiHost: globalConfig.apiHost,
contentApiHost: globalConfig.contentApiHost,
reduxDevTools: env == 'development' && !['0', 'false'].includes(process.env.REDUX_DEVTOOLS),
showDebug: process.env.DEBUG
}, DEFAULTS)
| import defaults from 'defaults'
const API_GLOBAL = '_IMDIKATOR'
const env = process.env.NODE_ENV || 'development'
const DEFAULTS = {
port: 3000,
reduxDevTools: false
}
const globalConfig = (typeof window !== 'undefined' && window[API_GLOBAL] || {})
export default defaults({
env,
port: process.env.PORT,
// nodeApiHost: 'localhost:8080',
nodeApiHost: 'atindikatornode.azurewebsites.net',
apiHost: globalConfig.apiHost,
contentApiHost: globalConfig.contentApiHost,
reduxDevTools: env == 'development' && !['0', 'false'].includes(process.env.REDUX_DEVTOOLS),
showDebug: process.env.DEBUG
}, DEFAULTS)
| FIX - changed node api to https | FIX - changed node api to https
| JavaScript | mit | bengler/imdikator,bengler/imdikator |
110e1871555cece764e2dcbfdf3ab7c14c7c164e | bin/gut-cli.js | bin/gut-cli.js | var gut = require('../');
if (process.argv.length > 2 && process.argv[2] === 'status') {
console.log("\n\tGut status: %s", gut.getStatus());
}
console.log('\nI think you meant "git"');
| #!/usr/bin/env node
var gut = require('../');
if (process.argv.length > 2 && process.argv[2] === 'status') {
console.log("\n\tGut status: %s", gut.getStatus());
}
console.log('\nI think you meant "git"');
| Add shabang to bin file | Add shabang to bin file
| JavaScript | mit | itsananderson/gut-status |
c025d9457aa000d0f23252e07ce6f2e2c3c5d971 | releaf-core/app/assets/config/releaf_core_manifest.js | releaf-core/app/assets/config/releaf_core_manifest.js | //= link_tree ../images
//= link releaf/application.css
//= link releaf/application.js
| //= link_tree ../images
//= link_tree ../javascripts/ckeditor
//= link releaf/application.css
//= link releaf/application.js
| Fix releaf ckeditor assets copying | Fix releaf ckeditor assets copying
| JavaScript | mit | cubesystems/releaf,cubesystems/releaf,cubesystems/releaf |
7a3062a02c2e676704ecad75def38d322c45a5d0 | lib/resources/console/scripts/content-editor/plaintext.js | lib/resources/console/scripts/content-editor/plaintext.js | pw.component.register('content-editor-plaintext', function (view, config) {
var self = this;
var mock = document.createElement('DIV');
mock.classList.add('console-content-plaintext-mock')
mock.style.position = 'absolute';
mock.style.top = '-100px';
mock.style.opacity = '0';
mock.style.width = view.node.clientWidth + 'px';
document.body.appendChild(mock);
view.node.addEventListener('keypress', function (evt) {
var value = this.value + String.fromCharCode(evt.keyCode);
if (evt.keyCode == 13) {
value += '<br>';
}
self.update(value);
});
view.node.addEventListener('keyup', function (evt) {
self.update(this.value);
});
view.node.addEventListener('blur', function () {
pw.component.broadcast('content-editor:changed');
});
this.update = function (value) {
value = value.replace(/\n/g, '<br>');
if (value.trim() == '') {
value = ' ';
}
// add an extra line break to push the content down
if (value.substring(value.length - 4, value.length) == '<br>') {
value += '<br>';
}
mock.innerHTML = value;
view.node.style.height = mock.offsetHeight + 'px';
};
});
| pw.component.register('content-editor-plaintext', function (view, config) {
var self = this;
var mock = document.createElement('DIV');
mock.classList.add('console-content-plaintext-mock')
mock.style.position = 'absolute';
mock.style.top = '-100px';
mock.style.opacity = '0';
mock.style.width = view.node.clientWidth + 'px';
pw.node.after(view.node, mock);
view.node.addEventListener('keypress', function (evt) {
var value = this.value + String.fromCharCode(evt.keyCode);
if (evt.keyCode == 13) {
value += '<br>';
}
self.update(value);
});
view.node.addEventListener('keyup', function (evt) {
self.update(this.value);
});
view.node.addEventListener('blur', function () {
pw.component.broadcast('content-editor:changed');
});
this.update = function (value) {
value = value.replace(/\n/g, '<br>');
if (value.trim() == '') {
value = ' ';
}
// add an extra line break to push the content down
if (value.substring(value.length - 4, value.length) == '<br>') {
value += '<br>';
}
mock.innerHTML = value;
view.node.style.height = mock.offsetHeight + 'px';
};
});
| Fix text editor wrapping when floating | Fix text editor wrapping when floating
| JavaScript | mit | metabahn/console,metabahn/console,metabahn/console |
a6d0373ea7ca897721d691089567af8e13bab61b | mac/filetypes/open_STAK.js | mac/filetypes/open_STAK.js | define(['itemObjectModel', 'mac/roman'], function(itemOM, macRoman) {
'use strict';
function open(item) {
function onBlock(item, byteSource) {
return byteSource.slice(0, 12).getBytes().then(function(headerBytes) {
var dv = new DataView(headerBytes.buffer, headerBytes.byteOffset, 4);
var length = dv.getUint32(0, false);
var name = macRoman(headerBytes, 4, 4);
var id = dv.getInt32(8, false);
var blockItem = itemOM.createItem(name + " " + id);
item.addItem(blockItem);
if (length > 8) {
blockItem.byteSource = byteSource.slice(12, length);
}
if (byteSource.byteLength >= (length + 12)) {
return onBlock(item, byteSource.slice(length));
}
});
}
return onBlock(item, item.byteSource);
}
return open;
});
| define(['itemObjectModel', 'mac/roman'], function(itemOM, macRoman) {
'use strict';
function open(item) {
function onBlock(item, byteSource) {
return byteSource.slice(0, 12).getBytes().then(function(headerBytes) {
var dv = new DataView(
headerBytes.buffer, headerBytes.byteOffset, headerBytes.byteLength);
var length = dv.getUint32(0, false);
var name = macRoman(headerBytes, 4, 4);
var id = dv.getInt32(8, false);
var blockItem = itemOM.createItem(name + " " + id);
item.addItem(blockItem);
if (length > 8) {
blockItem.byteSource = byteSource.slice(12, length);
}
if (byteSource.byteLength >= (length + 12)) {
return onBlock(item, byteSource.slice(length));
}
});
}
return onBlock(item, item.byteSource);
}
return open;
});
| Use right length of header | Use right length of header | JavaScript | mit | radishengine/drowsy,radishengine/drowsy |
93bc928f2f19bba92ce178325f396c863f34c566 | packages/client/.spinrc.js | packages/client/.spinrc.js | const url = require('url');
const config = {
builders: {
web: {
entry: './src/index.tsx',
stack: ['web'],
openBrowser: true,
dllExcludes: ['bootstrap'],
defines: {
__CLIENT__: true
},
// Wait for backend to start prior to letting webpack load frontend page
waitOn: ['tcp:localhost:8080'],
enabled: true
},
test: {
stack: ['server'],
roles: ['test'],
defines: {
__TEST__: true
}
}
},
options: {
stack: ['apollo', 'react', 'styled-components', 'css', 'sass', 'less', 'es6', 'ts', 'webpack', 'i18next'],
cache: '../../.cache',
ssr: true,
webpackDll: true,
reactHotLoader: false,
frontendRefreshOnBackendChange: true,
defines: {
__DEV__: process.env.NODE_ENV !== 'production',
__API_URL__: '"/graphql"'
},
webpackConfig: {
devServer: {
disableHostCheck: true
}
}
}
};
config.options.devProxy = config.options.ssr;
if (process.env.NODE_ENV === 'production') {
// Generating source maps for production will slowdown compilation for roughly 25%
config.options.sourceMap = false;
}
const extraDefines = {
__SSR__: config.options.ssr
};
config.options.defines = Object.assign(config.options.defines, extraDefines);
module.exports = config; | const url = require('url');
const config = {
builders: {
web: {
entry: './src/index.tsx',
stack: ['web'],
openBrowser: true,
dllExcludes: ['bootstrap'],
defines: {
__CLIENT__: true
},
// Wait for backend to start prior to letting webpack load frontend page
waitOn: ['tcp:localhost:8080'],
enabled: true
},
test: {
stack: ['server'],
roles: ['test'],
defines: {
__TEST__: true
}
}
},
options: {
stack: ['apollo', 'react', 'styled-components', 'css', 'sass', 'less', 'es6', 'ts', 'webpack', 'i18next'],
cache: '../../.cache',
ssr: true,
webpackDll: true,
reactHotLoader: false,
defines: {
__DEV__: process.env.NODE_ENV !== 'production',
__API_URL__: '"/graphql"'
},
webpackConfig: {
devServer: {
disableHostCheck: true
}
}
}
};
config.options.devProxy = config.options.ssr;
if (process.env.NODE_ENV === 'production') {
// Generating source maps for production will slowdown compilation for roughly 25%
config.options.sourceMap = false;
}
const extraDefines = {
__SSR__: config.options.ssr
};
config.options.defines = Object.assign(config.options.defines, extraDefines);
module.exports = config; | Remove unused option for client-side bundle | Remove unused option for client-side bundle
| JavaScript | mit | sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit |
4f2ba69c7a4c2e5906d949fae1d0fc902c6f12df | data/wp/wp-content/plugins/epfl/menus/epfl-menus-admin.js | data/wp/wp-content/plugins/epfl/menus/epfl-menus-admin.js | // It seems that not much documentation exists for the JQuery
// mini-Web-app that is the Wordpress admin menu editor. However,
// insofar as Polylang's business in that mini-Web-app is similar
// to ours, studying the js/nav-menu.js therefrom is helpful.
function initNavMenus ($) {
var $metabox = $('div.add-external-menu');
$('input.submit-add-to-menu', $metabox).click(function() {
console.log("click");
// For inspiration regarding wpNavMenu, look at wp-admin/js/nav-menu.js
wpNavMenu.addItemToMenu(
{'-1': {
'menu-item-type': 'external-menu',
'menu-item-url': 'https://example.com/restapi/menu?lang=en_JP'
}},
wpNavMenu.addMenuItemToBottom,
function() {
console.log('Added external menu to menu');
});
}); // submit button's .click()
}
function initExternalMenuList ($) {
$('a.page-title-action').remove();
$('h1.wp-heading-inline').after('<button class="page-title-action">' + wp.translations.refresh_button + '</button>');
var $button = $('h1.wp-heading-inline').next();
var spinning = false;
$button.click(function() {
if (spinning) return;
var $form = window.EPFLMenus.asWPAdminPostForm('refresh');
$form.submit();
var $spinner = $('<span class="ajax-spinner"></span>');
$button.append($spinner);
spinning = true;
});
}
jQuery( document ).ready(function($) {
if (window.wp.screen.base === 'nav-menus') {
initNavMenus($);
}
if (window.wp.screen.base === 'edit' && window.wp.screen.post_type === 'epfl-external-menu' ) {
initExternalMenuList($);
}
// If you see this, nothing threw or crashed (yet).
console.log('epfl-menus-admin.js is on duty.');
});
| function initExternalMenuList ($) {
$('a.page-title-action').remove();
$('h1.wp-heading-inline').after('<button class="page-title-action">' + wp.translations.refresh_button + '</button>');
var $button = $('h1.wp-heading-inline').next();
var spinning = false;
$button.click(function() {
if (spinning) return;
var $form = window.EPFLMenus.asWPAdminPostForm('refresh');
$form.submit();
var $spinner = $('<span class="ajax-spinner"></span>');
$button.append($spinner);
spinning = true;
});
}
jQuery( document ).ready(function($) {
if (window.wp.screen.base === 'edit' && window.wp.screen.post_type === 'epfl-external-menu' ) {
initExternalMenuList($);
}
// If you see this, nothing threw or crashed (yet).
console.log('epfl-menus-admin.js is on duty.');
});
| Remove dead code in the JS app | Remove dead code in the JS app
| JavaScript | mit | epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp,epfl-idevelop/jahia2wp |
d94120cf7da438722c1bb60dfaa81ada4e48e724 | src/helpers/menu_entry.js | src/helpers/menu_entry.js | const Handlebars = require('handlebars');
const templates = {
active: Handlebars.compile('<li class="active">{{{content}}}</li>'),
unactive: Handlebars.compile('<li><a href="{{link}}">{{{content}}}</a></li>')
};
module.exports = function(entries, current_page) {
const items = entries.map((entry) => {
const context = entry.page === '/'
? {content: '<i class="fa fa-home"></i>', link: '/'}
: {content: entry.page, link: `/pages/${entry.page}.html`};
return entry.page === current_page
? templates.active(context)
: templates.unactive(context);
}).join('');
return `<ul class="menu">${items}</ul>`;
}
| const Handlebars = require('handlebars');
const templates = {
active: Handlebars.compile('<li class="active"><a>{{{content}}}</a></li>'),
unactive: Handlebars.compile('<li><a href="{{link}}">{{{content}}}</a></li>')
};
module.exports = function(entries, current_page) {
const items = entries.map((entry) => {
const context = entry.page === '/'
? {content: '<i class="fa fa-home"></i>', link: '/'}
: {content: entry.page, link: `/pages/${entry.page}.html`};
return entry.page === current_page
? templates.active(context)
: templates.unactive(context);
}).join('');
return `<ul class="menu">${items}</ul>`;
}
| Fix active menu item content. | Fix active menu item content.
| JavaScript | mit | NealRame/CV,NealRame/Blog,NealRame/Blog,NealRame/Blog,NealRame/CV |
bc09b643a4763de17f5d6db6b926174667825ad2 | client/app/instructor/newevent/newevent.controller.js | client/app/instructor/newevent/newevent.controller.js | 'use strict';
export default class NewEventCtrl {
/*@ngInject*/
constructor($scope) {
$scope.event = {info:{}};
$scope.stage = {
select: true,
create: false,
assign: false,
done: false
}
$scope.doneSelect = function(create){
$scope.stage.select = false;
if (create){
$scope.stage.create = true;
}
else{
$scope.stage.assign = true;
}
}
$scope.doneCreate = function(){
$scope.stage.create = false;
$scope.stage.assign = true;
}
$scope.doneAssign = function(){
$scope.stage.assign = false;
$scope.stage.done = true;
}
}
}
| 'use strict';
export default class NewEventCtrl {
/*@ngInject*/
constructor($scope) {
$scope.event = {info:{}};
$scope.stage = {
select: false,
create: true,
assign: false,
done: false
}
$scope.doneSelect = function(create){
$scope.stage.select = false;
if (create){
$scope.stage.create = true;
}
else{
$scope.stage.assign = true;
}
}
$scope.doneCreate = function(){
$scope.stage.create = false;
$scope.stage.assign = true;
}
$scope.doneAssign = function(){
$scope.stage.assign = false;
$scope.stage.done = true;
}
}
}
| Change to new event form instead of to selecting an event | Change to new event form instead of to selecting an event
| JavaScript | mit | rcos/venue,rcos/venue,rcos/venue,rcos/venue |
9c61fdff3cf4e40724f2565a5ab55f6d2b3aa0a9 | stats-server/lib/server.js | stats-server/lib/server.js | var express = require('express');
var https = require('https');
var logger = require('./logger');
var security = require('./security');
var db = require('./db');
var app = configureExpressApp();
initializeMongo(initializeRoutes);
startServer(security, app);
function configureExpressApp() {
var app = express();
app.use(express.json());
app.use(express.urlencoded());
app.use(genericErrorHandler);
return app;
function genericErrorHandler(err, req, res, next) {
res.status(500);
res.json({ error: "Please check if your request is correct" });
}
}
function initializeMongo(onSuccessCallback) {
db.initialize(function(err, _db) {
if(err) throw err; // interrupt when can't connect
onSuccessCallback(_db);
});
}
function initializeRoutes(db) {
['./daily_stats_routes', './instance_run_routes'].forEach(function(routes) {
require(routes)(app, logger, db);
});
}
function startServer(security, app) {
var port = 3000;
var httpsServer = https.createServer(security.credentials, app);
httpsServer.listen(port);
console.log("Codebrag stats server started on port", port);
return httpsServer;
}
| var express = require('express');
var https = require('https');
var logger = require('./logger');
var security = require('./security');
var db = require('./db');
var app = configureExpressApp();
initializeMongo(initializeRoutes);
startServer(security, app);
function configureExpressApp() {
var app = express();
app.use(express.json());
app.use(express.urlencoded());
app.use(genericErrorHandler);
return app;
function genericErrorHandler(err, req, res, next) {
res.status(500);
res.json({ error: "Please check if your request is correct" });
}
}
function initializeMongo(onSuccessCallback) {
db.initialize(function(err, _db) {
if(err) throw err; // interrupt when can't connect
onSuccessCallback(_db);
});
}
function initializeRoutes(db) {
['./daily_stats_routes', './instance_run_routes'].forEach(function(routes) {
require(routes)(app, logger, db);
});
}
function startServer(security, app) {
var port = 6666;
var httpsServer = https.createServer(security.credentials, app);
httpsServer.listen(port);
console.log("Codebrag stats server started on port", port);
return httpsServer;
}
| Change port back to 6666 | Change port back to 6666
| JavaScript | agpl-3.0 | cazacugmihai/codebrag,cazacugmihai/codebrag,softwaremill/codebrag,softwaremill/codebrag,cazacugmihai/codebrag,cazacugmihai/codebrag,softwaremill/codebrag,softwaremill/codebrag,cazacugmihai/codebrag |
7e580f82edfbe1b3ba4e6e7a365c216b2b81cb91 | config/index.js | config/index.js | // see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
},
dev: {
env: require('./dev.env'),
port: 8080,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
}
| // see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
},
dev: {
env: require('./dev.env'),
port: 3000,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
}
| Change default dev port to 3000 | Change default dev port to 3000
| JavaScript | mit | adrielpdeguzman/vuelma,adrielpdeguzman/vuelma,vuelma/vuelma,vuelma/vuelma |
87eebeaee3d2930e29f8b9aa7e3784f7f519f444 | jquery.activeNavigation.js | jquery.activeNavigation.js | (function( $ ) {
$.fn.activeNavigation = function(selector) {
var pathname = window.location.pathname
var hrefs = []
$(selector).find("a").each(function(){
if (pathname.indexOf($(this).attr("href")) > -1)
hrefs.push($(this))
})
if (hrefs.length) {
hrefs.sort(function(a,b){
return b.attr("href").length - a.attr("href").length
})
hrefs[0].closest('li').addClass("active")
}
};
})(jQuery); | (function( $ ) {
$.fn.activeNavigation = function(selector) {
var pathname = window.location.pathname
var extension_position;
var href;
var hrefs = []
$(selector).find("a").each(function(){
// Remove href file extension
extension_position = $(this).attr("href").lastIndexOf('.');
href = (extension_position >= 0) ? $(this).attr("href").substr(0, extension_position) : $(this).attr("href");
if (pathname.indexOf(href) > -1) {
hrefs.push($(this));
}
})
if (hrefs.length) {
hrefs.sort(function(a,b){
return b.attr("href").length - a.attr("href").length
})
hrefs[0].closest('li').addClass("active")
}
};
})(jQuery);
| Remove file extension from href's | Remove file extension from href's
| JavaScript | mit | Vitaa/ActiveNavigation,Vitaa/ActiveNavigation |
26d0c3815f5bdcc23b25709167c1bcf96a8d14c2 | examples/worker-semaphore.js | examples/worker-semaphore.js | var {Worker} = require("ringo/worker")
var {Semaphore} = require("ringo/concurrent")
var {setInterval, clearInterval} = require("ringo/scheduler");
function main() {
// Create a new workers from this same module. Note that this will
// create a new instance of this module as workers are isolated.
var w = new Worker(module.id);
var s = new Semaphore();
w.onmessage = function(e) {
print("Got response from worker: " + e.data);
s.signal();
};
// Calling worker.postMessage with true as second argument causes
// callbacks from the worker to be executed synchronously in
// the worker's own thread instead of in our own event loop thread,
// allowing us to wait synchronously for replies.
w.postMessage(1, true);
// Wait until the semaphore gets 5 signals.
s.wait(5);
print("Got 5 responses, quitting.");
}
function onmessage(e) {
print("Worker got message: " + e.data);
var count = 1;
// Send 5 responses back to the caller.
var id = setInterval(function() {
e.source.postMessage(count);
if (count++ >= 5) clearInterval(id);
}, 500);
}
if (require.main === module) {
main();
}
| var {Worker} = require("ringo/worker")
var {Semaphore} = require("ringo/concurrent")
var {setInterval, clearInterval} = require("ringo/scheduler");
function main() {
// Create a new workers from this same module. Note that this will
// create a new instance of this module as workers are isolated.
var w = new Worker(module.id);
var s = new Semaphore();
w.onmessage = function(e) {
print(" Response from worker: " + e.data);
s.signal();
};
// Calling worker.postMessage with true as second argument causes
// callbacks from the worker to be executed synchronously in
// the worker's own thread instead of in our own event loop thread,
// allowing us to wait synchronously for replies.
w.postMessage(1, true);
// Wait until the semaphore gets 3 signals.
s.wait(3);
print("Got 3 responses from worker.");
// Wait for 2 more responses.
s.wait(2);
print("Got 2 more responses, quitting.");
}
function onmessage(e) {
print("Worker got message: " + e.data);
var count = 1;
// Send 5 responses back to the caller.
var id = setInterval(function() {
e.source.postMessage(count);
if (count++ >= 5) clearInterval(id);
}, 500);
}
if (require.main === module) {
main();
}
| Make single worker semaphore example slightly more interesting | Make single worker semaphore example slightly more interesting
| JavaScript | apache-2.0 | Transcordia/ringojs,ringo/ringojs,ringo/ringojs,oberhamsi/ringojs,Transcordia/ringojs,ringo/ringojs,oberhamsi/ringojs,ashwinrayaprolu1984/ringojs,Transcordia/ringojs,Transcordia/ringojs,oberhamsi/ringojs,ashwinrayaprolu1984/ringojs,ringo/ringojs,ashwinrayaprolu1984/ringojs,ashwinrayaprolu1984/ringojs |
68a5a2ce778484bf94518ad3e1a2a895c76d25f4 | app/imports/ui/components/form-fields/open-cloudinary-widget.js | app/imports/ui/components/form-fields/open-cloudinary-widget.js | import { Meteor } from 'meteor/meteor';
import { $ } from 'meteor/jquery';
/* global cloudinary */
/**
* Opens the Cloudinary Upload widget and sets the value of the input field with name equal to nameAttribute to the
* resulting URL of the uploaded picture.
* @param nameAttribute The value of the associated input field's name attribute.
* @memberOf ui/components/form-fields
*/
export function openCloudinaryWidget(nameAttribute) {
cloudinary.openUploadWidget(
{
cloud_name: Meteor.settings.public.cloudinary.cloud_name,
upload_preset: Meteor.settings.public.cloudinary.upload_preset,
sources: ['local', 'url', 'camera'],
cropping: 'server',
cropping_aspect_ratio: 1,
max_file_size: '500000',
max_image_width: '500',
max_image_height: '500',
min_image_width: '300',
min_image_height: '300',
},
(error, result) => {
if (error) {
console.log('Error during image upload: ', error);
return;
}
// Otherwise get the form elements
// console.log('Cloudinary results: ', result);
const url = result[0].url;
$(`input[name=${nameAttribute}]`).val(url);
});
}
| import { Meteor } from 'meteor/meteor';
import { $ } from 'meteor/jquery';
/* global cloudinary */
/**
* Opens the Cloudinary Upload widget and sets the value of the input field with name equal to nameAttribute to the
* resulting URL of the uploaded picture.
* @param nameAttribute The value of the associated input field's name attribute.
* @memberOf ui/components/form-fields
*/
export function openCloudinaryWidget(nameAttribute) {
cloudinary.openUploadWidget(
{
cloud_name: Meteor.settings.public.cloudinary.cloud_name,
upload_preset: Meteor.settings.public.cloudinary.upload_preset,
sources: ['local', 'url', 'camera'],
cropping: 'server',
cropping_aspect_ratio: 1,
max_file_size: '500000',
max_image_width: '500',
max_image_height: '500',
min_image_width: '200',
min_image_height: '200',
},
(error, result) => {
if (error) {
console.log('Error during image upload: ', error);
return;
}
// Otherwise get the form elements
// console.log('Cloudinary results: ', result);
const url = result[0].url;
$(`input[name=${nameAttribute}]`).val(url);
});
}
| Change min image size to 200x200 | Change min image size to 200x200
| JavaScript | apache-2.0 | radgrad/radgrad,radgrad/radgrad,radgrad/radgrad |
9bc7cfc00b0a0b96245af835995b39e8493f0a01 | test_frontend/app/views/teacher/modules/assistance_request_list_module_spec.js | test_frontend/app/views/teacher/modules/assistance_request_list_module_spec.js | define((require) => {
describe('requester_module', () => {
beforeEach(() => {
require('app/views/teacher/modules/assistance_request_list_module');
});
define('>RetrieveAssistanceRequests', () => {
it('should be defined', () => {
expect(RetrieveAssistanceRequests).toBeDefined();
});
[[], ['a'], ['a', 'b', 'random_course_id_42']].forEach(selectedCourseList => {
it(`should request assistance requests for selected courses (${selectedCourseList})`, () => {
const mock_socket = {
emit: () => undefined
};
const spy_emit = spyOn(mock_socket, 'emit').and.callThrough();
const spy_getSelectedClassIds = jasmine.createSpy('getSelectedClassIds').and.returnValue(selectedCourseList);
selectedClassIds = spy_getSelectedClassIds;
expect(RetrieveAssistanceRequests()).toBeUndefined();
expect(spy_emit.calls.count()).toEqual(1);
expect(spy_emit.calls.argsFor(0)).toEqual([{cids: selectedCourseList, qty: 5}]);
expect(spy_getSelectedClassIds.calls.count()).toEqual(1);
expect(spy_emit.calls.argsFor(0)).toEqual([]);
});
});
});
});
}); | define((require) => {
describe('requester_module', () => {
beforeEach(() => {
require('app/views/teacher/modules/assistance_request_list_module');
});
describe('>RetrieveAssistanceRequests', () => {
it('should be defined', () => {
expect(RetrieveAssistanceRequests).toBeDefined();
});
[[], ['a'], ['a', 'b', 'random_course_id_42']].forEach(selectedCourseList => {
it(`should request assistance requests for selected courses (${selectedCourseList})`, () => {
const mock_socket = {
emit: () => undefined
};
socket = mock_socket;
const spy_emit = spyOn(mock_socket, 'emit').and.callThrough();
const spy_getSelectedClassIds = jasmine.createSpy('getSelectedClassIds').and.returnValue(selectedCourseList);
getSelectedClassIds = spy_getSelectedClassIds;
expect(RetrieveAssistanceRequests()).toBeUndefined();
expect(spy_emit.calls.count()).toEqual(1);
expect(spy_emit.calls.argsFor(0)).toEqual(['Request_RetrieveAssistanceRequests', {cids: selectedCourseList, qty: 5}]);
expect(spy_getSelectedClassIds.calls.count()).toEqual(1);
expect(spy_getSelectedClassIds.calls.argsFor(0)).toEqual([]);
});
});
});
});
}); | Fix AR list module test | Fix AR list module test
| JavaScript | mit | samg2014/VirtualHand,samg2014/VirtualHand |
1b77aa7ecddf446637e1bfd14bd92d8d588dcb6d | app/gui/task_view.js | app/gui/task_view.js | define([
'underscore',
'backbone'
], function(_, Backbone) {
var TaskView = Backbone.View.extend({
tagName: 'li',
className: 'task',
events: {
"dragstart" : "on_dragstart",
"dragover" : "on_dragover",
"drop" : "on_drop"
},
initialize: function() {
this.id = 'id-' + this.model.get('id');
this.$el.prop('draggable', true);
},
render: function() {
this.$el.html(this.model.get('name'));
return this;
},
on_dragstart: function(event) {
var id = this.model.get('id');
var list_id = this.model.get('list_id');
var payload = [id, list_id].join(':');
event.originalEvent.dataTransfer.setData("text/plain", payload);
},
on_dragover: function(event) {
event.preventDefault();
},
on_drop: function(event) {
event.preventDefault();
},
close: function() {
this.off();
this.remove();
}
});
return TaskView;
});
| define([
'underscore',
'backbone'
], function(_, Backbone) {
var TaskView = Backbone.View.extend({
tagName: 'li',
className: 'task',
events: {
"dragstart" : "on_dragstart",
"dragover" : "on_dragover",
"drop" : "on_drop",
"click .delete" : "delete"
},
initialize: function() {
this.id = 'id-' + this.model.get('id');
this.$el.prop('draggable', true);
},
render: function() {
this.$el.html(this.model.get('name') + this.delete_link());
return this;
},
delete_link: function() {
return('<a href="#" class="delete">x</a>');
},
on_dragstart: function(event) {
var id = this.model.get('id');
var list_id = this.model.get('list_id');
var payload = [id, list_id].join(':');
event.originalEvent.dataTransfer.setData("text/plain", payload);
},
on_dragover: function(event) {
event.preventDefault();
},
on_drop: function(event) {
event.preventDefault();
},
delete: function(event) {
this.model.destroy();
},
close: function() {
this.off();
this.remove();
}
});
return TaskView;
});
| Add ability to delete a task | Add ability to delete a task
| JavaScript | mit | lorenzoplanas/tasks,lorenzoplanas/tasks |
edede8b53d19f628c566edf52d426b81d69af306 | client/src/Requests/PanelIssue.js | client/src/Requests/PanelIssue.js | import React from 'react'
import { Panel } from 'react-bootstrap'
import MarkdownBlock from '../shared/MarkdownBlock'
import { getCreator, getContent } from '../shared/requestUtils'
const Issue = props => {
return (
<Panel
header={`${props.issue.title} by ${getCreator(props.issue).name || getCreator(props.issue).login}`}
eventKey={props.issue.id}>
<MarkdownBlock body={getContent(props.issue)} />
</Panel>
)
}
export default Issue
| import React from 'react'
import { Panel } from 'react-bootstrap'
import MarkdownBlock from '../shared/MarkdownBlock'
import { getCreator, getContent } from '../shared/requestUtils'
const Issue = props => {
if (!props.issue)
return null
return (
<Panel
header={`${props.issue.title} by ${getCreator(props.issue).name || getCreator(props.issue).login}`}
eventKey={props.issue.id}>
<MarkdownBlock body={getContent(props.issue)} />
</Panel>
)
}
export default Issue
| Work around react router bug | Work around react router bug
<Miss /> sometimes renders even when it should not
| JavaScript | mit | clembou/github-requests,clembou/github-requests,clembou/github-requests |
9c2086204891e1b78e8cc077272018238d0ae5c1 | server/vote.js | server/vote.js | // TODO: should the baseScore be stored, and updated at vote time?
// This interface should change and become more OO, this'll do for now
var Scoring = {
// re-run the scoring algorithm on a single object
updateObject: function(object) {
// just count the number of votes for now
var baseScore = MyVotes.find({votedFor: object._id}).count();
// now multiply by 'age' exponentiated
// FIXME: timezones <-- set by server or is getTime() ok?
var ageInHours = (new Date().getTime() - object.submitted) / (60 * 60 * 1000);
object.score = baseScore * Math.pow(ageInHours + 2, -0.1375);
},
// rerun all the scoring
updateScores: function() {
Posts.find().forEach(function(post) {
Scoring.updateObject(post);
Posts.update(post._id, {$set: {score: post.score}});
});
}
}
Meteor.methods({
voteForPost: function(post){
var user = this.userId();
if(!user) return false;
var myvote = MyVotes.findOne({votedFor: post._id, user: user});
if(myvote) return false;
MyVotes.insert({votedFor: post._id, user: user, vote: 1});
Scoring.updateObject(post);
Posts.update(post._id, {$set: {score: post.score}});
return true;
}
});
| // TODO: should the baseScore be stored, and updated at vote time?
// This interface should change and become more OO, this'll do for now
var Scoring = {
// re-run the scoring algorithm on a single object
updateObject: function(object) {
// just count the number of votes for now
var baseScore = object.votes;
// now multiply by 'age' exponentiated
// FIXME: timezones <-- set by server or is getTime() ok?
var ageInHours = (new Date().getTime() - object.submitted) / (60 * 60 * 1000);
object.score = baseScore * Math.pow(ageInHours + 2, -0.1375);
},
// rerun all the scoring
updateScores: function() {
Posts.find().forEach(function(post) {
Scoring.updateObject(post);
Posts.update(post._id, {$set: {score: post.score}});
});
}
}
Meteor.methods({
voteForPost: function(post){
var userId = this.userId();
if(!userId) return false;
// atomically update the post's votes
var query = {_id: post._id, voters: {$ne: userId}};
var update = {$push: {voters: userId}, $inc: {votes: 1}};
Posts.update(query, update);
// now update the post's score
post = Posts.findOne(post._id);
Scoring.updateObject(post);
Posts.update(post._id, {$set: {score: post.score}});
return true;
}
});
| Use an atomic update operation | Use an atomic update operation | JavaScript | mit | mrn3/ldsdiscuss,delgermurun/Telescope,manriquef/Vulcan,SachaG/Gamba,geverit4/Telescope,TribeMedia/Screenings,IQ2022/Telescope,eruwinu/presto,caglarsayin/Telescope,rtluu/immersive,aozora/Telescope,zires/Telescope,cloudunicorn/fundandexit,Daz2345/Telescope,em0ney/Telescope,iraasta/quickformtest,covernal/Telescope,STANAPO/Telescope,KarimHmaissi/Codehunt,edjv711/presto,veerjainATgmail/Telescope,covernal/Telescope,jamesrhymer/iwishcitiescould,Bloc/Telescope,SachaG/swpsub,SachaG/bjjbot,TelescopeJS/Screenings,haribabuthilakar/fh,Daz2345/dhPulse,jkuruzovich/projecthunt,MallorcaJS/discuss.mallorcajs.com,elamotte/indieshunt,cloudunicorn/fundandexit,TribeMedia/Telescope,julienlapointe/telescope-nova-social-news,jparyani/Telescope,SachaG/swpsub,geoclicks/Telescope,vazco/Telescope,LuisHerranz/Telescope,ahmadassaf/Telescope,decent10/Telescope,lpatmo/cb-links,wangleihd/Telescope,dima7b/stewardsof,mandym-webdev/digitalnomadnews,okaysee/snackr,LuisHerranz/Telescope,McBainCO/telescope-apto-news,Eynaliyev/Screenings,robertoscaccia/Crafteria-webapp,eruwinu/presto,PaulAsjes/snackr,xamfoo/Telescope,nhlennox/gbjobs,georules/iwishcitiescould,baptistemac/Telescope,HelloMeets/HelloMakers,Leeibrah/telescope,neynah/Telescope,sophearak/Telescope,veerjainATgmail/Telescope,sdeveloper/Telescope,mandym-webdev/suggestanapp,cydoval/Telescope,samim23/GitXiv,automenta/sernyl,bharatjilledumudi/StockX,wojingdaile/Telescope,SwarnaKishore/TechTrendz,queso/Telescope,MeteorHudsonValley/Telescope,georules/iwishcitiescould,kakedis/Telescope,sophearak/Telescope,edjv711/presto,eruwinu/presto,NodeJSBarenko/Telescope,cloudunicorn/fundandexit,TodoTemplates/Telescope,chemceem/telescopeapp,Tobi2705/Telescope,tepk/Telescope,georules/iwishcitiescould,tommytwoeyes/Telescope,wduntak/tibetalk,WeAreWakanda/telescope,mandym-webdev/suggestanapp,neynah/Telescope,Discordius/Lesswrong2,codebuddiesdotorg/cb-v2,bengott/Telescope,wende/quickformtest,metstrike/Telescope,maxtor3569/Telescope,victorleungtw/AskMe,Healdb/Telescope,sing1ee/Telescope,opendataforgood/dataforgood_restyling,dominictracey/Telescope,SachaG/Gamba,sabon/great-balls-of-fire,maxtor3569/Telescope,pombredanne/Telescope,wooplaza/wpmob,Alekzanther/LawScope,Discordius/Telescope,Erwyn/Test-deploy-telescope,nishanbose/Telescope,almeidamarcell/AplicativoDoDia,Air2air/Telescope,NYUMusEdLab/fork-cb,aykutyaman/Telescope,lpatmo/cb-links,cdinnison/NPnews,tepk/Telescope,gzingraf/GreenLight-Pix,automenta/sernyl,crozzfire/hacky,nwabdou85/tagsira_,wende/quickformtest,guillaumj/Telescope,SachaG/bjjbot,mr1azl/Telescope,tepk/Telescope,wunderkraut/WunderShare,enginbodur/TelescopeLatest,weld-co/weld-telescope,mr1azl/Telescope,TribeMedia/Telescope,Discordius/Lesswrong2,jeehag/linkupp,nikhilno1/Telescope,jparyani/Telescope,Discordius/Lesswrong2,kakedis/Telescope,tupeloTS/telescopety,GitYong/Telescope,Leeibrah/telescope,bharatjilledumudi/StockX,alertdelta/asxbase,huaiyudavid/rentech,Code-for-Miami/miami-graph-telescope,theartsnetwork/artytrends,lewisnyman/Telescope,LocalFoodSupply/CrunchHunt,ryangum/telescope,datracka/dataforgood,metstrike/Telescope,theartsnetwork/artytrends,johndpark/Telescope,hoihei/Telescope,Healdb/Telescope,youprofit/Telescope,geverit4/Telescope,mr1azl/Telescope,Daz2345/Telescope,ryeskelton/Telescope,jrmedia/oilgas,arbfay/Telescope,GitYong/Telescope,basemm911/questionsociety,johndpark/Telescope,VulcanJS/Vulcan,Bloc/Telescope,codebuddiesdotorg/cb-v2,iraasta/quickformtest,lambtron/goodwillhunt.org,MeteorKorea/MeteorJS_KR,SachaG/Zensroom,weld-co/weld-telescope,wangleihd/Telescope,evilhei/itForum,Daz2345/Telescope,codebuddiesdotorg/cb-v2,kakedis/Telescope,tonyoconnell/nootropics,innesm4/strictly44,basemm911/questionsociety,rizakaynak/Telescope,silky/GitXiv,IanWhalen/Telescope,TribeMedia/Screenings,xamfoo/Telescope,UCSC-MedBook/MedBook-Telescope3,lpatmo/cb2,TribeMedia/Screenings,Code-for-Miami/miami-graph-telescope,aykutyaman/Telescope,tommytwoeyes/Telescope,arbfay/Telescope,braskinfvr/storytellers,lpatmo/cb-links,delgermurun/Telescope,IQ2022/Telescope,zires/Telescope,evilhei/itForum,Discordius/Lesswrong2,ryeskelton/Telescope,parkeasz/Telescope,rizakaynak/Telescope,JackAdams/meteorpad-index,dima7b/stewardsof,wduntak/tibetalk,SachaG/Zensroom,zires/Telescope,SachaG/fundandexit,lpatmo/cb2,sethbonnie/StartupNews,bshenk/projectIterate,dominictracey/Telescope,almogdesign/Telescope,fr0zen/viajavaga,adhikariaman01/Telescope,aichane/digigov,cmrberry/startup-stories,mavidser/Telescope,thinkxl/telescope-theme-mono,cydoval/Telescope,evilhei/itForum,fr0zen/viajavaga,faaez/Telescope,tupeloTS/grittynashville,yourcelf/Telescope,tylermalin/Screenings,meteorclub/crater.io,nickmke/decibel,SachaG/bjjbot,huaiyudavid/rentech,acidsound/Telescope,edjv711/presto,crozzfire/hacky,nishanbose/Telescope,bharatjilledumudi/StockX,braskinfvr/storytellers,julienlapointe/telescope-nova-social-news,NodeJSBarenko/Telescope,zandboxapp/zandbox,azukiapp/Telescope,maxtor3569/Telescope,jbschaff/StartupNews,HelloMeets/HelloMakers,nickmke/decibel,queso/Telescope,STANAPO/Telescope,jkuruzovich/projecthunt,Healdb/Telescope,danieltynerbryan/ProductNews,GeoffAbbott/easyLife,cydoval/Telescope,NYUMusEdLab/fork-cb,wunderkraut/WunderShare,SwarnaKishore/TechTrendz,capensisma/Asteroid,ibrahimcesar/Screenings,sungwoncho/Telescope,tupeloTS/grittynashville,gzingraf/GreenLight-Pix,nwabdou85/tagsira,TelescopeJS/Screenings,sdeveloper/Telescope,ahmadassaf/Telescope,Daz2345/dhPulse,almogdesign/Telescope,yourcelf/Telescope,TelescopeJS/CrunchHunt,wojingdaile/Telescope,nishanbose/Telescope,asm-products/discourse,gkovacs/Telescope,SSOCIETY/webpages,covernal/Telescope,sharakarasic/telescope-coderdojola,StEight/Telescope,sungwoncho/Telescope,higgsj/phunt,AdmitHub/Telescope,iraasta/quickformtest,jonmc12/heypsycho,ourcities/conectacao,Accentax/betanyheter,ourcities/conectacao,rafaecheve/startupstudygroup,theartsnetwork/artytrends,wunderkraut/WunderShare,zarkem/ironhacks,SachaG/fundandexit,Air2air/Telescope,empirical-org/codex-quill,capensisma/Asteroid,Code-for-Miami/miami-graph-telescope,msavin/Telescope,liamdarmody/telescope_app,em0ney/Telescope,JstnEdr/Telescope,tupeloTS/telescopety,Eynaliyev/Screenings,SachaG/swpsub,manriquef/Vulcan,TelescopeJS/CrunchHunt,nathanmelenbrink/theRecord,guilherme22/forum,zarkem/ironhacks,sabon/teleport-troubleshoot,bshenk/projectIterate,UCSC-MedBook/MedBook-Telescope3,youprofit/Telescope,geverit4/Telescope,elamotte/indieshunt,azukiapp/Telescope,SachaG/Zensroom,jrmedia/oilgas,huaiyudavid/rentech,parkeasz/Telescope,msavin/Telescope,baptistemac/Telescope,bharatjilledumudi/india-shop,simbird/Test,yourcelf/Telescope,aykutyaman/Telescope,sabon/great-balls-of-fire,STANAPO/Telescope,geoclicks/Telescope,tart2000/Telescope,ahmadassaf/Telescope,MeteorHudsonValley/Telescope,parkeasz/Telescope,bengott/Telescope,vazco/Telescope,jrmedia/oilgas,silky/GitXiv,acidsound/Telescope,TodoTemplates/Telescope,dominictracey/Telescope,tart2000/Telescope,innesm4/strictly44,ibrahimcesar/Screenings,veerjainATgmail/Telescope,meurio/conectacao,GeoffAbbott/dfl,enginbodur/TelescopeLatest,hudat/Behaviorally,rselk/telescope,jonmc12/heypsycho,azukiapp/Telescope,tylermalin/Screenings,cmrberry/startup-stories,aichane/digigov,Discordius/Telescope,filkuzmanovski/Telescope,gzingraf/GreenLight-Pix,msavin/Telescope,lewisnyman/Telescope,aozora/Telescope,PaulAsjes/snackr,nhlennox/gbjobs,Scalingo/Telescope,Air2air/Telescope,guillaumj/Telescope,danieltynerbryan/ProductNews,simbird/Test,aichane/digigov,meteorhacks/Telescope,Scalingo/Telescope,delgermurun/Telescope,flyghtdeck/beta,ibrahimcesar/Screenings,Tobi2705/telescopedeploy,KarimHmaissi/Codehunt,StEight/Telescope,StEight/Telescope,tupeloTS/telescopety,lpatmo/cb,JstnEdr/Telescope,HelloMeets/HelloMakers,nathanmelenbrink/theRecord,ryeskelton/Telescope,Heyho-letsgo/frenchmeteor,jonmc12/heypsycho,sdeveloper/Telescope,xamfoo/change-route-in-iron-router,simbird/Test,nwabdou85/tagsira_,wduntak/tibetalk,SSOCIETY/webpages,wende/quickformtest,basehaar/sumocollect,sing1ee/Telescope,TribeMedia/Telescope,TelescopeJS/Screenings,UCSC-MedBook/MedBook-Telescope2,mandym-webdev/digitalnomadnews,NodeJSBarenko/Telescope,johndpark/Telescope,faaez/Telescope,seanpat09/crebuzz,almogdesign/Telescope,Heyho-letsgo/frenchmeteor,youprofit/Telescope,Eynaliyev/Screenings,wilsonpeng8/growthintensive,basemm911/questionsociety,MeteorHudsonValley/Telescope,Discordius/Telescope,adhikariaman01/Telescope,geoclicks/Telescope,SachaG/fundandexit,guillaumj/Telescope,WeAreWakanda/telescope,tylermalin/Screenings,WeAreWakanda/telescope,lambtron/goodwillhunt.org,Alekzanther/LawScope,metstrike/Telescope,sing1ee/Telescope,Scalingo/Telescope,zarkem/ironhacks,enginbodur/TelescopeLatest,AdmitHub/Telescope,em0ney/Telescope,VulcanJS/Vulcan,flyghtdeck/beta,GeoffAbbott/dfl,bharatjilledumudi/india-shop,bshenk/projectIterate,nathanmelenbrink/theRecord,tonyoconnell/nootropics,silky/GitXiv,rafaecheve/startupstudygroup,faaez/Telescope,jamesrhymer/iwishcitiescould,lpatmo/cb2,adhikariaman01/Telescope,IQ2022/Telescope,mavidser/Telescope,GeoffAbbott/easyLife,jbschaff/StartupNews,bharatjilledumudi/india-shop,LocalFoodSupply/CrunchHunt,niranjans/Indostartups,acidsound/Telescope,automenta/sernyl,wrichman/tuleboxapp,liamdarmody/telescope_app,caglarsayin/Telescope,samim23/GitXiv,sethbonnie/StartupNews,bengott/Telescope,tupeloTS/grittynashville,aozora/Telescope,SSOCIETY/webpages,sabon/great-balls-of-fire,queso/Telescope,arunoda/Telescope,julienlapointe/telescope-nova-social-news,rtluu/immersive,wangleihd/Telescope,Daz2345/dhPulse,rtluu/immersive,lpatmo/cb,Leeibrah/telescope,tommytwoeyes/Telescope,LuisHerranz/Telescope,TelescopeJS/Meta,jbschaff/StartupNews,nikhilno1/Telescope,basehaar/sumocollect,SachaG/Gamba,dima7b/stewardsof,haribabuthilakar/fh,jamesrhymer/iwishcitiescould,samim23/GitXiv,capensisma/Asteroid,rizakaynak/Telescope,saadullahkhan/giteor,TodoTemplates/Telescope,Alekzanther/LawScope,netham91/Telescope,xamfoo/change-route-in-iron-router,sharakarasic/telescope-coderdojola,manriquef/Vulcan,UCSC-MedBook/MedBook-Telescope3,pombredanne/Telescope,hoihei/Telescope,danieltynerbryan/ProductNews,sophearak/Telescope,meteorhacks/Telescope,pombredanne/Telescope,nwabdou85/tagsira,wooplaza/wpmob,sungwoncho/Telescope,nhlennox/gbjobs,hoihei/Telescope,lpatmo/sibp,lewisnyman/Telescope,gkovacs/Telescope,meteorclub/crater.io,UCSC-MedBook/MedBook-Telescope2,filkuzmanovski/Telescope,meurio/conectacao,Discordius/Telescope,xamfoo/change-route-in-iron-router,caglarsayin/Telescope,JstnEdr/Telescope,sethbonnie/StartupNews,arbfay/Telescope,mavidser/Telescope |
d2d1d18134787a398511c60dccec4ee89f636edc | examples/cherry-pick/app/screens/application/index.js | examples/cherry-pick/app/screens/application/index.js | import './base.css';
import './application.css';
import 'suitcss-base';
import 'suitcss-utils-text';
import 'suitcss-components-arrange';
import React from 'react';
module.exports = React.createClass({
contextTypes: {
router: React.PropTypes.object.isRequired
},
link: function () {
var router = this.context.router;
return router.generate.apply(router, arguments);
},
getInitialState() {
var time = new Date().getTime();
// setInterval(this.updateTime, 1000);
return { time };
},
updateTime() {
var time = new Date().getTime();
this.setState({time});
},
render: function () {
return (
<div className='Application'>
<div className='Navbar'>
<div className='Navbar-header'>
<a className='Navbar-brand' href={this.link('index')}></a>
</div>
</div>
<div className='Application-content'>
{this.props.children}
</div>
<footer className='Footer'>
<p className='u-textCenter'>Cherrytree Demo. ·
<a href='github.com/QubitProducts/cherrytree'>Cherrytree Repo</a> ·
<a href='github.com/KidkArolis/cherrypick'>Demo Source Code</a>
</p>
</footer>
</div>
);
}
}); | import './base.css';
import './application.css';
import 'suitcss-base';
import 'suitcss-utils-text';
import 'suitcss-components-arrange';
import React from 'react';
module.exports = React.createClass({
contextTypes: {
router: React.PropTypes.object.isRequired
},
link: function () {
var router = this.context.router;
return router.generate.apply(router, arguments);
},
getInitialState() {
var time = new Date().getTime();
// setInterval(this.updateTime, 1000);
return { time };
},
updateTime() {
var time = new Date().getTime();
this.setState({time});
},
render: function () {
return (
<div className='Application'>
<div className='Navbar'>
<div className='Navbar-header'>
<a className='Navbar-brand' href={this.link('index')}></a>
</div>
</div>
<div className='Application-content'>
{this.props.children}
</div>
<footer className='Footer'>
<p className='u-textCenter'>Cherrytree Demo. ·
<a href='https://github.com/QubitProducts/cherrytree'>Cherrytree Repo</a> ·
<a href='https://github.com/QubitProducts/cherrytree/tree/master/examples/cherry-pick'>Demo Source Code</a>
</p>
</footer>
</div>
);
}
}); | Fix links in the cherry-pick demo | Fix links in the cherry-pick demo
| JavaScript | mit | nathanboktae/cherrytree,QubitProducts/cherrytree,QubitProducts/cherrytree,nathanboktae/cherrytree |
4a68f3869ab9af0c3b51bff223c36d49b58e5df3 | app/views/wrapper.js | app/views/wrapper.js | module.exports = function (body) {
return `
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minor WOT</title>
<link rel="stylesheet" href="/style.css" />
<script src="/app.js" defer></script>
${body}
`;
}
| module.exports = function (body) {
return `
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Minor WOT</title>
<link rel="stylesheet" href="/style.css" />
<script src="/app.js" defer></script>
<div data-root>
${body}
</div>
`;
}
| Add data-root div around main body for later use | Add data-root div around main body for later use
| JavaScript | mit | rijkvanzanten/luaus |
1fa073552fd0c806aae62e6b317199e46aabd085 | src/ParseCliServer.js | src/ParseCliServer.js | import express from 'express';
import bodyParser from 'body-parser';
import AppCache from 'parse-server/lib/cache';
import ParseCliController from './ParseCliController';
import ParseCliRouter from './ParseCliRouter';
import VendorAdapter from './VendorAdapter';
class ParseCliServer {
constructor({
config,
vendorAdapter,
cloud,
public_html
}) {
if (config) {
AppCache.put(config.applicationId, config);
if (config.limit != undefined) {
this.length_limit = limit;
} else {
this.length_limit = '500mb';
}
}
if (!vendorAdapter) {
vendorAdapter = new VendorAdapter({
config: config,
cloud: cloud,
public_html: public_html
});
}
let controller = new ParseCliController(vendorAdapter);
this.router = new ParseCliRouter(controller);
}
get app() {
var app = express();
/*
parse-cli always send json body but don't send a Content-Type
header or in some cases send an unexpected value like
application/octet-stream.
express request length limit is very low. Change limit value
for fix 'big' files deploy problems.
*/
app.use(bodyParser.json({type: function() { return true; }, limit: this.length_limit}));
this.router.mountOnto(app);
return app;
}
}
export default ParseCliServer;
export {
ParseCliServer
};
| import express from 'express';
import bodyParser from 'body-parser';
import AppCache from 'parse-server/lib/cache';
import ParseCliController from './ParseCliController';
import ParseCliRouter from './ParseCliRouter';
import VendorAdapter from './VendorAdapter';
class ParseCliServer {
constructor({
config,
vendorAdapter,
cloud,
public_html
}) {
if (config) {
AppCache.put(config.applicationId, config);
if (config.limit != undefined) {
this.length_limit = config.limit;
} else {
this.length_limit = '500mb';
}
}
if (!vendorAdapter) {
vendorAdapter = new VendorAdapter({
config: config,
cloud: cloud,
public_html: public_html
});
}
let controller = new ParseCliController(vendorAdapter);
this.router = new ParseCliRouter(controller);
}
get app() {
var app = express();
/*
parse-cli always send json body but don't send a Content-Type
header or in some cases send an unexpected value like
application/octet-stream.
express request length limit is very low. Change limit value
for fix 'big' files deploy problems.
*/
app.use(bodyParser.json({type: function() { return true; }, limit: this.length_limit}));
this.router.mountOnto(app);
return app;
}
}
export default ParseCliServer;
export {
ParseCliServer
};
| Fix typo in limit configuration and remove bodyparser urlencoded middleware. | Fix typo in limit configuration and remove bodyparser urlencoded
middleware.
| JavaScript | mit | back4app/parse-cli-server,luisholanda/parse-cli-server |
1f34969f216a7333a27fbd48b97293f3a22d0ec1 | lib/Object/map-to-array.js | lib/Object/map-to-array.js | 'use strict';
var callable = require('./valid-callable')
, forEach = require('./for-each')
, defaultCb = function (value, key) { return [key, value]; };
module.exports = function (obj, cb/*, thisArg*/) {
var a = [], thisArg = arguments[2];
cb = (cb == null) ? defaultCb : callable(cb);
forEach(obj, function (value, key) {
a.push(cb.call(thisArg, value, key, this));
}, obj, arguments[3]);
return a;
};
| 'use strict';
var callable = require('./valid-callable')
, forEach = require('./for-each')
, call = Function.prototype.call
, defaultCb = function (value, key) { return [key, value]; };
module.exports = function (obj, cb/*, thisArg*/) {
var a = [], thisArg = arguments[2];
cb = (cb == null) ? defaultCb : callable(cb);
forEach(obj, function (value, key) {
a.push(call.call(cb, thisArg, value, key, this));
}, obj, arguments[3]);
return a;
};
| Support any callable object as callback | Support any callable object as callback
| JavaScript | isc | medikoo/es5-ext |
f28118fe786bf4fea5b899ff27e185df532e884d | StringManipulation/ConsecutiveString/consecutivestring.js | StringManipulation/ConsecutiveString/consecutivestring.js | var ConsecutiveString = function(){};
/*validate k and length of the array. If the array length is 0 of less than k of k is less thatn or equal to 0
return an empty string.
if k is 1, then return the longest string.
else, loop through the string, */
ConsecutiveString.prototype.longestConsec = function(starr, k){
var out = "", concat = "";
if((k <= 0 || starr.length == 0) || k > starr.length){
return out;
}
else if(k === 1){
var s = starr.sort(function(b, a){
return a - b;
});
out = s[s.length-1]
}else{
for(var x = 0; x <= k; x++){
var f3 = starr[x] + starr[x+1] + starr[x+2];
var n3 = starr[x+1] + starr[x+2] + starr[x+3];
if(n3.length > f3.length){
starr[x] = null;
}
}
}
return out;
};
module.exports = ConsecutiveString
| var ConsecutiveString = function(){};
/*validate k and length of the array. If the array length is 0 of less than k of k is less thatn or equal to 0
return an empty string.
if k is 1, then return the longest string.
else, loop through the string, */
ConsecutiveString.prototype.longestConsec = function(starr, k){
var out = "", concat = "";
if((k <= 0 || starr.length == 0) || k > starr.length){
return out;
}
else if(k === 1){
var s = starr.sort(function(b, a){
return a - b;
});
out = s[s.length-1]
}else{
let lens = strarr.map( (_,i,arr) => arr.slice(i,i+k).join('').length ),
i = lens.indexOf( Math.max(...lens) );
out = strarr.slice(i,i+k).join('')
}
}
return out;
};
module.exports = ConsecutiveString
| Add Consectutive String Description solution | Add Consectutive String Description solution
| JavaScript | mit | BrianLusina/JS-Snippets |
a4d85bb42cf25879f154fba5b647778f503984a4 | docs/client/lib/navigate.js | docs/client/lib/navigate.js | navigate = function (hash) {
window.location.replace(Meteor.absoluteUrl(null, { secure: true }) + hash);
};
| navigate = function (hash) {
window.location.replace(Meteor.absoluteUrl() + hash);
};
| Remove extra option to absoluteUrl | Remove extra option to absoluteUrl
force-ssl already sets this option by default
| JavaScript | mit | msavin/meteor,daslicht/meteor,dboyliao/meteor,colinligertwood/meteor,chinasb/meteor,yonglehou/meteor,sclausen/meteor,jdivy/meteor,ashwathgovind/meteor,cog-64/meteor,elkingtonmcb/meteor,l0rd0fwar/meteor,meteor-velocity/meteor,brettle/meteor,dfischer/meteor,HugoRLopes/meteor,kencheung/meteor,jdivy/meteor,chiefninew/meteor,sunny-g/meteor,Paulyoufu/meteor-1,AnthonyAstige/meteor,whip112/meteor,msavin/meteor,rozzzly/meteor,sclausen/meteor,luohuazju/meteor,joannekoong/meteor,dandv/meteor,Puena/meteor,yiliaofan/meteor,sitexa/meteor,jagi/meteor,saisai/meteor,4commerce-technologies-AG/meteor,williambr/meteor,GrimDerp/meteor,alexbeletsky/meteor,luohuazju/meteor,katopz/meteor,modulexcite/meteor,mauricionr/meteor,paul-barry-kenzan/meteor,stevenliuit/meteor,fashionsun/meteor,AnjirHossain/meteor,jdivy/meteor,Quicksteve/meteor,AnthonyAstige/meteor,vjau/meteor,yyx990803/meteor,sitexa/meteor,vacjaliu/meteor,cog-64/meteor,jirengu/meteor,baiyunping333/meteor,arunoda/meteor,sdeveloper/meteor,yanisIk/meteor,cog-64/meteor,ljack/meteor,eluck/meteor,jeblister/meteor,neotim/meteor,brdtrpp/meteor,mauricionr/meteor,youprofit/meteor,shadedprofit/meteor,yyx990803/meteor,joannekoong/meteor,AnjirHossain/meteor,lieuwex/meteor,benjamn/meteor,baiyunping333/meteor,katopz/meteor,rabbyalone/meteor,HugoRLopes/meteor,D1no/meteor,lassombra/meteor,pjump/meteor,DAB0mB/meteor,karlito40/meteor,shadedprofit/meteor,williambr/meteor,dboyliao/meteor,Theviajerock/meteor,chinasb/meteor,devgrok/meteor,lassombra/meteor,judsonbsilva/meteor,allanalexandre/meteor,saisai/meteor,justintung/meteor,Puena/meteor,benstoltz/meteor,chiefninew/meteor,Puena/meteor,sitexa/meteor,GrimDerp/meteor,benstoltz/meteor,modulexcite/meteor,aramk/meteor,jrudio/meteor,vjau/meteor,vacjaliu/meteor,benjamn/meteor,ljack/meteor,kengchau/meteor,lorensr/meteor,yalexx/meteor,meteor-velocity/meteor,Eynaliyev/meteor,HugoRLopes/meteor,johnthepink/meteor,alexbeletsky/meteor,ljack/meteor,codedogfish/meteor,stevenliuit/meteor,eluck/meteor,Ken-Liu/meteor,williambr/meteor,karlito40/meteor,henrypan/meteor,IveWong/meteor,queso/meteor,yinhe007/meteor,deanius/meteor,vacjaliu/meteor,HugoRLopes/meteor,zdd910/meteor,DCKT/meteor,benjamn/meteor,4commerce-technologies-AG/meteor,brdtrpp/meteor,newswim/meteor,framewr/meteor,lieuwex/meteor,lieuwex/meteor,udhayam/meteor,akintoey/meteor,rozzzly/meteor,ashwathgovind/meteor,judsonbsilva/meteor,mubassirhayat/meteor,TechplexEngineer/meteor,D1no/meteor,zdd910/meteor,ndarilek/meteor,evilemon/meteor,nuvipannu/meteor,youprofit/meteor,Hansoft/meteor,wmkcc/meteor,pandeysoni/meteor,chasertech/meteor,shrop/meteor,allanalexandre/meteor,namho102/meteor,DCKT/meteor,colinligertwood/meteor,imanmafi/meteor,jenalgit/meteor,PatrickMcGuinness/meteor,brdtrpp/meteor,chinasb/meteor,Jeremy017/meteor,DCKT/meteor,tdamsma/meteor,alphanso/meteor,lpinto93/meteor,devgrok/meteor,mubassirhayat/meteor,GrimDerp/meteor,modulexcite/meteor,TribeMedia/meteor,GrimDerp/meteor,planet-training/meteor,vacjaliu/meteor,allanalexandre/meteor,elkingtonmcb/meteor,Prithvi-A/meteor,kencheung/meteor,eluck/meteor,brdtrpp/meteor,mirstan/meteor,newswim/meteor,kengchau/meteor,katopz/meteor,benstoltz/meteor,Ken-Liu/meteor,deanius/meteor,tdamsma/meteor,colinligertwood/meteor,dfischer/meteor,brettle/meteor,bhargav175/meteor,skarekrow/meteor,jg3526/meteor,IveWong/meteor,skarekrow/meteor,shmiko/meteor,zdd910/meteor,joannekoong/meteor,LWHTarena/meteor,namho102/meteor,tdamsma/meteor,guazipi/meteor,Jonekee/meteor,guazipi/meteor,paul-barry-kenzan/meteor,michielvanoeffelen/meteor,dboyliao/meteor,cbonami/meteor,deanius/meteor,ericterpstra/meteor,hristaki/meteor,AlexR1712/meteor,meonkeys/meteor,jenalgit/meteor,jg3526/meteor,henrypan/meteor,benstoltz/meteor,emmerge/meteor,oceanzou123/meteor,Eynaliyev/meteor,sdeveloper/meteor,devgrok/meteor,akintoey/meteor,esteedqueen/meteor,meonkeys/meteor,Theviajerock/meteor,lorensr/meteor,somallg/meteor,elkingtonmcb/meteor,pjump/meteor,vjau/meteor,TechplexEngineer/meteor,yalexx/meteor,justintung/meteor,neotim/meteor,juansgaitan/meteor,Puena/meteor,neotim/meteor,Hansoft/meteor,mauricionr/meteor,HugoRLopes/meteor,D1no/meteor,DAB0mB/meteor,chengxiaole/meteor,IveWong/meteor,deanius/meteor,D1no/meteor,jenalgit/meteor,paul-barry-kenzan/meteor,DCKT/meteor,dfischer/meteor,newswim/meteor,Profab/meteor,Urigo/meteor,sunny-g/meteor,lieuwex/meteor,yalexx/meteor,qscripter/meteor,ericterpstra/meteor,johnthepink/meteor,guazipi/meteor,planet-training/meteor,allanalexandre/meteor,h200863057/meteor,modulexcite/meteor,lorensr/meteor,johnthepink/meteor,calvintychan/meteor,Ken-Liu/meteor,michielvanoeffelen/meteor,neotim/meteor,ndarilek/meteor,cog-64/meteor,daltonrenaldo/meteor,codingang/meteor,benjamn/meteor,Jonekee/meteor,shrop/meteor,baiyunping333/meteor,chasertech/meteor,mirstan/meteor,chinasb/meteor,chinasb/meteor,udhayam/meteor,cherbst/meteor,JesseQin/meteor,AnthonyAstige/meteor,AnjirHossain/meteor,alexbeletsky/meteor,Profab/meteor,evilemon/meteor,justintung/meteor,AlexR1712/meteor,AlexR1712/meteor,SeanOceanHu/meteor,deanius/meteor,mjmasn/meteor,PatrickMcGuinness/meteor,AlexR1712/meteor,newswim/meteor,aramk/meteor,iman-mafi/meteor,arunoda/meteor,jeblister/meteor,hristaki/meteor,dev-bobsong/meteor,arunoda/meteor,yiliaofan/meteor,steedos/meteor,yiliaofan/meteor,AnthonyAstige/meteor,pandeysoni/meteor,oceanzou123/meteor,aldeed/meteor,daltonrenaldo/meteor,chmac/meteor,chasertech/meteor,h200863057/meteor,PatrickMcGuinness/meteor,evilemon/meteor,baysao/meteor,ljack/meteor,alexbeletsky/meteor,qscripter/meteor,benjamn/meteor,mirstan/meteor,lassombra/meteor,Ken-Liu/meteor,rabbyalone/meteor,daslicht/meteor,DAB0mB/meteor,yonas/meteor-freebsd,whip112/meteor,kidaa/meteor,bhargav175/meteor,whip112/meteor,h200863057/meteor,planet-training/meteor,sunny-g/meteor,bhargav175/meteor,lawrenceAIO/meteor,rabbyalone/meteor,yanisIk/meteor,yonglehou/meteor,jagi/meteor,jeblister/meteor,akintoey/meteor,shmiko/meteor,colinligertwood/meteor,juansgaitan/meteor,karlito40/meteor,justintung/meteor,saisai/meteor,yonglehou/meteor,Theviajerock/meteor,udhayam/meteor,pjump/meteor,imanmafi/meteor,Paulyoufu/meteor-1,karlito40/meteor,dboyliao/meteor,shrop/meteor,kengchau/meteor,youprofit/meteor,JesseQin/meteor,Hansoft/meteor,aldeed/meteor,yonas/meteor-freebsd,nuvipannu/meteor,shrop/meteor,mirstan/meteor,cbonami/meteor,brettle/meteor,jdivy/meteor,jeblister/meteor,Eynaliyev/meteor,meteor-velocity/meteor,LWHTarena/meteor,Jeremy017/meteor,Jonekee/meteor,somallg/meteor,lpinto93/meteor,DCKT/meteor,namho102/meteor,emmerge/meteor,henrypan/meteor,paul-barry-kenzan/meteor,williambr/meteor,TribeMedia/meteor,lpinto93/meteor,sclausen/meteor,AnjirHossain/meteor,shadedprofit/meteor,jirengu/meteor,Hansoft/meteor,imanmafi/meteor,stevenliuit/meteor,yalexx/meteor,Urigo/meteor,kidaa/meteor,somallg/meteor,judsonbsilva/meteor,esteedqueen/meteor,lawrenceAIO/meteor,henrypan/meteor,Prithvi-A/meteor,akintoey/meteor,jrudio/meteor,cog-64/meteor,steedos/meteor,hristaki/meteor,baiyunping333/meteor,ashwathgovind/meteor,akintoey/meteor,pjump/meteor,bhargav175/meteor,iman-mafi/meteor,TechplexEngineer/meteor,cbonami/meteor,queso/meteor,zdd910/meteor,luohuazju/meteor,yanisIk/meteor,yinhe007/meteor,imanmafi/meteor,henrypan/meteor,shrop/meteor,vjau/meteor,jirengu/meteor,aldeed/meteor,brdtrpp/meteor,msavin/meteor,shmiko/meteor,imanmafi/meteor,msavin/meteor,IveWong/meteor,queso/meteor,framewr/meteor,chasertech/meteor,aramk/meteor,dev-bobsong/meteor,lawrenceAIO/meteor,wmkcc/meteor,cherbst/meteor,Puena/meteor,udhayam/meteor,brdtrpp/meteor,chiefninew/meteor,SeanOceanHu/meteor,IveWong/meteor,arunoda/meteor,sclausen/meteor,allanalexandre/meteor,aldeed/meteor,brettle/meteor,jenalgit/meteor,AnthonyAstige/meteor,esteedqueen/meteor,Theviajerock/meteor,4commerce-technologies-AG/meteor,iman-mafi/meteor,ashwathgovind/meteor,dboyliao/meteor,ericterpstra/meteor,dfischer/meteor,kidaa/meteor,oceanzou123/meteor,mauricionr/meteor,sunny-g/meteor,bhargav175/meteor,queso/meteor,luohuazju/meteor,neotim/meteor,emmerge/meteor,fashionsun/meteor,brettle/meteor,hristaki/meteor,yanisIk/meteor,eluck/meteor,akintoey/meteor,youprofit/meteor,jrudio/meteor,guazipi/meteor,joannekoong/meteor,daslicht/meteor,meteor-velocity/meteor,shadedprofit/meteor,planet-training/meteor,cherbst/meteor,arunoda/meteor,arunoda/meteor,Ken-Liu/meteor,tdamsma/meteor,williambr/meteor,alphanso/meteor,michielvanoeffelen/meteor,udhayam/meteor,lieuwex/meteor,yyx990803/meteor,Profab/meteor,LWHTarena/meteor,chmac/meteor,somallg/meteor,bhargav175/meteor,AnthonyAstige/meteor,alphanso/meteor,mjmasn/meteor,l0rd0fwar/meteor,baiyunping333/meteor,TribeMedia/meteor,brettle/meteor,rabbyalone/meteor,skarekrow/meteor,yinhe007/meteor,sunny-g/meteor,EduShareOntario/meteor,JesseQin/meteor,chinasb/meteor,jeblister/meteor,papimomi/meteor,juansgaitan/meteor,yiliaofan/meteor,youprofit/meteor,emmerge/meteor,Jeremy017/meteor,servel333/meteor,steedos/meteor,pjump/meteor,jeblister/meteor,wmkcc/meteor,iman-mafi/meteor,devgrok/meteor,ashwathgovind/meteor,mjmasn/meteor,cog-64/meteor,papimomi/meteor,codedogfish/meteor,meonkeys/meteor,lorensr/meteor,Prithvi-A/meteor,yiliaofan/meteor,katopz/meteor,codedogfish/meteor,l0rd0fwar/meteor,HugoRLopes/meteor,DCKT/meteor,benjamn/meteor,LWHTarena/meteor,msavin/meteor,mirstan/meteor,codingang/meteor,jagi/meteor,lorensr/meteor,Jonekee/meteor,steedos/meteor,PatrickMcGuinness/meteor,iman-mafi/meteor,iman-mafi/meteor,evilemon/meteor,esteedqueen/meteor,johnthepink/meteor,nuvipannu/meteor,henrypan/meteor,Eynaliyev/meteor,joannekoong/meteor,yanisIk/meteor,paul-barry-kenzan/meteor,jagi/meteor,yalexx/meteor,sdeveloper/meteor,oceanzou123/meteor,fashionsun/meteor,chengxiaole/meteor,servel333/meteor,justintung/meteor,mubassirhayat/meteor,mjmasn/meteor,Quicksteve/meteor,udhayam/meteor,iman-mafi/meteor,katopz/meteor,yanisIk/meteor,allanalexandre/meteor,hristaki/meteor,guazipi/meteor,Paulyoufu/meteor-1,servel333/meteor,alphanso/meteor,vacjaliu/meteor,colinligertwood/meteor,Profab/meteor,rabbyalone/meteor,neotim/meteor,Ken-Liu/meteor,cherbst/meteor,chengxiaole/meteor,l0rd0fwar/meteor,justintung/meteor,karlito40/meteor,yanisIk/meteor,yalexx/meteor,LWHTarena/meteor,codedogfish/meteor,lieuwex/meteor,TechplexEngineer/meteor,williambr/meteor,rabbyalone/meteor,Puena/meteor,elkingtonmcb/meteor,sclausen/meteor,youprofit/meteor,lpinto93/meteor,ericterpstra/meteor,meonkeys/meteor,rozzzly/meteor,kengchau/meteor,mubassirhayat/meteor,chinasb/meteor,D1no/meteor,JesseQin/meteor,namho102/meteor,neotim/meteor,jeblister/meteor,zdd910/meteor,dev-bobsong/meteor,wmkcc/meteor,EduShareOntario/meteor,AnjirHossain/meteor,nuvipannu/meteor,chmac/meteor,AlexR1712/meteor,brdtrpp/meteor,codingang/meteor,sclausen/meteor,4commerce-technologies-AG/meteor,meteor-velocity/meteor,Theviajerock/meteor,sunny-g/meteor,servel333/meteor,calvintychan/meteor,youprofit/meteor,IveWong/meteor,sdeveloper/meteor,Eynaliyev/meteor,AlexR1712/meteor,dfischer/meteor,yanisIk/meteor,bhargav175/meteor,emmerge/meteor,ljack/meteor,steedos/meteor,Jonekee/meteor,HugoRLopes/meteor,kengchau/meteor,Profab/meteor,h200863057/meteor,EduShareOntario/meteor,qscripter/meteor,chengxiaole/meteor,wmkcc/meteor,LWHTarena/meteor,h200863057/meteor,DAB0mB/meteor,kidaa/meteor,jrudio/meteor,stevenliuit/meteor,shadedprofit/meteor,baysao/meteor,skarekrow/meteor,daltonrenaldo/meteor,hristaki/meteor,baysao/meteor,lawrenceAIO/meteor,framewr/meteor,jirengu/meteor,zdd910/meteor,mjmasn/meteor,mauricionr/meteor,servel333/meteor,somallg/meteor,dfischer/meteor,ndarilek/meteor,paul-barry-kenzan/meteor,ericterpstra/meteor,ndarilek/meteor,IveWong/meteor,luohuazju/meteor,whip112/meteor,deanius/meteor,shmiko/meteor,emmerge/meteor,alexbeletsky/meteor,baysao/meteor,somallg/meteor,imanmafi/meteor,yinhe007/meteor,dandv/meteor,devgrok/meteor,queso/meteor,eluck/meteor,judsonbsilva/meteor,Jonekee/meteor,codingang/meteor,akintoey/meteor,sitexa/meteor,dandv/meteor,cbonami/meteor,chmac/meteor,TechplexEngineer/meteor,kencheung/meteor,kidaa/meteor,newswim/meteor,jg3526/meteor,imanmafi/meteor,hristaki/meteor,tdamsma/meteor,lassombra/meteor,TribeMedia/meteor,yonglehou/meteor,juansgaitan/meteor,katopz/meteor,DAB0mB/meteor,arunoda/meteor,yinhe007/meteor,vjau/meteor,chiefninew/meteor,aramk/meteor,shmiko/meteor,TribeMedia/meteor,skarekrow/meteor,Paulyoufu/meteor-1,jagi/meteor,colinligertwood/meteor,jagi/meteor,jdivy/meteor,framewr/meteor,mauricionr/meteor,lpinto93/meteor,qscripter/meteor,jenalgit/meteor,calvintychan/meteor,shrop/meteor,yinhe007/meteor,kidaa/meteor,sitexa/meteor,GrimDerp/meteor,Urigo/meteor,jirengu/meteor,vjau/meteor,pandeysoni/meteor,alexbeletsky/meteor,williambr/meteor,guazipi/meteor,AnjirHossain/meteor,ljack/meteor,daltonrenaldo/meteor,dboyliao/meteor,lawrenceAIO/meteor,Prithvi-A/meteor,papimomi/meteor,Hansoft/meteor,fashionsun/meteor,chasertech/meteor,yyx990803/meteor,katopz/meteor,karlito40/meteor,Quicksteve/meteor,dfischer/meteor,kidaa/meteor,planet-training/meteor,papimomi/meteor,lawrenceAIO/meteor,newswim/meteor,yonas/meteor-freebsd,AnjirHossain/meteor,Ken-Liu/meteor,PatrickMcGuinness/meteor,saisai/meteor,dev-bobsong/meteor,yonas/meteor-freebsd,karlito40/meteor,Profab/meteor,Prithvi-A/meteor,planet-training/meteor,udhayam/meteor,dandv/meteor,juansgaitan/meteor,vacjaliu/meteor,daltonrenaldo/meteor,daslicht/meteor,DAB0mB/meteor,yonas/meteor-freebsd,michielvanoeffelen/meteor,framewr/meteor,brettle/meteor,skarekrow/meteor,codedogfish/meteor,Paulyoufu/meteor-1,JesseQin/meteor,cbonami/meteor,daslicht/meteor,EduShareOntario/meteor,lorensr/meteor,queso/meteor,saisai/meteor,shmiko/meteor,baysao/meteor,luohuazju/meteor,steedos/meteor,AnthonyAstige/meteor,namho102/meteor,oceanzou123/meteor,mubassirhayat/meteor,modulexcite/meteor,aldeed/meteor,sclausen/meteor,benstoltz/meteor,tdamsma/meteor,pjump/meteor,dboyliao/meteor,SeanOceanHu/meteor,msavin/meteor,stevenliuit/meteor,Eynaliyev/meteor,joannekoong/meteor,Theviajerock/meteor,ndarilek/meteor,fashionsun/meteor,alphanso/meteor,pandeysoni/meteor,mubassirhayat/meteor,johnthepink/meteor,yyx990803/meteor,nuvipannu/meteor,papimomi/meteor,yonglehou/meteor,mauricionr/meteor,kencheung/meteor,somallg/meteor,dev-bobsong/meteor,yyx990803/meteor,GrimDerp/meteor,alexbeletsky/meteor,judsonbsilva/meteor,daslicht/meteor,planet-training/meteor,mirstan/meteor,benstoltz/meteor,dev-bobsong/meteor,l0rd0fwar/meteor,framewr/meteor,PatrickMcGuinness/meteor,kengchau/meteor,emmerge/meteor,eluck/meteor,saisai/meteor,jg3526/meteor,johnthepink/meteor,meonkeys/meteor,baiyunping333/meteor,whip112/meteor,evilemon/meteor,shmiko/meteor,4commerce-technologies-AG/meteor,rozzzly/meteor,chmac/meteor,dandv/meteor,daltonrenaldo/meteor,aramk/meteor,lieuwex/meteor,ndarilek/meteor,SeanOceanHu/meteor,Hansoft/meteor,calvintychan/meteor,mirstan/meteor,oceanzou123/meteor,benstoltz/meteor,TechplexEngineer/meteor,brdtrpp/meteor,codingang/meteor,jirengu/meteor,jg3526/meteor,jg3526/meteor,eluck/meteor,pjump/meteor,DCKT/meteor,chasertech/meteor,Theviajerock/meteor,msavin/meteor,yinhe007/meteor,AnthonyAstige/meteor,EduShareOntario/meteor,lassombra/meteor,papimomi/meteor,chiefninew/meteor,yyx990803/meteor,allanalexandre/meteor,Urigo/meteor,alphanso/meteor,jrudio/meteor,yalexx/meteor,stevenliuit/meteor,pandeysoni/meteor,D1no/meteor,codedogfish/meteor,servel333/meteor,lpinto93/meteor,namho102/meteor,elkingtonmcb/meteor,cbonami/meteor,Urigo/meteor,sunny-g/meteor,jrudio/meteor,queso/meteor,judsonbsilva/meteor,cherbst/meteor,steedos/meteor,papimomi/meteor,EduShareOntario/meteor,SeanOceanHu/meteor,daltonrenaldo/meteor,judsonbsilva/meteor,calvintychan/meteor,jdivy/meteor,chmac/meteor,wmkcc/meteor,kencheung/meteor,qscripter/meteor,namho102/meteor,yonas/meteor-freebsd,4commerce-technologies-AG/meteor,yiliaofan/meteor,D1no/meteor,h200863057/meteor,Quicksteve/meteor,l0rd0fwar/meteor,aldeed/meteor,Puena/meteor,lpinto93/meteor,chasertech/meteor,HugoRLopes/meteor,Prithvi-A/meteor,kengchau/meteor,Jonekee/meteor,justintung/meteor,GrimDerp/meteor,daslicht/meteor,cog-64/meteor,Jeremy017/meteor,rozzzly/meteor,skarekrow/meteor,dandv/meteor,D1no/meteor,whip112/meteor,meonkeys/meteor,Eynaliyev/meteor,chengxiaole/meteor,Prithvi-A/meteor,elkingtonmcb/meteor,aldeed/meteor,mjmasn/meteor,ljack/meteor,4commerce-technologies-AG/meteor,TribeMedia/meteor,alexbeletsky/meteor,kencheung/meteor,servel333/meteor,michielvanoeffelen/meteor,h200863057/meteor,saisai/meteor,johnthepink/meteor,pandeysoni/meteor,whip112/meteor,sitexa/meteor,aleclarson/meteor,jenalgit/meteor,shrop/meteor,Quicksteve/meteor,codedogfish/meteor,TechplexEngineer/meteor,dboyliao/meteor,SeanOceanHu/meteor,Urigo/meteor,codingang/meteor,ashwathgovind/meteor,AlexR1712/meteor,LWHTarena/meteor,Paulyoufu/meteor-1,Jeremy017/meteor,Quicksteve/meteor,baysao/meteor,jdivy/meteor,newswim/meteor,shadedprofit/meteor,meonkeys/meteor,daltonrenaldo/meteor,lassombra/meteor,servel333/meteor,aramk/meteor,jg3526/meteor,michielvanoeffelen/meteor,devgrok/meteor,stevenliuit/meteor,sunny-g/meteor,vjau/meteor,ashwathgovind/meteor,yiliaofan/meteor,jenalgit/meteor,fashionsun/meteor,luohuazju/meteor,mjmasn/meteor,juansgaitan/meteor,aleclarson/meteor,framewr/meteor,zdd910/meteor,sdeveloper/meteor,EduShareOntario/meteor,qscripter/meteor,chiefninew/meteor,PatrickMcGuinness/meteor,shadedprofit/meteor,codingang/meteor,dandv/meteor,JesseQin/meteor,meteor-velocity/meteor,vacjaliu/meteor,modulexcite/meteor,lorensr/meteor,evilemon/meteor,Jeremy017/meteor,esteedqueen/meteor,calvintychan/meteor,pandeysoni/meteor,l0rd0fwar/meteor,esteedqueen/meteor,fashionsun/meteor,cbonami/meteor,cherbst/meteor,yonglehou/meteor,paul-barry-kenzan/meteor,SeanOceanHu/meteor,chiefninew/meteor,somallg/meteor,Urigo/meteor,rozzzly/meteor,kencheung/meteor,elkingtonmcb/meteor,colinligertwood/meteor,esteedqueen/meteor,TribeMedia/meteor,JesseQin/meteor,dev-bobsong/meteor,ericterpstra/meteor,jirengu/meteor,sdeveloper/meteor,Quicksteve/meteor,rabbyalone/meteor,Profab/meteor,yonas/meteor-freebsd,DAB0mB/meteor,devgrok/meteor,Hansoft/meteor,yonglehou/meteor,guazipi/meteor,ndarilek/meteor,meteor-velocity/meteor,chengxiaole/meteor,juansgaitan/meteor,baiyunping333/meteor,evilemon/meteor,lassombra/meteor,tdamsma/meteor,ndarilek/meteor,henrypan/meteor,nuvipannu/meteor,cherbst/meteor,benjamn/meteor,ericterpstra/meteor,alphanso/meteor,SeanOceanHu/meteor,qscripter/meteor,sdeveloper/meteor,aleclarson/meteor,modulexcite/meteor,chengxiaole/meteor,jagi/meteor,chmac/meteor,sitexa/meteor,chiefninew/meteor,lawrenceAIO/meteor,wmkcc/meteor,deanius/meteor,tdamsma/meteor,ljack/meteor,oceanzou123/meteor,nuvipannu/meteor,mubassirhayat/meteor,planet-training/meteor,eluck/meteor,Jeremy017/meteor,karlito40/meteor,calvintychan/meteor,Eynaliyev/meteor,aramk/meteor,baysao/meteor,rozzzly/meteor,michielvanoeffelen/meteor,joannekoong/meteor,allanalexandre/meteor,Paulyoufu/meteor-1,mubassirhayat/meteor |
fe0d1ba2d55121a69791896e0f9fec3aa70f7c3c | public/javascript/fonts.js | public/javascript/fonts.js | WebFontConfig = {
custom: { families: ['Alternate Gothic No.3', 'Clarendon FS Medium', 'Proxima Nova Light', 'Proxima Nova Semibold', 'Stub Serif FS', 'Stub Serif FS'],
urls: [ 'http://f.fontdeck.com/s/css/tEGvGvL6JlBfPjTgf2p9URd+sJ0/' + window.location.hostname + '/5502.css' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = '/javascript/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
| WebFontConfig = {
custom: { families: ['Alternate Gothic No.3', 'Clarendon FS Medium', 'Proxima Nova Light', 'Proxima Nova Semibold', 'Stub Serif FS', 'Stub Serif FS', 'Reminder Pro Bold'],
urls: [ 'http://f.fontdeck.com/s/css/tEGvGvL6JlBfPjTgf2p9URd+sJ0/' + window.location.hostname + '/5502.css' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = '/javascript/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
| Add new font to JS | Add new font to JS
| JavaScript | mit | robinwhittleton/static,kalleth/static,tadast/static,robinwhittleton/static,robinwhittleton/static,kalleth/static,robinwhittleton/static,alphagov/static,tadast/static,alphagov/static,alphagov/static,kalleth/static,kalleth/static,tadast/static,tadast/static |
040681cfa5be9a0b095fab6f8f3c84c833245c94 | addon/components/one-way-input.js | addon/components/one-way-input.js | import Ember from 'ember';
const {
Component,
get
} = Ember;
export default Component.extend({
tagName: 'input',
type: 'text',
attributeBindings: [
'accept',
'autocomplete',
'autosave',
'dir',
'formaction',
'formenctype',
'formmethod',
'formnovalidate',
'formtarget',
'height',
'inputmode',
'lang',
'list',
'max',
'min',
'multiple',
'name',
'pattern',
'size',
'step',
'type',
'value',
'width'
],
_sanitizedValue: undefined,
input() { this._handleChangeEvent(); },
change() { this._handleChangeEvent(); },
_handleChangeEvent() {
this._processNewValue.call(this, this.readDOMAttr('value'));
},
_processNewValue(rawValue) {
const value = this.sanitizeInput(rawValue);
if (this._sanitizedValue !== value) {
this._sanitizedValue = value;
this.attrs.update(value);
}
},
sanitizeInput(input) {
return input;
},
didReceiveAttrs() {
this._super(...arguments);
if (!this.attrs.update) {
throw new Error(`You must provide an \`update\` action to \`{{${this.templateName}}}\`.`);
}
this._processNewValue.call(this, get(this, 'value'));
}
});
| import Ember from 'ember';
const {
Component,
get
} = Ember;
export default Component.extend({
tagName: 'input',
type: 'text',
attributeBindings: [
'accept',
'autocomplete',
'autosave',
'dir',
'formaction',
'formenctype',
'formmethod',
'formnovalidate',
'formtarget',
'height',
'inputmode',
'lang',
'list',
'max',
'min',
'multiple',
'name',
'pattern',
'placeholder',
'size',
'step',
'type',
'value',
'width'
],
_sanitizedValue: undefined,
input() { this._handleChangeEvent(); },
change() { this._handleChangeEvent(); },
_handleChangeEvent() {
this._processNewValue.call(this, this.readDOMAttr('value'));
},
_processNewValue(rawValue) {
const value = this.sanitizeInput(rawValue);
if (this._sanitizedValue !== value) {
this._sanitizedValue = value;
this.attrs.update(value);
}
},
sanitizeInput(input) {
return input;
},
didReceiveAttrs() {
this._super(...arguments);
if (!this.attrs.update) {
throw new Error(`You must provide an \`update\` action to \`{{${this.templateName}}}\`.`);
}
this._processNewValue.call(this, get(this, 'value'));
}
});
| Add placeholder to attribute bindings | Add placeholder to attribute bindings
| JavaScript | mit | AdStage/ember-one-way-controls,dockyard/ember-one-way-input,dockyard/ember-one-way-controls,dockyard/ember-one-way-input,AdStage/ember-one-way-controls,dockyard/ember-one-way-controls |
a0d7b9248e15b04725cc72834cebe1084a2e70e5 | addons/storysource/src/manager.js | addons/storysource/src/manager.js | /* eslint-disable react/prop-types */
import React from 'react';
import addons from '@storybook/addons';
import StoryPanel from './StoryPanel';
import { ADDON_ID, PANEL_ID } from '.';
export function register() {
addons.register(ADDON_ID, api => {
addons.addPanel(PANEL_ID, {
title: 'Story',
render: ({ active, key }) => <StoryPanel key={key} api={api} active={active} />,
paramKey: 'story',
});
});
}
| /* eslint-disable react/prop-types */
import React from 'react';
import addons from '@storybook/addons';
import StoryPanel from './StoryPanel';
import { ADDON_ID, PANEL_ID } from '.';
export function register() {
addons.register(ADDON_ID, api => {
addons.addPanel(PANEL_ID, {
title: 'Story',
render: ({ active, key }) => <StoryPanel key={key} api={api} active={active} />,
paramKey: 'storysource',
});
});
}
| CHANGE paramKey for storysource addon disable | CHANGE paramKey for storysource addon disable
| JavaScript | mit | storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook |
ff86c57864c82a30f9af6bea2b29b8b2ae68defd | server/routes/heroku.js | server/routes/heroku.js | var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(err, res, body) {
console.log(body);
res.sendStatus(200).end();
});
});
module.exports = router;
| var express = require('express');
var router = express.Router();
var request = require('request');
router.get('/', function(req, res) {
request({
url: 'https://status.heroku.com/api/v3/current-status',
method: 'GET'
}, function(error, response, body) {
console.log(body); // {"status":{"Production":"green","Development":"green"},"issues":[]}
res.sendStatus(200).end();
});
});
module.exports = router;
| Rename res to not overwrite express res. | Rename res to not overwrite express res.
| JavaScript | mit | jontewks/bc-slack-alerts |
6af9dc39bbf566d6bea1d2bc553d47e9312e7daa | src/Components/EditableTable/EditableTableHeader/index.js | src/Components/EditableTable/EditableTableHeader/index.js | import React from 'react'
import PropTypes from 'prop-types'
const EditableTableHeader = ({columnNames}) => {
return(
<div>
{columnNames.map( columnName => {return <div key={columnName}>{columnName}</div>})}
</div>
)
}
EditableTableHeader.propTypes = {
columnNames: PropTypes.arrayOf(PropTypes.string).isRequired
}
export default EditableTableHeader | import React from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
const Div = styled.div`
display:flex;
flex-direction:row;
`
const HeaderCell = styled.div`
flex:1;
`
const EditableTableHeader = ({columnNames}) => {
return(
<Div>
{columnNames.map( columnName => {return <HeaderCell key={columnName}>{columnName}</HeaderCell>})}
</Div>
)
}
EditableTableHeader.propTypes = {
columnNames: PropTypes.arrayOf(PropTypes.string).isRequired
}
export default EditableTableHeader | Add styled components to EditableTableHeader | Add styled components to EditableTableHeader
| JavaScript | mit | severnsc/brewing-app,severnsc/brewing-app |
5d3bae193a4258fe1310f677f09df68de082590f | packages/coinstac-common/src/models/computation/remote-computation-result.js | packages/coinstac-common/src/models/computation/remote-computation-result.js | 'use strict';
const ComputationResult = require('./computation-result');
const joi = require('joi');
/* istanbul ignore next */
/**
* @class RemoteComputationResult
* @extends ComputationResult
* @description RemoteComputationResult result container
* @property {string[]} usernames
* @property {string} _id extends it's parent `PouchDocument` `_id` requirement
* and mandates the format: `runId`
*/
class RemoteComputationResult extends ComputationResult {
constructor(opts) {
super(opts);
this._idRegex = RemoteComputationResult._idRegex;
}
}
RemoteComputationResult._idRegex = /^([^-]+$)/; // format: runId
RemoteComputationResult.schema = Object.assign({}, ComputationResult.schema, {
_id: joi.string().regex(RemoteComputationResult._idRegex).required(),
complete: joi.boolean().default(false), // DecentralizedComputation complete/halted
computationInputs: joi.array().items(joi.array()).required(),
endDate: joi.date().timestamp(),
startDate: joi.date().timestamp().default(Date.now()),
usernames: joi.array().items(joi.string()).default([]),
userErrors: joi.array(),
// runId - derived from _id, enforced on ComputationResult instantiation
});
module.exports = RemoteComputationResult;
| 'use strict';
const ComputationResult = require('./computation-result');
const joi = require('joi');
/* istanbul ignore next */
/**
* @class RemoteComputationResult
* @extends ComputationResult
* @description RemoteComputationResult result container
* @property {string[]} usernames
* @property {string} _id extends it's parent `PouchDocument` `_id` requirement
* and mandates the format: `runId`
*/
class RemoteComputationResult extends ComputationResult {
constructor(opts) {
super(opts);
this._idRegex = RemoteComputationResult._idRegex;
}
}
RemoteComputationResult._idRegex = /^([^-]+$)/; // format: runId
RemoteComputationResult.schema = Object.assign({}, ComputationResult.schema, {
_id: joi.string().regex(RemoteComputationResult._idRegex).required(),
complete: joi.boolean().default(false), // DecentralizedComputation complete/halted
computationInputs: joi.array().items(joi.array()).required(),
endDate: joi.date().timestamp(),
startDate: joi.date().timestamp()
.default(() => Date.now(), 'time of creation'),
usernames: joi.array().items(joi.string()).default([]),
userErrors: joi.array(),
// runId - derived from _id, enforced on ComputationResult instantiation
});
module.exports = RemoteComputationResult;
| Fix remote computation document's start date bug. | Fix remote computation document's start date bug.
This ensures that remote computation documents are created with a
dynamically generated start date.
Closes #185.
| JavaScript | mit | MRN-Code/coinstac,MRN-Code/coinstac,MRN-Code/coinstac |
1178d8d86a2b8774ad9636de8d29ca30d352db51 | lib/assets/javascripts/cartodb/common/background_polling/models/upload_config.js | lib/assets/javascripts/cartodb/common/background_polling/models/upload_config.js |
/**
* Default upload config
*
*/
module.exports = {
uploadStates: [
'enqueued',
'pending',
'importing',
'uploading',
'guessing',
'unpacking',
'getting',
'creating',
'complete'
],
fileExtensions: [
'csv',
'xls',
'xlsx',
'zip',
'kml',
'geojson',
'json',
'ods',
'kmz',
'tsv',
'gpx',
'tar',
'gz',
'tgz',
'osm',
'bz2',
'tif',
'tiff',
'txt',
'sql'
],
// How big should file be?
fileTimesBigger: 3
} |
/**
* Default upload config
*
*/
module.exports = {
uploadStates: [
'enqueued',
'pending',
'importing',
'uploading',
'guessing',
'unpacking',
'getting',
'creating',
'complete'
],
fileExtensions: [
'csv',
'xls',
'xlsx',
'zip',
'kml',
'geojson',
'json',
'ods',
'kmz',
'tsv',
'gpx',
'tar',
'gz',
'tgz',
'osm',
'bz2',
'tif',
'tiff',
'txt',
'sql',
'rar'
],
// How big should file be?
fileTimesBigger: 3
}
| Allow importing RAR files in the UI | Allow importing RAR files in the UI
Fixes 2366
| JavaScript | bsd-3-clause | splashblot/dronedb,CartoDB/cartodb,bloomberg/cartodb,splashblot/dronedb,CartoDB/cartodb,CartoDB/cartodb,codeandtheory/cartodb,codeandtheory/cartodb,bloomberg/cartodb,bloomberg/cartodb,CartoDB/cartodb,bloomberg/cartodb,splashblot/dronedb,CartoDB/cartodb,codeandtheory/cartodb,codeandtheory/cartodb,codeandtheory/cartodb,splashblot/dronedb,splashblot/dronedb,bloomberg/cartodb |
19c9ad30143a106ecff8eceb1e03d1b0dc68a208 | packages/redis/index.js | packages/redis/index.js | const Redis = require('ioredis');
module.exports = url => {
const redis = new Redis(url);
redis.setJSON = async (...arguments) => {
arguments[1] = JSON.stringify(arguments[1]);
if (typeof arguments[2] === 'object' && arguments[2].asSeconds) {
arguments[2] = parseInt(arguments[2].asSeconds());
}
if (typeof arguments[2] === 'number') {
arguments[3] = parseInt(arguments[2]);
arguments[2] = 'EX';
}
return await redis.set.apply(redis, arguments);
}
redis.getJSON = async key => {
const value = await redis.get(key);
if (value) {
return JSON.parse(value);
}
return value;
}
return redis;
};
| const Redis = require('ioredis');
module.exports = url => {
const redis = new Redis(url);
redis.setJSON = async (...arguments) => {
arguments[1] = JSON.stringify(arguments[1]);
if (typeof arguments[2] === 'object' && arguments[2].asSeconds) {
arguments[2] = parseInt(arguments[2].asSeconds());
}
if (typeof arguments[2] === 'number') {
arguments[3] = parseInt(arguments[2]);
arguments[2] = 'EX';
}
if (typeof arguments[2] === 'undefined') {
arguments = [arguments[0], arguments[1]];
}
return await redis.set.apply(redis, arguments);
}
redis.getJSON = async key => {
const value = await redis.get(key);
if (value) {
return JSON.parse(value);
}
return value;
}
return redis;
};
| Fix redis syntax error if third argument is undefined | Fix redis syntax error if third argument is undefined
| JavaScript | mit | maxdome/maxdome-node,maxdome/maxdome-node |
87f5054b206cac2bc48cd908a83ebdce5723da62 | blueprints/ember-cli-typescript/index.js | blueprints/ember-cli-typescript/index.js | /* eslint-env node */
const path = require('path');
module.exports = {
description: 'Initialize files needed for typescript compilation',
files() {
return [
path.join(this.path, 'files', 'tsconfig.json'),
path.join(this.path, 'files', 'app', 'config', 'environment.d.ts'),
];
},
mapFile() {
const result = this._super.mapFile.apply(this, arguments);
const tsconfigPattern = `${path.sep}tsconfig.json`;
const appPattern = `${path.sep}app${path.sep}`;
if (result.indexOf(tsconfigPattern) > -1) {
return 'tsconfig.json';
} else if (result.indexOf(appPattern) > -1) {
var pos = result.indexOf(appPattern);
return result.substring(pos + 1);
}
},
locals() {
return {
inRepoAddons: (this.project.pkg['ember-addon'] || {}).paths || [],
};
},
normalizeEntityName() {
// Entity name is optional right now, creating this hook avoids an error.
},
afterInstall() {
return this.addPackagesToProject([
{ name: 'typescript', target: 'latest' },
{ name: '@types/ember', target: 'latest' },
{ name: '@types/rsvp', target: 'latest' },
{ name: '@types/ember-testing-helpers', target: 'latest' },
]);
},
};
| import { existsSync } from 'fs';
/* eslint-env node */
const path = require('path');
module.exports = {
description: 'Initialize files needed for typescript compilation',
files() {
return [
path.join(this.path, 'files', 'tsconfig.json'),
path.join(this.path, 'files', 'app', 'config', 'environment.d.ts'),
];
},
mapFile() {
const result = this._super.mapFile.apply(this, arguments);
const tsconfigPattern = `${path.sep}tsconfig.json`;
const appPattern = `${path.sep}app${path.sep}`;
if (result.indexOf(tsconfigPattern) > -1) {
return 'tsconfig.json';
} else if (result.indexOf(appPattern) > -1) {
var pos = result.indexOf(appPattern);
return result.substring(pos + 1);
}
},
locals() {
return {
inRepoAddons: (this.project.pkg['ember-addon'] || {}).paths || [],
};
},
normalizeEntityName() {
// Entity name is optional right now, creating this hook avoids an error.
},
async afterInstall() {
if (existsSync('.gitignore')) {
await this.insertIntoFile('.gitignore', '\n# Ember CLI TypeScript\n.e-c-ts');
}
return this.addPackagesToProject([
{ name: 'typescript', target: 'latest' },
{ name: '@types/ember', target: 'latest' },
{ name: '@types/rsvp', target: 'latest' },
{ name: '@types/ember-testing-helpers', target: 'latest' },
]);
},
};
| Add `.e.c-ts` to `.gitignore` on install. | Add `.e.c-ts` to `.gitignore` on install.
| JavaScript | mit | emberwatch/ember-cli-typescript,emberwatch/ember-cli-typescript,emberwatch/ember-cli-typescript,emberwatch/ember-cli-typescript |
fd0db8de5cc41d704148a4b5ad64c8161754e146 | tests/commands/cmmTests.js | tests/commands/cmmTests.js | var cmm = require("__buttercup/classes/commands/command.cmm.js");
module.exports = {
setUp: function(cb) {
this.command = new cmm();
(cb)();
},
callbackInjected: {
callsToCallback: function(test) {
var callbackCalled = false;
var callback = function(comment) {
callbackCalled = true;
};
this.command.injectCommentCallback(callback);
this.command.execute({}, "");
test.strictEqual(callbackCalled, true, "Calls into callback");
test.done();
},
callsToCallbackWithCommentTestCaseOne: function(test) {
var providedComment = "I am the first test case";
var callbackCalled = false;
var callback = function(comment) {
if (comment === providedComment) {
callbackCalled = true;
}
};
this.command.injectCommentCallback(callback);
this.command.execute({}, providedComment);
test.strictEqual(callbackCalled, true, "Calls into callback with correct comment (test case one)");
test.done();
}
}
};
| var cmm = require("__buttercup/classes/commands/command.cmm.js");
module.exports = {
setUp: function(cb) {
this.command = new cmm();
(cb)();
},
callbackInjected: {
callsToCallback: function(test) {
var callbackCalled = false;
var callback = function(comment) {
callbackCalled = true;
};
this.command.injectCommentCallback(callback);
this.command.execute({}, "");
test.strictEqual(callbackCalled, true, "Calls into callback");
test.done();
},
callsToCallbackWithCommentTestCaseOne: function(test) {
var providedComment = "I am the first test case";
var callbackCalled = false;
var callback = function(comment) {
if (comment === providedComment) {
callbackCalled = true;
}
};
this.command.injectCommentCallback(callback);
this.command.execute({}, providedComment);
test.strictEqual(callbackCalled, true, "Calls into callback with correct comment (test case one)");
test.done();
},
callsToCallbackWithCommentTestCaseTwo: function(test) {
var providedComment = "The second test case, that is what I am";
var callbackCalled = false;
var callback = function(comment) {
if (comment === providedComment) {
callbackCalled = true;
}
};
this.command.injectCommentCallback(callback);
this.command.execute({}, providedComment);
test.strictEqual(callbackCalled, true, "Calls into callback with correct comment (test case two)");
test.done();
}
}
};
| Test case two for comment contents | Test case two for comment contents
| JavaScript | mit | perry-mitchell/buttercup-core,buttercup-pw/buttercup-core,buttercup/buttercup-core,buttercup-pw/buttercup-core,perry-mitchell/buttercup-core,buttercup/buttercup-core,buttercup/buttercup-core |
73419f13fdb6a10cc0362a108375c062721b612d | eg/piezo.js | eg/piezo.js | var five = require("../lib/johnny-five.js"),
board = new five.Board();
board.on("ready", function() {
// Creates a piezo object and defines the pin to be used for the signal
var piezo = new five.Piezo(3);
// Injects the piezo into the repl
board.repl.inject({
piezo: piezo
});
// Plays a song
piezo.play({
// song is composed by an array of pairs of notes and beats
// The first argument is the note (null means "no note")
// The second argument is the length of time (beat) of the note (or non-note)
song: [
["C4", 1],
["D4", 1],
["F4", 1],
["D4", 1],
["A4", 1],
[null, 1],
["A4", 4],
["G4", 4],
[null, 2],
["C4", 1],
["D4", 1],
["F4", 1],
["D4", 1],
["G4", 1],
[null, 1],
["G4", 4],
["F4", 4],
[null, 2]
],
tempo: 250
});
});
| var five = require("../lib/johnny-five.js"),
board = new five.Board();
board.on("ready", function() {
// Creates a piezo object and defines the pin to be used for the signal
var piezo = new five.Piezo(3);
// Injects the piezo into the repl
board.repl.inject({
piezo: piezo
});
// Plays a song
piezo.play({
// song is composed by an array of pairs of notes and beats
// The first argument is the note (null means "no note")
// The second argument is the length of time (beat) of the note (or non-note)
song: [
["C4", 1/4],
["D4", 1/4],
["F4", 1/4],
["D4", 1/4],
["A4", 1/4],
[null, 1/4],
["A4", 1],
["G4", 1],
[null, 1/2],
["C4", 1/4],
["D4", 1/4],
["F4", 1/4],
["D4", 1/4],
["G4", 1/4],
[null, 1/4],
["G4", 1],
["F4", 1],
[null, 1/2]
],
tempo: 100
});
});
| Change beat to fractional values | Change beat to fractional values
| JavaScript | mit | AnnaGerber/johnny-five,cumbreras/rv,kod3r/johnny-five,kod3r/johnny-five,joelunmsm2003/arduino |
e513455d27aad423afe5bed9d34054430af82473 | plugins/wallhaven_cc.js | plugins/wallhaven_cc.js | var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name: 'wallhaven.cc',
prepareImgLinks: function (callback) {
var res = [];
hoverZoom.urlReplace(res,
'img[src*="/th.wallhaven.cc/"]',
/\/th.wallhaven.cc\/(.*)\/(.*)\/(.*)\.(.*)$/,
'/w.wallhaven.cc/full/$2/wallhaven-$3.jpg'
);
$('body').on('mouseenter', 'a[href*="/wallhaven.cc/w/"]', function () {
hoverZoom.prepareFromDocument($(this), this.href, function (doc) {
var img = doc.getElementById('wallpaper');
return img ? img.src : false;
});
});
callback($(res));
},
});
| var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name: 'wallhaven.cc',
version:'3.0',
prepareImgLinks: function (callback) {
var res = [];
hoverZoom.urlReplace(res,
'img[src*="/th.wallhaven.cc/"]',
/\/th.wallhaven.cc\/(.*)\/(.*)\/(.*)\.(.*)$/,
'/w.wallhaven.cc/full/$2/wallhaven-$3.jpg'
);
hoverZoom.urlReplace(res,
'img[src]',
/\/avatar\/\d+\//,
'/avatar/200/'
);
$('body').on('mouseenter', 'a[href*="/wallhaven.cc/w/"]', function () {
hoverZoom.prepareFromDocument($(this), this.href, function (doc) {
var img = doc.getElementById('wallpaper');
return img ? img.src : false;
});
});
callback($(res));
},
});
| Update for plug-in : wallhaven.cc | Update for plug-in : wallhaven.cc
| JavaScript | mit | extesy/hoverzoom,extesy/hoverzoom |
9ded25a6bb411da73117adcb50fe5194de8bd635 | chrome/browser/resources/managed_user_passphrase_dialog.js | chrome/browser/resources/managed_user_passphrase_dialog.js | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function load() {
$('unlock-passphrase-button').onclick = function(event) {
chrome.send('checkPassphrase', [$('passphrase-entry').value]);
};
$('cancel-passphrase-button').onclick = function(event) {
// TODO(akuegel): Replace by closeDialog.
chrome.send('DialogClose');
};
$('passphrase-entry').oninput = function(event) {
$('unlock-passphrase-button').disabled = $('passphrase-entry').value == '';
$('incorrect-passphrase-warning').hidden = true;
};
}
function passphraseCorrect() {
chrome.send('DialogClose', ['true']);
}
function passphraseIncorrect() {
$('incorrect-passphrase-warning').hidden = false;
$('passphrase-entry').focus();
}
window.addEventListener('DOMContentLoaded', load);
| // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function load() {
var checkPassphrase = function(event) {
chrome.send('checkPassphrase', [$('passphrase-entry').value]);
};
var closeDialog = function(event) {
// TODO(akuegel): Replace by closeDialog.
chrome.send('DialogClose');
};
// Directly set the focus on the input box so the user can start typing right
// away.
$('passphrase-entry').focus();
$('unlock-passphrase-button').onclick = checkPassphrase;
$('cancel-passphrase-button').onclick = closeDialog;
$('passphrase-entry').oninput = function(event) {
$('unlock-passphrase-button').disabled = $('passphrase-entry').value == '';
$('incorrect-passphrase-warning').hidden = true;
};
$('passphrase-entry').onkeypress = function(event) {
if (!event)
return;
// Check if the user pressed enter.
if (event.keyCode == 13)
checkPassphrase(event);
};
// Pressing escape anywhere in the frame should work.
document.onkeyup = function(event) {
if (!event)
return;
// Check if the user pressed escape.
if (event.keyCode == 27)
closeDialog(event);
};
}
function passphraseCorrect() {
chrome.send('DialogClose', ['true']);
}
function passphraseIncorrect() {
$('incorrect-passphrase-warning').hidden = false;
$('passphrase-entry').focus();
}
window.addEventListener('DOMContentLoaded', load);
| Improve usability in passphrase input dialog. | Improve usability in passphrase input dialog.
Add the possiblity to press Enter to submit the dialog and to press Escape to
dismiss it.
R=akuegel@chromium.org, jhawkins@chromium.org
BUG=171370
Review URL: https://chromiumcodereview.appspot.com/12321166
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@185194 0039d316-1c4b-4281-b951-d872f2087c98
| JavaScript | bsd-3-clause | krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,ondra-novak/chromium.src,ltilve/chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,ltilve/chromium,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,M4sse/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,jaruba/chromium.src,dednal/chromium.src,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,markYoungH/chromium.src,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,hujiajie/pa-chromium,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,anirudhSK/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,hujiajie/pa-chromium,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,littlstar/chromium.src,littlstar/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,ChromiumWebApps/chromium,anirudhSK/chromium,dednal/chromium.src,Jonekee/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,markYoungH/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,axinging/chromium-crosswalk,Just-D/chromium-1,ChromiumWebApps/chromium,jaruba/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,anirudhSK/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,jaruba/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,Just-D/chromium-1,markYoungH/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,anirudhSK/chromium,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,chuan9/chromium-crosswalk,ondra-novak/chromium.src,hujiajie/pa-chromium,littlstar/chromium.src,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,hujiajie/pa-chromium,M4sse/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,anirudhSK/chromium,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,patrickm/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,dednal/chromium.src,patrickm/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,Just-D/chromium-1,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,dednal/chromium.src,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,anirudhSK/chromium,Jonekee/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,dushu1203/chromium.src,Chilledheart/chromium,markYoungH/chromium.src,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,anirudhSK/chromium,Jonekee/chromium.src,axinging/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,hujiajie/pa-chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,littlstar/chromium.src,Jonekee/chromium.src,dednal/chromium.src |
dc7e4ee88250241d6950b4bdd6da0dc899050ccb | cla_public/static-src/javascripts/modules/cookie-banner.js | cla_public/static-src/javascripts/modules/cookie-banner.js | 'use strict';
require('./cookie-functions.js');
require('govuk_publishing_components/components/cookie-banner.js');
window.GOVUK.DEFAULT_COOKIE_CONSENT = {
'essential': true,
'usage': false,
'brexit': false
}
window.GOVUK.setDefaultConsentCookie = function () {
var defaultConsent = {
'essential': true,
'usage': false,
'brexit': false
}
window.GOVUK.setCookie('cookie_policy', JSON.stringify(defaultConsent), { days: 365 })
}
window.GOVUK.approveAllCookieTypes = function () {
var approvedConsent = {
'essential': true,
'usage': true,
'brexit': true
}
window.GOVUK.setCookie('cookie_policy', JSON.stringify(approvedConsent), { days: 365 })
}
| 'use strict';
require('./cookie-functions.js');
require('govuk_publishing_components/components/cookie-banner.js');
window.GOVUK.DEFAULT_COOKIE_CONSENT = {
'essential': true,
'usage': false,
'brexit': false
}
window.GOVUK.setDefaultConsentCookie = function () {
var defaultConsent = {
'essential': true,
'usage': false,
'brexit': false
}
window.GOVUK.setCookie('cookie_policy', JSON.stringify(defaultConsent), { days: 365 })
}
window.GOVUK.approveAllCookieTypes = function () {
var approvedConsent = {
'essential': true,
'usage': true,
'brexit': true
}
window.GOVUK.setCookie('cookie_policy', JSON.stringify(approvedConsent), { days: 365 })
}
window.GOVUK.Modules.CookieBanner.prototype.isInCookiesPage = function () {
return window.location.pathname === '/cookie-settings'
}
| Remove cookie banner from cookie settings page | Remove cookie banner from cookie settings page
| JavaScript | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public |
6a68619153b8b2cd9c35401e3943d4c4cc218eb6 | generators/server/templates/server/boot/security.js | generators/server/templates/server/boot/security.js | 'use strict';
const cookieParser = require('cookie-parser');
const csrf = require('csurf');
module.exports = function(server) {
let secure = true;
if (process.env.NODE_ENV === 'development') {
secure = false;
}
server.use(cookieParser());
server.use(csrf({cookie: {
key: 'XSRF-SECRET',
secure,
httpOnly: true,
path: '/<%= applicationFolder %>'
}}));
server.use((err, req, res, next) => { //eslint-disable-line
if (err.code !== 'EBADCSRFTOKEN') {
return next(err);
}
// handle CSRF token errors here
res.status(403); //eslint-disable-line no-magic-numbers
res.send('invalid csrf token');
});
server.use((req, res, next) => {
const token = req.csrfToken();
res.header('x-powered-by', '');
res.cookie('XSRF-TOKEN', token, { secure, path: '/<%= applicationFolder %>' });
next();
});
};
| 'use strict';
const cookieParser = require('cookie-parser');
const csrf = require('csurf');
module.exports = function(server) {
let secure = true;
if (process.env.NODE_ENV === 'development') {
secure = false;
}
server.use(cookieParser());
server.use(csrf({cookie: {
key: 'XSRF-SECRET',
secure,
httpOnly: true,
path: '/<%= applicationFolder %>'
}}));
server.use((err, req, res, next) => { // eslint-disable-line
if (err.code !== 'EBADCSRFTOKEN') {
return next(err);
}
// handle CSRF token errors here
res.status(403); // eslint-disable-line no-magic-numbers
res.send('invalid csrf token');
});
server.use((req, res, next) => {
const token = req.csrfToken();
res.header('x-powered-by', '');
res.cookie('XSRF-TOKEN', token, { secure, path: '/<%= applicationFolder %>' });
next();
});
};
| Fix linting errors on server | Fix linting errors on server
| JavaScript | apache-2.0 | societe-generale/react-loopback-generator,societe-generale/react-loopback-generator |
05e683ffe8c940d8fe5f762d91b3d76ab95e5b9d | app/js/controllers.js | app/js/controllers.js | 'use strict';
/* Controllers */
var cvAppControllers = angular.module('cvAppControllers', []);
cvAppControllers.controller('HomeController', ['$scope', '$http', function($scope, $http) {
$http.get('/app/info/info.json').success(function(data) {
$scope.stuff = data;
});
}]);
cvAppControllers.controller('AboutController', ['$scope', '$http', function($scope, $http) {
$http.get('/app/info/info.json').success(function(data) {
$scope.stuff = data;
});
}]); | 'use strict';
/* Controllers */
var cvAppControllers = angular.module('cvAppControllers', []);
cvAppControllers.controller('HomeController', ['$scope', '$http', function($scope, $http) {
$http.get('/app/info/info.json').success(function(data) {
$scope.stuff = data;
});
$scope.backgroundImg = "/app/img/kugghjulet.png"
}]);
cvAppControllers.controller('AboutController', ['$scope', '$http', function($scope, $http) {
$http.get('/app/info/info.json').success(function(data) {
$scope.stuff = data;
});
}]); | Add kugghjulet.png to home scope | Add kugghjulet.png to home scope
| JavaScript | mit | RegularSvensson/cvApp,RegularSvensson/cvApp |
ac3b1f587ed3a1cc7e0816d4d0a788da8e6d3a09 | lib/node_modules/@stdlib/datasets/stopwords-english/lib/index.js | lib/node_modules/@stdlib/datasets/stopwords-english/lib/index.js | 'use strict';
/**
* A list of English stopwords.
*
* @module @stdlib/datasets/smart-stopwords-en
*
* @example
* var STOPWORDS = require( '@stdlib/datasets/smart-stopwords-en' )
* // returns [ "a", "a's", "able", "about", ... ]
*/
var STOPWORDS = require( './../data/words.json' );
// EXPORTS //
module.exports = STOPWORDS;
| 'use strict';
/**
* A list of English stopwords.
*
* @module @stdlib/datasets/stopwords-en
*
* @example
* var STOPWORDS = require( '@stdlib/datasets/stopwords-en' )
* // returns [ "a", "a's", "able", "about", ... ]
*/
var STOPWORDS = require( './../data/words.json' );
// EXPORTS //
module.exports = STOPWORDS;
| Revert name change of stopwords-english | Revert name change of stopwords-english
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib |
cecc6de2d3df51acd077c5e3f8e3c88b8608d987 | app/services/index.js | app/services/index.js | import 'whatwg-fetch';
const apiBaseURL = 'http://localhost:1337';
function parseJSONFromResponse(response) {
return response.json();
}
export const bookshelfApi = {
getBooks() {
return fetch(`${apiBaseURL}/books`)
.then(parseJSONFromResponse)
.catch(error =>
console.error(
`Something went wrong trying to fetch books from bookshelf-server.
Make sure the bookshelf-server is started.`, error));
}
};
| import 'whatwg-fetch';
const apiBaseURL = 'http://localhost:1337';
function parseJSONFromResponse(response) {
return response.json();
}
function stringIsEmpty(str) {
return str === '' || str === undefined || str === null;
}
export const bookshelfApi = {
getBooks() {
return fetch(`${apiBaseURL}/books`)
.then(parseJSONFromResponse)
.catch(error =>
console.error('something went wrong attempting to fetch books:', error));
},
createBook(title, author) {
if (stringIsEmpty(title) || stringIsEmpty(author)) {
return false;
}
return fetch(`${apiBaseURL}/books`, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify({
title,
author,
}),
}).then(() => true)
.catch(() => false);
},
};
| Add method createBook to bookshelfApi connection. | Add method createBook to bookshelfApi connection.
| JavaScript | mit | w1nston/bookshelf,w1nston/bookshelf |
9672073a981ce9ebb88f7911854518ee9d0225ca | test/reducers/sum.spec.js | test/reducers/sum.spec.js | const sum = require('./sum');
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
}); | const sum = require('./sum');
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(4);
}); | Change test result to test travis ci notification | Change test result to test travis ci notification
| JavaScript | mit | FermORG/FermionJS,FermORG/FermionJS |
2e424fd72f6a1e484da6085238702c989879ad27 | server/server-logic.js | server/server-logic.js | const Q = require('q');
const RegularUsers = require('./../models/userSchema.js');
const BusinessUsers = require('./../models/businessUserSchema.js');
const Events = require('./../models/eventSchema.js');
const utils = require('../utils/utilities.js');
// Promisify a few mongoose methods with the `q` promise library
const findUser = Q.nbind(RegularUsers.findOne, RegularUsers);
const findBusUser = Q.nbind(BusinessUsers.findOne, BusinessUsers);
const findAllEvents = Q.nbind(Events.find, Events);
const postAnEvent = Q.nbind(Events.create, Events);
module.exports = {
getEvents: (req, res, next) => {
findAllEvents({})
.then((events) => {
res.json(events);
})
.fail((error) => {
next(error);
});
},
postEvent: (req, res, next) => {
const body = req.body;
postAnEvent({
username: body.username,
eventTime: body.eventTime,
location: body.location,
createdAt: new Date().toLocaleString(),
tags: body.tags.split(' '),
businessName: body.businessName,
picLink: body.picLink,
busLink: body.busLink,
description: body.dscription,
})
.then(() => {
res.setStatus(201).end();
})
.fail(err => err);
},
// getUser: (req, res, next) => {
//
// },
};
| const Q = require('q');
const RegularUsers = require('./../models/userSchema.js');
const BusinessUsers = require('./../models/businessUserSchema.js');
const Events = require('./../models/eventSchema.js');
const utils = require('../utils/utilities.js');
// Promisify a few mongoose methods with the `q` promise library
const findUser = Q.nbind(RegularUsers.findOne, RegularUsers);
const findBusUser = Q.nbind(BusinessUsers.findOne, BusinessUsers);
const findAllEvents = Q.nbind(Events.find, Events);
const postAnEvent = Q.nbind(Events.create, Events);
module.exports = {
getEvents: (req, res, next) => {
findAllEvents({})
.then((events) => {
res.json(events);
})
.fail((error) => {
next(error);
});
},
postEvent: (req, res, next) => {
const body = req.body;
const tags = body.tags ? body.tags.split(' ') : '';
postAnEvent({
username: body.username,
eventTime: body.eventTime,
location: body.location,
createdAt: new Date().toLocaleString(),
tags,
businessName: body.businessName,
picLink: body.picLink,
busLink: body.busLink,
description: body.dscription,
})
.then(() => {
res.setStatus(201).end();
})
.fail(err => err);
},
// getUser: (req, res, next) => {
//
// },
};
| Debug and tested server routes, successful post and get | Debug and tested server routes, successful post and get
| JavaScript | unlicense | DeFieldsEPeriou/DeGreenFields,eperiou/DeGreenFields,eperiou/DeGreenFields,DeFieldsEPeriou/DeGreenFields |
8d885db7d5e7a731f1ae180c0160db046cd1355c | examples/renderinitial/router.js | examples/renderinitial/router.js | var monorouter = require('monorouter');
var reactRouting = require('monorouter-react');
var PetList = require('./views/PetList');
var PetDetail = require('./views/PetDetail');
var Preloader = require('./views/Preloader');
module.exports = monorouter()
.setup(reactRouting())
.route('index', '/', function(req) {
this.renderInitial(Preloader, function() {
// Artificially make the next render take a while.
setTimeout(function() {
this.render(PetList);
}.bind(this), 1000);
});
})
.route('pet', '/pet/:name', function(req) {
this.renderInitial(Preloader, function() {
// Artificially make the next render take a while.
setTimeout(function() {
this.render(PetDetail, {petName: req.params.name});
}.bind(this), 1000);
});
});
| var monorouter = require('monorouter');
var reactRouting = require('monorouter-react');
var PetList = require('./views/PetList');
var PetDetail = require('./views/PetDetail');
var Preloader = require('./views/Preloader');
module.exports = monorouter()
.setup(reactRouting())
.route('index', '/', function(req) {
this.renderInitial(Preloader, function() {
// Artificially make the next render take a while.
setTimeout(function() {
this.render(PetList);
}.bind(this), 1000);
});
})
.route('pet', '/pet/:name', function(req) {
// NOTE: Because we're calling `this.renderInitial()`, we lose the
// opportunity to have the server send a 404, and the client will have to
// display a 'missing' view. If you want the server to send 404s, you have
// to call `this.unhandled()` before `this.renderInitial()`.
this.renderInitial(Preloader, function() {
// Artificially make the next render take a while.
setTimeout(function() {
this.render(PetDetail, {petName: req.params.name});
}.bind(this), 1000);
});
});
| Add note about 404 pitfall with renderInitial example | Add note about 404 pitfall with renderInitial example
| JavaScript | mit | matthewwithanm/monorouter |
9c20d0be36788e04838ea8e19e6f7eed3e0f44c3 | app/controllers/control.js | app/controllers/control.js | 'use strict';
/**
* Module dependencies.
*/
/**
* Find device by id
*/
exports.command = function(req, res) {
var client = exports.client;
var channel = '/control/' + req.params.deviceId + '/' + req.params.command;
client.publish(channel, req.body);
console.log('Publish to channel: ' + channel);
res.jsonp({result: 'OK'});
};
exports.setClient = function(client) {
exports.client = client;
}; | 'use strict';
/**
* Module dependencies.
*/
/**
* Find device by id
*/
exports.command = function(req, res) {
var client = exports.client;
var channel = '/control/' + req.params.deviceId;
var data = {
command: req.params.command,
body: req.body
}
client.publish(channel, data);
console.log('Publish to channel: ' + channel);
res.jsonp({result: 'OK'});
};
exports.setClient = function(client) {
exports.client = client;
}; | Send command in the published message | Send command in the published message
| JavaScript | apache-2.0 | msprunck/openit-site,msprunck/openit-site |
c75bb56fc01ba261f77d848d5667b7b480c71261 | app/controllers/category/index.js | app/controllers/category/index.js | import Ember from 'ember';
import PaginationMixin from '../../mixins/pagination';
const { computed } = Ember;
export default Ember.Controller.extend(PaginationMixin, {
queryParams: ['page', 'per_page', 'sort'],
page: '1',
per_page: 10,
sort: 'alpha',
totalItems: computed.readOnly('model.meta.total'),
currentSortBy: computed('sort', function() {
return (this.get('sort') === 'downloads') ? 'Downloads' : 'Alphabetical';
}),
});
| import Ember from 'ember';
import PaginationMixin from '../../mixins/pagination';
const { computed } = Ember;
export default Ember.Controller.extend(PaginationMixin, {
queryParams: ['page', 'per_page', 'sort'],
page: '1',
per_page: 10,
sort: 'downloads',
totalItems: computed.readOnly('model.meta.total'),
currentSortBy: computed('sort', function() {
return (this.get('sort') === 'downloads') ? 'Downloads' : 'Alphabetical';
}),
});
| Sort crates within a category by downloads by default | Sort crates within a category by downloads by default
There will be an RFC soon about whether this is the best ordering or
not.
| JavaScript | apache-2.0 | Susurrus/crates.io,steveklabnik/crates.io,steveklabnik/crates.io,Susurrus/crates.io,rust-lang/crates.io,rust-lang/crates.io,Susurrus/crates.io,Susurrus/crates.io,rust-lang/crates.io,rust-lang/crates.io,steveklabnik/crates.io,steveklabnik/crates.io |
8d362700afeaa78d1741b91c7bf9f31553debfa3 | public/src/js/logger.js | public/src/js/logger.js | /**
* public/src/js/logger.js - delish
*
* Licensed under MIT license.
* Copyright (C) 2017 Karim Alibhai.
*/
const util = require('util')
, debounce = require('debounce')
let currentLog = document.querySelector('.lead')
, nextLog = document.querySelector('.lead.next')
/**
* Updates the current log status.
* @param {String} message the string with formatting
* @param {...Object} values any values to plug in
*/
export default debounce(function () {
let text = util.format.apply(util, arguments)
// transition to the new log
nextLog.innerText = text
currentLog.classList.add('hide')
nextLog.classList.remove('next')
// after the CSS transition completes, swap
// the log elements out
setTimeout(() => {
let parent = currentLog.parentElement
parent.removeChild(currentLog)
currentLog = nextLog
nextLog = document.createElement('div')
nextLog.classList.add('lead')
nextLog.classList.add('next')
parent.appendChild(nextLog)
}, 700)
}, 700) | /**
* public/src/js/logger.js - delish
*
* Licensed under MIT license.
* Copyright (C) 2017 Karim Alibhai.
*/
const util = require('util')
, debounce = require('debounce')
let currentLog = document.querySelector('.lead')
, nextLog = document.querySelector('.lead.next')
/**
* Updates the current log status.
* @param {String} message the string with formatting
* @param {...Object} values any values to plug in
*/
export default debounce(function () {
let text = util.format.apply(util, arguments)
// transition to the new log
nextLog.innerText = text
currentLog.classList.add('hide')
nextLog.classList.remove('next')
// after the CSS transition completes, swap
// the log elements out
setTimeout(() => {
let parent = currentLog.parentElement
parent.removeChild(currentLog)
currentLog = nextLog
nextLog = document.createElement('p')
nextLog.classList.add('lead')
nextLog.classList.add('next')
parent.appendChild(nextLog)
}, 700)
}, 700) | Change div to p when creating new logs | Change div to p when creating new logs
| JavaScript | mit | karimsa/delish,karimsa/delish,karimsa/delish |
d23d00bafe9fb4a89d92f812506c244d2be595a1 | src/browser/extension/background/getPreloadedState.js | src/browser/extension/background/getPreloadedState.js | export default function getPreloadedState(position, cb) {
chrome.storage.local.get([
'monitor' + position, 'slider' + position, 'dispatcher' + position,
'test-templates', 'test-templates-sel'
], options => {
cb({
monitor: {
selected: options['monitor' + position],
sliderIsOpen: options['slider' + position] || false,
dispatcherIsOpen: options['dispatcher' + position] || false,
},
test: {
selected: options['test-templates-sel'] || 0,
templates: options['test-templates']
}
});
});
}
| const getIfExists = (sel, template) => (
typeof sel === 'undefined' ||
typeof template === 'undefined' ||
typeof template[sel] === 'undefined' ?
0 : sel
);
export default function getPreloadedState(position, cb) {
chrome.storage.local.get([
'monitor' + position, 'slider' + position, 'dispatcher' + position,
'test-templates', 'test-templates-sel'
], options => {
cb({
monitor: {
selected: options['monitor' + position],
sliderIsOpen: options['slider' + position] || false,
dispatcherIsOpen: options['dispatcher' + position] || false,
},
test: {
selected: getIfExists(options['test-templates-sel'], options['test-templates']),
templates: options['test-templates']
}
});
});
}
| Select the test template only if exists | Select the test template only if exists
Related to
https://github.com/zalmoxisus/redux-devtools-test-generator/issues/3
| JavaScript | mit | zalmoxisus/redux-devtools-extension,zalmoxisus/redux-devtools-extension |
0c2a557dbef6674d3d352cd49e9c13f4ed2f8362 | src/js/schemas/service-schema/EnvironmentVariables.js | src/js/schemas/service-schema/EnvironmentVariables.js | let EnvironmentVariables = {
description: 'Set environment variables for each task your service launches in addition to those set by Mesos.',
type: 'object',
title: 'Environment Variables',
properties: {
variables: {
type: 'array',
duplicable: true,
addLabel: 'Add Environment Variable',
getter: function (service) {
let variableMap = service.getEnvironmentVariables();
if (variableMap == null) {
return [{
key: null,
value: null,
usingSecret: null
}];
}
return Object.keys(variableMap).map(function (key) {
let value = variableMap[key];
let usingSecret = null;
if (typeof value === 'object' && value != null) {
usingSecret = true;
value = service.get('secrets')[value.secret].source;
}
return {
key,
value,
usingSecret
};
});
},
itemShape: {
properties: {
key: {
title: 'Key',
type: 'string'
},
value: {
title: 'Value',
type: 'string'
}
}
}
}
}
};
module.exports = EnvironmentVariables;
| import {Hooks} from 'PluginSDK';
let EnvironmentVariables = {
description: 'Set environment variables for each task your service launches in addition to those set by Mesos.',
type: 'object',
title: 'Environment Variables',
properties: {
variables: {
type: 'array',
duplicable: true,
addLabel: 'Add Environment Variable',
getter: function (service) {
let variableMap = service.getEnvironmentVariables();
if (variableMap == null) {
return [{}];
}
return Object.keys(variableMap).map(function (key) {
return Hooks.applyFilter('variablesGetter', {
key,
value: variableMap[key]
}, service);
});
},
itemShape: {
properties: {
key: {
title: 'Key',
type: 'string'
},
value: {
title: 'Value',
type: 'string'
}
}
}
}
}
};
module.exports = EnvironmentVariables;
| Move unnecessary things out of env schema | Move unnecessary things out of env schema | JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
14c9a161b2362d84905476ffb31be2864eec8a4a | angular-typescript-webpack-jasmine/webpack/webpack.test.js | angular-typescript-webpack-jasmine/webpack/webpack.test.js | const loaders = require("./loaders");
const webpack = require("webpack");
const path = require("path");
module.exports = {
context: path.join(__dirname, ".."),
entry: ["./src/test.ts"],
output: {
filename: "build.js",
path: path.resolve("temp"),
publicPath: "/"
},
resolve: {
extensions: [
".ts",
".js",
".json"
]
},
resolveLoader: {
modules: ["node_modules"]
},
devtool: "source-map-inline",
module: {
loaders: loaders
/* postLoaders: [
{
test: /^((?!\.spec\.ts).)*.ts$/,
exclude: /(node_modules)/,
loader: "istanbul-instrumenter"
}
] */
}
};
| const rules = require("./rules");
const webpack = require("webpack");
const path = require("path");
module.exports = {
context: path.join(__dirname, ".."),
entry: ["./src/test.ts"],
output: {
filename: "build.js",
path: path.resolve("temp"),
publicPath: "/"
},
resolve: {
extensions: [
".ts",
".js",
".json"
]
},
resolveLoader: {
modules: ["node_modules"]
},
devtool: "source-map-inline",
module: {
rules: rules
}
};
| Replace loaders -> rules. Delete useless configs | Replace loaders -> rules. Delete useless configs
| JavaScript | mit | var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training |
bb1901f9173c5df8ca7444919cfbe18457ebfa3f | endswith.js | endswith.js | /*! http://mths.be/endswith v0.1.0 by @mathias */
if (!String.prototype.endsWith) {
(function() {
'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
var toString = {}.toString;
String.prototype.endsWith = function(search) {
var string = String(this);
if (
this == null ||
(search && toString.call(search) == '[object RegExp]')
) {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var pos = stringLength;
if (arguments.length > 1) {
var position = arguments[1];
if (position !== undefined) {
// `ToInteger`
pos = position ? Number(position) : 0;
if (pos != pos) { // better `isNaN`
pos = 0;
}
}
}
var end = Math.min(Math.max(pos, 0), stringLength);
var start = end - searchLength;
if (start < 0) {
return false;
}
var index = -1;
while (++index < searchLength) {
if (string.charAt(start + index) != searchString.charAt(index)) {
return false;
}
}
return true;
};
}());
}
| /*! http://mths.be/endswith v0.1.0 by @mathias */
if (!String.prototype.endsWith) {
(function() {
'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
var toString = {}.toString;
String.prototype.endsWith = function(search) {
var string = String(this);
if (
this == null ||
(search && toString.call(search) == '[object RegExp]')
) {
throw TypeError();
}
var stringLength = string.length;
var searchString = String(search);
var searchLength = searchString.length;
var pos = stringLength;
if (arguments.length > 1) {
var position = arguments[1];
if (position !== undefined) {
// `ToInteger`
pos = position ? Number(position) : 0;
if (pos != pos) { // better `isNaN`
pos = 0;
}
}
}
var end = Math.min(Math.max(pos, 0), stringLength);
var start = end - searchLength;
if (start < 0) {
return false;
}
var index = -1;
while (++index < searchLength) {
if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) {
return false;
}
}
return true;
};
}());
}
| Use `charCodeAt` instead of `charAt` | Use `charCodeAt` instead of `charAt`
`charCodeAt` is faster in general.
Ref. #4.
| JavaScript | mit | mathiasbynens/String.prototype.endsWith |
b8173fcb00aa5e8599c2bdca5e888614eebf70eb | lib/models/graph-object.js | lib/models/graph-object.js | // Copyright 2015, EMC, Inc.
'use strict';
module.exports = GraphModelFactory;
GraphModelFactory.$provide = 'Models.GraphObject';
GraphModelFactory.$inject = [
'Model'
];
function GraphModelFactory (Model) {
return Model.extend({
connection: 'mongo',
identity: 'graphobjects',
attributes: {
instanceId: {
type: 'string',
required: true,
unique: true,
uuidv4: true
},
context: {
type: 'json',
required: true,
json: true
},
definition: {
type: 'json',
required: true,
json: true
},
tasks: {
type: 'json',
required: true,
json: true
},
node: {
model: 'nodes'
}
}
});
}
| // Copyright 2015, EMC, Inc.
'use strict';
module.exports = GraphModelFactory;
GraphModelFactory.$provide = 'Models.GraphObject';
GraphModelFactory.$inject = [
'Model',
'Constants'
];
function GraphModelFactory (Model, Constants) {
return Model.extend({
connection: 'mongo',
identity: 'graphobjects',
attributes: {
instanceId: {
type: 'string',
required: true,
unique: true,
uuidv4: true
},
context: {
type: 'json',
required: true,
json: true
},
definition: {
type: 'json',
required: true,
json: true
},
tasks: {
type: 'json',
required: true,
json: true
},
node: {
model: 'nodes'
},
active: function() {
var obj = this.toObject();
return obj._status === Constants.Task.States.Pending;
}
}
});
}
| Add active() method to graph object model | Add active() method to graph object model
| JavaScript | apache-2.0 | YoussB/on-core,YoussB/on-core |
6a4390f2cd0731a55bc6f65745ca16156fa74a94 | tests/unit/serializers/ilm-session-test.js | tests/unit/serializers/ilm-session-test.js | import { moduleForModel, test } from 'ember-qunit';
moduleForModel('ilm-session', 'Unit | Serializer | ilm session', {
// Specify the other units that are required for this test.
needs: ['serializer:ilm-session']
});
// Replace this with your real tests.
test('it serializes records', function(assert) {
let record = this.subject();
let serializedRecord = record.serialize();
assert.ok(serializedRecord);
});
| import { moduleForModel, test } from 'ember-qunit';
moduleForModel('ilm-session', 'Unit | Serializer | ilm session', {
// Specify the other units that are required for this test.
needs: [
'model:session',
'model:learner-group',
'model:instructor-group',
'model:user',
'serializer:ilm-session'
]
});
// Replace this with your real tests.
test('it serializes records', function(assert) {
let record = this.subject();
let serializedRecord = record.serialize();
assert.ok(serializedRecord);
});
| Fix ilm-session serializer test dependancies | Fix ilm-session serializer test dependancies
| JavaScript | mit | jrjohnson/frontend,gabycampagna/frontend,djvoa12/frontend,thecoolestguy/frontend,gboushey/frontend,stopfstedt/frontend,dartajax/frontend,thecoolestguy/frontend,gboushey/frontend,ilios/frontend,dartajax/frontend,ilios/frontend,jrjohnson/frontend,gabycampagna/frontend,djvoa12/frontend,stopfstedt/frontend |
d12c22bcd977b818dd107cfe5a5fe072f9bbab74 | tests/arity.js | tests/arity.js | var overload = require('../src/overload');
var should = require('should');
describe('overload', function() {
describe('arity', function() {
it('should exist', function() {
overload.should.have.property('arity');
});
it('should work', function() {
var two_or_three = overload.arity(2, 3);
var obj = {};
var res = 0;
overload.add(obj, 'work', function(one) {
res += 1;
});
overload.add(obj, 'work', two_or_three, function(one, two, three) {
res += 2;
});
obj.work('one');
res.should.eql(1);
obj.work('one', 'two');
res.should.eql(3);
obj.work('one', 'two', 'three');
res.should.eql(5);
obj.work('one', 'two', 'three', 'four');
res.should.eql(5);
});
});
}); | var overload = require('../src/overload');
var should = require('should');
describe('overload', function() {
describe('arity', function() {
it('should exist', function() {
overload.should.have.property('arity');
});
it('should work', function() {
var two_or_three = overload.arity(2, 3);
var obj = {};
var res = 0;
overload.add(obj, 'work', function(one) {
res += 1;
});
overload.add(obj, 'work', two_or_three, function(one, two, three) {
res += 2;
});
obj.work('one');
res.should.eql(1);
obj.work('one', 'two');
res.should.eql(3);
obj.work('one', 'two', 'three');
res.should.eql(5);
obj.work('one', 'two', 'three', 'four');
res.should.eql(5);
});
it('should work with saying more than or equal to', function() {
var obj = {};
var res = 0;
overload.add(obj, 'work', overload.arity(3), function() {
res++;
});
obj.work();
res.should.eql(0);
obj.work('one', 'two', 'three');
res.should.eql(1);
obj.work('one', 'two', 'three', 'four');
res.should.eql(2);
});
});
}); | Add tests for saying more than | Add tests for saying more than
| JavaScript | mit | nathggns/Overload |
e0fcfb103b04c290c4572cf2acacf8b56cd16f59 | example/pub.js | example/pub.js | const R = require("ramda");
const Promise = require("bluebird");
const pubsub = require("../")("amqp://docker");
const publish = (event, index) => {
const data = { number: index + 1 };
console.log(` [-] Published event '${ event.name }' with data:`, data);
event.publish(data)
};
// Create the event.
const events = {
foo: pubsub.event("foo"),
bar: pubsub.event("bar")
};
// Read in the command-line args, to determine which event to fire
// and how many events to fire it.
const args = process.argv.slice(2);
const eventName = args[0] || "foo";
const count = parseInt(args[1]) || 1;
if (events[eventName]) {
const promises = R.times((index) => publish(events[eventName], index), count);
Promise.all(promises)
.then(() => {
console.log("");
setTimeout(() => process.exit(0), 200);
})
} else {
console.log(`Event named '${ eventName }' does not exist.\n`);
}
| const R = require("ramda");
const Promise = require("bluebird");
const pubsub = require("../")("amqp://docker");
const publish = (event, index) => {
const data = { number: index + 1 };
console.log(` [-] Published event '${ event.name }' with data:`, data);
event.publish(data)
};
// Create the event.
const events = {
foo: pubsub.event("foo"),
bar: pubsub.event("bar")
};
// Read in the command-line args, to determine which event to fire
// and how many events to fire it.
const args = process.argv.slice(2);
const eventName = args[0] || "foo";
const count = parseInt(args[1]) || 1;
if (events[eventName]) {
const promises = R.times((index) => publish(events[eventName], index), count);
Promise.all(promises)
.then(() => {
console.log("");
setTimeout(() => process.exit(0), 500);
})
} else {
console.log(`Event named '${ eventName }' does not exist.\n`);
}
| Extend timeout before killing process. | Extend timeout before killing process.
| JavaScript | mit | philcockfield/mq-pubsub |
2483669d68dd399e9597db2c413994817ef1ed61 | test/assert.js | test/assert.js | 'use strict';
var CustomError = require('es5-ext/error/custom')
, logger = require('../lib/logger')();
module.exports = function (t, a) {
t = t(logger);
t(true, true, 'foo');
t.ok(false, 'bar');
t.not(false, true, 'not');
t.deep([1, 2], [1, 2], 'deep');
t.notDeep([1, 2], [2, 1], 'not deep');
t.throws(function () { throw new CustomError('Test', 'TEST'); }, 'TEST',
'throws');
a.deep([logger[0].type, logger[0].data], ['pass', 'foo']);
a.deep([logger[1].type, logger[1].data.message], ['fail', 'bar']);
a.deep([logger[2].type, logger[2].data], ['pass', 'not'], "'not' support");
a.deep([logger[3].type, logger[3].data], ['pass', 'deep'], "'deep' support");
a.deep([logger[4].type, logger[4].data], ['pass', 'not deep'],
"'not deep' support");
a.deep([logger[5].type, logger[5].data], ['pass', 'throws'],
"custom trhows support");
};
| 'use strict';
var customError = require('es5-ext/error/custom')
, logger = require('../lib/logger')();
module.exports = function (t, a) {
t = t(logger);
t(true, true, 'foo');
t.ok(false, 'bar');
t.not(false, true, 'not');
t.deep([1, 2], [1, 2], 'deep');
t.notDeep([1, 2], [2, 1], 'not deep');
t.throws(function () { throw customError('Test', 'TEST'); }, 'TEST',
'throws');
a.deep([logger[0].type, logger[0].data], ['pass', 'foo']);
a.deep([logger[1].type, logger[1].data.message], ['fail', 'bar']);
a.deep([logger[2].type, logger[2].data], ['pass', 'not'], "'not' support");
a.deep([logger[3].type, logger[3].data], ['pass', 'deep'], "'deep' support");
a.deep([logger[4].type, logger[4].data], ['pass', 'not deep'],
"'not deep' support");
a.deep([logger[5].type, logger[5].data], ['pass', 'throws'],
"custom trhows support");
};
| Update up to changes in es5-ext | Update up to changes in es5-ext
| JavaScript | isc | medikoo/tad |
9cb0c8ee1f56dbe8c966ea4b912f4fd73f8d3684 | server.js | server.js | import express from 'express';
import { apolloExpress, graphiqlExpress } from 'apollo-server';
import bodyParser from 'body-parser';
import cors from 'cors';
import { createServer } from 'http';
import { SubscriptionServer } from 'subscriptions-transport-ws';
import { subscriptionManager } from './data/subscriptions';
import schema from './data/schema';
const GRAPHQL_PORT = 8080;
const WS_PORT = 8090;
const graphQLServer = express().use('*', cors());
graphQLServer.use('/graphql', bodyParser.json(), apolloExpress({
schema,
context: {},
}));
graphQLServer.use('/graphiql', graphiqlExpress({
endpointURL: '/graphql',
}));
graphQLServer.listen(GRAPHQL_PORT, () => console.log(
`GraphQL Server is now running on http://localhost:${GRAPHQL_PORT}/graphql`
));
// WebSocket server for subscriptions
const websocketServer = createServer((request, response) => {
response.writeHead(404);
response.end();
});
websocketServer.listen(WS_PORT, () => console.log( // eslint-disable-line no-console
`Websocket Server is now running on http://localhost:${WS_PORT}`
));
// eslint-disable-next-line
new SubscriptionServer(
{ subscriptionManager },
websocketServer
);
| import express from 'express';
import { apolloExpress, graphiqlExpress } from 'apollo-server';
import bodyParser from 'body-parser';
import cors from 'cors';
import { createServer } from 'http';
import { SubscriptionServer } from 'subscriptions-transport-ws';
import { printSchema } from 'graphql/utilities/schemaPrinter'
import { subscriptionManager } from './data/subscriptions';
import schema from './data/schema';
const GRAPHQL_PORT = 8080;
const WS_PORT = 8090;
const graphQLServer = express().use('*', cors());
graphQLServer.use('/graphql', bodyParser.json(), apolloExpress({
schema,
context: {},
}));
graphQLServer.use('/graphiql', graphiqlExpress({
endpointURL: '/graphql',
}));
graphQLServer.use('/schema', function(req, res, _next) {
res.set('Content-Type', 'text/plain');
res.send(printSchema(schema));
});
graphQLServer.listen(GRAPHQL_PORT, () => console.log(
`GraphQL Server is now running on http://localhost:${GRAPHQL_PORT}/graphql`
));
// WebSocket server for subscriptions
const websocketServer = createServer((request, response) => {
response.writeHead(404);
response.end();
});
websocketServer.listen(WS_PORT, () => console.log( // eslint-disable-line no-console
`Websocket Server is now running on http://localhost:${WS_PORT}`
));
// eslint-disable-next-line
new SubscriptionServer(
{ subscriptionManager },
websocketServer
);
| Add /schema path that serves schema as plain text | Add /schema path that serves schema as plain text
| JavaScript | mit | misas-io/misas-server,vincentfretin/assembl-graphql-js-server,misas-io/misas-server,a1528zhang/graphql-mock-server |
4b91adde9fcdac4489f062552dd96c72efa26fda | server.js | server.js | // server.js
'use strict';
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const morgan = require('morgan');
const bodyParser = require('body-parser'); // Pull info from HTML POST
const methodOverride = require('method-override'); // Simulate DELETE and PUT
const argv = require('yargs');
// =============================================================================
// Configuration
// DB Config
const DB_URL = argv.db || process.env.DATABASE_URL;
mongoose.connect(DB_URL);
// Set static files location /public/img will be /img for users
app.use(express.static(__dirname + '/public'));
// Log every request to the console
app.use(morgan('dev'));
// Parse application/x-www-form-unlencoded, JSON, and vnd.api+json as JSON
app.use(bodyParser.urlencoded({'extended':'true'}));
app.use(bodyParser.json());
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
app.use(methodOverride());
// =============================================================================
// Initilize app
app.listen(8080);
console.log('App is running on port 8080');
| // server.js
//jscs:disable requireTrailingComma, disallowQuotedKeysInObjects
'use strict';
const express = require('express');
const app = express();
const mongoose = require('mongoose');
const morgan = require('morgan');
const bodyParser = require('body-parser'); // Pull info from HTML POST
const methodOverride = require('method-override'); // Simulate DELETE and PUT
const argv = require('yargs');
// =============================================================================
// Configuration
// DB Config
const DB_URL = argv.db || process.env.DATABASE_URL;
mongoose.connect(DB_URL);
// Set static files location /public/img will be /img for users
app.use(express.static(__dirname + '/public'));
// Log every request to the console
app.use(morgan('dev'));
// Parse application/x-www-form-unlencoded, JSON, and vnd.api+json as JSON
app.use(bodyParser.urlencoded({'extended':'true'}));
app.use(bodyParser.json());
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
app.use(methodOverride());
// =============================================================================
// Initilize app
app.listen(8080);
console.log('App is running on port 8080');
| Disable some annoying JSCS stuff | Disable some annoying JSCS stuff
| JavaScript | mit | brandonlee503/Node-Angular-App-Test,brandonlee503/Node-Angular-App-Test |
0d98c7264a78894fbed253e8711bf0ba8c89ba0c | server.js | server.js | 'use strict';
const app = require('./app');
require('./api.js')(app);
require('./static.js')(app);
const PORT = process.env.PORT || 4000;
app.listen(PORT, () => {
console.log(`App listening on port ${PORT}!`);
});
| 'use strict';
const app = require('./app');
// remove the automatically added `X-Powered-By` header
app.disable('x-powered-by');
require('./api.js')(app);
require('./static.js')(app);
const PORT = process.env.PORT || 4000;
app.listen(PORT, () => {
console.log(`App listening on port ${PORT}!`);
});
| Remove the `X-Powered-By` header added by Express | Remove the `X-Powered-By` header added by Express
The `X-Powered-By` header provides no real benefit and also leaks
information about the design of the underlying system that may be
useful to attackers.
| JavaScript | mit | clembou/github-requests,clembou/github-requests,clembou/github-requests |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.