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 |
|---|---|---|---|---|---|---|---|
bf5747db8433447954f26aaa9e4fb29fa44b32af | Fix the Windows packaged build, r=vporof (#24) | src/shared/util/spawn.js | src/shared/util/spawn.js | /*
Copyright 2016 Mozilla
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
u... | JavaScript | 0 | @@ -603,16 +603,67 @@
colour';
+%0Aimport %7B IS_PACKAGED_BUILD %7D from '../build-info';
%0A%0Aexport
@@ -874,16 +874,114 @@
')));%0A%0A
+ const stdio = process.platform === 'win32' && IS_PACKAGED_BUILD%0A ? 'ignore'%0A : 'inherit';%0A
const
@@ -1030,27 +1030,16 @@
%7B stdio
-: 'inherit'
, ...opt
|
7e6208b0584040c45449faa39e60ccc98bb9acb1 | Remove unneeded eslint comment | src/bin.js | src/bin.js | import fs from 'fs';
import path from 'path';
import chalk from 'chalk';
import mri from 'mri';
import glob from 'tiny-glob/sync.js';
import fuzzysearch from 'fuzzysearch';
import enquirer from 'enquirer';
// eslint-disable-next-line import/no-unresolved
import degit from './index.js';
import { tryRequire, base } from... | JavaScript | 0.000002 | @@ -202,58 +202,8 @@
er';
-%0A%0A// eslint-disable-next-line import/no-unresolved
%0Aimp
|
bfb30a22f62fc8c63167a3fb13cd5c5f4af9d773 | Make JSlint happier | src/VIE.js | src/VIE.js | // ### Handle dependencies
//
// VIE tries to load its dependencies automatically.
// Please note that this autoloading functionality only works on the server.
// On browser Backbone needs to be included manually.
// Require [underscore.js](http://documentcloud.github.com/underscore/)
// using CommonJS require if it... | JavaScript | 0.000002 | @@ -1343,16 +1343,17 @@
(config)
+
%7B%0A th
@@ -1887,29 +1887,16 @@
pace) ?
-%0A
this.con
@@ -1918,29 +1918,16 @@
space :
-%0A
%22http://
|
37f824c25b9f24e4fb2adda56bc88bca60671e64 | Remove cache from product detail | src/store/server/ajax.js | src/store/server/ajax.js | import express from 'express'
let ajaxRouter = express.Router();
import serverSettings from './settings'
import api from 'cezerin-client';
api.init(serverSettings.apiBaseUrl, serverSettings.security.token);
const DEFAULT_CACHE_CONTROL = 'public, max-age=600';
ajaxRouter.get('/products', (req, res, next) => {
const ... | JavaScript | 0 | @@ -253,16 +253,69 @@
ge=600';
+%0Aconst PRODUCTS_CACHE_CONTROL = 'public, max-age=60';
%0A%0AajaxRo
@@ -505,39 +505,40 @@
Cache-Control',
-DEFAULT
+PRODUCTS
_CACHE_CONTROL).
@@ -670,32 +670,32 @@
us, json%7D) =%3E %7B%0A
+
res.status(s
@@ -705,55 +705,8 @@
us).
-header('Cache-Control', DEFAULT_CACHE_CONTRO... |
66bdbe3a207a81247f1377d3afab5dc7fd7756be | fix arg count check | src/cli.js | src/cli.js | var User = require('./user.js'),
args = process.argv.slice(2);
if (args.length < 2) {
console.log('invalid arg count');
return;
}
switch (args[0]) {
case 'user':
if (args[1] == 'create') {
if (args.length < 4) {
console.log('invalid arg count');
retu... | JavaScript | 0.000005 | @@ -456,17 +456,17 @@
ength %3C
-3
+4
) %7B%0A
|
f521de3a472502612a107340ab2ca9ebf268ede9 | fix --width and --height arguments | src/cli.js | src/cli.js | #!/usr/bin/env node
var path = require("path");
var commandLineArgs = require('command-line-args');
var SimpleThumbnailGenerator = require("./simple-thumbnail-generator");
var ThumbnailGeneratorService = require("./thumbnail-generator-service");
var utils = require("./utils");
var Logger = require("./logger");
var op... | JavaScript | 0.000002 | @@ -4344,17 +4344,26 @@
Count,%0A%09
-w
+thumbnailW
idth: wi
@@ -4368,17 +4368,26 @@
width,%0A%09
-h
+thumbnailH
eight: h
@@ -5427,8 +5427,9 @@
(1);%0A%7D);
+%0A
|
fbe3162766d590485a8ebbf82a0076012fcfc350 | Test for `set` | test/create.js | test/create.js | 'use strict';
var isArray = Array.isArray;
module.exports = function (t, a) {
var ObservableArray = t(Array)
, arr = new ObservableArray('foo', 'bar', 23)
, evented = 0, x = {};
a(isArray(arr), true, "Is array");
a(arr instanceof ObservableArray, true, "Subclassed");
a.deep(arr, ['foo', 'bar', 23], "Constr... | JavaScript | 0.000001 | @@ -1322,26 +1322,38 @@
'abc');%0A
+%0A
%09arr.
-push(
+set(arr.length,
'raz');%0A
|
17219abf022ff722a98de9575b07aec7057c172b | Fix build sitemap.xml | src/tasks/sitemap-xml.js | src/tasks/sitemap-xml.js | var _ = require('lodash'),
vow = require('vow'),
js2xml = require('js2xmlparser'),
errors = require('../errors').TaskSitemapXML,
logger = require('../logger'),
levelDb = require('../providers/level-db');
module.exports = function (target) {
logger.info('Start to build "sitemap.xml" file', modu... | JavaScript | 0.000007 | @@ -355,23 +355,16 @@
ions
-%5B'
+().
hosts
-'%5D %7C%7C %7B%7D
;%0A%0A
@@ -1056,25 +1056,22 @@
levelDb
-%0A
+.get()
.getByCr
@@ -1105,20 +1105,16 @@
-
var key
@@ -1127,20 +1127,16 @@
rd.key,%0A
-
@@ -1166,28 +1166,24 @@
e;%0A%0A
-
if (key.inde
@@ -1225,28 +12... |
cdf2a558eec4b351d7742bf2a358f70a73ed21ad | Revert 334b408..8695551 | src/app.js | src/app.js | /**
* Welcome to Pebble.js!
*
* This is where you write your app.
*/
var UI = require('ui');
// fake out configuration information for now
var exercises = [];
for (var i=0; i < 10; i++) {
var name = 'Exercise '+i;
var starting = 100;
exercises.push({
name: name,
reps: [starting, starting+5, starting... | JavaScript | 0 | @@ -219,30 +219,8 @@
+i;%0A
- var starting = 100;%0A
ex
@@ -258,53 +258,241 @@
-reps: %5Bstarting, starting+5, starting+10%5D%0A %7D
+starting: 100,%0A reps: 3,%0A increase: 5%0A %7D);%0A%7D%0A%0Afunction weightsString(exercise)%7B%0A var weights = %5B%5D;%0A for (var i=0; i%3Cexercise.reps; i++)%7... |
10844b0f0430fbd56f64029ca29673c6700f84fa | fix in tests. | test/markup.js | test/markup.js | 'use strict'
var path = require('path')
var helpers = require('yeoman-generator').test
var assert = require('yeoman-assert')
describe('Markup Features', function () {
describe('HTML Project', function () {
before('crafting project', function (done) {
helpers.run(path.join(__dirname, '../app'))
.in... | JavaScript | 0 | @@ -2612,13 +2612,16 @@
pug/
-index
+screen-1
.pug
|
83617243dd5d4c0156ba4cee3c43a6f03369fe7d | Use predefined "global" var in place of "this". | src/end.js | src/end.js | if ( typeof define === "function" && define.amd ) {
define(this.sn = sn);
} else if ( typeof module === "object" && module.exports ) {
module.exports = sn;
}
else this.sn = sn;
}();
| JavaScript | 0 | @@ -161,19 +161,24 @@
;%0A%09%7D
-%0A%09
+
else
-this
+%7B%0A%09%09global
.sn
@@ -183,13 +183,16 @@
n = sn;%0A
+%09%7D%0A
%7D();%0A
|
d91dd9669b7a1c5dd18044e791c6900c14186e36 | Fix #158. | src/app.js | src/app.js | var SVG_NS = "http://www.w3.org/2000/svg"
export default function (app) {
var view = app.view || function () {
return ""
}
var model
var actions = {}
var subscriptions = []
var hooks = {
onError: [],
onAction: [],
onUpdate: [],
onRender: []
}
var plugins = [app].concat((app.plugin... | JavaScript | 0 | @@ -1609,27 +1609,21 @@
esult ==
-= undefined
+ null
%7C%7C type
|
3e9139641cec670eb524c8e4aaa87f4605ac621c | Add a test to ensure that "a = (1, 2)" is parsed and printed correctly. | test/parens.js | test/parens.js | var assert = require("assert");
var esprima = require("esprima");
var parse = require("../lib/parser").parse;
var Printer = require("../lib/printer").Printer;
var NodePath = require("ast-types").NodePath;
var util = require("../lib/util");
var n = require("../lib/types").namedTypes;
var b = require("../lib/types").buil... | JavaScript | 0.00078 | @@ -2126,16 +2126,41 @@
= 3)%22);
+%0A check(%22a = (1, 2)%22);
%0A%0A t.
|
d95e53c8ae63e8c32db4ab94a0db0055b913ee40 | Update reason why micro.blog is skipped | test/remote.js | test/remote.js | import test from 'ava'
import Ajv from 'ajv'
import got from 'got'
import schema from '..'
const macro = (t, url) => {
return got(url, { json: true }).then(res => {
const valid = t.context.ajv.validate(schema, res.body)
t.true(valid, t.context.ajv.errorsText())
})
}
test.beforeEach(t => {
t.context.ajv... | JavaScript | 0.000001 | @@ -806,47 +806,98 @@
%0A//
-Item IDs are numbers instead of strings
+%60author.url%60 sometimes is empty.%0A// See https://github.com/brentsimmons/JSONFeed/issues/35
.%0Ate
|
f46a57919e9d8ddbe48027abb497ebf9214d0aa9 | support option '-i' and '--image' to specify rootfs image | bin/makerboard.js | bin/makerboard.js | #!/usr/bin/env node
/*
QEMU=`which qemu-mipsel-static`
if [ ! -x "$QEMU" ]; then
echo "No available QEMU utility can be used."
echo "Please install it with command:"
echo " sudo apt-get install qemu-user-static"
exit
fi
*/
var path = require('path');
var fs = require('fs');
var MakerBoard = require('../lib/make... | JavaScript | 0.000003 | @@ -713,32 +713,155 @@
create %3Cpath%3E')%0A
+%09%09.option('i', %7B%0A%09%09%09alias: 'image',%0A%09%09%09describe: 'specifying an image to be used',%0A%09%09%09type: 'string'%0A%09%09%7D)%0A%09%09.nargs('i', 1)%0A
%09%09.help('help')%0A
@@ -852,32 +852,32 @@
%09%09.help('help')%0A
-
%09%09.example('$0 c
@@ -1021... |
2783e2e313fa1385a1db0001f38aea2029df7940 | Improve docstrings | src/bem.js | src/bem.js | /*
* This module provides BEM (Block Element Modifier) related methods
* These methods can be used as an abstraction to talk to the DOM
* BEM is a CSS methodology separating blocks (block) from elements (__element) and modifiers (--modifier)
* BEM examples: alert, alert--warning, form__button, form__button--disable... | JavaScript | 0.000005 | @@ -3824,32 +3824,37 @@
m %7Bboolean%7D %5Bexp
+=true
%5D Optional: If t
@@ -4794,32 +4794,37 @@
m %7Bboolean%7D %5Bexp
+=true
%5D Optional: If t
|
3a38e4aa5deb756f49054d85512342b2b209396f | Fix assertion in a bot method | src/bot.js | src/bot.js | 'use strict';
const { expect } = require('code');
const Rx = require('rx-lite');
const Logger = require('./logger');
const logLevel = process.env.NODE_ENV === 'production' ? 'info' : 'debug';
const slackToken = process.env.SLACK_TOKEN;
class Bot {
constructor(controller) {
this._logger = new Logger(logLevel, ... | JavaScript | 0.001017 | @@ -1594,16 +1594,18 @@
n.object
+()
.and.to.
|
3edaf73ce8b9eddb926be3ca50c57097a587410e | Remove code for debugging Travis | test/shared.js | test/shared.js | import React from 'react';
import { mount } from 'enzyme';
import { createStore } from 'redux';
import Phone from '../dev-server/Phone';
import App from '../dev-server/containers/App';
import brandConfig from '../dev-server/brandConfig';
import version from '../dev-server/version';
import prefix from '../dev-server/pr... | JavaScript | 0.000038 | @@ -359,36 +359,8 @@
';%0A%0A
-console.info(process.env);%0A%0A
cons
|
95838bfb121b5a0c4ed38f7a1c8a910a0bf65285 | Update simple.js | test/simple.js | test/simple.js | JavaScript | 0.000001 | @@ -1 +1,3037 @@
%0A
+var assert = require('assert');%0Avar global_variable = 'i am global';%0A%0Adescribe('mocha runner', function () %7B%0A this.timeout(0);%0A var describe_variable = 'i am in describe';%0A%0A before('Before all hook', function (done) %7B%0A console.info('before all');%0A //th... | |
e9ec6db0078efdc45678a52b75b4d7b1b08678e0 | add shortcut -x for --proxy | src/hii.js | src/hii.js | /**
* @file
* @author zdying
*/
var __hiipack = require('./global');
var express = require('express');
var path = require('path');
var fs = require('fs');
var fse = require('fs-extra');
var colors = require('colors');
var child_process = require('child_process');
var os = require('os');
var server = require('./serv... | JavaScript | 0.000002 | @@ -1364,16 +1364,69 @@
.cwd())%0A
+ .option('-x, --proxy', 'start the proxy server')%0A
.opt
@@ -1619,57 +1619,8 @@
or')
-%0A .option('--proxy', 'start the proxy server')
;%0A%0Ap
|
fc9c697bed738906673f210c0bf760b5b0a11047 | use files and roots everywhere | src/cli.js | src/cli.js | #!/usr/bin/env node
import 'babel-polyfill'
import log from 'npmlog'
import untildify from 'untildify'
// don't log the config until the log level is set
import config from './config/default.js'
import options from './config/options.js'
import saveConfig from './config/save.js'
import albums from './command/albums.... | JavaScript | 0 | @@ -2049,32 +2049,83 @@
.argv%0A
+ files = argv._.slice(1).map(f =%3E untildify(f))%0A
roots = argv
@@ -2112,38 +2112,46 @@
f))%0A roots =
+(
argv.R
+ %7C%7C %5B%5D)
.map(r =%3E untild
@@ -2222,31 +2222,20 @@
ums(
-argv._.slice(1), argv.R
+files, roots
)%0A
|
3e20a04f3bc44dfea4a6e93fa3054c05e1f4b9d9 | update email address | src/cli.js | src/cli.js | var program = require('commander');
var fs = require('fs');
var path = require('path');
var pjson = require('../package.json');
var colors = require('colors/safe');
var Runner = require('./runner');
program
.version(pjson.version)
.option('-c, --conf <config-file>', 'Path to Configuration File')
.parse(process.a... | JavaScript | 0.000001 | @@ -1268,27 +1268,26 @@
ct:
-support@screener.io
+help@saucelabs.com
');%0A
|
e10198543eb2d6ee8764784b44b92187eceb4b1d | Update path to compare page | src/cli.js | src/cli.js | #!/usr/bin/env node
import 'babel-polyfill';
import commander from 'commander';
import { getPreviousSha, setPreviousSha } from './previousSha';
import constructReport from './constructReport';
import createDynamicEntryPoint from './createDynamicEntryPoint';
import createWebpackBundle from './createWebpackBundle';
im... | JavaScript | 0 | @@ -2079,22 +2079,23 @@
dpoint%7D/
-report
+compare
?q=$%7Bpre
|
401c01ad7684bc9451a2987d9a19269a1f9ec2ec | fix English grammar in CLI output when there's only 1 file | src/cli.js | src/cli.js | #!/usr/bin/env node
/*eslint-env node */
/*eslint no-process-exit: 0 */
'use strict';
var fs = require('fs');
var glob = require('glob');
var bootlint = require('./bootlint.js');
var totalErrCount = 0;
var totalFileCount = 0;
var disabledIds = [];
var patterns = process.argv.slice(2);
patterns.forEach(function (patte... | JavaScript | 0.000042 | @@ -947,17 +947,19 @@
+ %22 file
-s
+(s)
.%22);%0Aif
|
2f43aa247e5032ed61112c63ff1461b6d04a8d9d | Remove stray word | react/components/ManageChannel/index.js | react/components/ManageChannel/index.js | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { compose, graphql } from 'react-apollo';
import { propType } from 'graphql-anywhere';
import { some } from 'underscore';
import styled from 'styled-components';
import mapErrors from 'react/util/mapErrors';
import compactObject from ... | JavaScript | 0.999407 | @@ -3412,18 +3412,8 @@
%7D%0A%0A
- handle%0A%0A
re
|
109561225a43b1f487c09a2acf84d955892d5c37 | add async harness to CRL | src/crl.js | src/crl.js | (function(){
/*
CRL (Cor Runtime Library)
*/
var
hasProp = Object.prototype.hasOwnProperty,
slice = Array.prototype.slice;
CRL = (typeof CRL === 'undefined' ? {} : CRL);
CRL.idSeed = 1;
CRL.instancers = [];
CRL.nativeTypes = {
'String' : String,
'Number' : Number,
'Boolean' : Boolean,
'R... | JavaScript | 0.000001 | @@ -3007,16 +3007,1048 @@
e;%0A%7D;%0A%0A%0A
+// Schedule%0Afunction schedule(fn, time) %7B%0A if (time === void 0 && typeof global.setImmediate !== 'undefined') %7B%0A setImmediate(fn);%0A %7D else %7B%0A setTimeout(fn, +time);%0A %7D%0A%7D%0A%0A// Breakpoint%0Afunction Breakpoint(timeout) %7B%... |
6f70f049f5e5e4a98eb38352d8f278fa8d77132f | Correct use of `commander` for parsing CLI options | bin/thoughtful.js | bin/thoughtful.js | #!/usr/bin/env node
/*!
* thoughtful-release <https://github.com/nknapp/thoughtful-release>
*
* Copyright (c) 2015 Nils Knappmeier.
* Released under the MIT license.
*/
'use strict'
var program = require('commander')
program
.version(require('../package').version)
.command('changelog <release>', 'update th... | JavaScript | 0 | @@ -301,18 +301,33 @@
elease%3E'
-,
+)%0A .description(
'update
@@ -656,8 +656,103 @@
s.argv)%0A
+%0Aif (process.argv.length === 2) %7B%0A // No args provided: Display help%0A program.outputHelp()%0A%7D%0A
|
1b3b24a73e34fb953535411d44485f23d02a4fc8 | Update gameVersion | public/js/database.js | public/js/database.js |
// LoL Cruncher - A Historical League of Legends Statistics Tracker
// Copyright (C) 2015 Jason Chu (1lann) 1lanncontact@gmail.com
// This program 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, ei... | JavaScript | 0.000001 | @@ -897,11 +897,11 @@
= 6
-162
+201
%0Avar
|
3f7c7299380b8aa138eaeb5d31d10636a57e37ca | Update basic.js | tests/basic.js | tests/basic.js | "use strict";
// this is a test
const assert = require('chai').assert;
describe("geek value equals 42", () => {
let geek = 42;
it("should return 42", () => {
assert.equal(geek, 42)
});
});
| JavaScript | 0.000001 | @@ -179,17 +179,17 @@
l(geek,
-4
+3
2)%0A %7D);
|
a04ca40a1073392c35ff64b2a75bc6fe19cf88fa | add createTemplateElement | src/dom.js | src/dom.js | import {_FEATURE} from './feature';
let shadowPoly = window.ShadowDOMPolyfill || null;
/**
* Represents the core APIs of the DOM.
*/
export const _DOM = {
Element: Element,
SVGElement: SVGElement,
boundary: 'aurelia-dom-boundary',
addEventListener(eventName: string, callback: Function, capture?: boolean): voi... | JavaScript | 0.000001 | @@ -1068,32 +1068,198 @@
ragment();%0A %7D,%0A
+ createTemplateElement(): HTMLTemplateElement %7B%0A let template = document.createElement('template');%0A return _FEATURE.ensureHTMLTemplateElement(template);%0A %7D,%0A
createMutation
|
ffc727e7806f896ff445bbe31dec25549e217722 | add id selector | src/dom.js | src/dom.js | import { toArray } from "./util";
export function $(selector, el = document) {
return el.querySelector(selector);
}
export function $$(selector, el = document) {
return toArray(el.querySelectorAll(selector));
}
export function replace(el_old, el_new) {
el_old.parentNode.replaceChild(el_new, el_old);
... | JavaScript | 0.000001 | @@ -211,24 +211,105 @@
ector));%0A%7D%0A%0A
+export function id(name, el = document) %7B%0A return el.getElementById(name);%0A%7D%0A%0A
export funct
@@ -2729,30 +2729,8 @@
-$, $$, component,%0A
repl
@@ -2747,16 +2747,42 @@
, remove
+,%0A $, $$, id, component
,%0A ad
|
79551bea7d3c52a7ba7621ab4e1332ce8853f298 | update dom | src/dom.js | src/dom.js | var _findInChildren = function ( element, elementToFind ) {
for ( var i = 0; i < element.children.length; ++i ) {
var childEL = element.children[i];
if ( childEL === elementToFind )
return true;
if ( childEL.children.length > 0 )
if ( _findInChildren( childEL, elemen... | JavaScript | 0.000001 | @@ -1562,24 +1562,43 @@
ent;%0A %7D%0A%0A
+ var el = null;%0A
for ( va
@@ -1647,28 +1647,24 @@
) %7B%0A
-var
el = FIRE.ge
@@ -1757,24 +1757,174 @@
rn el;%0A %7D
+%0A if ( element.shadowRoot ) %7B%0A el = FIRE.getFirstFocusableChild(element.shadowRoot);%0A if ( el !== null )%0... |
55aca83478807452c7e3f8fc79830e3f1c428207 | Add missing ; | tests/index.js | tests/index.js | import path from 'path';
import fs from 'fs';
import FeatherPlugin from '../';
const HELPER_DIR = path.join(__dirname, 'helpers');
class MockCompiler {
constructor() {
this.options = {
context: HELPER_DIR
};
}
plugin(type, fn) {
this.fn = fn;
}
}
const compiler = new MockCompiler();
let i... | JavaScript | 0.000015 | @@ -1712,14 +1712,15 @@
;%0A %7D%0A %7D)
+;
%0A%7D
|
05802698e6ce639440111eddf8fbecf4da3f0098 | Add logging/spinner around project validation | src/exp.js | src/exp.js | #!/usr/bin/env node
/**
* @flow
*/
import 'instapromise';
import _ from 'lodash-node';
import bunyan from 'bunyan';
import crayon from '@ccheever/crayon';
import glob from 'glob';
import path from 'path';
import simpleSpinner from '@exponent/simple-spinner';
import url from 'url';
import program, { Command } from... | JavaScript | 0 | @@ -2472,24 +2472,109 @@
lidation) %7B%0A
+ log('Making sure project is setup correctly...');%0A simpleSpinner.start();%0A
// val
@@ -2835,24 +2835,91 @@
%60);%0A %7D%0A
+ simpleSpinner.stop();%0A log('Your project looks good!');%0A
%7D%0A%0A r
|
249eb48bfbadbde7b03f9989594188d3a2f621f5 | Add some things to the info panel | src/gui.js | src/gui.js | const EventEmitter = require('events'),
blessed = require('blessed'),
timestamp = require('./util/timestamp');
class GUI extends EventEmitter {
constructor(screen) {
super();
this.screen = screen;
this.chatbox = blessed.box({
label: 'Retrocord Light',
left: '0.5%',
width: '86%',
... | JavaScript | 0 | @@ -106,16 +106,51 @@
estamp')
+,%0A Discord = require('discord.js')
;%0A%0Aclass
@@ -1507,16 +1507,734 @@
se;%0A %7D%0A
+ renderInfo() %7B%0A if (global.ctx && ctx.discord && ctx.discord.user) %7B%0A const uname = ctx.discord.user.username,%0A friendCount = ctx.discord.user.friends.array().length,... |
23f31e5c8f0d13984e0caa314e67fa2652ebf0d1 | use global.environment | tile-server.js | tile-server.js | var Windshaft = require('windshaft');
var _ = require('underscore')._;
var fs = require('fs');
var userConfig = require('./config.json');
// Configure pluggable URLs
// =========================
// The config object must define grainstore config (generally just postgres connection details), redis config,
// a base url... | JavaScript | 0.00089 | @@ -1579,24 +1579,27 @@
%0Aglobal.
-settings
+environment
= requi
|
384bf34fd0b42983591b6df552574f3fa5494f94 | Fix code style | tinypng-cli.js | tinypng-cli.js | #!/usr/bin/env node
var fs = require('fs');
var request = require('request');
var minimatch = require('minimatch');
var glob = require('glob');
var uniq = require('array-uniq');
var chalk = require('chalk');
var pretty = require('prettysize');
var argv = require('minimist')(process.argv.slice(2));
var home = process.... | JavaScript | 0.000169 | @@ -1646,34 +1646,37 @@
.width) %7B%0A
+
if
+
(typeof (argv.rw
@@ -1711,24 +1711,28 @@
) %7B%0A
+
resize.width
@@ -1757,32 +1757,34 @@
v.width);%0A
+
+
%7D else %7B%0A
@@ -1768,32 +1768,36 @@
%7D else %7B%0A
+
console.
@@ -1874,32 +1874,34 @@
value only.'... |
c3afc8f7661e8edec9a64f87425b61307c2fcec3 | Implement checkKey() function | storage.js | storage.js | (function(){
'use strict';
function Storage(storageAreaName)
{
var _storageArea = (storageAreaName === 'session') ? window.sessionStorage : window.localStorage;
this.isSupported = function() {
return typeof _storageArea !== 'undefined';
};
this.set = function(ke... | JavaScript | 0.000018 | @@ -319,24 +319,52 @@
key, val) %7B%0A
+ checkKey(key);%0A%0A
@@ -377,32 +377,32 @@
=== undefined)%0A
-
@@ -674,32 +674,60 @@
function(key) %7B%0A
+ checkKey(key);%0A%0A
if(_
@@ -1033,32 +1033,60 @@
function(key) %7B%0A
+ checkKey(key);%... |
94552283b415871c60d491a4c7127749f080cc13 | fix duplicated home route | 01-Embedded-Login/src/routes.js | 01-Embedded-Login/src/routes.js | import React from 'react';
import { Route, BrowserRouter } from 'react-router-dom';
import App from './App';
import Home from './Home/Home';
import Callback from './Callback/Callback';
import Auth from './Auth/Auth';
import history from './history';
const auth = new Auth();
export const makeMainRoutes = () => {
ret... | JavaScript | 0.000003 | @@ -421,36 +421,35 @@
er=%7B(props) =%3E %3C
-Home
+App
auth=%7Bauth%7D %7B..
|
4bef6ec5940ca5bcc84b16f4015a68dc7821035a | move toJSON at the end [ci skip] | src/pca.js | src/pca.js | 'use strict';
const Matrix = require('ml-matrix');
const EVD = Matrix.DC.EVD;
const SVD = Matrix.DC.SVD;
const Stat = require('ml-stat').matrix;
const mean = Stat.mean;
const stdev = Stat.standardDeviation;
const defaultOptions = {
isCovarianceMatrix: false,
center: true,
scale: false
};
class PCA {
... | JavaScript | 0 | @@ -3026,352 +3026,8 @@
%7D%0A%0A
- /**%0A * Export the current model to a JSON object%0A * @return %7BObject%7D model%0A */%0A toJSON() %7B%0A return %7B%0A name: 'PCA',%0A center: this.center,%0A scale: this.scale,%0A means: this.means,%0A ... |
1b6ad0ab5b95bd89d3d55ef1d5d346b9e722ef39 | Update index.js | projects/acc/js/index.js | projects/acc/js/index.js | if ('Accelerometer' in window && 'Gyroscope' in window) {
//document.getElementById('moApi').innerHTML = 'Generic Sensor API';
let accelerometer = new Accelerometer();
accelerometer.addEventListener('reading', e => MaccelerationHandler(accelerometer, 'moAccel'));
accelerometer.start();
let accelerometer... | JavaScript | 0.000002 | @@ -2283,21 +2283,23 @@
round =
-color
+#000000
;%0A
|
934ed114536c66b7f855f03454664a5e92c363f1 | Optimise report link popup code | app/assets/javascripts/instructional_materials.js | app/assets/javascripts/instructional_materials.js | function showInstructionalMaterial(oMaterialTab){
setTableHeaders(1);
var oSelectedTab = $$('.selected_tab')[0];
if(oSelectedTab){
oSelectedTab.removeClassName('selected_tab');
oSelectedTab.addClassName('tab');
$(oSelectedTab.id + "_data").hide();
}
oMaterialTab.removeCl... | JavaScript | 0 | @@ -4678,24 +4678,54 @@
%0A %7D);%0A%7D%0A%0A
+var g_reportLinkPopup = null;%0A
%0Afunction op
@@ -4769,24 +4769,25 @@
-var oPopUpWindow
+g_reportLinkPopup
= n
@@ -5180,28 +5180,33 @@
click=%5C%22
-oPopUpWindow
+g_reportLinkPopup
.destroy
@@ -5251,36 +5251,41 @@
/div%3E%22;%0A
-oPopUpWindow
+g_repor... |
043738313222433026f6e9449c3c003e514d954a | Add timeout to scroll efect | app/assets/javascripts/repositories/row_editor.js | app/assets/javascripts/repositories/row_editor.js | /*
globals HelperModule animateSpinner SmartAnnotation Asset
*/
/* eslint-disable no-unused-vars */
var RepositoryDatatableRowEditor = (function() {
const NAME_COLUMN_ID = 'row-name';
const TABLE_ROW = '<tr></tr>';
const TABLE_CELL = '<td></td>';
var TABLE;
// Initialize SmartAnnotation
function initSm... | JavaScript | 0.000001 | @@ -2937,24 +2937,54 @@
'success');%0A
+%0A setTimeout(() =%3E %7B%0A
wind
@@ -3007,16 +3007,18 @@
+
left: 0,
@@ -3018,16 +3018,18 @@
eft: 0,%0A
+
@@ -3053,25 +3053,44 @@
th'%0A
-%7D
+ %7D);%0A %7D, 400
);%0A %7D);
|
98bd54ef5aff77d901ef5e2c118ae4027403b14c | fix sessions relationship in seq block model. | app/models/curriculum-inventory-sequence-block.js | app/models/curriculum-inventory-sequence-block.js | import Ember from 'ember';
import DS from 'ember-data';
const { computed } = Ember;
const { alias, equal } = computed;
export default DS.Model.extend({
title: DS.attr('string'),
description: DS.attr('string'),
required: DS.attr('number'),
childSequenceOrder: DS.attr('number'),
orderInSequence: DS.attr('num... | JavaScript | 0 | @@ -877,44 +877,8 @@
ny('
-curriculum-inventory-sequence-block-
sess
|
c70d485afe776fd08fbb4a34157baa480cd9b528 | Update common.js | userapp/common.js | userapp/common.js | // Init UserApp with your App Id
// https://help.userapp.io/customer/portal/articles/1322336-how-do-i-find-my-app-id-
UserApp.initialize({ appId: "YOUR-USERAPP-APP-ID" });
| JavaScript | 0.000001 | @@ -144,27 +144,21 @@
d: %22
-YOUR-USERAPP-APP-ID
+57b349611262d
%22 %7D)
|
9b9d4d7c0fd1aa6d934e718dbd9d9570fc9a4ab1 | reset XP if it isn't safe int | commands/server_management/giveXP.js | commands/server_management/giveXP.js | /**
* @file giveXP command
* @author Sankarsan Kampa (a.k.a k3rn31p4nic)
* @license GPL-3.0
*/
exports.exec = async (Bastion, message, args) => {
if (!args.id || !args.points) {
return Bastion.emit('commandUsage', message, this.help);
}
if (message.mentions.users.size) {
args.id = message.mentions.u... | JavaScript | 0.000002 | @@ -801,16 +801,77 @@
ints)%7D%60;
+%0A if (!Number.isSafeInteger(args.points)) args.points = '0';
%0A%0A awai
|
e14bb365dc5346e4680f102aabf5732a3305f345 | Add Mat2d | js/AM.Math.js | js/AM.Math.js | AM.Math = AM.Math || {};
AM.Math.ToDeg = function (rad) {
return rad * (180 / Math.PI);
};
AM.Math.ToRad = function (deg) {
return deg * (Math.PI / 180);
};
AM.Math.Vec2d = function (x, y) {
this.x = x;
this.y = y;
};
AM.Math.Vec2d.prototype = {
x: 0,
y: 0,
subtract: function (otherVec) {... | JavaScript | 0.000006 | @@ -1874,16 +1874,682 @@
(proj);%0A %7D%0A%7D;
+%0A%0AAM.Math.Mat2d = function(e00, e01, e10, e11)%7B%0A%09%0A%09this.mat = %5B%5Be00,e01%5D,%0A%09 %5Be10,e11%5D%5D;%0A%7D;%0A%0AAM.Math.Mat2d.prototype = %7B%0A%09mat:%5B%5B0,0%5D,%5B0,0%5D%5D,%0A%09%0A%09mult: function(m)%7B%0A%09%09var e00 = this.mat%5B... |
cab3287e086fd630a0cad28454ed7da16b3f3b59 | Allow beforeFn to override indexFile. | js/server/modules/org/arangodb/foxx/swagger.js | js/server/modules/org/arangodb/foxx/swagger.js | /*global ArangoServerState */
'use strict';
////////////////////////////////////////////////////////////////////////////////
/// @brief Foxx Swagger integration
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2015 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License")... | JavaScript | 0 | @@ -2218,18 +2218,16 @@
eq,
-(
result
-&&
+?
res
@@ -2241,13 +2241,12 @@
Path
-) %7C%7C
+ : (
opts
@@ -2266,16 +2266,17 @@
ppPath))
+)
;%0A
@@ -2285,24 +2285,172 @@
turn;%0A %7D%0A
+ var indexFile = result ? result.indexFile : opts.indexFile;%0A if (pathInfo === 'index.html' && indexFile) %7B... |
2a20d0d7db83a304693577495cb692d1d7fdd24a | Correct scoping for variable (linting) | js/app/app.js | js/app/app.js | /**
* Main application container for the Legislature Tracker
*
* An 'e' prefix is referring to editorialized content.
*/
(function($, w, undefined) {
LT.Application = Backbone.Router.extend({
routes: {
'categories': 'routeCategories',
'category/:category': 'routeCategory',
'bill/:bill': 'ro... | JavaScript | 0 | @@ -4150,30 +4150,27 @@
this;%0A
-%0A
+var
bill_id = d
@@ -4177,32 +4177,39 @@
ecodeURI(bill);%0A
+ %0A
bill = thi
@@ -4245,17 +4245,16 @@
%7D)%5B0%5D;%0A
-%0A
if
|
34ef7196506047b06c3010a4a442fb0bd2a62b71 | Remove Joi validation | routes.js | routes.js | const Reporter = require('./src/Reporter');
const PostReporter = require('./src/PostReport');
const Verification = require('./src/Verification');
const Joi = require('joi');
module.exports = [
{
method: 'GET',
path: '/report/',
handler: Reporter,
config: {
validate: {
query: {
... | JavaScript | 0 | @@ -502,144 +502,8 @@
er,%0A
- config: %7B%0A validate: %7B%0A payload: Joi.object().keys(%7B%0A item: Joi.object().required(),%0A %7D),%0A %7D%0A %7D%0A
%7D,
|
ef959ba56e70e14c02986d8fc3feea6a4de39df3 | Clean getNestedProp | assets/javascript/script.js | assets/javascript/script.js | "use strict";
var getNestedProp = function (obj, propString, fallback) {
if (!propString) return obj;
var prop, props = propString.split('.');
//for (var i = 0, iLen = props.length - 1; i < iLen; i++) {
for (var i = 0, iLen = props.length - 1; i <= iLen; i++) {
prop = props[i];
if (typeof obj == 'ob... | JavaScript | 0 | @@ -147,70 +147,8 @@
);%0A%0A
- //for (var i = 0, iLen = props.length - 1; i %3C iLen; i++) %7B%0A
fo
@@ -361,34 +361,8 @@
%7D%0A%0A
- //return obj%5Bprops%5Bi%5D%5D;%0A
re
|
19073b16508fd3e0e3180e5372be4f75f7fbc66b | Fix GlobalSearch result z-index | components/AppLayout/GlobalSearch.js | components/AppLayout/GlobalSearch.js | import React, { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
import { t } from 'ttag';
import {
Box,
InputAdornment,
TextField,
ClickAwayListener,
makeStyles,
} from '@material-ui/core';
import SearchIcon from '@material-ui/icons/Search';
const useStyles = makeStyles(theme => ... | JavaScript | 0.000002 | @@ -730,25 +730,25 @@
zIndex:
-1
+2
,%0A displa
|
023c261748af4fec2c0e00dfb2b6edc714681aa9 | Move Ragnar back to original home location | components/character/player/index.js | components/character/player/index.js | 'use strict';
var Player = function(playablePlayerName, ctx) {
this.ctx = ctx;
this.spriteFile = new Image();
this.spriteFile.src = 'components/character/player/sprites.png';
this.tileScale = 3;
this.name = playablePlayerName;
this.type = 'playable'; // Airship, Boat, etc
this.models = this.getModels... | JavaScript | 0.000001 | @@ -480,12 +480,12 @@
x:
-1408
+2624
, /
@@ -503,11 +503,11 @@
y:
-976
+752
|
ea4350063182f28a3c45451ceb9758d025f96840 | add markdown plugin for markdown to html conversion via marked | runner.js | runner.js | const fs = require('fs')
const path = require('path')
const glob = require('glob')
const matter = require('gray-matter')
const DEFAULT_OPTIONS = {
source: './content',
target: './public'
}
const data = {
files: {},
meta: {
title: 'test'
},
options: DEFAULT_OPTIONS
}
// util functions
const readFile ... | JavaScript | 0 | @@ -113,16 +113,49 @@
matter')
+%0Aconst marked = require('marked')
%0A%0Aconst
@@ -947,24 +947,200 @@
%7D)%0A %7D%0A%7D%0A%0A
+const markdown = () =%3E data =%3E %7B%0A return %7B%0A files: data.files.map(file =%3E %7B%0A return Object.assign(file, %7B%0A content: marked(file.content)%0A %7... |
b9a9338d074e868ebbe053e8bbc46aae8fd5edd2 | undo last change... who am i kidding, these commits are just tests for webhooks. | src/map.js | src/map.js | /*!
** Created by Jacques Vincilione, Justin Johns - Lucien Consulting, INC
** Requires Google Maps API to be included.
**
** Standard MIT License
Copyright (c) 2015 Lucien Consulting, INC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ... | JavaScript | 0 | @@ -1217,13 +1217,9 @@
%0A*/%0A
-void
+(
func
@@ -3932,9 +3932,10 @@
%7D);%0A%0A%7D()
+)
;
|
43d3284c74ea9cd651b58d90665799440df5d65e | Update mainLucas.js | assetsLucas/js/mainLucas.js | assetsLucas/js/mainLucas.js | $( document ).ready(function() {
$(".masthead__menu-item").each(
function(){
$( this ).on( "click", function() {
//$(".masthead__menu-item").removeClass("links-activeItem");
//$( this ).addClass("links-activeItem");
//console.log("masthead__menu-item:I am caleld");
window.activeNaviItem ... | JavaScript | 0.000001 | @@ -27,16 +27,42 @@
on() %7B%0A%0A
+ /*%0A //only for ajax navi%0A
$(%22.mas
@@ -146,18 +146,16 @@
%7B%0A
-//
$(%22.mast
@@ -211,18 +211,16 @@
;%0A
-//
$( this
@@ -255,150 +255,8 @@
%22);%0A
- //console.log(%22masthead__menu-item:I am caleld%22);%0A window.activeNaviItem = $( this );%0A... |
67c98c90debdb0bd878f4d90aee9fd4e15cbc26e | Fix vote id | scripts/offline.js | scripts/offline.js | (function() {
var db;
databaseOpen()
.then(refreshView);
function databaseOpen() {
return new Promise(function(resolve, reject) {
var version = 1;
var request = indexedDB.open('bookmarks', version);
// Run migrations if necessary
request.onupgradeneeded = function(e) {
d... | JavaScript | 0.000001 | @@ -6338,22 +6338,18 @@
').text(
-PIndex
+id
);%0A %09$(
|
0fd6a77844fce2f201726ae5bf0e77fa2247a29a | add a sanity check | sanity.js | sanity.js | var pad = ' ';
var expect = function (actual, expected, message) {
if (expected != actual) {
print(message + ': ' + actual + ' (expected: ' + expected + ')');
}
};
var expectNone = function (collection, field) {
var selector = {};
selector[field] = {$exists: true};
... | JavaScript | 0.000013 | @@ -2430,32 +2430,402 @@
empty note');%0A%0A
+matches('memberships', 'jurisdiction_id', %7B%0A $where: function () %7B%0A var count = 0;%0A for (var i = 0, l = this.contact_details.length; i %3C l; i++) %7B%0A if (this.contact_details%5Bi%5D.type == 'email') %7B%0A count += 1;%0A %7D%0A i... |
2e538754422f4844c854261c52aba8bc9ec87449 | add param 'root' to MDSConsole.run callback | js/console.js | js/console.js | var MDSConsole = {
/**
* Private!
* Posts message to console.
*/
post: function(type, message) {
var logRecord = document.createElement('div');
logRecord.classList.add('run_script__console_record');
logRecord.textContent = message;
var console = document.getElementById('run_script__console'... | JavaScript | 0.000003 | @@ -3678,16 +3678,52 @@
action(
+Mydataspace.getRoot(MDSConsole.root)
);%0A
|
e69ca52e830f5df2960f737f790cc75dfcb618ed | split name and city strings | script.js | script.js | var iconStar = "img/star.svg";
var iconNostar = "img/nostar.svg";
var iconSearch = "img/search.svg";
loadBusstopsList();
$(document).ready(function() {
// Initialize
$(".bus-list").hide();
$(".station").removeClass("expanded");
// User Events
$(".station").click(function() {
if ($(this).hasClass("e... | JavaScript | 0.000451 | @@ -2834,16 +2834,200 @@
data) %7B%0A
+ for (var i = 0; i %3C data.length; i++) %7B%0A // %5B0%5D is italian %5B1%5D is german%0A data%5Bi%5D.stop = data%5Bi%5D.ORT_NAME.split(%22 - %22);%0A data%5Bi%5D.city = data%5Bi%5D.ORT_GEMEINDE.split(%22 - %22);%0A %7D%0A
localS
|
c934e8f793b71e9b95134ba559240e482995b433 | Update content.js | js/content.js | js/content.js | Contents = {};
MainModel = null;
$(function() { // have to wait for DOM to load to get templates
Contents.github = new Content({
id: "github",
title: "GitHub",
description: "The full source code for all of my non-work projects is hosted on my GitHub!",
color: [0, 0, 190]
});
... | JavaScript | 0.000001 | @@ -669,33 +669,8 @@
/a%3E.
-%3Cbr /%3EClick logo to play!
%22,%0A
|
db37aed97b45e3d57013e15598bf15eeebc7fcb4 | Allow setting arbitrary image | script.js | script.js | (function () {
var $sam, $top;
function randomOffset() {
var range = 15;
return Math.floor(Math.random() * range) - Math.ceil(range / 2);
}
function wiggle() {
setDimensions();
setPosition();
}
function setDimensions() {
var scaleWidth, scaleHeight, scaleRatio, newWidth, newHeight;
... | JavaScript | 0.000004 | @@ -25,16 +25,23 @@
am, $top
+, parms
;%0A%0A fun
@@ -1082,40 +1082,546 @@
%0A%0A
-$(function () %7B%0A cacheQueries
+function setImage() %7B%0A if (parms%5B'img'%5D) %7B%0A $sam.attr('src', parms%5B'img'%5D);%0A %7D%0A %7D%0A%0A function parseParameters() %7B%0A var rawParms;%0A parms = ... |
c33b9f0f6c34996d40dbc3854b4a248dc6b62972 | Add background canvas | js/display.js | js/display.js | import { $$ } from 'util/dom';
import settings from 'settings';
var canvas = document.createElement('canvas');
export var ctx = canvas.getContext('2d');
var rows = settings.rows;
var cols = settings.cols;
var jewelSize = settings.jewelSize;
var firstRun = true;
function setup () {
var boardElement = $$('#game-scr... | JavaScript | 0.000001 | @@ -257,16 +257,581 @@
true;%0A%0A
+function createBackground () %7B%0A var bg = document.createElement('canvas');%0A var ctx = bg.getContext('2d');%0A var x, y;%0A%0A bg.classList.add('board-bg');%0A bg.width = cols * jewelSize;%0A bg.height = rows * jewelSize;%0A%0A ctx.fillStyle = 'rgba(255,23... |
26fd757bee1a2da4a9fae8566269622052afdb9a | allow multiple values in filters | script.js | script.js | $(function() {
var app = angular.module('app', []);
app.filter('slugify', function() {
return function(input) {
return input.replace(/[^\w]/g, '').replace(/\s+/g, '-').toLowerCase();
};
});
app.controller('Ctrl', function($scope, $http, $location, $filter) {
var all... | JavaScript | 0.000002 | @@ -902,24 +902,95 @@
ngth %3E 0) %7B%0A
+ d%5Bkey%5D = _.map(value.split(','), _.trim);%0A%0A
@@ -1622,14 +1622,13 @@
niq(
-%5Bvalue
+d%5Bkey
%5D.co
@@ -2351,16 +2351,17 @@
%5Bkey%5D =
+%5B
filter.v
@@ -2364,16 +2364,17 @@
er.value
+%5D
;%0A
|
263fdcc3ea8812fd47a505db70dbe0373d8c8f62 | Fix bug where last entry would not show. | script.js | script.js | $( document ).ready(function() {
var $form = $("form#wiki");
var $output = $('#articles');
var $outputElement = $('<p>');
var pageids = [];
/* Setup button handler */
$form.submit(function( event ) {
event.preventDefault();
var start_article = $(this).find("input[type=text]").val();
console.log( "Start: ",... | JavaScript | 0 | @@ -2073,19 +2073,75 @@
%09%09%09%09
-return null
+// false: No next wiki page available%0A%09%09%09%09return %5Bsplit%5B0%5D, false%5D;
%0A%09%09%09
@@ -2214,16 +2214,68 @@
le link%0A
+%09%09// true: Continue, sentence has a link at the end%0A
%09%09return
@@ -2275,16 +2275,17 @@
%09return
+%5B
split%5B0%5D
@@ ... |
0bed76f5ab3dd1cda9304226ed09206812887064 | Update gruppoc.js | js/gruppoc.js | js/gruppoc.js | gruppo.innerHTML ="<h3>26/5/2017 - Nuovo Badge</h1>Aggiunto un nuovo Badge: il Badge Navigatore. Si ottiene navigando nella piattaforma on line del corso per referenti di sostegno. Il tempo trascorso on line lo potete vedere del registro presenze."
gruppo.innerHTML += "<iframe width=\"100%\" height=\"200\" src=\"https:... | JavaScript | 0.000001 | @@ -242,16 +242,168 @@
senze.%22%0A
+gruppo.innerHTML += %22%3Cimg src='http://www.alberghierocastelnuovocilento.gov.it/moodlekeys/pluginfile.php/41/badges/badgeimage/26/f1?refresh=9437'%3E%3Cbr%3E%22%0A
gruppo.i
|
4f5cfd6e63e7287669573ebce4a70c7d87428e25 | Add an externally available deselection | src/tools/tool.select.js | src/tools/tool.select.js | /**
* @file Tool definition for the PC dual purpose selection tool. Provides event
* handlers and special logic for the selection tool ONLY. Allows selection of
* entire objects, rotation, scaling and node/segment adjustment.
**/
"use strict";
module.exports = function(paper) {
var tool = new paper.Tool();
//... | JavaScript | 0 | @@ -712,16 +712,138 @@
5%0A %7D;%0A%0A
+ // Externalize deseletion%0A paper.deselect = function() %7B%0A if (selectionRectangle) selectionRectangle.remove();%0A %7D%0A%0A
// Too
|
d654e71867b585b1ebf564891253999d710fdfc6 | Fix placeholder being shown instead of selected value on rerender | dist/index.js | dist/index.js | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("va... | JavaScript | 0 | @@ -2954,24 +2954,43 @@
%7D else if (
+!newProps.value &&
newProps.pla
|
0ec5383ea4506399be04713c0809f948dd053e38 | Change boolean-based options to real booleans | js/hipchat.js | js/hipchat.js | (function() {
// Creates an iframe with an embedded HipChat conversation window.
//
// Options:
// url - The url to the room to embed; required
// el - The container in which to insert the HipChat panel; required
// timezone - The timezone to use in the embedded room; required
/... | JavaScript | 0.999921 | @@ -887,17 +887,21 @@
nymous:
-0
+false
,%0A
@@ -963,17 +963,20 @@
inimal:
-1
+true
%0A
|
bf06b9dc4a2508b05c6e7da3b0d8a66a58c04f15 | Remove redundant `? true : false` | dist/layzr.js | dist/layzr.js | (function(root, factory) {
if(typeof define === 'function' && define.amd) {
define([], factory);
} else if(typeof exports === 'object') {
module.exports = factory();
} else {
root.Layzr = factory();
}
}(this, function() {
'use strict';
// CONSTRUCTOR
function Layzr( options ) {
// deboun... | JavaScript | 0.001107 | @@ -688,23 +688,8 @@
%3E 1
- ? true : false
;%0A
|
c218779a9c87700f4c38cb2d7d3ab2abf3a603f1 | Fix map controls | js/mapView.js | js/mapView.js | //Declare API access Token
mapboxgl.accessToken = 'pk.eyJ1IjoibGl6emllZ29vZGluZyIsImEiOiJjaW92cmc1NHYwMWJsdW9tOHowdTA2cnFsIn0.lFq-Wju99kZ_dR_2TMBYCQ';
//Initialize a new map object inside of the #map div
function initMap(callback, initialSalary, source){
console.log('initMap');
window.map = new mapboxgl.Map({
... | JavaScript | 0.000001 | @@ -465,18 +465,17 @@
axZoom:
-12
+9
, //Defa
|
bff7636d9936fef6905b07b3c8d1c82309de873d | Fix i18n import | src/translation/index.js | src/translation/index.js | import {t, init} from 'i18next';
export default {
translate: t,
init
};
| JavaScript | 0.000019 | @@ -23,16 +23,23 @@
'i18next
+-client
';%0A%0Aexpo
|
278193fd07101d0f0c92c88892731b144a02f770 | fix card url | js/overlay.js | js/overlay.js | /* global TrelloPowerUp */
var Promise = TrelloPowerUp.Promise;
var t = TrelloPowerUp.iframe();
var gFormUrl = '';
var cardName = '';
var cardShortLink = '';
var userName = t.arg('user');
// this function we be called once on initial load
// and then called each time something changes
t.render(function(){
return Pr... | JavaScript | 0.000001 | @@ -382,25 +382,19 @@
name', '
-shortLink
+url
')%0A %5D)%0A
@@ -696,17 +696,11 @@
ata.
-shortLink
+url
;%0A
@@ -901,16 +901,17 @@
00294234
+=
%22 + card
|
93dc8cc1043b757c2cb1215d82335a7328781245 | Add pcr module initiation | src/pcr.js | src/pcr.js | var express = require('express');
var path = require('path');
var PCR = require('pcr');
var app = express();
app.set('port', process.env.PORT || 3000);
app.set('view engine', 'ejs');
app.use(express.static('public'));
app.get('/', (req, res) => {
res.render('index');
});
app.listen(app.get('port'), () => {
cons... | JavaScript | 0 | @@ -82,16 +82,95 @@
pcr');%0A%0A
+var TOKEN = process.env.PCR_AUTH_TOKEN %7C%7C 'public';%0Avar pcr = new PCR(TOKEN);%0A%0A
var app
|
2878330894a28fd0a7ad3bf5e0f21f9cea3265a3 | Improve element check + include scroll position object to set the current scrolling position | scroll.js | scroll.js | import viewport from './viewport';
/**
* Find the current scroll position of a HTML Element
* @param {HTMLElement|window} [elm = viewport] - The HTML element to find the scrolling position from
* @return {Object} - The current scroll information
*/
export default function scroll(elm = viewport) {
// Take the vi... | JavaScript | 0 | @@ -27,16 +27,185 @@
ewport';
+%0Aimport size from './size';%0Aimport isObject from './isObject';%0Aimport isWindow from './isWindow';%0Aimport isDOMElement from './isDOMElement';%0Aimport inDOM from './inDOM';
%0A%0A/**%0A *
@@ -458,255 +458,710 @@
m =
-viewport) %7B%0A // Take the viewport if window is the eleme... |
c35681ea6b8a6e0a0d1c3e6f9b86f161767a1d41 | Handle jQuery in noConflict mode. | js/scripts.js | js/scripts.js | // DOM Ready
$(function() {
// SVG fallback
// toddmotto.com/mastering-svg-use-for-a-retina-web-fallbacks-with-png-script#update
if (!Modernizr.svg) {
var imgs = document.getElementsByTagName('img');
for (var i = 0; i < imgs.length; i++) {
if (/.*\.svg$/.test(imgs[i].src)) {
imgs[i].src = imgs[i].src.sli... | JavaScript | 0 | @@ -6,17 +6,38 @@
M Ready%0A
-$
+jQuery(document).ready
(functio
@@ -38,16 +38,17 @@
unction(
+$
) %7B%0A%0A%09//
|
e4d905bd08aea8a3295f8da41997edb1784c7262 | Make types strict-local. | src/utils/testHelpers.js | src/utils/testHelpers.js | /* @flow */
import type { Narrow } from '../types';
export const navStateWithNarrow = (narrow: Narrow): Object => ({
nav: {
index: 0,
routes: [
{
routeName: 'chat',
params: {
narrow,
},
},
],
},
});
export const defaultNav = {
index: 0,
routes: [{ rout... | JavaScript | 0 | @@ -2,16 +2,29 @@
* @flow
+strict-local
*/%0Aimpor
@@ -115,14 +115,24 @@
w):
-Object
+%7B%7C nav: mixed %7C%7D
=%3E
|
4af0f0809a5c23f733dde4d08994a10c6ca62262 | Add author and license comment | src/videojs-playcount.js | src/videojs-playcount.js | import videojs from 'video.js';
/**
* A video.js plugin to handle basic play counting for videos. By default, a
* `played` event will be triggered on the player if the video has played for a
* cumulative 10% of its total video length.
*
* Options
* playTimer: Number of seconds necessary for a view to be consid... | JavaScript | 0 | @@ -235,16 +235,74 @@
gth.%0A *%0A
+ * Author: Nick Pafundi / Clover Sites%0A * License: MIT%0A *%0A
* Optio
|
9e104db2e1eea685f0f50e8a46b2a91c3b5b2755 | Send error messages back to Slack | server.js | server.js | var config = require('config');
var express = require('express');
var bodyParser = require('body-parser');
var ircdispatcher = require('./lib/ircdispatcher');
var messageparser = require('./lib/messageparser');
var l = require('./lib/log')('Server');
var db = require('./lib/db');
var app = express();
app.use(bodyPars... | JavaScript | 0 | @@ -742,9 +742,9 @@
ame
-!
+=
== '
@@ -754,16 +754,147 @@
pError')
+ %7B%0A // Send 200 so that Slack will display the message%0A res.status(200).json(%7Btext: 'Error: ' + e.message%7D);%0A %7D else %7B
%0A l
@@ -943,24 +943,26 @@
stack);%0A
+
res.status(e
@@ -964,22 +964,19 @@
tus(
-e.s... |
905db33e46a66a30c8de268238b4ed4e22751936 | use time from event | server.js | server.js | var env = process.env.NODE_ENV || 'development';
var express = require('express');
var compression = require('compression');
var bodyParser = require('body-parser');
var redis = require('redis');
var request = require('request');
var chunk = require('lodash/chunk');
var find = require('lodash/find');
var redisURL = pr... | JavaScript | 0.000073 | @@ -5817,18 +5817,18 @@
e =
-Date.now()
+event.time
;%0A%0A
|
9e60007fd0ff804d9211a58a53437ee887f6491c | replace action of all matching forms | src/patterns/autosubmit.js | src/patterns/autosubmit.js | define([
'require',
'../lib/jquery',
'../lib/jquery.form',
'../lib/dist/underscore',
'./inject',
'./modal'
], function(require) {
// those two for error messages
var inject = require('./inject');
// can be called on a form or an element in a form
var init = function($el) {
... | JavaScript | 0.000001 | @@ -1090,34 +1090,78 @@
-var ourid = $form.attr('
+if (!data) return;%0A var $forms = $(data).find('form%5B
id
+%5D
');%0A
@@ -1180,26 +1180,29 @@
-if (data && !ourid
+$forms.each(function(
) %7B%0A
@@ -1225,180 +1225,225 @@
-console.warn('Ignored response data because our has no id'... |
d32380b9b5e10361a9ca0bbd938d50e3900e33be | Fix IE compatibility issue using latest Stanbol service. | src/xdr.js | src/xdr.js | // Based on [Julian Aubourg's xdr.js](https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js)
// Internet Explorer 8 & 9 don't support the cross-domain request protocol known as CORS.
// Their solution we use is called XDomainRequest. This module is a wrapper for
// XDR using jQuery ajaxTransport, jQuery's w... | JavaScript | 0 | @@ -1370,16 +1370,52 @@
ataType)
+ + %22&header_Content-Type=text/plain%22
;%0A
|
2ea5769ac4a3d2fb338fca27ce66ce40762be596 | add interpreter hashbang | server.js | server.js | 'use strict';
// Configuration module provides all of the set-up necessary for
// starting the database and configuring the express application
const config = require('./config');
const db = config.mongoose.init();
const app = config.express.init();
// Once the express app is initialized, the API module will
// loop... | JavaScript | 0.000013 | @@ -1,8 +1,29 @@
+#!/usr/bin/env node%0A%0A
'use str
|
1fec746d2c7f453f5281dc72fc6dfbaf569f0e5a | Reorder code in top-down fashion | server.js | server.js | #!/usr/bin/env node
var express = require('express')
var request = require('request')
var app = express()
var slSystems = require('./src/slSystemsCrawler')
var Bacon = require('baconjs').Bacon
var _ = require('lodash')
var courts = require('./public/courts')
var webTimmi = require('./src/webTimmiCrawler')
var browserif... | JavaScript | 0.000001 | @@ -497,32 +497,213 @@
'/courts', f
-unction
+reeCourts)%0Aapp.get('/locations', locations)%0Avar port = process.env.PORT %7C%7C 5000%0Aapp.listen(port, function () %7B%0A console.log('Server started at localhost:' + port)%0A%7D)%0A%0Afunction freeCourts
(req, res) %7B
@@ -1139,17 +1139,16 @@
%0A %7D%0A%7D
-)... |
f46055bb4ef88acd1a653e6a8ed3d3045cbf4bc5 | Disable rollbar in localhost | server.js | server.js | // https://github.com/zeit/next.js/blob/master/examples/custom-server-koa/server.js
//
const Koa = require('koa');
const next = require('next');
const Rollbar = require('rollbar');
const send = require('koa-send');
// Server related config & credentials
//
const serverConfig = {
ROLLBAR_SERVER_TOKEN: process.env.RO... | JavaScript | 0 | @@ -436,80 +436,115 @@
nst
-rollbar = new Rollbar(%7B%0A accessToken: serverConfig.ROLLBAR_SERVER_TOKEN
+enableRollbar = !!serverConfig.ROLLBAR_SERVER_TOKEN;%0Aconst rollbar = new Rollbar(%7B%0A enabled: enableRollbar
,%0A
@@ -560,20 +560,29 @@
caught:
-true
+enableRollbar
,%0A capt
@@ -609,12 +609,71 @@
ns... |
5819d6474614e4ad9fb59c036505c6edabbed32d | enable minify | server.js | server.js | /*eslint-env node*/
// Setup basic express server
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var cfenv = require('cfenv');
var appEnv = cfenv.getAppEnv();
//var port = process.env.PORT || 3000;
var port = appEnv.port;
s... | JavaScript | 0.000049 | @@ -450,16 +450,64 @@
')());%0A%0A
+//Minify%0Aapp.use(require('express-minify')());%0A%0A
// Routi
|
da0af6773f05d808cbf7f8d5b6a9d94bff44885e | Add graceful exit from SIGTERM (docker) | server.js | server.js | "use strict";
const path = require("path");
const env = process.env.NODE_ENV || "development";
const config = require(path.join(__dirname, "config/config"))(env);
if (env === "test" || process.env.PMX) {
require("pmx").init({
http : true
});
}
const app = require(path.join(__dirname, "app.js"))(config);
const p... | JavaScript | 0 | @@ -112,38 +112,19 @@
require(
-path.join(__dirname, %22
+%22./
config/c
@@ -134,165 +134,104 @@
ig%22)
-)
(env);%0A
-%0Aif (env === %22test%22 %7C%7C process.env.PMX) %7B%0A%09require(%22pmx%22).init(%7B%0A%09%09http : true%0A%09%7D);%0A%7D%0A%0Aconst app = require(path.join(__dirname, %22app.js%22))(config
+const... |
cd553620e7a7c21c378b8a63fd8ae00fa1c6dbc0 | call setAttributeNS if args.length === 3 | src/svg.js | src/svg.js | module.exports = function(p5) {
p5.prototype.querySVG = function(selector) {
var svg = this._graphics && this._graphics.svg;
if (!svg) {
return null;
}
var elements = svg.querySelectorAll(selector);
return elements.map(function(elt) {
return new p5.SVG... | JavaScript | 0.000085 | @@ -785,24 +785,297 @@
%7D);%0A %7D;%0A%0A
+ SVGElement.prototype.attribute = function() %7B%0A var args = arguments;%0A if (args.length === 3) %7B%0A this.elt.setAttributeNS.apply(this.elt, args);%0A return this;%0A %7D%0A p5.Element.prototype.attribute.apply(th... |
103749041853065c4f220b02dda87e8c87d7bd89 | implement base api version | server.js | server.js | /**
* Created by godson on 4/9/15.
*/
var express = require( 'express' );
var app = express();
var mongoose = require( 'mongoose' );
var morgan = require( 'morgan' );
var bodyParser = require( 'body-parser' );
var methodOverride = require( 'method-override' );
mongoose.co... | JavaScript | 0 | @@ -34,16 +34,27 @@
5.%0A */%0A%0A
+//Includes%0A
%0Avar exp
@@ -313,16 +313,28 @@
e' );%0A%0A%0A
+// configs%0A%0A
mongoose
@@ -621,16 +621,1294 @@
e());%0A%0A%0A
+// models%0A%0Avar Todo = mongoose.model('Todo', %7B%0A text : String%0A%7D);%0A%0A%0A// routes%0A%0A// get all todos%0Aapp.get('/api/todos', funct... |
0b30ea866a01c6aabf8865d6c33ac3c41a9f141e | refactor scrape vars, and fs write outside loop | server.js | server.js | var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var app = express();
app.get('/scrape', function(req, res){
var url = [
'http://www.imdb.com/list/ls052535080/?start=1&view=detail&sort=listorian:asc',
'http://www.imdb.com/list/ls05... | JavaScript | 0 | @@ -1471,12 +1471,11 @@
= %7B
-%7D;%0A%0A
+%0A
@@ -1486,17 +1486,23 @@
title
-=
+ :
data.fi
@@ -1529,22 +1529,31 @@
+
year
-=
+ :
data.fi
@@ -1583,24 +1583,31 @@
+
rating
-=
+ :
data.fi
@@ -1634,32 +1634,34 @@
value').text();%0A
+
descri
@@ -1... |
84220d8369bd2c2d62b06b6df382364efed9b9b7 | Remove security headers for testing purposes | server.js | server.js | var fs = require('fs')
var path = require('path')
var hyperstream = require('hyperstream')
var app = require('./src/app.js')
var store = require('./src/store.js')
var httpProxy = require('http-proxy')
// var proxy = httpProxy.createProxyServer({target: 'http://elmalvinense.com'})
var proxycake = httpProxy.createProxySe... | JavaScript | 0 | @@ -2303,24 +2303,27 @@
e.now())%0A
+ //
res.setHead
@@ -2361,24 +2361,27 @@
=block')%0A
+ //
res.setHead
@@ -2409,24 +2409,27 @@
'DENY')%0A
+ //
res.setHead
|
08d560fdaba4ca5c5a7319975ab0f86c76a7b7de | Send content-type header. | server.js | server.js | var fs = require('fs')
,Q = require('q')
,http = require('http')
,less = require('less')
,port = 8000
l = console.log;
var parser = new less.Parser();
http.createServer(function (req, res) {
var time = process.hrtime();
l("Start request");
readEntireBody(req)
.then(parseLess)
.then(ou... | JavaScript | 0 | @@ -1263,24 +1263,48 @@
res.
-statusCode = 200
+writeHead(200, %22Content-Type: text/css%22)
;%0A
|
6fa172730aeeaf620006087a5007d07786102992 | update parks data source | gmaps/app.js | gmaps/app.js | function initMap() {
// STARTER VARIABLES
// Raleigh parks data
var raleighParks = 'http://data-ral.opendata.arcgis.com/datasets/5a211ae2f9974f3b814438d5f3a5d783_12.geojson';
// Map style
var darkBaseStyle = new google.maps.StyledMapType(darkMatter, {name: 'Dark Base'});
// Map bounds (Empty)
var bounds =... | JavaScript | 0 | @@ -165,10 +165,9 @@
783_
-12
+4
.geo
|
092bec3b97eca8c2fe5a0786a4cb1b20130d2251 | accept 'magic 8 ball' as input | server.js | server.js | var bodyParser = require('body-parser');
var answers = require('./answers.js');
var express = require('express');
var request = require('request');
var app = express();
var port = process.env.PORT || 3000;
var postOptions = {
url: 'https://api.groupme.com/v3/bots/post',
method: 'POST'
};
app.use(bodyParser.json(... | JavaScript | 0.999999 | @@ -608,16 +608,185 @@
4000);%0A
+ %7Delse if(req.body.name.toLowerCase().indexOf('magic 8 ball') %3C 0 && req.body.text.toLowerCase().indexOf('magic 8 ball') %3E -1) %7B%0A setTimeout(sayBot(res), 4000);%0A
%7Dels
|
fd82f6ae159006833191b79e82502665ee0e74ba | Revert "make skip onboarding button appears on slide 2" | assets/js/states/onboarding.js | assets/js/states/onboarding.js | (function (window, Cryptoloji, undefined) {
'use strict'
Cryptoloji.states.onboarding = {}
Cryptoloji.states.onboarding.root = {
enter: function () {
$('.next_button_onboarding').css('display', 'none')
$('#main_section_onboarding_wrapper').addClass('section-show')
// go to step1 if we ar... | JavaScript | 0.000001 | @@ -1862,24 +1862,45 @@
gic(n)%0A %7D%0A%0A
+ var timer = null;%0A%0A
Cryptoloji
@@ -2050,34 +2050,180 @@
-%7D,%0A leave: function() %7B
+ timer = setTimeout(function()%7B%0A TweenLite.to($('.onboarding_skip_button'), 1, %7Bopacity:.5%7D)%0A %7D, 3000)%0A %7D,%0A leave: function() %7B%... |
51efb214b79d94808a37618e25abd464d81c85f2 | Check two-char ops first | server.js | server.js | const restify = require('restify');
const sessions = require('client-sessions');
const passport = require('passport-restify');
const GoogleStrategy = require('passport-google-oauth20');
const logger = require('./logger');
const User = require('./user');
const {NoteSet, Note} = require('./note');
const {db, Predicate} =... | JavaScript | 0 | @@ -2492,199 +2492,8 @@
if
-(singleCharOps.some((op) =%3E req.query%5Bparam%5D.startsWith(op))) %7B%0A operator = req.query%5Bparam%5D.substring(0, 1);%0A req.query%5Bparam%5D = req.query%5Bparam%5D.substring(1);%0A %7D else if
(two
@@ -2726,24 +2726,215 @@
bstring(2);%0A
+ %7D else if (si... |
e66ebd9fd829a454a77f65c29fb9728c352afee3 | update main file | server.js | server.js | 'use strict';
var express = require('express'),
app = express(),
RouterRoot,
config = require('./config'),
routes = require('./routes'),
bodyParser = require('body-parser'),
session = require('express-session'),
mongoose = require('mongoose');
mongoose.connect(config.mongo_url, function(e... | JavaScript | 0 | @@ -1186,31 +1186,105 @@
gout);%0A%0A
-%0ARouterRoot.pos
+// RouterRoot.get('/admin', )%0ARouterRoot.post('/cates', routes.cates.add);%0A%0ARouterRoot.ge
t('/post
@@ -1300,22 +1300,20 @@
s.posts.
-c
rea
-te
+d
);%0ARoute
@@ -1310,34 +1310,35 @@
ad);%0ARouterRoot.
-ge
+pos
t('/posts', rout
@@ -1338,36 +1338,38 @@... |
0358d01f230707e64f9c7298d8a8d34593fb8943 | Connect to mongo here so we only do it once | server.js | server.js | var express = require('express'),
pages = require('./routes/pages.js'),
signup = require('./routes/signup.js'),
flash = require('connect-flash'),
auth = require('./modules/auth.js');
var app = express();
// Configuration
var secret = process.env.COOKIE_SECRET || 'secret';
app.set('views', __dirname + '/views... | JavaScript | 0 | @@ -1,12 +1,27 @@
+%22use strict%22;%0A%0A
var express
@@ -197,16 +197,241 @@
uth.js')
+,%0A api = require('./modules/api.js'),%0A mongoose = require('mongoose');%0A%0Amongoose.connect(process.env.MONGODB_CONNECTION_STRING);%0Avar db = mongoose.connection;%0Adb.on('error', console.error.bind(console, 'connection e... |
02a2bef8ac023108a422d5bf7dd01ded0957fc11 | Remove unused require | server.js | server.js | // TODO Remove?
require('./lib/utils/functional');
// Server
var http = require('http');
var app = require('express')();
var config = require('./src/config');
// DB
var mongoose = require('mongoose');
// Sub-apps
var api = require('./src/server/api');
var pages = require('./src/server/pages');
// Game-logic
// TODO Mo... | JavaScript | 0.000001 | @@ -1,56 +1,4 @@
-// TODO Remove?%0Arequire('./lib/utils/functional');%0A%0A
// S
|
3383f3e6ac2fb8c17409278be903176ef0c3498e | Fix the issue with synchronizing pull requests. | server.js | server.js | "use strict"
var format = require('python-format')
var request = require('request')
var port = +process.env.npm_package_config_webhookport
if (!port) {
console.error("Start the bot using 'npm start'.")
return
}
var secret = process.env.npm_package_config_secret
if (!secret) {
console.error("Secret not de... | JavaScript | 0 | @@ -2687,24 +2687,124 @@
st.html_url%0A
+ var action = result.action%0A if (action === 'synchronize') %7B%0A action = 'updated'%0A %7D%0A
shorten(
@@ -3100,23 +3100,16 @@
escape(
-result.
action),
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.