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
de4a7ee9cb31e257a3fe5ceb494586b19a412ba2
src/v2/stories/Bookmarklet.stories.js
src/v2/stories/Bookmarklet.stories.js
import React from 'react' import { storiesOf } from '@storybook/react' import Specimen from 'v2/stories/__components__/Specimen' import Bookmarklet from 'v2/components/Bookmarklet/components/Blocks' storiesOf('Bookmarklet', module).add('Bookmarklet', () => ( <Specimen> <Bookmarklet /> </Specimen> ))
Add story for bookmarklet component
Add story for bookmarklet component
JavaScript
mit
aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell
d8b89e1d4bd4b6c0b58b3804f9b3502f9f80a5eb
ch02/fizz_buzz_2.js
ch02/fizz_buzz_2.js
/** * Created by larry on 8/28/16. */ for(var i = 1; i <= 100; i++) { if (i % 3 == 0 && i % 5 == 0) { console.log("FizzBuzz"); } else if (i % 3 == 0) { console.log("Fizz"); } else if (i % 5 == 0) { console.log("Buzz"); } else { console.log(i); } }
Write the second version of "Fizz Buzz."
Write the second version of "Fizz Buzz." This version handles all the cases in the actual game: * Print "FizzBuzz" if the value is evenly divisible by both 3 and 5 * Print "Fizz" if the value is evenly divisible by 3 * Print "Buzz" if the value is evenly divisble by 5 * Otherwise, print the value
JavaScript
apache-2.0
mrwizard82d1/eloquent-js
cb260529a8585a8a5e34ff7962602e560be08e39
app/actions/__tests__/tasks.js
app/actions/__tests__/tasks.js
import * as actions from '../tasks'; describe('Task Actions', () => { let defaultId, defaultTask; beforeEach(() => { defaultId = 'someUniqueId'; defaultTask = { id: 'someIdString', name: 'Some task name' }; }); it('ADD_TASK should return the obj...
Add test coverage for actions
Add test coverage for actions
JavaScript
mit
CarlaCrandall/DoItNow,CarlaCrandall/DoItNow,CarlaCrandall/DoItNow
ad3b613fc3eeb800a4c2a9d5f51d35debb9871c9
learning/javascript/TeamStats.js
learning/javascript/TeamStats.js
const team = { _players:[ { firstName: 'Cristiano', lastName: 'Ronaldo', age: 36 }, { firstName: 'Lionel', lastName: 'Messi', age:32 }, { firstName: 'Ice', lastName: 'Shi', ange:37 } ], _games:[ ...
Add project team stats on learning Object section
Add project team stats on learning Object section
JavaScript
apache-2.0
SpAiNiOr/mystudy,SpAiNiOr/mystudy,SpAiNiOr/mystudy
ad1dde3af5b710077ce07d450d92f86762b70da0
week-7/javascript_olympics.js
week-7/javascript_olympics.js
/* PEER PARING CHALLENGE 7.6: JAVASCRIPT OLYMPICS WE PAIRED ON THIS CHALLENGE: Becca Nelson & Lars Johnson THIS CHALLENGE TOOK US: ___ Hours */ // ########################################################### // WARM UP // ########################################################### // BULK UP // ########...
Create JS Olympics file for 7.6
Create JS Olympics file for 7.6
JavaScript
mit
larsjx/phase-0,larsjx/phase-0,larsjx/phase-0
41aa5f27916122de2f7f12f9a5916c08b1800649
flow-typed/npm/@storybook/addon-actions_v4.x.x.js
flow-typed/npm/@storybook/addon-actions_v4.x.x.js
// flow-typed signature: 824de8c4d861db90a6471d410d3df917 // flow-typed version: <<STUB>>/@storybook/addon-actions_v4.0.0/flow_v0.90.0 /** * This is an autogenerated libdef stub for: * * '@storybook/addon-actions' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you t...
Add types for @storybook/addon-actions package
Add types for @storybook/addon-actions package
JavaScript
mit
moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0
5bffa73605614b0250d047033621e9591ddc578c
webextensions/common/common.js
webextensions/common/common.js
'use strict'; var configs; function log(aMessage, ...aArgs) { if (!configs || !configs.debug) return; console.log('reload-on-idle: ' + aMessage, ...aArgs); }; function createFilter() { try { return new RegExp(configs.filter, 'i'); } catch (e) { log(`"${configs.filter}" is not a valid expression.`...
Define the data structure for addon settings.
WE: Define the data structure for addon settings. This is a straight-forward translation of the XPCOM-based configuration. (Few options are missing for compatibility reasons, though) See 'reload-on-idle/content/config.xul' for details.
JavaScript
mpl-2.0
clear-code/reload-on-idle,clear-code/reload-on-idle,clear-code/reload-on-idle
c126dd52a5993b29eed8c87b32a6699c648d0570
js/components/immutableComponent.js
js/components/immutableComponent.js
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = require('react') class ImmutableComponent extends React.Component { shouldComponentUpdate (nextPr...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = require('react') class ImmutableComponent extends React.Component { shouldComponentUpdate (nextPr...
Use nextProps for comparison not nextState
Use nextProps for comparison not nextState Auditors: da39a3ee5e6b4b0d3255bfef95601890afd80709@bridiver
JavaScript
mpl-2.0
MKuenzi/browser-laptop,timborden/browser-laptop,willy-b/browser-laptop,willy-b/browser-laptop,manninglucas/browser-laptop,timborden/browser-laptop,MKuenzi/browser-laptop,darkdh/browser-laptop,diasdavid/browser-laptop,diasdavid/browser-laptop,timborden/browser-laptop,darkdh/browser-laptop,Sh1d0w/browser-laptop,pmkary/br...
8bab3396c6e13326d8aba4e31adac88d4f310399
src/common/bootstrap/bootstrap.js
src/common/bootstrap/bootstrap.js
/** * Enhances the angular bootstrap directive to allow it to stay open when the * user clicks inside the menu. */ angular.module('ui.bootstrap.dropdownToggle', []).directive('dropdownToggleNoClose', ['$document', '$location', '$window', function ($document, $location, $window) { var openElement = null, cl...
Add a variation on the Angular UI Bootstrap code which keeps the dropdown open as long as the clicks are inside the menu
Add a variation on the Angular UI Bootstrap code which keeps the dropdown open as long as the clicks are inside the menu
JavaScript
bsd-3-clause
trestle-pm/trestle
8ee1550f8931410495e329d04a3b6bd71a462e1f
app/models/customer.server.model.js
app/models/customer.server.model.js
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Customer Schema */ var CustomerSchema = new Schema({ firstName: { type: String, default: '', trim: true }, surName: { type: String, default: '', trim: true }, suburb: { type: String,...
Update as Day 10 Customer Model
Update as Day 10 Customer Model
JavaScript
mit
cheshiret/myMeanProject,cheshiret/myMeanProject,cheshiret/myMeanProject
c0304dcb326316638c41c209b76409e1853a8230
test/browser/refs.js
test/browser/refs.js
import { h, render, Component } from '../../src/preact'; /** @jsx h */ describe('refs', () => { let scratch; before( () => { scratch = document.createElement('div'); (document.body || document.documentElement).appendChild(scratch); }); beforeEach( () => { scratch.innerHTML = ''; }); after( () => { scr...
Add tests for `ref` :)
Add tests for `ref` :)
JavaScript
mit
neeharv/preact,developit/preact,gogoyqj/preact,neeharv/preact,developit/preact
988174a6294ab863be2961267174901440100944
test/mjsunit/test-path.js
test/mjsunit/test-path.js
var path = require("path"); process.mixin(require("./common")); var f = __filename; assert.equal(path.basename(f), "test-path.js"); assert.equal(path.basename(f, ".js"), "test-path"); assert.equal(path.extname(f), ".js"); assert.equal(path.dirname(f).substr(-13), "/test/mjsunit"); path.exists(f, function (y) { assert...
Add tests for path module.
Add tests for path module.
JavaScript
apache-2.0
dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,isaacs/nshtools,dreamllq/node,dreamllq/node,dreamllq/node
5470155907b3c85417b63e92e7b2d9c7c04690fc
test/test-api-util-cache.js
test/test-api-util-cache.js
module.exports = { setUp: function (callback) { var path = require('path'); this.cache = require('../lib/utils/cache'); this.cache.init({ "path" : path.resolve(__dirname, "../") + "/cache" }); this.cacheKey = "test"; this.cacheValue = "{test:tefdsafsafdsa...
Create test file for cache.
Create test file for cache.
JavaScript
mit
Solid-Interactive/grasshopper-api-js,Solid-Interactive/grasshopper-api-js
1017054e95ecb84155c54102705f8570e0199a49
polygerrit-ui/app/types/polymer-behaviors.js
polygerrit-ui/app/types/polymer-behaviors.js
/** * @license * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
Add mock mixin for Polymer.IronFitBehavior
Add mock mixin for Polymer.IronFitBehavior Polymer.IronFitBehavior doesn't have a mixin and should be added to component using Polymer.mixinBehavior([Polymer.IronFitBehavior]). Polymer linter doesn't process this correctly. To workaround it the mock mixin was added. It will be used in JSDoc comments after conversion t...
JavaScript
apache-2.0
GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit
2060d39c9d2690095ce5520ea0cf25bad1015c70
lib/core/behaviour/physics.js
lib/core/behaviour/physics.js
/** * @module Joy.Behaviour */ (function(J) { /** * TODO: Wouldn't it be nice? */ var Physics = J.Behaviour.extend({ INIT: function (options) {}, UPDATE: function () {} }); J.Behaviour.Physics = Physics; })(Joy);
Add Physics placeholder. Planned to be implemented soon.
Add Physics placeholder. Planned to be implemented soon.
JavaScript
mit
royquintanar/joy.js,endel/joy.js,royquintanar/joy.js
6088dceecde8bd76c02bc3860b17e3d4ba932289
lib/linters/trailing_semicolon.js
lib/linters/trailing_semicolon.js
'use strict'; module.exports = { name: 'trailingSemicolon', nodeTypes: ['rule', 'atrule'], message: 'All property declarations should end with a semicolon.', lint: function trailingSemicolonLinter (config, node) { var others = 0; if (node.ruleWithoutBody || !node.nodes.length) { ...
'use strict'; module.exports = { name: 'trailingSemicolon', nodeTypes: ['rule', 'atrule'], message: 'All property declarations should end with a semicolon.', lint: function trailingSemicolonLinter (config, node) { var others = 0; if (node.ruleWithoutBody || (node.nodes && !node.nodes....
Add an extra safety check to trailingSemicolon
Add an extra safety check to trailingSemicolon
JavaScript
mit
JoshuaKGoldberg/lesshint,runarberg/lesshint,lesshint/lesshint
a45f169d1917b5e5275818142a9033cdcdd25766
rules/application_access_override.js
rules/application_access_override.js
function (user, context, callback) { // Applications that are restricted var MOCO_MOFO_APPS = ['phonebook.mozilla.com', 'phonebook-dev.mozilla.com', 'login.mozilla.com', 'passwordreset.mozilla.com']; // LDAP groups allowed to access these applications var ALLOWED_GROUPS = ['team_moco', 'team_mofo']; if (MOCO...
Add support for auth0-side application access restriction override This fails authentication for specific applications directly from auth0, instead of letting the application decide. Mainly used for applications that do not have proper OIDC or SAML support with authorization management capabilities.
Add support for auth0-side application access restriction override This fails authentication for specific applications directly from auth0, instead of letting the application decide. Mainly used for applications that do not have proper OIDC or SAML support with authorization management capabilities.
JavaScript
mpl-2.0
mozilla-iam/auth0-deploy,mozilla-iam/auth0-deploy,jdow/auth0-deploy,jdow/auth0-deploy,tristanweir/auth0-deploy,tristanweir/auth0-deploy
efdf64567548a52776c29f432911fce1a78a9bf5
test/in-view.offset.spec.js
test/in-view.offset.spec.js
import test from 'ava'; import inView from '../src/in-view'; test('inView.offset returns the offset', t => { t.true(inView.offset(50) === 50); }); test('inView.offset returns current offset if it doesn\'t receive a number', t => { t.true(inView.offset(10) === 10); t.true(inView.offset('foo') === 10); });
Add initial tests for inView.offset
Add initial tests for inView.offset
JavaScript
mit
kudago/in-view,camwiegert/in-view
6d435c7da8a100b1520d0aedbb1974f0f41ee84f
test/test-multiple-batch.js
test/test-multiple-batch.js
// test-multiple-batch.js -- Multiple calls to addBatch() // // Copyright 2016 fuzzy.ai <evan@fuzzy.ai> // // 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/lic...
Test for multiple addBatch() calls
Test for multiple addBatch() calls
JavaScript
apache-2.0
vowsjs/vows,fuzzy-ai/perjury
de3d1a3c4cfbabc50e24c4acad51822daa7476e8
fakehue/simplebutton.js
fakehue/simplebutton.js
var MeshbluSocketIO = require('meshblu'); var SerialPort = require('serialport'); var tinycolor = require('tinycolor2'); var cfg = require('./meshblu.json'); var serport = null; var meshblu = null; SerialPort.list(function (err, ports) { ports.forEach(function(port) { if (port.vendorId == '1B4F') { conso...
Add temporary simple LED button
Add temporary simple LED button
JavaScript
mit
jamesbulpin/meshblu-connector-ledbutton
ba5cb655163ee7e2f646f0716ba3e9125567156b
files/require-css/0.1.8/css.min.js
files/require-css/0.1.8/css.min.js
define(function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n...
Update project require-css to 0.1.8
Update project require-css to 0.1.8
JavaScript
mit
fchasen/jsdelivr,RoberMac/jsdelivr,jtblin/jsdelivr,firulais/jsdelivr,labsvisual/jsdelivr,bdukes/jsdelivr,stevelacy/jsdelivr,vousk/jsdelivr,dpellier/jsdelivr,RoberMac/jsdelivr,ajibolam/jsdelivr,anilanar/jsdelivr,cake654326/jsdelivr,yaplas/jsdelivr,dnbard/jsdelivr,wallin/jsdelivr,CTres/jsdelivr,ndamofli/jsdelivr,ajkj/jsd...
e3f3e344eef2dadf3781a54d0fad7231d7e20ec0
array/array_merge2.js
array/array_merge2.js
//function to combine two one dimensional arrays to one function array_merge2(arr1, arr2) { return arr1.concat(arr2); } console.log(array_merge2([1, 2, 3], [4, 5]));
Create function that merge 2 arrays
chore: Create function that merge 2 arrays
JavaScript
mit
divyanshu-rawat/Basic-JS-Algorithms
14f9ee8730d2acfdc74a4963b1e1a8ea3f5ef47e
bin/upload-release.js
bin/upload-release.js
"use strict" let version = process.argv[2] let auth = process.argv[3] if (!auth) { console.log("Usage: upload-release.js [TAG] [github-user:password]") process.exit(1) } require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => { if (error) throw error let message = ...
Add a github release upload script
Add a github release upload script
JavaScript
mit
dperetti/CodeMirror,bfrohs/CodeMirror,xeronith/CodeMirror,codio/CodeMirror,hackmdio/CodeMirror,alur/CodeMirror,Jisuanke/CodeMirror,SidPresse/CodeMirror,vincentwoo/CodeMirror,wingify/CodeMirror,pabloferz/CodeMirror,MarcelGerber/CodeMirror,INTELOGIE/CodeMirror,alur/CodeMirror,dperetti/CodeMirror,jayaprabhakar/CodeMirror,...
4bbc2eefe6a89f38a5cf2b21a757acc86047b010
lib/youtube-track.js
lib/youtube-track.js
var ytdl = require('ytdl-core'); module.exports = YoutubeTrack = function(vid, cb) { var _this = this; var requestUrl = 'http://www.youtube.com/watch?v=' + vid; ytdl.getInfo(requestUrl, (err, info) => { if (err) cb(err, undefined); else { _this.vid = info.vid; _this.title = info.title; ...
Add YoutubeTrack class to represent a youtube track For future soundcloud support.
Add YoutubeTrack class to represent a youtube track For future soundcloud support.
JavaScript
mit
meew0/Lethe
d9350a3749a7d33a425c3f5f499984ff52c8690b
src/exports/assets.js
src/exports/assets.js
import { Asset, BondBase, BondCorporate, BondGovernment, BondMortgage, Currency, CustomAsset, Derivative, BondOption, CFD, Equity, ForeignExchangeOption, Fund, ExchangeTradedFund, ForeignExchange, NonDeliverableForward, Index, BondFuture, BondFutureOption, EnergyFuture, EquityF...
Create exports folder for namespacing imports/exports.
Create exports folder for namespacing imports/exports.
JavaScript
apache-2.0
amaas-fintech/amaas-core-sdk-js
dce6f6ba0af831253b4351dd99735b3a28692335
test/components/Scrollbar/Scrollbar.spec.js
test/components/Scrollbar/Scrollbar.spec.js
import React from 'react'; import { mount } from 'enzyme'; import Scrollbar from '../../../src/components/Scrollbar/Scrollbar'; describe('<Scrollbar />', function () { beforeEach(function () { this.update = sinon.spy(); }); describe('when mounted', function () { it('add scrollbar using the Highcharts u...
Add tests for the Scrollbar component
Add tests for the Scrollbar component
JavaScript
mit
whawker/react-jsx-highcharts,AlexMayants/react-jsx-highcharts,whawker/react-jsx-highcharts,AlexMayants/react-jsx-highcharts
b26d9ab3b9a031f52e8a1f40a20f3da625e561ba
js/i18n/zh-cn.js
js/i18n/zh-cn.js
plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","Filename":"文件名","Image format either wrong or not supported.":"图片格式错误...
Add language pack for Simplified Chinese.
Add language pack for Simplified Chinese.
JavaScript
agpl-3.0
envato/plupload,vitr/fend005-plupload,moxiecode/plupload,envato/plupload,vitr/fend005-plupload,moxiecode/plupload
f6b2e366048308c44de85eb573417d9d12472974
src/Problems/PairsWithDifferenceK.js
src/Problems/PairsWithDifferenceK.js
const test = require('tape') /** * Given an array arr of distinct integers and a nonnegative integer k, * write a function that returns an array of all pairs [x,y], * such that x - y = k. If no such pairs exist, return an empty array. * * Examples: * * input = [0, -1, -2, 2, 1], k = 1 * output: [[0, -1], [-1, ...
Add pairs with given difference
Add pairs with given difference
JavaScript
mit
ayastreb/cs101
f5b2b81e1b87583f54ecc6b3578e072205566875
popular_posts.js
popular_posts.js
var superagent = require('superagent'); var _ = require('lodash'); var fs = require('fs'); var path = require('path'); var frontMatter = require('front-matter'); var postsPath = path.join(__dirname, 'pages/posts'); var postFiles = fs.readdirSync(postsPath); var posts = _.map(postFiles, function(file) { var filePath...
Add script to pull piwik data, inject into posts
Add script to pull piwik data, inject into posts
JavaScript
mit
scottnonnenberg/blog,scottnonnenberg/blog,scottnonnenberg/blog
001cacd3ddc41e01f230da17562d1c51835f7cb8
app/assets/javascripts/new_timeslot.js
app/assets/javascripts/new_timeslot.js
$(document).ready(function(){ $("#new-timeslot-form").submit(function(event){ event.preventDefault(); var data = createDate(); $("#modal_new_timeslot").modal('toggle'); $.ajax({ type: "POST", url: "/api/timeslots", data: { start: data } }).done(function(response) { ...
Create new timeslot with ajax call
Create new timeslot with ajax call
JavaScript
mit
theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board
1d0b3c7cb45be76fe7002a6f428373606e24e192
Resources/public/js/tests/fieldTest.js
Resources/public/js/tests/fieldTest.js
describe('Test the field component', function() { /** * Get the textarea component */ function getFieldComponent(field) { var editorAdvancedFieldComponent = Vue.extend(editorAdvancedField); var store = new Vuex.Store({ state: { configuration: { ...
Add field component tests on tags.
Add field component tests on tags.
JavaScript
mit
IDCI-Consulting/ExtraFormBundle,IDCI-Consulting/ExtraFormBundle
821ff82302228712ce5eea057b5437074cd722c1
test/client/modules/videos/mark_as_favourite_spec.js
test/client/modules/videos/mark_as_favourite_spec.js
var expect = chai.expect; describe('markAsFavouriteService', function () { // console.log(angular.module('APP')) var $httpBackend; // var APP; var video = { _id: '123' } var apiUrl = '/api/v1/videos/' + video._id + '/mark_favourite'; beforeEach(module('APP')); beforeEach(inject(function ($injector) { ...
Test for mark as fav
Test for mark as fav
JavaScript
mit
sporto/devtalks.net
f4a490fcbe4d751a6ef64c4e5a0ffe4c4919bea4
assets/js/pages/lessees/reservations.js
assets/js/pages/lessees/reservations.js
$(document).ready(function() { $('#reservation-table').DataTable({}); }); $('.btn-cancel').on('click', function() { if (confirm('Are you sure to cancel this reservation?')) { console.log('cancelled'); } }); $('.btn-view').on('click', function() { $('reservation-modal').modal('show'); });
Add script for lessee reservation list
Add script for lessee reservation list
JavaScript
mit
gctomakin/renTRMNL,gctomakin/renTRMNL,gctomakin/renTRMNL
33b7b330687c4daa4e04ffe1e4d0e23b942673c6
client/components/SignUp/SignUpPage.js
client/components/SignUp/SignUpPage.js
import React, { Component } from 'react'; import logo from '../../public/images/logo.png'; import PageFooter from '../PageFooter'; import SignUpForm from './SignUpForm'; import { connect } from 'react-redux'; class SignUpPage extends Component { constructor(props) { super(props); this.renderSignU...
Create container for SignUpForm component
Create container for SignUpForm component
JavaScript
mit
amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books
1e7390448d7cd39522d122205e917f61438e7ba4
promise-it-wont-hurt/reject-a-promise.js
promise-it-wont-hurt/reject-a-promise.js
var q = require('q'); var deferred = q.defer(); deferred.promise.then(null, function(err) { console.log(err.message); }); setTimeout(deferred.reject, 300, new Error("REJECTED!"));
Complete 'Reject a promise' challenge in 'Promise it won't hurt' tutorial
Complete 'Reject a promise' challenge in 'Promise it won't hurt' tutorial
JavaScript
mit
PaoloLaurenti/nodeschool
c043ca4b069b8e50bc892fdb3c113232c6ddeb8a
modules/version.js
modules/version.js
var exec = require('child_process').exec; var hash; module.exports.init = function(b) { exec('git rev-parse HEAD', function(error, stdout, stderr) { if(error != null) { hash = null; console.err("git's broken yo"); } hash = stdout; console.log(hash); }); } module.exports.run = function(r, parts, reply...
Add command to get the hash of the git commit that is currently being run
Add command to get the hash of the git commit that is currently being run
JavaScript
mit
euank/EuIrcBot,LinuxMercedes/EuIrcBot,gmackie/EuIrcBot,brhoades/EuIrcBot,brhoades/EuIrcBot,gmackie/EuIrcBot,euank/EuIrcBot,LinuxMercedes/EuIrcBot
bf8e163558e88261e82323a15a4f42e4c6f4717f
design/es6.js
design/es6.js
// note we can also import/export in CS2 // fragment.js function replace() { } function extract() { } function three() { } export default { one, two } // unpoly.js import fragment from './fragment' import modal from './modal' import form from './form' up = { fragment, modal, form } // Add shorthand function...
Add preview how we're going to organize as ES6 module
Add preview how we're going to organize as ES6 module
JavaScript
mit
unpoly/unpoly,unpoly/unpoly,unpoly/unpoly
01324eb6ed248d82829350d335d321464e8a1dd8
assets/js/dataTables.filter.perlModule.js
assets/js/dataTables.filter.perlModule.js
/** * This filtering plugin will allow matching of module names in either * form of 'Foo::Bar', or 'Foo-Bar'. * * Based on dataTables.filter.phoneNumber.js * * @summary Make Perl module names searchable * @name Perl module * @author Zak B. Elep * * @example * $(document).ready(function() { * $('#examp...
Add filter plugin for dataTables
Add filter plugin for dataTables This is a simple client-side plugin for handling Perl module names in DataTables.
JavaScript
artistic-2.0
perl6/modules.perl6.org,perl6/modules.perl6.org,perl6/modules.perl6.org,perl6/modules.perl6.org
8fc5f419460926efb1a7d59d0c8249bf422c9180
test/client/autocomplete.clienttest.js
test/client/autocomplete.clienttest.js
module.exports = { 'Should autocomplete words on home page': function (browser) { browser .url('http://localhost:8000/') .waitForElementVisible('body', 1000) .setValue('input[type=search].searchbox__search.tt-input', 'babb') // Wait for the suggestions menu to open .waitForElementVis...
Add end-to-end tests for autocomplete
Add end-to-end tests for autocomplete
JavaScript
mit
TheScienceMuseum/collectionsonline,TheScienceMuseum/collectionsonline
8ae7a077b9d64d6c9775ae7833a1c822801b3605
lib/errors.js
lib/errors.js
function httpError ( message, code ) { var err = new Error( message ); err.status = code; return err; } exports.system = function ( message ) { return httpError( message, 500 ); }; exports.auth = function ( message ) { return httpError( message, 401 ); }; exports.notAuthorized = functio...
Add some common HTTP error helpers
Add some common HTTP error helpers
JavaScript
mit
projectweekend/express-classy
191894db5c4bf0f9fa8e2c9a16e8bbd878e13d54
sashimi-webapp/src/logic/documentPackager/markdown-it-asciimath.js
sashimi-webapp/src/logic/documentPackager/markdown-it-asciimath.js
/** * Code were taken from https://github.com/quertt/markdown-it-asciimath * and modified for use with webpack, since the original npm package * wasn't meant for use with webpack. * Credits to: quertt for the wonderful library */ import katex from 'katex'; import asciiMathTexImg from './ASCIIMathTeXImg'; functio...
Add customised asciimath plugin library for webpack
Add customised asciimath plugin library for webpack
JavaScript
mit
nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note
b437a1c89693af0aca0b0ad8c65aeefc1b9b4c19
src/ably.js
src/ably.js
(function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define([], factory); } else { // Browser globals (root is window) root.ably = factory(); } }(this, function () { return {}; }));
Add initial module definition boilerplate
Add initial module definition boilerplate The module definition supports both AMD and browser globals.
JavaScript
mit
vgno/ably
b9cf17a63c0a0584b4150bcd9cf98a16936e6afe
packages/react-jsx-highcharts/test/components/PlotBandLine/PlotBandLineLabel.integration.spec.js
packages/react-jsx-highcharts/test/components/PlotBandLine/PlotBandLineLabel.integration.spec.js
import React from 'react'; import Highcharts from 'highcharts'; import { HighchartsChart, Debug, HighchartsProvider, PlotBand, YAxis } from '../../../src'; describe('<PlotBandLineLabel /> integration', () => { describe('when parent axis is updated', () => { it('updates plotband style', () => { co...
Add failing test for Plotband.Label updating together with axis
Add failing test for Plotband.Label updating together with axis
JavaScript
mit
whawker/react-jsx-highcharts,whawker/react-jsx-highcharts
b4ae4fcb5e2880e6594be63dc72bbab27c4f81aa
src/js/directives/widget-header.js
src/js/directives/widget-header.js
/** * Widget Header Directive */ angular .module('RDash') .directive('rdWidgetHeader', rdWidgetTitle); function rdWidgetTitle() { var directive = { requires: '^rdWidget', scope: { title: '@', icon: '@' }, transclude: true, template: '<div c...
/** * Widget Header Directive */ angular .module('RDash') .directive('rdWidgetHeader', rdWidgetTitle); function rdWidgetTitle() { var directive = { requires: '^rdWidget', scope: { title: '@', icon: '@' }, transclude: true, template: '<div c...
Add grid col for search bar more beauty
Add grid col for search bar more beauty
JavaScript
mit
jlengwork/rdash-angular,mkosuri/RP,ksiabani/rdash-angular,ksiabani/rdash-angular,NamithaNinan/SEVAWebsite,ahluis/1E-test,jasonmelgoza/Responsive-Dashboard,noahcooper/rdash-angular,RickyDan/rdash-angular,noahcooper/rdash-angular,tbaker0815/upwork_project,maxamillion32/rdash-angular,igorcarlospulini/igorcarlospulini.gith...
04359fd9400e6f2b5675c9ebce2fbf00d762449e
src/test/integration/oauth-test.js
src/test/integration/oauth-test.js
const express = require('express'); const e2p = require('event-to-promise'); const simpleOAuth2 = require('simple-oauth2'); const {server, chai} = require('../common'); describe('oauth/', function() { function setupOAuth() { const config = { client: { id: 'hello', secret: 'super secret' ...
Add integration test of OAuth2
Add integration test of OAuth2
JavaScript
mpl-2.0
moziot/gateway,mozilla-iot/gateway,moziot/gateway,mozilla-iot/gateway,moziot/gateway,mozilla-iot/gateway,mozilla-iot/gateway,mozilla-iot/gateway
505c07875d7a81f054a8d8cf6509a2170f1bc83c
src/models.spec.js
src/models.spec.js
import { parseCommand, Spreadsheet } from './models'; describe('parseCommand', () => { const ast = parseCommand('A0 = A1 + A2'); it('parses simple assignment', () => { expect(ast.type).toEqual('assignment'); }); it('assigns correct target cell', () => { expect(ast.target).toEqual('A0'); }); descri...
Add tests for parseCommand function
Add tests for parseCommand function
JavaScript
mit
schultyy/spreadsheet,schultyy/spreadsheet
c8b7743ca97145c6b0691788d80d9cca8af8bdc5
scripts/publishdocs.js
scripts/publishdocs.js
#!env node let package = require('../package.json').name; let version = require('../package.json').version; let corePackage = require('../../core/package.json').name; let coreVersion = require('../../core/package.json').version; let PAGES_DIR = "../ui-router.github.io"; let sh = require('shelljs'); let readlineSync ...
Add script to publish docs to ui-router.github.io
chore(docs): Add script to publish docs to ui-router.github.io
JavaScript
mit
ui-router/ng2,wawyed/ng2,ui-router/angular,ui-router/ng2,ui-router/angular,wawyed/ng2,ui-router/angular,ui-router/angular,wawyed/ng2
2ada54d87b87302013c67b5e864dc05431a13060
test/orchestrate.io/common-test.js
test/orchestrate.io/common-test.js
var helper = require('../helper') , expect = require('chai').expect; describe('orchestrate.io/common', function () { describe('.merge', function () { it('returns a merger object', function () { x = { a: 1 }; y = { b: 2 }; merged = helper.io.common.merge(x,y) expect(merged).to.eql({ a: 1...
Add test for the common function
Add test for the common function
JavaScript
mit
giraffi/node-orchestrate.io
8ac7634543bb11b67ebdc0efbd0de85b333cc0fa
components/serverSide/triggerTestStart.js
components/serverSide/triggerTestStart.js
var Memcached = require('memcached'); var KeyGen = require('./mcKeyGenerator.js'); var mc = new Memcached("localhost:11211"); var mcKey = KeyGen.getTestKey(); mc.get(mcKey, function (err, json) { console.log("Got: "); console.log(json); mc.set(mcKey, "TRUE", 0, function(){ console.log("Set: TRUE"...
Test environment instrumentation: tiny script to modify a value in memcached that will trigger test starts.
Test environment instrumentation: tiny script to modify a value in memcached that will trigger test starts.
JavaScript
apache-2.0
santiagocasti/collab,santiagocasti/collab,santiagocasti/collab,santiagocasti/collab
c15a6b620243d019c38d82e8be5ab3571f153791
packager/babelRegisterOnly.js
packager/babelRegisterOnly.js
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict...
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict...
Use absolute locations for plugins and presets in packager babel config
Use absolute locations for plugins and presets in packager babel config Reviewed By: davidaurelio Differential Revision: D5044244 fbshipit-source-id: ab1af28d0158c22d0426a7a3b3f1bb0a63abac4e
JavaScript
bsd-3-clause
rickbeerendonk/react-native,cpunion/react-native,lprhodes/react-native,formatlos/react-native,hammerandchisel/react-native,ndejesus1227/react-native,exponentjs/react-native,hoastoolshop/react-native,ptmt/react-native-macos,hammerandchisel/react-native,negativetwelve/react-native,jasonnoahchoi/react-native,hoastoolshop/...
6031df4b525b59c05a2ff5506c07db4b461d925b
packages/ecmascript/plugin.js
packages/ecmascript/plugin.js
function BabelCompiler() {} var BCp = BabelCompiler.prototype; BCp.processFilesForTarget = function (inputFiles) { inputFiles.forEach(function (inputFile) { var source = inputFile.getContentsAsString(); var inputFilePath = inputFile.getPathInPackage(); var outputFilePath = inputFile.getPathInPackage(); ...
function BabelCompiler() {} var BCp = BabelCompiler.prototype; BCp.processFilesForTarget = function (inputFiles) { inputFiles.forEach(function (inputFile) { var source = inputFile.getContentsAsString(); var inputFilePath = inputFile.getPathInPackage(); var outputFilePath = inputFile.getPathInPackage(); ...
Print better errors when ecmascript compilation fails.
Print better errors when ecmascript compilation fails.
JavaScript
mit
deanius/meteor,IveWong/meteor,cbonami/meteor,Prithvi-A/meteor,yiliaofan/meteor,jenalgit/meteor,joannekoong/meteor,lpinto93/meteor,mubassirhayat/meteor,hristaki/meteor,Prithvi-A/meteor,sitexa/meteor,kengchau/meteor,dfischer/meteor,AlexR1712/meteor,DAB0mB/meteor,cherbst/meteor,meonkeys/meteor,deanius/meteor,ashwathgovind...
81e92bcd88f2a6eeb7a4fdc0152f3c4b6c562863
examples/NervousText.js
examples/NervousText.js
// The Java "NervousText" example ported to JavaScript. // Compile using jsc -extends java.applet.Applet -implements java.lang.Runnable NervousText.js /* Adapted from Java code by Daniel Wyszynski Center for Applied Large-Scale Computing (CALC) 04-12-95 Test of text animation. kwalrath: Chang...
Add example of classfile generation.
Add example of classfile generation.
JavaScript
mpl-2.0
rasmuserik/rhino,tejassaoji/RhinoCoarseTainting,lv7777/egit_test,qhanam/rhino,Pilarbrist/rhino,Pilarbrist/rhino,Distrotech/rhino,lv7777/egit_test,AlexTrotsenko/rhino,rasmuserik/rhino,swannodette/rhino,InstantWebP2P/rhino-android,lv7777/egit_test,sam/htmlunit-rhino-fork,AlexTrotsenko/rhino,ashwinrayaprolu1984/rhino,jsdo...
a1e21c5a536d5b771a1c3574081cc574f1d1c61e
server/data/data-cars.js
server/data/data-cars.js
'use strict'; var mongoose = require('mongoose'), Car = mongoose.model('Car'), BBPromise = require('bluebird'); module.exports = { getCarById: function (id) { // TODO: Find a specific car by ObjectId return new BBPromise(function (resolve, reject) { Car.find({_id: id}) ...
Add data object for cars.
Add data object for cars.
JavaScript
mit
TA-2016-NodeJs-Team2/Telerik-Racer,TA-2016-NodeJs-Team2/Telerik-Racer
9dfa9e430a77f4985b659a3207fee3c7b9b2f6f6
app/javascript/app/components/data-explorer-content/pathway-selector-utils/pathway-selector-utils.js
app/javascript/app/components/data-explorer-content/pathway-selector-utils/pathway-selector-utils.js
import uniqBy from 'lodash/uniqBy'; export function getPathwaysModelOptions(query, filtersMeta, filter) { if (!query || !query.locations) return filtersMeta[filter]; const locationsSelected = filtersMeta.locations.filter( location => location.id === query.locations ); const modelSelected = filtersMeta.mode...
Move pathway functions to new file
Move pathway functions to new file
JavaScript
mit
Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch
6d566d24d788baaf48afc591bd937724047e4f5d
public/javascripts/lib/i18n_configure.js
public/javascripts/lib/i18n_configure.js
(function(root,undefined) { var _ = root._; var langopts = root.DC_LANGUAGE_CODES ? _.clone(root.DC_LANGUAGE_CODES) : { language: 'eng', fallback: 'eng' }; langopts.namespace = 'WS'; var i18n = new root.I18n( langopts ); _.t = i18n.translate; })(this);
(function(root,undefined) { var _ = root._; var langopts = root.DC_LANGUAGE_CODES ? _.clone(root.DC_LANGUAGE_CODES) : { language: 'eng', fallback: 'eng' }; langopts.namespace = 'WS'; var i18n = new root.I18n( langopts ); _.mixin({ t: i18n.translate }); })(this);
Use _.mixin for i18n translation function
Use _.mixin for i18n translation function
JavaScript
mit
Teino1978-Corp/Teino1978-Corp-documentcloud,monofox/documentcloud,roberttdev/dactyl4,gunjanmodi/documentcloud,roberttdev/dactyl,dannguyen/documentcloud,moodpo/documentcloud,dannguyen/documentcloud,roberttdev/dactyl4,monofox/documentcloud,monofox/documentcloud,documentcloud/documentcloud,moodpo/documentcloud,roberttdev/...
0e5a113f7c92dd27c549b13887be4915562923d4
s3-slack.js
s3-slack.js
const aws = require('aws-sdk'); const s3 = new aws.S3({ apiVersion: '2006-03-01' }); const https = require('https'); const url = require('url'); const slackUrl = 'https://hooks.slack.com/services/....'; // Your incoming webhook url const slackRequestOptions = url.parse(slackUrl); slackRequestOptions.method = 'POST'; ...
Add script for sending s3 events to slack
Add script for sending s3 events to slack
JavaScript
mit
voidabhi/node-scripts,voidabhi/node-scripts,voidabhi/node-scripts
db0578b310425bcf14d706d869f1d2ca0c75c5f0
desktop/src/Task/__tests__/Circle.spec.js
desktop/src/Task/__tests__/Circle.spec.js
/* eslint-env mocha, jest */ import React from 'react'; import { shallow } from 'enzyme'; import Circle from '../Circle'; it('should render', () => { shallow(<Circle />); }); it('should be a <p />', () => { const circle = shallow(<Circle />); expect(circle.is('p.Circle')).toEqual(true); });
Add Task Circle unit test
Add Task Circle unit test
JavaScript
mit
mkermani144/wanna,mkermani144/wanna
7dd1dc4473afe806e1b474db80fb40b54c2dec99
272-Closest_Binary_Search_Tree_Value_II.js
272-Closest_Binary_Search_Tree_Value_II.js
'use strict'; /** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } */ /** * @param {TreeNode} root * @param {number} target * @param {number} k * @return {number[]} */ var closestKValues = function (root, target, k) { /** * This...
Solve 272 Closest Binary Search Tree Value II
Solve 272 Closest Binary Search Tree Value II
JavaScript
apache-2.0
HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode,HappyCompanions/LeetCode
e57be479c0c493a8a793c202953e1e18cf943dd7
test/player.spec.js
test/player.spec.js
'use strict'; var expect = require('chai').expect; var Player = require('../app/scripts/player'); describe('player', function () { it('should initialize player', function () { var player = new Player({ name: 'Super Player', color: 'green' }); expect(player).to.have.property('name', 'Super P...
Add test for Player model
Add test for Player model
JavaScript
mit
caleb531/connect-four
0f1a6676b4cbea177e6c40241a5866a42ce1e1d9
src/Reporter.js
src/Reporter.js
const Report = require('./report'); const Hipchat = require('./Hipchat'); function Reporter( request, reply ) { console.log(request.query); return reply({}); } module.exports = Reporter;
Add boilerplate function to handle the request
Add boilerplate function to handle the request
JavaScript
mit
wearenolte/lighthouse-reporter
b69e2d77b1f20283cc19f84ef79a2125f221bfd1
server/game/cards/01-Core/EndlessPlains.js
server/game/cards/01-Core/EndlessPlains.js
const ProvinceCard = require('../../provincecard.js'); class EndlessPlains extends ProvinceCard { setupCardAbilities(ability) { this.reaction({ when: { onConflictDeclared: event => event.conflict.conflictProvince === this && event.conflict.attackers.length > 0 }, ...
const ProvinceCard = require('../../provincecard.js'); class EndlessPlains extends ProvinceCard { setupCardAbilities(ability) { this.reaction({ when: { onConflictDeclared: event => event.conflict.conflictProvince === this && event.conflict.attackers.length > 0 }, ...
Refactor Endless Plains to use opponent targeting
Refactor Endless Plains to use opponent targeting
JavaScript
mit
gryffon/ringteki,jeremylarner/ringteki,gryffon/ringteki,jeremylarner/ringteki,gryffon/ringteki,jeremylarner/ringteki
44b8f97d39ba86dc13680544fe752322e8b12143
ui/app/routes/freestyle.js
ui/app/routes/freestyle.js
import Route from '@ember/routing/route'; import { inject as service } from '@ember/service'; import RSVP from 'rsvp'; export default Route.extend({ emberFreestyle: service(), beforeModel() { let emberFreestyle = this.get('emberFreestyle'); return emberFreestyle.ensureHljs().then(() => { return RSV...
Fix syntax highlighting in the styleguide
Fix syntax highlighting in the styleguide
JavaScript
mpl-2.0
burdandrei/nomad,nak3/nomad,nak3/nomad,burdandrei/nomad,burdandrei/nomad,dvusboy/nomad,dvusboy/nomad,burdandrei/nomad,hashicorp/nomad,nak3/nomad,burdandrei/nomad,hashicorp/nomad,hashicorp/nomad,nak3/nomad,burdandrei/nomad,dvusboy/nomad,nak3/nomad,dvusboy/nomad,dvusboy/nomad,hashicorp/nomad,dvusboy/nomad,nak3/nomad,hash...
aef0e4d16ec31cdfa503d2d4e5e5637e6fd709e0
mac/resources/open_CNTL.js
mac/resources/open_CNTL.js
define(['mac/roman'], function(macintoshRoman) { 'use strict'; return function(resource) { var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength); resource.dataObject = { rectangle: { top: dv.getInt16(0, false), left: dv.getInt16(2, false), ...
Create resource handler script for CNTL
Create resource handler script for CNTL
JavaScript
mit
radishengine/drowsy,radishengine/drowsy
5c6fe35e914945a41c27151c5b0de19f8671f657
mac/resources/open_MENU.js
mac/resources/open_MENU.js
define(['mac/roman'], function(macintoshRoman) { 'use strict'; return function(resource) { var dv = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength); resource.dataObject = { id: dv.getUint16(0, false), definitionProcedureResourceID: dv.getUint16(6, false...
Create resource handler script for MENU
Create resource handler script for MENU
JavaScript
mit
radishengine/drowsy,radishengine/drowsy
f8ae151d836a63e3af4a96401225981cd7a4ae68
index.js
index.js
'use strict' var express = require('express'); var app = express(); app.get('/', function(req, res) { res.send('<a href="/authenticate">Log in!</a>'); }); app.get('/authenticate'); app.get('/display', function(req, res) { }); app.listen(8060);
Initialize express and its routes
Initialize express and its routes
JavaScript
mit
tolgaek/thinkful-auth-151027
5ac02b2c5bdfe0f7435d062b65f154188fa7bb60
desktop/src/Task/__tests__/DueDate.spec.js
desktop/src/Task/__tests__/DueDate.spec.js
/* eslint-env mocha, jest */ import React from 'react'; import { shallow } from 'enzyme'; import DueDate from '../DueDate'; it('should render', () => { shallow(<DueDate />); }); it('should be a <span />', () => { const dueDate = shallow(<DueDate />); expect(dueDate.is('span.DueDate')).toEqual(true); }); it('sh...
Add Task DueDate unit test
Add Task DueDate unit test
JavaScript
mit
mkermani144/wanna,mkermani144/wanna
db5d92f4fa121a05dfd4f60a6fd3839f33dfcdee
test/inbound_bridge.js
test/inbound_bridge.js
var RIPPLE_ADDRESS = ''; var COIN_ADDRESS = ''; var COIN_TRANSACTION_HASH = ''; describe('Crypto Coin Inbound Bridge', function() { describe('a bitcoin bridge with no fee', function() { before(function() { bridge = new CryptoCoinBridge({ rippleAddress: RIPPLE_ADDRESS, coinAddress: COIN_ADDR...
Add spec for inbound bridge.
[TEST] Add spec for inbound bridge.
JavaScript
agpl-3.0
dabibbit/blockchain-bridge,RoastBeefSandwichCo/Roast-Coins,RoastBeefSandwichCo/ripple-coins,RoastBeefSandwichCo/Roast-Coins
c211cb0299772f297c43f4bb237063adf2ec9dc4
server/email-notifications/create-account.js
server/email-notifications/create-account.js
// Sends account creation notification (as an input it takes data as submitted with form) 'use strict'; var ensureCallable = require('es5-ext/object/valid-callable') , compileTpl = require('es6-template-strings/compile') , resolveTpl = require('es6-template-strings/resolve-to-string') , mailer =...
Configure on create account notification util
Configure on create account notification util
JavaScript
mit
egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations
70c4f96b7e0ba9c4f8a822bb37095c829c1f1641
src/ggrc/assets/javascripts/components/auto-save-form/fields/tests/checkbox-value-form-field_spec.js
src/ggrc/assets/javascripts/components/auto-save-form/fields/tests/checkbox-value-form-field_spec.js
describe('GGRC.Components.checkboxValueFormField', function () { 'use strict'; var viewModel; beforeEach(function () { viewModel = GGRC.Components .getViewModel('checkboxValueFormField'); spyOn(viewModel, 'dispatch'); viewModel.attr('fieldId', 'id'); }); it('does not fire valueChanged even...
Add checkbox value form field tests
Add checkbox value form field tests
JavaScript
apache-2.0
AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core
b73a4faa1411c815703af876870722f6af4f7ac8
src/store/selectors/index.js
src/store/selectors/index.js
import { createSelector } from 'reselect' import events from '../../core/events' const documentCaptures = state => state.documentCaptures const faceCaptures = state => state.faceCaptures export const documentCaptured = createSelector( documentCaptures, documents => documents.some(i => i.isValid) ) export const d...
Use Redux selectors to store minimal possible state
Use Redux selectors to store minimal possible state
JavaScript
mit
onfido/onfido-sdk-core
74dcb56ee494177f78ecf5b368d9d5e0fc4411dc
js/resize-portfolio-captions.js
js/resize-portfolio-captions.js
$(document).ready(function(){ var heights = $(".portfolio-caption").map(function() { return $(this).height(); }) maxHeight = Math.max.apply(null, heights); $(".portfolio-caption").height(maxHeight); });
Add js to resize portfolio grid captions based on max height
Add js to resize portfolio grid captions based on max height
JavaScript
apache-2.0
jjparseghian/jjparseghian.github.io,jjparseghian/jjparseghian.github.io,jjparseghian/jjparseghian.github.io,jjparseghian/jjparseghian.github.io
9862957b1d1b29c5a1f19684164e8e207f8e8759
migrations/1531584159824_modify-song-fields-again.js
migrations/1531584159824_modify-song-fields-again.js
exports.shorthands = undefined; exports.up = (pgm) => { pgm.addColumns('laundry_songs', { japan_only: { type: 'boolean', notNull: true, default: false }, version: { type: 'real', notNull: false }, }); pgm.dropColumns('laundry_songs', ['full_raw_score']); }; exports.down = (pgm) => { pgm.dropColumns('l...
Add migration about song datas.
Add migration about song datas.
JavaScript
mit
semiquaver-moe/server,semiquaver-moe/server
b1fbcd97a2d1b2b4227c37034b64d4221b431711
lib/main.js
lib/main.js
import { Meteor } from 'meteor/meteor'; // Add Transform to user's Collection Meteor.users._transform = function(user) { user.hasRole = function(role) { return this.roles.indexOf(role) >= 0; }; return user; };
Add hasRole function to user model
Add hasRole function to user model
JavaScript
mit
kyle-rader/greatpuzzlehunt,kyle-rader/greatpuzzlehunt,kyle-rader/greatpuzzlehunt
52cfe18e86b4c8283310cc42c2efb8e22f3c8518
TC/config/browser-versions.js
TC/config/browser-versions.js
TC.Cfg.acceptedBrowserVersions = [ { "name": "Chrome", "version": 63 }, { "name": "Firefox", "version": 57 }, { "name": "IE", "version": 11 }, { "name": "Edge", "version": 16 }, { "name": "Safari", "version": 11 }, { "name": "Mobile Safari", "versio...
Add supported browser versions list
Add supported browser versions list
JavaScript
bsd-2-clause
sitna/api-sitna,sitna/api-sitna
20a6d2e5b7d232249b49383ed22737ba44b829ee
bin/docomo-tts.js
bin/docomo-tts.js
#!/usr/bin/env node var https = require('https'); var fs = require('fs'); var argv = require('argv'); argv.option([ { name: 'apikey', short: 'a', type: 'string', description: '[Mondatory] API KEY provided from docomo Developer support', example: "'"+ argv.name + " --apikey=value' or '" + argv.name + " -a val...
Add main source js file
Add main source js file
JavaScript
mit
cafedeaqua/docomo-tts-api-cli
bd85ecda4744fcd02720d36eb4c7fd059b51dd37
app/assets/javascripts/vendor/console-shim-min.js
app/assets/javascripts/vendor/console-shim-min.js
/* console-shim 1.0.0 https://github.com/kayahr/console-shim Copyright (C) 2011 Klaus Reimer <k@ailis.de> Licensed under the MIT license (See http://www.opensource.org/licenses/mit-license) */ (function(){function c(a,b){return function(){a.apply(b,arguments)}}if(!window.console)window.console={};var a=window.cons...
Add console-shim for crippled browsers
Add console-shim for crippled browsers
JavaScript
apache-2.0
radare/radare.tv,radare/radare.tv,SunDi3yansyah/asciinema.org,SunDi3yansyah/asciinema.org,SunDi3yansyah/asciinema.org,asciinema/asciinema.org,SunDi3yansyah/asciinema.org,SunDi3yansyah/asciinema.org,radare/radare.tv,asciinema/asciinema-server,asciinema/asciinema.org,asciinema/asciinema-server,asciinema/asciinema.org,asc...
6e558bef658dd8b9e6682cd8f0fd3e5e4fc86335
lib/control/v1/signature.js
lib/control/v1/signature.js
'use strict'; const CP = require('child_process'); const Path = require('path'); class Server { constructor(port, path, options) { options = options || {}; this.port = Number(port) || 9909; this.path = path || Path.resolve(__dirname, '../../pkcs7/bin/server'); this.retries = 0; this.maxRetires...
Add an untested controller for the PKCS7 validator app
Add an untested controller for the PKCS7 validator app
JavaScript
mit
rapid7/warden,rapid7/warden,rapid7/warden
6334ac2d0215d00b843f41a0ba502061df86cd4d
test/ApiSpec.js
test/ApiSpec.js
var expect = require('chai').expect; var Api = require('./../src/Api'); describe('Create new instance for API', function() { it('should have methods', function(){ var api = new Api({hostname: 'localhost'}); expect(api).to.respondTo('get'); expect(api).to.respondTo('login'); expect(api).to.respondTo('logout'...
Test for all available methods
Test for all available methods
JavaScript
apache-2.0
kishmiryan-karlen/workfront-api,Workfront/workfront-api,Workfront/workfront-api
7d3c48a32f6987d148565b742939b6f05349c89b
tests/unit/components/em-form-multi-models-test.js
tests/unit/components/em-form-multi-models-test.js
import { moduleForComponent, test } from 'ember-qunit'; import Ember from 'ember'; moduleForComponent('em-form', 'em-form multi models', { // Specify the other units that are required for this test needs: ['component:form-group', 'component:form-group-control', 'component:control-within-label', 'componen...
Add unit tests for multi-model, needs documentation.
Add unit tests for multi-model, needs documentation.
JavaScript
apache-2.0
josefguenther/ember-rapid-forms,slannigan/computed_input_errors,nobesnickr/ember-rapid-forms,piceaTech/ember-rapid-forms,piceaTech/ember-rapid-forms,josefguenther/ember-rapid-forms,nobesnickr/ember-rapid-forms,pedrokiefer/ember-forms,slannigan/computed_input_errors,pedrokiefer/ember-forms
0c0fe673ef0e499591a5f8524021d328c705d7ea
themeStorage.js
themeStorage.js
window.ThemeStorage = { defaultTheme: 'vibrantink', save: function(themeName) { localStorage.setItem('github_theme', themeName); }, getCurrent: function() { return localStorage.getItem('github_theme') || this.defaultTheme; } };
Add theme storage for saving and retrieving the current theme
Add theme storage for saving and retrieving the current theme
JavaScript
mit
craigerm/dark-octo-themes,craigerm/dark-octo-themes
7bbcae5a86daeeb1bc382e6fcc73921e13a57119
src/site/javascripts/docs.js
src/site/javascripts/docs.js
$(document).ready(function() { // make sidebar sticky when it hits the top of the viewport var $sidebar = $("#sidebar"); $sidebar.affix({ offset: { top: $sidebar.offset().top - 20, bottom: $("footer").outerHeight(true) + 20 } }); $(window).resize(fu...
$(document).ready(function() { // make sidebar sticky when it hits the top of the viewport var $sidebar = $("#sidebar"); $sidebar.affix({ offset: { top: $sidebar.offset().top - 20, bottom: $("footer").outerHeight(true) + 20 } }); $(window).resize(fu...
Fix position of sidebar in Safari
Fix position of sidebar in Safari Fixes #29 See twbs/bootstrap#12126
JavaScript
apache-2.0
cescoffier/web-site,kevinbayes/vertx-web-site,karianna/vertx-web-site,vietj/vertx,cazacugmihai/vertx-web-site,cazacugmihai/vertx-web-site,cescoffier/web-site,karianna/vertx-web-site,michel-kraemer/web-site,cazacugmihai/vertx-web-site,michel-kraemer/web-site,michel-kraemer/web-site,woorea/vertx-web-site,vert-x3/vertx-we...
26badb74d93045eac40a5d554c8663a32e3524b6
website/app/application/directives/mathjax-bind.js
website/app/application/directives/mathjax-bind.js
Application.Directives.directive("mathjaxBind", mathjaxBindDirective); function mathjaxBindDirective() { return { restrict: "A", controller: ["$scope", "$element", "$attrs", function($scope, $element, $attrs) { $scope.$watch($attrs.mathjaxBind, function...
Add directive for rendering latex equations.
Add directive for rendering latex equations.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
7b7e1474c4244672000e40c180af384c4b41b0f3
src/test/js/core/utilTest.js
src/test/js/core/utilTest.js
var util = require('util'); exports.test = { testToStringWithArray : function(){ assert.deepEquals(['1', '2', '3'], util.toStringWithArray([1, 2, 3])); assert.equals('{"s":2}', util.toStringWithArray({s : 2})); assert.equals('2', util.toStringWithArray(2)); }, testIsSingleArray : function(){ assert.che...
Test suite for util module
Test suite for util module
JavaScript
mit
suhaibkhan/finitejs,suhaibkhan/finitejs,suhaibkhan/finitejs
49e6b7c1f3dfe7fe5144336c3e47d4af2269bd40
assets/js/src/preview-ajax.js
assets/js/src/preview-ajax.js
/** * The AJAX setup for the Markdown Preview meta box. */ (function($, d, w){ $.fn.getParsedContent = function(){ return this.each(function(){ // Set refs to this container and editor content var $this = $(this); var $content = $('#content'); $.ajax({ url: ajaxurl, t...
Set up AJAX script to update preview
Set up AJAX script to update preview
JavaScript
mit
friartuck6000/wp-parsedown,friartuck6000/wp-parsedown
9595c6104e0072c5a019cd1da28b084ac12b7d36
test/mjsunit/bugs/bug-3621.js
test/mjsunit/bugs/bug-3621.js
// Copyright 2014 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var a = []; var endIndex = 0xffff; a[endIndex] = 3; Object.defineProperty(a, 0, { get: function() { this[1] = 2; return 1; } }); assertEquals('123', a.j...
Add test case for SparseJoin misbehavior with getters
Add test case for SparseJoin misbehavior with getters BUG=v8:3621 LOG=N R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/645703003 git-svn-id: f98b9d40cb02301bc76fa9e1b46ee668158567fd@24535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
JavaScript
mit
UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh
781ca786aa3249fb63b216dc5d82d6f5ec32afd0
benchmarks/benchmark-load.js
benchmarks/benchmark-load.js
'use strict' const IPFS = require('ipfs') const IPFSRepo = require('ipfs-repo') const DatastoreLevel = require('datastore-level') const OrbitDB = require('../src/OrbitDB') console.log("Starting IPFS...") const repoConf = { storageBackends: { blocks: DatastoreLevel } } const ipfs = new IPFS({ repo: new IPF...
Add a benchmark for loading a db
Add a benchmark for loading a db
JavaScript
mit
orbitdb/orbit-db,haadcode/orbit-db,orbitdb/orbit-db,haadcode/orbit-db
a2d3d72e1a5a0d401c92f7d02ebcd0ba4f563ae8
test/specs/util_query_spec.js
test/specs/util_query_spec.js
import '../../src/'; import Avatar from '../samples/components/avatar'; import List from '../samples/components/list'; describe('query', () => { const body = document.querySelector('body'); beforeEach(() => { body.innerHTML = ` <div id="test"> <avatar></avatar> ...
Add fail test for query
Add fail test for query
JavaScript
mit
baza-fe/knockout.register
e29bb5fe786316c4d3fbc139fba4b775ae5c5f8e
src/js/stores/healthChecksRowScheme.js
src/js/stores/healthChecksRowScheme.js
var HealthCheckProtocols = require("../constants/HealthCheckProtocols"); const healthChecksRowScheme = { protocol: HealthCheckProtocols.COMMAND, command: null, path: null, portIndex: 0, gracePeriodSeconds: 300, intervalSeconds: 60, timeoutSeconds: 20, maxConsecutiveFailures: 3, ignoreHttp1xx: false }...
Introduce health checks row scheme
Introduce health checks row scheme
JavaScript
apache-2.0
cribalik/marathon-ui,mesosphere/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui
e7be3770bd6d8f46b29fb2f87d5c087511aa8366
youre-a-square.js
youre-a-square.js
// https://www.codewars.com/kata/youre-a-square const isSquare = n => ( n >= 0 ? Math.pow(Math.round(Math.sqrt(n)), 2) === n : false );
Add solution for "You're a square"
Add solution for "You're a square"
JavaScript
mit
jonathanweiss/codewars
e7842e76bafc42c9cc18df4951805e089847610e
kasih.in/app/assets/frontend/components/common/help/presentation/HelpForm.js
kasih.in/app/assets/frontend/components/common/help/presentation/HelpForm.js
import React, {PropTypes} from 'react'; class HelpForm extends React.Component{ constructor(props, context) { super(props, context); this.state = { help: { message: "" } }; this.onMessageChange = this.onMessageChange.bind(this); this.onClickPost = this.onClickPost.bind(this); } onM...
Rename presentational into presentation folder.
Rename presentational into presentation folder.
JavaScript
mit
prdx/kasih.in,prdx/kasih.in,prdx/kasih.in
6c03a2af0d8b2c32cccd9bbbdd338a257858c32e
connectors/ambientsleepingpill.js
connectors/ambientsleepingpill.js
'use strict'; /* global Connector */ const DEFAULT_TRACK_ART = 'nocover.png'; Connector.playerSelector = '#player'; Connector.artistSelector = '#trackartist'; Connector.trackSelector = '#tracktitle'; Connector.playButtonSelector = '#play'; Connector.getTrackArt = function() { let trackArtUrl = $('#trackimageurl...
'use strict'; /* global Connector */ Connector.playerSelector = '#player'; Connector.artistSelector = '#trackartist'; Connector.trackSelector = '#tracktitle'; Connector.playButtonSelector = '#play';
Fix Ambient Sleeping Pill connector
Fix Ambient Sleeping Pill connector
JavaScript
mit
alexesprit/web-scrobbler,inverse/web-scrobbler,carpet-berlin/web-scrobbler,Paszt/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,usdivad/web-scrobbler,alexesprit/web-scrobbler,galeksandrp/web-scrobbler,Paszt/web-scrobbler,david-sabata/web-scrobbler,david-sabata/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,carpet-ber...
b8b7ef924c45f611b1430931973dfb9b64c8cf1c
routes/index.js
routes/index.js
var express = require('express'); var router = express.Router(); var windspeed = require('../middleware/windspeed') router.use(windspeed) var statusValues = { 1: { human: "Safe(ish)", machine: "safe" }, 2: { human: "Moderate", machine: "moderate" }, 3: { human: "Hazardous", machine: "hazardous" }...
var express = require('express'); var router = express.Router(); var windspeed = require('../middleware/windspeed') router.use(windspeed) var statusValues = { 1: { human: "Safe(ish)", machine: "safe" }, 2: { human: "Moderate", machine: "moderate" }, 3: { human: "Hazardous", machine: "hazardous" }...
Remove /about route since there's no content for it yet
Remove /about route since there's no content for it yet
JavaScript
mit
renemarcelo/kcbx-petcoke,chihacknight/kcbx-petcoke,benwilhelm/kcbx-petcoke,justinmanley/kcbx-petcoke,chihacknight/kcbx-petcoke,manleyjster/kcbx-petcoke,open-city/kcbx-petcoke,open-city/kcbx-petcoke,manleyjster/kcbx-petcoke,chihacknight/kcbx-petcoke,benwilhelm/kcbx-petcoke,benwilhelm/kcbx-petcoke,open-city/kcbx-petcoke,...
cacb1156965408787c18a12c721400f0d62c1cd8
test/integration/skin-size-tests.js
test/integration/skin-size-tests.js
/* global render, ImageData */ const {chromium} = require('playwright-chromium'); const test = require('tap').test; const path = require('path'); const indexHTML = path.resolve(__dirname, 'index.html'); // immediately invoked async function to let us wait for each test to finish before starting the next. (async () =>...
Add unit tests for setting then getting skin size
Add unit tests for setting then getting skin size
JavaScript
bsd-3-clause
LLK/scratch-render,LLK/scratch-render
3fc3eaf71f55e8a9b5fa54b5611330339dfa18e0
test/karma.conf.js
test/karma.conf.js
// Karma configuration // Generated on Sat Feb 20 2016 09:40:08 GMT+0800 (Malay Peninsula Standard Time) module.exports = function(config) { config.set({ basePath: '../', frameworks: ['jasmine'], files: [ 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route....
Add login authentication and unit testing
Add login authentication and unit testing
JavaScript
mit
HarveyLeo/cms-frontend,HarveyLeo/cms-frontend
14e013a35b61089706aa560e1bcf664d087b875d
src/js/App.js
src/js/App.js
$(document).ready(function() { initCanvas($(window).width(), $(window).height()); }); var initCanvas = function(width, height) { // Create the canvas var canvas = document.createElement("canvas"); var ctx = canvas.getContext("2d"); canvas.width = width; canvas.height = height; document.getE...
Create and insert the canvas on page load
Create and insert the canvas on page load
JavaScript
mit
Tactique/jswars
8c42c4ea189e7a8095af2f051780354a0b08b553
assets/js/scale.fix.js
assets/js/scale.fix.js
var metas = document.getElementsByTagName('meta'); var i; if (navigator.userAgent.match(/iPhone/i)) { for (i=0; i<metas.length; i++) { if (metas[i].name == "viewport") { metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; } } document.addEventListener("gesturestart", gestu...
var metas = document.getElementsByTagName('meta'); var i; if (navigator.userAgent.match(/iPhone/i)) { for (i=0; i<metas.length; i++) { if (metas[i].name == "viewport") { metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; } } document.addEventListener("touchstart", gesture...
Fix bug of incorrect touch event name
Fix bug of incorrect touch event name Beginning of touch event is called `touchstart`, not `gesturestart` as referenced [1] here. [1] https://developer.mozilla.org/en/docs/Web/API/Touch_events
JavaScript
cc0-1.0
fducau/fducau.github.io,yuasabe/yuasabe.github.io,MRECoelho/MRECoelho.github.io,AzriRosehaizat/azrirosehaizat.github.io,rodalton/blog,dudok/dudok.github.io,soutoner/minimal-resume,mike-u/ivis-jminimal,fducau/fducau.github.io,initialneil/initialneil.github.io,bosung/bosung.github.io,n-tos/samplePages,mike-u/ivis-jminima...
98d08e515debe9ce6300f7f4f57309e34e2e0e84
server/app/models/service-template.js
server/app/models/service-template.js
const { DataTypes, Model } = require('sequelize'); /** * This class represents a template for a list of services for a week. */ class ServiceTemplate extends Model { /** * Initialization function. * * @param sequelize * @returns {Model} */ static init(sequelize) { return sup...
Add ServiceTemplate object without associations
Add ServiceTemplate object without associations
JavaScript
apache-2.0
K-Fet/K-App,K-Fet/K-App,K-Fet/K-App,K-Fet/K-App
b80b4643178f439e45622f67cbe0ea4a9eee6a9b
specs/clientspecs/analyzeexperiments/measurenumeric/optionlist/statstable.spec.js
specs/clientspecs/analyzeexperiments/measurenumeric/optionlist/statstable.spec.js
var index = require('../../../index.js')(); var expect = require('chai').expect; var React = require('react'); var ReactDOM = require('react-dom'); var TestUtils = require('react-addons-test-utils'); var StatsTable = require('../../../../../server/client/containers/AnalyzeExperiment/MeasureNumeric/OptionList/StatsTab...
Write tests for stats table
Write tests for stats table
JavaScript
mit
marcusbuffett/agnition,Agnition/agnition,marcusbuffett/agnition,Agnition/agnition
63e1d11e97af7ec805b491501f0c8498a10bc90a
src/js/circularbuffer.js
src/js/circularbuffer.js
/* Fixed size queue implemented as a circular array */ function Ring(size) { this.length = size; this.maxIndex = this.length - 1; this.start = 0; this.buffer = new Float32Array(this.length); } Ring.prototype.push = function (element) { this.buffer[this.start] = element; var newStart = this.st...
Add a minimal fixed size queue.
Add a minimal fixed size queue.
JavaScript
mit
archblob/amit
66ada9d7c7d183f69860c11a463a796a38d6c5d6
src/js/select-url.js
src/js/select-url.js
document.addEventListener('DOMContentLoaded',function() { document.querySelector('select[name="selectUrl"]').onchange=changeEventHandler; },false); function changeEventHandler(event) { // You can use “this” to refer to the selected element. if(!event.target.value) alert('Please Select One'); else window...
Add script to change URLs
Add script to change URLs Ref #31
JavaScript
mit
budparr/thenewdynamic,thenewdynamic-org/thenewdynamic.org,thenewdynamic-org/thenewdynamic.org,budparr/thenewdynamic,budparr/thenewdynamic