commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
33a93e7cd8026621d6d06c916a8428ceaea9f905 | Add arguments to ping | index.js | index.js | var fs = require('fs');
var rtmpdump = require('rtmpdump');
var schedule = require('node-schedule');
var config = require('./config.json');
var vorpal = require('vorpal')();
var videoURL = config.videoURL;
//TODO: Utility function for log formatting
function streamError(err, callback) {
//TODO: Check against broa... | JavaScript | 0.000002 | @@ -1261,32 +1261,56 @@
pingStream(
+record, timeout, persist
);%0A %7D
@@ -2846,97 +2846,409 @@
ity.
- Times out after 15 seconds')%0A .action(function (args, callback) %7B%0A pingStream(
+')%0A .option('-r, --record', 'Will record the stream on success. Default is false.')%0A .optio... |
f0a2ba0f2a1c1b0958348c5d1bfb9ca79281e6c6 | Check for app._router.stack also | index.js | index.js | var debug = require('debug');
module.exports = function (app) {
return new Connectr(app);
};
var merge = function(a, b){
if (a && b) {
for (var key in b) {
a[key] = b[key];
}
}
return a;
};
module.exports.patch = function (app) {
if (app._use)
throw new Error('This app is already patched... | JavaScript | 0 | @@ -476,24 +476,177 @@
.app = app;%0A
+ this.stack = this.app.stack %7C%7C (this.app._router? this.app._router.stack : null);%0A %0A if(!this.stack) %7B%0A throw new Error('Cannot find stack');%0A %7D%0A
%7D;%0A%0AConnectr
@@ -3454,20 +3454,16 @@
his.
-app.
stack);%0A
%0A r
@@ -3458,16 +3458,16 @@
stack);... |
68253bb53f19a6d159a39b81337cc89a1f4ee7f1 | decrease number of iterations | index.js | index.js | 'use strict';
var JAPANESE_NUMERAL_CHARS = {
'〇': 0,
'一': 1,
'二': 2,
'三': 3,
'四': 4,
'五': 5,
'六': 6,
'七': 7,
'八': 8,
'九': 9,
'壱': 1,
'弐': 2,
'参': 3
};
var EXPONENTS_IN_SUBSEQ = {
'十': 1,
'百': 2,
'千': 3,
'拾': 1
};
var POWERS_OF_MYRIAD = {
'万': 4,
'億': 8,
'兆': 12
};
function va... | JavaScript | 0.999461 | @@ -3266,21 +3266,14 @@
%7D%0A
-var numbers =
+return
cha
@@ -3294,19 +3294,8 @@
ars)
-;%0A numbers
.red
@@ -3304,25 +3304,27 @@
e(function (
-p
+acc
, n) %7B%0A i
@@ -3350,17 +3350,19 @@
return
-p
+acc
;%0A %7D%0A
@@ -3369,17 +3369,24 @@
if (
-p
+acc.prev
%3E= n) %7B
@@ -3460,75 +3460,68 @@
... |
6a2955e9a45228296c3b784416bbcbe84b13b557 | Resolve each path so it simply doesn't pass ".". Closes #7 | tasks/dox.js | tasks/dox.js | /*
* grunt-dox
* https://github.com/mattmcmanus/grunt-dox
*
* Copyright (c) 2012 Matt McManus
* Licensed under the MIT license.
*/
var exec = require('child_process').exec,
fs = require('fs'),
path = require('path'),
rimraf = require('rimraf');
// Figure out the parent dir to pass to dox-foundation
... | JavaScript | 0.999977 | @@ -441,16 +441,29 @@
r dir =
+path.resolve(
path.dir
@@ -491,16 +491,17 @@
.sep)%5B0%5D
+)
;%0A //
@@ -1490,24 +1490,29 @@
ame,'../');%0A
+ %0A
// Absol
@@ -1997,17 +1997,16 @@
%0A %7D
-;
%0A %7D);
|
81790b66e758f47eea8385c5fc1436fb00dd75cd | fix conflicts | src/player.js | src/player.js | const Provider = require('./provider');
const LoopMode = require('./loop_mode');
const State = require('./state');
const Speaker = require('./speaker');
module.exports = class Player {
constructor(playlist, playerStatus, ev) {
this.playlist = playlist;
this.status = playerStatus;
this.ev = ev;
this.s... | JavaScript | 0.000112 | @@ -870,15 +870,12 @@
his.
-destroy
+stop
();%0A
|
c5b1d3601d1e0821f83fe93291e63a2754d47c17 | Allow "once:" prefix before events | src/player.js | src/player.js | export default function Player(context, properties, x=0, y=0, pathfind) {
let self = this;
let options = properties;
options.tileWidth = options.tileWidth || 32;
options.tileHeight = options.tileHeight || 32;
options.movementFrameCount = options.movementFrameCount || 8;
options.framesPerDirection = options.... | JavaScript | 0.999999 | @@ -1213,143 +1213,493 @@
let
-handlers = %7B%7D;%0A this.on = (event, handler) =%3E %7B%0A if (!handlers%5Bevent%5D) %7B%0A handlers%5Bevent%5D = %5B%5D;%0A %7D%0A
+once = function (event, id, handler) %7B%0A return function () %7B%0A handler.apply(this.arguments);%0A self.off(event, id);%0A... |
3a720e7fa2a4ed05b8fdb9f3e18422b4ad414351 | Call Plugin#initialize with this instance | src/plugin.js | src/plugin.js | Libretto.Plugin = class {
constructor() {
window.addEventListener('load', this.initialize);
}
initialize() {
}
};
| JavaScript | 0 | @@ -37,16 +37,37 @@
tor() %7B%0A
+ let that = this;%0A
wind
@@ -98,23 +98,57 @@
d',
-this.initialize
+() =%3E %7B%0A that.initialize().call(that);%0A %7D
);%0A
|
477cfddd972c8250ab681940dc924e0ec976f7e9 | replace child_process.exec() with dns.resolve() | index.js | index.js | 'use strict'
let exec = require('child_process').exec
let stream = require('stream')
function ipfreely (siteList) {
let readStream = new stream.Readable()
readStream._read = function () {} // no op
siteList.forEach((site) => {
exec(`dig +short ${site}`, (err, output) => {
if (err) {
readStrea... | JavaScript | 0.001152 | @@ -11,20 +11,23 @@
t'%0A%0Alet
-exec
+resolve
= requi
@@ -34,28 +34,21 @@
re('
-child_process').exec
+dns').resolve
%0Alet
@@ -233,41 +233,28 @@
-exec(%60dig +short $%7B
+resolve(
site
-%7D%60
, (err,
outp
@@ -249,21 +249,21 @@
, (err,
-outpu
+ipLis
t) =%3E %7B%0A
@@ -325,17 +325,16 @@
%7D%0A... |
c820dc04ab506bdca88e6504ee9e7e8adaa0c7af | disable calls do crud | test-crud.js | test-crud.js | M.wrap('github/jillix/bind-form/dev/test-crud.js', function (require, module, exports) {
var templateName = 'crudTest';
var data = {
template: {
t: '_template',
d: {
db: 'dms',
collection: templateName,
name: 'Crud Test',
schema: {
... | JavaScript | 0.000002 | @@ -970,16 +970,18 @@
%0A
+//
crud.cal
|
0a3653217056fc032b5e85ad9393bc77a44056e4 | Use a simple foor loop instead of .find to avoid using a polyfill | src/prefix.js | src/prefix.js | /**
* Export javascript style and css style vendor prefixes.
* Based on "transform" support test.
*/
import isBrowser from 'is-browser'
let js = ''
let css = ''
// We should not do anything if required serverside.
if (isBrowser) {
const jsCssMap = {
Webkit: '-webkit-',
Moz: '-moz-',
// IE did it wro... | JavaScript | 0 | @@ -358,16 +358,147 @@
-o-'%0A %7D
+%0A%0A // Order matters. We need to check Webkit the last one because%0A // other vendors use to add Webkit prefixes to some properties
%0A const
@@ -522,25 +522,25 @@
', '
-Webkit
+ms
', '
-ms
+O
', '
-O
+Webkit
'%5D%0A%0A
@@ -627,47 +627,92 @@
%0A%0A
-const vendor = pr... |
72af38cbee7a3d9d21428a8d6674bfa95065980c | convert stop names to lower case in hash | transit.js | transit.js | var layout = (function () {
var map = null;
return {
initMap : function () {
var mapDet = {
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('transitMap'), mapDet);
return map;
},
... | JavaScript | 0.999999 | @@ -4327,19 +4327,61 @@
).text()
-%5D =
+.toLowerCase()%5D =%0A
utils.s
|
1c4d42c18d4488e9719e15dbb76f6b030a6fead0 | Replace succeed with complete in res. | index.js | index.js | var ws = require('ws')
, protocol = require('nydus-protocol')
, EventEmitter = require('events').EventEmitter
, util = require('util')
, uuid = require('node-uuid')
, Socket = require('./socket')
, createRouter = require('./router')
module.exports = function(httpServer, options) {
return new NydusServer(... | JavaScript | 0.000001 | @@ -2733,23 +2733,24 @@
unction
-succeed
+complete
(results
@@ -3255,24 +3255,26 @@
n %7B
-succeed: succeed
+complete: complete
, fa
|
a8c568e01a3ae18562075493b940fb72163d9522 | test function name | test/Util.js | test/Util.js | var PF = require('..');
describe('Utility functions', function () {
describe('interpolate', function () {
it('should return the interpolated path', function () {
PF.Util.interpolate(0, 1, 0, 4).should.eql([
[0, 1], [0, 2], [0, 3], [0, 4]
]);
});
});
... | JavaScript | 0.999572 | @@ -1180,38 +1180,40 @@
PF.Util.
-expand
+compress
Path(%5B%0A
@@ -1338,38 +1338,40 @@
PF.Util.
-expand
+compress
Path(%5B%0A
|
7d1bc7f40a027185d8d6a487ab57acb8b8c6822d | change interval config location | index.js | index.js | var express = require('express');
var exphbs = require('express-handlebars');
var config = require('./config.js');
var app = express();
var BME280 = require('node-bme280');
var barometer = new BME280({address: 0x77});
var latestTemp;
var latestPressure;
var latestHumidity;
var latestTime;
var ready = false;
var Datas... | JavaScript | 0 | @@ -988,13 +988,28 @@
fig.
-baroI
+ambientTemperature.i
nter
|
c2a12ef4b873b272edfd53ecec68b30c3430b753 | fix eslint error | test/cert.js | test/cert.js | "use strict";
var assert = require("assert");
var trusted = require("../index.js");
var DEFAULT_RESOURCES_PATH = "test/resources";
var DEFAULT_OUT_PATH = "test/out";
describe("Certificate", function() {
var cert;
var exts;
it("init", function() {
var ext1;
var ext2;
var oid;
... | JavaScript | 0.000005 | @@ -129,43 +129,8 @@
es%22;
-%0Avar DEFAULT_OUT_PATH = %22test/out%22;
%0A%0Ade
|
05074e01cd292aac5bceeaea5a78eec75e307e0d | Remove Timeout | test/core.js | test/core.js | var WebRTC = require('../');
console.log('WebRTC Core Loaded!');
setTimeout(function() {
console.log('Closing now...');
}, 1000);
| JavaScript | 0.000002 | @@ -64,71 +64,26 @@
);%0A%0A
-setTimeout(function() %7B%0A console.log('Closing now...');%0A%7D, 1000);%0A
+WebRTC.setDebug(true);
|
8ea33898734aa25048add59dcbc840c1ccaa16be | handle 1 or many har files | lib/siteHTMLRenderer.js | lib/siteHTMLRenderer.js | /**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
'use strict';
var ySlowUtil = require('./util/yslowUtil'),
util = require('./util/util'),
simplehar = require('simple... | JavaScript | 0 | @@ -2833,16 +2833,100 @@
un = 0;%0A
+%0A result.html = Array.isArray(result.html) ?%0A result.html : %5Bresult.html%5D;%0A%0A
resu
|
e61322ad3a4ea82da9f35c81466c3bde011ad845 | remove no-prefix | index.js | index.js | var postcss = require('postcss')
var properties = require('./properties')
var noPrefix = require('./no-prefix')
var autoprefixer = require('autoprefixer')
var rePrefix = /^-webkit-|^-moz-(osx-)?|^-ms-|^-o-/i
module.exports = postcss.plugin('postcss-unprefix', function() {
//删除重复生成的声明
function removeRepeatDecl(rul... | JavaScript | 0.999998 | @@ -71,46 +71,8 @@
s')%0A
-var noPrefix = require('./no-prefix')%0A
var
|
536ce31531b5663ba48f97631aa60dd6b9288a94 | write tests for validOpts errs | test/errs.js | test/errs.js | 'use strict'
//----------------------------------------------------------
// Modules
//----------------------------------------------------------
// NPM
const assert = require('chai').assert
const sinon = require('sinon')
const faker = require('faker')
// Local
const Multispinner = require('../')
const Spinners = req... | JavaScript | 0 | @@ -246,16 +246,92 @@
'faker')
+%0Aconst clone = require('lodash.clonedeep')%0Aconst kindOf = require('kind-of')
%0A%0A// Loc
@@ -406,24 +406,83 @@
/spinners')%0A
+const defaultProps = require('lib/constants').defaultProps%0A
const states
@@ -979,51 +979,674 @@
rty'
-)%0A it('throw when opt is incorrect type'
+... |
9db3b14699cc38e2616ab47c852a46175830d520 | add tests for ground link | test/gist.js | test/gist.js | describe('Gist', function() {
beforeEach(function() {
gists = document.getElementsByClassName('gist-file');
});
it('are loaded', function() {
expect(gists.length).to.equal(3);
});
context('when language is supported', function() {
beforeEach(function() {
gist = ... | JavaScript | 0 | @@ -19,24 +19,131 @@
unction() %7B%0A
+ before(function(done) %7B%0A setTimeout(function() %7B%0A done();%0A %7D, 1000);%0A %7D);%0A%0A
beforeEa
@@ -560,16 +560,18 @@
it('has
+a
link to
@@ -588,32 +588,142 @@
', function() %7B%0A
+ var link = getGroundsLink();%0A%0A... |
54a1682b2e150d2aa24d7f70c5bf4fc787596ab2 | Handles empty response | test/http.js | test/http.js | "use strict";
describe("http", function () {
it("knows config.httpPort", function () {
assert("object" === typeof config && "number" === typeof config.httpPort);
});
describe("gpf.http", function () {
var baseUrl;
before(function () {
baseUrl = "http://localhost:" + ... | JavaScript | 0.998656 | @@ -1793,32 +1793,301 @@
);%0A %7D);%0A%0A
+ it(%22succeeds when the HTTP response is empty%22, function (done) %7B%0A gpf.http.get(baseUrl + %22content=%22).then(function (response) %7B%0A assert(response.responseText === %22%22);%0A done();%0A %7D)%5B... |
1795029faf8e736e9aea159a71135db7c0840a0d | Update tests | test/http.js | test/http.js | var request = require('supertest');
var expect = require('chai').expect;
process.env.NODE_ENV = 'production';
var app = require('../app');
describe('Test fonts files', function () {
it('responds to /fonts/fontawesome-webfont.svg', function (done) {
request(app)
.get('/fonts/fontawesome-webfont.svg')... | JavaScript | 0.000001 | @@ -1547,501 +1547,8 @@
);%0A%0A
-describe('Test version api', function () %7B%0A it('responds to /api/version', function (done) %7B%0A request(app)%0A .get('/api/version')%0A .expect(200)%0A .end(function(err, res) %7B%0A if (err) return done(err);%0A expect(res.body... |
b876ad74484dac5ac3d4c15088b30c36cc09252f | Add bit module | index.js | index.js | var webduino = require('./src/webduino');
require('setimmediate');
require('./src/core/EventEmitter')(webduino);
require('./src/core/Logger')(webduino);
require('./src/core/util')(webduino);
require('./src/util/promisify')(webduino);
require('./src/core/Transport')(webduino);
require('./src/core/Pin')(webduino);
requ... | JavaScript | 0.000001 | @@ -505,32 +505,70 @@
art')(webduino);
+%0Arequire('./src/board/Bit')(webduino);
%0A%0Arequire('./src
|
1e23f1a1ff92d7221633f877e87eb86acc392d6f | trim resource entry to single line | lib/stream-log-stats.js | lib/stream-log-stats.js | 'use strict'
var Clf = require('common-log-format')
var f = require('function-tools')
var view = require('./view')
var stats = require('./stats')
var JSONStream = require('JSONStream')
var streamVia = require('stream-via')
module.exports = streamLogStats
function streamLogStats (options) {
var throttledRender = f.t... | JavaScript | 0 | @@ -634,28 +634,41 @@
plit%5B0%5D + '
+...
' +
+decodeURI(
requestSplit
@@ -670,16 +670,56 @@
Split%5B1%5D
+.substr(-(process.stdout.columns - 37)))
, logObj
|
33b045d03791827edf77302345cc2bc8d32cf990 | Add USEPL environment variable | index.js | index.js | module.exports = xsd2json;
var childProcess = require('child_process');
var concat = require('concat-stream');
var path = require('path');
// Prolog executable:
var PROLOG = process.env.SWIPL || 'swipl';
var SOURCE = {
// Compiled (qlf) Prolog file, created by `npm run-script create-qlf`:
COMPILED: {
exec: ... | JavaScript | 0.000001 | @@ -986,16 +986,54 @@
compiled
+ %7C%7C process.env.USEPL === 'uncompiled'
) %7B%0A
|
f06c6d027a5bbc7620f80559de58ba0598ae2606 | Add support for negative numbers. | index.js | index.js | 'use strict';
var esprima = require('esprima');
exports.tokenize = tokenize;
exports.parse = parse;
function tokenize (code) {
var list = esprima.tokenize(code, {
comment: true,
loc: true
});
if (list.comment) {
return list;
}
var result = [];
var comments = [];
list.map(function (t) {
... | JavaScript | 0.000001 | @@ -1315,22 +1315,137 @@
%7B%0A
-switch (type()
+var tt = type();%0A var negative = '';%0A if (tt === '-') %7B%0A next();%0A tt = type();%0A negative = '-';%0A %7D%0A switch (tt
) %7B%0A
@@ -1704,16 +1704,27 @@
N.parse(
+negative +
value);%0A
|
189706ee3fa2aaef9b2d365d35378d4246b924cc | rename variable | index.js | index.js | 'use strict';
/**
* INIT VARIABLES
*/
var express = require('express');
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var firebase = require('firebase');
var _ = require('lodash');
require('dotenv').config();
/**
* FIREBASE CONFIG
*/
var config = {
a... | JavaScript | 0.000018 | @@ -143,18 +143,24 @@
p);%0Avar
-io
+socketIO
= requi
@@ -1255,18 +1255,24 @@
id);%0A%0A
-io
+socketIO
.emit('c
@@ -1445,26 +1445,32 @@
, msg);%0A
-io
+socketIO
.emit('read-
@@ -1888,18 +1888,24 @@
%7B%0A
-io
+socketIO
.emit('r
|
9dc14d79850050cae9ec023248d2c6c31debb20a | convert parent test to mocha | lib/tags/parent.test.js | lib/tags/parent.test.js | var testCase = require('nodeunit').testCase,
swig = require('../../index');
exports.parent = testCase({
setUp: function (callback) {
swig.init({
allowErrors: true
});
callback();
},
'basic': function (test) {
swig.compile('{% block foo %}hi{% endblock %}', { filename: 'parent' });
va... | JavaScript | 0.999999 | @@ -1,120 +1,91 @@
var
-testCase = require('nodeunit').testCase,%0A swig = require('../../index');%0A%0Aexports.parent = testCase(%7B%0A setUp:
+swig = require('../../index');%0A%0Adescribe('Tag: parent', function () %7B%0A beforeEach(
func
@@ -90,24 +90,16 @@
nction (
-callback
) %7B%0A
@@ -113,14 +113,8 ... |
a0fa616312a02d19665b8ccf1c1613a3aef76406 | remove debug log from test builder | lib/test/cases/build.js | lib/test/cases/build.js | var fs = require("fs");
//------------------------------------------------------------------------------
// Result Data
//------------------------------------------------------------------------------
function getInitialResult() {
var result = {
cases: [],
currLabel: null, // "in" or "out"
currCase: get... | JavaScript | 0.000001 | @@ -2531,41 +2531,8 @@
) %7B%0A
- console.log(block.cursor);%0A
|
c6e03b8c985647031382875bf260a8948f1a76ed | Fix for interactive mode | src/render.js | src/render.js | pc.render = function() {
// try to autodetect dimensions and create scales
if (!d3.keys(__.dimensions).length) {
pc.detectDimensions()
} else {
//Apply defaults if dimensions was passed
if (Object.keys(__.types).length === 0) {
pc.detectDimensions();
}
pc.dimensions(pc.applyDimensionDefa... | JavaScript | 0 | @@ -270,20 +270,16 @@
ns();%0A
- %7D%0A
pc.d
@@ -340,16 +340,22 @@
ons)));%0A
+ %7D%0A
%7D%0A pc
|
a9ef13df243f8f32c579da9cc289e390323acc6b | Add library class to body. | index.js | index.js | /**
* Features a variety of commonly used widgets, including toolbars, text inputs, checkboxes, groups
* and multiple types of buttons.
*
* @namespace onyx
*/
module.exports.version = "2.6.0-rc.1";
| JavaScript | 0 | @@ -128,17 +128,16 @@
buttons.
-
%0A*%0A* @na
@@ -148,17 +148,16 @@
ace onyx
-
%0A*/%0Amodu
@@ -191,8 +191,66 @@
-rc.1%22;%0A
+%0Avar dom = require('enyo/dom');%0Adom.addBodyClass('onyx');%0A
|
a8db50f2ad69a83dd12d672a43fe2c499e7f76ad | Call diff instead of diffChildren in render.js (+5 B) | src/render.js | src/render.js | import { EMPTY_OBJ, EMPTY_ARR } from './constants';
import { commitRoot } from './diff/index';
import { diffChildren } from './diff/children';
import { createElement, Fragment } from './create-element';
import options from './options';
/**
* Render a Preact virtual node into a DOM element
* @param {import('./index')... | JavaScript | 0 | @@ -68,53 +68,14 @@
Root
- %7D from './diff/index';%0Aimport %7B diffChildren
+, diff
%7D f
@@ -86,24 +86,21 @@
'./diff/
-children
+index
';%0Aimpor
@@ -746,16 +746,8 @@
diff
-Children
(%0A%09%09
@@ -822,16 +822,29 @@
oldVNode
+ %7C%7C EMPTY_OBJ
,%0A%09%09EMPT
@@ -1011,16 +1011,25 @@
mounts,%0A
+%09%09false,%... |
caaa84d7de011f8a94a77b188f4391a6c5c7e67d | Fix typo. | lib/tooltip/delegate.js | lib/tooltip/delegate.js | /* @flow */
import { CompositeDisposable, Emitter } from 'sb-event-kit'
import type { Disposable } from 'sb-event-kit'
export default class TooltipDelegate {
emitter: Emitter;
expanded: boolean;
subscriptions: CompositeDisposable;
showProviderName: boolean;
constructor() {
this.emitter = new Emitter()
... | JavaScript | 0.001604 | @@ -494,16 +494,17 @@
-ui-defa
+u
lt.showP
|
05e557105e41a99269c1d885462c17db87f9ef3b | Add 'scrollEnabled' prop to ScrollableTabView | index.js | index.js | 'use strict';
var React = require('react-native');
var {
Dimensions,
Text,
View,
ScrollView,
TouchableOpacity,
PanResponder,
} = React;
var DefaultTabBar = require('./DefaultTabBar');
var deviceWidth = Dimensions.get('window').width;
var rebound = require('rebound');
var precomputeStyle = require('precomp... | JavaScript | 0 | @@ -1564,16 +1564,17 @@
if
+(
(gesture
@@ -1689,16 +1689,72 @@
itWidth)
+ && %0A this.props.scrollEnabled !== false)
%7B%0A
|
ea6468c4c8bf229b437dd9e0d1de14e301107f38 | Clean up tests slightly. | test/spec.js | test/spec.js | describe('exchange rate tool', function() {
beforeEach(function() {
browser.get('http://localhost:3456');
});
it('should be able to wait only for $http, not $timeout', function() {
var loadButton = element(by.id('load-button'));
var loadStatus = element(by.id('load-status'));
protractor.waitForX... | JavaScript | 0 | @@ -116,83 +116,8 @@
);%0A%0A
- it('should be able to wait only for $http, not $timeout', function() %7B%0A
va
@@ -154,34 +154,32 @@
load-button'));%0A
-
var loadStatus
@@ -205,32 +205,105 @@
oad-status'));%0A%0A
+ it('should be able to wait only for $http, not $timeout', function() %7B%0A
protracto... |
f725de502c95d6d9be6c07483f1afbd8b86fe8a7 | add support for new maki function, exit middleware | index.js | index.js | var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var passportLocalMongoose = require('passport-local-mongoose');
// session handling
var redis = require('redis');
var connectRedis = require('connect-redis');
var session = require('express-session');
var cookieParser = require... | JavaScript | 0 | @@ -3277,32 +3277,61 @@
%7D%0A %0A
+ var plugin = self;%0A
maki.r
@@ -3378,36 +3378,45 @@
eate', function(
+ next ,
done
+
) %7B%0A
@@ -3432,16 +3432,80 @@
= this;%0A
+ console.log('pre-create plugin ' , plugin.config );%0A
@@ -3516,36 +3516,38 @@
... |
50b49395f421338f2f9be1a7ac38492659dea20a | Fix bug when trying to deep extend a string | lib/utils/deepExtend.js | lib/utils/deepExtend.js | export const deepExtend = function(target){
for (var i = 1; i < arguments.length; i++) {
// Copy unique items from incoming array
if (target instanceof Array && arguments[i] instanceof Array) {
for (var j = 0; j < arguments[i].length; j++) {
if (target.indexOf(arguments[i][j]) < 0) {
t... | JavaScript | 0.000001 | @@ -587,16 +587,62 @@
efined'%0A
+ && typeof target%5Bprop%5D === 'object'%0A
|
cbfc131437f41e60ff00bf9af15a380c6d9369c4 | Remove console.log from tests | test/test.js | test/test.js | /*global after, describe, it */
'use strict';
var assert = require('assert');
var gifsicle = require('../lib/').gifsicle;
var fs = require('fs');
var Imagemin = require('../lib/');
var jpegtran = require('../lib/').jpegtran;
var optipng = require('../lib/').optipng;
var path = require('path');
var rm = require('rimraf... | JavaScript | 0.000002 | @@ -2202,43 +2202,8 @@
) %7B%0A
- console.log(file);%0A
|
0b32cd646c882e73adaa1051baa211f948d1fd21 | Rename to not confuse with the log method | src/router.js | src/router.js | import express from 'express'
import bodyParser from 'body-parser'
import xmlParser from 'express-xml-bodyparser'
import log from './logging'
import _ from 'lodash/fp'
export default (opts) => {
const router = express.Router()
router.use(function saveRawBody (req, res, next) {
req.rawBody = ''
req.on('data... | JavaScript | 0.000003 | @@ -117,16 +117,23 @@
port log
+Request
from '.
@@ -1195,16 +1195,23 @@
%0A log
+Request
(err, re
@@ -1347,16 +1347,23 @@
log
+Request
(null, r
|
de98851ba96d48d80c9944264c87f86209e32e9d | Remove redundant methods from bottom-tab | lib/views/bottom-tab.js | lib/views/bottom-tab.js | "use strict";
class BottomTab extends HTMLElement{
initialize(Content, onClick){
this._active = true
this._count = 0
this.innerHTML = Content
this.classList.add('linter-tab')
this.countSpan = document.createElement('span')
this.countSpan.classList.add('badge')
this.countSpan.classList.ad... | JavaScript | 0.000001 | @@ -80,53 +80,8 @@
k)%7B%0A
- this._active = true%0A this._count = 0%0A%0A
@@ -467,52 +467,8 @@
%7D%0A
- get active()%7B%0A return this._active%0A %7D%0A
se
@@ -624,50 +624,8 @@
%7D%0A
- get count()%7B%0A return this._count%0A %7D%0A
se
|
5a86405d04cf2e98444648f9fc5adb378f090b6d | Support arbitrary default meta values. | lib/winston-logstash.js | lib/winston-logstash.js | /*
*
* (C) 2013 Jaakko Suutarla
* MIT LICENCE
*
*/
var net = require('net'),
util = require('util'),
os = require('os'),
tls = require('tls'),
fs = require('fs'),
winston = require('winston'),
common = require('winston/lib/winston/common');
var ECONNREFUSED_REGEXP = /ECONNREFUSED/;
var L... | JavaScript | 0 | @@ -1152,16 +1152,318 @@
e %7C%7C '';
+%0A this.meta_defaults = options.meta %7C%7C %7B%7D;%0A %0A // We want to avoid copy-by-reference for meta defaults, so make sure it's a flat object.%0A for (var property in this.meta_defaults) %7B%0A if (typeof this.meta_defaults%5Bproperty%5D === 'object') %7B%0A ... |
8bc53fe393f85ae1ee8d437389c8463dec0eab61 | Fix previous URL in IE | src/router.js | src/router.js | /* UMD.define */ (function (root, factory) {
if (typeof customLoader === 'function'){ customLoader(factory, 'router'); }
else if (typeof define === 'function' && define.amd){ define([], factory); }
else if(typeof exports === 'object'){ module.exports = factory(); }
else{ root.returnExports = factory();
... | JavaScript | 0.000034 | @@ -827,99 +827,133 @@
//
-console.log('hashchange', event);%0A // IE does not have URLs in the event
+ IE does not have URLs in the event, so use previous%0A var prev = router.current ? router.current.url : '';
%0A
@@ -1022,20 +1022,12 @@
ef,
+pr
ev
-ent.oldURL
));%0A
@... |
2de4080254b598223e22830aa140a15ae4ce612f | Test text response | test/test.js | test/test.js | require('mocha');
var stream = require('stream');
var should = require('should-promised');
var expect = require('expect');
var sinon = require('sinon');
global.Promise = require('es6-promise').Promise;
global.fetcher = require('../');
global.Headers = require('node-fetch/lib/headers');
global.Response = require('no... | JavaScript | 0.000013 | @@ -4506,73 +4506,596 @@
);%0A%0A
-/*%0A * Cases%0A * response text%0A * response form-data encoded string
+it(%22Response text without Content-Type%22, function () %7B%0A var data = %7Bbcd: 456%7D;%0A var body = new stream.PassThrough();%0A var res = new Response(%0A body,%0A %7B%0A url: '/',%0A st... |
cb5abce6381cc63bf56c7f23548be19440de5343 | add test for 14.0 support | test/test.js | test/test.js | require('chai').should()
var emoji = require('../')
describe('react-easy-emoji', () => {
it ('should work', () => {
var elements = emoji('This is really 😄')
elements.should.have.lengthOf(2)
elements[0].should.equal('This is really ')
var element = elements[1]
element.type.should.equal('img')
element.p... | JavaScript | 0 | @@ -919,11 +919,274 @@
key)%0A%09%7D)
+%0A%0A%09it ('should support emoji 14', () =%3E %7B%0A%09%09var element = emoji('%F0%9F%AB%A0')%0A%09%09element.should.have.lengthOf(1)%0A%09%09element%5B0%5D.type.should.equal('img')%0A%09%09element%5B0%5D.props.alt.should.equal('%F0%9F%AB%A0')%0A%09%09element%5B0%5D.props.src.s... |
82d7b5281a8d815f96b9d084ec10a9540e9fad95 | fix spelling error in routes.js | src/routes.js | src/routes.js | import React from 'react';
import { Route, IndexRoute, Redirect } from 'react-router';
import CounterView from './containers/Counter/counterView';
import HelloRoutes from './containers/Hello/HelloRoutes';
import CoreLayout from './layouts/coreLayout';
export default (
<Route path="/" component= { CoreLayout } >
... | JavaScript | 0.000003 | @@ -233,17 +233,17 @@
layouts/
-c
+C
oreLayou
|
735136f78cb40b67af780e18802b59c783121dee | Declare d | test/test.js | test/test.js | var test = require('tape');
var deltaify = require('../');
test('Default values', function(t) {
t.plan(5);
var i = 0;
var f = deltaify(function(delta) {
t.ok(Number.isFinite(delta));
if ((++i) === 5) {
clearInterval(d);
}
});
var d = setInterval(f, 100);
});
| JavaScript | 0.004111 | @@ -103,16 +103,25 @@
lan(5);%0A
+ var d;%0A
var i
@@ -260,20 +260,16 @@
%7D);%0A%0A
-var
d = setI
|
67ab8c862adc60f40af1fe32125efed8021321de | Fix path | test/test.js | test/test.js | var assert = require("assert");
var scraper = require('google-scraper');
var options = {
keyword : "javascript",
language : "en",
results : 100
};
var scrape = new scraper.GoogleScraper(options);
describe('getGoogleLinks()', function(){
it('There are links', function(done){
scrape.getGoogleLinks(func... | JavaScript | 0.000018 | @@ -53,22 +53,19 @@
re('
-google-scraper
+../index.js
');%0A
@@ -279,17 +279,16 @@
(done)%7B%0A
-%0A
scra
@@ -330,18 +330,16 @@
k)%7B%0A
-
%09var val
@@ -382,16 +382,18 @@
false);%0A
+
%09%09assert
@@ -413,12 +413,13 @@
');%0A
+
%09
-%09
done
@@ -427,13 +427,14 @@
);%0A%09
+
%7D);%0A
-%0A... |
fde198097bdf3e45692ef6ebaa1175e36b24cc34 | fix resolved relative urls for windows | index.js | index.js | var fs = require('fs');
var path = require('path');
var url = require('url');
var reduceFunctionCall = require('reduce-function-call');
var mkdirp = require('mkdirp');
var postcss = require('postcss');
var chalk = require('chalk');
module.exports = postcss.plugin('postcss-assets-rebase', function(options) {
return f... | JavaScript | 0 | @@ -3497,24 +3497,118 @@
Contents);%0A%0A
+%09if (path.sep === '%5C%5C') %7B%0A%09%09relativeAssetsPath = relativeAssetsPath.replace(/%5C%5C/g, '%5C/');%0A%09%7D%0A%0A
%09return comp
|
ae1d8f28ce9a2cccc9feda9d4a6545c29bd2be83 | Disable imagenet | index.js | index.js | require('dotenv').config();
process.on('unhandledRejection', (error) => {
console.error(error);
});
const {RtmClient, WebClient, CLIENT_EVENTS} = require('@slack/client');
const plugins = [
require('./mahjong'),
require('./pocky'),
require('./esolang-rankmaker'),
require('./emoji-notifier'),
require('./sushi-b... | JavaScript | 0.000002 | @@ -316,24 +316,27 @@
shi-bot'),%0A%09
+//
require('./i
|
545563c77ba2cb3bc7eea426454bb1483375f7dc | Fix video unit test | common/lib/xmodule/xmodule/js/spec/video/video_quality_control_spec.js | common/lib/xmodule/xmodule/js/spec/video/video_quality_control_spec.js | (function() {
describe('VideoQualityControl', function() {
var state, videoControl, videoQualityControl, oldOTBD;
function initialize() {
loadFixtures('video.html');
state = new Video('#example');
videoControl = state.videoControl;
videoQualityControl = state.videoQualityControl;
... | JavaScript | 0.000003 | @@ -1194,16 +1194,20 @@
itle=%22HD
+ off
%22 ' +%0A
@@ -1293,16 +1293,20 @@
'%3EHD
+ off
%3C/a%3E'%0A
|
3e0da99040e30807cd84625d8c844cafcbdf247e | Fix issue-426: Add the test for fsPromises.readdir when the path exists, and is a directory (#452) | tests/spec/fs.readdir.spec.js | tests/spec/fs.readdir.spec.js | var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.readdir', function() {
beforeEach(util.setup);
afterEach(util.cleanup);
it('should be a function', function() {
var fs = util.fs();
expect(fs.readdir).to.be.a('function');
});
it('should return an error if... | JavaScript | 0 | @@ -1493,24 +1493,816 @@
%7D);%0A %7D);
+%0A%0A it('(promise) should be a function', function() %7B%0A var fsPromises = util.fs().promises;%0A expect(fsPromises.readdir).to.be.a('function');%0A %7D);%0A %0A it('(promise) should return a list of files from an existing directory', function() %7B%0A var ... |
82c76f8355d1eb558917183e0aa28529bf3355ff | correct variable name | modules/background/api/configHelper.js | modules/background/api/configHelper.js | import Promise from 'bluebird';
import path from 'path';
let fs = Promise.promisifyAll(require('fs'));
const configHelper = () => {
let config = 'config/app_configuration.min.JSON'
let innerRepresentation;
const getData = () => {
if(!innerRepresentation || innerRepresentation.changed) {
return fs.re... | JavaScript | 0.99653 | @@ -356,20 +356,16 @@
, config
-Name
), 'utf8
|
2d3eb710e5d90db5015ffa44676d338e993368b7 | Move FriendlyErrorsWebpackPlugin from if-statement | build-tools/config/webpack/webpack.conf.dev.js | build-tools/config/webpack/webpack.conf.dev.js | const detectPort = require('detect-port');
const opn = require('opn');
const config = require('../config');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
const { DEVELOPMENT } = config.buildTypes;
module.exports = detectPort(config.devServer.port).then(port => {
const devWebpackConf... | JavaScript | 0.000001 | @@ -572,19 +572,21 @@
=%3E %7B%7D);%0A
-%0A
+%7D%0A%0A
// not
@@ -650,18 +650,16 @@
he port%0A
-
devWeb
@@ -687,18 +687,16 @@
sh(%0A
-
-
new Frie
@@ -727,18 +727,16 @@
%7B%0A
-
compilat
@@ -761,18 +761,16 @@
-
-
messages
@@ -773,18 +773,16 @@
ages: %5B%0A
-
@@ -... |
af65cdf46f735cca9364b5e1427ed18e0acbbcff | fix compilation issue | server/webapp/javascripts/custom_tree_view.js | server/webapp/javascripts/custom_tree_view.js | /*************************GO-LICENSE-START*********************************
* Copyright 2014 ThoughtWorks, Inc.
*
* 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
*
* http://www.apache... | JavaScript | 0 | @@ -1498,16 +1498,20 @@
package
+Name
= $j(th
@@ -1580,16 +1580,20 @@
(package
+Name
.indexOf
|
cf48d882e430da399489cb6913fc6c6ea9b65c7a | enable await-related rules for Node 8 | config/rules/node-8.js | config/rules/node-8.js | 'use strict';
module.exports = {
"rules": {
"no-await-in-loop": "off",
"no-return-await" : "off",
"require-await" : "off"
}
};
| JavaScript | 0 | @@ -46,112 +46,8 @@
: %7B%0A
- %22no-await-in-loop%22: %22off%22,%0A %22no-return-await%22 : %22off%22,%0A %22require-await%22 : %22off%22%0A
|
678de9e5fa7e29deeda9ba08a5fe11ea0d51d5a0 | enable socket.io | example/client/app/app.js | example/client/app/app.js | /*global angular*/
angular.module('app', [
'ngRoute',
'ngAnimate',
'ui.bootstrap',
'app.includes',
'blog',
'enterprise',
'home',
'session',
'translation',
'modalExample',
'diagrams',
'hljs'
])
.constant('USE_SOCKET',... | JavaScript | 0.000001 | @@ -318,12 +318,11 @@
T',
-fals
+tru
e)%0A
|
8f2ca23c727e70c6a402a5ab5ba26a981e8d4066 | Remove unnecessary fluff from dialogue end state's tests | go/base/static/js/test/tests/campaign/dialogue/states/end.test.js | go/base/static/js/test/tests/campaign/dialogue/states/end.test.js | describe("go.campaign.dialogue.states.choice", function() {
var testHelpers = go.testHelpers,
oneElExists = testHelpers.oneElExists,
noElExists = testHelpers.noElExists;
var dialogue = go.campaign.dialogue,
states = go.campaign.dialogue.states;
var setUp = dialogue.testHelpers.setUp,
tea... | JavaScript | 0.000152 | @@ -57,133 +57,8 @@
) %7B%0A
- var testHelpers = go.testHelpers,%0A oneElExists = testHelpers.oneElExists,%0A noElExists = testHelpers.noElExists;%0A%0A
va
|
649c6a2bf4bc94320350be6aacf9b9d40676ac5e | remove unused var | rating.js | rating.js | /**
* Variable Star Rating
*
* ver 0.4.0
*
* (c) Vitalii Omelkin, 2015, 2016
* Licensed under the MIT License
*
*/
;(function(){
var rating = angular.module('stars', []);
/**
* Demo controllers
* ----------------
*/
rating.controller("starsController", function ($scope) {
//... | JavaScript | 0.000002 | @@ -5928,42 +5928,8 @@
nt;%0A
- var starEls = %5B%5D;%0A
|
932c63605c911c765ab77423e04f0970367ade39 | Change the way the Remapping abstraction works | rebase.js | rebase.js | const {Remapping, Transform} = require("../transform")
function rebaseSteps(doc, forward, steps, maps) {
let remap = new Remapping([], forward.slice())
let transform = new Transform(doc)
let positions = []
for (let i = 0; i < steps.length; i++) {
let step = steps[i].map(remap)
let result = step && tra... | JavaScript | 0 | @@ -131,27 +131,72 @@
ing(
-%5B%5D, forward.slice()
+maps.map(m =%3E m.invert()).reverse().concat(forward), maps.length
)%0A
@@ -389,51 +389,23 @@
-let id = remap.addToFront(maps%5Bi%5D.invert())
+remap.mapFrom--
%0A
@@ -450,16 +450,16 @@
ap.a
-ddToBack
+ppendMap
(ste
@@ -474,10 +474,21 @@
(),
-id
+re... |
2833eee51b2e706c33fdd6491d774fe80a21adf8 | Send data from the server | api/collab.js | api/collab.js | exports.init = function () {
debugger
}
| JavaScript | 0 | @@ -26,19 +26,141 @@
) %7B%0A
- debugger
+%7D;%0A%0Aexports.clientConnectedServer = function (link) %7B%0A setInterval(function () %7B%0A link.send(null, new Date());%0A %7D, 500);
%0A%7D
+;
%0A
|
7bb00dbc6d0b1993874533dbe95b7d310ece22f6 | make protractor builds more reliable? | config/protractor.conf.js | config/protractor.conf.js | exports.config = {
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:8080',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
},
specs: [ '../src/**/*.e2e.spec.js' ]
};
if (process.env['TRAVIS']) {
exports.config.sauceUser = process.env['SAUCE_USERNAME'... | JavaScript | 0 | @@ -443,295 +443,47 @@
': '
-firefox'%0A %7D, %7B%0A 'browserName': 'chrome'%0A %7D, %7B%0A 'browserName': 'internet explorer',%0A 'version': '11'%0A %7D, %7B%0A 'browserName': 'internet explorer',%0A 'version': '10'%0A %7D, %7B%0A %22browserName%22: %22safari%22,%0A %22version%22: %227%22%0A ... |
0413757e3be3648d68630eb3cb2523de24c96877 | Register notOk as a non-negative assertion | src/assert.js | src/assert.js | function Assert( testContext ) {
this.test = testContext;
}
// Assert helpers
QUnit.assert = Assert.prototype = {
// Specify the number of expected assertions to guarantee that failed test
// (no assertions are run at all) don't slip through.
expect: function( asserts ) {
if ( arguments.length === 1 ) {
this... | JavaScript | 0.999999 | @@ -2563,38 +2563,32 @@
, false, message
-, true
);%0A%09%7D,%0A%0A%09equal:
|
ce573c22cf13dafd9d375eb3a72faf95ec1395cc | Fix a deployment issue | shipitfile.js | shipitfile.js | require('dotenv').config();
module.exports = shipit => {
shipit.initConfig({
production: {
servers: process.env.SHIPIT_PRODUCTION_SERVER,
dir: process.env.SHIPIT_PRODUCTION_DIR,
},
});
const dockerApp = 'sudo docker-compose exec app ';
function options() {
... | JavaScript | 0 | @@ -581,21 +581,8 @@
tall
- --production
', o
|
48cd943605898a8df68fe21bf2f52274de8d78d2 | add solution | Algorithms/JS/arrays/longestCommonSubstring.js | Algorithms/JS/arrays/longestCommonSubstring.js | longestCommonSubstring.js
| JavaScript | 0.000003 | @@ -1,26 +1,1402 @@
-longestCommonSubstring.js
+// Write a function to find the longest common prefix string amongst an array of strings.%0A%0Avar longestCommonPrefix = function(strs) %7B //120 ms runtime%0A if(strs.length %3C 1) return %22%22;%0A var sortedArr = strs.sort(),%0A a1 = sortedArr%5B0%5D,%0A ... |
5468fba9952929c56322b93b03b131d7f831dc7c | bump version | version.js | version.js | module.exports = '2018-05-09';
| JavaScript | 0 | @@ -23,9 +23,9 @@
-05-
-09
+18
';%0A
|
d85798ccd0a44e5df34b0a2be31924cba87be2e3 | Update index.js | 4/js/index.js | 4/js/index.js | $('body')
.on('click', '.vimeo-launch', function () {
var videoID = $(this).data('vimeo-id'),
$video = '<div id="vimeo-pop-container"><div><span class="vimeo-close"></span><iframe src="http://player.vimeo.com/video/' + videoID + '/?title=1&byline=1&portrait=0&autoplay=1" width="90%" height="90%" fra... | JavaScript | 0.000002 | @@ -67,32 +67,17 @@
D =
-$(this).data('vimeo-id')
+121500937
,%0A
|
80e7e987ad7c21985a4af1930569749d0a13462a | prepare for fadeIn animation logic | monitor.js | monitor.js |
var tessel = require('tessel');
var ambientlib = require('ambient-attx4');
var Neopixels = require('neopixels');
var ambient = ambientlib.use(tessel.port['A']);
var neo = new Neopixels();
var SOUND_TRIGGER = 0.1;
var vals = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0... | JavaScript | 0 | @@ -380,19 +380,18 @@
E_IN = 1
-0
;%0A
+
var END_
@@ -1367,16 +1367,19 @@
M_FRAMES
+*10
)));%0A %7D
@@ -1485,33 +1485,16 @@
ames) %7B%0A
- var trail = 5;%0A
var ar
@@ -1678,18 +1678,18 @@
3%5D = 0x
-11
+00
;//vals%5B
@@ -1735,18 +1735,18 @@
1%5D = 0x
-22
+11
;%0A
@@ -1764,18 +1764,18 @@
2%5D = ... |
51ab0478f9019f196ca4c1601e7b91d0cf993956 | rename title of help to Information about the page | util/tips.js | util/tips.js | define([
'src/util/api',
'./yamlParser',
'src/util/ui',
'src/util/versioning'
], function (API, yamlParser, UI, Versioning) {
let tipsURL = 'https://docs.cheminfo.org/tips/';
let pagesURL = 'https://docs.cheminfo.org/pages/';
let minDelayBetweenTips = 4 * 3600 * 1000;
async function getViewInfo() {
... | JavaScript | 0 | @@ -3080,38 +3080,50 @@
00, title: '
-Did you know ?
+Information about the page
' %7D%0A );
@@ -3575,16 +3575,33 @@
e: '
-Userguid
+Information about the pag
e' %7D
|
9010c29c47bd9b3166cc84dd29778ce367f3df4d | test add log statement | public/prototype/js/factionsController.js | public/prototype/js/factionsController.js | (function(){
angular
.module("RiskLegacyHCI")
.controller("FactionsController", FactionsController);
function FactionsController($scope, $rootScope) {
$scope.factions = {};
$scope.factionNames = [];
$scope.update = update;
$scope.update();
function update() {
va... | JavaScript | 0.000001 | @@ -276,24 +276,51 @@
.update();%0A%0A
+ %09console.log(%22here%22);%0A%0A
%09functio
|
5ecca46e40f56fbec3f908d2db22d8a2e12c0d57 | Add finalUrl field to GM_xmlhttpRequest details object | src/chrome/chromeFiles/content/xmlhttprequester.js | src/chrome/chromeFiles/content/xmlhttprequester.js |
function GM_xmlhttpRequester(unsafeContentWin, chromeWindow) {
this.unsafeContentWin = unsafeContentWin;
this.chromeWindow = chromeWindow;
}
// this function gets called by user scripts in content security scope to
// start a cross-domain xmlhttp request.
//
// details should look like:
// {method,url,onload,one... | JavaScript | 0 | @@ -3700,16 +3700,84 @@
usText :
+ ''),%0A finalUri:(req.readyState == 4 ? req.channel.URI.spec :
'')%0A
|
29749a04a0424117706e75fafb5f34c5b6cabf92 | Fix performance issue | src/scopes.js | src/scopes.js | 'use strict';
var _ = require('lodash');
var applyScope = function (_this, applier) {
return function (qb) {
var tempStatements = qb._statements.slice();
// Apply scope
applier.call(_this, qb);
// Find added statements
qb._statements.filter(function (statement) {
return !tempStatements.s... | JavaScript | 0.000011 | @@ -242,109 +242,52 @@
-qb._statements.filter(function (statement) %7B%0A return !tempStatements.some(_.matches(statement));
+_.difference(qb._statements, tempStatements)
%0A
@@ -321,18 +321,16 @@
nts%0A
-%7D)
.forEach
@@ -413,16 +413,17 @@
;%0A %7D)
+;
%0A %7D;%0A%7D%0A
|
19b877113e29483c7504730530ad12bd8f24a579 | handle singular/plural for unset winner confirmation message | candidates/static/js/constituency.js | candidates/static/js/constituency.js | /* Javascript for the constituency page, dealing with:
- Popping up the source attribution boxes
- Hiding or revealing the the new candidate form
*/
$(function() {
/* If Javascript's enabled, hide the source-confirmation
boxes and the add new candidate form. */
$('.source-confirmation-standing').hide()... | JavaScript | 0 | @@ -2696,51 +2696,165 @@
-message;%0A
+electedCount=electedCandidates.length,%0A text,%0A
+
message
- = interpolate(gettext(
+;%0A text = ngettext(%22Are you sure that you want to unset one winner?%22,%0A
%22Are
@@ -2902,17 +2902,16 @@
inners?%22
-)
,%0A
@@ -2916,17 +... |
d01910092ab73567b15a34a8ce4f5948b76e94c5 | Fix frontend tests | frontend/app/services/demography.js | frontend/app/services/demography.js | import Service from '@ember/service';
export default Service.extend({
genders: null,
ageGroups: null,
ageGroupLabels: null,
init() {
this._super(...arguments);
this.set('genders', ['male', 'female', 'other']);
let groupRange = Array.from({length: 20}, (v, i) => {
return [i*5, (i*5)+4];
... | JavaScript | 0.000047 | @@ -356,15 +356,25 @@
nge.
+slice(0); //
copy
-();
%0A
|
bad26bcd3b200079f6575e01eb6987eb57e00d8c | test mongod | api/config.js | api/config.js | module.exports = {
port: process.env.PORT || 3000,
db: process.env.MONGODB || 'mongodb://localhost:27017/blog'
};
| JavaScript | 0.000007 | @@ -90,22 +90,53 @@
b://
-localhost:2701
+info@jodiehag.com:Mcgrady13@fierce-bayou-3434
7/bl
|
cc27aec6d6a5823ef2e9be40f6fc160bed5c7b00 | Fix inconsistent scrollTop calculation in Firefox | rellax.js | rellax.js |
// ------------------------------------------
// Rellax.js - v1.0.0
// Buttery smooth parallax library
// Copyright (c) 2016 Moe Amaya (@moeamaya)
// MIT license
//
// Thanks to Paraxify.js and Jaime Cabllero
// for parallax concepts
// ------------------------------------------
(function (root, factory) {
if (type... | JavaScript | 0.000099 | @@ -3821,16 +3821,77 @@
center ?
+ (window.pageYOffset %7C%7C document.documentElement.scrollTop %7C%7C
documen
@@ -3906,16 +3906,17 @@
crollTop
+)
: 0;%0A%0A
|
0fbe11313423e380077be91c8c97860973c43176 | Update version string to 2.5.2-pre.3 | version.js | version.js | if (enyo && enyo.version) {
enyo.version["enyo-ilib"] = "2.5.2-pre.2";
}
| JavaScript | 0.000001 | @@ -61,14 +61,14 @@
5.2-pre.
-2
+3
%22;%0A%7D%0A
|
ea58234139837d210e21bd27837001b89f7af0cf | Update loops-iterables.js | Assignments/js-fundamentals/loops-iterables.js | Assignments/js-fundamentals/loops-iterables.js | /**
* PART 0
*
* Write a function that calculates the sum of all the numbers in an array
*/
console.assert(sumOfArray([1, 2]) === 3);
console.assert(sumOfArray([]) === 0);
console.assert(sumOfArray([1, 2, 3]) === 6);
console.assert(sumOfArray([10, 9, 8]) === 27);
// PART 1
// Write a function maxOfArray() that... | JavaScript | 0 | @@ -504,17 +504,17 @@
ert(isNa
-n
+N
(maxOfAr
|
ecdd9be70dfd66e0c4224584faea0df50799f4f8 | remove redundant log | tasks/mutation-testing-nodeunit.js | tasks/mutation-testing-nodeunit.js | 'use strict';
var CopyUtils = require('../utils/CopyUtils'),
path = require('path'),
_ = require('lodash'),
nodeunit = require('nodeunit'),
TestStatus = require('../lib/TestStatus'),
log4js = require('log4js'),
logger = log4js.getLogger('mutation-testing-nodeunit'),
Promise = require('blueb... | JavaScript | 0.000081 | @@ -5440,41 +5440,8 @@
) %7B%0A
- logger.error(error);%0A
|
623294cf89ed8aae5a24f795fc4efc0ef11d92eb | Add thunkDispatcher to usePageReducer | src/hooks/usePageReducer.js | src/hooks/usePageReducer.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { useReducer, useCallback, useMemo } from 'react';
import getReducer from '../pages/dataTableUtilities/reducer/getReducer';
import getColumns from '../pages/dataTableUtilities/columns';
import getPageInfo from '../pages/dataTableUtilities/pageInf... | JavaScript | 0 | @@ -1584,16 +1584,145 @@
%0A %7D);%0A%0A
+ const thunkDispatcher = action =%3E %7B%0A if (typeof action === 'function') action(dispatch, state);%0A dispatch(action);%0A %7D;%0A%0A
const
@@ -1762,24 +1762,31 @@
ebounce(
-d
+thunkD
ispatch
+er
, deboun
@@ -1863,24 +1863,31 @@
ebounce(
-d
+thunkD
ispatc... |
e86e40e4df5b08245f392305d10f3b7da8557bd6 | Create album feature genre picker update | client-app/src/album/CreateAlbumForm.js | client-app/src/album/CreateAlbumForm.js | import React from 'react';
import axios from 'axios';
import GenreFormItem from './GenreFormItem';
class CreateAlbumForm extends React.Component {
constructor(props) {
super(props);
this.state = {
name: '',
artist: '',
genres: [],
releaseDate: new D... | JavaScript | 0 | @@ -3543,32 +3543,125 @@
%7D)%7D%0A
+ %3Cbutton type=%22button%22 onClick=%7Bthis.setGenresToState%7D%3EUpdate Genres%3C/button%3E%0A
%3C/la
|
bbb9585c7bf723e3e20dfc0790e0f7e2f1c3b273 | Add Mock Database | data/database.js | data/database.js | /**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
// Model type... | JavaScript | 0 | @@ -1,336 +1,14 @@
-/**%0A * Copyright (c) 2015, Facebook, Inc.%0A * All rights reserved.%0A *%0A * This source code is licensed under the BSD-style license found in the%0A * LICENSE file in the root directory of this source tree. An additional grant%0A * of patent rights can be found in the PATENTS file in the sa... |
30ca4af6d88f9977489a38a56365f4165fe2dc26 | Allow library build to work with Typescript | config/webpack.library.js | config/webpack.library.js | const path = require("path");
const webpack = require("webpack");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
module.exports = {
node: {
// Consider suggesting jsmediatags use: https://github.com/feross/is-buffer
// Cuts 22k
... | JavaScript | 0 | @@ -207,16 +207,65 @@
rts = %7B%0A
+ resolve: %7B%0A extensions: %5B%22.js%22, %22.ts%22%5D%0A %7D,%0A
node:
@@ -537,17 +537,20 @@
est: /%5C.
-j
+%5Btj%5D
s$/,%0A
|
8870942df5207343b1890032d50421232d9ae1b7 | Set up better pseudocode | NestedAccordion/js/scripts.js | NestedAccordion/js/scripts.js | /**
GOAL- Create a nested accordian website
* Click on a `Header` and have a new block of text open up.
* If you click again, the "accordian" will close"
* If you click it again, the accordion closes
TODO
* Establish a connection between js and html page
-Run test like `alert` to see if link was established.
* Con... | JavaScript | 0.001478 | @@ -1,352 +1,38 @@
/
-**%0AGOAL- Create a nested accordian website%0A* Click on a %60Header%60 and have a new block of text open up.%0A* If you click again, the %22accordian%22 will close%22%0A* If you click it again, the accordion closes%0A%0ATODO%0A* Establish a connection between js and html page%0A -Run test li... |
42ae6deda4db46f65b119ad54590abdd8cd359cd | Make footnotes in the footnote example non-draggable | example/footnote/index.js | example/footnote/index.js | // schema{
import {schema} from "prosemirror-schema-basic"
import {Schema} from "prosemirror-model"
const footnoteSpec = {
group: "inline",
content: "inline*",
inline: true,
draggable: true,
// This makes the view treat the node as a leaf, even though it
// technically has content
atom: true,
toDOM: ()... | JavaScript | 0.000008 | @@ -178,27 +178,8 @@
ue,%0A
- draggable: true,%0A
//
|
e4aa37372fef588bdd6cf797a4ab6f5200ab9b4e | add unanswered boosted posts that are not expired to priority zone detection | www/js/services/activity/activity-model.js | www/js/services/activity/activity-model.js | angular.module('app.services').factory('ActivityModel',
function (JsModel, groups, $http, follows, ActivityRead, iStorage) {
return JsModel.extend({
labels: {
question: 'Question',
petition: 'Petition',
'leader-news': 'News',
'leader-event': 'Event',
'micro-petition': ... | JavaScript | 0 | @@ -3863,105 +3863,354 @@
is
-InPriorityZone: function() %7B%0A if(this.isUserPetitionType())%7B%0A return(this.isUnrea
+Boosted: function()%7B%0A return(this.get('publish_status') == 1)%0A %7D,%0A isExpired: function()%7B%0A this.get('closed')%0A %7D,%0A isInPriorit... |
e9e3ed5c4781d22f6f27f65272e73dd9ce4da72d | Allow a text control to use <pre> formatting. This is great for debugging. Zubair | public/visifile_drivers/controls/label.js | public/visifile_drivers/controls/label.js | function(args) {
/*
is_app(true)
control_type("VB")
display_name("Label control")
description("This will return the label control")
base_component_id("label_control")
load_once_from_file(true)
visibility("PRIVATE")
read_only(true)
properties(
[
{
id: "text",
name: "Text",
... | JavaScript | 0 | @@ -615,32 +615,378 @@
%7D%0A ,%0A
+%0A%0A %7B%0A id: %22use_pre%22,%0A name: %22Use %3Cpre%3E%22,%0A type: %22Select%22,%0A default: false,%0A values: %5B%0A %7Bdisplay: %22False%22, value... |
abc7167b0451ebb43940c9d92d923bfb907590ad | fix tel flares | modules/twilpub/twilpub.controllers.js | modules/twilpub/twilpub.controllers.js | var Message = require('mongoose').model('Message');
var twilio = require('twilio');
exports.voicemessage = function(req, res, next){
var token = process.env.TWILIO_TOKEN;
var header = req.headers['x-twilio-signature'];
var url = process.env.FLARE_URL;
if (twilio.validateRequest(token, header, url, r... | JavaScript | 0.000001 | @@ -259,16 +259,121 @@
ARE_URL;
+%0A var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;%0A%0A //console.log(fullUrl);
%0A%0A if
@@ -412,17 +412,21 @@
header,
-u
+fullU
rl, req.
@@ -476,16 +476,18 @@
nt%22) %7B%0A%0A
+%0A%0A
|
2362b64eba3d7b642aad60776855fc01d75a1473 | use inherited format method | src/bbcode.js | src/bbcode.js | import {MarkupFormatProperties} from './format';
import {AttributeFormatter, MarkupTagFormatter} from './def'
/**
* BBCode Format
*/
export let bbcode_format = new MarkupFormatProperties( 'bbcode', { brackets: ['[', ']'], self_attribute: true } );
/**
* Basic Attribute Formatter
*/
export class BBCodeAttrFormatt... | JavaScript | 0.000046 | @@ -70,22 +70,16 @@
matter,
-Markup
TagForma
@@ -92,19 +92,32 @@
from './
-def
+markup-formatter
'%0A%0A/**%0A
@@ -512,22 +512,16 @@
extends
-Markup
TagForma
@@ -639,184 +639,5 @@
%7D%0A
- %0A format( def, children, attributes )%0A %7B%0A return this.format_markup( def, children, attributes,... |
7187dee1b0d00c41ad45e6b2616faa6d3b4d99e2 | add empty image | client/dist/assets/play.js | client/dist/assets/play.js | var socket = io.connect('http://vader.mapado.com');
function updatePlayer(player) {
if (typeof player === "number") {
var position = player;
var name = ' ';
var avatar = '';
} else {
var position = player.position;
var name = player.name;
var avatar = player... | JavaScript | 0.999666 | @@ -198,16 +198,94 @@
atar = '
+data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
';%0A %7D
|
4d6899bbe86301db3d8508a52fd6fb4e086d621e | fix default ip | example/mobile/app/App.js | example/mobile/app/App.js | 'use strict';
console.disableYellowBox = true;
import React, {
Component
} from 'react-native';
import Meteor from 'react-native-meteor';
import Tabs from './Tabs';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
selectedTab: 0
};
}
componen... | JavaScript | 0.000002 | @@ -385,20 +385,16 @@
%7C '1
-92.168.1.139
+27.0.0.1
')+'
|
ebfc1a554f26222f71571324005192f02d30c513 | fix reference to issue 3 close #3 | test/test.js | test/test.js | var assert = require('assert')
, ldstars = require('..');
describe('ldstars', function(){
describe('rate()', function() {
it('should give no stars if dataset got nothing good', function(){
var s = ldstars.rate({});
assert.deepEqual(s, { ol: false, of: false, re: false, uri:false, ld: false });
... | JavaScript | 0 | @@ -4094,17 +4094,17 @@
it('#
-2
+3
default
@@ -5378,9 +5378,9 @@
t('#
-2
+3
sho
|
5ea055d93fb973262a1927bf1df8d093fb33a892 | Support WIP [ci skip] | src/script.js | src/script.js | (function ($) {
//-----------------------+
// Better val() function |
//-----------------------+
$.fn.valInternal = jQuery.fn.val;
$.fn.val = function (val) {
if (this.length) {
var type = this.attr('type');
type = type ? type : this.get(0).tagName.toLowerCase();
... | JavaScript | 0 | @@ -1149,20 +1149,20 @@
turn el.
-attr
+prop
('value'
|
1f6c9c57ceafce6e45948ba982e1ea0ffb769111 | Add remove header code | server.js | server.js | "use strict";
const express = require("express");
const app = express();
// install request
const request = require('request');
const PORT = process.env.PORT || 3000;
const rovi = process.env.ROVI_APIKEY || '';
const echo = process.env.ECHONEST_APIKEY || '';
// CORS (Cross-Origin Resource Sharing) headers to suppo... | JavaScript | 0.000001 | @@ -1663,24 +1663,66 @@
throw err;%0A
+ res.removeHeader(%22X-Frame-Options%22);
%0A res.s
|
f5d72e03a3277b93e5718dd81e40b662182e3e40 | Add a test (letter exchange with replace) | test/test.js | test/test.js | 'use strict';
var chai = require('chai');
chai.use(require('chai-shallow-deep-equal'));
var equal = chai.assert.equal;
var sdEqual = chai.assert.shallowDeepEqual;
var clubExpr = require('../index');
var parse = clubExpr.parse;
describe('#parse', function() {
it('should parse a single expression with one arg', f... | JavaScript | 0.000002 | @@ -4947,32 +4947,234 @@
, 2%5D);%0A %7D);%0A%0A
+ it('should replace %22a%22 with %22x%22 and conversely in a flat expr', function() %7B%0A sdEqual(replace(%5B'Somme', 'a', 'x'%5D, %7B'a':'x', 'x':'a'%7D),%0A %5B'Somme', 'x', 'a'%5D);%0A %7D);%0A%0A
it('should r
@@ -5230,32... |
dacac6d9bc0314c1de735e6851e8cb0a17143977 | Use assertion utility | lib/node_modules/@stdlib/fs/read-json/lib/async.js | lib/node_modules/@stdlib/fs/read-json/lib/async.js | 'use strict';
// MODULES //
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
var isObject = require( '@stdlib/assert/is-plain-object' );
var isFunction = require( '@stdlib/assert/is-function' );
var readFile = require( '@stdlib/fs/read-file' );
var removeBOM = require( '@stdlib/string/remove-utf8-bom... | JavaScript | 0.000002 | @@ -373,16 +373,74 @@
son' );%0A
+var instanceOf = require( '@stdlib/assert/instance-of' );%0A
%0A%0A// MAI
@@ -1038,17 +1038,20 @@
ame, '..
-/
+', '
package.
@@ -2278,21 +2278,16 @@
%7D%0A%09%09if (
- file
instanc
@@ -2291,18 +2291,25 @@
ance
-of
+Of( file,
Error )
%7B%0A%09
@@ -2300,24 +2300,26 @@
ile, E... |
73d0d96a6886f2115cee29b6a9a2ea56634c336b | Change server.js formatting, throw error | api/server.js | api/server.js | const Glue = require('glue');
const ioc = require('electrolyte');
const handlebars = require('handlebars');
const manifestPromise = require('./manifest');
const bookshelf = require('./src/lib/bookshelf');
const logger = require('./src/lib/logger');
var options = {
relativeTo: __dirname + '/src'
};
manifestPromise.t... | JavaScript | 0 | @@ -790,24 +790,26 @@
y %7B%0A
+
let token =
@@ -847,32 +847,34 @@
ken')%0A
+
.forge(%7B token:
@@ -875,24 +875,26 @@
oken: id %7D)%0A
+
.w
@@ -944,32 +944,34 @@
ow())%0A
+
.fetch();%0A
@@ -956,32 +956,34 @@
.fetch();%0A
+
if (!tok
@@ -998,... |
7ab2b8c6a3461bceeb7d57c0b0be859490486842 | Change scroll listener throttle time from 400 ms to 200 ms | app/assets/javascripts/controllers/entries.controller.js | app/assets/javascripts/controllers/entries.controller.js | function EntriesController() {
this.$pageContentWrapper = $('#page-content-wrapper');
this.entriesToFetch = 4;
this.threshold = 1000;
this.baseApiUrl = 'http://flatiron-magazine-cpk.herokuapp.com/api/v0/entries';
this.fetchedEntries = 0;
this.displayedEntries = 0;
this.viewedEntries = [];
}
EntriesContro... | JavaScript | 0.000001 | @@ -2516,17 +2516,17 @@
%7D%0A %7D,
-4
+2
00));%0A%7D%0A
|
649e6a2865210023b29db6ea3a6882ee9dde30e1 | Reformat code | client/src/models/AuthorizationGroup.js | client/src/models/AuthorizationGroup.js | import Model from "components/Model"
import encodeQuery from "querystring/encode"
import React from "react"
import utils from "utils"
import * as yup from "yup"
export default class AuthorizationGroup extends Model {
static resourceName = "AuthorizationGroup"
static listName = "authorizationGroupList"
static get... | JavaScript | 0 | @@ -79,34 +79,8 @@
de%22%0A
-import React from %22react%22%0A
impo
|
81b2865ef249aa07809ba6a0046a3bc793735ab7 | add comments | Components/ShadowDOM/polyfill/ShimShadowDOM.js | Components/ShadowDOM/polyfill/ShimShadowDOM.js | (function(scope) {
// imports
var Projection = scope.Projection;
var LightDOM = scope.LightDOM;
// ShadowRoot constructor
var ShadowRoot = function(inNode) {
// ShadowDOM implies LightDOM
if (!inNode.lightDOM) {
new LightDOM(inNode);
}
// make a new root
var root = document.createElement("shadow-root"... | JavaScript | 0 | @@ -3389,24 +3389,49 @@
unction() %7B%0A
+ // primary shadow root%0A
var root =
@@ -3455,16 +3455,48 @@
tChild;%0A
+ // content pool from lightDOM%0A
var po
@@ -3581,11 +3581,11 @@
ight
-dom
+DOM
to
|
7ac27f7b5c0c06390e60e18beae373aedc89ff49 | Add test for tasks implicitly bounded to disposed domains. | test/test.js | test/test.js |
"use strict";
if (typeof asap === "undefined") {
// Make browserify ignore node-only modules.
var requireNodeOnly = require;
var asap = require("../asap");
var expect = require("expect.js");
var mocha = global.mocha || requireNodeOnly("mocha");
// Some environments (node 0.6, browsers) do no... | JavaScript | 0 | @@ -5155,17 +5155,16 @@
run task
-k
s bound
@@ -5195,32 +5195,32 @@
nction (done) %7B%0A
+
@@ -5330,24 +5330,24 @@
.be(false);%0A
-
@@ -5382,24 +5382,407 @@
dispose();%0A%0A
+ asap(done);%0A %7D);%0A%0A it(%22shouldn't run tasks implicitly bound... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.