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
8b4ad0a07433563f1ace4560f7144dbf18a05f50
Update prefix.js
symbol/prefix.js
symbol/prefix.js
var version = require("../package.json").version var MAJOR = version.split(".")[0] var PREFIX = "_dom-delegator-events-v" + MAJOR + ".0.0-" module.exports = PREFIX
JavaScript
0.000002
@@ -11,42 +11,15 @@ n = -require(%22../package.json%22).version +%224.0.0%22 %0Avar
38ac8f67ee5c8c76d60ef038b331be1dc2f6aae1
Remove broken attempt to set clear filter shortcut
source/views/menu/MenuFilterView.js
source/views/menu/MenuFilterView.js
import { Class } from '../../core/Core'; import Obj from '../../foundation/Object'; import '../../foundation/EventTarget'; // For Function#on import { bind, bindTwoWay } from '../../foundation/Binding'; import { lookupKey } from '../../dom/DOMEvent'; import View from '../View'; import ViewEventsController from '../Vie...
JavaScript
0.000001
@@ -1039,203 +1039,8 @@ );%0A%0A - // Remove Ctrl-/ shortcut from search clear button.%0A searchTextView%0A .render()%0A .get( 'childViews' )%0A .last()%0A .set( 'shortcut', '' );%0A%0A
1fd6680ae51ec21db66827150c83d96b2693da86
make jshint happy
app/scripts/controllers/login-controller.js
app/scripts/controllers/login-controller.js
(function(){ 'use strict'; angular .module('porttare.controllers') .controller('LoginController', LoginController); function LoginController( $rootScope, $state, $ionicLoading, $ionicPopup, $a...
JavaScript
0.000002
@@ -1144,16 +1144,17 @@ .index') +; %0A %7D
92117581b3294ad941c37f4c4065f4dc136134dc
Upgrade version of vusion-cli
vusion.config.js
vusion.config.js
module.exports = { version: '>=0.5.0', type: 'library', lint: true, webpack: { output: { publicPath: '/proto-ui/', }, }, webpackDevServer: { historyApiFallback: { index: '/proto-ui/', }, }, docs: { mode: 'history', b...
JavaScript
0
@@ -34,11 +34,11 @@ %3E=0. -5.0 +7.7 ',%0A @@ -275,24 +275,55 @@ docs: %7B%0A + title: 'Proto UI %E7%BB%84%E4%BB%B6%E5%BA%93',%0A mode
225265e9a2f3355c075959cc79668cf6b367db96
Add comments to new config parameters.
config.example.js
config.example.js
var port = process.env.PORT || 3000; module.exports = { port: port, github: { clientId: "your github application client id", secret: 'your github appliction secret', callbackURL: 'http://localhost:' + port + '/auth/github/callback', token: "oauth api token for server-side...
JavaScript
0
@@ -1332,43 +1332,185 @@ %0A -unauthenticated_timeout: 10 * 1000, +// The time in ms before an unauthenticated websocket connection times out.%0A unauthenticated_timeout: 10 * 1000,%0A // The time in ms before an authentication token times out. %0A
275f8ce0c77ca79c32359d8780849684ed44bedb
Use people API instead of plus API
samples/people/me.js
samples/people/me.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.000127
@@ -692,19 +692,21 @@ %0Aconst p -lus +eople = googl @@ -708,19 +708,21 @@ google.p -lus +eople (%7B%0A ver @@ -802,16 +802,123 @@ ple() %7B%0A + // See documentation of personFields at%0A // https://developers.google.com/people/api/rest/v1/people/get%0A const @@ -930,19 +930,21 @@ await p -lus +eople ....
36d86c63c32cd214416cb5d704a3bddcb4a15321
fix filename path
config/winston.js
config/winston.js
var winston = require('winston'); require('winston-daily-rotate-file'); module.exports = function () { return new winston.Logger({ transports: [ new winston.transports.Console({ level: 'info', json: false, timestamp: function () { ...
JavaScript
0.001082
@@ -888,17 +888,14 @@ logs -%5C%5C +/ ' + ' -%5C%5C .log @@ -2132,8 +2132,9 @@ ormat;%0A%7D +%0A
649f051fdc473b264991aebdfe51057a438d9ddd
use Array.isArray if available for mixed-context array's, fallback to instanceof
jsontoxml.js
jsontoxml.js
//copyright Ryan Day 2010 <http://ryanday.org>, Joscha Feth 2013 <http://www.feth.com> [MIT Licensed] var process_to_xml = function(node_data,options){ var makeNode = function(name, content, attributes, level, hasSubNodes) { var indent_value = options.indent !== undefined ? options.indent : "\t"; var ind...
JavaScript
0.000005
@@ -808,24 +808,69 @@ ata;%0A if( +(Array.isArray) ? Array.isArray(node_data) : node_data in
0c26ba9f6342f6946741e1b504db495239c75d74
Update harassment_model.js
assets/js/harassment_model.js
assets/js/harassment_model.js
// JavaScript const maxlen = 400; const alphabet = "abcdefghijklmnopqrstuvwxyz@.!? "; const num_chars = alphabet.length+1; var model; async function init(){ model = await tf.loadModel('http://www.solaire.ie/assets/model/model.json'); console.log("Done") } char_dict = {}; for (var i = 0; i < alphabet.length; i++) ...
JavaScript
0.000001
@@ -151,16 +151,48 @@ init()%7B%0A + console.log(%22Loading Model%22);%0A model @@ -217,16 +217,17 @@ el('http +s ://www.s @@ -284,16 +284,17 @@ (%22Done%22) +; %0A%7D%0A%0Achar
6b81b1fd9d982d852adccf546da096ba298bb725
use props shot form
packages/entity-list/src/components/ListView/ListView.js
packages/entity-list/src/components/ListView/ListView.js
import PropTypes from 'prop-types' import React from 'react' import {intlShape} from 'react-intl' import {actions, form} from 'tocco-app-extensions' import {LoadMask, theme, scale} from 'tocco-ui' import styled from 'styled-components' import SelectionControllerContainer from '../../containers/SelectionControllerConta...
JavaScript
0.000002
@@ -1240,29 +1240,24 @@ %7B%0A -this. props.formDe @@ -1268,21 +1268,16 @@ tion && -this. props.fo @@ -1436,21 +1436,16 @@ sition=%7B -this. props.se @@ -1739,37 +1739,32 @@ ... -this. props.showSelect @@ -1882,21 +1882,16 @@ ... -this. props.sh @@ -2110,21 +2110,16 @@ sabled=%7B...
4483ba053e11c258483cd50216574d41746991f5
Add missing await
packages/lesswrong/lib/collections/users/serverSchema.js
packages/lesswrong/lib/collections/users/serverSchema.js
import { markdownToHtml } from '../../../server/editor/make_editable_callbacks.js'; import Users from 'meteor/vulcan:users'; import { addFieldsDict, denormalizedField } from '../../modules/utils/schemaUtils' addFieldsDict(Users, { htmlBio: { ...denormalizedField({ needsUpdate: (data) => ('bio' in data), ...
JavaScript
0.002139
@@ -394,16 +394,22 @@ return +await markdown
bfe15f9d6ad40124b0dfa0a60d807699bcda7d30
update var names
app/system/modules/widget/app/views/edit.js
app/system/modules/widget/app/views/edit.js
module.exports = { data: window.$data, ready: function () { UIkit.tab(this.$$.tab, {connect: this.$$.content}); // this.$set('widget.settings', _.defaults({}, this.widget.settings, this.type.defaults)); }, computed: { sections: function () { var sections = []; ...
JavaScript
0.000001
@@ -809,12 +809,13 @@ ion. -name +label ), v @@ -829,18 +829,20 @@ osition. -id +name %7D;%0A
0f9c3b9e0e59ec3ab9a95c5844799da2511d8e4a
remove custom text input handling story (#5431)
packages/react/src/components/ComboBox/ComboBox-story.js
packages/react/src/components/ComboBox/ComboBox-story.js
/** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { useState } from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; imp...
JavaScript
0
@@ -456,55 +456,8 @@ on'; -%0Aimport WithState from '../../tools/withState'; %0A%0Aco @@ -3290,718 +3290,8 @@ dd(%0A - 'custom text input handling',%0A () =%3E (%0A %3CWithState initialState=%7B%7B inputText: '' %7D%7D%3E%0A %7B(%7B state, setState %7D) =%3E (%0A %3Cdiv style=%7B%7B width:...
71c809c285fa028a6dec22ebadb5ddb63a318cff
Update socialshareBundle.js
scripts/eventBundle/socialshareBundle.js
scripts/eventBundle/socialshareBundle.js
/** * socialshare Bundle * * @author Phuc Le <info@phuc.at> */ trackingJS.prototype.eventBundles.socialshare = function() { this.bundleName = 'socialshare'; /** * @mehtod init * * @param tracking */ this.init = function init(tracking) { this.tracking = tracking; bind...
JavaScript
0.000001
@@ -833,28 +833,24 @@ );%0A%0A - this.trackin @@ -858,20 +858,16 @@ .event(%0A - @@ -890,36 +890,32 @@ a',%0A - 'Social Media - @@ -943,36 +943,32 @@ e',%0A - - 'Social Media: ' @@ -1002,23 +1002,10 @@ - );%0A +); %0A
9577003e7de0693a180ed962c034995dbd129144
CHANGE the bootstrap script so it also installs optional dependencies on CI
scripts/bootstrap.js
scripts/bootstrap.js
#!/usr/bin/env node /* eslint-disable global-require */ const { lstatSync, readdirSync } = require('fs'); const { join } = require('path'); const { checkDependenciesAndRun, spawn } = require('./cli-utils'); function run() { const inquirer = require('inquirer'); const program = require('commander'); const chalk ...
JavaScript
0
@@ -2118,30 +2118,118 @@ %3E %7B%0A -spawn( +const command = process.env.CI%0A ? 'yarn install --network-concurrency 8'%0A : 'yarn instal @@ -2272,16 +2272,39 @@ rency 8' +;%0A spawn(command );%0A
365a1255a1ffa4a3a2d09fe9faf66c07dbbd3e9d
change user_id to username
server/api/screenshot/screenshotModel.js
server/api/screenshot/screenshotModel.js
var mongoose = require('mongoose'); var db = require('../../db/index.js'); var screenshotsSchema = mongoose.Schema({ url: { type: String, required: true }, originalImage: { type: String, required: true }, annotatedImage: { type: String, required: true }, //--> annotation functionality to be implemented on the fr...
JavaScript
0.998661
@@ -382,11 +382,12 @@ user -_id +name : %7B
5ab6553097445098602673ebfef636e082d92d5f
Use correct identd handler
server/backends/irc/connectionManager.js
server/backends/irc/connectionManager.js
#!/usr/bin/env node // // Copyright 2014 Ilkka Oksanen <iao@iki.fi> // // 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 // // Un...
JavaScript
0
@@ -1069,16 +1069,24 @@ tHandler +Selector ).listen @@ -1284,24 +1284,89 @@ andler);%0A%7D%0A%0A +function identHandlerSelector(conn) %7B%0A identHandler(conn);%0A%7D%0A%0A function set
da42e26d6fdbeadf312aaf7a00cc798a42fcd607
Fix createVersion
server/controllers/versionsController.js
server/controllers/versionsController.js
let helpers = require(`${__dirname}/../helpers.js`); let db = require(`${__dirname}/../schemas.js`); let UserRecipe = db.UserRecipe; let Recipe = db.Recipe; let _ = require('underscore'); module.exports = { // description: Makes a new version from an existing version // body: { // previous: { previous version ...
JavaScript
0.000003
@@ -388,19 +388,19 @@ %3E %7B%0A -let +var newVers @@ -533,24 +533,35 @@ on = version +.toObject() ;%0A retu @@ -570,32 +570,35 @@ UserRecipe.find +One (%7B%0A usern @@ -629,17 +629,16 @@ %7D);%0A -%0A %7D).t @@ -685,68 +685,103 @@ tion - = _.findIndex(userRecipe.recipes, %0A r...
0271704ab4fe69897e47e1fb5282cc2dcf524f49
implement lady
server/game/cards/attachments/02/lady.js
server/game/cards/attachments/02/lady.js
const DrawCard = require('../../../drawcard.js'); class Lady extends DrawCard { canAttach(player, card) { if(card.getFaction() !== this.getFaction()) { return false; } return super.canAttach(player, card); } } Lady.code = '02004'; module.exports = Lady;
JavaScript
0.000001
@@ -82,169 +82,960 @@ -canAttach(player, card) %7B%0A if(card.getFaction() !== this.getFaction()) %7B%0A return false;%0A %7D%0A%0A return super.canAttach(player, card) +setupCardAbilities() %7B%0A this.action(%7B%0A title: 'Pay 1 gold to attach Lady to another ch...
cb9c1abffc998cd2572f3da9fbae8a842716686c
Set the resolution of an ability to be cancelled when /cancel-prompt is used, so that the prompt does not continue or try to invoke a handler with no targets selected (#1367)
server/game/gamesteps/abilityresolver.js
server/game/gamesteps/abilityresolver.js
const _ = require('underscore'); const BaseStep = require('./basestep.js'); const GamePipeline = require('../gamepipeline.js'); const SimpleStep = require('./simplestep.js'); const ChooseOpponentPrompt = require('./chooseopponentprompt.js'); class AbilityResolver extends BaseStep { constructor(game, ability, cont...
JavaScript
0
@@ -1810,24 +1810,55 @@ celStep() %7B%0A + this.cancelled = true;%0A this
c27feb635b328e67c76821780af87197e77b540b
fix fcking reorder endpoint
frontend/items_module/items.service.js
frontend/items_module/items.service.js
class ItemsService { constructor($http) { this.http = $http; } getChecklist(user, checklistName) { let {name} = user; return this.http.get(`./api/${name}/checklists/${checklistName}`); } addItem(user, checklistName, newItem) { let {name} = user; return this.http.post(`./api/${name}/checklists/${checkli...
JavaScript
0.000001
@@ -670,16 +670,24 @@ e%7D/items +/reorder %60, items
c463af1842189f184da73127884160ae6048cf1c
send sessionId in the browser-end event
runner/browserrunner.js
runner/browserrunner.js
/** * @license * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt * The complete set of contributors may be f...
JavaScript
0
@@ -4869,32 +4869,48 @@ rror, this.stats +, this.sessionId );%0A%0A // Nothing
ec29a103083e76ed60f30199a1432034bec17d21
add missing translation string for greek
imports/i18n/en-US/publishers.js
imports/i18n/en-US/publishers.js
const publisher = { entity: { username: 'Username', profile: { firstname: 'First name', lastname: 'Last name', email: 'E-mail', telefon: 'Phone', gender: 'Gender', genderValues: { m: 'Brother', w: 'Sister' }, congregation: 'Congregation', p...
JavaScript
0.999999
@@ -1119,24 +1119,50 @@ stralian)',%0A + 'el-GR': 'Greek',%0A fi:
f8145c933412af8450ddf5fb11136725ad5cf7e2
Update Bert Alerte to login
imports/modules/app/lib/login.js
imports/modules/app/lib/login.js
/* eslint-disable no-undef */ import { Meteor } from 'meteor/meteor'; import { Bert } from 'meteor/themeteorchef:bert'; import '/imports/lib/validation'; let component; const login = () => { const email = document.querySelector('[name="emailAddress"]').value; const password = document.querySelector('[name="passw...
JavaScript
0
@@ -23,17 +23,16 @@ ndef */%0A -%0A import %7B @@ -423,90 +423,73 @@ ert( -err +'Identification inc or -. re -ason, 'warning');%0A %7D else %7B%0A Bert.alert('Logged in!', 'success');%0A +cte', 'danger', 'fixed-top');%0A %7D else %7B %0A
d1a99b15c019baea114fb193d2de731c65cb7470
update slack callback
scripts/slackMsgs.js
scripts/slackMsgs.js
module.exports = { getChannelName: function(robot, res){ return (robot.adapter.client.rtm.dataStore.getChannelGroupOrDMById(res.message.room)).name; }, getUserName: function(res){ return res.message.user.name; }, getChannelId: function(res){ return res.message.room; }...
JavaScript
0
@@ -1917,32 +1917,74 @@ %22text%22: %22%22,%0A + %22replace_original%22: true,%0A
17743fb143930517564d7278c3dd5bbca09d8420
Add CAROUSEL_ITEM to constants
utilities/constants.js
utilities/constants.js
// ## Components export const ACCORDION = 'SLDSAccordion'; export const ACCORDION_PANEL = 'SLDSAccordionPanel'; export const ALERT = 'SLDSAlert'; export const ALERT_CONTAINER = 'SLDSAlertContainer'; export const APP_LAUNCHER = 'SLDSAppLauncher'; export const APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection'; export const...
JavaScript
0.999641
@@ -1202,32 +1202,81 @@ selIndicators';%0A +export const CAROUSEL_ITEM = 'SLDSCarouselItem';%0A export const CAR
f1cf3df870df632f91a0d6aac4f2987407b8e005
Update app.js
client/app.js
client/app.js
angular.module('Instagram', ['ngRoute', 'ngMessages']) .config(function($routeProvider) { $routeProvider .when('/', { templateUrl: 'views/home.html', controller: 'HomeCtrl' }) .when('/login', { templateUrl: 'views/login.html', controller: 'LoginCtrl' }) .when('/signup', { templateUrl: 'vi...
JavaScript
0.000002
@@ -84,16 +84,18 @@ ider) %7B%0A +%09%09 $routePr @@ -101,16 +101,18 @@ rovider%0A +%09%09 .when( @@ -114,24 +114,26 @@ when('/', %7B%0A +%09%09 template @@ -148,32 +148,34 @@ ews/home.html',%0A +%09%09 controller: @@ -181,29 +181,33 @@ 'HomeCtrl'%0A +%09%09 %7D)%0A +%09%09 .when('/lo @@ -210...
cd951bd603d9f9eb79e2432a94d572ddac9089b7
remove ripple after animation
cmp-ripple.js
cmp-ripple.js
cmpRipple = function(elements, options) { //TODO: add version/copyright notice + version tag //TODO: build encapsulated JS file //TODO: active state should listen on mousedown + stay triggered on click //TODO: destroy() function removing click event handlers //TODO: build animationEvent/rippleElement only onc...
JavaScript
0.000001
@@ -2413,18 +2413,16 @@ -// rippleEl @@ -2431,102 +2431,204 @@ ent. -parentNode.removeChild(rippleElement);%0A rippleElement.className += ' cmp-ripple-remove' +className += ' cmp-ripple-remove';%0A%0A rippleElement.addEventListener(stylePrefix('transitionend'), function(event) %7B%0A ...
fc2ac6867bdd3c518d2c85246f15563a0359b2b2
fix email validation in js
Kwf_js/Form/BasicForm.js
Kwf_js/Form/BasicForm.js
Ext.form.BasicForm.override({ resetDirty: function() { this.items.each(function(field) { field.resetDirty(); }); }, setDefaultValues: function() { this.items.each(function(field) { field.setDefaultValue(); }, this); }, clearValues: function() {...
JavaScript
0.000566
@@ -1013,16 +1013,17 @@ A-Z0-9_. ++ -%5D)+@((%5B
fbc94924106a92e39160ae0b375468d5e6e83c16
Set global Timeout function if 'window.' versions are not available
Objective-J/Constants.js
Objective-J/Constants.js
/* * Constants.js * Objective-J * * Created by Francisco Tolmasky. * Copyright 2008-2010, 280 North, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 ...
JavaScript
0.000067
@@ -946,24 +946,38 @@ w.setTimeout + %7C%7C setTimeout ;%0A window @@ -1013,24 +1013,40 @@ clearTimeout + %7C%7C clearTimeout ;%0A window @@ -1084,16 +1084,31 @@ Interval + %7C%7C setInterval ;%0A wi @@ -1154,16 +1154,33 @@ Interval + %7C%7C clearInterval ;%0A%7D%0A%0A//
d735885863fe2c0bdc8e74f28a204f54e6498bca
Support TouchableNativeFeedback for Android (#86)
Button.js
Button.js
import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { StyleSheet, Text, TouchableOpacity, View, ViewPropTypes, } from 'react-native'; import coalesceNonElementChildren from './coalesceNonElementChildren'; const systemButtonOpacity = 0.2; export default class Button extends ...
JavaScript
0
@@ -80,16 +80,28 @@ mport %7B%0A + Platform,%0A StyleS @@ -134,16 +134,43 @@ pacity,%0A + TouchableNativeFeedback,%0A View,%0A @@ -184,17 +184,16 @@ ropTypes -, %0A%7D from @@ -754,16 +754,57 @@ .style,%0A + androidBackground: PropTypes.object,%0A %7D;%0A%0A @@ -1486,16 +1486,51 @@ %0A %7D%0A%...
ff9b7caa38166f36941d48817e59587fec545a61
delete usertimeline
Resources/lib/vineAPI.js
Resources/lib/vineAPI.js
exports.vineLogin = function(username,passwd){ var xhr = Ti.Network.createHTTPClient(); //login xhr.open('POST','https://api.vineapp.com/users/authenticate'); xhr.send({ username: username, password: passwd }); xhr.onload = function(){ var json = JSON.parse(this.responseText); if(json.er...
JavaScript
0.000004
@@ -343,32 +343,60 @@ r');%0A%09 else%7B%0A +%09 %09// console.log(json);%0A %09 %09Ti.App.key @@ -453,16 +453,60 @@ userId;%0A +%09 %09Ti.App.username = json.data.username;%0A %09 %7D%0A%09 @@ -545,24 +545,25 @@ ete');%0A%09%7D;%0A%7D +; %0A%0Aexports.vi @@ -1071,16 +1071,17 @@ %7D%0A%09%7D;%0A%...
e313e474aba08e4de453c3042419a2fe50c7e296
fix copy paste in comment
app/scripts/components/color-picker/color-picker-module-inc.js
app/scripts/components/color-picker/color-picker-module-inc.js
/** * bootstraps the 'highlightText' module. */ define([ 'components/color-picker/color-picker-module-def', 'components/color-picker/color-picker-directive' ], function (colorPickerModule) { 'use strict'; return colorPickerModule; });
JavaScript
0
@@ -20,21 +20,19 @@ he ' -highlightText +colorPicker ' mo
8eef609c053717f39faa79206dec13fead85a703
correct send message for user DELETE
admin/server/controllers/user-controller.js
admin/server/controllers/user-controller.js
const User = require('../models/user'); const cookieController = require('./cookie-controller'); const bcrypt = require('bcrypt'); const serverConfig = require('../.server-config'); let userController = {}; // create the user on mongoDB userController.createUser = (req, res) => { let bodyObj = req.body; let new...
JavaScript
0.000051
@@ -2172,12 +2172,12 @@ nd(' -post +user del
cc51c66c7601a0e2c6e4b03271c1dce878ff8033
Active again the trigger for the toggle/update event
app/assets/javascripts/lib/mixins/flyout.js
app/assets/javascripts/lib/mixins/flyout.js
define([ "jquery" ], function($) { "use strict"; var asFlyout = function(args) { var _this = this; args || (args = {}); this.$facetCount = $(args.facet); this.$listener = $(args.$listener || "#js-row--content"); this.close = this.$listener.on(":toggleActive/click", function(event, data) { ...
JavaScript
0
@@ -1085,16 +1085,22 @@ unction( +target ) %7B%0A @@ -1140,16 +1140,56 @@ /close%22) +.trigger(%22:toggleActive/update%22, target) ;%0A
d06ef4aa5b32ee971a2a7cc6bd73e42cf757ae25
Make the ball bounce off paddles.
pong.js
pong.js
'use strict'; var canvas = document.querySelector('canvas'); var context = canvas.getContext('2d'); // Space between the side edge of the canvas and the paddle. var EDGE_TO_PADDLE = 5; /** The paddle at either side of the canvas. @constructor @param {boolean} isLeft - If true, construct the left paddle, oth...
JavaScript
0.000016
@@ -1557,17 +1557,17 @@ PEED: 0. -5 +2 ,%0A%0A ren @@ -1992,16 +1992,375 @@ edY;%0A %7D +,%0A%0A /**%0A @param rectangle %7BObject%7D%0A @return True iff the Ball collides with the rectangle.%0A */%0A collides: function(rectangle) %7B%0A return this.x - this.RADIUS %3C rectangle.x + rectangle.WIDTH%0...
b58252a036852b3bba279917b501f5529715cd42
Allow negative starting velocities
pong.js
pong.js
'use strict'; const framesPerSecond = 30; const defaultWidth = 800; const defaultHeight = 600; const defaultBallRadius = 10; let playGround = null; let context = null; const keydown = () => {}; const pointFactory = () => Object.assign({}, { x: 0, y: 0 }); const ball = { pos: pointFactory(), vel: pointFactory()...
JavaScript
0.000195
@@ -686,24 +686,77 @@ //////////%0A%0A +const randSign = () =%3E Math.random() %3E .5 ? 1 : -1;%0A%0A const middle @@ -1830,24 +1830,38 @@ all.vel.x = +randSign() * ( Math.floor(M @@ -1874,32 +1874,33 @@ ndom() * 10) + 3 +) ;%0A ball.vel.y = @@ -1896,24 +1896,38 @@ all.vel.y = +randSign() * ( Math.floor(M @@...
35c34f3d8a3b6d8c9d3ebb395e7a3a33f6ba3f86
Make sendAllBut take peer object instead of id
room.js
room.js
var util = require("util"); var EventEmitter = require("events").EventEmitter; var MAX_DJS = 5; function Room(buoy, name) { this.buoy = buoy; this.name = name; this.peers = []; this.djs = []; this.activeDJ = -1; // Val is an index in this.djs this.activeTrack = null; console.log("[debug] ...
JavaScript
0
@@ -717,27 +717,24 @@ dAllBut(peer -.id , %22peerJoine @@ -1441,19 +1441,16 @@ But(peer -.id , %22peerL @@ -1604,19 +1604,16 @@ But(from -.id , %22chat%22 @@ -2043,19 +2043,16 @@ peers%5Bi%5D -.id == but)
7878a3b99a5b704824d24e801386fd06f7bc27dd
Create pxy.pac
pxy.pac
pxy.pac
function FindProxyForURL(url, host) { if (url.indexOf(".mp3")>1 || url.indexOf(".mp4")>1 || url.indexOf(".flv")>1) return "DIRECT"; if (host == "music.163.com" || url.indexOf('music.126.net')>-1 || url.match(/.*comment.*\.163\.com.*/i)) return ( "PROXY 120.52.72.58:80;"+ "PROXY 220.248.229.45:3128;"+ "PROXY 120...
JavaScript
0.000001
@@ -277,476 +277,8 @@ ;%22+%0A -%22PROXY 220.248.229.45:3128;%22+%0A%22PROXY 120.52.21.132:8082;%22+%0A%22PROXY 120.52.72.56:80;%22+%0A%22PROXY 120.52.72.53:80;%22+%0A%22PROXY 120.52.72.54:80;%22+%0A%22PROXY 120.52.72.59:80;%22+%0A%22PROXY 120.52.72.52:80;%22+%0A%22PROXY 113.108.192.74:80;%22+%0A%22PROXY 218.205.80.12...
e1f005b2c31f8e61802bc36c5574cf20c19a8b4e
Fix sigint listener assertion error.
read.js
read.js
var readline = require('readline') var Mute = require('mute-stream') , rl , rlopts , history; var errors = { cancel: new Error('cancelled'), timeout: new Error('timed out') } errors.cancel.cancel = true; errors.timeout.timeout = true; function open(opts) { //console.log('opening rl interface'); close()...
JavaScript
0.000001
@@ -2180,18 +2180,16 @@ ocess.on -ce ('SIGINT @@ -2413,24 +2413,25 @@ , onError);%0A +%0A process.
8d3686893bbb59c70dec9684d5cb30d975869743
test for valid output
test.js
test.js
'use strict'; const npmDownloads = require('./'); const test = require('tape'); test('test shall fail', t => { npmDownloads(); t.fail(); });
JavaScript
0.003297
@@ -1,144 +1,399 @@ -'use strict';%0A%0Aconst npmDownloads = require('./' +import test from 'ava';%0Aimport npmDownloads from './src';%0A%0Atest(async t =%3E %7B%0A const downloads = await npmDownloads(%7Bmodule: 'ava'%7D );%0A + const -test = require('tape');%0A%0Atest('test shall fail', t =%3E %7B%0A npmDownlo...
b9e4d24ffa9bdd7bc94301f4c11fe7f517b5fa28
improve tests
test.js
test.js
'use strict'; var test = require('ava'); var isRootPath = require('./'); test(function (t) { t.assert(isRootPath('/')); t.assert(!isRootPath('/Users/')); t.assert(!isRootPath('')); t.assert(!isRootPath('.')); t.assert(!isRootPath(' ')); var _ = process.platform; process.platform === 'win32'; Object.defineProp...
JavaScript
0.000016
@@ -87,16 +87,128 @@ n (t) %7B%0A +%09var _ = process.platform;%0A%0A%09Object.defineProperty(process, 'darwin', %7B%0A%09%09value: 'win32',%0A%09%09writable: true%0A%09%7D);%0A %09t.asser @@ -219,32 +219,32 @@ RootPath('/'));%0A - %09t.assert(!isRoo @@ -353,66 +353,8 @@ );%0A%0A -%09var _ = process.platform;%0A%0...
d2c6d3468e3e9fa9ad587f4d1492539c871309b0
fix for test
test.js
test.js
const fs = require("nodejs-fs-utils"); const os = require('os') const test = require("tape") const ms = require('ms') try { fs.rmdirsSync(".test") } catch (err) { } const cluster = require('cluster'); let start = 8 let count = start if (cluster.isMaster) { process.on("SIGINT", () => { }) process.on("SIGHUP"...
JavaScript
0.000001
@@ -115,60 +115,8 @@ s')%0A -%0Atry %7B%0A fs.rmdirsSync(%22.test%22)%0A%0A%7D%0Acatch (err) %7B %7D%0A%0A cons @@ -204,16 +204,79 @@ aster) %7B +%0A %0A try %7B%0A fs.rmdirsSync(%22.test%22)%0A %0A %7D%0A catch (err) %7B %7D %0A%0A proc
733f5077e8ba7187f5c61a1a424a690bcbdf07e5
Make sure tests pass in node 0.12
test.js
test.js
'use strict'; var test = require('tape'); var findValue = require('./'); var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; test('requires something coercible to an object', function (t) { t['throws'](function () { findValue(null); }, TypeError, 'null throws'); t['throws'](function () { ...
JavaScript
0.000001
@@ -1566,34 +1566,34 @@ ;%0A%0A%09 -t.deepEqual(findValue(%5B%5D, +var expectedTuples = %5B%0A%09%09%5B Arra @@ -1603,17 +1603,18 @@ rototype -%5B +, Symbol.i @@ -1625,52 +1625,183 @@ tor%5D -), %5B%0A%09%09%5BArray.prototype, Symbol.iterator%5D%0A%09%5D +%0A%09%5D;%0A%09if ('values' in Array.prototype) %7B%0A%0...
35f3688281ef92298e59de082b31e7a60c5992a0
fix tests
test.js
test.js
'use strict'; var assert = require('assert'); var nock = require('nock'); var avail = require('./'); var fixtures = { results: [ { domain: 'avail.io', path: '', availability: 'available' }, { domain: 'avail.com', path: '', availability: 'unavailable' }, { ...
JavaScript
0.000001
@@ -8,19 +8,21 @@ rict';%0A%0A -var +const assert @@ -42,19 +42,21 @@ sert');%0A -var +const nock = @@ -72,19 +72,22 @@ nock');%0A -var +%0Aconst avail = @@ -107,46 +107,45 @@ );%0A%0A -var f +const statusF ixture -s = %7B%0A -results: %5B%0A %7B%0A +status: %5B%7B%0A @@ -172,159 +172,237 @@...
3675e105f62e7b3ad32dba3369e95f4ce80460ae
add test for objectMode true/false
test.js
test.js
/*! * value2stream <https://github.com/hybridables/value2stream> * * Copyright (c) 2016 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk) * Released under the MIT license. */ 'use strict' var test = require('mukla') var isBuffer = require('is-buffer') var value2stream = require('./index') var Prom...
JavaScript
0.998447
@@ -2463,16 +2463,547 @@ 'end', done)%0A%7D)%0A +%0Atest('should fire %60error%60 event on %60opts.objectMode: false%60 (default) and object value', function (done) %7B%0A value2stream(%7B a: 'b' %7D).once('error', function (err) %7B%0A test.ifError(!err)%0A test.strictEqual(err instanceof Error, true)%0A do...
ad7dffc87ee29ca4a1c66fd457a41c8db42db6f9
Fix server package path
test.js
test.js
import test from 'ava' import request from 'supertest' import { exec } from 'mz/child_process' import createServer from './dist/server.builded' const serverConfig = { nodeEnv: 'test', port: 6006, timeout: 28000, schemaName: 'public', databaseUrl: '', sentryDns: '', s3BucketName: 'vivo-em-nos-staging', } ...
JavaScript
0.000001
@@ -95,23 +95,22 @@ %0Aimport -createS +* as s erver fr @@ -130,17 +130,16 @@ rver -.builded' +/index'%0A %0A%0Aco @@ -174,145 +174,463 @@ nv: -'test',%0A port: 6006,%0A timeout: 28000,%0A schemaName: 'public',%0A databaseUrl: '',%0A sentryDns: '',%0A s3BucketName: 'vivo-em-nos-staging' +process.env.NODE_E...
04de6d335bdc033872448ece7f1b912dd99b83e4
remove clever computed property in tests
test.js
test.js
/*! * requires-regex <https://github.com/jonschlinkert/requires-regex> * * Copyright (c) 2014-2018 Jon Schlinkert, contributors. * Licensed under the MIT License */ 'use strict'; require('mocha'); var assert = require('assert'); var re = require('./'); function match(str) { var matches = []; var regex = re(...
JavaScript
0
@@ -401,23 +401,29 @@ -matches.push(%7B +var tok = %7B%7D;%0A tok %5Bm%5B2 @@ -436,16 +436,37 @@ %5B4%5D%5D -: + = m%5B4%5D - %7D +;%0A matches.push(tok );%0A
50ccf8f4877049c0f59b06825f4ccda8dbefc81b
Add a single test for `setHours()`. Still need better test coverage... just being lazy...
test.js
test.js
var assert = require('assert'); var time = require('./'); var d = new time.Date(Date.UTC(2011, 0, 1)); assert.equal(d.getUTCFullYear(), 2011); assert.equal(d.getUTCMonth(), 0); assert.equal(d.getUTCDate(), 1); console.log(d+''); d.setTimezone("UTC"); console.log(d+''); console.log("UTC Hours: " + d.getHours()); as...
JavaScript
0
@@ -1227,28 +1227,76 @@ rt.equal(d.getHours(), 16);%0A +d.setHours(15);%0Aassert.equal(d.getHours(), 15);%0A
f92f771e2dbee2ad74f82b70ea35e6011f8139bd
add test case from #5
test.js
test.js
"use strict"; const m = require("."); const assert = require("assert"); async function main() { assert.deepStrictEqual(await m.merge(["1.0.0.0", "1.0.0.1"]), ["1.0.0.0/31"]); assert.deepStrictEqual(await m.merge(["1.0.0.0/24", "1.0.1.0/24"]), ["1.0.0.0/23"]); assert.deepStrictEqual(await m.merge(["1.0.0.0/24", ...
JavaScript
0
@@ -3478,32 +3478,116 @@ .0.1%22), false);%0A + assert.deepStrictEqual(await m.overlap(%22fe80:1:0:0:0:0:0:0%22, %22fe80::/10%22), true);%0A assert.deepStr
6d626137b9e10360fefd11e9415e1f4b8e64e1f0
fix lint
test.js
test.js
import test from 'ava'; import isIp from 'is-ip'; import m from '.'; test('IPv4 DNS', async t => { t.true(isIp.v4(await m.v4())); }); test('IPv4 HTTPS', async t => { t.true(isIp.v4(await m.v4({https: true}))); }); test('IPv4 DNS timeout', async t => { t.true(isIp.v4(await m.v4({timeout: 2000}))); }); test('IPv4 ...
JavaScript
0.000013
@@ -586,16 +586,22 @@ t =%3E %7B%0A%09 +await t.throws
3515e04c9b3c0a1a3db7c9b779b753a2289d387a
Fix root test script.
test.js
test.js
const fs = require('fs') const child = require('child_process') const path = require('path') fs.readdirSync(__dirname) .filter(file => /^mingle\.[^.]+$/.test(file)) .filter(dir => ~fs.readdirSync(path.join(dir)).indexOf('test')) .forEach(dir => { console.log(dir) const tests = fs.readdirSync(path.j...
JavaScript
0
@@ -375,19 +375,16 @@ =%3E /%5C.t -est %5C.js$/.t
3181b94870002a0ecdf1b6fb9aac7e61e5f6a0f0
update tests, add tests for `.keys`
test.js
test.js
/*! * parse-git-config <https://github.com/jonschlinkert/parse-git-config> * * Copyright (c) 2015 Jon Schlinkert. * Licensed under the MIT license. */ 'use strict'; /* deps:mocha */ require('should'); var git = require('./'); describe('sync:', function() { it('should return an object', function() { git.sy...
JavaScript
0
@@ -169,24 +169,25 @@ ';%0A%0A -/* deps: +require(' mocha - */ +'); %0Areq @@ -206,19 +206,21 @@ ');%0Avar -git +parse = requi @@ -306,27 +306,29 @@ ion() %7B%0A -git +parse .sync().shou @@ -353,35 +353,37 @@ (%5B'core'%5D);%0A -git +parse .sync().should.n @@ -415,19 +415,21 @@ %5D);%0A -git +pa...
d698f6eb4989ab10d7f19cccbd966b11eaa17771
Clean up tests
test.js
test.js
'use strict' var zlib = require('zlib') var http = require('http') var test = require('tape') var nock = require('nock') var Client = require('./') var options = { organizationId: 'some-org-id', appId: 'some-app-id', secretToken: 'secret', userAgent: 'foo' } test('throw if missing required options', function...
JavaScript
0.000001
@@ -326,17 +326,17 @@ %7B%0A -var fn = +t.throws( func @@ -357,17 +357,16 @@ Client(%7B - appId: ' @@ -396,29 +396,14 @@ bar' - %7D)%0A %7D -%0A t.throws(fn )%0A
35167876816e0d68c1c31537bbabe946e15fb241
test tool fix
test.js
test.js
"use strict"; var username = "testo" var password = "testo" var srvurl = "https://moimosk.ru/cgi/secret"; var authsrv = "https://micropeppa.freefeed.net/v1/"; var https = require("https"); var XMLHttpRequest = require("xhr2"); var openpgp = require("openpgp"); var testData = "qwertyuiop[]asdfghjkl;zxcvbnm,./"; var tok...
JavaScript
0.000001
@@ -1526,17 +1526,16 @@ ,msgEnc) -; %0A%09%09%09%09%09.t @@ -3435,29 +3435,8 @@ ()%7B%0A -%09%09console.log(oReq);%0A %09%09if @@ -3452,24 +3452,64 @@ tus %3C 400)%7B%0A +%09%09%09var res = JSON.parse(oReq.response);%0A %09%09%09if(res.po
5276bd1b0278f9686e8ff78709b6e493cfc967a8
add tests
test.js
test.js
var expect = require('chai').expect; var origin = require('./'); describe('git remote origin URL:', function () { it('should return the git remote origin URL.', function () { var actual = origin.url(); console.log('git remote origin url:', actual); var expected = 'https://github.com/jonschlinkert/remote-...
JavaScript
0
@@ -1,118 +1,315 @@ -var expect = require('chai').expect;%0Avar origin = require('./');%0A%0Adescribe('git remote origin URL:', function () %7B +'use strict';%0A%0Arequire('should');%0Avar url = require('./');%0A%0Adescribe('async:', function () %7B%0A it('should trow when not found', function (cb) %7B%0A url('foo'...
6b1f76fbe31cfb8aedaa9572f19c1b99c5f6a9da
initialize with IP and initial sandboxed path
test.js
test.js
var ftpd = require('./ftpd.js'); var server = ftpd.createServer("localhost").listen(7001, "127.0.0.1");
JavaScript
0
@@ -63,17 +63,41 @@ er(%22 -localhost +127.0.0.1%22, %22/home/alan/temporary %22).l @@ -110,20 +110,7 @@ 7001 -, %22127.0.0.1%22 );%0A
17de811b1a18bb8d82f101e30d994b8c2d8c728f
Update test.js, remove unnessecary stuff
test.js
test.js
var opensrt = require("./opensrt.js"); var token = ""; var zlib = require("zlib"); var query = { imdbid: "tt1844624", season: "2", episode: "3", filename: "American.Horror.Story.S02E03.720p.HDTV.X264-DIMENSION" } var OpenSRT = new opensrt('OpenSRTJS'); OpenSRT.searchEpisode(query, function(err, res){ if(err)...
JavaScript
0
@@ -35,52 +35,8 @@ s%22); -%0Avar token = %22%22;%0Avar zlib = require(%22zlib%22); %0A%0Ava @@ -210,16 +210,48 @@ SRTJS'); + // REPLACE WITH YOUR USER AGENT %0A%0AOpenSR
6a5863679af7139b954d0b26e5b8223bf1965575
update for server only
test.js
test.js
var externalip = require('externalip'); var color = require('just.randomcolor'); var server, io; var app = require('commander'); process.env.DEBUG = true; app .version('0.0.1') .option('-s, --server', 'Run as server') .option('-p, --port [port]', 'Which port to use?', process.env.PORT || 3333) .option('-a, --...
JavaScript
0
@@ -524,16 +524,18 @@ ) %7B%0A + ip = ip. @@ -542,16 +542,18 @@ trim();%0A + // s @@ -581,36 +581,171 @@ -console.log(err, ip + myColor = new color().toHex().value;%0A myUsername = app.user;%0A // addMessage('Server listening on ' + ip + ':' + app.port, 'server', serverColor );%0A ...
0829a5fce6ee5b45f22e669cd9f1b123c457bb53
Fix linter errors
test.js
test.js
/* global it: false */ "use strict"; var assert = require("assert"); var cr = require("./"); it("should return correct amount of addresses", function () { assert(cr("1.2.3.4/30").length === 4); assert(cr("1.2.3.4/24").length === 256); assert(cr("1.2.3.4/20").length === 4096); assert(cr("255.255.255.255/32").l...
JavaScript
0.000021
@@ -1,27 +1,4 @@ -/* global it: false */%0A %22use @@ -113,33 +113,32 @@ esses%22, function - () %7B%0A assert(cr @@ -474,17 +474,16 @@ function - () %7B%0A a
4bd41b1aa225ac4d30d68e5e93a82f9062ad0488
Change error message per readme.
test.js
test.js
var Office365ConnectorHook = require("./index.js"), winston = require('winston'), Logger = winston.Logger, Console = winston.transports.Console, hookUrl = process.env.HOOK_URL; if (!hookUrl) { console.warn("No process.env.HOOK_URL set. Please set it to your Connector Webhook URL before running this...
JavaScript
0
@@ -774,37 +774,21 @@ e: ' -You can send card titles too! +My puny title ' %7D) @@ -870,22 +870,16 @@ down in -error messages
30710ee30ef42142f6d69f9c7bfe88aef5fe30f6
update tests
test.js
test.js
import childProcess from 'child_process'; import test from 'ava'; test.cb('default', t => { const cp = childProcess.spawn('./cli.js', {stdio: 'inherit'}); cp.on('error', t.ifError); cp.on('close', code => { t.is(code, 1); t.end(); }); });
JavaScript
0.000001
@@ -239,12 +239,209 @@ );%0A%09%7D);%0A%7D);%0A +%0Atest.cb('user', t =%3E %7B%0A%09const cp = childProcess.spawn('./cli.js', %5B'iama_rishi'%5D, %7Bstdio: 'inherit'%7D);%0A%0A%09cp.on('error', t.ifError);%0A%0A%09cp.on('close', code =%3E %7B%0A%09%09t.is(code, 0);%0A%09%09t.end();%0A%09%7D);%0A%7D);%0A
eb5e80ce3bb3b5cd755830672e71fc71d44707cd
fix polygons in test.js
test.js
test.js
var test = require('tape'); var inside = require('./'); var point = require('turf-point'); var polygon = require('turf-polygon'); var fs = require('fs'); test('featureCollection', function (t) { // test for a simple polygon var poly = polygon([[[0,0], [0,100], [100,100], [100,0]]]); var ptIn = point([50, 50]); ...
JavaScript
0.000011
@@ -269,32 +269,39 @@ 00,100%5D, %5B100,0%5D +, %5B0,0%5D %5D%5D);%0A var ptIn @@ -581,24 +581,31 @@ 00%5D, %5B100,0%5D +, %5B0,0%5D %5D%5D);%0A var p
2afa66445670d17d94d103b3dab9c9708bdd1451
Use different method to detect lastevaluatedkey variable.
read.js
read.js
/*jshint esversion: 6 */ /* globals console, require, exports*/ 'use strict'; // Load required libraries const AWSXRay = require('aws-xray-sdk-core'); const AWS = AWSXRay.captureAWS(require('aws-sdk')); const dynamodb = new AWS.DynamoDB.DocumentClient(); const moment = require('moment-timezone'); exports.handler = (ev...
JavaScript
0
@@ -1510,23 +1510,16 @@ %0A%0A if ( -typeof event.la @@ -1532,31 +1532,27 @@ uatedkey - != 'undefined' +.length %3E 1 ) %7B%0A
1b7347efd40a2e720796e9873e746ef98cd3061c
Add Time.now().
time.js
time.js
import {assert, getLast, makePromise, zip} from './util.js' const unitToFactor = new Map() export class Duration { static sum(durations) { return durations.reduce((a, b) => a.plus(b), Duration.make(0)) } static parse(duration) { const match = duration.match(/^([+-]?)(\d+)(?::(\d\d))?$/) if (!match)...
JavaScript
0.000001
@@ -3821,16 +3821,200 @@ Time %7B%0A + static now() %7B%0A const sinceEpoch = Duration.milliseconds(Date.now())%0A const zone = Duration.minutes(-new Date().getTimezoneOffset())%0A return new Time(sinceEpoch, zone)%0A %7D%0A%0A static
ff45163148a537b64ada323b68290b573f404ab2
remove pbs specifics....
seed.js
seed.js
// Load Environment var dotenv = require('dotenv'); dotenv.load(); process.env.MONGO_DATABASE = 'mongodb://localhost:27017/connect'; process.env.OUTPUT_LOG = './log.txt'; // create a password var crypto = require('crypto'); var app = require('express')(); // stub out the schema require('./app/helpers/database')(app);...
JavaScript
0.000006
@@ -1451,226 +1451,244 @@ .'); - %0A var gameParams = %7B%0A title: 'Empty Game',%0A slug: 'empty-game2',%0A repository: 'https://projects.pbs.org/bitbucket/projects/PKK/repos/empty-game/',%0A location: 'https://springroll-tc.pbskids.org/empty-game' +%0A //set your values as desired%0A var gameTitle = '...
516880e218000e28406c242ce546396f04ea62f1
remove debug output
sets.js
sets.js
var encode = require('level-encode') , AsyncCache = require('async-cache') , Sets = function (db, cache, child) { if (!(this instanceof Sets)) return new Sets(db, cache, child) var self = this this._children = {} if (child) { this.db = db this.cache = cache ...
JavaScript
0.000101
@@ -2033,43 +2033,8 @@ ) %7B%0A - console.log(this.db%5Bkey%5D, key)%0A
19aa0c118e10328485459a1250341ac993650805
add templar
site.js
site.js
// this is the request handler for the site. module.exports = site var router = require("./router.js") , errors = require("./errors.js") , domain = require("domain") , config = require("./config.js") , Cookies = require("cookies") , Keygrip = require("keygrip") , keys = new Keygrip(config.keys) , Negotiator = require...
JavaScript
0.000106
@@ -471,16 +471,192 @@ ring%22)%0A%0A +, Templar = require(%22templar%22)%0A, ejs = require('ejs')%0A, tplDir = path.resolve(__dirname, 'templates')%0A, templateOptions = %7B engine: ejs, debug: config.debug, folder: tplDir %7D%0A%0A RedSess. @@ -1414,16 +1414,69 @@ , res)%0A%0A + res.template = Templar(req, res, t...
cace2bae0838c1690334d15ef62d8393364d915d
Add notion of top level `unit` that creates stream of application changes itself.
unit.js
unit.js
"use strict"; var filter = require("reducers/filter") var map = require("reducers/map") var flatten = require("reducers/flatten") var has = require("./util/has") var field = require("./util/field") var association = require("util/association") var keys = Object.keys function unit(mapping) { /** Takes mapping o...
JavaScript
0
@@ -8,16 +8,94 @@ rict%22;%0A%0A +var channel = require(%22reducers/channel%22)%0Avar pipe = require(%22reducers/pipe%22)%0A var filt @@ -960,23 +960,22 @@ reactor( -changes +source ) %7B%0A @@ -1279,19 +1279,336 @@ om.%0A -**/ +If %60%0A **/%0A%0A // If %60source%60 stream of state changes is not pr...
da86bf18e94cdccceb10fc5457cfe2802390f376
Create task.js
task.js
task.js
// Module: task controller app using angular js. You need to keep this to use it in your app as per licence agreement. // Author Sateesh Peetha // BLog: http://tech.dingg.org // Connect with me on LinkedIn at https://www.linkedin.com/in/sateeshpeetha/ // or at angel.co here https://angel.co/sateesh-peetha var app = an...
JavaScript
0.001241
@@ -3035,16 +3035,24 @@ log(task +,event,e );%0A%0A
4380feca196861034f05fe5ac000996a3898c127
Test trello lib.
test.js
test.js
'use strict'; /** * Run package tests. * (C) 2013 Alex Fernández. */ // requires var testing = require('testing'); var Log = require('log'); // globals var log = new Log('info'); /** * Run all module tests. */ exports.test = function(callback) { log.debug('Running tests'); var tests = {}; var libs = ['revi...
JavaScript
0
@@ -308,16 +308,19 @@ libs = %5B +%0A%09%09 'reviewS @@ -325,16 +325,31 @@ wServer' +,%0A%09%09'trello',%0A%09 %5D;%0A%09libs
b88c06ce00120abbfef8ea8fb2dfae8fe89f7160
Test program now emits JSON strings of messages, not just message bodies
test.js
test.js
var sys = require("sys"), stomp = require("./stomp"); var client = new stomp.Client("localhost", 61613); client.subscribe("/queue/news", function(data){ console.log('received: ' + data.body); }); client.publish('/queue/news','hello'); var repl = require('repl').start( 'stomp-test> ' ); repl.context.client = clien...
JavaScript
0
@@ -182,17 +182,28 @@ ' + -data.body +JSON.stringify(data) );%0A%7D
44a403c3b212f4b6becb5c73aa50afc25d5f877e
Add more tests
test.js
test.js
import test from 'ava'; import replaceString from './'; test('Throws if not given a non-empty string', t => { t.throws(() => replaceString()); t.throws(() => replaceString('')); }); test('Returns an array', t => { t.true(Array.isArray(replaceString('blah', 'blah', x => x))); }); test('Works with strings', t =>...
JavaScript
0
@@ -299,22 +299,30 @@ ks with -string +matching group s', t =%3E @@ -365,21 +365,24 @@ there', -'hey' +/(hey)/g , x =%3E ( @@ -459,38 +459,203 @@ 'Works with -matching group +strings', t =%3E %7B%0A t.same(%0A replaceString('hey there', 'hey', x =%3E (%7B worked: x %7D)),%0A %5B'', %7B worked: 'hey' %7D,...
eb1f0e01722208366c9199b96235fd043ec162ae
upgrade to latest AVA
test.js
test.js
import fs from 'fs'; import test from 'ava'; import pify from 'pify'; import requireUncached from 'require-uncached'; const fsP = pify(fs, Promise); test.afterEach(async () => { try { await fsP.unlink('.npmrc'); } catch (err) { if (err.code !== 'ENOENT') { throw err; } } }); test('get the npm registry UR...
JavaScript
0
@@ -340,10 +340,14 @@ %0A%09t. -ok +truthy (req
88a3f89e005847c1bb920a04cb2827854bc9714d
Add missing semicolons
test.js
test.js
/*jshint laxbreak:true */ var assert = require('assert'); var resize = require('./index'); describe('resize.path()', function() { it('returns new relative path with suffix', function() { assert.equal(resize.path('./foo.jpg', '-bar'), 'foo-bar.jpg'); }); it('returns new relative path with custom format', fu...
JavaScript
0.999999
@@ -402,16 +402,17 @@ ');%0A %7D) +; %0A%0A it(' @@ -732,16 +732,17 @@ );%0A %7D) +; %0A%7D);%0A%0Ade
1a86d0d5ce879743e1a06d03b55073a123985a4a
Add test for multiple extensions
test.js
test.js
import test from 'ava'; import modifyFilename from '.'; test('main', t => { t.is( modifyFilename('src/unicorn.png', (filename, ext) => `${filename}-rainbow${ext}`), 'src/unicorn-rainbow.png' ); t.is( modifyFilename(['src/unicorn.png', 'src/pony.png'], (filename, ext) => `${filename}-rainbow${ext}`)[1], 'sr...
JavaScript
0.000001
@@ -336,13 +336,128 @@ png'%0A%09); +%0A%0A%09t.is(%0A%09%09modifyFilename('foo.min.js', (filename, ext) =%3E %60$%7Bfilename%7D-rainbow$%7Bext%7D%60),%0A%09%09'foo.min-rainbow.js'%0A%09); %0A%7D);%0A
cd488a8ddbb838ca768d26c8eeb7724edc0b4a49
fix test to improve code coverage
test.js
test.js
'use strict'; var noop = require('nop'); var readGlob = require('./'); var test = require('tape'); test('readGlob()', function(t) { t.plan(13); readGlob('.git{attributes,ignore}', 'utf8', function(err, contents) { t.strictEqual(err, null, 'should read files.'); t.deepEqual(contents, [ '* text=auto\...
JavaScript
0
@@ -534,16 +534,37 @@ g: 'hex' +,%0A ignoreDir: true %0A %7D, fu @@ -902,25 +902,12 @@ _', -%7BignoreDir: true%7D +null , fu
4c74dcb9ddab5299f6c1bfbaa81ff88602648209
Remove trailing comma
test.js
test.js
describe('forwarded-parse', function () { 'use strict'; var assert = require('assert') , parse = require('./'); it('is exported as a function', function () { assert.strictEqual(typeof parse, 'function'); }); it('parses the pairs as expected', function () { assert.deepEqual(parse('foo=a,foo=b;ba...
JavaScript
0.000554
@@ -1,8 +1,35 @@ +/* istanbul ignore next */%0A describe @@ -1190,17 +1190,16 @@ %5B 'e' %5D -, %0A %7D);
0553bdc33294b2590a7ca6ee2b81173da9f48138
update tests
test.js
test.js
/*! * api-toc <https://github.com/jonschlinkert/api-toc> * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; /* deps:mocha */ var assert = require('assert'); var should = require('should'); var toc = require('./'); describe('toc', function () { it('should generate a TOC:...
JavaScript
0.000001
@@ -378,21 +378,22 @@ '+ **%5B -1-one +config %5D(fixtur @@ -395,21 +395,22 @@ ixtures/ -1-one +config .js)**', @@ -426,11 +426,16 @@ - %5B -aaa +.disable %5D(fi @@ -445,19 +445,21 @@ res/ -1-one +config .js#L -2 +10 )',%0A @@ -474,11 +474,15 @@ - %5B -bbb +.enable %5D(fi @@ -484,29 +484,30 @@ e%5D(fixt...
42024f3b5d0d5ed8479f8875bd47fa16ecd4e7e6
test case node legacy support
test.js
test.js
/*eslint-env node, mocha */ 'use strict'; let assert = require('assert'); let simpleXor = require('./'); describe('mocha', function () { it('should xor with correct result', function () { assert.equal(simpleXor('Hello', '-----key----'), 'eHAAB'); }); });
JavaScript
0.000002
@@ -36,19 +36,19 @@ rict';%0A%0A -let +var assert @@ -72,11 +72,11 @@ ');%0A -let +var sim
7424130043c20ca96c1dc37e3893bf70c8e04c9b
Update tests
test.js
test.js
/*! * pad-left <https://github.com/jonschlinkert/pad-left> * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License */ 'use strict'; var should = require('should'); var pad = require('./'); describe('pad left', function () { it('should return the string when no padding amount is passed.',...
JavaScript
0.000001
@@ -510,27 +510,24 @@ ual(' - abc');%0A p @@ -547,35 +547,32 @@ ).should.equal(' - @@ -982,35 +982,32 @@ - abc');%0A %7D);%0A%0A @@ -1112,21 +1112,8 @@ , 10 - - str.length , 0) @@ -1177,21 +1177,16 @@ .equal(' -00000 00000abc @@ -1228,29 +1228,24 @@ equ...
435f0a4240c96e5eaf375d25f3ba703df712b17f
Replace parameter task with name in test.js.
test.js
test.js
var cluster = require('cluster'); var reduler = require('./index'); var numCPUs = require('os').cpus().length; reduler.connect(); if (cluster.isMaster) { for (var i = 0; i < numCPUs; ++i) cluster.fork(); reduler.run(); reduler.add('multiply', [1, 2], {date: Date.now() + 10000}, function(err, id) { cons...
JavaScript
0
@@ -529,20 +529,20 @@ %7B%0A var -func +task s = %7B%0A @@ -636,28 +636,28 @@ unction(id, -task +name , args) %7B%0A @@ -705,20 +705,20 @@ id, id, -task +name , args); @@ -726,18 +726,18 @@ -funcs%5Btask +tasks%5Bname %5D.ap
cda80c7de4a396c2c8977ebca4c07e94065e06d8
Add test for null files.
test.js
test.js
/* jshint node: true */ /* global describe, it */ 'use strict'; var assert = require('assert'), es = require('event-stream'), gutil = require('gulp-util'), PassThrough = require('stream').PassThrough, cat = require('./index'); describe('gulp-cat', function() { it('should work in buffer mode', fu...
JavaScript
0
@@ -2173,13 +2173,511 @@ %0A %7D); +%0A%0A it('should let null files pass through', function(done) %7B%0A var stream = cat(),%0A n = 0;%0A stream.pipe(es.through(function(file) %7B%0A assert.equal(file.path, 'null.md');%0A assert.equal(file.contents, null);%0A ...
462950ee1d73938892076c332e01b784952e9a16
Send test to Google to avoid the GitHub API limit.
test.js
test.js
'use strict'; /** * Run package tests. * (C) 2014 Alex Fernández. */ // requires require('prototypes'); var testing = require('testing'); var request = require('./index.js'); /** * Test get. */ function testGet(callback) { request.get('http://www.google.com/', function(error, result) { testing.check(error,...
JavaScript
0
@@ -879,37 +879,23 @@ s:// -api.github.com/authorizations +www.google.com/ ', j @@ -975,13 +975,13 @@ to G -itHub +oogle ', c @@ -1104,17 +1104,17 @@ Code, 40 -1 +5 , 'Shoul @@ -1127,15 +1127,12 @@ be a -uthoriz +llow ed',
d99c47be572c273aef554f6138f2a057c8b76fc4
Fix tests
test.js
test.js
import request from './__mocks__/request'; import logger from './index'; const url = 'http://localhost/accept-log'; const UNSUPPORTED_METHOD = 'PUT'; let messageParts; beforeEach(() => { messageParts = ['hello', 'world']; }); describe('Sends message over the network', () => { test('GET', () => { const config...
JavaScript
0.000003
@@ -144,16 +144,75 @@ 'PUT';%0A +const timeOffset = -(new Date().getTimezoneOffset() / 60);%0A let mess @@ -548,33 +548,45 @@ ello%2520world&to= -3 +$%7BtimeOffset%7D %60%0A %7D);%0A %7D);%0A @@ -895,17 +895,30 @@ orld&to= -3 +$%5C%7BtimeOffset%7D %60%0A %7D) @@ -1173,17 +1173,29 @@ d%22,%22to%22: -3 +$%...
464b9130a606540dfc044d08fe893c6dd4a089a8
improve test log
test.js
test.js
const {spawn} = require('child_process'); const commands = [ {cmd: 'rm', args: ['-r', 'test-cmp'], ignoreErrors: true}, {cmd: './node_modules/.bin/vue', args: ['init', '.', 'test-cmp'], yes: true}, {cmd: 'npm', args: ['install'], cwd: 'test-cmp'}, {cmd: 'npm', args: ['run', 'lint'], cwd: 'test-cmp'}, {cmd: '...
JavaScript
0.000001
@@ -576,16 +576,23 @@ (command +, index ) %7B%0A re @@ -1380,40 +1380,150 @@ log( -'process exit with status', code +%0A '=%3E process',%0A (index+1),%0A 'of',%0A commands.length,%0A 'exit with status',%0A code%0A );%0A @@ -1596,16 +1596,23 @@ ev, nex...
22382c2f98a9dcd8f428ef50b47c68d628e32f7e
Implement first test
test.js
test.js
var expect = require('chai').expect; var es = require('event-streams'); var concat = require('concat'); describe('permutation streams', function() { it('should return all permutations'); });
JavaScript
0.002787
@@ -60,21 +60,20 @@ t-stream -s ');%0A + var conc @@ -97,16 +97,46 @@ cat');%0A%0A +var ps = require('./index');%0A%0A describe @@ -172,16 +172,16 @@ ion() %7B%0A - it('sh @@ -209,14 +209,280 @@ tations' +, function(done) %7B%0A var s = ps.createPermutationStream();%0A es.readArray(%5B%22hello%22, %22wo...
66acf397fc0c6090b764d2a04bcad2ede0041d15
fix AMD logic
vars.js
vars.js
module.exports = { createClass: function(chartType, methodNames) { var classData = { displayName: chartType + 'Chart', getInitialState: function() { return {}; }, render: function() { var _props = {}; for (var name in this.props) { if (this.props.hasOwnProperty(name)) {...
JavaScript
0.000043
@@ -1771,17 +1771,17 @@ define -= +! == 'func
b394ba39a32bdbf76f7245f6d461cdc3fc47e121
Add functions for deep merging and cloning objects
util.js
util.js
const fs = require("fs"); function evalTemplate(template, scope) { with(scope) { try { return eval(`\`${template.replace(/`/g, '\\`')}\``); } catch (error) { console.log("Error encountered while evaluating a template:"); console.log(`Message: ${error.message}`); ...
JavaScript
0
@@ -711,16 +711,1130 @@ 4));%0A%7D%0A%0A +function isMergeableObject(object) %7B%0A return object && typeof object == %22object%22;%0A%7D%0A%0Afunction deepClone(object) %7B%0A if (!object %7C%7C typeof object !== 'object') return object;%0A%0A var output = object.constructor();%0A for (var key in object) ...
2cf967cb705697b15590537bfe34d5e15deca8e5
Use local variables in extractEmailAddress function
util.js
util.js
function extractEmailAddress(emailAddress) { emailAddressRegex = /^(?:.*<)?([^<>]+)(?:>)?$/; return emailAddressRegex.exec(emailAddress)[1].toLowerCase(); } function extractListId(rawMessage) { listIDRegex = /\r\nlist-id:[ \t]*([^\n\r]+)\r\n/i; unfoldRegex = /\r\n[ \t]+/g; rawMessageUnfolded = rawMessage.rep...
JavaScript
0.000003
@@ -40,16 +40,20 @@ ss) %7B%0A +var emailAdd
a2687d24e927269c526076891bbaa691da23881a
downgrade gid
util.js
util.js
var debug = require('debug')('webtorrent-website:util') var posix = require('posix') var MAX_SOCKETS = 10000 exports.downgradeUid = function () { if (process.platform === 'linux' && process.env.NODE_ENV === 'production') { process.setuid('www-data') debug('downgraded uid to ' + process.getuid()) } } expo...
JavaScript
0.000003
@@ -220,16 +220,47 @@ ion') %7B%0A + process.setgid('www-data')%0A proc @@ -308,15 +308,44 @@ ded -uid to +gid (' + process.getgid() + ') uid ( ' + @@ -360,16 +360,22 @@ getuid() + + ')' )%0A %7D%0A%7D%0A
0b5796e01731f2415954248df60cf794b3882092
Make the format better
Board.js
Board.js
var body = document.body; var html = document.documentElement; var body = html.getElementsByTagName("body")[0]; var table = body.getElementsByTagName("table")[0]; var size = 20; // Size of cell // Credit to http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript var height = Mat...
JavaScript
0.999999
@@ -866,52 +866,8 @@ ) %7B%0A -%09// var row = document.createElement(%22tr%22);%0A %09var @@ -929,55 +929,8 @@ ) %7B%0A -%09 // var cell = document.createElement(%22td%22);%0A %09 v @@ -1178,66 +1178,9 @@ );%0A%09 - // row.appendChild(cell);%0A%09%7D%0A%09// table.appendChild(row); +%7D %0A%7D%0A%0A
74d68da80518da818c17256eb34a26228f092420
read and write json file using fs
playground/json.js
playground/json.js
var obj = { name: 'Jayant' }; var stringObj = JSON.stringify(obj); console.log(typeof stringObj); console.log(stringObj); var personString = '{"name": "jayant", "age": 25}'; var person = JSON.parse(personString); console.log(typeof person); console.log(person);
JavaScript
0
@@ -1,12 +1,15 @@ +// var obj = %7B%0A @@ -8,16 +8,19 @@ obj = %7B%0A +// %09name: ' @@ -31,12 +31,18 @@ nt'%0A +// %7D;%0A%0A +// var @@ -70,24 +70,27 @@ ngify(obj);%0A +// console.log( @@ -108,16 +108,19 @@ ngObj);%0A +// console. @@ -136,16 +136,19 @@ gObj);%0A%0A +// var pers @@ -191,16 +191,19 ...
e0ed10566b017ac07f13687635d3f732f8116994
Send fortune categories list as user notice
plugins/fortune.js
plugins/fortune.js
var exec = require("child_process").exec; function FortunePlugin(bot) { var self = this; self.name = "fortune"; self.help = "Fortune teller plugin"; self.depend = ["cmd"]; self.events = { "cmd#fortune" : function(nick, to, args, message) { var cmd = "fortune -s"; if (args[1] && args[1].match(/^\w+$/)) ...
JavaScript
0
@@ -867,22 +867,27 @@ %09%09%09%09bot. -say(to +notice(nick , %22All a
825d803789f47e54ec7ee401ae698f4aa98d24fa
Change sanitization
back/modules/utils.js
back/modules/utils.js
'use strict' const spawn = require('child_process').spawnSync; exports.handleSpawnError = function(result) { if (result.error) { return {'message':result.error.message, 'status': result.error.errno}; } else if (result.stderr.toString() !== '') { return {'message':result.stderr.toString(),'status': 500}; } el...
JavaScript
0.000005
@@ -899,20 +899,16 @@ place(/%5B -%5C%5D%5C%5B &%3E%3C;%7C%5C// @@ -993,12 +993,8 @@ e(/%5B -%5C%5D%5C%5B %3E%3C;%7C
828725626b9405375ce08bbe9f111166ab297e03
add ping route for monitoring
backend/app/routes.js
backend/app/routes.js
'use strict'; var initAuthenticationRoutes = require('./authentication/authentication.routes'); var initTripsRoutes = require('./trips/trips.routes'); var initEventsRoutes = require('./events/events.routes'); var initUsersRoutes = require('./users/users.routes'); var initCarsRoutes = require('./cars/cars.routes'); m...
JavaScript
0
@@ -525,10 +525,89 @@ text);%0A%0A + context.app.get('/ping', function(req, res) %7B%0A res.sendStatus(200);%0A %7D);%0A %7D%0A
c811d6fe5129d45d542d6008e42612eb8a3ae1d5
fix format for ended live streams
plugins/youtube.js
plugins/youtube.js
var request = require("request"); var querystring = require("querystring"); function YoutubePlugin(bot) { var self = this; self.name = "youtube"; self.help = "Youtube plugin"; self.depend = ["cmd", "ignore", "util"]; self.apiKey = null; self.vidre = new RegExp('(?:youtube(?:-nocookie)?\\.com/(?:[^/ ]+/.+/|(?:...
JavaScript
0.000022
@@ -1380,47 +1380,123 @@ ata. -snippet.liveBroadcastContent != %22none%22; +liveStreamingDetails !== undefined;%0A%09%09var liveNow = live && data.liveStreamingDetails.actualEndTime === undefined;%0A %0A%09%09v @@ -1508,16 +1508,19 @@ r = live +Now ? data. @@ -1547,16 +1547,43 @@ tContent +.replace(%22none%22, %2...
d5f881a4de0d5fc1af85921ce9c7dc3919c6d335
Fix typo (#2243)
feature-detects/crypto/getrandomvalues.js
feature-detects/crypto/getrandomvalues.js
/*! { "name": "getRandomValues", "property": "getrandomvalues", "caniuse": "window.crypto.getRandomValues", "tags": ["crypto"], "authors": ["komachi"], "notes": [{ "name": "W3C Editor’s Draft", "href": "https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#RandomSource-method-getRando...
JavaScript
0.998548
@@ -432,16 +432,23 @@ mValues +method for gene @@ -450,17 +450,19 @@ generat -e +ing cryptog
691f1f208efc2101e34d54796c4892871a5e0c4a
use a hack with setTimeout() for opening multiple tabs in parallel
firefox/chrome/content/browser-overlay.js
firefox/chrome/content/browser-overlay.js
let Cc = Components.classes; let Ci = Components.interfaces; let prompts = Cc['@mozilla.org/embedcomp/prompt-service;1'].getService(Ci.nsIPromptService); let adban = Cc['@ad-ban.appspot.com/adban;1'].getService().wrappedJSObject; let $ = function(id) { return document.getElementById(id); }; let _ = function(id, pa...
JavaScript
0
@@ -854,16 +854,176 @@ (url) %7B%0A + // use this hack, otherwise firefox 3.6 can skip the tab%0A // if another tab is immediately opened after this tab.%0A const open_tab_callback = function() %7B%0A gBrows @@ -1061,16 +1061,57 @@ b(url);%0A + %7D%0A setTimeout(open_tab_callback, 10);%0A %7D;%0A%0Alet
d5a3c29dc0ed2b83e182db06fa59173967512d7e
remove dead test code from server main script
polyball/Server.js
polyball/Server.js
var Logger = require('polyball/shared/Logger'); var FileServer = require('polyball/server/FileServer'); var Model = require('polyball/shared/Model'); var Comms = require('polyball/server/Comms'); var Util = require('polyball/shared/Util'); //jshint ignore:line var Engine = require('polyball/server/Engine'); var Configu...
JavaScript
0.000001
@@ -754,958 +754,8 @@ );%0A%0A -%0A%0A// TODO deleteme start%0A%0A//model.addOrResetArena(%7B%0A// numberPlayers: Util.getRandomInt(3, 10),%0A// arenaRadius: 300,%0A// bumperRadius: 35,%0A// marginX: 60,%0A// marginY: 60%0A//%7D);%0A//%0A//setInterval(function () %7B%0A// comms.broadcastSnapshot(mode...