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 |
|---|---|---|---|---|---|---|---|
2f86000c11a60ebae469095f604338e0052df3dd | Check if type main files exist before copying types to dist | scripts/templates/build.js | scripts/templates/build.js | const shell = require("shelljs");
const pino = require("pino")({ prettyPrint: { forceColor: true } });
const yargs = require("yargs");
const fs = require("fs");
const path = require("path");
const { paths, mergeDirectories } = require("../../lib/node");
const concat = require("../../lib/node/concatJs");
const { runScr... | JavaScript | 0 | @@ -573,56 +573,61 @@
nst
-typesOutPath = paths.dist(%60$%7BnameSpaceId%7D/types%60
+mainTypeFilesSrcPath = path.join(typesSrcPath, %22main%22
);%0A
@@ -646,24 +646,32 @@
stsSync(
-typesOut
+mainTypeFilesSrc
Path)) %7B
@@ -686,16 +686,76 @@
urn;%0A %7D
+%0A%0A const typesOutPath = paths.dist(%60$%7BnameSpaceId... |
909be0fe839a61616bc62e93176a7ceb7f8fdd55 | Fix title rendering in redux example | example/redux/client/routes.js | example/redux/client/routes.js | /* @flow */
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import { App, NotFound } from './components/App.js';
import Home, { Who, How } from './components/Pages.js';
import { LogIn, SignUp } from './components/SignUp.js';
/**
* The route configuration for the whole app.
*/
export co... | JavaScript | 0.000001 | @@ -349,37 +349,8 @@
='/'
- title='Redux Example %7C Home'
com
@@ -378,16 +378,45 @@
dexRoute
+ title='Redux Example %7C Home'
compone
|
88054912159f83017885f4c56c1978dbd4b4ccea | Fix loading... label (XHR) | data/console/xhr/response-tab.js | data/console/xhr/response-tab.js | /* See license.txt for terms of usage */
define(function(require, exports, module) {
const React = require("react");
// Firebug SDK
const { createFactories } = require("reps/rep-utils");
const { TreeView } = require("reps/tree-view");
const { Reps } = require("reps/repository");
// XHR Spy
const { Json } = require(... | JavaScript | 0 | @@ -1408,24 +1408,36 @@
if (!content
+ %7C%7C !content
.text) %7B%0A
@@ -1549,32 +1549,36 @@
DOM.div(
+%7B%7D,
%22Loading...%22)%0A
@@ -1752,16 +1752,20 @@
DOM.div(
+%7B%7D,
%22Loading
|
47ff752408b6688c155f84fee05393c6af0b82e5 | Use POST | app.js | app.js | // Import express and request modules
var express = require('express');
var request = require('request');
// Store our app's ID and Secret. These we got from Step 1.
// For this tutorial, we'll keep your API credentials right here. But for an actual app, you'll want to store them securely in environment variables.
... | JavaScript | 0 | @@ -1052,26 +1052,27 @@
t route%0Aapp.
-ge
+pos
t('/test', f
|
16cd4c86e3081608e359346577dc1d07f6bed312 | Add 'DOMContentLoaded' listeners for phantomJS | test/unit/modules/browser-events-spec.js | test/unit/modules/browser-events-spec.js | var assert = require('proclaim');
var Keen = require('../../../lib/browser');
describe('Keen.listenTo', function() {
beforeEach(function(){
Keen.domEvents = {};
});
it('should be a function', function(){
assert.isFunction(Keen.listenTo);
});
it('should create a Keen.domEvents object', function(){
... | JavaScript | 0 | @@ -2601,32 +2601,163 @@
s', function()%7B%0A
+ if (window.mochaPhantomJS && document.addEventListener) %7B%0A document.addEventListener('DOMContentLoaded', function() %7B%0A
var btn = do
@@ -2795,24 +2795,28 @@
o-anchor');%0A
+
Keen.lis
@@ -2821,32 +2821,36 @@
istenTo(%7B%0A
+
'... |
2e390794edea210d70b64dbcbca932a70e788d4e | Use change event in device-orientation example | examples/device-orientation.js | examples/device-orientation.js | goog.require('ol.DeviceOrientation');
goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.dom.Input');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
var view = new ol.View2D({
center: [0, 0],
zoom: 2
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol... | JavaScript | 0 | @@ -621,24 +621,16 @@
ion.on('
-property
change',
@@ -654,180 +654,251 @@
%7B%0A
-// event.key is the changed property name%0A var element = document.getElementById(event.key);%0A if (element) %7B%0A element.innerHTML = deviceOrientation.get(event.key);%0A %7D
+$('#alpha').text(deviceOrientation.getAlpha() +... |
770b16660503dea4a67675aaff0191eee1c272a3 | remove unused comma | src/rules.js | src/rules.js | // rules
// TODO:
// Waiting for URL Pattern specs
// https://developer.mozilla.org/en-US/docs/Web/API/URLPattern
export const rules = [
{
patterns: [
/http(s?):\/\/thanhnien.vn\/*/
],
unwanted: [
'.morenews',
'.zone--media',
'.zone--timeline'
]
},
{
patterns: [
... | JavaScript | 0.004075 | @@ -1202,12 +1202,11 @@
%5D%0A %7D
-,
%0A%5D%0A
|
9cf300b99893d86338d849c8b6d134bb181881b6 | test for port | app.js | app.js | // Clapp.Kerberos
// v. 0.1.0
console.log('\n\t\t\t\t== Clapp.Kerberos ==');
// =======================
// libraries =========
// =======================
var express = require("express");
var app = express();
var path = require('path');
var http = require('http').Server(app);
var io = require("socket.io")... | JavaScript | 0.000001 | @@ -916,9 +916,9 @@
t =
-5
+3
000;
|
b2521a5a0d14e1c5dc717054d8e645f1e1c17ee6 | Add more endpoints, and default to US if none provided | app.js | app.js | // See https://github.com/yagop/node-telegram-bot-api
var TelegramBot = require('node-telegram-bot-api');
// See https://github.com/t3chnoboy/amazon-product-api
var amazon = require('amazon-product-api');
// List of supported Amazon endpoints
var amazonEndpoints = {
'IT' : 'webservices.amazon.it'
};
// Telegram AP... | JavaScript | 0 | @@ -269,36 +269,244 @@
%0A '
-IT' : 'webservices.amazon.it
+US' : 'webservices.amazon.com',%0A 'CA' : 'webservices.amazon.ca',%0A 'IT' : 'webservices.amazon.it',%0A 'DE' : 'webservices.amazon.de',%0A 'UK' : 'webservices.amazon.co.uk',%0A 'ES' : 'webservices.amazon.es',%0A 'FR' : 'webservices.amazon.fr
'%0A%7D;... |
8e36afd1e50b91efcbf606cddbc5aa1dcc59430d | disable ubidots, enable beebotte | app.js | app.js | /*
* before anything else, make __root available
*/
// global.$__root = __dirname;
var config = require('./config');
// console.log('CONFIG', config)
// var express = require('./lib/liveio');
var express = require('express');
//Configure DB
require('./lib/setup/db')(config.db);
//MODELS
require('./models')();
var... | JavaScript | 0 | @@ -634,24 +634,83 @@
server);%0A
+ require('./clients/beebotte')(app, payload.server);%0A //
require('./
|
0ac146c6b6f0b54a355275d6d4ecfec6c2d2cb3e | use 2 space as tab indention | app.js | app.js | var restify = require('restify');
var mongoose = require('mongoose');
var config = require('./config');
var restifyRoutes = require('restify-routes');
var server = restify.createServer({
name: 'lybica',
version: '1.0.0'
});
server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser())... | JavaScript | 0 | @@ -181,18 +181,16 @@
erver(%7B%0A
-
name:
@@ -199,18 +199,16 @@
ybica',%0A
-
versio
@@ -384,18 +384,16 @@
next) %7B%0A
-
res.he
@@ -434,18 +434,16 @@
, '*');%0A
-
return
@@ -581,18 +581,16 @@
ion() %7B%0A
-
consol
|
446e2d08020fa51c1077a137b3c3bd6e9d94bf9f | Add empty line at the end of file | test/acceptance/mvt.js | test/acceptance/mvt.js | require('../support/test_helper');
const assert = require('../support/assert');
const TestClient = require('../support/test-client');
function createMapConfig (sql = TestClient.SQL.ONE_POINT) {
return {
version: '1.6.0',
layers: [{
type: "cartodb",
options: {
... | JavaScript | 0.000006 | @@ -1507,8 +1507,9 @@
%7D);%0A%7D);
+%0A
|
719afc5779ee929c4c1c84cae50a4ca85605f112 | Fix redis inconsistencies | app.js | app.js |
// Require dependencies
var express = require('express');
var app = express();
var http = require('http');
var server = http.createServer(app);
var io = require('socket.io').listen(server);
var redis = require('redis');
var client = redis.createClient();
// assuming io is the Socket.IO server object
io.configure(func... | JavaScript | 0.999973 | @@ -216,28 +216,8 @@
is')
-;%0Avar client = redis
.cre
@@ -493,22 +493,16 @@
%0A redis
-Client
.lpush(%22
@@ -556,22 +556,16 @@
redis
-Client
.ltrim(%22
@@ -715,22 +715,16 @@
redis
-Client
.lrange(
|
8c913b06eafdf3491e3bb3336e764d1e6eadf15d | Fix #16 Add next() to routes for files ending in .html, corrects the bug where headers were already sent before Express could set basic headers for terminal server messages. | app.js | app.js | /* NOTE: Does NOT work when placed in the js folder, even when adding /../ before routes! */
// require the express module, set to variable called app
var express = require('express'),
app = express(),
path = require('path'),
port = 3000;
// set a route for the root of the server
app.get('/', function(req... | JavaScript | 0 | @@ -310,32 +310,38 @@
unction(req, res
+, next
) %7B%0A res.sendFi
@@ -378,24 +378,34 @@
ex.html'));%0A
+ next();%0A
%7D);%0A%0A// othe
@@ -445,32 +445,38 @@
unction(req, res
+, next
) %7B%0A res.sendFi
@@ -509,32 +509,42 @@
/index.html'));%0A
+ next();%0A
%7D);%0A%0Aapp.get('/a
@@ -567,32 +567,38 @@
uncti... |
87fc902b6f2d8c2e7e59244be1c4f783bf559ab3 | Test /style.css | test/app/index.test.js | test/app/index.test.js | const app = require('../../app')
const request = require('supertest')
const t = require('tap')
const { version } = require('../../package.json')
t.test('/healthz')
t.test('/version', (t) => request(app)
.get('/version')
.expect('Content-Type', /text\/plain/)
.expect(200)
.expect(version)
)
t.test('/style.css... | JavaScript | 0.000001 | @@ -314,17 +314,144 @@
yle.css'
-)
+, (t) =%3E request(app)%0A .get('/style.css')%0A .expect('Content-Type', /css/)%0A .expect(200)%0A .expect(/%5C*%5Cs*%5C%7B%5Cs*box-sizing:/)%0A)%0A
%0At.test(
|
832b9bc1d5cacf67f1882c6f821f0b0ed4b7cdf8 | Update mood calculation | app.js | app.js | // Connecting dependencies
var Twitter = require('twitter');
var dotenv = require('dotenv');
var five = require('johnny-five');
var board = new five.Board();
// Loading environment variables
dotenv.load();
// Connecting to Twitter
var client = new Twitter({
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer... | JavaScript | 0 | @@ -923,25 +923,23 @@
var mood
-Amplifier
+Compare
= %7B%0A l
@@ -947,12 +947,10 @@
ve:
+8
0
-.87
,%0A
@@ -954,19 +954,17 @@
%0A joy:
-0.8
+2
5,%0A sup
@@ -973,12 +973,10 @@
se:
+8
0
-.75
,%0A
@@ -986,12 +986,10 @@
er:
-0.86
+28
,%0A
@@ -998,12 +998,9 @@
vy:
-0.84
+1
,%0A
@@ -1012,12 +101... |
24e00a8da594e11061a5bd9f3c49913caf7ef03e | remove views and change error handling | app.js | app.js | var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var http = require ('http');
var mongoose = require('mongoose');
var uristring =
process.env.MONGO... | JavaScript | 0 | @@ -209,24 +209,60 @@
y-parser');%0A
+var passport = require('passport');%0A
var http = r
@@ -741,111 +741,8 @@
);%0A%0A
-// view engine setup%0Aapp.set('views', path.join(__dirname, 'views'));%0Aapp.set('view engine', 'jade');%0A%0A
// u
@@ -997,76 +997,51 @@
use(
-express.static(path.join(__dirname, 'public')));... |
9ea654138d4de9fd373de46bee83396cde8a6a05 | fix a test for ws | test/arraybuffer/ws.js | test/arraybuffer/ws.js | var expect = require('expect.js');
var eio = require('../../');
describe('arraybuffer', function() {
this.timeout(30000);
it('should be able to receive binary data when bouncing it back (ws)', function(done) {
var binaryData = new Int8Array(5);
for (var i = 0; i < 5; i++) {
binaryData[i] = i;
}
... | JavaScript | 0.003096 | @@ -993,35 +993,8 @@
ket(
-%7B transports: %5B'polling'%5D %7D
);%0A
@@ -1019,32 +1019,74 @@
', function() %7B%0A
+ socket.on('upgrade', function() %7B%0A
socket.sen
@@ -1096,24 +1096,26 @@
inaryData);%0A
+
socket
@@ -1141,24 +1141,26 @@
%E2%82%AC%E2%82%AC');%0A
+
socket.on('m
@@ -... |
8baf6d090174c104e3053153bbf0cf27f7acd13d | add body-parser | server/index.js | server/index.js | const React = require('react');
const { renderToStaticMarkup } = require('react-dom/server');
const { match, RouterContext } = require('react-router');
const express = require('express');
const path = require('path');
const pug = require('pug');
const webpack = require('webpack');
const { port, isDev } = require('./co... | JavaScript | 0.002976 | @@ -274,16 +274,59 @@
bpack');
+%0Aconst bodyParser = require('body-parser');
%0A%0Aconst
@@ -559,16 +559,96 @@
app.use(
+bodyParser.urlencoded(%7B extended: true %7D));%0Aapp.use(bodyParser.json());%0Aapp.use(
express.
@@ -667,30 +667,8 @@
ic')
-);%0Aapp.use('/api', api
);%0Aa
@@ -719,16 +719,38 @@
, port);
+%... |
1921bfddb726eac93abd89e8b7668bf912cd38fb | change ip detection | app.js | app.js | //Required modules
var request = require('request');
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
//Routes
app.get('/', funct... | JavaScript | 0.000001 | @@ -549,19 +549,27 @@
ket.
-handshake.a
+client.conn.remoteA
ddre
@@ -727,24 +727,69 @@
address);%0A%0A
+ //we call the api to get the country%0A
var
@@ -852,53 +852,8 @@
s;%0A%0A
- //we call the api to get the country%0A
|
ccf8c7044ebd4118bb80defea8c67c80bd0701a7 | add user class | server/index.js | server/index.js | // PiMonitor.js
var http = require("http"),
https = require("https"),
crypt3 = require("crypt3"),
express = require('express'),
url = require("url"),
path = require("path"),
fs = require("fs"),
os = require("os"),
colors = requi... | JavaScript | 0.000001 | @@ -5883,16 +5883,77 @@
%0A%0A%0A%0A*/%0A%0A
+function User(username)%0A%7B%0A this.username = username;%0A%7D%0A%0A%0A%0A
raspberr
|
3e792945afad3194f42f570b4116c020f0e33d1a | Update for returning details. | app.js | app.js | var express = require('express');
var app = express();
// var redis = require('redis');
// var client = redis.createClient();
var pg = require('pg');
var connString = 'postgres://vil:kzciaMUwTvd4y9Q0KYI6@localhost/namesandsongs';
app.get('/namesandsongs/api/song', function(request, response) {
//this starts init... | JavaScript | 0 | @@ -236,38 +236,24 @@
p.get('/
-namesandsongs/
api/song
', funct
@@ -240,24 +240,25 @@
t('/api/song
+s
', function(
@@ -317,33 +317,32 @@
connection pool
-
%0A%09//it will keep
@@ -387,33 +387,32 @@
able) 30 seconds
-
%0A%09//and set a li
@@ -432,33 +432,32 @@
so configurable)
-
%0A%09pg.connect(con
@@ -... |
a89ceb6a4ccfd0936d4bdc886d17ac4eae9b3582 | Update app logic to better handle websockets | app.js | app.js | const express = require('express');
const http = require('http');
const request = require('request');
const path = require('path');
const WebSocket = require('ws');
const compression = require('compression');
const app = express();
require('dotenv').config();
app.set('view engine', 'hbs');
app.use(compression());
ap... | JavaScript | 0.000001 | @@ -224,16 +224,65 @@
press();
+%0Aconst ws = new WebSocket(%60ws://localhost:2080%60);
%0A%0Arequir
@@ -601,58 +601,8 @@
s) %7B
-%0A%09const ws = new WebSocket(%60ws://localhost:2080%60);
%0A%0A%09l
@@ -1415,59 +1415,8 @@
%7D;%0A%0A
-%09const ws = new WebSocket(%60ws://localhost:2080%60);%0A%0A
%09let
|
4900bfaebb302dc130b2f4a6aac97c9e909fa552 | Fix typo and path issue; uncomment default intent | app.js | app.js | var restify = require('restify'),
builder = require('botbuilder'),
nconf = require('nconf');
// Create nconf environment to load keys and connections strings
// which should not end up on GitHub
nconf
.file({ file: './config.json' })
.env();
//=========================================... | JavaScript | 0 | @@ -952,16 +952,23 @@
t' : '
+static/
index.ht
@@ -1285,17 +1285,16 @@
uilder.I
-z
ntentDia
@@ -1729,18 +1729,16 @@
e')%0A
-//
.onDefau
|
fca73783eb69bf65a4bdff37e2ecc1a7c1e41118 | test filename as variable | app.js | app.js | #!/usr/bin/env node
//
// Detects triangles and quadrilaterals
//
// sourced from: https://github.com/peterbraden/node-opencv/tree/master/examples
var cv = require('opencv'),
colors = require("colors"),
Spacebrew = require('./sb-1.3.0').Spacebrew,
sb,
config = require("./machine"),
fs = require("fs"),
PN... | JavaScript | 0.000054 | @@ -339,16 +339,45 @@
.Png;%0A%0A%0A
+var filepath = './files/';%0A%0A%0A
/**%0A*%0A*
@@ -1468,32 +1468,77 @@
-fs.writeFile('image.png'
+var filename = filepath + 'image.png';%0A%0A fs.writeFile(filename
, bu
@@ -1566,18 +1566,8 @@
(err
-, filename
)%7B%0A
|
52a268ed63f934878aab3c5bd05f18c3c62748c4 | add dummy errorhandler | app.js | app.js | var express = require('express')
var url = require('url')
var telldus = require('telldus')
var ws = require("nodejs-websocket")
var port = process.env.PORT || 9000
var portWs = 9001
var app = express()
app.set('port', port)
app.use(express.static(__dirname + '/public'))
app.get('/api/on', function(request, response)... | JavaScript | 0.000001 | @@ -1295,40 +1295,59 @@
) %7B%0A
+%0A
+%7D)%0A
con
-sole.log(%22Received %22+str)
+n.on(%22close%22, function (code, reason) %7B%0A
%0A %7D
@@ -1351,37 +1351,37 @@
%7D)%0A conn.on(%22
-close
+error
%22, function (cod
@@ -1377,32 +1377,54 @@
nction (
-code, reason) %7B%0A
+err) %7B%0A console.log(%22E... |
04b849c2c3d019654b24a7a8aa469f8dd08d602e | fix UTC String in details view to really show a UTC time string | app.js | app.js | 'use strict';
const cluster = require('cluster');
const express = require('express');
const sqlite3 = require('sqlite3').verbose();
const db = global.db = new sqlite3.Database('./soon.db');
const bodyParser = require('body-parser');
const compression = require('compression');
const exphbs = require('express-handlebar... | JavaScript | 0 | @@ -4767,16 +4767,20 @@
= moment
+.utc
(end).fo
|
a8c002ad34880876b92ffa8001a786cf150ffa60 | Fix app.js, make it actually listen | app.js | app.js | var express = require('express')
, app = express()
app.get('/', function(req, res) {
res.send('./app/index.html')
}) | JavaScript | 0 | @@ -45,16 +45,52 @@
xpress()
+%0A , port = process.env.PORT %7C%7C 8080
%0A%0Aapp.ge
@@ -150,8 +150,81 @@
tml')%0A%7D)
+%0A%0Aapp.listen(port, function () %7B%0A console.log('Listening on ' + port)%0A%7D)
|
2021e0f3d70220579579b451540b622446b5104e | use new body parsers | app.js | app.js | 'use strict';
var a127 = require('a127-magic');
var express = require('express');
var app = express();
// configure usergrid-objects
var config = a127.config.load();
var Usergrid = require('usergrid-objects')(config.usergrid);
// ensure body is parsed
var bodyParser = require('body-parser');
app.use(bodyParser);
//... | JavaScript | 0.000001 | @@ -307,16 +307,76 @@
dyParser
+.urlencoded(%7B extended: false %7D));%0Aapp.use(bodyParser.json()
);%0A%0A// u
|
d0afbdb071b73f8612777ab9fa803762bd9aae7f | Fix health check path | app.js | app.js | /**
* Copyright 2017 The AMP HTML Authors. All Rights Reserved.
*
* 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 require... | JavaScript | 0.000008 | @@ -1149,16 +1149,17 @@
heck', '
+/
_ah/heal
|
8849a0ce33321062ec0c04ce5bfbe55c38a57199 | Add refresh delay of 30 seconds. | app.js | app.js | var request = require('request');
var fetchfeed = require('./fetchfeed.js');
var nxws = new fetchfeed();
var feeds = require('./feeds.json').remote;
var checkNewsInterval;
var db = require('monk')('localhost/newsdb');
var db_items = db.get('items');
function fetchFeeds() {
// console.log('Fetching', feeds.length, '... | JavaScript | 0 | @@ -239,15 +239,47 @@
et('
-items')
+rss_guids');%0A%0Avar REFRESH_DELAY = 30000
;%0A%0Af
@@ -486,13 +486,21 @@
%0A%7D,
-10000
+REFRESH_DELAY
);%0A%0A
@@ -792,16 +792,17 @@
link%0A %7D
+;
%0A if (n
@@ -955,16 +955,17 @@
(null ==
+=
d) %7B%0A
@@ -1066,23 +1066,36 @@
.insert(
+%7Bguid:
newItem
+.guid%7D
... |
6cba999a52c5791b2eeb721c62617e20b7791bcf | Fix no res.locals.user in api_v2 | app.js | app.js | /*
* This file is part of SYZOJ.
*
* Copyright (c) 2016 Menci <huanghaorui301@gmail.com>
*
* SYZOJ is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at... | JavaScript | 0.000002 | @@ -1837,24 +1837,115 @@
'tmp') %7D);%0A%0A
+ // This should before load api_v2, to init the %60res.locals.user%60%0A this.loadHooks();%0A
// Trick
@@ -2237,38 +2237,16 @@
base();%0A
- this.loadHooks();%0A
this
|
29071eee23739d47dd9957b7fbdfacd5dd2918d7 | Fix issue with old express usage | app.js | app.js | //var http = require('http');
var express = require('express');
var app = module.exports = express();
/*http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'});
res.end('Can i haz app.js host another one or probably?');
}).listen(4080);*/
app.get('/', functio... | JavaScript | 0.000003 | @@ -381,16 +381,59 @@
ten(4000
+, function() %7B%0A console.log('srv OK');%0A%7D
);%0Aconso
|
821993d9d9853bacc985650eb41acd0b7f57150c | Allow dynamic port | app.js | app.js | 'use strict';
require('rootpath')();
var app = require('express')();
// Setup database connection
require('app/middleware/db');
// Setup extra stuff for express
require('app/middleware/express')(app);
// Load all routes
require('app/routes')(app);
app.listen(5000, function() {
console.log('Server listening at htt... | JavaScript | 0.000001 | @@ -62,16 +62,53 @@
ess')();
+%0Avar port = process.env.PORT %7C%7C%C2%A05000;
%0A%0A// Set
@@ -294,20 +294,20 @@
.listen(
-5000
+port
, functi
@@ -368,14 +368,18 @@
ost:
-5000.'
+%25s.', port
);%0A%7D
|
6d0574b3934728f3396f721d605953152d8d8b2e | remove empty line | app.js | app.js | var restify = require('restify');
var builder = require('botbuilder');
var cheerio = require('cheerio');
var request = require('request');
var PDFParser = require('pdf2json');
var textract = require('textract');
//=========================================================
// Bot Setup
//===============================... | JavaScript | 0.999999 | @@ -704,16 +704,17 @@
ORD%0A%7D);%0A
+%0A
var bot
@@ -3398,16 +3398,22 @@
r) %7B%0A%09%09%09
+//TODO
%0A%09%09%7D%0A%09%7D)
|
d50965da4ea2c0d91a44bb55439332477b78d592 | Change public folder location | app.js | app.js | var express = require('express');
var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var app = express();
// Serve the Parse API on the /parse URL prefix
var parse = require('./parse... | JavaScript | 0.000001 | @@ -736,15 +736,8 @@
, '/
-client/
buil
|
3d610d1d588d41f7dcfaffd4e30f4c998fdad144 | Test fixes | test/direction.spec.js | test/direction.spec.js | describe('Direction parameter', function () {
before(function () {
fixture.setBase("test/fixtures");
fixture.load("static_position.html");
this.element = document.getElementById('static');
this.timeout = (Scrollmarks.config().scrollThrottle + 1) / 60 * 1000; // excepted execution + 1 frame
});
after(funct... | JavaScript | 0.000001 | @@ -1738,32 +1738,57 @@
nction (done) %7B%0A
+%09%09window.scrollTo(0, 0);%0A
%09%09var mark = Scr
@@ -2034,34 +2034,30 @@
indow.scroll
-WithEvent(
+To(0,
0);%0A%09%09%09done(
@@ -2195,34 +2195,30 @@
indow.scroll
-WithEvent(
+To(0,
100);%0A%0A%09%09var
|
d033c4f693c607c73df51463750396ddb02af65e | change shut down sequence | app.js | app.js | var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');
var config = require('./config');
var cleanup = require('.... | JavaScript | 0.000014 | @@ -1946,16 +1946,18 @@
+//
console.
|
f42695f11faaafa7b9239d4643aa4d301fbfd242 | Add patch | app.js | app.js | const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const { Schema } = mongoose;
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017';
mongoose.connect(MONGODB_URI);
const app = express();
app.use(express.static(`${__dirname}/publi... | JavaScript | 0.000001 | @@ -1101,24 +1101,308 @@
r %7D));%0A%7D);%0A%0A
+app.put('/antibodies/:id', (req, res) =%3E %7B%0A Antibody.remove(%7B _id: req.params.id %7D).then(() =%3E %7B%0A const antibody = new Antibody(req.body);%0A return antibody.save();%0A %7D).then((doc) =%3E %7B%0A res.json(doc.toJSON());%0A %7D).c... |
46520ef8bba0c8db73df621104f9994db2d735d7 | Rename voucher qualification API method, allow for optional query params | src/Vouchers.js | src/Vouchers.js | 'use strict'
const { encode, isFunction, isObject } = require('./helpers')
module.exports = class Vouchers {
constructor (client, balance) {
this.client = client
// public
this.balance = balance
}
create (voucher, callback) {
return this.client.post(`/vouchers/${encode(voucher.code)}`, voucher... | JavaScript | 0 | @@ -1566,28 +1566,20 @@
%0A%0A
-q
+getQ
ualifi
-cationRequest
+ed
(pa
@@ -1575,32 +1575,36 @@
alified (params,
+ qs,
callback) %7B%0A
@@ -1592,32 +1592,98 @@
qs, callback) %7B%0A
+ if (isFunction(qs)) %7B%0A callback = qs%0A qs = %7B%7D%0A %7D%0A
return this.
@@ -1733,20 +1733,28 @@
m... |
415c0fb0d6c564e08a2b046c12fe230df0ec9bbe | change inline function declaration | app.js | app.js | const lc = require('node-lending-club-api')
const loanUtils = require('./lib/loanUtils')
const nconf = require('nconf')
const moment = require('moment')
const winston = require('winston')
nconf.argv().file('global', './global.json').env()
const logger = new (winston.Logger)({
transports: [
new (winston.transpor... | JavaScript | 0.000001 | @@ -461,25 +461,16 @@
ng(true,
- function
(err, d
@@ -469,24 +469,27 @@
(err, data)
+ =%3E
%7B%0A handleE
@@ -881,23 +881,17 @@
ort(
-function
(a, b)
+ =%3E
%7B%0A
@@ -1076,33 +1076,24 @@
(investorId,
- function
(err, data)
@@ -1088,24 +1088,27 @@
(err, data)
+ =%3E
%7B%0A handl
@@ -1302,25 +130... |
ea0c1e3dbcf9ce04b8fa54c2a9a15e000d67ecc8 | tests should be expecting false not true on errors | test/exceptionTests.js | test/exceptionTests.js | var metaconfirm = require('../../meta-confirm');
var expect = require('chai').expect;
describe('meta-confirm Exceptions', function () {
"use strict";
describe('parameter exceptions', function () {
it('return an error if sending a null url without waiting for the timeout', function (done) {
... | JavaScript | 0.99999 | @@ -966,35 +966,36 @@
e, %22Expecting a
-Tru
+fals
e result from Me
@@ -1885,35 +1885,36 @@
(result).equals(
-tru
+fals
e, %22Expecting a
@@ -1905,35 +1905,36 @@
e, %22Expecting a
-Tru
+fals
e result from Me
@@ -2730,35 +2730,36 @@
(result).equals(
-tru
+fals
e, %22Expecting a
@@ -2748,37 +2748,36 @@
lse, ... |
d516ac97ba76dc5b98e799e2267c0e467141dda6 | update test case for #18 | test/extra_carriage.js | test/extra_carriage.js | var net = require('net'),
tap = require('tap'),
carrier = require('../lib/carrier.js');
tap.test("strips CR", function(t) {
var server;
var port = 4001;
var to_be_sents = ["ONE\r\nTWO\r", "\nTHREE\r\n"];
var expected = ["ONE", "TWO", "THREE"]
t.plan(3);
server = net.createServer(function(... | JavaScript | 0 | @@ -522,30 +522,21 @@
;%0A
-client.once('connect',
+var sendOne =
fun
@@ -544,22 +544,20 @@
tion
+
() %7B%0A
- while
+%09if
(to_
@@ -571,18 +571,26 @@
s.length
-)
+%3E 0) %7B%0A%09%09
client.w
@@ -620,29 +620,101 @@
));%0A
- client.end();%0A %7D
+%09%09setTimeout(sendOne, 100);%0A%09%7D else %7B%... |
139d6ef820e0bd8df469c87e6f52d3020dbd62a4 | Add waitFor after resize. @bug W-4011728@ @rev bvenkataraman@ | aura-components/src/test/components/uitest/virtualDataGrid_resizeTest/virtualDataGrid_resizeTestTest.js | aura-components/src/test/components/uitest/virtualDataGrid_resizeTest/virtualDataGrid_resizeTestTest.js | /*
* Copyright (C) 2013 salesforce.com, 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.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | JavaScript | 0.000001 | @@ -1857,32 +1857,117 @@
function(cmp) %7B%0A
+%09%09 this.waitForResize(cmp, 0, this.WIDTHS.initialWidths%5B0%5D);%0A%09%09%7D, function(cmp) %7B%0A
%09%09%09var grid = cm
@@ -3680,11 +3680,419 @@
%0A%09%09%7D%5D%0A%09%7D
+,%0A%09%0A%09waitForResize : function(cmp, columnIndex, initialSize) %7B%0A $A.test... |
8bd20d16623dbfdfb083052626e6490e66d76e96 | Fix email | src/back/app.js | src/back/app.js | var nodemailer = require('nodemailer');
var express = require('express');
var ses = require('nodemailer-ses-transport');
var bodyParser = require('body-parser');
var app = express();
var router = express.Router();
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }));
// par... | JavaScript | 0.999999 | @@ -1633,32 +1633,38 @@
res.
-json(%7Byo: info.response%7D
+redirect('echaurivinos.com.ar'
);%0A
|
c19071f6930ed3c6e80d50582c0a390544f606c3 | No empty lines | app.js | app.js | 'use strict'
const fs = require('fs')
const express = require('express')
const http = require('http')
const socketio = require('socket.io')
const PROD = process.env.NODE_ENV === 'production'
const ASSETS_BASE = PROD? '/' : 'http://localhost:3000/'
const app = express()
const server = http.Server(app)
const io = sock... | JavaScript | 0.998611 | @@ -456,19 +456,65 @@
f8')
-.split('%5Cn'
+%0A .split('%5Cn').filter(line =%3E line.trim()
)%0A
|
ead8ac8efa1f33dc37c92ceae4b46e45ebc49766 | Update noop with a for range loop. | app.js | app.js | #!/usr/bin/env node
var express = require('express')
var cors = require('cors')
var fs = require('fs');
var app = express();
var exec = require('child_process').exec;
var sha1 = require('sha1');
var bodyParser = require('body-parser');
var multer = require('multer');
var upload = multer();
const MAX_CODE_LENGTH = 20... | JavaScript | 0 | @@ -480,34 +480,55 @@
%7B%0A
-while (state.KeepRunning()
+for (auto _ : state) benchmark::DoNotOptimize(0
);%0A%7D
|
f49471d422a9682c73b03d5c3d053f8c972500ad | update tests | test/game-time-test.js | test/game-time-test.js | const assert = require("chai").assert;
const HangMan = require("../lib/game-time");
describe("HangMan", function(){
it('should be a function', function(){
assert.isFunction(HangMan);
});
it('should instantiate a new Hangman game', function () {
var hangman = new HangMan();
assert.isObject(hangman... | JavaScript | 0.000001 | @@ -78,18 +78,16 @@
ime%22);%0A%0A
-%0A%0A
describe
@@ -512,32 +512,37 @@
ex);%0A %7D);%0A%0A it
+.skip
('should return
@@ -583,9 +583,10 @@
and
-5
+10
', f
@@ -679,32 +679,37 @@
());%0A %7D);%0A%0A it
+.skip
('should return
@@ -827,32 +827,37 @@
));%0A %7D);%0A%0A%0A it
+.skip
('should have a
@@ -9... |
dac9fddc65cc4208db3d0fd88384d136c8d6491c | add get & set event | src/state.js | src/state.js | import Store from './store';
import ListenerTree from './listener-tree';
import {
parsePath,
stringifyPath,
arrayFromAllowNullOrUndefined,
} from './utils';
export default class State {
constructor({
store = new Store(),
cursor = [],
emitter = new ListenerTree(),
} = {}) {
this.__store = sto... | JavaScript | 0 | @@ -157,16 +157,252 @@
tils';%0A%0A
+const generateEmitterName = message =%3E %7B%0A if (message === 'get') %7B%0A return 'get';%0A %7D%0A // compatible legacy event%0A if (message === 'set' %7C%7C message === 'change') %7B%0A return 'set';%0A %7D%0A throw new Error('event not allowed');%0A%7D;%0A%0A
expo... |
a8dbe4a4af8f40be19593c4c1ed12a6e1651975d | Add Access-Control-Allow-Origin Header for localhost | app.js | app.js | "use strict";
const koa = require("koa");
const cash = require("koa-cash");
const stats = require("./lib");
const favicon = require("koa-favicon");
const cache = require("lru-cache")({
maxAge: 1000 * 60 * 60 * 24 // global max age = 1 Day
});
const port = process.env.PORT || 9090;
const app = koa();
app.use(fa... | JavaScript | 0.000001 | @@ -2250,24 +2250,89 @@
respond() %7B%0A
+ this.set(%22Access-Control-Allow-Origin%22, %22http://localhost%22);%0A
this.bod
@@ -2511,12 +2511,13 @@
port%7D%60);%0A%7D);
+%0A
|
5f9d454f3b07c31839c12ac87437d77e7e9c7f75 | Make loader tests dependent on base load | test/js/loader-test.js | test/js/loader-test.js | //window.LocalCache && LocalCache.reset();
function getSelector(sheetNum, ruleNum) {
var sheet = document.styleSheets[sheetNum] || {},
rules = sheet.cssRules || sheet.rules || {},
rule = rules[ruleNum] || {};
return rule.selectorText;
}
// Use setTimeout rather than $.ready to test the loader in the n... | JavaScript | 0.000001 | @@ -252,118 +252,8 @@
%0A%7D%0A%0A
-// Use setTimeout rather than $.ready to test the loader in the no jquery/zepto case%0AsetTimeout(function()%7B%0A
wind
@@ -270,34 +270,32 @@
%22Base Loader%22);%0A
-
asyncTest('load
@@ -306,34 +306,32 @@
', function() %7B%0A
-
expect(6);%0A%0A
@@ -328,18 +328,16 @@
... |
44526fd288e52be0707e9a3aed6ab2b25f338b1d | fix missing ; | test/lib/pageLoader.js | test/lib/pageLoader.js | /**
* Created by Eric Wu on 7/26/14.
*/
var pageLoader = require('../../lib/pageLoader');
var should = require('should');
var url = "http://www.google.com"
describe("pageLoader", function( ){
it('Should load the web page', function (done) {
pageLoader(url, function (err, body) {
if(err) t... | JavaScript | 0.000003 | @@ -153,16 +153,17 @@
gle.com%22
+;
%0A%0Adescri
|
702a332ab9a55f2d7a72d82781414c9d7075acbb | Revert "試験的に async を使用するようにした" | src/store.js | src/store.js | import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import { baseURL, getCall, postCall } from './rest'
Vue.use(Vuex)
export const mutations = {
setItem(state, newItem) {
state.item = newItem
},
setRecipe(state, newRecipe) {
state.recipe = newRecipe
},... | JavaScript | 0 | @@ -669,22 +669,16 @@
s = %7B%0A
-async
setItem(
@@ -703,24 +703,24 @@
newItem) %7B%0A
+
postCall
@@ -1217,22 +1217,16 @@
%0A %7D,%0A
-async
setRecip
@@ -1754,22 +1754,16 @@
%0A %7D,%0A
-async
setPrice
@@ -1827,16 +1827,10 @@
%7D,%0A
+
-async
dele
|
7aa6e38fdabfcd22242a195fd42fe558346e1043 | Fix reply callback | app.js | app.js | 'use strict';
let https = require('https');
let db_query = require('./db');
function setWebhook() {
let options = {
host: "api.telegram.org",
path: `/bot${process.env.TELEGRAM_TOKEN}/setWebhook`,
method: "POST",
headers: {
'Content-Type': "application/json"
}
... | JavaScript | 0.000002 | @@ -1210,16 +1210,24 @@
ge(data.
+message.
chat.id,
|
a403c921fe4aca5fb2f9762a5cd2cd5729c453c0 | Fix default | src/store.js | src/store.js | import React from 'react'
import { reduce } from 'lodash'
import { Provider } from 'react-redux'
import persistState from 'redux-devtools/lib/persistState'
import promiseMiddleware from 'redux-promise'
import extendify from 'extendify'
import thunkMiddleware f... | JavaScript | 0.00001 | @@ -722,16 +722,41 @@
Context:
+ (store, options, http)=%3E
(%7B%7D),%0A
|
56baef81fe70398eca2e9c1a353ef11d9b0b9ca3 | fix `undefined` test | test/napi/lib/hello.js | test/napi/lib/hello.js | var addon = require('../native');
var assert = require('chai').assert;
describe('hello', function() {
it('should export a greeting', function () {
assert.equal(addon.greeting, "Hello, World!");
assert.equal(addon.greeting, addon.greetingCopy);
});
it('should export global singletons for JS primitives', ... | JavaScript | 0.000248 | @@ -373,16 +373,66 @@
fined);%0A
+ assert.ok(addon.hasOwnProperty('undefined'));%0A
asse
|
937a0e20bd93fb91c5cc5a7ca9445e8fa6c447df | Fix the key call to req.query | app.js | app.js | var http = require('http');
var hellobot = require('./hellobot');
var express = require('express');
var bodyParser = require('body-parser');
//var $ = require('jQuery');
var ig = require('instagram-node').instagram({});
var Slack = require('node-slack');
var slack = new Slack("https://hooks.slack.com/services/T0N3CEYE5... | JavaScript | 0.999452 | @@ -2849,17 +2849,17 @@
eq.query
-.
+%5B
'hub.cha
@@ -2865,16 +2865,17 @@
allenge'
+%5D
);%0A i
|
06672372eb6502e2ef2125c5adb608d54f0717d9 | Add an ASCII Art Playa logo on startup - Since ASCII art is awesome | app.js | app.js |
/**
* Module dependencies.
*/
var express = require('express');
var io = require('socket.io');
var http = require('http');
var app = express();
var server = http.createServer(app);
var playa = require('./shared/playa');
var port = process.argv[2];
if(port == undefined) {
port = 3000;
}
// Configuration
a... | JavaScript | 0 | @@ -2011,16 +2011,17 @@
(%22%7C __
+%5C
%5C%7C %7C
@@ -2209,20 +2209,23 @@
%7C_%7C%5C
+%5C
__,_%7C%5C
+%5C
__, %7C%5C
+%5C
__,_
|
047138d5c2d3b96b03a5dacafa7520da24f4d03b | Make grid smarter | app.js | app.js | import React from 'react';
import ReactDOM from 'react-dom';
import LazyLoad from 'react-lazy-load';
import Lightbox from 'react-image-lightbox';
import JustifiedLayout from 'react-justified-layout';
import Promise from 'es6-promise'; // For older browsers http://caniuse.com/#feat=promises
import fetch from 'whatwg-fet... | JavaScript | 0.000002 | @@ -3238,12 +3238,48 @@
ght=
-%2280%22
+%7B72%7D containerPadding=%7B0%7D boxSpacing=%7B6%7D
con
|
9f7ce20759b6790a844b1aac92cfbd183cbea319 | 修改抓取检测频率,预防因为服务器问题而出现未抓取的情况 | app.js | app.js | var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var request = require('superagent');
var session = require('express-session');
var index = r... | JavaScript | 0 | @@ -838,17 +838,35 @@
/ %E6%AF%8F%E5%A4%A9 01:
-0
+10,05:10,09:10,13:1
0 %E4%BB%8EBing%E6%8A%93
@@ -898,11 +898,19 @@
('0
+1
0 1
+,5,9,13
* *
|
1c2456553e1a00e7ff13b196867f0a5ce17a3e4e | Fix initial object list loading. Closes #11. | app.js | app.js | var codeObjects = {};
var express = require('express');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var home = require('./routes/index')(codeObjects);
var playground = require(... | JavaScript | 0 | @@ -1707,24 +1707,180 @@
tp().io();%0A%0A
+function makeFullUpdate(playground) %7B%0A var objectIds = Object.keys(codeObjects%5Bplayground%5D);%0A return %7BplaygroundId: playground, objectIds: objectIds%7D;%0A%7D%0A%0A
app.io.route
@@ -2005,25 +2005,8 @@
data
-,%0A objectIds
;%0A%0A
@@ -2128,62 +2128,8 @@
... |
8baf0b8be353485a859970a7ea066dd9004fbe8a | Change back mongodb URI | app.js | app.js | const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const contactRoutes = require('./routes/contactsRouter');
const userRoutes = require('./routes/usersRouter');
const app = express();
// Use body-parser middleware
app.use(bodyParser.json());
// Use Exp... | JavaScript | 0.000014 | @@ -594,32 +594,93 @@
%7C%7C '
-Database address go here
+mongodb://achowdhury2015:absolute2895@ds025263.mlab.com:25263/achowdhury-mean-contact
', %7B
|
c63f4f9dfb8f3156740a9067265fa409ec133854 | edit of app.js | app.js | app.js | "use strict";
var path = require("path");
var express = require("express");
var config = require('./config')
var fs = require("fs");
var https = require("https");
var app = express();
var http = express();
var clavePrivada = fs.readFileSync(config.private_key).;
var certificado = fs.readFileSync(config.cer... | JavaScript | 0.000001 | @@ -265,17 +265,16 @@
ate_key)
-.
;%0D%0Avar c
|
12f84e9753b73f326c7c32a840c9ccf00168e5ec | Make sure mocha.done function call is without arguments. | test/removeListener.js | test/removeListener.js | /*jslint node: true */
"use strict";
var H = require('../index').EventEmitter;
var _ = require('underscore');
var assert = require('assert');
describe('HevEmitter on', function () {
describe('removeListener', function () {
it('should NOT trigger one level method after one level removal', function (done)... | JavaScript | 0.000001 | @@ -539,36 +539,55 @@
.then(
-done
+function () %7B done(); %7D
);%0A %7D);%0A%0A
@@ -1244,36 +1244,55 @@
.then(
-done
+function () %7B done(); %7D
);%0A %7D);%0A%0A
@@ -2304,36 +2304,55 @@
.then(
-done
+function () %7B done(); %7D
);%0A %7D);%0A%0A
@@ -3045,36 +... |
75507fac15ad30b8fd378eff1f850e80ad877b79 | Question 6 number game | app.js | app.js |
var userName = prompt ('Hello what\'s your name?').toUpperCase();
console.log ('Hello ' + userName + ' , nice to meet you!');
alert ('Hello' + ' ' + userName + ' ' + 'nice to meet you! I have a guessing game I would like you to play. Click the "ok" button to contiune.');
var counterRight = 0;
var counterWrong = 0;
var... | JavaScript | 0.999984 | @@ -3319,16 +3319,221 @@
ong);%0A%7D%0A
+var question6 = prompt ('Guess a number between 1 and 20, I%5C'll give you 4 tries');%0Awhile (guessNumberGame %3C 4 ) %7B%0A alert ('Guess again');%0A if (question6 === 8) %7B%0A alert ('Yep, you got it! ');%0A %7D%0A%7D%0A%0A
var petA
|
173cd401af093ac30884f670e09e7bd254107c13 | Remove invalid removeListener test. | test/removeListener.js | test/removeListener.js | /*jslint node: true */
"use strict";
var H = require('../index').EventEmitter;
var _ = require('underscore');
var assert = require('assert');
describe('HevEmitter on', function () {
describe('removeListener', function () {
it('should NOT trigger one level method after one level removal', function (done)... | JavaScript | 0 | @@ -3096,334 +3096,8 @@
);%0A%0A
- it('should NOT trigger one level method after two star removal', function (done) %7B%0A var h = new H();%0A var f = function () %7B%0A done();%0A %7D;%0A h.on(%5B'sadface'%5D, f);%0A h.removeListener(%5B'**'... |
1ea29ccc0760f9060d1c6eea2bfc42d435381509 | handle ? in path | app.js | app.js | // deprecating, replacing with serverless mode
var RUNNING_LOCAL = (document.location.host == 'localhost' || document.location.host == '127.0.0.1' || document.location.protocol == 'file:');
var API_URL = RUNNING_LOCAL ? 'http://0.0.0.0:5000/' : 'http://opentaba-server.herokuapp.com/';
// var API_URL = '/'; // server... | JavaScript | 0.999987 | @@ -4464,19 +4464,63 @@
ush_id'%5D
-);
+.split('?')%5B0%5D); // remove '?params' if exists
%0A%09%09%7D%0A%09);
|
8b995288d853136cd69fe293a7e2285f14ce17a9 | Remove empty module. | app.js | app.js | var processManager = require('./controllers/process-manager');
processManager.fork('/controllers/api');
processManager.fork('/controllers/fetching');
processManager.fork('/controllers/streaming');
module.exports = processManager;
| JavaScript | 0 | @@ -146,55 +146,8 @@
g');
-%0AprocessManager.fork('/controllers/streaming');
%0A%0Amo
|
7ff6c20240a6384b0c318138278d6770187fc578 | remove unused log | stackfanatic.js | stackfanatic.js | var args = require('system').args;
var page = require('webpage').create();
var env = require('system').env;
var googleEmail = args[1] || env.GOOGLE_EMAIL;
var googlePassword = args[2] || env.GOOGLE_PASSWORD;
var landingUrl = "http://stackoverflow.com/";
var loginUrl = "https://stackoverflow.com/users/login";
var goog... | JavaScript | 0.000002 | @@ -1430,53 +1430,8 @@
();%0A
- console.log(%22entered password%22);%0A
|
2add17f98b95b2beac50579b93da31a81c351675 | disable seedDB | server/config/environment/development.js | server/config/environment/development.js | 'use strict';
// Development specific configuration
// ==================================
module.exports = {
// MongoDB connection options
mongo: {
uri: 'mongodb://localhost/jagen-dev'
},
// Seed database on startup
seedDB: true
};
| JavaScript | 0.000001 | @@ -238,11 +238,12 @@
DB:
-tru
+fals
e%0A%0A%7D
|
77562c06cfe6ca4f3635285f408e4bd746c84d3b | add ca to coverage | test/servers/server.js | test/servers/server.js | 'use strict';
const sinon = require('sinon');
const http = require('http');
const https = require('https');
const server = require('../../servers/server');
const path = require('path');
const fs = require('fs');
const FIXTURE_PATH = path.join(__dirname, 'fixtures');
const CERT_FIXTURE_PATH = path.join(FIXTURE_PATH, '... | JavaScript | 0 | @@ -4560,32 +4560,50 @@
tlspassphrase',%0A
+ ca: 'ca',%0A
crl: 'tl
@@ -4782,32 +4782,54 @@
tlspassphrase',%0A
+ ca: 'ca',%0A
crl:
@@ -5723,35 +5723,30 @@
c
-rl: 'tlscrl
+a: 'ca
'%0A
|
f877ac56a4c7becd3639a4fce6e01d972f84b273 | make auto join check log current settings | server/discord/utils/collection/index.js | server/discord/utils/collection/index.js | const r = require('./../../../db');
const client = require('./../../');
const config = require('config');
function guildStats(guild) {
// Guild stats!
const bots = guild.members.filter(member => member.user.bot).length;
const users = guild.memberCount - bots;
const percentage = Math.floor((bots / guild.memberCount... | JavaScript | 0 | @@ -391,32 +391,42 @@
e %3E config.get('
+discord').
collection').per
@@ -411,34 +411,32 @@
ord').collection
-')
.percentage && g
@@ -458,32 +458,42 @@
t %3E config.get('
+discord').
collection').use
@@ -482,26 +482,24 @@
).collection
-')
.users;%0A%0A%09//
@@ -1558,32 +1558,42 @@
rs: config.get('
+discord').
... |
02e5c568c15034ee8f69c96372764703446e85a9 | Fix stepPaths resolution | server/services/business-process-flow.js | server/services/business-process-flow.js | // Service that propagates business process flow changes
'use strict';
var aFrom = require('es5-ext/array/from')
, ensureIterable = require('es5-ext/iterable/validate-object')
, ensureCallable = require('es5-ext/object/valid-callable')
, Set = require('es6-set')
, ensureType = req... | JavaScript | 0.000002 | @@ -1375,31 +1375,103 @@
s)).map(
-resolveStepPath
+function (shortPath) %7B%0A%09%09return 'processingSteps/map/' + resolveStepPath(shortPath);%0A%09%7D
);%0A%0A%09//
|
47a27fd5a27139b392d3050d5759097d1b9d91c9 | Refactor card rest api response | server/src/api/v1/card/cardController.js | server/src/api/v1/card/cardController.js | 'use strict';
const async = require ('async');
const models = require ('../../../models/index');
const config = require ('../../../config/config');
const log = require ('../../../libs/winston')(module);
const cardItemModel = models.cardItemModel;
const cardsModel = models.cardsModel;
const cardModel = mode... | JavaScript | 0 | @@ -1044,33 +1044,33 @@
rn res.status(40
-4
+0
).json(%7B%0A
@@ -1425,32 +1425,162 @@
%7D%0A %7D);%0A
+ %7D else if (!req.body.cards) %7B%0A return res.status(400).json(%7B%0A data: %7B%0A error: 'Please add cards'%0A %7D%0A %7D);%0A
%7D else %7B%0A a
@@ -2217,17 +2217,1... |
5a58c5ca2ee62ce13b20ce951f75485e9eb79bda | Rewrite tests for Tree constructor | test/spec/tree.spec.js | test/spec/tree.spec.js | describe ("Tree", function() {
it("should return a tree object", function(){
var tree=new Tree()
expect(tree).toBeDefined();
});
xit("should return tree with age 0 when created", function() {
var tree=new Tree();
expect(tree.age).toEqual(0);
});
xit("should have height 0 when created", functio... | JavaScript | 0.000001 | @@ -24,16 +24,19 @@
ion() %7B%0A
+%0A
it(%22sh
@@ -40,24 +40,33 @@
%22should
-return a
+instantiate a new
tree ob
@@ -84,16 +84,20 @@
tion()%7B%0A
+
var
@@ -92,33 +92,35 @@
var tree
-=
+ =
new Tree()%0A e
@@ -113,21 +113,31 @@
w Tree()
+;
%0A
+%0A
expect(t
@@ -156,25 +1... |
8bd3a36c6a1bb63583b4ade50c8c3c3b44096e38 | remove openDir when import from database | main-process.js | main-process.js | const ipcMain = require('electron').ipcMain;
const dialog = require('electron').dialog;
const async = require('async');
const path = require('path');
const nedb = require('nedb'),
db = new nedb({filename: path.join(__dirname, 'live.db'), autoload: true, onload: (err) => {}});
const ajax = require('./ajax');
fu... | JavaScript | 0.000001 | @@ -2674,25 +2674,8 @@
ile'
-, 'openDirectory'
%5D%0A
|
2641e59cd0015c936f0a1c13cb9c5cb1a9174eaa | Modify bind port: 8080 -> 8000 (test.websocket.js) | test/test.websocket.js | test/test.websocket.js | var should = require('should')
, ServerResponse = require('http').ServerResponse
, WebSocket = require('ws')
, WebSocketHandler = require('../lib/websocket');
describe('WebSocketHandler', function() {
var handler, ws;
beforeEach(function() {
handler = new WebSocketHandler({}, { port: 8080 });
ws = n... | JavaScript | 0 | @@ -296,17 +296,17 @@
port: 80
-8
+0
0 %7D);%0A
@@ -344,17 +344,17 @@
lhost:80
-8
+0
0');%0A %7D
|
852d2fd7a8bad7d329d49d2d9a70399e39691f0c | Test sending notification to an unregistered token | test/testUnregister.js | test/testUnregister.js | var mercurius = require('../index.js');
var request = require('supertest');
var assert = require('assert');
var nock = require('nock');
var crypto = require('crypto');
var urlBase64 = require('urlsafe-base64');
var testUtils = require('./testUtils.js');
var userCurve = crypto.createECDH('prime256v1');
var userPublicK... | JavaScript | 0 | @@ -1381,13 +1381,223 @@
);%0A %7D);
+%0A%0A it('replies with 404 on %60notify%60 after a registration has been removed', function(done) %7B%0A request(mercurius.app)%0A .post('/notify')%0A .send(%7B%0A token: token,%0A %7D)%0A .expect(404, done);%0A %7D);
%0A%7D);%0A
|
1a6edc458b5ccba82d8988c599a0ba3d5a01b0f3 | Enable another script injection test | chrome/test/data/extensions/api_test/executescript/removed_frames/test.js | chrome/test/data/extensions/api_test/executescript/removed_frames/test.js | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// A simple helper to keep track of how many responses are received, and fail
// if it receives a "fail" message. It's unfortunate that these are never
//... | JavaScript | 0 | @@ -1490,154 +1490,13 @@
%7D
+,
%0A
- // This is another great test to have, but currently it crashes in blink.%0A // TODO(devlin): Fix the crash in blink and enable this!%0A //
fun
@@ -1508,19 +1508,16 @@
() %7B%0A
- //
waitF
@@ -1579,19 +1579,16 @@
rl);%0A
- //
%7D%0A %5D);
|
580a00a3679713a6c548b38ab37507536e183669 | remove console | static/index.js | static/index.js | seajs.use(['$', 'placeholder', 'sticky', 'word-color', 'autocomplete'], function($, Placeholder, Sticky, wordColor, Autocomplete) {
Sticky.stick('#document-wrapper', 0);
var modules = [];
var urls = [
'http://spmjs.org/repository/arale/?define',
'http://spmjs.org/repository/gallery/?define',
'http:... | JavaScript | 0.000002 | @@ -4736,36 +4736,8 @@
);%0A%0A
- console.log(result);%0A%0A
@@ -4825,42 +4825,8 @@
);%0A%0A
- console.log(result);%0A %0A
|
1c372f7892199b84f128662fd71dc5795ec64348 | Remove extra debug lines in item test | test/tests/itemTest.js | test/tests/itemTest.js | describe("Zotero.Item", function() {
describe("#getField()", function () {
it("should return false for valid unset fields on unsaved items", function* () {
var item = new Zotero.Item('book');
assert.equal(item.getField('rights'), false);
});
it("should return false for valid unset fields on unsaved item... | JavaScript | 0 | @@ -1146,68 +1146,8 @@
D);%0A
-%09%09%09%09Zotero.debug('=-=-=');%0A%09%09%09%09Zotero.debug(item.parentID);%0A
%09%09%09%09
|
c0df6bc5f0959ae08aae1d723db115c51069fea9 | Fix test | test/tick-converter.js | test/tick-converter.js | "use strict";
const tickConverter = require("../src/tick-converter");
describe("tick-converter", function () {
it("is a function", () => {
assert("function" === typeof tickConverter);
});
[{
label: "No elapsed time",
tick: 0,
sequence: [1000],
expectedStep: 0,
... | JavaScript | 0.000004 | @@ -832,22 +832,33 @@
let
-result
+%7Bstep, remaining%7D
= tickC
@@ -902,23 +902,16 @@
assert(
-result.
step ===
@@ -949,15 +949,8 @@
ert(
-result.
rema
@@ -956,16 +956,18 @@
aining =
+==
expecte
|
a49379d216b33595525e796bddccfb4aed209a2b | Fix eslint | test/trailpack.test.js | test/trailpack.test.js | 'use strict'
const assert = require('assert')
const _ = require('lodash')
const WebServerTrailpack = require('../')
const Trailpack = require('trailpack')
describe('Web Server Trailpack', () => {
let pack
before(() => {
pack = global.app.packs.webservertest
})
it('should load', () => {
assert(pack)
... | JavaScript | 0.999541 | @@ -2377,13 +2377,13 @@
it:
-%22100%22
+'100'
,%0A
@@ -2400,11 +2400,11 @@
et:
-%220%22
+'0'
%0A
|
2e0f3de72c9781491ed572ad84b80776b07c9843 | add missing util require | test/transformation.js | test/transformation.js | var transform = require("../lib/6to5/transform");
var sourceMap = require("source-map");
var helper = require("./_helper");
var assert = require("assert");
var chai = require("chai");
var _ = require("lodash");
var run = function (task) {
var actual = task.actual;
var expect = task.expect;
var... | JavaScript | 0.000002 | @@ -184,24 +184,69 @@
re(%22chai%22);%0A
+var util = require(%22../lib/6to5/util%22);%0A
var _
|
17f04695e0548e093533d8b498d2b741bdc9daeb | Add user helpers to test service | test/twitterService.js | test/twitterService.js | 'use strict';
class TwitterService {
// House Keeping of our connection/server
constructor() {
this.server = undefined;
}
start(done) {
require('../server').then((server) => {
this.server = server;
done();
}).catch(done);
}
clearDB() {
this.server.db.dropDatabase();
}
sto... | JavaScript | 0.000001 | @@ -8,16 +8,61 @@
rict';%0A%0A
+const User = require('../app/models/user');%0A%0A
class Tw
@@ -588,16 +588,709 @@
/');%0A %7D
+%0A%0A // User API%0A getAPIUsers() %7B%0A return this.server.hapiServer.inject('/api/users');%0A %7D%0A%0A getAPIUser(id) %7B%0A return this.server.hapiSever.inject(%60/api/users... |
b6b03af002043a6b3d813d84315dde2365a5732e | Update search.js | store/search.js | store/search.js | /**
* Methods for search functionality
* */
const async = require('async');
const db = require('./db');
/**
* @param db - database object
* @param search - object for where parameter of query
* @param cb - callback
*/
function findPlayer(search, cb) {
db.first(['account_id', 'personaname', 'avatarfull']).from('... | JavaScript | 0.000001 | @@ -902,46 +902,8 @@
= ?%0A
- ORDER BY last_match_time DESC%0A
@@ -912,17 +912,17 @@
LIMIT
-1
+2
50) sear
@@ -923,17 +923,16 @@
) search
-
%0A
|
c9df22ea4e5934e01c12ec8903ae9b0df6fe25c1 | Remove image. | share/spice/chuck_norris/chuck_norris.js | share/spice/chuck_norris/chuck_norris.js | function ddg_spice_chuck_norris(api_result) {
if (api_result.type !== 'success') return;
Spice.render({
data : api_result.value,
source_url : 'http://www.icndb.com',
source_name : 'Internet Chuck Norris Database',
image : 'https://upload.wikimed... | JavaScript | 0 | @@ -267,157 +267,8 @@
e',%0A
- image : 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/ChuckNorris200611292256.jpg/48px-ChuckNorris200611292256.jpg',%0A
|
01d5e5149b23565ab91ee7b7c8ca3719eb5aea69 | Fix isPlainObject | src/utils.js | src/utils.js | 'use strict';
const cuid = require('cuid');
const { createHash } = require('crypto');
module.exports = {
toPlainOrEmptyObject: (obj) =>
typeof obj === 'object' && !Array.isArray(obj) ? obj : {},
nullIfEmpty: (o) => o && (Object.keys(o).length > 0 ? o : null),
isPlainObject: (obj) => typeof obj === 'object... | JavaScript | 0.003597 | @@ -290,16 +290,20 @@
(obj) =%3E
+%0A
typeof
@@ -341,16 +341,31 @@
ray(obj)
+ && obj != null
,%0A%0A nor
|
f996fef098eb561869c5e78488ada080be551577 | Handle unopened file descriptor 3 | src/utils.js | src/utils.js | import fs from "fs";
import repeat from "lodash.repeat";
import memoize from "lodash.memoize";
import types from "./types";
class TextStream {
constructor(input) {
this.input = input;
this.length = input.length;
this.char = 0;
this.consumed = null;
}
consume(regex) {
... | JavaScript | 0.000042 | @@ -3031,16 +3031,41 @@
%22EBADF%22
+ %7C%7C error.code == %22ENXIO%22
) %7B%0A
|
ea729df83823a204c7d4bdabd8cb97af2e54fdad | switch from Spice.render to Spice.add | share/spice/mass_on_time/mass_on_time.js | share/spice/mass_on_time/mass_on_time.js | function ddg_spice_mass_on_time (api_result) {
if (api_result.error) return;
var details = api_result['query-details'];
// Check the URL if we passed in the "current" word.
// This says if we should check for relevancy or not.
var script = $('[src*="/js/spice/mass_on_time/"]')[0];
var source =... | JavaScript | 0 | @@ -1665,14 +1665,11 @@
ice.
-render
+add
(%7B%0A%09
|
e454c110a52b55ac7ab0fb583e3560da42b7481f | active verbs | spec/data-table-spec.js | spec/data-table-spec.js | describe('dc.dataTable', function() {
var id, chart, data;
var dateFixture;
var dimension, group;
var countryDimension;
beforeEach(function() {
dateFixture = loadDateFixture();
data = crossfilter(dateFixture);
dimension = data.dimension(function(d) {
return d3.ti... | JavaScript | 0.000032 | @@ -1068,23 +1068,16 @@
it('
-should
generate
som
@@ -1072,16 +1072,17 @@
generate
+s
somethi
@@ -1169,26 +1169,16 @@
it('
-should be
register
ed',
@@ -1173,18 +1173,17 @@
register
-ed
+s
', funct
@@ -1272,25 +1272,16 @@
t('s
-ize should be set
+ets size
', f
@@ -1366,27 +1366,18 @@
t('s
+ets s
ortBy
... |
6c086d41b64a01e622b57b5e20845f82846f14f0 | Add check for java that gives a good error message. | bin.js | bin.js | #!/usr/bin/env node
/*
* Copyright 2016 Malte Ubl.
*
* 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 applicab... | JavaScript | 0 | @@ -1115,24 +1115,415 @@
exit(0);%0A%7D%0A%0A
+var javaCheck = require('child_process').spawnSync('java', %5B'-version'%5D);%0Aif (javaCheck.error) %7B%0A console.log('Splittable currently requires java to be installed and the ' +%0A 'command %60java%60 to work.%5Cn' +%0A 'Please install it for now and foll... |
09f0f40ed124c8d86044819a717d0970f57f1ed1 | Fix admin api URL | _js/admin/weight-app.js | _js/admin/weight-app.js | export { WeightApp }
function getMiddayOfDate(date) {
var middayOnDate = new Date(date);
middayOnDate.setHours(12);
middayOnDate.setMinutes(0);
middayOnDate.setSeconds(0);
middayOnDate.setMilliseconds(0);
return middayOnDate;
}
function cleanWeightResult(weight) {
if(weight) {
return weight.toFixed... | JavaScript | 0.000001 | @@ -473,16 +473,22 @@
.apiBase
+Health
Url + '/
@@ -993,16 +993,22 @@
.apiBase
+Health
Url%7D/hea
|
3b8d1780b324bbc3c19812acba44e354530af4d7 | Fix mac-only enter key regression | front_end/ui/ActionRegistry.js | front_end/ui/ActionRegistry.js | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {Action} from './Action.js';
import {Context} from './Context.js'; // eslint-disable-line no-unused-vars
/**
* @unrestricted
*/
export class Ac... | JavaScript | 0.000557 | @@ -1092,24 +1092,107 @@
%60);%0A %7D%0A
+ if (!extension.canInstantiate()) %7B%0A action.setEnabled(false);%0A %7D%0A
%7D%0A %7D%0A%0A
@@ -1749,16 +1749,36 @@
(action
+ && action.enabled()
) %7B%0A
|
06535708691f02ba4b8c739f50b32cf0a76eba98 | add prod url | frontend/config/environment.js | frontend/config/environment.js | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'frontend',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-co... | JavaScript | 0.000001 | @@ -1092,16 +1092,115 @@
ion') %7B%0A
+ ENV.baseURL = '/grocerylist/';%0A ENV.APP.API_HOST = 'http://internetfett.pythonanywhere.com';
%0A %7D%0A%0A
|
4acbec33eca0289a5a17d656d09d1e6179aeeb9e | add chosen congrat to logging | bot.js | bot.js | 'use strict'
require('dotenv').config()
var createMonitor = require('micro-monitor');
var procMetrics = require('numbat-process');
var Emitter = require('numbat-emitter');
var bole = require('bole');
var Twit = require('twit');
var congrats = require('./congrats');
const ellipsize = require('ellipsize');
var setting... | JavaScript | 0 | @@ -1405,22 +1405,32 @@
led
-congratulating
+to send %22$%7Bcongrat%7D%22 to
@$%7B
@@ -1517,24 +1517,28 @@
o(%60sent
+%22$%7B
congrat
-s
+%7D%22
to @$%7Bs
|
2a780f2132c867a996e78c1c0f1e9ef92d4a86fa | Add support for new @mention command syntax | bot.js | bot.js | /* Require modules */
var nodeTelegramBot = require('node-telegram-bot')
, config = require('./config.json')
, request = require("request")
, cheerio = require("cheerio");
/* Functions */
/**
* Uses the request module to return the body of a web page
* @param {string} url
* @param {callback} callb... | JavaScript | 0 | @@ -661,14 +661,14 @@
s %22/
-random
+dinner
%22 co
@@ -707,16 +707,58 @@
/dinner%22
+ %7C%7C message.text == %22/dinner@WhatToEatBot%22
) %7B%0A
|
ea5c8c45463757f9ad50be55353489b0711f792f | fix option name: "nextBtnHtml" to "closeBtnHtml" | abigimage.jquery.min.js | abigimage.jquery.min.js | (function(c){c.fn.abigimage=function(r){var f=c.extend(true,c.fn.abigimage.defaults,r);this.overlay=c("<div>").attr(f.overlayAttrs).css(f.overlayCSS).appendTo("body"),this.layout=c("<div>").attr(f.layoutAttrs).css(f.layoutCSS).appendTo("body"),this.wrapper=c("<div>").attr(f.wrapperAttrs).css(f.wrapperCSS).appendTo(this... | JavaScript | 0.997724 | @@ -663,20 +663,21 @@
.html(f.
-next
+close
BtnHtml)
@@ -2772,12 +2772,13 @@
%22%E2%97%84%22,
-next
+close
BtnH
@@ -3713,8 +3713,9 @@
Query));
+%0A
|
639c111e8825b6278b11662da54485e7d18065fd | FIX error with 2 bodies in answer | bot.js | bot.js | var config = require ('./config.js'),
xmpp = require('node-xmpp'),
fs = require('fs'),
cl = new xmpp.Client({jid: config.jid, password: config.password});
var plugins = {};
fs.readdirSync("./plugins").forEach(function(file) {
var p = require("./plugins/" + file);
for (var name in p) {
if (p... | JavaScript | 0 | @@ -2254,16 +2254,47 @@
rs.from;
+%0A stanza.remove('body');
%0A%0A
|
a68a1ddfdb888b03ce3fa2403da6acfc71100844 | Use js instead of php script for extracing csv data | export-csv.js | export-csv.js | /**
* A small plugin for getting the CSV of a categorized chart
*/
(function (Highcharts) {
var each = Highcharts.each;
Highcharts.Chart.prototype.getCSV = function () {
var columns = [],
line,
tempLine,
csv = "",
row,
col,
... | JavaScript | 0.000616 | @@ -636,13 +636,68 @@
%7C%7C
-'%5Cn';
+%22%250A%22; // '%5Cn' isn't working with the js csv data extraction
%0A%0A
@@ -2555,16 +2555,240 @@
csv.php%0A
+ // Instead of the php script on server side we get the csv info on client side%0A // original code from %0A // http://stackoverflow.com/questions/1783... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.