commit
stringlengths
40
40
old_file
stringlengths
4
264
new_file
stringlengths
4
264
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
624
message
stringlengths
15
4.7k
lang
stringclasses
3 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
89886ad9e2dca38a13ce918c3cc528578b025b4f
tests/ecmascript/test-dev-div-by-zero.js
tests/ecmascript/test-dev-div-by-zero.js
/* * Floating point division by zero is undefined behavior (in C99+) * so the internal implementation must work around it by implementing * the division manually for portability. * * Exercise a few cases in compiler/executor. */ /*=== 0.5 1 -1 NaN 0 0 compiler Infinity -Infinity -Infinity Infinity NaN NaN ex...
Add division by zero testcase
Add division by zero testcase Useful for manually exercising -fsanitize=undefined.
JavaScript
mit
svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape
a513e8454a5d2a0cf6e59e8c78ef33f3bdfd5d70
src/index.js
src/index.js
import React from 'react'; import _Story from './components/Story'; export const Story = _Story; const defaultOptions = { inline: false, header: true, source: true, }; export default { addWithInfo(storyName, _info, _storyFn, _options) { const options = { ...defaultOptions, ..._options }; ...
import React from 'react'; import _Story from './components/Story'; export const Story = _Story; const defaultOptions = { inline: false, header: true, source: true, }; export default { addWithInfo(storyName, info, storyFn, _options) { if (typeof storyFn !== 'function') { if (typeof info === 'functio...
Handle undefined info before full options are found
Handle undefined info before full options are found
JavaScript
mit
storybooks/storybook,storybooks/react-storybook,nfl/react-storybook,nfl/react-storybook,rhalff/storybook,Hacker0x01/react-storybook-addon-info,rhalff/storybook,shilman/storybook,shilman/storybook,shilman/storybook,storybooks/storybook,kadirahq/react-storybook,enjoylife/storybook,storybooks/storybook,storybooks/storyboo...
3b4214f0b176b6df45f9d09ef347efc8dcf6b943
src/util/each.js
src/util/each.js
// Does something for a single node or a DocumentFragment. This is useful when // working with arguments that are passed to DOM methods that work with either. export default function (node, func) { if (node instanceof DocumentFragment) { const chs = node.childNodes; const chsLen = chs.length; for (let a =...
Add utility for working with document fragments and single nodes using a single function.
Add utility for working with document fragments and single nodes using a single function.
JavaScript
mit
skatejs/named-slots
e4373f0cecd175583a00d3e56754b9b99d0bfb4d
lib/bma_gis.js
lib/bma_gis.js
/* bma_gis.js carto helpers */ window.BG = { // MUST be called first to setup everything init: function(wms, pg_bridge, layer, title) { this.wms_url_ = wms; this.layer_name_ = layer; this.title_ = title || 'bMa & OpenStreetMap'; this.pg_ = pg_bridge + '/'; }, //...
Put JS stuff in a dedicated lib
Put JS stuff in a dedicated lib
JavaScript
agpl-3.0
pierremarc/proto_bma,pierremarc/proto_bma,pierremarc/proto_bma
235a357e7adae4d19746d9abe4eaa271bb4ffe43
test/updateServer_spec.js
test/updateServer_spec.js
import chai from 'chai'; import fetch from 'node-fetch'; import https from 'https'; chai.should(); describe('Update Server', () => { it('should be online', (done) => { https.get('https://update.gpmdp.xyz', () => done()) .on('error', () => done(new Error('Update server was unreachable'))); }); it('sho...
Implement an update server spec file
Implement an update server spec file
JavaScript
mit
n4k1/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MCManuelLP/Google-Play-Music-Desktop-Player-UNOFFICIAL-,petuhovskiy/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MCManuelLP/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-,MCManuelLP/Google-Play-Music-Desktop-Pla...
aaf89722894478e2d27aec6f2b81511c69ad754c
test/monitorModelTest.js
test/monitorModelTest.js
'use strict' var request = require('request') var fs = require('fs') var os = require('os') var should = require('should') var utility = require('../public/utility') let path = require('path') var api var url describe('Server: Web', function () { before(function (done) { url = 'http://localhost:8085/api' do...
Add Testcase for Showing Logs JSON
Add Testcase for Showing Logs JSON
JavaScript
mit
Flieral/Logger-Service
3e028e4308ec518fdaf5fae02a4f78a5fa8f9fcd
particles/Multiplexer/multiplexer-test.js
particles/Multiplexer/multiplexer-test.js
/** * @license * Copyright (c) 2017 Google Inc. All rights reserved. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * Code distributed by Google as part of this project is also * subject to an additional IP rights grant found at * http://polymer.github.io...
Add test for N^2 behavior.
Add test for N^2 behavior.
JavaScript
bsd-3-clause
PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs,PolymerLabs/arcs
8d4f5470e2a2bcbb6f8eda6ec7d24a82d9feb3b0
bp/bp.js
bp/bp.js
// Node 11.2.0 fs = require('fs'); const input = fs.readFileSync('input.txt', 'utf-8').trim().split('\n'); const start = process.hrtime.bigint(); // Code here console.log(process.hrtime.bigint() - start);
Add boilerplate to simplify starting challenges
Add boilerplate to simplify starting challenges
JavaScript
mit
foxscotch/advent-of-code,foxscotch/advent-of-code
b7194056cb7ccc5e4987f48d9f56e4d116ddb0c3
src/js/new-recipe.js
src/js/new-recipe.js
;(function(){//IFEE angular.module('brewKeeper') .controller('createNewRecipe', function($scope, $http){ $scope.recipe = { }//Might need to prepopulate this with empty strings for each key... Maybe... $scope.submit=function(){ $http.post('urlendpoint', $scope.recipe);//ADD ACTUAL ENDPOINT HERE!...
Set up controller for createNewRecipe to submit form when we get endpoint.
Set up controller for createNewRecipe to submit form when we get endpoint.
JavaScript
mit
Brew-Keeper/brew-keeper-gui,ahartz1/brew-keeper-gui,ahartz1/brew-keeper-gui,Brew-Keeper/brew-keeper-gui,ahartz1/brew-keeper-gui,Brew-Keeper/brew-keeper-gui
a79dd613fb12841df94c4645740f11e4256ebdaf
src/js/framework/styler.js
src/js/framework/styler.js
let CLASSES = { hidden: "hidden", }; class Styler { addClass(elem, klass) { elem.classList.add(klass); } get classes() { return CLASSES; }; hide(elem) { this.addClass(elem, CLASSES.hidden); } removeClass(elem, klass) { elem.classList.remove(klass); } show(elem) { this.remove...
Add helper for adding classes/styles to elements
Add helper for adding classes/styles to elements
JavaScript
mit
tdg5/js4pm,tdg5/front-end-skills-for-pms,tdg5/front-end-skills-for-pms,tdg5/js4pm
db28492e6bd99aa138e0c7d4a1ce15fe4661f13b
packages/id-map/package.js
packages/id-map/package.js
Package.describe({ summary: "Dictionary data structure: a wrapper for a raw object", internal: true }); Package.on_use(function (api) { api.export('IdMap'); api.use(['underscore', 'json', 'ejson']); api.add_files([ 'id-map.js' ]); });
Package.describe({ summary: "Dictionary data structure allowing non-string keys", internal: true }); Package.on_use(function (api) { api.export('IdMap'); api.use(['underscore', 'json', 'ejson']); api.add_files([ 'id-map.js' ]); });
Tweak the description of id-map
Tweak the description of id-map
JavaScript
mit
udhayam/meteor,sdeveloper/meteor,benjamn/meteor,Ken-Liu/meteor,AnjirHossain/meteor,chiefninew/meteor,jg3526/meteor,SeanOceanHu/meteor,yyx990803/meteor,dfischer/meteor,steedos/meteor,williambr/meteor,D1no/meteor,udhayam/meteor,colinligertwood/meteor,stevenliuit/meteor,nuvipannu/meteor,kencheung/meteor,Theviajerock/meteo...
f2912ffe4d2e659ea1042b9d8699c0d44d9de918
static/js/load_script.js
static/js/load_script.js
// Load a javascript file from the given url, and call the given callback when // it's done loading. function loadScript(url, callback){ var script = document.createElement("script") script.type = "text/javascript"; if (script.readyState){ //IE script.onreadystatechange = function(){ if (script.readyS...
Move loadScript into separate file
Move loadScript into separate file Not sure if I'll be needing this
JavaScript
mit
wapcaplet/pasta,wapcaplet/pasta
c2aaf644d32990b9873e79976b2aa54de9052c7b
src/components/hocs.js
src/components/hocs.js
import { lifecycle } from 'recompose' import database from '../database' export const withDatabaseSubscribe = (trigger, getRefPath, getOnTrigger) => ( lifecycle({ componentWillMount() { this.databaseRef = database.ref(getRefPath(this.props)) this.onTrigger = this.databaseRef.on( trigger, ...
Add a with database higher order component
Add a with database higher order component
JavaScript
mit
mg4tv/mg4tv-web,mg4tv/mg4tv-web
c681cecc3797e1709aa8fbcc06c7e358dc17dd8e
api_performance/transactionsWithoutFilters.js
api_performance/transactionsWithoutFilters.js
import http from 'k6/http' import { check } from 'k6' const auth = require('./auth.js') const BASE_URL = __ENV.BASE_URL || 'https://127.0.0.1:8080' export const options = { vus: 10, duration: '2m', thresholds: { http_req_duration: ['p(95)<600'] }, insecureSkipTLSVerify: true } function makeGetRequest (...
Add api load test for transactions without filters
Add api load test for transactions without filters To test the openhim api OHM-574
JavaScript
mpl-2.0
jembi/openhim-core-js,jembi/openhim-core-js
5491b2b00f1e2fd161d646355ac03fb06d6aed47
app/scripts/tests/stores/MobilizationsTest.js
app/scripts/tests/stores/MobilizationsTest.js
import mobilizations from './../../stores/mobilizations' import { EDIT_COLUMN_CONTENT } from './../../constants/ActionTypes'; describe('mobilizations', function(){ describe('#editColumnContent', function(){ it('should change the column text', function(){ const mobilizationsList = [ { name...
Add test to mobilizations store
Add test to mobilizations store
JavaScript
agpl-3.0
nossas/bonde-client,nossas/bonde-client,nossas/bonde-client
67fe84f08d7ef03767d90e3f283799984cd26b5b
src/Oro/Bundle/EmailBundle/Resources/public/js/email/template/view.js
src/Oro/Bundle/EmailBundle/Resources/public/js/email/template/view.js
/*global define*/ define(['jquery', 'underscore', 'backbone' ], function ($, _, Backbone) { 'use strict'; /** * @export oroemail/js/email/template/view * @class oroemail.email.template.View * @extends Backbone.View */ return Backbone.View.extend({ events: { 'c...
/*global define*/ define(['jquery', 'underscore', 'backbone' ], function ($, _, Backbone) { 'use strict'; /** * @export oroemail/js/email/template/view * @class oroemail.email.template.View * @extends Backbone.View */ return Backbone.View.extend({ events: { 'c...
Introduce transport settings - fixed flush of selected value
CRM-1974: Introduce transport settings - fixed flush of selected value
JavaScript
mit
Djamy/platform,trustify/oroplatform,ramunasd/platform,morontt/platform,Djamy/platform,2ndkauboy/platform,northdakota/platform,geoffroycochard/platform,trustify/oroplatform,hugeval/platform,northdakota/platform,morontt/platform,hugeval/platform,morontt/platform,2ndkauboy/platform,orocrm/platform,trustify/oroplatform,ram...
341269db9076621480f43d43de87116959175ca1
src/overrides/DataModel.js
src/overrides/DataModel.js
Ext4.define('Densa.overrides.DataModel', { override: 'Ext.data.Model', //when creating record with uuid idGenerator we can set the internalId to the id //which it will get after saving //fixes de-selected row in grid after insert in bound form constructor: function(data, id, raw, convertedData) { ...
Fix deselected row in grid after insert in bound form
Fix deselected row in grid after insert in bound form when creating record with uuid idGenerator we can set the internalId to the id which it will get after saving
JavaScript
bsd-2-clause
Ben-Ho/densajs,koala-framework/densajs
e29e2bb50e5df929abfe595572de27d84ddebca3
test/testGOFManager.js
test/testGOFManager.js
/** * @author adoankim <adoankim@alumnos.uvigo.es> * @copyright 2014 adoankim * @license {@link https://github.com/adoankim/PhaserGoF/blob/master/LICENSE|MIT License} * * testCell.js */ var chai = require('chai'); var assert = chai.assert, expect = chai.expect, should = chai.should(); ...
Add test cases for GOFManager class
Add test cases for GOFManager class
JavaScript
mit
adoankim/PhaserGoF,adoankim/PhaserGoF
68037d58a71ece4cab9d388f928be74f28eded7f
Medium/215_Kth_Largest_Element_in_an_Array.js
Medium/215_Kth_Largest_Element_in_an_Array.js
/** * @param {number[]} nums * @param {number} k * @return {number} */ var findKthLargest = function(nums, k) { var sorted = nums.sort(function(a, b) { return a - b; }); return sorted[sorted.length - k]; };
Add solution to question 215
Add solution to question 215
JavaScript
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
572b517dc47204ef4f63356bd121e729ff53779e
stream-adventure/lines.js
stream-adventure/lines.js
var os = require('os'); var tmap = require('through2-map'); var split = require('split'); // Convert even-numbered lines to uppercase, odd-numbered lines to lowercase. // Line number starts from 1. var lineNum = 1; process.stdin .pipe(split()) .pipe(tmap({ wantStrings: true }, function (data) { var line = line...
Add solution for stream-adventure: "Lines"
Add solution for stream-adventure: "Lines"
JavaScript
mit
davidcgl/nodeschool
88b14abcdd56309ea1c3f5daa82a09c5dd937ea0
test/app.js
test/app.js
var path = require('path'), assert = require('yeoman-generator').assert, helpers = require('yeoman-generator').test, os = require('os'); describe('sails-rest-api:app', function () { before(function (done) { helpers.run(path.join(__dirname, '../app')) .inDir(path.join(os.tmpdir(), '....
var path = require('path'), assert = require('yeoman-generator').assert, helpers = require('yeoman-generator').test, os = require('os'); describe('sails-rest-api:app', function () { before(function (done) { helpers.run(path.join(__dirname, '../app')) .inDir(path.join(os.tmpdir(), '....
Replace skip with skipAll in tests
Replace skip with skipAll in tests
JavaScript
mit
IncoCode/generator-sails-rest-api,tnunes/generator-trails,italoag/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,mhipo1364/generator-sails-rest-api,eithewliter5518/generator-sails-rest-api,italoag/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,konstantinzolotarev/generator-trails,jaumard/generat...
ecaa6445fe32bcf606121631e79b02a634eb4bcd
application/widgets/source/class/widgets/Theme.js
application/widgets/source/class/widgets/Theme.js
qx.Class.define("widgets.Theme", { extend: unify.ui.widget.styling.Theme, construct : function() { var styles = { test : { backgroundColor: "yellow", borderColor: "green green green green", children : { test1 : { backgroundColor : "orange" }, ...
Add first test theme to widget app
Add first test theme to widget app
JavaScript
mit
unify/unify,unify/unify,unify/unify,unify/unify,unify/unify,unify/unify
3e888128240a5e5b37293149eba044a4739dcf56
src/model/options/index.js
src/model/options/index.js
/** * Exports object that contains names of options as a key and their configuration objects as a value * * @example * export default { * optionName: { * desc: 'Description for the option', * alias: 'Short name for the option', * type: Boolean || String || Number, * defaults: 'Default value',...
/** * Exports object that contains names of options as a key and their configuration objects as a value * * @example * export default { * optionName: { * desc: 'Description for the option', * alias: 'Short name for the option', * type: Boolean || String || Number, * defaults: 'Default value',...
Fix boolean type in model options
Fix boolean type in model options
JavaScript
mit
italoag/generator-sails-rest-api,jaumard/generator-trails,tnunes/generator-trails,konstantinzolotarev/generator-trails,ghaiklor/generator-sails-rest-api,ghaiklor/generator-sails-rest-api,IncoCode/generator-sails-rest-api,italoag/generator-sails-rest-api
733de75270864987805cec324560784bc0355dcc
server/migrations/20170802145339-create-user.js
server/migrations/20170802145339-create-user.js
module.exports = { up: (queryInterface, Sequelize) => { queryInterface.createTable('Users', { id: { allowNull: false, autoIncrement: true, primaryKey: true, type: Sequelize.INTEGER, }, username: { type: Sequelize.STRING, allowNull: false, u...
Make the schema available to store user records in the database.
Make the schema available to store user records in the database.
JavaScript
mit
ekundayo-ab/hello-books,ekundayo-ab/hello-books
952c8d15408ab24b6c3a056834abef5a763cf9e8
stories/components/quoteBanner/index.js
stories/components/quoteBanner/index.js
import React from 'react'; import { storiesOf } from '@storybook/react'; import QuoteBanner from 'shared/components/quoteBanner/quoteBanner'; storiesOf('shared/components/quoteBanner', module) .add('Default', () => ( <QuoteBanner author="James bond" quote="I always enjoyed learning a new tongue" ...
Add story for QuoteBanner component
Add story for QuoteBanner component
JavaScript
mit
OperationCode/operationcode_frontend,sethbergman/operationcode_frontend,tal87/operationcode_frontend,tal87/operationcode_frontend,NestorSegura/operationcode_frontend,tskuse/operationcode_frontend,hollomancer/operationcode_frontend,NestorSegura/operationcode_frontend,miaket/operationcode_frontend,sethbergman/operationco...
36a358a9460ec54648b154bba443f471654c084d
tests/unit/-private/query-manager-macro-decorator-test.js
tests/unit/-private/query-manager-macro-decorator-test.js
import EmberObject from '@ember/object'; import { queryManager, QueryManager } from 'ember-apollo-client'; import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; import ApolloService from 'ember-apollo-client/services/apollo'; class OverriddenApollo extends ApolloService {} let TestObject; mo...
Add tests for queryManager macro + decorator
Add tests for queryManager macro + decorator
JavaScript
mit
bgentry/ember-apollo-client,bgentry/ember-apollo-client
e967d9d1b3997baf6bb687cde319e9cae861d9f1
tests/gtype-signal-exception.js
tests/gtype-signal-exception.js
#!/usr/bin/env seed // Returns: 0 // STDIN: // STDOUT:Signal definition needs name property\nSignal definition needs name property // STDERR: // Returns: 0 // STDIN: // STDOUT:Hello\nGoodbye // STDERR: Seed.import_namespace("Gtk"); Gtk.init(null, null); HelloWindowType = { parent: Gtk.Window, name: "He...
Add test for attempting to invalidly define signals.
Add test for attempting to invalidly define signals. svn path=/trunk/; revision=227
JavaScript
lgpl-2.1
danilocesar/seed,danilocesar/seed,danilocesar/seed,danilocesar/seed,danilocesar/seed
d3727d4f73f7facddd4ba93569b192f9b27b6bc5
test/proxy.js
test/proxy.js
var fs = require('fs'); var http = require('http'); var https = require('https'); var cgi = require('cgi'); // The HTTPS SSL options var options = { key: fs.readFileSync(__dirname + '/ssl.key'), cert: fs.readFileSync(__dirname + '/ssl.crt') } var hander = cgi(__dirname + '/cgi-bin/nph-proxy.cgi', { nph: true, ...
var fs = require('fs'); var http = require('http'); var https = require('https'); var cgi = require('cgi'); // The HTTPS SSL options var options = { key: fs.readFileSync(__dirname + '/ssl.key'), cert: fs.readFileSync(__dirname + '/ssl.crt') } var handler = cgi(__dirname + '/cgi-bin/nph-proxy.cgi', { nph: true, ...
Fix typo in test script
Fix typo in test script
JavaScript
mit
celsoprieto/ISISCGI,TooTallNate/node-cgi,celsoprieto/ISISCGI,TooTallNate/node-cgi,celsoprieto/ISISCGI,TooTallNate/node-cgi
c52c13d4a83b59496a964cc08a8dc4c25a1d4403
tests/jsx/helpers/organismDetailsSpec.js
tests/jsx/helpers/organismDetailsSpec.js
// chai is an assertion library let chai = require('chai'); // @see http://chaijs.com/api/assert/ let assert = chai.assert; // register alternative styles // @see http://chaijs.com/api/bdd/ chai.expect(); chai.should(); // fs for reading test files let fs = require('fs'); let rewire = require("rewire"); let organis...
Add simple test case for organismDetails helper
Add simple test case for organismDetails helper
JavaScript
mit
molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec
cf09b56f56f31b57b572156da7e7e43a7c6f4905
maintenance/count-entries.js
maintenance/count-entries.js
/*jslint node: true */ /* * Count all of the entries. Each Response object holds an array of one or more entries. * * Usage: * $ envrun -e my-deployment.env node find-plural-entries.js * */ 'use strict'; var mongo = require('../lib/mongo'); var Response = require('../lib/models/Response'); var db; function ...
Add a maintenance script for counting the total number of entries
Add a maintenance script for counting the total number of entries
JavaScript
bsd-3-clause
LocalData/localdata-api,LocalData/localdata-api,LocalData/localdata-api
9461bc93ba7eca6c26fefd155372217a27628fb3
files/layzr.js/1.2.2/layzr.min.js
files/layzr.js/1.2.2/layzr.min.js
!function(t,i){"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?module.exports=i():t.Layzr=i()}(this,function(){"use strict";function t(t){this._lastScroll=0,this._ticking=!1,t=t||{},this._optionsSelector=t.selector||"[data-layzr]",this._optionsAttr=t.attr||"data-layzr",this._optionsAttrRetin...
Update project layzr.js to 1.2.2
Update project layzr.js to 1.2.2
JavaScript
mit
RoberMac/jsdelivr,justincy/jsdelivr,alexmojaki/jsdelivr,cake654326/jsdelivr,ndamofli/jsdelivr,ajibolam/jsdelivr,ajibolam/jsdelivr,afghanistanyn/jsdelivr,CTres/jsdelivr,justincy/jsdelivr,Metrakit/jsdelivr,wallin/jsdelivr,markcarver/jsdelivr,dpellier/jsdelivr,Swatinem/jsdelivr,Sneezry/jsdelivr,cognitom/jsdelivr,megawac/j...
de57019a64d2ced61f3bdb9dd21a973adf8f0a21
updates/0.0.1-list_recommended-family-constellations.js
updates/0.0.1-list_recommended-family-constellations.js
exports.create = { 'Recommended Family Constellation': [{ familyConstellation: '2-parent (male and female)' }, { familyConstellation: '2-parent (females)' }, { familyConstellation: '2-parent (males)' }, { familyConstellation: 'Single Parent (female)' }, { familyConstellation: 'Single Parent (male)' }...
Create script to automatically create the list for Recommended Family Constellations.
Create script to automatically create the list for Recommended Family Constellations.
JavaScript
mit
autoboxer/MARE,autoboxer/MARE
c8371e2b7e45b64b5b1aef195b3de0d21b75540a
migrations/20200221232549-add-index-to-event-datetime.js
migrations/20200221232549-add-index-to-event-datetime.js
'use strict'; module.exports = { up: async queryInterface => { await queryInterface.sequelize.query( `CREATE INDEX events_datetime ON "Events" ("dateTime");` ); }, down: async queryInterface => { await queryInterface.sequelize.query( `DROP INDEX events_datetime;` ); } };
Add database migration to add an index to event dateTime field, to speed up reporting queries that generate CSV files.
Add database migration to add an index to event dateTime field, to speed up reporting queries that generate CSV files.
JavaScript
agpl-3.0
TheCacophonyProject/Full_Noise
1e2d200c76f51dc6963dde639f91af31887c62c9
Gruntfile.js
Gruntfile.js
'use strict'; module.exports = function (grunt) { // Load external grunt task config. grunt.loadTasks('./grunt'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-jscs'); grunt.initConfig({ config: { files: { lint: [ ...
Add grunt file containing a lint task.
Add grunt file containing a lint task.
JavaScript
mit
incuna/djangular-rest-framework,incuna/djangular-rest-framework
0423a4405b5be5381f0fb7e4cd56a3bdd945afac
jupyter-spark/extensions/spark.js
jupyter-spark/extensions/spark.js
define(function () { var show_running_jobs = function() { var element = 'fffffffff'; var modal = Jupyter.dialog.modal({ title: "Running Spark Jobs", body: element, buttons: { "Close": {} } }); modal.addClass("m...
Create modal that opens on keyboard shortcut "Alt-S".
Create modal that opens on keyboard shortcut "Alt-S".
JavaScript
mpl-2.0
mreid-moz/jupyter-spark,mreid-moz/jupyter-spark
5e7ee92ba760f0a014852b44ca603de0cf33103b
lib/router.js
lib/router.js
;(function(riot, evt) { // browsers only if (!this.top) return var loc = location, fns = riot.observable(), win = window, current function hash() { return loc.hash.slice(1) } function parser(path) { return path.split('/') } function emit(path) { if (path.type) path = ...
;(function(riot, evt) { // browsers only if (!this.top) return var loc = location, fns = riot.observable(), win = window, current function hash() { return loc.href.split('#')[1] || '' } function parser(path) { return path.split('/') } function emit(path) { if (path.ty...
Use location.href to extract hash
Use location.href to extract hash There is a bug in firefox which means that location.hash contains the decoded URL. e.g if the url is xxx.com/#link/http%3A%2Fwhy.com Then: location.hash will be: #link/http://why.com and location.href will be: xxx.com/#link/http%3A%2Fwhy.com So location.href contains...
JavaScript
mit
laomu1988/riot,davidmarkclements/riot,davidmarkclements/riot,dschnare/riot,marcioj/riot,xieyu33333/riot,xieyu33333/riot,GerHobbelt/riotjs,marciojcoelho/riotjs,ListnPlay/riotjs,scalabl3/riot,ListnPlay/riotjs,dp-lewis/riot,xtity/riot,tao-zeng/riot,scalabl3/riot,duongphuhiep/riot,rsbondi/riotjs,muut/riotjs,ttamminen/riotj...
9120504c07a69506831f3264dd3b244411fd2ebd
Queue/index.js
Queue/index.js
function Queue() { this._oldestIndex = 1; this._newestIndex = 1; this._storage = {}; } Queue.prototype.size = function() { return this._newestIndex - this._oldestIndex; }; Queue.prototype.enqueue = function(data) { this._storage[this._newestIndex] = data; this._newestIndex++; }; Queue.prototype.dequeue =...
Add Queue, and rename files
Add Queue, and rename files
JavaScript
mit
jazlalli/data-structure-playground
cfb735bf738443de1d868435e55758e6a1cf3c62
udata/migrations/2019-07-23-reversed-date-range.js
udata/migrations/2019-07-23-reversed-date-range.js
/** * Swap reversed DateRange values */ var updated = 0; // Match all Dataset having temporal_coverage.start > temporal_coverage.end const pipeline = [ {$project: { cmp: {$cmp: ['$temporal_coverage.start', '$temporal_coverage.end']}, obj: '$$ROOT' }}, {$match: {cmp: {$gt: 0}}}, {$rep...
Fix existing dataset with reversed temporal coverage (migration)
Fix existing dataset with reversed temporal coverage (migration)
JavaScript
agpl-3.0
opendatateam/udata,etalab/udata,etalab/udata,etalab/udata,opendatateam/udata,opendatateam/udata
7613c87332c207db7cfd0809c1695ed991a89fc5
file-system/watcher-spawn.js
file-system/watcher-spawn.js
'use strict'; // In the curernt version of JavaScript, one **cannot** 'use strict' with const // declarations // Import the fs (file system) module. // "Require" returns an object: the module being required. // By declaring it const fs = require('fs'); // Import the child_process module; however, only get a single f...
Add file watcher that spawns a new process.
Add file watcher that spawns a new process. Add a file watcher process that spawns an operating system process, captures its output and pipes that output to the standard output of the node process running the file watcher script.
JavaScript
mit
mrwizard82d1/node-js-the-right-way
5826f84bf22d136fa4eede515b7511f4e566fd4a
child_process/handle_error.js
child_process/handle_error.js
/* If the child process fails, print the error. */ const {exec} = require('child_process') proc = exec('python count.py abc', (error, stdout, stderr) => { if (error) { console.log('Error:', error) } console.log(stdout) })
Add example that prints the error from a child process
Add example that prints the error from a child process
JavaScript
apache-2.0
feihong/node-examples,feihong/node-examples
3245e5defcce51139b0d30cc4956b5520708d068
week-7/variables-objects.js
week-7/variables-objects.js
// JavaScript Variables and Objects // I paired [by myself] on this challenge. // __________________________________________ // Write your code below. var secretNumber = 7; var password = "just open the door"; var allowedIn = false; var members = ["John", "Kate", "Joe", "Mary"]; // ________________________________...
Add variables objects solution to match test code
Add variables objects solution to match test code
JavaScript
mit
michaelzwang/phase-0,michaelzwang/phase-0,michaelzwang/phase-0
7041c7958b3b8a8354300b76ef1e5716d67de2d4
src/lib/SpreadSheet.spec.js
src/lib/SpreadSheet.spec.js
import { SpreadSheet } from './SpreadSheet'; import { Row, Cell } from './models'; import { parseCommand } from './models'; describe('SpreadSheet', () => { const cells = [ new Cell(0, 'A', 0), new Cell(1, 'A', 5), new Cell(2, 'A', 10) ]; const rows = [ new Row('A', cells) ]; const spreadShee...
Add tests for SpreadSheet eval
Add tests for SpreadSheet eval
JavaScript
mit
schultyy/spreadsheet,schultyy/spreadsheet
a66bd438086607e141616769368eae3c799d70a5
lib/utilities.js
lib/utilities.js
'use strict'; /** * Convert a string to camel case. * * @param {String} string - The string. * @return {String} */ function camelCase(string) { if (typeof string !== 'string') { throw new Error('`camelCase`: first argument must be a string.'); } // hyphen found after first character if (...
Create utility helper for camel casing text with hyphens
Create utility helper for camel casing text with hyphens This helper will be used when converting CSS styles to JS objects. Then the `style` object will be consistent in the React props.
JavaScript
mit
remarkablemark/html-react-parser,remarkablemark/html-react-parser,remarkablemark/html-react-parser
70fc48b39ea70654f230899629da2339c63606d4
src/concat/index.js
src/concat/index.js
var FileType = require('../file').type; /** * @param {Array<Object>} files * @param {string} fileType */ function concat(files, fileType) { var code = []; files.forEach(function(file) { switch (fileType) { case FileType.CSS: code.push(file.code); ...
Add simple module for concatting code.
Add simple module for concatting code.
JavaScript
bsd-3-clause
ZocDoc/Bundler,ZocDoc/Bundler
5ae4b4f4b0fbef750a0f897c05c3dca5c1d8454f
src/tasks/load-model-files.js
src/tasks/load-model-files.js
var path = require('path'), vow = require('vow'), inherit = require('inherit'), fsExtra = require('fs-extra'), Base = require('./base'); module.exports = inherit(Base, { logger: undefined, __constructor: function (baseConfig, taskConfig) { this.__base(baseConfig, taskConfig); ...
Implement task for loading model files
Implement task for loading model files
JavaScript
mpl-2.0
bem-site/builder-core,bem-site/gorshochek
630e5319af9242035b66df3dba9714604f7a058f
scripts/process-all-records.js
scripts/process-all-records.js
var jobs = require('../server/kue').jobs; var mongoose = require('../server/mongoose'); var Record = mongoose.model('Record'); var count = 0; Record .find() .select({ identifier: 1, parentCatalog: 1 }) .lean() .stream() .on('data', function (record) { count++; jobs .cr...
Add script to process all records again
Add script to process all records again
JavaScript
agpl-3.0
jdesboeufs/geogw,inspireteam/geogw
5ce37602b361f4ed79d4354b998f0ae1d99a18bf
test/functional/ios/testapp/keyboard-specs.js
test/functional/ios/testapp/keyboard-specs.js
"use strict"; var setup = require("../../common/setup-base") , desired = require('./desired') , _ = require('underscore'); describe("testapp - keyboard stability @skip-ci", function () { var runs = 10 , text = 'Delhi is New @@@ QA-BREAKFAST-FOOD-0001'; var driver; setup(this, _.defaults({ deviceNa...
Add stability test for iOS keyboard
Add stability test for iOS keyboard
JavaScript
apache-2.0
appium/appium,appium/appium,appium/appium,appium/appium,appium/appium,Sw0rdstream/appium,appium/appium
71b4aecaabd67943c58a2fa62f03f10b21bc9b63
index.js
index.js
const http = require('http') const parseString = require('xml2js').parseString const nfl = { hostname: 'www.nfl.com', path: '/liveupdate/scorestrip/ss.xml', method: 'GET' } const getGames = function getGames(xml) { let games parseString(xml.join(''), (err, data) => { if (err) return console.error(err) ...
Add random team select script
Add random team select script This script will randomly select a team from the current season's, week's set of matches. Not sure if the XML will get updated as the season goes along. Will update if changes are needed.
JavaScript
mit
yuleugim/nfld16
3c6bec39f84dd8aa6424483a2d819420d0e2e785
bundle.js
bundle.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.ex...
Create a dist file with browserify
Create a dist file with browserify
JavaScript
mit
jollyra/tiles,jollyra/tiles
429fa904d86ee4c6963a331b6a73ca70d15c4605
bin/tap-reader.js
bin/tap-reader.js
#!/usr/bin/env node // read a tap stream from stdin. var TapConsumer = require("../lib/tap-consumer") , TapStream = require("../lib/tap-stream") var tc = new TapConsumer , ts = new TapStream(!process.env.nodiag) //process.stdin.pipe(tc) process.stdin.on("data", function (c) { c = c + "" // console.error(JSO...
Read tap output from stdin, to test parsing
Read tap output from stdin, to test parsing
JavaScript
isc
iarna/node-tap,tapjs/node-tap,isaacs/node-tap,myndzi/node-tap,evanlucas/node-tap,myndzi/node-tap,jkrems/node-tap,Raynos/node-tap,Dignifiedquire/node-tap-core,evanlucas/node-tap,strongloop-forks/node-tap,iarna/node-tap,jondlm/node-tap,isaacs/node-tap,tapjs/node-tap,strongloop-forks/node-tap,jinivo/marhert,jondlm/node-ta...
25c32481177b8055a7c746b38d094efd5ab8e3a7
test/test-util.js
test/test-util.js
/*globals suite, test, setup, teardown */ var sutil = require('sake/util'); suite('sake.util', function () { test('fileFromStackTrace', function () { sutil.fileFromStackTrace().should.equal(__filename); }); test('directoryFromStackTrace', function () { sutil.directoryFromStackTrace()...
Add test file for stack trace functions.
Add test file for stack trace functions.
JavaScript
mit
jhamlet/node-sake
b31d1b6e1e0eb033d9b7165e2c476fdfdadf7591
scripts/managedb/swap_coords.js
scripts/managedb/swap_coords.js
/* # Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either ver...
ADD script for swapping coordinates in entities collection
ADD script for swapping coordinates in entities collection
JavaScript
agpl-3.0
McMutton/fiware-orion,gavioto/fiware-orion,fortizc/fiware-orion,gavioto/fiware-orion,telefonicaid/fiware-orion,j1fig/fiware-orion,Fiware/data.Orion,j1fig/fiware-orion,jmcanterafonseca/fiware-orion,pacificIT/fiware-orion,jmcanterafonseca/fiware-orion,fiwareulpgcmirror/fiware-orion,Fiware/data.Orion,telefonicaid/fiware-o...
a1f23b243a855a9cae37edaaa5ed2a2c62c50072
webpack.config.js
webpack.config.js
const path = require('path'); module.exports = { resolve: { modules: [ __dirname + '/scripts', path.resolve(__dirname, "./node_modules") ] } };
Resolve import for modules in ‘scripts’ directory
Resolve import for modules in ‘scripts’ directory
JavaScript
apache-2.0
weepower/wee-core
8adde8004e6986a919fc26e1df2c72bddc55077b
test/actions/editor_test.js
test/actions/editor_test.js
import { expect, isFSA, isFSAName } from '../spec_helper' import * as subject from '../../src/actions/editor' describe('editor actions', () => { context('#setIsCompleterActive', () => { const action = subject.setIsCompleterActive({ isActive: true }) it('is an FSA compliant action', () => { expect(isFS...
Add tests around the new updated editor actions
Add tests around the new updated editor actions
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
a19c5e3daf7cc6b81f410c5780b9eff24df70b00
test/unit/ngGravatarTest.js
test/unit/ngGravatarTest.js
var chai = require('chai'); var sinon = require('sinon'); var sinonChai = require("sinon-chai"); var ngGravatar = require('../../src/ngGravatar'); chai.should(); chai.use(sinonChai); describe('ngGravatar', function() { var gravatarDirective; beforeEach(function() { gravatarDirective = ngGravatar(); ...
Add simple test for gravatar directive
Add simple test for gravatar directive
JavaScript
mit
Spidy88/ngGravatar
eb2454acd11b656a16813a1bdbc7e6257d5d486f
core/model/formats/bibtexmisc.js
core/model/formats/bibtexmisc.js
'use strict'; require('../../../utils/array'); /** * @module bibTex Misc Entry Formatter * Module for formatting source data into a bibTeX misc type entry */ module.exports = { /** * Formats a source data object to a citation * @param {SourceData} sourceData - The SourceData object to generate the citation...
Set up initial bibtex misc style formatter
Set up initial bibtex misc style formatter
JavaScript
mit
nokeeo/software-citation-tools,faokryn/software-citation-tools
fb969ac6c3ebd2dd62897c3cbb34222a08e09655
src/io.js
src/io.js
/* IO monad taken from monet.js */ /* The MIT License (MIT) Copyright (c) 2016 Chris Myers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ri...
Add IO monad from monet.js
Add IO monad from monet.js but make it more es6-like
JavaScript
mit
memee/reactive-charts
5dbd7c1c09c05fa122d53ca3060b565af75b54d7
lib/properties.es6.js
lib/properties.es6.js
/** * @license * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requir...
Add missing properties module (required by Hook and PubHook)
Add missing properties module (required by Hook and PubHook)
JavaScript
apache-2.0
mdittmer/smw,mdittmer/smw,mdittmer/smw
d0d1827193fbcb37d9315adddf3000f4d0037a75
controllers/helpers/docHelper.js
controllers/helpers/docHelper.js
const docHelper = { checkDocDetails: (req, res) => { let document = req.body; if (!(document.title && document.content && document.access)) { res.status(400) .json({ success: false, message: 'All fields must be filled' }); res.end(); return true; } }...
Add document helper file for document controller
Add document helper file for document controller
JavaScript
mit
andela-oolutola/document-management-system-api
25955ef55a3086c37c8e6fa6590abb4b3bd80da6
Workspace/Project/utility.js
Workspace/Project/utility.js
module.exports = { move: function(arr, old_index, new_index) { while (old_index < 0) old_index += arr.length; while (new_index < 0) new_index += arr.length if (new_index >= arr.length) { var k = new_index - arr.length while ((k--) + 1) arr.push(undefined) } arr.spli...
Add Object Compare Check and Element Change Position in Array
Add Object Compare Check and Element Change Position in Array
JavaScript
mit
MrWooJ/WJChipDesign,MrWooJ/WJChipDesign
c99512ea8181d4020de2d1adc45612a70ddce91d
files/bootstrap.hover-dropdown/2.1.3/bootstrap-hover-dropdown.min.js
files/bootstrap.hover-dropdown/2.1.3/bootstrap-hover-dropdown.min.js
/** * @preserve * Project: Bootstrap Hover Dropdown * Author: Cameron Spear * Version: v2.1.3 * Contributors: Mattia Larentis * Dependencies: Bootstrap's Dropdown plugin, jQuery * Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience. * License: MIT * ...
Update project bootstrap-hover-dropdown to v2.1.3
Update project bootstrap-hover-dropdown to v2.1.3
JavaScript
mit
anilanar/jsdelivr,MenZil/jsdelivr,dnbard/jsdelivr,siscia/jsdelivr,tunnckoCore/jsdelivr,Swatinem/jsdelivr,photonstorm/jsdelivr,cognitom/jsdelivr,anilanar/jsdelivr,yyx990803/jsdelivr,vousk/jsdelivr,garrypolley/jsdelivr,labsvisual/jsdelivr,dpellier/jsdelivr,siscia/jsdelivr,anilanar/jsdelivr,Sneezry/jsdelivr,ajibolam/jsdel...
185f131d51470073e4656122276c7d8a561ef3a5
src/utils/get-scripts.js
src/utils/get-scripts.js
import fs from 'fs'; import path from 'path'; import yaml from 'js-yaml'; const scriptCache = {}; function getCacheOrFile(key, fn) { if (scriptCache[key]) { return scriptCache[key]; } const value = fn(); scriptCache[key] = value; return value; } const travisCommands = [ // Reference: http://docs.tr...
import fs from 'fs'; import path from 'path'; import yaml from 'js-yaml'; const scriptCache = {}; function getCacheOrFile(key, fn) { if (scriptCache[key]) { return scriptCache[key]; } const value = fn(); scriptCache[key] = value; return value; } const travisCommands = [ // Reference: http://docs.tr...
Fix a bug in getScript utility.
Fix a bug in getScript utility. - Should not extract script from deploy section.
JavaScript
mit
depcheck/depcheck,depcheck/depcheck
7d5d37e7477c4a41e264d583158d759ad851b201
patchDedupe.js
patchDedupe.js
var through = require("through2"); exports.patch = function (Browserify) { Browserify.prototype._dedupe = function () { return through.obj(function (row, enc, next) { if (!row.dedupeIndex && row.dedupe) { // PATCH IS AS SIMPLE AS NOT DOING THE FOLLOWING: /* ...
Add monkey patch for _dedupe.
Add monkey patch for _dedupe.
JavaScript
mit
YuzuJS/browserify-dedupe-patch
6793f01abdbd91e6b8918504145e616ffa05f727
week-7/group_project_solution.js
week-7/group_project_solution.js
// PERSON 5 // Refactored code: // Simplified variable names and sum. function sum(array){ // This works thanks to ECMAScript 6! var total = array.reduce((a, b) => a + b, 0); return total; } // Got rid of total_sum variable. function mean(array){ var average = sum(array) / array.length; return average; }...
Add 7.8 JS Telephone file
Add 7.8 JS Telephone file
JavaScript
mit
Rinthm/phase-0,Rinthm/phase-0,Rinthm/phase-0
fb9ac1e15ab745af5cc79ad5c06a91be49760ed7
src/components/events/DetailSpec.js
src/components/events/DetailSpec.js
import { shallow, createLocalVue } from '@vue/test-utils'; import Vuex from 'vuex'; import Detail from './Detail.vue'; const localVue = createLocalVue(); localVue.use(Vuex); describe('Event Detail.vue', () => { let wrapper, getters, store; beforeEach(() => { getters = { isAdmin: () => true } ...
Test to catch compile issues
Test to catch compile issues
JavaScript
mit
dmurtari/mbu-frontend,dmurtari/mbu-frontend
9ef27994b8fab189390e473ccd8ed59ca15281c1
server/startup/migrations/v060.js
server/startup/migrations/v060.js
RocketChat.Migrations.add({ version: 60, up: function() { let subscriptions = RocketChat.models.Subscriptions.find({ $or: [ { name: { $exists: 0 } }, { name: { $not: { $type: 2 } } } ] }).fetch(); if (subscriptions && subscriptions.length > 0) { RocketChat.models.Subscriptions.remove({ _id: { $in: _.pluck(subs...
Add migration to remove invalid subscriptions
Add migration to remove invalid subscriptions
JavaScript
mit
Achaikos/Rocket.Chat,ahmadassaf/Rocket.Chat,Gyubin/Rocket.Chat,4thParty/Rocket.Chat,BorntraegerMarc/Rocket.Chat,alexbrazier/Rocket.Chat,abduljanjua/TheHub,snaiperskaya96/Rocket.Chat,mwharrison/Rocket.Chat,ealbers/Rocket.Chat,NMandapaty/Rocket.Chat,ealbers/Rocket.Chat,Movile/Rocket.Chat,matthewshirley/Rocket.Chat,AlecTr...
ea67a765efd1145cc6f9df34ce7d7b6a0c0f12a5
models/county.js
models/county.js
'use strict'; module.exports = (sequelize, DataTypes) => { const county = sequelize.define('county', { name: DataTypes.STRING(64) // eslint-disable-line no-magic-numbers }, { timestamps: false, classMethods: { associate: (models) => { county.hasMany(models.temp); } } }); ret...
Rename of the area model
Rename of the area model
JavaScript
mit
NewEvolution/thermostats,NewEvolution/thermostats
2472cec57936a2d8820f5e047b7f9520a7cf5d3c
components/ClickablePath.js
components/ClickablePath.js
import React, { Component } from 'react'; import { TouchableOpacity, Image, View } from 'react-native'; import styles from './styles/ClickablePathStyle'; import PropTypes from 'prop-types'; import { StackNagivator } from 'react-navigation'; export default class ClickablePath extends Component { static propTypes = { ...
Add separate clickable image for paths
Add separate clickable image for paths
JavaScript
mit
fridl8/cold-bacon-client,fridl8/cold-bacon-client,fridl8/cold-bacon-client
52a9aa355a2c931d96f3f3d9a5ad483e94a95cf4
geoportailv3/static/js/statemanagerservice.js
geoportailv3/static/js/statemanagerservice.js
/** * @fileoverview This files provides a service for managing application * states. States are written to both the URL (through the ngeoLocation * service) and the local storage. */ goog.provide('app.StateManager'); goog.require('app'); goog.require('goog.asserts'); goog.require('goog.math'); goog.require('goog.s...
Add a state manager service
Add a state manager service
JavaScript
mit
Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,geoportallux/geoportailv3-gisgr,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,geoportallux/geoportailv3-gisgr,geoportallux/geoportailv3-gisgr,geoportallux/geoportailv3-gisgr
40ae6817fa0314ebd3f249965876c9a7b18056a9
static/js/loadall.js
static/js/loadall.js
// ready() functions executed after everything else. // Mainly for widget layout $(function() { $(window).resize(function(event) { layoutWidgets(); }); layoutWidgets(); $(window).trigger("resize"); $("#workspace").invalidateLayout = function(event) { layoutWidgets(); ...
Add specific JS to run after everything else has loaded, mainly for widget layout.
Add specific JS to run after everything else has loaded, mainly for widget layout.
JavaScript
apache-2.0
vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium
c5a39025eb85c99f3a14e522b7e3411e3336ce7d
lib/rules/split-platform-components.js
lib/rules/split-platform-components.js
/** * @fileoverview Android and IOS components should be * used in platform specific React Native components. * @author Tom Hastjarjanto */ 'use strict'; module.exports = function(context) { var reactComponents = []; var androidMessage = 'Android components should be placed in android files'; var iosMessage...
Add initial implementation to force seperation of platform specific components
Add initial implementation to force seperation of platform specific components
JavaScript
mit
Intellicode/eslint-plugin-react-native
c51db7e3983d631228cd39f2ee6ac1d840104e28
doubly-linked-list.js
doubly-linked-list.js
"use strict"; // DOUBLY-LINKED LIST // define constructor function Node(val) { this.data = val; this.previous = null; this.next = null; }
Define constructor for doubly linked list
Define constructor for doubly linked list
JavaScript
mit
derekmpham/interview-prep,derekmpham/interview-prep
988347f27393de2cd643c29aad772d13df170189
shared/util/typed-connect.js
shared/util/typed-connect.js
// @flow import {Component} from 'react' import {connect} from 'react-redux' type TypedMergeProps<State, Dispatch, OwnProps, Props> = (state: State, dispatch: Dispatch, ownProps: OwnProps) => Props export class ConnectedComponent<OwnProps> extends Component<void, OwnProps, void> {} export default function typedConn...
Add typedConnect to let smart components in on the action
Add typedConnect to let smart components in on the action
JavaScript
bsd-3-clause
keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client
ec3dc4a2824e31bcb526d7873045efaa638b7f5f
migrations/20141007112548-uniqueromvariants.js
migrations/20141007112548-uniqueromvariants.js
module.exports = { up: function(migration, DataTypes, done) { migration.removeIndex('Incrementals', 'Incrementals_UniqueFilePerDirectory'); migration.addIndex( 'Incrementals', [ 'RomVariantId', 'filename' ], { indexName: 'Incrementals_UniqueFilePerRomVariant', indicesType: 'UNIQUE', } ); ...
Add a unique index for the rom variant.
Add a unique index for the rom variant.
JavaScript
mit
xdarklight/cm-update-server,xdarklight/cm-update-server,TheNameIsNigel/cm-update-server,TheNameIsNigel/cm-update-server
68d195f515efc4aab1fa9bcc69f4df151c886d17
generators/REACT_SCRIPTS/template/.storybook/config.js
generators/REACT_SCRIPTS/template/.storybook/config.js
import { configure } from '@kadira/storybook'; import '../src/index.css'; function loadStories() { require('../src/stories'); } configure(loadStories, module);
import { configure } from '@kadira/storybook'; function loadStories() { require('../src/stories'); } configure(loadStories, module);
Remove index.css import for CRA based apps.
Remove index.css import for CRA based apps.
JavaScript
mit
enjoylife/storybook,rhalff/storybook,enjoylife/storybook,storybooks/react-storybook,nfl/react-storybook,shilman/storybook,storybooks/storybook,nfl/react-storybook,jribeiro/storybook,kadirahq/react-storybook,bigassdragon/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,jribeiro/storybook,bi...
945a11ece943e8d4bde889b297905a88150eef78
utils/seed_test_cases.js
utils/seed_test_cases.js
var str = "["; for (var seedVal = 0; seedVal < 256; seedVal++) { var a = -3969392806; var b = -1780940711; var c = -1021952437; var d = 255990488; var e = -651539848; var f = -1525007287; var g = -990909925; var h = 811634969; var results = []; for (var i = 0; i < 256; i++) { results[i] = see...
Create script for getting seed test cases
Create script for getting seed test cases
JavaScript
mit
Jameskmonger/isaac-crypto
e99435374eb3b53bf5e1e88226976a0aacefc7f8
remove-the-minimum.js
remove-the-minimum.js
// https://www.codewars.com/kata/remove-the-minimum const removeSmallest = numbers => { const smallest = Math.min(...numbers); const smallestIndex = numbers.findIndex(number => number === smallest); const result = [...numbers]; result.splice(smallestIndex, 1); return result; };
Add solution for "remove the minimum"
Add solution for "remove the minimum"
JavaScript
mit
jonathanweiss/codewars
cb0bea819f71afa4f01e8856e252c17aa177c1d9
17/amqp-broadcast-bind.js
17/amqp-broadcast-bind.js
var amqp = require('amqp'); var connection = amqp.createConnection({ host: 'localhost' }); connection.on('ready', function () { connection.exchange('broadcast', { type: 'fanout', autoDelete: false }, function(exchange) { connection.queue('tmp-' + Math.random, { exclusive: true }, function(q) ...
Add the example to subscribe the broadcast via amqp.
Add the example to subscribe the broadcast via amqp.
JavaScript
mit
nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference
0ee01508243586e88b56b32f7089a00ce8eca4cc
app/assets/javascripts/factoid.js
app/assets/javascripts/factoid.js
$(document).ready(function(){ $("body").on("click", "#new-facts button", function(event){ event.preventDefault(); $.ajax({ url: "/factoids", type: "get" }).done(function(resp){ $("#factoid-display").empty().append(resp); }).fail(function(respo){ console.log(Error("Couldn't re...
Write ajax call for new facts.
Write ajax call for new facts.
JavaScript
mit
lukert33/about_luke_thomas,lukert33/about_luke_thomas,lukert33/about_luke_thomas
92fafb2e0ee21222aba97084998ac1ca8ef38c6f
server/node-server.js
server/node-server.js
var express = require('express'); var app = express(); var path = __dirname + ''; var port = 8080; app.use(express.static(path)); app.get('*', function(req, res) { res.sendFile(path + '/index.html'); }); app.listen(port);
Add custom Node.js server written with Express.
Add custom Node.js server written with Express.
JavaScript
mit
emc-mongoose/console,emc-mongoose/console,emc-mongoose/console
60b69b21c56edffe45e60e9cb8ab4d1bff7f1726
7/archiver-zip-bulk.js
7/archiver-zip-bulk.js
var fs = require('fs'); var archiver = require('archiver'); var output = fs.createWriteStream('output.zip'); output.on('close', function() { console.log('Done'); }); var archive = archiver('zip'); archive.on('error', function(err) { throw err; }); archive.pipe(output); archive.bulk([ { expand: true, cwd...
Add the example to create a zip file with multiple files by archiver.
Add the example to create a zip file with multiple files by archiver.
JavaScript
mit
nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference
39d080cfca62991c5f57de38a77bd30c61bbabb0
corehq/couchapps/exports_forms/views/attachments/map.js
corehq/couchapps/exports_forms/views/attachments/map.js
function (doc) { var media = 0, attachments = {}, value; if (doc.doc_type === "XFormInstance") { if (doc.xmlns) { for (var key in doc._attachments) { if (doc._attachments.hasOwnProperty(key) && doc._attachments[key].content_type !== "text/xml") { ...
Add couch view for attachments
Add couch view for attachments
JavaScript
bsd-3-clause
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
70b7c22e48a21079a379ced7d895d489fc96e65d
Greasemonkey/apple-documentation.user.js
Greasemonkey/apple-documentation.user.js
// ==UserScript== // @name Apple documentation class link // @namespace https://franklinyu.github.io/ // @version 0.1 // @description create link for classes in code segments // @author Franklin Yu // @include https://developer.apple.com/reference/* // @grant none // ==/UserScript== ...
Add script to help finding Apple documentation
Add script to help finding Apple documentation
JavaScript
mit
franklinyu/snippets,franklinyu/snippets,franklinyu/snippets
60995e57bc9e1b417693231f1818faf80feff641
src/es5.js
src/es5.js
var isES5 = (function(){ "use strict"; return this === void 0; })(); if (isES5) { module.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, keys: Object.keys, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5: isES5 ...
var isES5 = (function(){ "use strict"; return this === void 0; })(); if (isES5) { module.exports = { freeze: Object.freeze, defineProperty: Object.defineProperty, keys: Object.keys, getPrototypeOf: Object.getPrototypeOf, isArray: Array.isArray, isES5: isES5 ...
Change function defs to variable defs in block scope.
Change function defs to variable defs in block scope. Function definitions in blocks cause chrome to throw syntax error in strict mode.
JavaScript
mit
alubbe/bluebird,xbenjii/bluebird,bjonica/bluebird,peterKaleta/bluebird,vladikoff/bluebird,code-monkeys/bluebird,sequelize/bluebird,davyengone/bluebird,kidaa/bluebird,janmeier/bluebird,timnew/bluebird,mdarveau/bluebird,bsiddiqui/bluebird,STRML/bluebird,code-monkeys/bluebird,wainage/bluebird,xdevelsistemas/bluebird,Wande...
86f58920fea9f9773c64fb598139a795ba4bc2cc
client/src/reducers/reducer_broadcast.js
client/src/reducers/reducer_broadcast.js
import {SAVE_BROADCAST} from '../actions/index'; export default function (state=[], action) { switch (action.type){ case SAVE_BROADCAST: return state.concat([action.payload.data]); } return state; }
Create reducer that listens to SAVE_BROADCAST actions.
Create reducer that listens to SAVE_BROADCAST actions.
JavaScript
mit
TeamDreamStream/GigRTC,AuggieH/GigRTC,kat09kat09/GigRTC,AuggieH/GigRTC,TeamDreamStream/GigRTC,kat09kat09/GigRTC
11a8b02e97884f77c8c1f9720acc64dd9026e503
test/util/content-disposition.js
test/util/content-disposition.js
var assert = require('assert'); var contentDisposition = require('../../lib/util/content-disposition'); describe('contentDisposition', function() { it('returns attachment for no file name', function() { assert.equal(contentDisposition(), 'attachment'); }); it('returns file name', function() { ...
Add full coverage for contentDisposition utility
Add full coverage for contentDisposition utility
JavaScript
mit
itsananderson/molded
bbe6a5c7fd28324bf5ce8df345ac97e2182db570
packages/gatsby/src/cache-dir/register-service-worker.js
packages/gatsby/src/cache-dir/register-service-worker.js
import emitter from "./emitter" if (`serviceWorker` in navigator) { navigator.serviceWorker .register(`sw.js`) .then(function(reg) { reg.addEventListener(`updatefound`, () => { // The updatefound event implies that reg.installing is set; see // https://w3c.github.io/ServiceWorker/#servi...
import emitter from "./emitter" let pathPrefix = `/` if (__PREFIX_PATHS__) { pathPrefix = __PATH_PREFIX__ } if (`serviceWorker` in navigator) { navigator.serviceWorker .register(`${pathPrefix}sw.js`) .then(function(reg) { reg.addEventListener(`updatefound`, () => { // The updatefound event i...
Support path prefixes for service workers
Support path prefixes for service workers
JavaScript
mit
0x80/gatsby,gatsbyjs/gatsby,chiedo/gatsby,okcoker/gatsby,danielfarrell/gatsby,mingaldrichgan/gatsby,ChristopherBiscardi/gatsby,danielfarrell/gatsby,0x80/gatsby,gatsbyjs/gatsby,mingaldrichgan/gatsby,chiedo/gatsby,gatsbyjs/gatsby,ChristopherBiscardi/gatsby,mingaldrichgan/gatsby,ChristopherBiscardi/gatsby,fk/gatsby,daniel...
956a4c76ff90d4169d21f90b4ef6f1a33ed787bf
test/renderer/components/cell/cell_spec.js
test/renderer/components/cell/cell_spec.js
import React from 'react'; import {renderIntoDocument} from 'react-addons-test-utils'; import {expect} from 'chai'; import Cell from '../../../../src/notebook/components/cell/cell'; import * as commutable from 'commutable'; describe('Cell', () => { it('should be able to render a markdown cell', () => { const c...
Add tests for cell component
Add tests for cell component
JavaScript
bsd-3-clause
jdetle/nteract,nteract/nteract,jdfreder/nteract,temogen/nteract,jdetle/nteract,jdfreder/nteract,nteract/composition,rgbkrk/nteract,jdfreder/nteract,temogen/nteract,0u812/nteract,temogen/nteract,captainsafia/nteract,rgbkrk/nteract,nteract/nteract,nteract/nteract,nteract/composition,nteract/nteract,jdfreder/nteract,0u812...
21efb579e9ed5d925296dfa030afa487d4ce6fd2
spec/helpers/consolereporter.js
spec/helpers/consolereporter.js
var util = require('util'); var options = { showColors: true, print: function () { process.stdout.write(util.format.apply(this, arguments)); } }; jasmine.getEnv().addReporter(new jasmine.ConsoleReporter(options));
Fix jasmine has no output
Fix jasmine has no output
JavaScript
mit
jean343/Node-OpenMAX,jean343/Node-OMX,jean343/Node-OpenMAX,jean343/Node-OpenMAX,jean343/Node-OMX,jean343/Node-OpenMAX,jean343/Node-OMX,jean343/Node-OMX,jean343/Node-OMX,jean343/Node-OpenMAX,jean343/Node-OMX,jean343/Node-OpenMAX
a3b1e4c08b61db7cfb09ee82a085621ec19da8d1
modules/errors/errors.js
modules/errors/errors.js
/** * Meters the number of page errors, and provides traces after notices. */ exports.version = '0.1'; exports.module = function(phantomas) { var errors = []; phantomas.on('pageerror', function(msg, trace) { errors.push({"msg":msg, "trace":trace}); }); phantomas.on('report', function() { var len = errors....
Add a basic error reporting module.
Add a basic error reporting module.
JavaScript
bsd-2-clause
gmetais/phantomas,ingoclaro/phantomas,macbre/phantomas,william-p/phantomas,macbre/phantomas,ingoclaro/phantomas,gmetais/phantomas,ingoclaro/phantomas,william-p/phantomas,gmetais/phantomas,macbre/phantomas,william-p/phantomas
6ba99cb38f453499eb2cf84d0300f96f13584fd0
code/js/controllers/HoferLifeMusicController.js
code/js/controllers/HoferLifeMusicController.js
;(function() { "use strict"; var BaseController = require("BaseController"); new BaseController({ siteName: "LifeStoreFlat", play: ".player-play-button .icon-play-button", pause: ".player-play-button .icon-pause2", playNext: ".player-advance-button", playPrev: ".player-rewind-button", li...
;(function() { "use strict"; var BaseController = require("BaseController"); new BaseController({ siteName: "Hofer life music", play: ".player-play-button .icon-play-button", pause: ".player-play-button .icon-pause2", playNext: ".player-advance-button", playPrev: ".player-rewind-button", ...
Fix hofer life music Controller name
Fix hofer life music Controller name
JavaScript
mit
nemchik/streamkeys,nemchik/streamkeys,alexesprit/streamkeys,berrberr/streamkeys,ovcharik/streamkeys,berrberr/streamkeys,alexesprit/streamkeys,nemchik/streamkeys,ovcharik/streamkeys,berrberr/streamkeys
9de6aaaf8f14e1e91497a34012e8e46de519d7f4
Sources/Proxy/Core/LookupTableProxy/index.js
Sources/Proxy/Core/LookupTableProxy/index.js
import macro from 'vtk.js/Sources/macro'; import vtkColorMaps from 'vtk.js/Sources/Rendering/Core/ColorTransferFunction/ColorMaps'; import vtkColorTransferFunction from 'vtk.js/Sources/Rendering/Core/ColorTransferFunction'; const DEFAULT_PRESET_NAME = 'Cool to Warm'; // ----------------------------------------------...
Add proxy to manage LoookupTable with preset
fix(LookupTableProxy): Add proxy to manage LoookupTable with preset
JavaScript
bsd-3-clause
Kitware/vtk-js,Kitware/vtk-js,Kitware/vtk-js,Kitware/vtk-js
ccfc1237400f0f719e6e17f4372cce18cc0d7692
utils/streamHandler.js
utils/streamHandler.js
var Tweet = require('../models/Tweet'); var StreamHandler = function(stream, io) { // Whenever the stream handler passes new tweets... stream.on('data', function(data) { var tweet = { twid: data['id'], active: false, author: data['user']['name'], avatar: data['user']['profile_image_url'...
Add stream handler for saving new tweets and emitting data to the client
Add stream handler for saving new tweets and emitting data to the client
JavaScript
mit
thinkswan/react-twitter-stream,thinkswan/react-twitter-stream
b4aeabeeb81f14505416e0b0c4a5001f422044d2
test/tap/00-check-mock-dep.js
test/tap/00-check-mock-dep.js
console.log("TAP Version 13") process.on("uncaughtException", function(er) { console.log("not ok - Failed checking mock registry dep. Expect much fail!") console.log("1..1") process.exit(1) }) var assert = require("assert") var semver = require("semver") var mock = require("npm-registry-mock/package.json").vers...
Add test to verify npm-registry-mock version
test: Add test to verify npm-registry-mock version I keep getting myself into weird cases where I have an outdated copy of npm-registry-mock, and so tests fail, and I spend several minutes digging only to find that it's because I didn't update after the package.json dep changed. Add a test to alert to this situation,...
JavaScript
artistic-2.0
cchamberlain/npm,yibn2008/npm,lxe/npm,thomblake/npm,rsp/npm,thomblake/npm,Volune/npm,kimshinelove/naver-npm,TimeToogo/npm,DaveEmmerson/npm,segrey/npm,yodeyer/npm,Volune/npm,DIREKTSPEED-LTD/npm,misterbyrne/npm,cchamberlain/npm-msys2,haggholm/npm,ekmartin/npm,yibn2008/npm,yibn2008/npm,lxe/npm,cchamberlain/npm,kimshinelov...
edd9a17fd5d08514b54ce0450d82dbe055ba762b
mp3-stream.js
mp3-stream.js
var express = require('express'); var app = express(); var fs = require('fs'); app.listen(3000, function() { console.log("[NodeJS] Application Listening on Port 3000"); }); app.get('/api/play/:key', function(req, res) { var key = req.params.key; var music = 'music/' + key + '.mp3'; ...
Add mp3 file streaming example
Add mp3 file streaming example
JavaScript
mit
voidabhi/node-scripts,voidabhi/node-scripts,voidabhi/node-scripts
fd644a2e6881833fdbbc56c0451235f22b5f8aeb
test/karma.conf.js
test/karma.conf.js
module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath : '', // frameworks to use frameworks : [ 'mocha', 'sinon', 'chai-jquery', 'jquery-2.1.0', 'chai' ], // list of files / patterns to load in the browser...
Add karma file for browser tests
Add karma file for browser tests
JavaScript
mit
uplift/ExoSuit,uplift/ExoSuit
9dd1afd6966c5b53dcc7f98ab7caf92d328fdd29
test/index.js
test/index.js
const expect = require('expect'); const createProbot = require('..'); describe('Probot', () => { let probot; let event; beforeEach(() => { probot = createProbot(); probot.robot.auth = () => Promise.resolve({}); event = { event: 'push', payload: require('./fixtures/webhook/push') }; ...
Test for manually delivering events
Test for manually delivering events
JavaScript
isc
pholleran-org/probot,pholleran-org/probot,bkeepers/PRobot,probot/probot,pholleran-org/probot,probot/probot,probot/probot,bkeepers/PRobot
71156875e3af065137a620c918f042b9719a5aa9
mods/inverse/abilities.js
mods/inverse/abilities.js
exports.BattleAbilities = { arenatrap: { inherit: true, onFoeModifyPokemon: function(pokemon) { if (!pokemon.hasType('Flying') && pokemon.runImmunity('Ground', false)) { pokemon.tryTrap(); } }, onFoeMaybeTrapPokemon: function(pokemon) { if (!pokemon.hasType('Flying') && pokemon.runImmunity('Ground...
Fix Arena Trap on Inverse Battle Arena Trap still does not trap Flying-types on Inverse Battle.
Fix Arena Trap on Inverse Battle Arena Trap still does not trap Flying-types on Inverse Battle.
JavaScript
mit
yashagl/pokemon,Irraquated/Pokemon-Showdown,lFernanl/Pokemon-Showdown,gustavo515/batata,JennyPRO/Jenny,BlazingAura/Showdown-Boilerplate,SSJGVegito007/Vegito-s-Server,lAlejandro22/lolipoop,hayleysworld/serenityc9,DalleTest/Pokemon-Showdown,Elveman/RPCShowdownServer,Syurra/Pokemon-Showdown,comedianchameleon/servertest1,l...
1e84ec991a9d161f1e5d4fa4351d8a0d2562ec42
test/api-compiler-tests.js
test/api-compiler-tests.js
'use strict'; require('./patch-module'); require('marko/node-require').install(); var chai = require('chai'); chai.config.includeStack = true; var expect = require('chai').expect; var nodePath = require('path'); require('../compiler'); var autotest = require('./autotest'); var marko = require('../'); var markoCompile...
Test runner for `api-compiler` tests
Test runner for `api-compiler` tests
JavaScript
mit
marko-js/marko,marko-js/marko
a0811c7c3b685dbd94b8ad2cb463fdad97b67620
06/jjhampton-ch6-sequence-interface.js
06/jjhampton-ch6-sequence-interface.js
// Design an interface that abstracts iteration over a collection of values. An object that provides this interface represents a sequence, and the interface must somehow make it possible for code that uses such an object to iterate over the sequence, looking at the element values it is made up of and having some way to...
Add partial solution to sequence-interface exercise
Add partial solution to sequence-interface exercise Specify Sequence interface - define constructor, instance properties, and prototype methods. Also implement ArraySeq constructor that uses the Sequence interface.
JavaScript
mit
OperationCode/eloquent-js