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 |
|---|---|---|---|---|---|---|---|
3621a95f6eecb722fb6b3a79d6951afba19c1b4c | Remove unused variables and fix paths issue | index.js | index.js | var gulp = require('gulp');
var elixir = require('laravel-elixir');
var htmlmin = require('gulp-htmlmin');
var config = elixir.config;
/**
* Minify static html pages, useful when using html partials loaded though ajax
* @param {string} src The files to minify
* @param {strin... | JavaScript | 0 | @@ -122,42 +122,8 @@
n');
-%0Avar config = elixir.config;
%0A%0A/*
@@ -708,56 +708,14 @@
-var paths = new elixir.GulpPaths()%0A .src(
+src =
src
@@ -748,26 +748,27 @@
s/*'
-)
+;
%0A
- .
output
-(
+Path =
outp
@@ -803,17 +803,91 @@
/views/'
-)
+;%0A%0A var paths = %7B%0A sr... |
4586f1a6115eb7cd1e4e0009d9315f95e007c0da | Add base comma-style rule | index.js | index.js | 'use strict'
module.exports = {
env: {
es6: true, // enable all ECMAScript 6 features except for modules
node: true // Node.js global variables and Node.js-specific rules
},
rules: {
'camelcase': 0,
'comma-dangle': 0,
'consistent-return': 0,
'curly': [2, 'all'],
'dot-notation': 0,
... | JavaScript | 0.000006 | @@ -230,24 +230,56 @@
dangle': 0,%0A
+ %22comma-style%22: %5B2, 'last'%5D,%0A
'consist
|
f0b5406a77aea39532bbd0b3c01af5871081c3a7 | Remove strict URL parameter bindings | index.js | index.js | var ws = require("nodejs-websocket");
var clients = [];
var wsServer = ws.createServer(function (conn) {
var clientId = '';
conn.on("text", function (str) {
clientId = str;
clients[clientId] = conn;
console.log("Client registered: " + clientId)
});
conn.on("close", function (c... | JavaScript | 0.000001 | @@ -977,16 +977,59 @@
, true);
+%0A params.timestamp = new Date().getTime();
%0A%0A if(p
@@ -1143,48 +1143,8 @@
ent;
-%0A var payload = params.query.payload;
%0A%0A
@@ -1172,19 +1172,8 @@
%5D &&
- payload &&
cli
@@ -1262,23 +1262,38 @@
endText(
-payload
+JSON.stringify(params)
);%0A
@@ -1337,35 +13... |
4c51bab5f48b921fb577f1807392489fb4b37f5b | make notDeepLooseEqual fail with warning | index.js | index.js | 'use strict';
var tape = require('tape');
exports = module.exports = function exports(name, harness, fake) {
(fake || tape)(name, function(testObj) {
var tests = [];
function describe(child, harness) {
tests.push(function() {
exports(name + ' ' + child, harness, function() {
testObj... | JavaScript | 0.000002 | @@ -2848,73 +2848,70 @@
ion(
-actual, expected) %7B%0A t.notDeepLooseEqual(actual, expected, msg
+) %7B%0A t.fail('see https://github.com/substack/tape/pull/116'
);%0A
|
61c957d28fa5d744aeb189800252b72c7f172392 | add inspect() method | index.js | index.js | 'use strict';
var assert = require('assert');
var fs = require('fs');
module.exports = StaticConfig;
function StaticConfig(options) {
if (!(this instanceof StaticConfig)) {
return new StaticConfig(options);
}
var self = this;
assert(options && options.files, 'must pass in options.files');
... | JavaScript | 0.000002 | @@ -1361,32 +1361,303 @@
eturn null;%0A%7D;%0A%0A
+StaticConfig.prototype.inspect = function inspect() %7B%0A var self = this;%0A var clone = %7B%7D;%0A%0A var keys = Object.keys(self._configValues);%0A for (var i = 0; i %3C keys.length; i++) %7B%0A clone%5Bkeys%5Bi%5D%5D = self._configValues%5Bkeys... |
01576c52b2762c880ed190558dbe404ebf9b43d2 | change util export from index | index.js | index.js | /**
* Created by austin on 12/8/15.
*/
"use strict";
var Promise = require("bluebird")
, path = require("path")
, fs = Promise.promisifyAll(require("fs"))
, _ = require("lodash");
var Migration = require("./lib/Migration")
, constants = require("./constants")
, utils = require("./lib/utils");
var _scri... | JavaScript | 0 | @@ -428,20 +428,16 @@
ils = %7B%0A
- var
command
@@ -440,18 +440,17 @@
mandline
- =
+:
functio
@@ -1624,21 +1624,16 @@
,%0A
-var
library
- =
+:
fun
|
b171f142a39080f4055bebfb4eab695fc5d19e94 | remove broken gateways | index.js | index.js | var BaseGateway = require('42-cent-base').BaseGateway;
var AuthorizeNet = require('authorize-net');
var PayFlow = require('payflow').gateway;
var RocketGate = require('rocketgate').gateway;
var VirtualMerchant = require('virtualmerchant').gateway;
var NMI = require('nmi');
var Omise = require('42-cent-omise').factory;
... | JavaScript | 0.00001 | @@ -52,226 +52,8 @@
ay;%0A
-var AuthorizeNet = require('authorize-net');%0Avar PayFlow = require('payflow').gateway;%0Avar RocketGate = require('rocketgate').gateway;%0Avar VirtualMerchant = require('virtualmerchant').gateway;%0Avar NMI = require('nmi');
%0Avar
@@ -357,161 +357,204 @@
ry;%0A
-var Moneris = require('... |
768fda71c6b684f0e8b9c0081245e792bb307e5b | allow custom announceLists | index.js | index.js | var BlockStream = require('block-stream')
var bncode = require('bncode')
var corePath = require('path')
var crypto = require('crypto')
var fs = require('fs')
var inherits = require('inherits')
var stream = require('stream')
var once = require('once')
var parallel = require('run-parallel')
var calcPieceLength = require(... | JavaScript | 0 | @@ -2817,16 +2817,71 @@
eLength%0A
+ * @param %7BArray.%3CArray.%3Cstring%3E%3E=%7D opts.announceList%0A
* @para
@@ -3060,24 +3060,132 @@
s = %7B%7D%0A %7D%0A%0A
+ var announceList = (opts.announceList !== undefined)%0A ? opts.announceList%0A : DEFAULT_ANNOUNCE_LIST%0A%0A
var torren
@@ -3259,37 +3259,28... |
7c9bcb5486c611a91891a1103d806aea8a2bef76 | Add support for default exchange | index.js | index.js | "use strict";
var amqp = require("amqplib/callback_api");
var _ = require("lodash");
var url = require("url");
var EventEmitter = require("events");
var qs = require("querystring");
var JSON_TYPE = "application/json";
var defaultBehaviour = {
reuse: "default",
ack: false,
confirm: false,
heartbeat: 10,
produ... | JavaScript | 0 | @@ -1898,102 +1898,32 @@
-if (behaviour.exchange) %7B%0A channel.assertExchange(behaviour.exchange, %22topic%22);%0A %7D
+assertExchange(channel);
%0A
@@ -3204,35 +3204,24 @@
tch);%0A
-subChannel.
assertExchan
@@ -3227,35 +3227,18 @@
nge(
-behaviour.exchange, %22topic%22
+subChannel
);%0... |
f318d8c606019b7161134a79987f481e08898cd3 | use noop for cleanliness | index.js | index.js | /*
* index.js :: Wrap the redis pub-sub in a readable stream like interface
*
* (C) 2013, Jarrett Cruger
*
*/
var util = require('util'),
Readable = require('stream').Readable,
redis = require('redis');
if (Readable === undefined) {
Readable = require('readable-stream')
}
var SubscribeStream = functio... | JavaScript | 0.000001 | @@ -906,74 +906,12 @@
rd,
-function () %7B%0A //%0A // Remark: O hai there%0A //%0A %7D
+noop
);%0A
|
7b4f721d663b22158ff721ae3c313cae70f2e98b | fix standard issues | index.js | index.js | const debug = require('debug')('barracks')
const assert = require('assertf')
const async = require('async')
module.exports = Dispatcher
// initialize the dispatcher with actions
// obj -> fn
function Dispatcher (actions) {
if (!(this instanceof Dispatcher)) return new Dispatcher(actions)
assert(actions, "an 'act... | JavaScript | 0.009763 | @@ -1182,29 +1182,27 @@
try %7B%0A
-const
+var
fn = _getAc
@@ -2150,36 +2150,24 @@
ey%5D%0A if (
-'object' ==
typeof actio
@@ -2167,16 +2167,29 @@
f action
+ === 'object'
) return
@@ -3272,30 +3272,31 @@
if (
-'object' == typeof val
+typeof val === 'object'
) re
|
924af3ca0246e0f8c431cef73d21702ef11be6df | use named constants | index.js | index.js | 'use strict';
var ieee754 = require('ieee754');
module.exports = Protobuf;
function Protobuf(buf) {
this.buf = buf;
this.length = buf.length;
this.pos = 0;
}
Protobuf.prototype.destroy = function() {
this.buf = null;
};
Protobuf.prototype.readUInt32 = function() {
var val = this.buf.readUInt32LE... | JavaScript | 0.000014 | @@ -166,16 +166,142 @@
= 0;%0A%7D%0A%0A
+Protobuf.Varint = 0;%0AProtobuf.Int64 = 1;%0AProtobuf.Message = 2;%0AProtobuf.String = 2;%0AProtobuf.Packed = 2;%0AProtobuf.Int32 = 5;%0A%0A
Protobuf
@@ -330,24 +330,24 @@
unction() %7B%0A
-
this.buf
@@ -1722,17 +1722,31 @@
is.skip(
-0
+Protobuf.Varint
);%0A
@@ -3... |
3f79f2741545eae87125d62ed95915255abdf642 | Revert conf data | index.js | index.js | import express from 'express';
import ReactDOMServer from 'react-dom/server'
import {Router, createRoutesFromReactChildren, useRoutes} from 'react-router';
import RoutingContext from 'react-router/lib/RoutingContext'
import { createLocation, createMemoryHistory } from 'history'
import React from 'react';
import bodyPar... | JavaScript | 0.000001 | @@ -901,40 +901,8 @@
1',%0A
- host : '192.168.3.105',%0A
@@ -1289,21 +1289,17 @@
t: '
-192.168.3.105
+localhost
',%0A
|
e2948cb2dd78b4f0cfcaee20da5ba31dbddc5d37 | Add post to follow list | index.js | index.js | /*global require:false, console:false, module:false, setTimeout: false*/
var data = require('./src/data');
var renderer = require('./src/renderer');
var nav = require('./src/navigation');
var notification = require('./src/notification');
var config = require('./src/config');
var currentGroup = 0;
var currentPost = nu... | JavaScript | 0 | @@ -409,16 +409,34 @@
= false;
+%0Avar follows = %5B%5D;
%0A%0Avar re
@@ -984,24 +984,98 @@
e: 'open'%7D,%0A
+ %7Bname: 'Zobacz list%C4%99 post%C3%B3w obserwowanych', value: 'followlist'%7D,%0A
%7Bnam
@@ -1917,32 +1917,93 @@
break;%0A
+ case 'followlist':%0A console.log(fo... |
75baab601e74f232a1649f896cccf0e762eeb64c | fix typo squere to square | src/scheme-definitions.js | src/scheme-definitions.js | 'use strict';
let schemePresets = {
analogous: {
count: 3,
fn: 'analogous',
options: {}
},
complementary: {
count: 2,
fn: 'complement',
options: {}
},
splitComplementary: {
count: 3,
fn: 'complement',
options: {}
},
triadic: {
count: 3,
fn: 'equidistant'
},... | JavaScript | 0.999999 | @@ -320,17 +320,17 @@
,%0A%0A squ
-e
+a
re: %7B%0A
|
128729a4d4dc8baa856e11bc453b5828ded60516 | improve doc comments | index.js | index.js |
/**
* Module dependencies.
*/
var Me = require('./lib/me');
var Site = require('./lib/site');
var debug = require('debug')('wpcom');
/**
* WordPress.com REST API class.
*
* @api public
*/
function WPCOM(request){
if (!(this instanceof WPCOM)) return new WPCOM(request);
if ('function' !== typeof request) {... | JavaScript | 0 | @@ -1178,16 +1178,43 @@
y, fn)%7B%0A
+ // params request object%0A
var pa
@@ -1344,16 +1344,27 @@
path);%0A%0A
+ // token%0A
if (op
@@ -1421,16 +1421,49 @@
n;%0A %7D%0A%0A
+ // set method and path request%0A
params
@@ -1544,16 +1544,49 @@
.path;%0A%0A
+ // query parameter is optional%0A
if ('f
@@ -... |
bd95758d9ba780891c2cd16723fd58095e4ae205 | Attach `client` instance to `on` and `once` helpers This allows attached event handlers to being triggered on `client.emit` calls. | index.js | index.js | "use strict";
var Promise = require('promise');
const NodeCecModule = require('node-cec');
const NodeCec = NodeCecModule.NodeCec;
const CEC = NodeCecModule.CEC;
const startupTimeout = 30000; // milliseconds
let client = new NodeCec('node-cec-monitor');
let responsesPending = [];
let timeout = 3000;
let busy = false;
... | JavaScript | 0 | @@ -2296,16 +2296,29 @@
lient.on
+.bind(client)
;%0A%0Alet o
@@ -2334,16 +2334,29 @@
ent.once
+.bind(client)
;%0A%0Amodul
|
0f5dc47016b5846b5be775980e25513fa0601208 | put logging module back in! :S | index.js | index.js | 'use strict';
var iter = require('super-iter');
var forEach = iter.forEach;
var CONF = require('config');
var koa = require('koa');
var mount = require('koa-mount');
var Router = require('koa-router');
var apiDescriptor = require('./lib/start/apiDescriptor');
var createApiVersion = require('./lib/start/createApiVer... | JavaScript | 0 | @@ -365,24 +365,56 @@
routers');%0A%0A
+require('./lib/start/logger');%0A%0A
var app = ko
|
457298be30dba84142854b0f03e4151ac42a502b | use hostname from docker-compose | index.js | index.js |
/* setup slack connection */
var RtmClient = require('@slack/client').RtmClient;
var MemoryDataStore = require('@slack/client').MemoryDataStore;
var RTM_EVENTS = require('@slack/client').RTM_EVENTS;
var token = process.env.SLACK_API_TOKEN || '';
var rtm = new RtmClient(token, {
logLevel: 'error',
dataStore: ne... | JavaScript | 0.000008 | @@ -534,17 +534,21 @@
t: '
-localhost
+elasticsearch
:920
|
fddcffd7b9fa7d93093650aae488e8804f532b61 | Use clone options only for clone and not for pull | index.js | index.js | const childProcess = require('child_process');
const opted = require('opted');
const fs = require('fs');
const parse = require('./parse');
const async = require('async');
const ssh = require('./lib/ssh');
const debug = require('debug')('git-visit');
function Repository(path, url, options) {
options = options || {}... | JavaScript | 0 | @@ -1513,37 +1513,36 @@
ed(this.options.
-clone
+pull
).join(' ');%0A%0A
|
938cfafa5f87749d47a2c0fa2db62c708a0765e8 | Add note explaining weaknesses of current packageTree approach. | index.js | index.js | /* eslint-env node */
/* eslint-disable new-cap */
'use strict';
const Funnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
const path = require('path');
const resolve = require('resolve');
function packageTree(name, _options) {
let options = _options || {};
let na... | JavaScript | 0 | @@ -65,17 +65,17 @@
%0A%0Aconst
-F
+f
unnel
@@ -265,51 +265,23 @@
me,
-_options) %7B%0A let options = _options %7C%7C %7B%7D;
+options = %7B%7D) %7B
%0A l
@@ -480,150 +480,715 @@
));%0A
+%0A
-let entryModule = packageJson%5B'module'%5D %7C%7C packageJson%5B'jsnext:main'%5D %7C%7C packageJson%5B'main'%5D... |
14b00062a98108593631fde3aac3b77b24490ad1 | remove extra logging | index.js | index.js | #!/usr/local/bin/node
var express = require('express');
var request = require('request');
var app = express();
var cache = {};
app.get('/favicon.ico', function(req, res) {
res.sendStatus(404);
});
app.get('/dump', function(req, res) {
res.send(cache);
});
app.get('/*', function(req, res){
var desiredUrl = r... | JavaScript | 0 | @@ -758,39 +758,8 @@
) %7B%0A
- console.log('err', err);%0A
|
ed8ada898389517a5410434707b13bc165bf7b20 | Trim the bookmark title | index.js | index.js | var self = require("sdk/self");
var data = self.data;
var pws = require("sdk/page-worker");
var { setInterval, clearInterval } = require("sdk/timers");
var preferences = require("sdk/simple-prefs");
var inter = preferences.prefs["interval"];
var sel = preferences.prefs["selector"];
var sourceURL = preferences.prefs["s... | JavaScript | 0.999999 | @@ -1168,16 +1168,23 @@
message
+.trim()
;%0A%09%09%09%09sa
|
669219160fcc611707ababac7c117325967a7e98 | Fix file object not being updated for subsequent files, related to #50 | index.js | index.js | 'use strict';
var Transform = require('readable-stream/transform');
var rs = require('replacestream');
var istextorbinary = require('istextorbinary');
module.exports = function(search, replacement, options) {
return new Transform({
objectMode: true,
transform: function(file, enc, callback) {
if (file.... | JavaScript | 0 | @@ -172,32 +172,33 @@
unction(search,
+_
replacement, opt
@@ -374,24 +374,62 @@
%7D%0A %0A
+ var replacement = _replacement;%0A
if (ty
@@ -425,32 +425,33 @@
if (typeof
+_
replacement ===
@@ -537,16 +537,17 @@
ement =
+_
replacem
|
4c081266433054dce2fb85de83bef0291ed99aa0 | fix compatibility with wepback 4.x from #43 | index.js | index.js | var loaderUtils = require('loader-utils');
var webfontsGenerator = require('webfonts-generator');
var path = require('path');
var glob = require('glob');
var url = require('url');
var hashFiles = require('./utils').hashFiles;
var mimeTypes = {
'eot': 'application/vnd.ms-fontobject',
'svg': 'image/svg+xml',
'ttf'... | JavaScript | 0 | @@ -5008,16 +5008,36 @@
context:
+ this.rootContext %7C%7C
this.op
|
d8eebac52d87586b5c0ab895a1e45deaf9c722d2 | Fix leftover artifact from refactor | index.js | index.js | 'use strict';
var exec = require('child_process').exec;
var serialNumber = function (cb, cmdPrefix) {
var delimiter = ': ';
var stdoutHandler = function (error, stdout) {
cb(error, parseResult(stdout));
};
var parseResult = function (input) {
return input.slice(input.indexOf(delimiter) + 2).trim();
};
if (!... | JavaScript | 0.000002 | @@ -829,13 +829,8 @@
xec(
-this.
cmdP
|
523904c00327e05552fd2d86c2a8b5c67942ef52 | Fix path resolution | index.js | index.js | var spawn = require("child_process").spawn;
var prebuilt = require("electron-prebuilt");
module.exports = function() {
var ps = spawn(prebuilt, [__dirname + "/electron.js"], {
stdio: [null, null, null, "ipc"]
});
let initialized = false;
let last = null;
ps.on("message", function(msg) {
if (msg ===... | JavaScript | 0.000002 | @@ -612,17 +612,30 @@
ps.send(
-%22
+__dirname + %22/
green.pn
@@ -684,17 +684,30 @@
ps.send(
-%22
+__dirname + %22/
red.png%22
@@ -757,17 +757,30 @@
ps.send(
-%22
+__dirname + %22/
blue.png
|
0f7423d6b10ada6ba72e00b4501b61fdd0656b7e | update working DHT example. peer wire protocol is in progress | index.js | index.js | /* global chrome */
// TODO: get .torrent file from magnet link
// window.log = function (data) {
// document.getElementById('console').innerHTML += data + '<br>'
// }
// window.log = function (/* ... */) {
// if (process.env.DEBUG !== 'false') console.log.apply(console, arguments)
// }
var DHT = require('bittor... | JavaScript | 0.000001 | @@ -18,53 +18,8 @@
*/%0A%0A
-// TODO: get .torrent file from magnet link%0A%0A
// w
@@ -243,16 +243,62 @@
)%0A// %7D%0A%0A
+var Protocol = require('bittorrent-protocol')%0A
var DHT
@@ -389,21 +389,19 @@
i')%0Avar
-Swarm
+net
= requi
@@ -408,63 +408,55 @@
re('
-./lib/peer-wire-swarm')%0A%0Awindow.bops = requir... |
f6d7e3acbe1e05e4b6df39a0bb8dbdd4cae43c02 | Improve response on submit issue error | index.js | index.js | var Hapi = require('hapi');
var Good = require('good');
var Joi = require('joi');
var GitHubApi = require("github");
var DBCtrl = require('./src/dbController');
const DEBUG = process.env.DEBUG;
var github = new GitHubApi({
version: "3.0.0",
debug: DEBUG,
protocol: "https",
timeout: 5000,
headers: ... | JavaScript | 0 | @@ -1534,32 +1534,100 @@
if(err) %7B%0A
+ // TODO: Catch requests limit and save to queue%0A
@@ -1664,30 +1664,40 @@
-return
+const response =
reply(err.m
@@ -1706,56 +1706,257 @@
sage
-, null)%0A
+)%0A %0A ... |
8282a179fe6ac8e2026fd6246e71cada63f46b99 | fix export syntax | index.js | index.js |
import RecyclerViewList from './lib/RecyclerViewList';
import DataSource from './lib/DataSource';
export default RecyclerViewList;
export DataSource;
| JavaScript | 0.000048 | @@ -1,13 +1,12 @@
-%0A
import Recyc
@@ -127,24 +127,26 @@
List;%0Aexport
+ %7B
DataSource;
@@ -144,10 +144,12 @@
taSource
+ %7D
;%0A
|
3e48749dad891a3ee33caea4a000789357f1581b | Replace `\` globally in uploadPath | index.js | index.js | 'use strict';
var fs = require('fs');
var gutil = require('gulp-util');
var es = require('event-stream');
var pkgcloud = require('pkgcloud');
module.exports = function (rackspace, options) {
var options = options || {};
var container = rackspace.container || options.container
if (!rackspace) { gutil.log(gutil.co... | JavaScript | 0.000095 | @@ -934,12 +934,13 @@
ace(
-'%5C%5C'
+/%5C%5C/g
,'/'
|
1e3c4bb374f7fadaecbb1cfb695f2f35864ebf72 | Set exclusive flag for tmp queues | index.js | index.js | "use strict";
var amqp = require("amqplib/callback_api");
var _ = require("lodash");
var url = require("url");
var EventEmitter = require("events");
var qs = require("querystring");
var JSON_TYPE = "application/json";
var defaultBehaviour = {
reuse: "default",
ack: false,
confirm: false,
heartbeat: 10,
prod... | JavaScript | 0 | @@ -1028,16 +1028,20 @@
search =
+%0A
qs.stri
@@ -2471,20 +2471,17 @@
essage,
-pubC
+c
allback)
@@ -2614,12 +2614,9 @@
ps,
-pubC
+c
allb
@@ -2965,41 +2965,23 @@
-subChannel.assertQueue(queueName,
+var queueOpts =
%7Bdu
@@ -3022,17 +3022,91 @@
ueueName
-%7D
+, exclusive: !queueName%7D;%0A subCh... |
aafe4016262a2bdc07c2435ebeb0cbbac2021fa6 | resolve relative to current file | index.js | index.js | const path = require('path');
const fs = require('fs');
const YAML = require('js-yaml');
const utils = require('loader-utils');
const defaultOptions = {
keyword: 'import'
};
const readFile = (file) => {
return new Promise((resolve, reject) => {
fs.readFile(file, (err, data) => {
if (e... | JavaScript | 0.000001 | @@ -3,13 +3,25 @@
nst
-path
+%7B join, dirname %7D
= r
@@ -46,13 +46,20 @@
nst
-fs
+%7B readFile %7D
= r
@@ -207,20 +207,16 @@
nst read
-File
= (file
@@ -280,11 +280,8 @@
-fs.
read
@@ -474,32 +474,38 @@
(source, keyword
+, path
) =%3E %7B%0A let o
@@ -857,32 +857,30 @@
nst
-location = path.... |
d8dde679622839848476319139781939210b2189 | Update index.js | index.js | index.js | var path = require('path');
var spawn = require('child_process').spawn;
var fs = require('fs-extra');
var crypto = require('crypto');
var plantuml = require('node-plantuml');
var Q = require('q');
var nailgunRunning = false;
var ASSET_PATH = 'assets/images/uml/';
function processBlock(blk) {
var deferred = Q.def... | JavaScript | 0 | @@ -3583,10 +3583,15 @@
((.*
-%5Cn
+%5B%5Cr%5Cn%5D+
)+?)
|
673214ae997d4c98debe3d07c04701a9f2a48951 | Fix websocketPort config | index.js | index.js | const express = require('express');
const compression = require('compression');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
const {Observable: $} = require('rxjs/Observable');
const {start} = require('./common/game');
const {getTime, saveTime, getPla... | JavaScript | 0.000005 | @@ -1979,20 +1979,29 @@
.listen(
-8008
+websocketPort
);%0A%0Acons
|
37595265ca8df85db323315b31488be9ea454ae5 | fix #1 accept multiple paths | index.js | index.js | var http = require("http")
, shoe = require("shoe")
, path = require("path")
, watchr = require("watchr")
, bundle = require("browserify-server")
, openStreams = []
module.exports = LiveReloadServer
function LiveReloadServer(options) {
var server = http.createServer(serveText)
, sock =... | JavaScript | 0.000001 | @@ -343,19 +343,21 @@
,
-uri
+paths
= optio
@@ -359,19 +359,17 @@
options.
-uri
+_
%7C%7C proc
@@ -689,13 +689,16 @@
path
+s
:
-uri
+paths
%0A
|
85e67edb82753d83f2322ba1d04809bd89a8c8ed | Add support for recognizing ICC v4.3 profiles | index.js | index.js | 'use strict';
// http://www.color.org/profileheader.xalter
const versionMap = {
0x02000000: '2.0',
0x02100000: '2.1',
0x02400000: '2.4',
0x04000000: '4.0',
0x04200000: '4.2'
};
const intentMap = {
0: 'Perceptual',
1: 'Relative',
2: 'Saturation',
3: 'Absolute'
};
const valueMap = {
// Device
's... | JavaScript | 0 | @@ -178,16 +178,37 @@
0: '4.2'
+,%0A 0x04300000: '4.3'
%0A%7D;%0A%0Acon
|
f882e96cae106d2603c52446722dbf4a4a7b2ce5 | Update index.js | index.js | index.js | /**
* koa-body - index.js
* Copyright(c) 2014
* MIT Licensed
*
* @author Daryl Lau (@dlau)
* @author Charlike Mike Reagent (@tunnckoCore)
* @api private
*/
'use strict';
/**
* Module dependencies.
*/
var buddy = require('co-body');
var forms = require('formidable');
/**
* Expose `requestbody()`.
*/
m... | JavaScript | 0.000001 | @@ -1590,17 +1590,21 @@
tru
-e
+thy
%0A
-var
+const
sym
|
b9413389ed97a18560f33225d1b3176e199dad0b | Fix loop | index.js | index.js | module.exports = function livereload(opt) {
// options
var opt = opt || {};
var ignore = opt.ignore || opt.excludeList ||
[/\.js(\?.*)?$/, /\.css(\?.*)?$/, /\.svg(\?.*)?$/, /\.ico(\?.*)?$/, /\.woff(\?.*)?$/, /\.png(\?.*)?$/, /\.jpg(\?.*)?$/, /\.jpeg(\?.*)?$/];
var include = opt.include || [/.*/];
var htm... | JavaScript | 0.000002 | @@ -4598,16 +4598,22 @@
-res.end(
+end.call(res,
res.
@@ -4636,16 +4636,17 @@
%0A %7D;%0A
+%0A
next
|
db0bd3528972ac2d6710c7619471527977c01451 | Update index.js | index.js | index.js | 'use strict';
var cheerio = require('cheerio');
// http://stackoverflow.com/questions/14480345/how-to-get-the-nth-occurrence-in-a-string
function getPosition(str, m, i) {
return str.split(m, i).join(m).length;
}
hexo.extend.filter.register('after_post_render', function(data){
var config = hexo.config;
if(config... | JavaScript | 0 | @@ -981,16 +981,37 @@
r src =
+$(this).attr('src')&&
$(this).
|
7d671f67eb6c6242f6b5336c670cef67f9c34117 | add another final pass to resolve all hrefs | index.js | index.js | /**
* Expose the parse function
*/
module.exports = function(href, key, value) {
var l = arguments.length;
if (l === 1) return parse.bind(null, href);
if (l == 2) return parse('', href, key);
return parse(href, key, value);
};
/**
* Define a property
*/
var define = Object.defineProperty;
/**
* Parse a... | JavaScript | 0 | @@ -755,209 +755,24 @@
%0A%0A
-// make the href mutable so hyper-path can resolve it%0A var href = value.href%0A define(obj, 'href', %7B%0A enumerable: true,%0A writable: true,%0A value: href%0A %7D);%0A%0A var hashCode = computeHash(href)
+var hashCode = 0
;%0A%0A
@@ -807,24 +807,8 @@
if (
-k === 'h... |
85894a8539622fbd91a210dc992e1276d7e10a16 | Add --help and --version to usage | index.js | index.js | var argv = require('minimist')(process.argv.slice(2));
var Yts = require('./lib/yts.js');
var chalk = require('chalk');
var path = require('path');
var isOutdated = require('is-outdated');
var showRecentMovies = function (options) {
options = options || {};
options.sort_by = options.sort_by || 'year';
options.or... | JavaScript | 0.000001 | @@ -2968,16 +2968,69 @@
ovie');%0A
+ console.log('--version');%0A console.log('--help');%0A
%7D;%0A%0Avar
|
91faed337caed93bc2322dfa53e91d20f1e19adc | Fix point form | index.js | index.js | var featureCollection = require('turf-featurecollection');
/**
* Filters a {@link FeatureCollection} by a property key-value combination
*
* @module turf/filter
* @param {FeatureCollection} features input FeatureCollection
* @param {String} key the property on which to filter
* @param {String} value the value o... | JavaScript | 0.000024 | @@ -518,24 +518,25 @@
turf.point(
+%5B
-72.581777,
@@ -544,16 +544,17 @@
4.260875
+%5D
, %7Bspeci
@@ -577,24 +577,25 @@
turf.point(
+%5B
-72.570018,
@@ -603,16 +603,17 @@
4.260691
+%5D
, %7Bspeci
@@ -638,24 +638,25 @@
turf.point(
+%5B
-72.576284,
@@ -664,16 +664,17 @@
4.257925
+%5D
, %7Bspeci
@@ -697,... |
271206894090cd372df8b12965372736eb222dfe | add more logging | index.js | index.js | process.title = 'rachelandjoey'
import hapi from 'hapi'
import path from 'path'
import jace from 'jace'
import bulkRequire from 'bulk-require'
import each from 'lodash/collection/each'
import values from 'lodash/object/values'
import after from 'lodash/function/after'
import size from 'lodash/collection/size'
const p... | JavaScript | 0 | @@ -745,36 +745,190 @@
tes%0A
-server.route(values(routes))
+const loadRoutes = () =%3E %7B%0A server.log(%5B'server', 'init', 'info'%5D, 'loading routes')%0A server.route(values(routes))%0A server.log(%5B'server', 'init', 'info', 'ok'%5D, 'routes loaded')%0A%7D
%0A%0A//
@@ -998,32 +998,110 @@
packs), () =%3E %7B... |
6ba954a067408e4e8da4a565bff657940a97545c | should not convert to buffer if binary | index.js | index.js | 'use strict';
var fs = require('fs');
var gutil = require('gulp-util');
var path = require('path');
var requireDir = require('require-dir');
var through = require('through2');
var istextorbinary = require('istextorbinary');
var escapeChars = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;
var localizationMatchCount;
/**
* @p... | JavaScript | 0.999567 | @@ -1211,16 +1211,17 @@
if (
+!
isBinary
@@ -1230,41 +1230,8 @@
%7B%0A
- return file.contents;%0A %7D%0A%0A
@@ -1260,16 +1260,25 @@
Contents
+%0A
.replace
@@ -1314,24 +1314,28 @@
$1) %7B%0A
+
var match =
@@ -1352,16 +1352,20 @@
t, $1);%0A
+
va
@@ -1401,24 +1401,28... |
09b001d77d77614f3c5168958e2eb0c4f087c134 | Refactor to improve bundle size | index.js | index.js | 'use strict'
var visit = require('unist-util-visit')
var normalize = require('nlcst-normalize')
var isLiteral = require('nlcst-is-literal')
var own = {}.hasOwnProperty
module.exports = search
var word = 'WordNode'
var whiteSpace = 'WhiteSpaceNode'
function search(tree, phrases, handler, options) {
var settings =... | JavaScript | 0 | @@ -193,65 +193,8 @@
ch%0A%0A
-var word = 'WordNode'%0Avar whiteSpace = 'WhiteSpaceNode'%0A%0A
func
@@ -281,14 +281,40 @@
var
-apos =
+config = %7B%0A allowApostrophes:
set
@@ -350,153 +350,50 @@
ions
+,
%0A
-var dashes = settings.allowDashes %7C%7C false%0A var literals = settings.allowLiterals%0A var c... |
d19931a7909bfc287832711a64a6cb76075c542c | Change config structure | index.js | index.js | /**
* Copyright: (c) 2016 Max Klein
* License: MIT
*/
const http = require('http');
const createHandler = require('github-webhook-handler');
const config = require('./config');
const handler = createHandler({
path: config.webhook.path,
secret: config.webhook.secret
});
const server = http.createServer(function... | JavaScript | 0.000002 | @@ -480,16 +480,24 @@
(config.
+webhook.
port);%0A%0A
|
72b191b69e0436841c1cd9c5b228ad6b48f30bd1 | add support for mixed-case input | index.js | index.js | 'use strict';
var step2list, step3list, consonant, vowel, consonantSequence,
vowelSequence, EXPRESSION_MEASURE_GREATER_THAN_0,
EXPRESSION_MEASURE_EQUAL_TO_1, EXPRESSION_MEASURE_GREATER_THAN_1,
EXPRESSION_VOWEL_IN_STEM, EXPRESSION_CONSONANT_LIKE,
EXPRESSION_SUFFIX_LL, EXPRESSION_SUFFIX_E, EXPRESSION_SUF... | JavaScript | 0.000003 | @@ -2863,16 +2863,30 @@
String()
+.toLowerCase()
;%0A%0A i
|
78f93589310a910d096cf1644edcf7d14662c1f0 | Remove logging noise | index.js | index.js | 'use strict';
const BbPromise = require('bluebird');
const validate = require('serverless/lib/plugins/aws/lib/validate');
const glob = require('glob-all');
const fs = require('fs');
const mime = require('mime-magic');
const globOpts = {
nodir: true
};
class Assets {
constructor (serverless, options) {
this.... | JavaScript | 0.000001 | @@ -1047,93 +1047,8 @@
=%3E %7B
-%0A console.log(%22Filename: %22, fn)%0A console.log(%22Path: %22, opt.source + fn)
%0A%0A
@@ -1204,22 +1204,19 @@
og(%22
-Content-Type:%22
+File: %22, fn
, ty
|
d321d1927dfcf3f613827262e7e5aec772ef49f6 | fix sortingwq | index.js | index.js | var dbConfig = require('./db.js');
var express = require('express');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var mongoose = require('mongoose');
app.use('/', express.static('src'));
var players = {};
mongoose.connect(dbConfig.mongoConnection);
var scoreSc... | JavaScript | 0.000002 | @@ -1900,35 +1900,36 @@
re.find().sort(%7B
-dat
+scor
e: -1%7D).exec(fun
@@ -2121,19 +2121,20 @@
).sort(%7B
-dat
+scor
e: -1%7D).
|
b02360900280a59ad1b72bb7ce7d723a2d91c78e | change text and dirty on componentReceiveProps | index.js | index.js | 'use strict';
import React, {Component, PropTypes} from 'react';
import {
StyleSheet,
TextInput,
LayoutAnimation,
Animated,
Easing,
Text,
View,
Platform
} from 'react-native';
var textPropTypes = Text.propTypes || View.propTypes
var textInputPropTypes = TextInput.propTypes || textPropTypes
var propTyp... | JavaScript | 0 | @@ -855,24 +855,219 @@
n state%0A %7D,
+%0A %0A componentWillReceiveProps (props) %7B%0A if (props.value !== this.state.text) %7B%0A this.setState(%7B text: props.value, dirty: !!props.value %7D)%0A this._animate(!!props.value)%0A %7D%0A %7D,
%0A%0A _animate
|
63cf609290f6a19be1888818c573156cf24a84c5 | Add error checks for ENV variables #3 and some error responses for Cloudant responses #4 | index.js | index.js | // 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.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed un... | JavaScript | 0 | @@ -736,16 +736,180 @@
ervices%0A
+// Validate%0Aif (typeof process.env.VCAP_SERVICES === 'undefined' %7C%7C%0A typeof process.env.DATABASE === 'undefined') %7B%0A throw new Error('Missing ENV variables');%0A%7D%0A%0A
// VCAP
@@ -1625,16 +1625,139 @@
%7D,%0A%7D);%0A%0A
+// Error return%0Avar errorFunc = function(... |
2719052d543ddb8a4c3f85d50c903f18746f28cc | Remove data.json reference from index.js | index.js | index.js | const
accountSid = 'ACC_SID'
, authToken = 'AUTH_TOKEN'
, Hapi = require('hapi')
, querystring = require('querystring')
, data = require('./data.json')
, helper = require('./helper.js')
, client = require('twilio')(accountSid, authToken);
/* Configure the Hapi server */
var ser... | JavaScript | 0.000003 | @@ -135,49 +135,8 @@
g')%0A
- , data = require('./data.json')%0A
,
|
c66eaf22a654c58edb12078f923bef00dfda5d75 | Make config object optional (#27) | index.js | index.js | const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const chalk = require('chalk');
const incorrectStyleGuidePath = require('./incorrectStyleGuidePath');
const autoprefixerConfig = require('./autoprefixer.config');
co... | JavaScript | 0 | @@ -5639,28 +5639,13 @@
ix %7D
-, autoprefixerConfig
+ = %7B%7D
) =%3E
|
814b2bd29d5b5c5cbcc64e1f4e099496ffe30cf7 | Add `@` file prefix to skip content wrapping | index.js | index.js | var gulpUtil = require( 'gulp-util' );
var through2 = require( 'through2' );
/**
* CSS nesting by directory gulp plugin
*/
module.exports = function ()
{
return through2.obj(
function ( data, encoding, callback )
{
if ( data.isNull() )
{
callback( null, data );
return;
}
if ( data.isStre... | JavaScript | 0 | @@ -3968,14 +3968,61 @@
= '&' )%0A
+%09%09// At-rule%0A%09%09%7C%7C ( name.charAt( 0 ) === '@' )%0A
%09);%0A%7D%0A
|
87727f488e5464cc6f0e4b0f1652995c387db922 | implement a up-down effect | index.js | index.js | // dependencies
var Jasciimo = require('jasciimo').Figlet
, Overlap = require ("overlap")
, AsciiFrames = require ("ascii-frames")
;
/**
* This function creates an ASCII box providing the width and height
*
*/
function createScreen (w, h) {
// left top corner
var screen = "╔";
// top line
fo... | JavaScript | 0.999199 | @@ -1363,11 +1363,14 @@
-if
+switch
(opt
@@ -1385,12 +1385,28 @@
mate
- ===
+) %7B%0A case
%22do
@@ -1411,20 +1411,22 @@
down-up%22
-) %7B%0A
+:%0A
@@ -1489,24 +1489,28 @@
+
frames.push(
@@ -1540,16 +1540,20 @@
+
who: scr
@@ -1574,16 +1574,20 @@
... |
0908c6cb1370373a7bb4ab69d34c2fcf15637eac | remove debug lines | index.js | index.js | import React,{Component} from 'react'
import {
CameraRoll
,Image
,Platform
,StyleSheet
,View
,Text
,Dimensions
,TouchableOpacity
,ListView
} from 'react-native'
import SGListView from 'react-native-sglistview'
class CameraRollPicker extends Component{
constructor(props) {
super(props);
... | JavaScript | 0.000093 | @@ -1260,30 +1260,8 @@
)%7D)%0A
- console.log()%0A
@@ -1553,17 +1553,16 @@
;%0A %7D%0A
-%0A
this
@@ -2066,31 +2066,8 @@
a)%7B%0A
- console.log(data);%0A
|
20fd986c630277453447e706b9707a462c447d9d | add git-emacs | index.js | index.js | /**
* parser optarg
*
* @class parser
*/
function parser(optstring, argv, opts) {
var ii;
if (!(this instanceof parser))
return new parser(optstring, argv);
this.optind = 2;
this.opterr = 1;
this.options = {};
// create Array to save arg
this.argArray = new Array();
this.optArgv = new Array... | JavaScript | 0.000001 | @@ -2545,16 +2545,17 @@
ay;%0A%7D;%0A%0A
+%0A
module.e
|
3e757479b273a4dab57784133db354dc5b23b2a4 | Remove Content-Length by default as we're streaming | index.js | index.js | 'use strict';
var zipline = require('zipline')
, parse = require('url-parse')
, zlib = require('zlib')
, vary = require('vary');
/**
* Attempt to detect if we're dealing with a legacy implementation of Opera
* which requires the use of a slightly different message encoding
*
* @param {Object} query Query st... | JavaScript | 0 | @@ -2435,16 +2435,91 @@
= 200;%0A%0A
+ this.res.removeHeader('Content-Length'); // We're streaming%0A
this.r
@@ -2563,16 +2563,38 @@
unked');
+ // Chunked encoding
%0A this.
@@ -2632,24 +2632,48 @@
'no-cache');
+ // Don't cache us.
%0A this.res.
@@ -2710,16 +2710,41 @@
alive');
+ /... |
1b08c663ac2489075aae6e2d03e7f37365447312 | Remove type ahead | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-cli-bootstrap-tagsinput' ,
included: function(app) {
this._super.included.apply(this, arguments);
app.import(app.bowerDirectory + '/typeahead.js/dist/typeahead.bundle.js');
app.import(app.bowerDirectory + '/bootstrap-tagsinput/src... | JavaScript | 0 | @@ -176,88 +176,8 @@
);%0A%0A
- app.import(app.bowerDirectory + '/typeahead.js/dist/typeahead.bundle.js');%0A%0A
@@ -353,107 +353,8 @@
');%0A
- app.import(app.bowerDirectory + '/bootstrap-tagsinput/src/bootstrap-tagsinput-typeahead.css');%0A
%7D%0A
|
4a895b3f0db417fe5d3261b463f1dd641f146886 | set encoding utf-8 | index.js | index.js | #! /usr/bin/env node
var Marked = require('marked')
var highlight = require('./highlight')
var opts = require('optimist').argv
var fs = require('fs')
Marked.setOptions({
highlight: function (code, lang) {
if(lang == 'js') {
return highlight(code)
}
return code
}
})
function html (t)... | JavaScript | 0.000572 | @@ -437,24 +437,103 @@
' %3Chead%3E')%0A
+html(' %3Cmeta http-equiv=%22Content-Type%22 content=%22text/html; charset=utf-8%22%3E')%0A
if(opts.css)
@@ -607,25 +607,24 @@
h.css', 'utf
--
8'))%0A html(
@@ -736,17 +736,16 @@
0%5D, 'utf
--
8')))%0Aht
|
000a39581a64062cba112525ebe8b673d91da49f | Tweak `decimals` `option` to be initialized with a default value | index.js | index.js | /*
Copyright (c) 2013, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/
'use strict';
exports.units = pureGridUnits;
// -----------------------------------------------------------------------------
// IE < 8 has issues with rounding,... | JavaScript | 0.000001 | @@ -2202,26 +2202,102 @@
-options = extend(%7B
+// Apply defaults to any non-specified %60options%60.%0A options = extend(%7B%0A decimals: 4,%0A
%0A
@@ -2508,13 +2508,8 @@
mals
- %7C%7C 4
) +
|
7138720d039e8f741a3498c031740813aad84a3c | detect media message | index.js | index.js | var PythonShell = require('python-shell');
var mongoose = require('mongoose');
var zerorpc = require('zerorpc');
var colors = require('colors');
var beneficiary = require('./src-node/beneficiary');
var config = require('./config.json');
var db = require('./src-node/db');
// Interactuar con yowsup (python) desde node
v... | JavaScript | 0.999897 | @@ -449,24 +449,78 @@
arse(input);
+%0A input.body = (input.body) ? input.body : 'media';
%0A%0A benefi
@@ -596,105 +596,81 @@
-db.reply(input.body, (err, res) =%3E %7B%0A // console.log(err
+// Obtener mensaje desde base de datos%0A db.reply(input
,
+(
res)
-; // error y res, trabajar
... |
df98f89095b505fc928c496682978f999a512178 | Test null stamp before typeof | index.js | index.js | var Adapter = require("socket.io-adapter");
module.exports = adapter;
function SimpleCache(size) {
this.size = size;
this.cache = {};
}
SimpleCache.prototype.reset = function() {
this.cache = {};
};
SimpleCache.prototype.resetRoom = function(room) {
delete this.cache[room];
};
SimpleCache.prototype.get = function... | JavaScript | 0 | @@ -745,16 +745,44 @@
p(st) %7B%0A
+%09if (st == null) return st;%0A
%09switch(
@@ -902,32 +902,8 @@
st;%0A
-%09%09case null: return st;%0A
%09%09de
|
19defeee487cb9732a7699f2af09d76f921bc627 | Add callback if player is not online | index.js | index.js | "use strict";
var BuycraftAPI = require("buycraft-js");
var Query = require("mcquery");
var Rcon = require("rcon");
var sleep = require("sleep");
var async = require("async");
var c = require("./config.json");
var debug = c.DEBUG;
var client = new BuycraftAPI(c.BUYCRAFT_API_KEY);
var rclient = new Rcon(c.MINECRAFT_SERV... | JavaScript | 0.000002 | @@ -5710,32 +5710,115 @@
%7D);%0A
+ %7D else %7B%0A cb();%0A
|
ebe3ec6b5e8d4c620d40f820b951dd6c9bdbca55 | Set appropriate file stat times (#763) | index.js | index.js | const chalk = require('chalk');
const PluginError = require('plugin-error');
const replaceExtension = require('replace-ext');
const stripAnsi = require('strip-ansi');
const through = require('through2');
const clonedeep = require('lodash/cloneDeep');
const path = require('path');
const applySourceMap = require('vinyl-s... | JavaScript | 0.000001 | @@ -3391,24 +3391,147 @@
m-reassign%0A%0A
+ if (file.stat) %7B%0A file.stat.atime = file.stat.mtime = file.stat.ctime = new Date(); // eslint-disable-line%0A %7D%0A%0A
cb(null,
|
dd223ed68c77d408fcbd284bf280d8596e02144a | add eventEmitter, rename to use twit client. Should work the same? | index.js | index.js | "use strict";
var thenify = require('thenify');
module.exports = function(client) {
var wrap = {};
Object.keys(client).forEach(function (key) {
wrap[key] = client[key];
});
Object.keys(Object.getPrototypeOf(client)).forEach(function (key) {
wrap[key] = thenify(client[key].bind(client)... | JavaScript | 0 | @@ -40,16 +40,67 @@
enify');
+%0Avar EventEmitter = require('events').EventEmitter;
%0A%0Amodule
@@ -118,16 +118,17 @@
function
+
(client)
@@ -132,18 +132,16 @@
nt) %7B%0A
-
-
var wrap
@@ -148,18 +148,16 @@
= %7B%7D;%0A%0A
-
Object
@@ -189,32 +189,173 @@
ction (key) %7B%0A
+ wrap%5Bkey%5D = client... |
8a3702e5006fadaf13ab761a90602dae26f9f6ab | enable cors | index.js | index.js | var Hapi = require('hapi');
var Ineter = require('ineter');
var ineter = new Ineter();
// Create a server with a host and port
var server = new Hapi.Server();
server.connection({
host: '0.0.0.0',
port: process.env.PORT || 5000
});
// Add the route
server.route({
method: 'GET',
path:'/',
handler: function(r... | JavaScript | 0.000001 | @@ -225,16 +225,48 @@
%7C%7C 5000
+,%0A routes: %7B%0A cors: true%0A %7D
%0A%7D);%0A%0A//
|
f90317887b3e124aa73584ad935da2645c2050f9 | Fix dirname tests for custom impl | index.js | index.js | 'use strict';
var path = require('path');
var isAbsolute = require('is-absolute');
var pathRoot = require('path-root');
var MapCache = require('map-cache');
var cache = new MapCache();
module.exports = function(filepath) {
if (typeof filepath !== 'string') {
throw new TypeError('parse-filepath expects a string'... | JavaScript | 0 | @@ -1192,30 +1192,33 @@
n() %7B%0A
-return
+var dir =
path.dirnam
@@ -1222,32 +1222,149 @@
name(filepath);%0A
+ if (dir === '.') %7B%0A return (filepath%5B0%5D === '.') ? dir : '';%0A %7D else %7B%0A return dir;%0A %7D%0A
%7D);%0A%0A def
|
bd1b7f8eeeb02b79814fc5c69b0a2d5f831da936 | UPDATE all dependencies listed at beginning of file | index.js | index.js | 'use strict';
var css = require('./css')
, less = require('./less')
, fs = require('fs')
, path = require('path')
, mkdirp = require('mkdirp')
, writer = require('write-to-path')
module.exports = function (opts, cb) {
if (typeof opts === 'string') opts = {entry: opts};
if (typeof cb === 'string') opts.o... | JavaScript | 0 | @@ -182,16 +182,64 @@
o-path')
+%0A , autoprefixer = require('autoprefixer-core')
%0A%0Amodule
@@ -668,63 +668,8 @@
) %7B%0A
- var autoprefixer = require('autoprefixer-core');%0A
|
1232a54ae832d7004777c88284bc521e5976c81b | remove cd | index.js | index.js | var express = require('express');
var app = express();
var MongoClient = require('mongodb').MongoClient
, assert = require('assert');
var db = MongoClient.connect("penn_db");
//get random from 1 to 100000
//return "num : {x,y}" from mongo
var num = Math.floor(Math.random() * (100000 - 1001 + 1)) + 1001;
var url = 'm... | JavaScript | 0.000006 | @@ -854,11 +854,8 @@
e();
-cd
%0A
|
88434c67cc5471cb8db3afdfc128738c8e785a58 | simplify inProgress logic | index.js | index.js | var async = require("async");
var events = require("events");
var qs = require("querystring");
var _ = require("lodash");
var needle = require("needle");
/* Constants
*/
var CACHE_RETRY_TTL = 2*60*60*1000; // if we don't find an item, how long does it stay in the cache as "not found" before we retry it
var MAX_CACHE... | JavaScript | 0.006236 | @@ -1082,50 +1082,8 @@
1%5D;%0A
- delete inProgress%5Btask.hash%5D;%0A
@@ -2603,50 +2603,8 @@
%0A
- delete inProgress%5Btask.hash%5D;%0A
@@ -3540,16 +3540,86 @@
= true;
+%0A retriever.once(hash, function() %7B delete inProgress%5Bhash%5D %7D);
%0A%0A
@@ -4140,272 +... |
9c86678bc5634a962f3c3a0e7c68571f9502f4cd | upgrade token bug fixed | index.js | index.js | var express = require('express');
var conf=require('./config').conf;
var request = require('request');
var _=require("underscore");
var moment = require('moment');
var jwt = require('jwt-simple');
var async=require('async');
var currentRoles={};
exports.checkAuthorization = function(req, res, next) {
var token =... | JavaScript | 0 | @@ -7781,139 +7781,8 @@
n);%0A
- value.authToken=_.difference(role%5Bmethod%5D,value.authToken);%0A newRole=value.authToken;%0A role%5Bmethod%5D=newRole;%0A
|
d72050e7a602d4e7a3bab253c0c098e90246f9e7 | Add client routes in production | index.js | index.js | const http = require('http');
const bodyParser = require('body-parser');
const cors = require('cors');
const express = require('express');
const isProduction = process.env.NODE_ENV === 'production';
if (!isProduction) require('dotenv').config();
var app = express();
const PORT = process.env.PORT || 4000;
const serve... | JavaScript | 0.000001 | @@ -22,16 +22,46 @@
'http');
+%0Aconst path = require('path');
%0A%0Aconst
@@ -862,16 +862,40 @@
tic(
-'public'
+path.resolve(__dirname, 'build')
))%0A
@@ -928,16 +928,271 @@
es'));%0A%0A
+// Render the client routes if any other URL is passed in%0A// Do this ony in production. The local client server is used ot... |
e05b726839ff56a35160fca533a7b47531840bd4 | update to support es6 classes | index.js | index.js | 'use strict';
// import
const _ = require('underscore');
const objectAssign = require('object-assign');
const express = require('express');
const glob = require('glob');
const path = require('path');
// default config
const defaultConfig = {
src: './src',
spa: {
path: '/release',
index: 'index.html'
},... | JavaScript | 0 | @@ -348,16 +348,152 @@
r logic%0A
+const isClass = (t) =%3E %7B%0A return typeof t === 'function' && (/%5E%5Cs*class%5Cs+/.test(t.toString()) %7C%7C /_class%5CS+/i.test(t.toString()));%0A%7D%0A%0A
const lo
@@ -946,24 +946,97 @@
fault;%0A %7D
+%0A %0A if (isClass(instance)) %7B%0A instance = new instan... |
82ef1c47fdd8bc39663e178fb7f336728772f502 | Validate views on initialization | index.js | index.js | 'use strict';
var forEach = require('es5-ext/object/for-each')
, ensureObject = require('es5-ext/object/valid-object')
, getRouter = require('controller-router')
, ensureView = require('site-tree/ensure-view')
, create = Object.create, stringify = JSON.stringify;
module.exports = function (viewMap,... | JavaScript | 0 | @@ -714,16 +714,27 @@
%09view =
+ensureView(
viewConf
@@ -734,24 +734,25 @@
iewConf.view
+)
;%0A%09%09%09routes%5B
@@ -878,16 +878,41 @@
ic path%0A
+%09%09%09ensureView(viewConf);%0A
%09%09%09route
|
a8abfcf4a922731a7ffae154a681119f68f6b91e | use const and add more logs | index.js | index.js | /* eslint no-console: 0 */
"use strict";
var path = require("path");
var fs = require("fs-extra");
var yaml = require("yaml-front-matter");
var chalk = require("chalk");
var { cloneDeep } = require("lodash");
var REGEX_NEWLINES = /^\n+/;
var REGEX_NO_FOLDER = /^[^\/]+(\/index)?$/;
function yamlMarkdownToHtml(args) {... | JavaScript | 0 | @@ -34,19 +34,21 @@
trict%22;%0A
-var
+const
path =
@@ -65,19 +65,21 @@
ath%22);%0A%0A
-var
+const
fs = re
@@ -97,19 +97,21 @@
xtra%22);%0A
-var
+const
yaml =
@@ -140,19 +140,21 @@
tter%22);%0A
-var
+const
chalk =
@@ -172,19 +172,21 @@
halk%22);%0A
-var
+const
%7B clone
@@ -214,19 +214,21 @@
ash%22);%... |
74d820a164a8734043290f7000073ea1a55530c9 | Change back to stringy | index.js | index.js | /**
* @file This is a tweetable quotes tag plugin for the Hexo static site generator.
* @copyright Chathu Vishwajith 2015-2016
* @author Chathu Vishwajith
* @license MIT
*/
const path = require('path');
const nunjucks = require('nunjucks');
const querystring = require('querystring');
nunjucks.configure(__dirname,... | JavaScript | 0.00144 | @@ -489,13 +489,8 @@
eet?
-text=
'+qu
@@ -503,24 +503,33 @@
ing.
-escape(
+stringify(%7B%22text%22:
quote+%22
-%5Cn
-%22+a
@@ -533,16 +533,35 @@
%22+author
+,%22via%22:%22iamchathu%22%7D
);%0A%0A%09con
|
e4b7455a7b5448a4716dadf73fc6546818c98bd7 | Tweak logging. | index.js | index.js | "use strict";
var $ = require("jquery");
var http = require("http");
var request = require("request");
var when = require("when");
var unfold = require("when/unfold");
var delay = require("when/delay");
var fantvEmail = "edit@me";
var fantvPassword = "edit me";
var netflixEmail = "edit@me";
var netflixPassword = "edi... | JavaScript | 0 | @@ -455,16 +455,34 @@
t = 0;%0A%0A
+log(new Date());%0A%0A
loginToF
@@ -4806,111 +4806,8 @@
%7D%0A
- else %7B%0A throw %22Could not find AddToQueue or QueueDelete URL for %22 + title + %22.%22;%0A %7D%0A
%0A
|
28d4e19b102a245c429568df09a0db9366903ce6 | fix text selection in the first row | index.js | index.js | exports.decorateConfig = (config) => {
const macosCSS = `
.header_header {
top: 0;
right: 0;
left: 0;
}
.tabs_borderShim {
display: none;
}
.tabs_title {
display: none;
}
.tabs_list {
margin-left: 0;
}
.tab_tab:first-of-type {
border-left-w... | JavaScript | 0.000111 | @@ -1405,155 +1405,282 @@
-if (props.tabs.length %3C= 1) %7B%0A classTerms.setAttribute('style', 'margin-top: 0')%0A %7D else %7B%0A classTerms.setAttribute('style',
+var header = document.getElementsByClassName('header_header')%5B0%5D%0A if (props.tabs.length %3C= 1) %7B%0A classTe... |
78cdcec6afe2344dc21f4d9fe0ba105e624dbbcd | Print file content when we can't find a pattern in it | index.js | index.js | /**
* Collection of test assertions helpers
*
* It mixes in the native node.js `assert` module. So you can just use this module as a
* drop-in replacement.
*
* @mixes nodejs/assert
* @example
* var assert = require('yeoman-assert');
*/
'use strict';
var fs = require('fs');
var _ = require('lodash');
var pat... | JavaScript | 0 | @@ -2851,32 +2851,55 @@
file, 'utf8');%0A%0A
+ var match = false;%0A
if (typeof r
@@ -2921,34 +2921,32 @@
g') %7B%0A
-assert.ok(
+match =
body.indexOf
@@ -2961,106 +2961,78 @@
%3E -1
-, file + ' did not
+;%0A %7D else %7B%0A
match
-%5C'' +
+=
regex
- + '%5C'.');%0A return;%0A %7D... |
8e4387a74ca5516071b67ebbe8e2a9fc91ab865e | Fix XO lint issue | index.js | index.js | 'use strict';
const path = require('path');
const gutil = require('gulp-util');
const through = require('through2-concurrent');
const prettyBytes = require('pretty-bytes');
const chalk = require('chalk');
const imagemin = require('imagemin');
const plur = require('plur');
const defaultPlugins = ['gifsicle', 'jpegtran'... | JavaScript | 0 | @@ -2529,24 +2529,78 @@
null, file);
+ // eslint-disable-line promise/no-callback-in-promise
%0A%09%09%09%7D)%0A%09%09%09.c
|
7de281fb4af2c7189146ec57e9db3191186ac845 | Add cache headers | index.js | index.js | var path = require('path');
var koala = require('./lib');
var fs = require('fs');
var PORT = process.env.PORT || 5000;
var ENV = process.env.NODE_ENV || 'development';
var app = koala({
fileServer: {
root: __dirname + '/dist/',
index: true,
maxAge: '1 day'
}
});
app.listen(PORT);
co... | JavaScript | 0.000001 | @@ -272,20 +272,18 @@
max
-A
+a
ge:
-'1 day'
+86400
%0A
|
d33ae4f8bea875e0c1a36821514dfab90873131e | Handle errors | index.js | index.js | 'use strict';
require('es6-promise').polyfill();
require('whatwg-fetch');
const url = require('url'),
querystring = require('querystring').parse;
const registry = 'http://npm-registry.herokuapp.com';
const query = querystring(window.location.search.slice(1)).q;
if (query) {
window.fetch(url.resolve(registr... | JavaScript | 0.000004 | @@ -352,23 +352,212 @@
=%3E
-response.json()
+%7B%0A if (response.status %3E= 400) %7B%0A document.write(response.status %3C 500 ? 'Package does not exist' : 'Internal server error');%0A %7D%0A else %7B%0A return response.json();%0A %7D%0A %7D
)%0A
|
2707d05fc91cac1bd73cbb61b7960789d8c30241 | Send accept requests. | index.js | index.js | function Node (id, address, generateProposalId) { // :: Int -> Int -> (Int) -> Node
this.io = require('socket.io')
this.id = id
this.address = address
this.acceptors = {} // ID -> [address, last proposal]
this.proposal = null
this.value = null
this.stateLog = {}
this.roles = []
this.quorum = null
th... | JavaScript | 0 | @@ -1,16 +1,46 @@
+var dgram = require('dgram')%0A%0A
function Node (i
@@ -50,16 +50,22 @@
address,
+ port,
generat
@@ -124,31 +124,41 @@
his.
-io = require('socket.io
+socket = dgram.createSocket('udp4
')%0A
@@ -196,16 +196,35 @@
address%0A
+ this.port = port%0A
this.a
@@ -1598,16 +1598,317 @@
Num = 1%0A
... |
ac6007fc67a5c13a7bb95117a2dcd8a7a37f04b4 | Debug the error | index.js | index.js | /**
* @file This is a tweetable quotes tag plugin for the Hexo static site generator.
* @copyright Chathu Vishwajith 2015-2016
* @author Chathu Vishwajith
* @license MIT
*/
const path = require('path');
const nunjucks = require('nunjucks');
const querystring = require('querystring');
nunjucks.configure(__dirname,... | JavaScript | 0.000008 | @@ -284,16 +284,18 @@
ing');%0A%0A
+//
nunjucks
|
0a97e536be3728f9029c9b3df2881af89530a208 | Replace component emitter with native emitter | index.js | index.js | /**
* @module st8
*
* Micro state machine.
*/
var Emitter = require('component-emitter');
var isFn = require('is-function');
var isObject = require('is-plain-object');
/** Defaults */
State.options = {
leaveCallback: 'after',
enterCallback: 'before',
changeCallback: 'change',
remainderState: '_'
};
/**
... | JavaScript | 0.00009 | @@ -73,25 +73,14 @@
re('
-component-emitter
+events
');%0A
|
4ec482d3968cbec02de9a4a4c709c69d399ed8ab | add stylus parameter support | index.js | index.js | function stylusSvg(stylus, svgDirs) {
var nodes = stylus.nodes;
var utils = stylus.utils;
var fs = require('fs');
var path = require('path');
function svgImport(expression, css) {
var svg = expression.nodes[0];
// assert that the node (svg) is a String node, passing
// the ... | JavaScript | 0 | @@ -176,17 +176,21 @@
gImport(
-e
+pathE
xpressio
@@ -192,19 +192,32 @@
ession,
-css
+stylusExpression
) %7B%0A
@@ -230,17 +230,21 @@
r svg =
-e
+pathE
xpressio
@@ -970,19 +970,29 @@
- //
if (
-css
+stylusExpression
!==
@@ -1013,18 +1013,116 @@
-//
+ var css = stylusExpression.nodes%5... |
41c3782f64545375e8e90b9f54ef563b4bd8dffe | Fix - remove extra space from max-age header | index.js | index.js |
'use strict';
const UnitMultiplier = { };
UnitMultiplier.seconds = 1;
UnitMultiplier.minutes = 60 * UnitMultiplier.seconds;
UnitMultiplier.hours = 60 * UnitMultiplier.minutes;
UnitMultiplier.days = 24 * UnitMultiplier.hours;
UnitMultiplier.weeks = 7 * UnitMultiplier.days;
UnitMultiplier.months = 30 * U... | JavaScript | 0 | @@ -792,17 +792,16 @@
max-age=
-
' + maxA
|
759b63328ac34ae3a9cbbad0d862c7cb3f05787f | Support engines | index.js | index.js | /*jshint node:true*/
/* global require, module */
'use strict';
var Funnel = require('broccoli-funnel');
var BabelDefeatureify = require('./lib/babel-defeatureify');
var BabelRemoveImports = require('./lib/babel-remove-imports');
var TemplateDefeatureify = require('./lib/template-defeatureify');
var StyleDefeatureify =... | JavaScript | 0 | @@ -663,16 +663,193 @@
ments);%0A
+ %0A // if no feature flag config, look for its parent%0A var _app = app;%0A while (_app.app && !this._hasFeatureFlagConfig(_app.registry)) %7B%0A _app = _app.app;%0A %7D%0A
this
@@ -885,16 +885,17 @@
arent',
+_
app.regi
@@ -900,16 +900,168 @@
gistry);
+%... |
faebe0c1a3e256894a02fceaa427a3ecd5ee4998 | Load dist vue2Dropzone for older browser | index.js | index.js | var component = {}
if (process.browser) {
component = require('vue2-dropzone')
}
component.name = 'dropzone'
component.render = function (createElement) {
const that = this._self
return createElement('div', {
props: that.props,
attrs: {
class: 'vue-dropzone dropzone',
... | JavaScript | 0 | @@ -74,16 +74,37 @@
dropzone
+/dist/vue2Dropzone.js
')%0A%7D%0Acom
|
b6b1ff95ba5bec7a5ab6beb9aa2d2f300be03dbd | Update appsScript.js | appsScript.js | appsScript.js | // TODO: Clean up code. Make more DRY.
// Create a trigger based off a form submit if you would like this to run every time a new entry is recorded
function createEvent() {
var sheet = SpreadsheetApp.getActiveSheet(); // *Only works if this Apps Script is tied to your Google Sheet
var rows = sheet.getDataRange();
... | JavaScript | 0 | @@ -1,16 +1,21 @@
// TODO:
+%0A// *
Clean u
@@ -20,17 +20,21 @@
up code
-.
+%0A// *
Make mo
@@ -43,12 +43,57 @@
DRY
-.
%0A//
+ * Add repeatable event funcionality%0A%0A// NOTE:
Cre
@@ -272,16 +272,17 @@
(); // *
+
Only wor
|
29797372dcf0d860a3acedbeacb6b7f4d6addc69 | fix default select option | resources/assets/scripts/components/float-labels.js | resources/assets/scripts/components/float-labels.js | import fastdom from 'fastdom/fastdom';
class FloatLabelComponent {
constructor(el, options = {}) {
this.options = Object.assign({
showClass: 'is-active',
focusClass: 'is-focus',
activeClass: 'has-float-labels',
}, options);
this.$wrapper = $(el);
// This wont work for checkboxes o... | JavaScript | 0.000005 | @@ -1535,26 +1535,72 @@
ut, textarea
-,
+').trigger('checkval');%0A this.$wrapper.find('
select').tri
@@ -1603,30 +1603,28 @@
.trigger('ch
-eckval
+ange
');%0A %7D%0A%0A /
|
07e3581cc91b8b2984cf149bfbeaf32f2c885912 | Add Filter of URL Names for Use in Output Files | js/casper.js | js/casper.js | var fs = require('fs');
var links;
function getLinks() {
var links = document.querySelectorAll('.nav-link.t-nav-link');
return Array.prototype.map.call(links, function (e) {
return e.getAttribute('href')
});
}
casper.start('http://192.168.13.37/index.php', function() {
fs.write('tests/validati... | JavaScript | 0 | @@ -213,17 +213,18 @@
('href')
+;
%0A
-
%7D);%0A
@@ -333,16 +333,13 @@
put/
-homepage
+index
.htm
@@ -491,16 +491,743 @@
.length;
+%0A // Get the word before .html.twig, the word before the last '/' and the word in urls like '/lexicon'%0A var regex = /((%5Cw*)(%5C/%7C.html.twig)$)%7C(%5C/%5Cw*$)/gm;%0A ... |
343caefb75631bc5f062cee16c04eccd310f5218 | Fix race in error handling test | test/integration/connection-pool/error-tests.js | test/integration/connection-pool/error-tests.js | var helper = require(__dirname + "/../test-helper");
var pg = require(__dirname + "/../../../lib");
pg = pg;
//first make pool hold 2 clients
pg.defaults.poolSize = 2;
//get first client
pg.connect(helper.config, assert.success(function(client, done) {
client.id = 1;
pg.connect(helper.config, assert.success(fu... | JavaScript | 0.000002 | @@ -464,32 +464,63 @@
on(isGreater) %7B%0A
+ console.log(isGreater)%0A
var kill
@@ -626,24 +626,24 @@
tate = $1';%0A
-
var
@@ -874,25 +874,9 @@
%7D%0A
- done2();
%0A
+
@@ -1106,16 +1106,17 @@
%7D);%0A
+%0A
@@ -1294,16 +1294,16 @@
killed%0A
-
@@ -13... |
2823b80941c3253956d0fcb9528426e2e9dc06db | update test on report manager | test/managers/inventory/report-manager/basic.js | test/managers/inventory/report-manager/basic.js | var helper = require("../../../helper");
var InventoryManager = require("../../../../src/managers/inventory/inventory-manager");
var ReportManager = require("../../../../src/managers/inventory/report-manager");
var reportManager = null;
before('#00. connect db', function (done) {
helper.getDb()
.then(db =>... | JavaScript | 0 | @@ -1169,32 +1169,33 @@
lization order%22)
+;
%0A
@@ -1842,16 +1842,17 @@
order%22)
+;
%0A
|
7d47736474fd6e61d2b9265632a02d798c363025 | Increase particle speed, increase far-bias, decresae fleck count | js/config.js | js/config.js | // NOTE: Not all config values may necessarily be changed at runtime. Some are
// mutated internally after intialization, meaning changing them at runtime may
// not work as expected.
/* *************************** */
/* * Basic spectrum settings * */
/* *************************** */
// BASIC ATTRIBUTES
var s... | JavaScript | 0 | @@ -2378,16 +2378,17 @@
nt = 0.0
+3
5; // fl
@@ -3235,16 +3235,18 @@
sBias =
+2.
2; // bi
@@ -3348,11 +3348,9 @@
y =
-2.8
+4
; //
|
1027b54dcd96cddbe4e27406a3e9e83bea76593d | add https test | test/spec/modules/colossussspBidAdapter_spec.js | test/spec/modules/colossussspBidAdapter_spec.js | import {expect} from 'chai';
import {spec} from '../../../modules/colossussspBidAdapter';
describe('ColossussspAdapter', function () {
let bid = {
bidId: '2dd581a2b6281d',
bidder: 'colossusssp',
bidderRequestId: '145e1d6a7837c9',
params: {
placement_id: 0
},
placementCode: 'placementid_... | JavaScript | 0.000001 | @@ -1424,32 +1424,38 @@
.url).to.equal('
+https:
//colossusssp.co
@@ -4668,16 +4668,22 @@
.equal('
+https:
//coloss
|
8963c0097df331c3ccb91e06f2cd902457ed3e99 | Update fallback versions. | js/config.js | js/config.js | app.config = {};
app.config.platform = 'ios';
app.config.framework = window.sessionStorage.getItem('ons-framework') || 'vanilla';
app.config.cdn = 'https://cdn.rawgit.com';
app.config.repos = {
onsenui: 'OnsenUI/OnsenUI-dist',
reactOnsenui: 'OnsenUI/react-onsenui'
};
app.config.versions = {
defaults: {
onsen... | JavaScript | 0 | @@ -331,9 +331,9 @@
-rc.
-3
+9
',%0A
@@ -354,17 +354,18 @@
i: '0.2.
-0
+22
'%0A %7D,%0A
|
d8311b43970c0fe55fa44bf09525bacef6a6ad5b | Correct naming | src/server/models/User.js | src/server/models/User.js | import crypto from 'crypto';
import mongoose from 'mongoose';
import jwt from 'jsonwebtoken';
import credentials from '../../../config/credentials';
const encodePassword = (rawPassword) => {
let recursiveLevel = 5;
while (recursiveLevel) {
rawPassword = crypto
.createHash('md5')
.update(rawPassword... | JavaScript | 0.000001 | @@ -149,22 +149,20 @@
%0A%0Aconst
-encode
+hash
Password
@@ -176,16 +176,21 @@
Password
+ = ''
) =%3E %7B%0A
@@ -618,22 +618,20 @@
set:
-encode
+hash
Password
@@ -762,14 +762,12 @@
===
-encode
+hash
Pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.