commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
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
--- +++ @@ -0,0 +1,20 @@ +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); + }); +} + +mo...
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
--- +++ @@ -0,0 +1,33 @@ +// 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 = {...
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
--- +++ @@ -0,0 +1,27 @@ +/** + * 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 + * $(docume...
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
--- +++ @@ -0,0 +1,51 @@ +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 men...
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
--- +++ @@ -0,0 +1,43 @@ +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( messag...
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
--- +++ @@ -0,0 +1,79 @@ +/** + * 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 asciiMathTexIm...
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
--- +++ @@ -0,0 +1,13 @@ +(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 () { + + + ...
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
--- +++ @@ -0,0 +1,49 @@ +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('u...
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...
--- +++ @@ -14,7 +14,7 @@ icon: '@' }, transclude: true, - template: '<div class="widget-header"><div class="row"><div class="pull-left"><i class="fa" ng-class="icon"></i> {{title}} </div><div class="pull-right" ng-transclude></div></div></div>', + template: '<div class="w...
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
--- +++ @@ -0,0 +1,62 @@ +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: 'hel...
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
--- +++ @@ -0,0 +1,27 @@ +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....
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
--- +++ @@ -0,0 +1,39 @@ +#!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 = ...
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
--- +++ @@ -0,0 +1,13 @@ +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...
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
--- +++ @@ -0,0 +1,15 @@ +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, fun...
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/...
--- +++ @@ -19,13 +19,13 @@ function config(onlyList) { _only = _only.concat(onlyList); return { - presets: ['es2015-node'], + presets: [require('babel-preset-es2015-node')], plugins: [ 'transform-flow-strip-types', 'syntax-trailing-function-commas', 'transform-object-rest-sprea...
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...
--- +++ @@ -24,7 +24,22 @@ babelOptions.sourceFileName = "/" + inputFilePath; babelOptions.sourceMapName = "/" + outputFilePath + ".map"; - var result = Babel.compile(source, babelOptions); + try { + var result = Babel.compile(source, babelOptions); + } catch (e) { + if (e...
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...
--- +++ @@ -0,0 +1,75 @@ +// 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 ...
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
--- +++ @@ -0,0 +1,64 @@ +'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) { + ...
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
--- +++ @@ -0,0 +1,66 @@ +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 + ); + con...
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/...
--- +++ @@ -7,6 +7,8 @@ var i18n = new root.I18n( langopts ); - _.t = i18n.translate; + _.mixin({ + t: i18n.translate + }); })(this);
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
--- +++ @@ -0,0 +1,54 @@ +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); +s...
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
--- +++ @@ -0,0 +1,14 @@ +/* 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')...
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
--- +++ @@ -0,0 +1,76 @@ +'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 = ...
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
--- +++ @@ -0,0 +1,18 @@ +'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(p...
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
--- +++ @@ -0,0 +1,9 @@ +const Report = require('./report'); +const Hipchat = require('./Hipchat'); + +function Reporter( request, reply ) { + console.log(request.query); + return reply({}); +} + +module.exports = 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
--- +++ @@ -7,20 +7,17 @@ onConflictDeclared: event => event.conflict.conflictProvince === this && event.conflict.attackers.length > 0 }, cost: ability.costs.breakSelf(), - handler: () => { - let otherPlayer = this.game.getOtherPlayer(this.controlle...
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...
--- +++ @@ -0,0 +1,18 @@ +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.ensu...
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
--- +++ @@ -0,0 +1,25 @@ +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), +...
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
--- +++ @@ -0,0 +1,36 @@ +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), + definitionProced...
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
--- +++ @@ -0,0 +1,18 @@ +'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);
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
--- +++ @@ -0,0 +1,18 @@ +/* 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('s...
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
--- +++ @@ -0,0 +1,58 @@ +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_ADD...
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
--- +++ @@ -0,0 +1,36 @@ +// 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/resolv...
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
--- +++ @@ -0,0 +1,37 @@ +describe('GGRC.Components.checkboxValueFormField', function () { + 'use strict'; + var viewModel; + + beforeEach(function () { + viewModel = GGRC.Components + .getViewModel('checkboxValueFormField'); + spyOn(viewModel, 'dispatch'); + viewModel.attr('fieldId', 'id'); + }); +...
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
--- +++ @@ -0,0 +1,40 @@ +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.so...
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
--- +++ @@ -0,0 +1,9 @@ +$(document).ready(function(){ + var heights = $(".portfolio-caption").map(function() { + return $(this).height(); + }) + + maxHeight = Math.max.apply(null, heights); + + $(".portfolio-caption").height(maxHeight); +});
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
--- +++ @@ -0,0 +1,16 @@ +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....
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
--- +++ @@ -0,0 +1,10 @@ +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; +};
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
--- +++ @@ -0,0 +1,30 @@ +TC.Cfg.acceptedBrowserVersions = [ + { + "name": "Chrome", + "version": 63 + }, + { + "name": "Firefox", + "version": 57 + }, + { + "name": "IE", + "version": 11 + }, + { + "name": "Edge", + "version": 16 + }, + { + "name": "Safari", + "version": 11 + ...
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
--- +++ @@ -0,0 +1,79 @@ +#!/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 + " --ap...
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...
--- +++ @@ -0,0 +1,8 @@ +/* + 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)w...
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
--- +++ @@ -0,0 +1,115 @@ +'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'); + +...
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
--- +++ @@ -0,0 +1,23 @@ +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')...
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
--- +++ @@ -0,0 +1,70 @@ +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', + 'compo...
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
--- +++ @@ -0,0 +1,13 @@ +window.ThemeStorage = { + + defaultTheme: 'vibrantink', + + save: function(themeName) { + localStorage.setItem('github_theme', themeName); + }, + + getCurrent: function() { + return localStorage.getItem('github_theme') || this.defaultTheme; + } +}; +
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...
--- +++ @@ -13,8 +13,46 @@ }); // add .nav class to all lists in the sidebar (necessary for scrollspy) - $("#sidebar").find("ul").addClass("nav"); + $sidebar.find("ul").addClass("nav"); // enable scrollspy $("body").scrollspy({ target: "#sidebar" }); + + // *************** START BUGFI...
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
--- +++ @@ -0,0 +1,21 @@ +Application.Directives.directive("mathjaxBind", mathjaxBindDirective); + +function mathjaxBindDirective() { + return { + restrict: "A", + controller: ["$scope", "$element", "$attrs", + function($scope, $element, $attrs) { + $scope....
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
--- +++ @@ -0,0 +1,36 @@ + +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)); + }, + + testI...
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
--- +++ @@ -0,0 +1,62 @@ +/** + * 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'); + + ...
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
--- +++ @@ -0,0 +1,11 @@ +// 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; retu...
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
--- +++ @@ -0,0 +1,54 @@ +'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 + } +}...
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
--- +++ @@ -0,0 +1,56 @@ +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"> + ...
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
--- +++ @@ -0,0 +1,15 @@ +var HealthCheckProtocols = require("../constants/HealthCheckProtocols"); + +const healthChecksRowScheme = { + protocol: HealthCheckProtocols.COMMAND, + command: null, + path: null, + portIndex: 0, + gracePeriodSeconds: 300, + intervalSeconds: 60, + timeoutSeconds: 20, + maxConsecutiv...
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
--- +++ @@ -0,0 +1,7 @@ +// https://www.codewars.com/kata/youre-a-square + +const isSquare = n => ( + n >= 0 ? + Math.pow(Math.round(Math.sqrt(n)), 2) === n : + false +);
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
--- +++ @@ -0,0 +1,58 @@ +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 ...
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...
--- +++ @@ -1,8 +1,6 @@ 'use strict'; /* global Connector */ - -const DEFAULT_TRACK_ART = 'nocover.png'; Connector.playerSelector = '#player'; @@ -11,17 +9,3 @@ Connector.trackSelector = '#tracktitle'; Connector.playButtonSelector = '#play'; - -Connector.getTrackArt = function() { - let trackArtUrl = $('...
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,...
--- +++ @@ -35,11 +35,5 @@ }); }); -/* GET about page */ -router.get('/about', function(req, res){ - res.render('about', { - bodyClass: "about" - }) -}) module.exports = router;
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
--- +++ @@ -0,0 +1,61 @@ +/* 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 bef...
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
--- +++ @@ -0,0 +1,50 @@ +// 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...
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
--- +++ @@ -0,0 +1,12 @@ +$(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; + canv...
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...
--- +++ @@ -6,7 +6,7 @@ metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; } } - document.addEventListener("gesturestart", gestureStart, false); + document.addEventListener("touchstart", gestureStart, false); } function gestureStart() { for (i=0; i<metas.length; i++) ...
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
--- +++ @@ -0,0 +1,43 @@ +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} + */ + st...
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
--- +++ @@ -0,0 +1,23 @@ +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...
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
--- +++ @@ -0,0 +1,25 @@ +/* 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]...
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
--- +++ @@ -0,0 +1,8 @@ +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('Plea...
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
--- +++ @@ -0,0 +1,52 @@ +/* + * 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 ...
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...
--- +++ @@ -9,26 +9,23 @@ }; export default { - addWithInfo(storyName, _info, _storyFn, _options) { + addWithInfo(storyName, info, storyFn, _options) { + if (typeof storyFn !== 'function') { + if (typeof info === 'function') { + _options = storyFn; + storyFn = info; + info = ''; + ...
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
--- +++ @@ -0,0 +1,13 @@ +// 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 chsL...
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
--- +++ @@ -0,0 +1,63 @@ +/* + +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'; + ...
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...
--- +++ @@ -0,0 +1,23 @@ +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 ...
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
--- +++ @@ -0,0 +1,52 @@ +'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) { + ...
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
--- +++ @@ -0,0 +1,74 @@ +/** + * @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 fo...
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
--- +++ @@ -0,0 +1,14 @@ +// 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);
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
--- +++ @@ -0,0 +1,12 @@ +;(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.r...
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
--- +++ @@ -0,0 +1,29 @@ +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.remo...
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...
--- +++ @@ -1,5 +1,5 @@ Package.describe({ - summary: "Dictionary data structure: a wrapper for a raw object", + summary: "Dictionary data structure allowing non-string keys", internal: true });
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
--- +++ @@ -0,0 +1,25 @@ +// 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 = ...
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
--- +++ @@ -0,0 +1,18 @@ +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....
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
--- +++ @@ -0,0 +1,35 @@ +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'] + }, + insecureSkipTLSV...
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
--- +++ @@ -0,0 +1,41 @@ +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 mobilization...
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...
--- +++ @@ -24,7 +24,9 @@ this.target = options.target; this.listenTo(this.collection, 'reset', this.render); - this.selectionChanged(); + if (!$(this.target).val()) { + this.selectionChanged(); + } }, /**
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
--- +++ @@ -0,0 +1,13 @@ +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...
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
--- +++ @@ -0,0 +1,51 @@ +/** + * @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.ex...
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
--- +++ @@ -0,0 +1,9 @@ +/** + * @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]; +};
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
--- +++ @@ -0,0 +1,14 @@ +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 }, ...
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...
--- +++ @@ -7,11 +7,7 @@ before(function (done) { helpers.run(path.join(__dirname, '../app')) .inDir(path.join(os.tmpdir(), './temp-test')) - .withOptions({ - skipHello: true, - skipInstall: true, - skipGeneratorUpdate: true - ...
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
--- +++ @@ -0,0 +1,22 @@ +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 : { + backg...
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
--- +++ @@ -16,7 +16,7 @@ export default { 'no-rest': { desc: 'Disables REST interface to this model', - type: 'Boolean', + type: Boolean, defaults: false, hide: false }
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
--- +++ @@ -0,0 +1,46 @@ +module.exports = { + up: (queryInterface, Sequelize) => { + queryInterface.createTable('Users', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: Sequelize.INTEGER, + }, + username: { + type: Sequelize.STRIN...
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...
--- +++ @@ -0,0 +1,12 @@ +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 alwa...
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
--- +++ @@ -0,0 +1,73 @@ +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 Apo...
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
--- +++ @@ -0,0 +1,46 @@ +#!/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 = { ...
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
--- +++ @@ -9,7 +9,7 @@ cert: fs.readFileSync(__dirname + '/ssl.crt') } -var hander = cgi(__dirname + '/cgi-bin/nph-proxy.cgi', { +var handler = cgi(__dirname + '/cgi-bin/nph-proxy.cgi', { nph: true, env: { //RUNNING_ON_SSL_SERVER: 1
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
--- +++ @@ -0,0 +1,25 @@ +// 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...
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
--- +++ @@ -0,0 +1,43 @@ +/*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('../li...
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...
--- +++ @@ -0,0 +1 @@ +!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-layz...
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
--- +++ @@ -0,0 +1,17 @@ +exports.create = { + 'Recommended Family Constellation': [{ + familyConstellation: '2-parent (male and female)' + }, { + familyConstellation: '2-parent (females)' + }, { + familyConstellation: '2-parent (males)' + }, { + familyConstellation: 'Single Parent (female)' + }, { + familyCo...
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
--- +++ @@ -0,0 +1,15 @@ +'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 eve...
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
--- +++ @@ -0,0 +1,40 @@ +'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: { + ...
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
--- +++ @@ -0,0 +1,23 @@ +define(function () { + var show_running_jobs = function() { + + var element = 'fffffffff'; + + var modal = Jupyter.dialog.modal({ + title: "Running Spark Jobs", + body: element, + buttons: { + "Close": {} + }...