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 |
|---|---|---|---|---|---|---|---|
24f64e48635f7059887cb63528da8cc4112a3e6c | append exception about Dooray connection | app.js | app.js | import express from 'express'
import bodyParser from 'body-parser'
import request from 'request'
import menubot from 'menubot'
import commitbot from 'commitbot'
import { FIREBASE_URL } from './config'
const app = express()
app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json())
app.route('/')
... | JavaScript | 0.00007 | @@ -1261,45 +1261,186 @@
-const res = JSON.parse(response.body)
+let res = null%0A if (response && response.body) %7B%0A res = JSON.parse(response.body)%0A %7D else %7B%0A console.error('Connection err!')%0A return false%0A %7D
%0A
|
16ca2a5440571a1a41a5bb7e9ed917a14cc27f06 | Remove test links | app.js | app.js | var express = require("express");
var req = require('request');
var async = require('async');
var bodyParser = require('body-parser');
var app = express();
var ejs = require('ejs');
app.set('view engine', 'ejs');
app.use(express.static(__dirname + '/views'));
app.use('/assets', express.static('static'));
app.use(bod... | JavaScript | 0 | @@ -704,35 +704,32 @@
'0' %7D;%0A%0A
- //
var baseurl = '
@@ -775,32 +775,35 @@
jects/';%0A
+ //
var baseurl = '
@@ -2378,35 +2378,32 @@
'0' %7D;%0A%0A
- //
var baseurl = '
@@ -2449,32 +2449,35 @@
jects/';%0A
+ //
var baseurl = '
|
9b13eb9a3d477516a950fcd43bb32b4b10113a86 | add guests to local storage | app.js | app.js | var eventInput = document.querySelector('#eventInput');
var typeEventInput = document.querySelector('#typeEventInput');
var hostInput = document.querySelector('#hostInput');
var startTimeInput = document.querySelector('#startTimeInput');
var endTimeInput = document.querySelector('#endTimeInput');
var guestInput = docum... | JavaScript | 0 | @@ -1315,16 +1315,41 @@
ord);%0A%0A%0A
+%0Avar guestListArray = %5B%5D;
%0A%0Afuncti
@@ -1726,16 +1726,49 @@
lue='';%0A
+%09guestListArray.push(guestName);%0A
%0A%0A%7D%0A%0A%0A%0A%0A
@@ -3423,27 +3423,25 @@
= guest
-Input.value
+ListArray
;%0A%09let l
@@ -3593,26 +3593,382 @@
);%0A%09
-console.log(event)
+loca... |
bf1afcc2bd58b63fe19319f370e0fa061ccfbef6 | add robots.txt | 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.000001 | @@ -3824,11 +3824,8 @@
* %5Cn
-%5Cr
Allo
|
ed30becc07e45083dfb16a51bced79aff6d57a0e | update app and use list as index static route | app.js | app.js |
var express = require('express');
var app = express();
app.use(express.compress());
app.use(express.static(__dirname + '/public'));
app.listen(process.env.PORT || 3000); | JavaScript | 0 | @@ -1,12 +1,55 @@
+%0A/**%0A * material demo%0A * @type %7B%5Btype%5D%7D%0A */
%0Avar express
@@ -163,14 +163,12 @@
+ '/
-public
+dist
'));
|
3f9de041e77fe460d729c42a00707e92a5669290 | remove some messages | app.js | app.js | import express from 'express';
import bodyParser from 'body-parser';
import EnvConfig from './env.config.json';
import { Logger, postMessage, parseCommand, Constants } from './lib';
import { executeCommand, helpOptions } from './command';
const logger = Logger('app.js');
const app = express();
app.use(bodyParser.urle... | JavaScript | 0.000003 | @@ -1387,49 +1387,8 @@
ody;
-%0A logger.info('got webhook data', data);
%0A%0A
|
6b5758303844acff0787cfe77142618c8c0338a1 | add json lookup mechanism | app.js | app.js | // Copyright 2016, Google, 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 law or agreed to in wr... | JavaScript | 0.000001 | @@ -943,32 +943,28 @@
ode';%0Aconst
-EXPENSES
+CODE
_TYPE_ACTION
@@ -1000,24 +1000,20 @@
;%0Aconst
-EXPENSES
+CODE
_TYPE_AR
@@ -1761,24 +1761,20 @@
rgument(
-EXPENSES
+CODE
_TYPE_AR
@@ -1884,16 +1884,50 @@
a%5Bkey%5D;%0A
+ if (type === 'Expenses')%7B%0A
let
@@ -1965,16 +1965,115 @@
seCode;%0A
+ ... |
0754f71209cc93499474844e4fcb236382d46e8d | Add options to create https server. | app.js | app.js | const Koa = require('koa')
const app = new Koa()
const views = require('koa-views')
const json = require('koa-json')
const onerror = require('koa-onerror')
const bodyparser = require('koa-bodyparser')
const logger = require('koa-logger')
const http = require('http')
const https = require('https')
const config = require... | JavaScript | 0 | @@ -931,17 +931,16 @@
hods())%0A
-%0A
if (proc
@@ -1027,12 +1027,41 @@
ten(
-3000
+config%5Bprocess.env.NODE_ENV%5D.port
)%0A%7D
@@ -1102,24 +1102,179 @@
env.PROD) %7B%0A
+ const options = %7B%0A key: fs.readFileSync('/home/ssl/www.keisei.top.key', 'utf8'),%0A cert: fs.readFileSync('/home/ssl/www.keisei.to... |
81b05cc44c075c2b7fd2e67656f24055c01707ac | Change port | app.js | app.js |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http')
, path = require('path')
, log4js = require('log4js');
log4js.configure({
appenders: [{
'type' : 'dateFile',
'filename': __dirname + '/logs/access.log',
'pattern': '-yyyy-MM-... | JavaScript | 0.000001 | @@ -811,13 +811,12 @@
%7C%7C
-1
+3
000
-2
);%0A
|
527944bf91fae599723b15ac09534bc3116d003d | Add CORS | app.js | app.js | /**
* Created by jan on 15.05.15.
*/
var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var autoIncrement = require('mongoose-auto-increment');
var app = express(); //Create the Express app
//connect to our database
//Ideally you will obtain DB details from... | JavaScript | 0.000446 | @@ -826,16 +826,271 @@
ction);%0A
+%0Avar allowCrossDomain = function(req, res, next) %7B%0A res.header('Access-Control-Allow-Origin', '*');%0A res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');%0A res.header('Access-Control-Allow-Headers', 'Content-Type');%0A%0A next();%0A%7D;%0A%0A
//con... |
f9fa1afca8392404f4811c9b3f35d123601d9313 | add restify-validator import inside app | app.js | app.js | var restify = require('restify')
var server = restify.createServer()
var setup = require('./controllers/setup.js')
var userController = require('./controllers/userController.js')
setup(server, restify)
userController(server)
server.listen(8080, function () {
console.log('listening at', server.name, server.url)
}) | JavaScript | 0 | @@ -171,16 +171,68 @@
ler.js')
+%0Avar restifyValidator = require('restify-validator')
%0A%0Asetup(
@@ -246,16 +246,34 @@
restify
+, restifyValidator
)%0AuserCo
|
71454264aaa2ba9c9c48621a4038b402b25072d7 | validate data | app.js | app.js | var http = require('http');
var default_port = 1771;
var util = require('util')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { util.puts(stdout) }
http.createServer(function (req, res) {
var urlSplitOnSegment = req.url.split('?')[1];
if (urlSplitOnSegment != undefined) {
var urlS... | JavaScript | 0.001283 | @@ -500,16 +500,137 @@
= %22%22
+,%0A%09%09%09 validHouseCodes = %5B'a', 'b', 'c'%5D,%0A%09%09%09 validUnitCodes = %5B'1', '2', '3'%5D,%0A%09%09%09 validStatusCodes = %5B'-', '+'%5D
;%0A%0A%09%09%09fo
@@ -799,32 +799,42 @@
ouseCode = value
+.toLower()
;%0A%09%09%09%09%7D else if
@@ -955,16 +955,245 @@... |
c72eaa304ac2332ed97092a1e8012745f40bf360 | remove screens when no clients are attached | app.js | app.js | var express = require("express"),
app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
server.listen(process.env.PORT || 3000);
app.use(express.bodyParser());
var screens = {};
app.get('/api/screens', function(req, res){
//list screens along with curr... | JavaScript | 0 | @@ -1386,24 +1386,106 @@
nction () %7B%0A
+ //console.log(%22disconect%22, socket, screens%5Bsocket.screenName%5D.indexOf(socket))
%0A if(scre
@@ -1538,15 +1538,8 @@
-delete
scre
@@ -1560,17 +1560,24 @@
eenName%5D
-%5B
+.splice(
screens%5B
@@ -1610,19 +1610,113 @@
(socket)
+, 1);%0A%0A if(screens%... |
f0d6c9060968834681290b7e0d71d5718237bfb2 | change /commit route to a root post | app.js | app.js | var express = require('express'),
app = express.createServer(),
io = require('socket.io').listen(app),
sounds = require('./sounds'),
port = process.env.PORT || 5000;
// Config
io.configure(function () {
io.set('transports', ['xhr-polling']);
io.set('polling duration', 10);
});
app.configure(functi... | JavaScript | 0 | @@ -895,22 +895,16 @@
.post('/
-commit
', funct
|
f1686d6d96342e967aca7e97ddba34b306d18391 | Fix bug on get first word | app.js | app.js | const tjbot = require('./tjbotlib');
const config = require('./config/configs');
const credentials = config.credentials;
const WORKSPACEID = config.conversationWorkspaceId;
const hardware = ['microphone', 'speaker'];
const configuration = {
listen: {
microphoneDeviceId: 'plughw:1,0',
inactivityTimeout: 60,... | JavaScript | 0 | @@ -766,34 +766,57 @@
t%0A
-if (msg.startsW
+const name = msg.spl
it
-h
('
-Sara')
+ ')%5B0%5D.join();%0A if (name
) %7B%0A
@@ -863,11 +863,13 @@
-var
+const
tur
@@ -880,54 +880,41 @@
msg.
-toLowerCase().replace('Sara'.toLowerCase(), %22%22
+replace(/(sara,vara,sarah)*/i, ''
);%0A%0A
|
295f3a144a728d996bcbeaf574cca8e6cf642e22 | fix server hooking for self-signed paypro testing. | app.js | app.js | var express = require('express');
var http = require('http');
var app = express();
app.use('/', express.static(__dirname + '/'));
app.get('*', function(req, res) {
return res.sendfile('index.html');
});
app.start = function(port, callback) {
app.set('port', port);
app.use(express.static(__dirname));
if (pro... | JavaScript | 0 | @@ -757,104 +757,1410 @@
-server.on('request', function(req, res) %7B%0A app(req, res);%0A pserver.app(res, re
+pserver.removeListener('request', pserver.app);%0A pserver.on('request', function(req, res) %7B%0A var statusCode = res.statusCode;%0A%0A var headers = Object.keys(res._headers %7... |
270a3bea694c07cdc556562a95761413330cb497 | use gzip when serving statics for express | app.js | app.js |
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, '... | JavaScript | 0 | @@ -601,24 +601,53 @@
blic') %7D));%0A
+app.use(express.compress());%0A
app.use(expr
|
9b9ebb2879412fcdc34f8989687514d5b56321b8 | Test again | app.js | app.js | var express = require('express');
var playsApp = require('radio-plays');
var streamManager = require('stream-data');
var logfmt = require("logfmt");
var app = express();
var http = require('http');
var moment = require('moment');
var googleapis = require('googleapis');
var pg = require('pg');
var google_tokens = null;
... | JavaScript | 0 | @@ -4186,32 +4186,39 @@
es.jsonp(null);%0A
+ /*%0A
var data = p
@@ -4238,16 +4238,16 @@
ays(1);%0A
-
var
@@ -4365,32 +4365,39 @@
(dataResponse);%0A
+ */%0A
%7D);%0A%0Aapp.get('/r
@@ -4451,24 +4451,31 @@
sonp(null);%0A
+ /*%0A
var data
@@ -4615,32 +4615,32 @@
= data;%0A %7D %0A
-
... |
14ebd1431ba58c0cad021a95cde1a8cb73de783d | Send out timestamp to new clients within the callback which sends out the old tweets | app.js | app.js | /*jshint
node: true,
globalstrict: true,
laxcomma: true
*/
'use strict';
/* Tiny */
var tiny = require('tiny');
var db;
tiny('latest_tweets.tiny', function openDatabase (err, tinydb) {
if (err) {
console.error('Error occurred when trying to open database:');
console.error(err);
console.error('Q... | JavaScript | 0 | @@ -1957,23 +1957,19 @@
;%0A %7D%0A
+%0A
-%7D);%0A%0A
// Sen
@@ -2046,16 +2046,18 @@
called%0A
+
socket
@@ -2097,24 +2097,30 @@
etTime() %7D);
+%0A %7D);
%0A%0A // Sends
|
c01e93393277593c69a1a8cc4c5e489bff83e129 | Switch from ffmpeg to music-metadata as has proper support for musicbrainz tags incl. mbid | app.js | app.js | var express = require('express');
var XMLHttpRequest = require('xhr2');
var ffmpeg = require('fluent-ffmpeg');
var bodyParser = require('body-parser');
var api_key = require('./private');
var app = express();
ffmpeg.setFfmpegPath('ffmpeg.exe')
ffmpeg.setFfprobePath('ffprobe.exe')
// Need to specify static content to ... | JavaScript | 0 | @@ -69,47 +69,8 @@
');%0A
-var ffmpeg = require('fluent-ffmpeg');%0A
var
@@ -167,81 +167,74 @@
();%0A
-%0Affmpeg.setFfmpegPath('ffmpeg.exe')%0Affmpeg.setFfprobePath('ffprobe.exe
+var mm = require('music-metadata');%0Aconst util = require('util
')%0A
+
%0A//
@@ -824,21 +824,19 @@
);%0A%09
-ffmpeg.ffprob
+mm.par... |
34dc3bdb159e72391161a88b450eac3ff7d92a4a | fix typo | app.js | app.js | /*
This bot waits patiently for the user to request a cat picture and then picks one at random from http://thecatapi.com/ for his/her viewing pleasure!
Created using:
- Microsoft's Bot Framework (https://docs.botframework.com/)
- BotBuilder for Node.js (https://github.com/Microsoft/BotBuilder, https://docs.botfr... | JavaScript | 0.999991 | @@ -566,16 +566,17 @@
s = requ
+i
re(%22xml2
|
b07d6fa00bde297bb7cd8ae7cb2e18d09ab1be2c | update the state of the requests[id] after each iteration | app.js | app.js | 'use strict';
console.log('Launching…');
var exec = require('child_process').exec;
var meta = require('./package.json');
var express = require('express');
var compression = require('compression');
var bodyParser = require('body-parser');
var path = require('path');
var Fs = require('fs');
var Map = require('immutable... | JavaScript | 0.000001 | @@ -3324,19 +3324,62 @@
nction (
-) %7B
+state) %7B%0A requests%5Bid%5D.results = state;
%0A
|
6605fe14815a23fd3fb96f3ae25697f5ec3b349a | Fix blow_show path in app.get id: | app.js | app.js | // Module dependencies.
var express = require('express');
//var ArticleProvider = require('./articleprovider-memory').ArticleProvider;
var ArticleProvider = require('./articleprovider-mongodb').ArticleProvider;
var app = express();
var bodyParser = require('body-parser');
var methodOverride = require('method-ov... | JavaScript | 0 | @@ -2106,14 +2106,8 @@
show
--final
.jad
|
0e41c7f493642b970e64a27a40cfb2750f1dc326 | remove uri encode | app.js | app.js | var _ = require('lodash');
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser());
app.set('port', (process.env.PORT || 5000));
// 生きてるか確認するためのHello World
app.get('/', function(req, res) {
res.send('Hello World!');
});
// LineからのコールバックURL
... | JavaScript | 0.71068 | @@ -714,18 +714,8 @@
ge:
-encodeURI(
msg.
@@ -721,17 +721,16 @@
.content
-)
,%0D%0A
|
2cdcad80068419360b0d5235e50ad777075f6fe6 | make file executeable | bin.js | bin.js | #!/usr/bin/env node
var link = require('./')
var path = require('path')
var fs = require('fs')
if (!process.env.npm_package_name) {
console.error('You should run link-bin as an npm install hook')
process.exit(1)
}
var filenames = [].concat(process.argv[2] || [])
if (!filenames.length) {
try {
var pkg = re... | JavaScript | 0.000002 | @@ -861,16 +861,50 @@
e, bin)%0A
+ fs.chmodSync(filename, 33261)%0A
%7D)%0A%7D)%0A
|
3cfff710ae2848f9175ce5baec7e24fe171f3d6a | add --domain option | bin.js | bin.js | #!/usr/bin/env node
var discovery = require('./')
var minimist = require('minimist')
var argv = minimist(process.argv.slice(2), {
alias: {port: 'p', host: 'h', server: 's'}
})
var rcvd = {}
var cmd = argv._[0]
var disc = discovery(argv)
if (cmd === 'listen') {
disc.listen(argv.port, onlisten)
} else if (cmd ===... | JavaScript | 0.000001 | @@ -168,16 +168,29 @@
ver: 's'
+, domain: 'd'
%7D%0A%7D)%0A%0Ava
@@ -780,32 +780,85 @@
ry server)%5Cn' +%0A
+ ' --domain=(optional authoritative domain)%5Cn'%0A
' lookup %5Bn
@@ -868,25 +868,24 @@
%5D%5Cn' +%0A '
-
--server
@@ -914,24 +914,77 @@
erver)%5Cn' +%0A
+ ' --domain=(optional au... |
903f1a2d2ad83f00d02bfb6f268a9c4092b086d7 | fix help | bin.js | bin.js | #!/usr/bin/env node
const explain = require('explain-error')
const mapLimit = require('map-limit')
const resolve = require('resolve')
const garnish = require('garnish')
const mkdirp = require('mkdirp')
const subarg = require('subarg')
const bole = require('bole')
const http = require('http')
const path = require('path... | JavaScript | 0.000002 | @@ -537,16 +537,35 @@
verbose'
+, 'help', 'version'
%5D,%0A de
@@ -669,16 +669,31 @@
s: 'j',%0A
+ help: 'h',%0A
open
|
21c8470b66f800793a8d9f5855bf27d92cb71a15 | Fix ping, attempting to make embedded about | bot.js | bot.js | client.login("")
var prefix = "px;"
client.on("message", function(message) {
if (message.author.equals(client.user)) return;
if (!message.content.startsWith(prefix)) return;
var args = message.content.substring(prefix.length).split(" ");
switch (args[0]) {
//ping command
case "ping... | JavaScript | 0 | @@ -374,25 +374,25 @@
%0A
-
+%09
.setColor(%22#
@@ -415,18 +415,18 @@
- .addField
+%09.setTitle
(%22:p
@@ -458,16 +458,17 @@
se time:
+
%22 + clie
@@ -490,25 +490,25 @@
%0A
-
+%09
.setFooter(%22
@@ -593,17 +593,17 @@
-
+%09
.setTime
@@ -610,28 +610,18 @@
stamp()%0A
- ... |
e2a14760e0a695e90075abe68140b72b5f73a3ee | add comment | bot.js | bot.js | var http = require('http');
var createHandler = require('github-webhook-handler');
var handler = createHandler({ path: '/webhook', secret: 'sekrit' });
var host = (process.env.VCAP_APP_HOST || 'localhost');
var port = (process.env.VCAP_APP_PORT || 7777);
// Start server
http.createServer(function (req, res) {
handle... | JavaScript | 0 | @@ -1,12 +1,16 @@
+// %0A
var http = r
|
2ff29dbca6ddd5039e3f9a3ddf7cf93020b8f551 | Remove replying to mentions | bot.js | bot.js | /**
* srifqi's Bot for Telegram
* License: MIT License
*/
console.log("srifqi's Bot for Telegram")
console.log('License: MIT License')
console.log('Initialising bot...')
const BOT_NAME = 'srifqiBot'
const TelegramBot = require('node-telegram-bot-api')
const math = require('mathjs')
const fetch = require('node-fet... | JavaScript | 0 | @@ -622,16 +622,17 @@
Markdown
+.
%0Aconst A
@@ -1380,44 +1380,8 @@
%3E %7B%0A
- // console.log('start', msg.from)%0A
ap
@@ -4184,108 +4184,8 @@
e.%0A%0A
-app.onText(new RegExp('@' + BOT_NAME + '%5C%5Cb', 'i'), (msg) =%3E app.sendMessage(msg.chat.id, 'Hey!'))%0A%0A
// l
@@ -4283,16 +4283,40 @@
sg.text)
+ // C... |
6624856bee454446857af16605222dcc4dc9d2bc | Add Apache-2.0 copyright notice | bub.js | bub.js | var fs = require('fs');
var path = require('path');
var request = require('hopjs-request');
var util = require('util');
// Constructor for the whole darn thing
var Bub = function (config) {
var BASE_URL = 'https://api.telegram.org/bot' + config.token;
var TIMEOUT = config.timeout ? config.timeout : 864000;
var o... | JavaScript | 0 | @@ -1,12 +1,611 @@
+/**%0A * Copyright 2015 Darshak Parikh%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A * http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Un... |
bcf7b565a19f9a515990bcf4d34ad4e03915a256 | Revert "Added distinguish errors and warnings as text ERR and WARN" | cli.js | cli.js | /*eslint no-console: ["error", {allow: ["log"]}] */
var validate = require('./index.js');
var colors = require('colors/safe');
var cliff = require('cliff');
var pluralize = require('pluralize');
var bytes = require('bytes');
var fs = require('fs');
module.exports = function (dir, options) {
if ... | JavaScript | 0 | @@ -605,23 +605,16 @@
rs.red(%22
-(ERR)
The dire
@@ -936,15 +936,8 @@
ed('
-(ERR)
Inva
@@ -1992,57 +1992,8 @@
i%5D;%0A
- var type = (color==red ? 'ERR': 'WARN');%0A
@@ -2046,24 +2046,11 @@
':
-(
' +
- type + ') '
iss
|
a0a02c62ed406ee06c15b35a0ae388b1d697bd1f | Add info about quotes to output of help | cli.js | cli.js | var tester = require('./main');
var fs = require('fs');
if (process.argv.length < 4 || process.argv[2] === 'help') {
console.log('== help');
console.log('Prints this message.');
console.log('== password <password>');
console.log('Check <password> against all app ids listed in app-list.txt');
} else if (process.arg... | JavaScript | 0 | @@ -287,16 +287,36 @@
list.txt
+. Don%5C't use quotes!
');%0A%7D el
|
926c0396389778a5376e7c0248215a054851dd7f | fix exit code | cli.js | cli.js | #!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const { changelog, release, init } = require('./');
const args = [].slice.call(process.argv, 2);
const cmd = args[0];
const dryRun = args.indexOf('-d') !== -1 || args.indexOf('--dry-run') !== -1;
const ignoreStaged = args.indexOf('-i') !== -... | JavaScript | 0.000697 | @@ -559,17 +559,27 @@
ss.exit(
-1
+err ? 1 : 0
);%0A%7D;%0A%0Ac
|
bea737e6ae9456347257292fe5c56a5e357f0a5d | Fix bug in CLI with exit code when provided with invalid file path | cli.js | cli.js | #!/usr/bin/env node
'use strict';
/*
* Dependencies.
*/
var mdast,
fs,
pack;
mdast = require('./');
fs = require('fs');
pack = require('./package.json');
/*
* Detect if a value is expected to be piped in.
*/
var expextPipeIn;
expextPipeIn = !process.stdin.isTTY;
/*
* Arguments.
*/
var argv;
argv ... | JavaScript | 0 | @@ -6488,23 +6488,87 @@
-throw exception
+process.stderr.write(exception.message + '%5Cn');%0A process.exit(1)
;%0A
|
d479ff47834eaf4dcb4b6b1b71065824a9acfa66 | add --output-unreleased | cli.js | cli.js | #!/usr/bin/env node
'use strict';
var addStream = require('add-stream');
var conventionalChangelog = require('conventional-changelog');
var fs = require('fs');
var meow = require('meow');
var tempfile = require('tempfile');
var _ = require('lodash');
var resolve = require('path').resolve;
var cli = meow({
help: [
... | JavaScript | 0.000012 | @@ -1597,32 +1597,103 @@
lt: 1',%0A '',%0A
+ ' -u, --output-unreleased Output unreleased changelog',%0A '',%0A
' -v, --ver
@@ -1722,24 +1722,24 @@
se output',%0A
-
'
@@ -2178,24 +2178,51 @@
easeCount',%0A
+ u: 'outputUnreleased',%0A
v: 'verb
@@ -2803,16 +2803,60 @@
aseCount
+,%... |
dfcc29dc2850cf97686d5a036fc3ec619094b2ea | fix clone and always listen+clone when running commands | cli.js | cli.js | #!/usr/bin/env node
var path = require('path')
var Dat = require('./')
var minimist = require('minimist')
var EOL = require('os').EOL
var url = require('url')
var stdout = require('stdout-stream')
var fs = require('fs')
var path = require('path')
var debug = require('debug')('dat.cli')
var defaultMessage = "Usage: da... | JavaScript | 0 | @@ -282,16 +282,105 @@
.cli')%0A%0A
+var argv = minimist(process.argv.slice(2), %7Bboolean: true%7D)%0Avar first = argv._%5B0%5D %7C%7C ''%0A%0A
var defa
@@ -474,62 +474,81 @@
var
-argv = minimist(process.argv.slice(2), %7Bboolean: true%7D
+badMessage = %5B'Command not found: ' + first, '', defaultMessage%5D.join(E... |
214551ee380908718c49ef64bf7b3705dff5b246 | Print brightness when not TTY | cli.js | cli.js | #!/usr/bin/env node
'use strict';
var brightness = require('brightness');
var meow = require('meow');
var progressControl = require('progress-control');
var chalk = require('chalk');
var cliCursor = require('cli-cursor');
var cli = meow({
help: [
'Example',
' $ brightness',
' $ brightness 0.8'
]
});
try {
... | JavaScript | 0.000048 | @@ -450,16 +450,87 @@
;%0A%09%09%09%7D%0A%0A
+%09%09%09if (!process.stdin.isTTY) %7B%0A%09%09%09%09console.log(val);%0A%09%09%09%09return;%0A%09%09%09%7D%0A%0A
%09%09%09brigh
|
fc4b8c0bf4f01436929f69978fd99dcb7be32225 | extend instead of concat default shortcuts ✨ | cli.js | cli.js | #! /usr/bin/env node
var fs = require('fs');
var output = require('./');
var pkg = require('./package.json');
var shortcuts = require('./shortcuts.json');
fs.readFile(process.env.HOME + '/.' + pkg.name + '/shortcuts.json', { encoding: 'utf8' }, function (err, data) {
if (!err) {
shortcuts = shortcuts.concat(JSO... | JavaScript | 0 | @@ -15,16 +15,137 @@
v node%0A%0A
+// TODO's:%0A// - write test for add/overwrite shortcuts%0A// - %60assignShortcuts()%60 add error handling check argument types%0A%0A
var fs =
@@ -376,20 +376,19 @@
n (err,
-data
+res
) %7B%0A if
@@ -413,25 +413,31 @@
tcuts =
-s
+assignS
hortcuts
.concat(
@@ -432,16 +432,20 ... |
6afd2fd27735c6adfecca1cb6c99fa0613a1dbc4 | fix mockReadStream | test/encryption.js | test/encryption.js | const expect = require('chai').expect
const encryption = require('../lib/encryption')
const Readable = require('stream').Readable
describe('encryption', () => {
it('should encrypt and decrypt', () => {
const data = 'some-unencrypted-data'
// create mock read stream (to mimic a pg_dump output strea... | JavaScript | 0.000001 | @@ -364,16 +364,59 @@
dable()%0A
+ mockedReadStream._read = () =%3E %7B %7D%0A
|
95438ed35b83a1b1aa98714c6ab0f1a8021520f3 | Remove unused import | test/files.spec.js | test/files.spec.js | var assert = require('assert');
var should = require('should');
var fs = require('fs');
describe('sendgrid-nodejs repo', function() {
/*
it('should have ./Docker or docker/Docker file', function() {
assert(fileExists('Docker') || fileExists('docker/Docker'));
});
it('should have ./docke... | JavaScript | 0.000001 | @@ -34,45 +34,8 @@
');%0A
-var should = require('should');%0A
var
|
30a86e05374f705533b522d8819914b275da9d43 | add time-out test | test/index-test.js | test/index-test.js | var expect = require('expect.js');
var ShortTermMemory = require('../');
var myStore;
describe('test basic functionality', function () {
it('create store', function () {
myStore = new ShortTermMemory({
duration: 60000
});
expect(myStore).to.be.an('object');
expect(myStore.get).to.be.an('function');
expec... | JavaScript | 0.000005 | @@ -716,12 +716,342 @@
);%0A%09%7D);%0A
+%09it('time out token', function (done) %7B%0A%09%09var shortStore = new ShortTermMemory(%7B%0A%09%09%09duration: 50%0A%09%09%7D);%0A%09%09shortStore.add('unique key', 'test-data');%0A%09%09setTimeout(function access () %7B%0A%09%09%09var token = shortStore.get('unique key');%0... |
fab2ea269b05e8c49f1a9e6441e0d2abed61613a | set first route to login. | ui/app/navigation.js | ui/app/navigation.js | /**
* UI Navigation links
*/
var navigation = [
{
// 'checkPermission': {
// 'service': 'dashboard',
// 'route': '/environment/list'
// },
'id': 'home',
'label': translation.home[LANG],
'url': '#/dashboard',
'tplPath': 'modules/DASHBOARD/home/directives/dashboard.tmpl',
'scripts': ['modules/DASH... | JavaScript | 0 | @@ -45,19 +45,25 @@
on = %5B%0A%09
-%7B%0A%09
+// %7B%0A%09//
%09// 'che
@@ -80,16 +80,19 @@
on': %7B%0A%09
+//
%09// %09'se
@@ -113,16 +113,19 @@
oard',%0A%09
+//
%09// %09'ro
@@ -155,16 +155,19 @@
t'%0A%09
+//
%09// %7D,%0A%09
%09'id
@@ -162,16 +162,19 @@
%09// %7D,%0A%09
+//
%09'id': '
@@ -173,32 +17... |
923582d12acc4c8eb5e8dd5347f60b44b0772ab8 | remove only | test/index.spec.js | test/index.spec.js | import { expect } from 'chai'
import { createEvent, createEvents } from '../src'
const invalidAttributes = { start: [] }
const validAttributes = { start: [2000, 10, 5, 5, 0], duration: { hours: 1 } }
const validAttributes2 = { start: [2001, 10, 5, 5, 0], duration: { hours: 1 } }
const validAttributes3 = { start: [2002... | JavaScript | 0.000001 | @@ -1195,13 +1195,8 @@
ribe
-.only
('.c
|
371d7a1fcafb91a814e70762db53b6c0a3f51227 | fix test | test/index.test.js | test/index.test.js | const fs = require('fs')
const rm = require('rimraf')
const generatePlay = require('../lib/generate-play')
const updateScripts = require('../lib/update-scripts')
beforeAll(() => {
process.chdir(__dirname)
})
afterAll(cleanup)
function cleanup() {
rm.sync('play*')
const data = JSON.stringify({
scripts: { t... | JavaScript | 0.000002 | @@ -840,18 +840,11 @@
Be('
-vbuild dev
+poi
--c
@@ -912,17 +912,20 @@
).toBe('
-v
+poi
build --
|
0a192430a7c43107bdacd1ff2d827ffa3c4c4aaa | fix test | test/index.test.js | test/index.test.js |
var should = require('chai').should()
, promise = require('laissez-faire')
, series = require('../series')
, async = require('../async')
, map = require('..')
function delay(err, val){
var args = arguments
return promise(function(fulfill, reject){
setTimeout(function () {
if (args.length < 2) reject(er... | JavaScript | 0.000002 | @@ -1018,16 +1018,43 @@
(v, k)%7B%0A
+%09%09%09k.should.be.a('number')%0A
%09%09%09retur
@@ -1066,36 +1066,36 @@
ay(null, v + 1).
-then
+read
(function(inc)%7B%0A
@@ -1080,35 +1080,32 @@
).read(function(
-inc
)%7B%0A%09%09%09%09calls.pus
@@ -1110,39 +1110,24 @@
ush(%5Bk, v%5D)%0A
-%09%09%09%09return inc%0A
%09%... |
63d1b28282f2169c88cb18cf76f1779c7027f258 | add test that starts/stops replicaset | test/index.test.js | test/index.test.js | var run = require('../');
describe('run', function() {
it('should start a standalone', function(done) {
var opts = {
action: 'start',
name: 'mongodb-runner-test-standalone',
port: 27001
};
run(opts, function(err) {
if (err) return done(err);
opts.action = 'stop';
run... | JavaScript | 0 | @@ -276,16 +276,409 @@
(err);%0A%0A
+ opts.action = 'stop';%0A run(opts, function(err) %7B%0A if (err) return done(err);%0A done();%0A %7D);%0A %7D);%0A %7D);%0A%0A it('should start a replicaset', function(done) %7B%0A var opts = %7B%0A action: 'start',%0A name: 'mongodb-... |
39e080ccdfafea7d592c64c590f12107789cb9c7 | allow overriding the stylesheet | static/js/widget.js | static/js/widget.js | if (typeof MiroCommunity === 'undefined') {
MiroCommunity = {
Widget: function(args) {
this.init(args);
},
jsonP: function(path) {
script = document.createElement('script');
script.type = 'text/javascript';
script.src = path;
docume... | JavaScript | 0.000001 | @@ -1840,20 +1840,51 @@
edStyles
+ && this.opts.stylesheet !== ''
) %7B%0A
-
@@ -1975,24 +1975,163 @@
tylesheet';%0A
+ if (this.opts.stylesheet) %7B%0A link.href = this.opts.stylesheet;%0A %7D else %7B%0A
@@ -2196,24 +2196,46 @@... |
36d3f719b2be634dca30475063c6500dc622a15e | make tests pass | test/index.test.js | test/index.test.js | 'use strict';
var Analytics = require('@segment/analytics.js-core').constructor;
var integration = require('@segment/analytics.js-integration');
var tester = require('@segment/analytics.js-integration-tester');
var Boomtrain = require('../lib/');
describe('Boomtrain', function() {
var analytics;
var boomtrain;
... | JavaScript | 0.000003 | @@ -2860,17 +2860,16 @@
dentify(
-
user_id,
@@ -2953,32 +2953,50 @@
rue, id: user_id
+, email: undefined
%7D);%0A %7D);%0A%0A
@@ -3242,32 +3242,60 @@
oor(date / 1000)
+,%0A email: undefined
%0A %7D);%0A
@@ -3563,16 +3563,44 @@
/ 1000)
+,%0A email: undefined
%0A
@@ -408... |
85815fd6cc8f673a2e1b31108c89288a5f34c787 | Streamline karma conf | test/karma.conf.js | test/karma.conf.js | module.exports = function(config) {
config.set({
basePath: '../',
frameworks: ['mocha', 'chai'],
customLaunchers: {
headlessChrome: {
base: 'Chrome',
flags: ['--disable-web-security', '--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream']
}
},
files... | JavaScript | 0 | @@ -132,24 +132,19 @@
%7B%0A
-headless
+dev
Chrome:
@@ -648,13 +648,12 @@
LOG_
-DEBUG
+WARN
,%0A%0A
@@ -694,16 +694,11 @@
: %5B'
-headless
+dev
Chro
|
da42ecc4d319c55dd1f4c7dbbdd9350d26a9c42d | Update reversestr.js | test/reversestr.js | test/reversestr.js | //using chained methods
function reverseStr(s) {
return s.split('').reverse().join('');
}
//fast method using for loop
function reverseStr(s) {
for (var i = s.length - 1, o = ''; i >= 0; o += s[i--]) { }
return o;
}
//fast method using while loop (faster with long strings in some browsers when compared with f... | JavaScript | 0.000001 | @@ -116,16 +116,41 @@
or loop%0A
+// dene 1.0 da de%C4%9Fi%C5%9Fklik%0A
function
|
583d3a88ac0f36c04839c9ea0d71b79abc5ee10d | Include map-area-compare in scene tests. | test/scene-test.js | test/scene-test.js | var GENERATE_SCENES = false, // flag to generate test scenes
specdir = process.cwd() + '/spec/',
testdir = process.cwd() + '/test/scenegraphs/',
fs = require('fs'),
tape = require('tape'),
vega = require('../'),
loader = vega.loader({baseURL: './web/'}),
specs = require('./specs-valid.json')... | JavaScript | 0 | @@ -395,133 +395,34 @@
-// remove map-area-compare due to cross-version node.js issue%0A return name !== 'wordcloud' && name !== 'map-area-compare
+return name !== 'wordcloud
';%0A
|
b22c196ede35073c31084bd10bb445e6e9c9c2b7 | add $watch And $digest test case | test/scope_spec.js | test/scope_spec.js | /* jshint globalstrict: true */
/* global Scope: false */
'use strict';
describe("[Angular-Scope]", function() {
it("can be constructed and used as an object", function() {
var scope = new Scope();
scope.aProperty = 1;
expect(scope.aProperty).toBe(1);
});
});
| JavaScript | 0.000004 | @@ -269,12 +269,426 @@
%0A %7D);%0A%0A
+ describe(%22digest%22, function()%7B%0A var scope;%0A%0A beforeEach(function()%7B%0A scope = new Scope();%0A %7D);%0A%0A it(%22calls the listener function of a watch on first $digest%22, function() %7B%0A var watchFn = function() %7B return 'wat'; %7D... |
82d8888b6c0085037f42accb72de0e0efe9bded6 | Update tests | test/test-utils.js | test/test-utils.js | import test from 'tape';
import getUrlParameter from '../js/utils/get-url-parameter';
import exportXML from '../js/utils/export-xml';
test('get url paramter test', function(t) {
t.throws(
function() {
getUrlParameter('http://example.com', 'id');
},
Error,
'should throw a... | JavaScript | 0.000001 | @@ -42,32 +42,33 @@
ameter from '../
+_
js/utils/get-url
@@ -83,56 +83,8 @@
er';
-%0Aimport exportXML from '../js/utils/export-xml';
%0A%0Ate
@@ -121,24 +121,25 @@
nction(t) %7B%0A
+%0A
t.throws
@@ -212,211 +212,20 @@
.com
-', 'id');%0A %7D,%0A Error,%0A 'should throw an error when the r... |
136bbe9b5006068ee4141ba8313165759f3385c8 | Remove hapi-ioredis from testServer | test/testServer.js | test/testServer.js | /**
* Created by Omnius on 18/07/2016.
*/
'use strict';
const Hapi = require('hapi');
const HapiAuthBasic = require('hapi-auth-basic');
const HapiAuthHawk = require('hapi-auth-hawk');
const Inert = require('inert');
// const Redis = require('hapi-ioredis');
module.exports = function () {
const server = new Hap... | JavaScript | 0 | @@ -216,49 +216,8 @@
');%0A
-// const Redis = require('hapi-ioredis');
%0A%0Amo
@@ -365,16 +365,17 @@
%7D);%0A
+%0A
serv
@@ -381,240 +381,291 @@
ver.
-register(%5B%0A Inert,%0A HapiAuthBasic,%0A HapiAuthHawk%0A // ,%0A // %7B%0A // register: Redis,%0A //... |
3763e6a95aa1b07db394f0e6f39b575e1641a640 | fix failing test | abi.js | abi.js | var nodeGypInstall = require('node-gyp-install')
var util = require('./util')
function getAbi (opts, version, cb) {
var log = opts.log
var install = opts.install || nodeGypInstall
version = version.replace('v', '')
util.readGypFile(version, 'src/node_version.h', function (err, a) {
if (err && err.code ===... | JavaScript | 0.000006 | @@ -215,17 +215,16 @@
v', '')%0A
-%0A
util.r
@@ -798,16 +798,22 @@
getAbi(
+opts,
version,
|
ed5d4a17992b0c9f3ac987756fca0d308a6c967c | fix translations run block not working | components/core/core.module.js | components/core/core.module.js | import '../drag/drag.module';
import '../layout/layout.module';
import '../map/map.module';
//import '../translations/js/translations';
import '../utils/utils.module';
import 'angular-gettext';
import coreService from './core.service';
/**
* @namespace hs
* @ngdoc module
* @module hs.core
* @name hs.core
* @descr... | JavaScript | 0.000002 | @@ -89,52 +89,8 @@
e';%0A
-//import '../translations/js/translations';%0A
impo
@@ -143,16 +143,58 @@
ttext';%0A
+import '../translations/js/translations';%0A
import c
|
63826647e004a18316bc3a3df246cd8a334ee49f | rollback added | test/unit/index.js | test/unit/index.js | import fs from 'fs-promise';
import path from 'path';
import TimedFile from '../../src/lib/index';
// import {
// console.log
// } from 'mocha-console.logger';
const PATH_DELIMITER = '/';
const gitTestFolder = [__dirname, '..', 'testcases', 'git'].join(PATH_DELIMITER);
const contentTestFolder = [__dirname, '..', 't... | JavaScript | 0.000001 | @@ -92,19 +92,16 @@
index';%0A
-//
import %7B
@@ -105,30 +105,16 @@
t %7B%0A
-//
- console.
log%0A
-//
%7D fr
@@ -123,24 +123,16 @@
'mocha-
-console.
logger';
@@ -528,120 +528,8 @@
);%0A%0A
- // afterEach((done) =%3E %7B%0A // console.log(this.ctx.currentTest.title);%0A // done();%0A ... |
0525437c1e7c52215b74cbde9acda594153b2ee6 | Fix unused component test | test/utils/link.js | test/utils/link.js | 'use strict'
const assert = require('chai').assert
const uuid = require('uuid/v4')
const link = require('../../src/utils/link')
const filename = require('../../src/utils/filename')
describe('link()', function() {
it('should work with an empty data string', function() {
const html = ''
const components = []
c... | JavaScript | 0.000002 | @@ -1173,31 +1173,41 @@
),%0A%09%09%09%09src:
-srcs%5B3%5D
+%60$%7B uuid() %7D.njk%60
%0A%09%09%09%7D%0A%09%09%5D%0A%0A%09
|
248d9d17c832d9197012f3f54fba2dc3b9ecb2a9 | Accept bad certs | test/hostmeta-https-only-test.js | test/hostmeta-https-only-test.js | // hostmeta-json-test.js
//
// Test flag to refuse falling back to http for hostmeta
//
// Copyright 2012, StatusNet 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://... | JavaScript | 0.999023 | @@ -807,16 +807,65 @@
ger%22);%0A%0A
+process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';%0A%0A
var suit
|
38f0235edabb3ff5a54367262caf7b7dfb0fd24c | add test case | test/hubot-pivotal-slack-test.js | test/hubot-pivotal-slack-test.js | "use strict";
var chai = require('chai');
var sinon = require('sinon');
chai.use(require('sinon-chai'));
chai.use(require('chai-string'));
var DummyRobot = require('./dummy-robot');
var targetScript = require("../src/scripts/hubot-pivotal");
describe("Test for hubot-pivotal.js", function() {
le... | JavaScript | 0.000059 | @@ -3799,12 +3799,502 @@
%7D);%0A%0A
+ // test getProjectName%0A it(%22Check for getProjectName%22, function() %7B%0A let dummyRobot = new DummyRobot();%0A let spyRespond = sinon.spy(dummyRobot, %22captureSend%22);%0A%0A delete process.env.PROJECT_IDS;%0A%0A // test%0A let ... |
6fb8db4f9c3e5bed240184406d13b5ca9b582a00 | FIX remove comment | test/node/LeaderElection.test.js | test/node/LeaderElection.test.js | import assert from 'assert';
import {
default as randomToken
} from 'random-token';
import {
default as memdown
} from 'memdown';
import * as _ from 'lodash';
import * as schemas from '../helper/schemas';
import * as schemaObjects from '../helper/schema-objects';
import * as humansCollection from '../helper/hu... | JavaScript | 0 | @@ -7809,115 +7809,10 @@
%7D);%0A
-%0A/* it('exit', () =%3E %7B%0A console.log('exit');%0A process.exit();%0A %7D);%0A */
+
%7D)
|
cd9a482b5531099102c06faef4b82b4c655d3396 | Split test statements | test/spec/controllers/session.js | test/spec/controllers/session.js | 'use strict';
describe('SessionCtrl', function() {
// load the controller's module
// We need to override the async translateProvider
// http://angular-translate.github.io/docs/#/guide/22_unit-testing-with-angular-translate
beforeEach(module('Teem', function ($provide, $translateProvider) {
$provide.facto... | JavaScript | 0.000543 | @@ -1678,56 +1678,8 @@
%7D);%0A
- %7D);%0A%0A it('should login', function() %7B
%0A
@@ -1982,24 +1982,79 @@
ut.flush();%0A
+ %7D);%0A%0A it('should call SwellRT', function() %7B
%0A exp
@@ -2104,24 +2104,93 @@
enCalled();%0A
+ %7D);%0A%0A it('should pass the right credential... |
55cefa78781b6ca974d245ae149882523e7e2268 | Fix broken DummyOutboundResource test | test/test_outbound/test_dummy.js | test/test_outbound/test_dummy.js | var assert = require('assert');
var vumigo = require("../../lib");
var test_utils = vumigo.test_utils;
var DummyApi = vumigo.dummy.api.DummyApi;
describe("outbound.dummy", function() {
var api;
var request;
beforeEach(function() {
api = new DummyApi();
request = test_utils.requester(api... | JavaScript | 0.000002 | @@ -8428,28 +8428,25 @@
content:
-null
+3
,%0A
@@ -8746,32 +8746,40 @@
s to be a string
+ or null
%22);%0A
|
cefb914e2fe4ba2e1cf139c197366f5c028fadf4 | fix zoom: show people at the bottom | src/interaction_controller.js | src/interaction_controller.js | app.InteractionController = class {
constructor(engine, renderer, loop, overlay) {
this._overlay = overlay;
this._viewport = overlay.querySelector('.viewport');
this._engine = engine;
this._renderer = renderer;
this._loop = loop;
this._minScale = 1;
this._maxS... | JavaScript | 0 | @@ -4678,24 +4678,203 @@
nOffset() %7B%0A
+ if (g.eq(this._renderer.scale(), this._minScale)) %7B%0A this._renderer.setOffset(this._center);%0A this._loop.invalidate();%0A return;%0A %7D%0A
var
@@ -5639,108 +5639,16 @@
Size
+/2
, 0);%0A
- var center = g... |
49d079ce979ffd775e48b69cc18adc420fdf8d68 | add carrage return | Sprinkle.js | Sprinkle.js | // Main Program for Sprinkle
// by Frank Hsiung
// Loading modules {
// var http = require('http');
// var path = require('path');
var fs = require('fs');
var request = require('/usr/local/lib/node_modules/request');
var gpio = require('/usr/local/lib/node_modules/onoff').Gpio;
// }--------------------------... | JavaScript | 0.999989 | @@ -3747,16 +3747,18 @@
his hour
+%5Cn
';%0A
|
23b5f7c8526e43d02a2bc90994767b83d5d7dbd2 | Fix first selected message not loading | src/js/DependentStateMixin.js | src/js/DependentStateMixin.js | /**
* @flow
*/
var RSVP = require('rsvp');
var React = require('react/addons');
var _ = require('lodash');
var asap = require('asap');
var classToMixinFunction = require('./classToMixinFunction');
class DependentStateMixin {
_subscriptions: Array<{remove: () => void;}>;
constructor(component, config) {
thi... | JavaScript | 0 | @@ -222,16 +222,43 @@
Mixin %7B%0A
+ _isSafeToSetState: bool;%0A
_subsc
@@ -1822,29 +1822,24 @@
is._
-component.isMounted()
+isSafeToSetState
&&
@@ -2374,32 +2374,67 @@
ntWillMount() %7B%0A
+ this._isSafeToSetState = true;%0A
this._create
@@ -2536,32 +2536,68 @@
WillUnmount() %7B%0A
+ this._isSafe... |
5b9ffb67ffb9ddac2cfc4f24f00301ef356b219a | Fix toShortString | ipv6-address.js | ipv6-address.js | function toString(arr) {
return Array.prototype.map.call(arr, function(ele) {
return ele.toString(16);
}).join(":");
}
class Ipv6Address extends Uint16Array {
constructor(iterable) {
let arr = new Uint16Array(this.length);
for(let i = 0; i < this.length; ++i) {
Object.d... | JavaScript | 0.999989 | @@ -1040,27 +1040,8 @@
0,%0A
- i = 0,%0A
@@ -1102,19 +1102,36 @@
let
-ele of this
+%5Bkey, val%5D of this.entries()
) %7B%0A
@@ -1145,19 +1145,19 @@
if(
-ele
+val
=== 0)
@@ -1216,17 +1216,19 @@
start =
-i
+key
;%0A
@@ -1282,20 +1282,9 @@
%7D
- else %7B%0A
+%0A
@@ -1... |
9fb30288f68432f6215d75c0da0659ed8f36c5be | tweak welcome message | src/js/utils/WelcomeStages.js | src/js/utils/WelcomeStages.js | var WelcomeStages = [
{
primary: 'Hello there you!',
secondary: "First off, let's see how your day is lining up...",
button: 'Skip for now'
},
{
primary: 'Nice one!',
secondary: "We're locating your calendar...",
button: ''
},
{
primary: 'Sweet!',
secondary: 'Now click... | JavaScript | 0 | @@ -619,18 +619,12 @@
for
-some other
+more
han
@@ -633,16 +633,29 @@
actions
+ and settings
.%22,%0A%09%09bu
|
66ed2dc5d4ef13947ca91a3d92ca6088d039db77 | Add progress bar animation | src/js/views/slideshowView.js | src/js/views/slideshowView.js | 'use strict';
import * as Backbone from 'backbone';
import SlideView from './slideView.js';
import SlideshowModel from '../models/slideshowModel.js';
const RIGHT_KEY_CODE = 39;
const LEFT_KEY_CODE = 37;
const UP_KEY_CODE = 38;
const DOWN_KEY_CODE = 40;
const SPACE_KEY_CODE = 32;
var SlideshowView = Backbone.View.exten... | JavaScript | 0.000001 | @@ -548,32 +548,99 @@
x);%0A %7D);%0A
+ this.progressBar = this.el.querySelector('.progress-bar');%0A
window.m
@@ -832,24 +832,193 @@
ex%5D.show();%0A
+ if(this.progressBar) %7B%0A this.progressBar.style.width = (this.model.get('slideIndex') / (this.model.get('numberOfSlides')... |
c3e12e3d2e1b2b4d1170fb875c1bf4046f7e0a0d | decompress api response automatically | src/kancolle/server/server.js | src/kancolle/server/server.js | 'use strict';
const KANCOLLE_BASE_DIR = process.env.KANCOLLE_BASE_DIR;
const request = require('request');
const rp = require('request-promise');
const path = require('path');
const urljoin = require('url-join');
const urlparse = require('url-parse');
const agentLog = require('winston').loggers.get('agent');
const osa... | JavaScript | 0 | @@ -961,45 +961,8 @@
l);%0A
-%09%09var returnResponseAsBuffer = null;%0A
%09%09re
@@ -1078,40 +1078,18 @@
%0A%09%09%09
-encoding: returnResponseAsBuffer
+gzip: true
%0A%09%09%7D
|
92978b5a56c58d4ff658c2a75574d29b78c6e7bd | Update mysql.js | providers/mysql.js | providers/mysql.js | const mysql = require("mysql2/promise");
let db;
const throwError = (err) => { throw err; };
exports.init = async () => {
db = await mysql.createConnection(conn: {
host: "localhost",
port: "3306",
user: "root",
password: "",
database: "Komada",
});
};
/* Table methods */
/**
* Checks if a ... | JavaScript | 0.000002 | @@ -158,14 +158,8 @@
ion(
-conn:
%7B%0A
|
b06012db6d9edc23875660dc9310986e5b322b76 | Remove unused requires | app.js | app.js | #!/usr/bin/env node
'use strict';
// FIXME should not be there. This is currently needed to work on a dev Cloudron
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
require('supererror')({ splatchError: true });
var async = require('async'),
express = require('express'),
json = require('body-parser').json,
... | JavaScript | 0.000001 | @@ -215,38 +215,8 @@
var
-async = require('async'),%0A
expr
@@ -428,258 +428,8 @@
'),%0A
- settings = require('./src/database/settings.js'),%0A shares = require('./src/database/shares.js'),%0A tags = require('./src/database/tags.js'),%0A things = require('./src/database/things.js'),%0A tokens = r... |
0bd75e93b437d8c080e889dad6840d03af34809f | Fix typos in app.js | app.js | app.js | var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var users = require('./routes/users');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser())
app.... | JavaScript | 0.999978 | @@ -146,20 +146,20 @@
);%0A%0Avar
-user
+post
s = requ
@@ -176,12 +176,12 @@
tes/
-user
+post
s');
|
dd4c85443a9c2dee57a84f0e89350d8c414b6369 | Update to make result cleaner, | 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('request');
var cheerio = require('cheerio');
var routes = require('./routes/... | JavaScript | 0 | @@ -1687,130 +1687,64 @@
-repository.totalStars = getStars(repository.url);%0A console.log('received total stars '+repository.totalStars);%0A
+var metadata = %7B%0A name: repository.title,
%0A
@@ -1756,19 +1756,19 @@
-repos.push(
+ owner:
repo
@@ -1773,18 +1773,23 @@
posi... |
54fbe0290981d1b0c49053568ae240bbb6eac740 | Add animation function | app.js | app.js | var DefinitionCreate = FormView.extend({
model: Definition,
initialize: function () {
FormView.prototype.initialize.call(this);
this.modelname = this.options.modelname;
this.title = 'Create ' + this.modelname;
this.instance.set({id: this.modelname,
tit... | JavaScript | 0.000002 | @@ -3130,17 +3130,96 @@
JSON()))
-;
+%0A .css(%22opacity%22, %220.1%22)%0A .animate(%7Bopacity: 1.0%7D, 1000);%0A
%0A
|
edf59a300cf98687b41af57fbf6675c0d0dff953 | Move favicon.ico higher up the chain | app.js | app.js | // server.js
//
// main function for activity pump application
//
// Copyright 2011-2012, StatusNet 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/li... | JavaScript | 0.000002 | @@ -2311,16 +2311,52 @@
mp%22)%7D));
+%0A app.use(express.favicon());
%0A%0A
@@ -3600,44 +3600,8 @@
);%0A%0A
- app.use(express.favicon());%0A
|
eedb488f07f9ffab731cdbc9d79376f1bb88ff22 | add morgan log | app.js | app.js | var express = require('express');
var path = require('path');
var mount_routes = require('mount-routes');
var mount_plugins = require('mount_plugin');
var app = express();
var lifecycle = require('./lifecycle');
app.set_absolute_path = function (key, path) {
this.set(key, app.cfg.root ... | JavaScript | 0.000025 | @@ -962,11 +962,13 @@
ble:
-tru
+ fals
e,%0A
@@ -980,16 +980,17 @@
g_level:
+
%22dev%22,%0A
|
c0110918f8922c9634b3c74facf8207b415172a7 | change well_known to well-known | app.js | app.js | const express = require('express');
const session = require('express-session');
const MongoStore = require('connect-mongo')(session);
const path = require('path');
const favicon = require('serve-favicon');
const logger = require('morgan');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-... | JavaScript | 0.998208 | @@ -2670,25 +2670,25 @@
.use('/.well
-_
+-
known', expr
@@ -2711,17 +2711,17 @@
ic/.well
-_
+-
known'))
|
a038de0ac273d3fb45c7bb63923c405ec8514675 | remove large intro text | app.js | app.js | var https = require("https");
var cities = require("cities");
var zip = process.argv.slice(2);
// allow multiple inputs
// throw error when no argv
function printer(data) {
console.log("________________________________________________");
console.log("");
console.log(" 0 0 0000 0000 00000 0 0 0000 0000... | JavaScript | 0.999891 | @@ -188,470 +188,8 @@
og(%22
-________________________________________________%22);%0A%09console.log(%22%22);%0A%09console.log(%22 0 0 0000 0000 00000 0 0 0000 0000 %22);%0A%09console.log(%22 0 0 0 0 0 0 0 0 0 0 0 %22);%0A%09console.log(%22 0 0 0 0000 0000 0 0000 0000 ... |
86cca371875cc36fd8658a079e1d07d91c2d9c84 | Use client folder | app.js | app.js | var express = require('express');
var app = express();
app.use(express.static('public/'));
var port = process.env.PORT || 3000;
app.listen(port, function() {
console.log('Listening on port ' + port);
});
| JavaScript | 0.000001 | @@ -77,14 +77,14 @@
ic('
-public
+client
/'))
|
c54ce98dd6e0f5d06020a3b5960023526589b63f | reset timer when clicking on 'prev'/'next' | app.js | app.js | /* jshint globalstrict: true, eqnull: true */
/* globals $, _, noUiSlider, Tsv, document, window, moment, d3 */
'use strict';
$(function() {
$.get('assets/data.tsv', function(rawData) {
var data = _.filter(d3.tsv.parse(rawData, function(d) {
return {
rawDate : d.Date,
... | JavaScript | 0 | @@ -3046,32 +3046,65 @@
- 1%5D.percent);%0A
+ playPause(true);%0A
%7D%0A
@@ -3325,32 +3325,65 @@
+ 1%5D.percent);%0A
+ playPause(true);%0A
%7D el
|
cbdba822eddecb9f7c73d3755e7c33bb891fc69b | add comments on failing test | app.js | app.js | cordova('asyncSeverStarted').registerAsync(function(message, callback){
function poll(){
setTimeout(function() {
if(typeof exports.app != 'undefined') {
callback("Pong:" + message);
} else {
poll();
}
}, 250);
}
poll();
});
... | JavaScript | 0 | @@ -1606,24 +1606,1111 @@
t);%0A//%0A//%7D);
+%0A//%0A// Fails with Error:%0A//%0A//E/jxcore-log%EF%B9%95 etag@/data/data/com.openmoney.p2p/files/jxcore/node_modules/express/node_modules/etag/index.js:55:1%0A//setHeader@/data/data/com.openmoney.p2p/files/jxcore/node_modules/express/node_modules/send/index.js:739:15%0A... |
a5b6f4184ed9e49d8692fec338bdc6c795df1848 | mark mentions | app.js | app.js | var vorpal = require('vorpal')(),
DataStore = require('nedb'),
cache = new DataStore(),
fs = require('fs'),
nconf = require('nconf'),
Twit = require('twit'),
ShortIdGenerator = require('./ShortIdGenerator'),
colors = require('colors');
var T = null;
var ME;
var twitterPinAuth = null;
nconf... | JavaScript | 0.000022 | @@ -3930,40 +3930,8 @@
) %7B%0A
- vorpal.log(result);%0A
@@ -3968,32 +3968,32 @@
nction(tweet) %7B%0A
+
@@ -4160,16 +4160,237 @@
%7D)%0A%7D%0A%0A
+var isMention = function(status) %7B%0A var mention = false;%0A status.entities.user_mentions.forEach(function(mention) %7B%0A ... |
b01dbb7e0b21fc1a92ec4b4fe42c1c42eeb7235e | Stop using deprecated bodyParser constructor | app.js | app.js | 'use strict';
var path = require('path');
var hook = require('./hook');
var config = require('./config');
var logger = require('./logger');
// Set up Express
var express = require('express');
var bodyParser = require('body-parser');
var port = process.env.PORT || config.port;
var app = express();
app.use(bodyParser... | JavaScript | 0.000534 | @@ -37,16 +37,92 @@
ath');%0A%0A
+var express = require('express');%0Avar bodyParser = require('body-parser');%0A%0A
var hook
@@ -216,101 +216,8 @@
);%0A%0A
-// Set up Express%0Avar express = require('express');%0Avar bodyParser = require('body-parser');%0A
var
@@ -257,16 +257,34 @@
.port;%0A%0A
+// Set up Expres... |
d62b47e03b9b4665dd571f9889d0311dd4c5c07e | add routing to send craigslist model via json to be used to build view | app.js | app.js | var express = require('express');
var app = express();
var http = require('http');
var bodyParser = require('body-parser');
var ajaxSearchHandler = require('./models/request_to_url');
app.use(express.static('public_html'));
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ ext... | JavaScript | 0 | @@ -121,33 +121,23 @@
');%0Avar
-ajaxSearchHandler
+CLModel
= requi
@@ -153,21 +153,15 @@
els/
-request_to_ur
+cl_mode
l');
@@ -700,25 +700,15 @@
l =
-ajaxSearchHandler
+CLModel
.url
@@ -941,16 +941,97 @@
%7D%0A%7D);%0A%0A
+app.get('/data/cl.json', function (req, res) %7B%0A res.send(CLModel.model);%0A%7D... |
bcef5027efee4a1ddff4d11dbbe7b93f2d590aa5 | Add highestGrandchildren and noChildren functions and update Person prototype attributes | app.js | app.js | //Hold family members
var familyTree = [];
function Person(name)
{
this.name = name;
this.parent = null;
this.children = [];
this.siblings = [];
this.grandparent = null;
this.addChild = function(name) {
var child = new Person(name);
child.parent = this;
if (child.parent.parent != null) {
child.grand... | JavaScript | 0.000001 | @@ -173,10 +173,35 @@
ll;%0A
+%09this.grandchildren = 0;%0A
%09%0A
-
%09thi
@@ -331,47 +331,107 @@
%09%09%09%09
-child.grand
+var granny = child.parent.
parent
- =
+%0A%09%09%09%09
child.
+grand
parent
-.parent
+ = granny.name;%0A%09%09%09%09granny.grandchildren += 1
;%0A%09%09
@@ -466,16 +466,43 @@
d);%0A%09... |
166a231106af7574c99811306698fd2284591c2a | Send response for debug ocr | app.js | app.js | var fs = require('fs');
var path = require('path');
var superagent = require('superagent');
var restify = require('restify');
var builder = require('botbuilder');
var server = restify.createServer();
var oxford = require('project-oxford');
var telegramDebug = require('./telegram-debug');
var jsonPrettify = require('jso... | JavaScript | 0 | @@ -3822,24 +3822,16 @@
response
-.regions
)+%22%60%22);%0A
|
319e288fdd16ff1fb491269478f431c6c4c40dd5 | create tables if they dont exist | app.js | app.js | var express = require('express');
var fs = require('fs');
var bodyParser = require('body-parser');
var lzString = require('lz-string');
var app = express();
var pg = require('pg');
var username = process.env.POSTGRES_ENV_POSTGRES_USER;
var password = process.env.POSTGRES_ENV_POSTGRES_PASSWORD;
var addr = process.env.... | JavaScript | 0 | @@ -541,66 +541,8 @@
db;%0A
-var client = new pg.Client(conString);%0Aclient.connect();%0A%0A
%0Avar
@@ -797,16 +797,16 @@
cept');%0A
-
next()
@@ -808,24 +808,817 @@
ext();%0A%7D);%0A%0A
+pg.connect(conString, function(err, client, done) %7B%0A if(err)%7B%0A done();%0A console.log(err);%0A retu... |
76aff5dedc769a8e3b2e30ec5228952b1bd6b414 | Reset default compileCommand to pdflatex. | app.js | app.js | var
rimraf = require("rimraf"),
path = require("path"),
spawn = require("child_process").spawn,
fs = require("fs");
module.exports.parse = function(texString, callback){
var outputDirectory = path.join(__dirname, "temp-" + generateGuid());
var texFilePath = path.join(outputDirectory, "output.tex");
fs.mkdir(o... | JavaScript | 0 | @@ -2961,38 +2961,31 @@
fn;%0A%7D;%0A%0Avar
-compileCommand
+LATEXMK
= %7B%0A%09comman
@@ -3026,35 +3026,106 @@
%7D;%0A%0A
-//
var
-compileCommand
+PDFLATEX = %7B%0A%09command: %22pdflatex%22,%0A%09options: %5B%22-interaction=nonstopmode%22%5D%0A%7D;%0A%0Avar XELATEX
= %7B%0A
-//
%09com
@@ -3131,27 +3131,26 @... |
c2bf7d2f11465ec9dbd542db88657f22d9972500 | Send the items to the view | app.js | app.js | var bogart = require('bogart')
,path = require('path');
require('dotenv').load();
var viewEngine = bogart.viewEngine('mustache', path.join(bogart.maindir(), 'views'));
var root = require("path").join(__dirname, "public");
var router = bogart.router();
var mp = require('mongodb-promise');
router.get('/', functio... | JavaScript | 0 | @@ -964,17 +964,17 @@
respond(
-'
+%22
index.ht
@@ -979,16 +979,55 @@
html
-', items
+%22, %7B locals: %7B items: items, errors: errors %7D %7D
);%0A
|
799365c0dd0fae08bda70d2ff3ccbfbf22213c83 | load dotenv | app.js | app.js | var express = require('express');
var app = express();
var server = require('http').createServer(app);
var bodyParser = require('body-parser');
app.use(express.static(__dirname + '/tmp'));
app.use(bodyParser.urlencoded({
extended: true
}));
var request = require('superagent');
var twilio = require('twilio');
requi... | JavaScript | 0.000001 | @@ -1,12 +1,60 @@
+var dotenv = require('dotenv');%0Adotenv.load();%0A%0A
var express
|
2c55030127aefb72bf42d0ab66820c0fe29304bd | Define size to be digits only | app.js | app.js | var express = require('express');
var gm = require('gm');
var hashblot = require('hashblot');
var crypto = require('crypto');
// Raster types we support for retrieval.
var rasterTypes = ['png','jpg','jpeg','gif','bmp','tga'];
module.exports = function appctor(opts) {
var gmopts = opts.gm || {};
function magickPd(s... | JavaScript | 0.000044 | @@ -1665,49 +1665,13 @@
urn
-res.status(400).send('Invalid image size'
+next(
);%0A
@@ -2471,16 +2471,22 @@
th/:size
+(%5C%5Cd+)
/:input(
@@ -2506,16 +2506,20 @@
ension',
+%0A
hashpat
|
ec220386c8960c0abdca1bb89adf3ffbea63435e | Convert + to space. | app.js | app.js | 'use strict';
var child_process = require('child_process');
var Color = require('color');
var async = require('async');
var streamBuffers = require('stream-buffers');
var memjs = require('memjs');
var client = memjs.Client.create();
var generating = {}; // pub/sub exposing pub existence
var express = require('exp... | JavaScript | 0.999858 | @@ -850,16 +850,34 @@
ams.text
+.replace('+', ' ')
);%0A%7D);%0A%0A
|
1b3136a6cf456b40fa7bc6102b1e8cb86531f0ac | Convert application for valid checkstyle | app.js | app.js | /*jslint node: true */
var fs = require('fs');
var express = require('express');
var session = require('express-session');
var path = require('path');
var csrf = require('csurf');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = requi... | JavaScript | 0.997367 | @@ -1,52 +1,4 @@
-/*jslint node: true */%0A%0Avar fs = require('fs');%0A
var
@@ -130,48 +130,8 @@
');%0A
-var favicon = require('serve-favicon');%0A
var
@@ -501,114 +501,8 @@
);%0A%0A
-// uncomment after placing your favicon in /public%0A//app.use(favicon(__dirname + '/public/favicon.ico'));%0A
app.
@@ -580,17 +... |
a0b5ce932e3bba650f8f6aa168f3a5acc2cfaaea | add space search | app.js | app.js | var _ = require('lodash');
var async = require('async');
var MongoClient = require('mongodb').MongoClient;
var request = require('request');
var express = require('express');
var app = express();
var resultsCollection;
var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
function getSuggestions(text, callback) {
re... | JavaScript | 0.000002 | @@ -228,16 +228,17 @@
abet = '
+
abcdefgh
|
ac9a8e794ac47f0db5abccc9490352a39f57e74e | fix favicon | app.js | app.js |
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
var fs = require("fs");
var app = express();
routes.init(app);
app.configure(function(){
app.set('port', process.env.PORT ||... | JavaScript | 0.014927 | @@ -460,23 +460,21 @@
/images/
-favicon
+penny
.png%22)))
|
ae526efcd72e7fea4368711219e1723db1c2af1f | remove debug stuff | 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 settings = require("./config").settings;
var auth = require("./routes/auth");
var routes = req... | JavaScript | 0.000017 | @@ -923,26 +923,8 @@
Map:
- false,%0A debug:
tru
|
ededb33847fbd7fb393467ffbec1ec3c200ba782 | Improve performance by enabling cache | app.js | app.js | var path = require('path');
var koa = require('koa');
var Router = require('koa-router');
var bodyParser = require('koa-bodyparser');
var views = require('koa-views');
var serve = require('koa-static');
var session = require('koa-session');
var passport = require('koa-passport');
var locale = require('koa-locale');
var... | JavaScript | 0.000006 | @@ -1531,16 +1531,30 @@
'jade',%0A
+%09cache: true,%0A
%09map: %7B%0A
|
befe00cdd9659c4424de004d53f281501e03d6a9 | disable request logging | app.js | app.js | const conditional = require('koa-conditional-get');
const etag = require('koa-etag');
const cors = require('koa2-cors');
const helmet = require('koa-helmet');
const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const mongoose = require('mongoose');
const { requestLogger, logger } = require('./midd... | JavaScript | 0.000001 | @@ -1484,16 +1484,19 @@
logging%0A
+//
app.use(
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.