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
0d4919d22140a13374e57db8d83dd218b4db8958
src/main/webapp/scripts/results.js
src/main/webapp/scripts/results.js
$().ready(() => { loadContentSection().then(() =>{ $('body').removeClass('loading'); }); }); $("body").on('click', '.keyword', function() { $(this).addClass("active"); $(".base").hide(200); $("#real-body").addClass("focus"); }); $("body").on('click', ".close", function(event) { event.stopPropagation(...
$().ready(loadContentSection); $("body").on('click', '.keyword', function() { $(this).addClass("active"); $(".base").hide(200); $("#real-body").addClass("focus"); }); $("body").on('click', ".close", function(event) { event.stopPropagation(); $(".extended").removeClass("extended"); $(this).parent().removeC...
Change await promises to counter
Change await promises to counter
JavaScript
apache-2.0
googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020
--- +++ @@ -1,8 +1,4 @@ -$().ready(() => { - loadContentSection().then(() =>{ - $('body').removeClass('loading'); - }); -}); +$().ready(loadContentSection); $("body").on('click', '.keyword', function() { $(this).addClass("active");
6a6494f7fe7fbfd64cc6493f464603c51b6d2b93
src/test/javascript/specRunner.js
src/test/javascript/specRunner.js
// We need to prime vertx since jasmine tests don't run in the vert.x container. if ((typeof nodyn) !== 'object') { load('./node.js'); } // jasmine's fake clock thinks it's using milliseconds, // but in fact it's using seconds. Set the timeout increment // to one second. jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 1; ...
// We need to prime vertx since jasmine tests don't run in the vert.x container. if ((typeof nodyn) !== 'object') { load('./node.js'); } // jasmine's fake clock thinks it's using milliseconds, // but in fact it's using seconds. Set the timeout increment // to one second. jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 1; ...
Use process.exit() to clean up after tests
Use process.exit() to clean up after tests
JavaScript
apache-2.0
nodyn/nodyn,dherges/nodyn,tony--/nodyn,nodyn/nodyn,tony--/nodyn,dherges/nodyn,nodyn/nodyn,dherges/nodyn,tony--/nodyn
--- +++ @@ -15,8 +15,7 @@ jasmineEnv.currentRunner_.finishCallback = function() { origCallback.call(this); - process.emit('exit', '__jvertx.stop()'); - __jvertx.stop(); + process.exit(); }; describe('Nodyn', function() {
3a82f7aca54c37a28158a5bb7f78459bc69e7f0e
public/script/init.js
public/script/init.js
/* global hljs */ (function() { 'use strict'; var cells = document.querySelectorAll('.diff tbody td'); for (var i = 0, len = cells.length; i < len; i++) { hljs.highlightBlock(cells[i]); } })();
/* global hljs */ (function() { 'use strict'; document.addEventListener('DOMContentLoaded', function() { var cells = document.querySelectorAll('.diff tbody td'); for (var i = 0, len = cells.length; i < len; i++) { hljs.highlightBlock(cells[i]); } }); })();
Tweak execution timing of highlighting
Tweak execution timing of highlighting
JavaScript
mit
takenspc/diffofhtmls,takenspc/diffofhtmls,takenspc/diffofhtmls
--- +++ @@ -1,8 +1,10 @@ /* global hljs */ (function() { 'use strict'; - var cells = document.querySelectorAll('.diff tbody td'); - for (var i = 0, len = cells.length; i < len; i++) { - hljs.highlightBlock(cells[i]); - } + document.addEventListener('DOMContentLoaded', function() { + ...
21043bdce769c06b08b9e9b1054eafebcb842351
test/wordpress/wordpress/index.js
test/wordpress/wordpress/index.js
import sinon from 'sinon'; import chai from 'chai'; const expect = chai.expect; import * as fetch from '../../../src/functions/fetch.js'; import checkWordpress from '../../../src/wordpress/wordpress'; describe('wordpress', function() { describe('test wordpress promise', function() { let sandbox; beforeEach(...
import sinon from 'sinon'; import chai from 'chai'; const expect = chai.expect; import * as fetch from '../../../src/functions/fetch.js'; import checkWordpress from '../../../src/wordpress/wordpress'; describe('wordpress', function() { describe('test wordpress promise', function() { let sandbox; beforeEach(...
Add new test case in wordpress
Add new test case in wordpress
JavaScript
mit
juffalow/pentest-tool-lite,juffalow/pentest-tool-lite
--- +++ @@ -33,5 +33,21 @@ expect(error).to.equal('Not a WordPress site!'); }); }); + + it('should return original URL', () => { + const html = { + body: '<html><head><title>Index of folder</title><link href="https://example.com/wp-content/themes/example/css/example.css" rel="s...
8c6348d276301e549e40025210b35d3daff49ab3
src/components/molecules/user_info/UserInfo.js
src/components/molecules/user_info/UserInfo.js
'use strict'; import React from 'react'; import ProfileImage from 'components/atoms/profile_image/ProfileImage'; import Username from 'components/atoms/username/Username'; import Badges from 'components/molecules/badges/Badges'; require('./stylesheets/user_info.scss'); class UserInfo extends React.Component { getU...
'use strict'; import React from 'react'; import ProfileImage from 'components/atoms/profile_image/ProfileImage'; import Username from 'components/atoms/username/Username'; import Badges from 'components/molecules/badges/Badges'; require('./stylesheets/user_info.scss'); class UserInfo extends React.Component { getU...
Fix not chached user bug
Fix not chached user bug
JavaScript
mit
cassioscabral/rateissuesfront,DominikePessoa/rateissuesfront,DominikePessoa/rateissuesfront,cassioscabral/rateissuesfront
--- +++ @@ -9,7 +9,7 @@ class UserInfo extends React.Component { getUserProfile() { - return JSON.parse(localStorage.getItem('userProfile')); + return JSON.parse(localStorage.getItem('userProfile')) || {email:"",nickname:""}; } render() {
20cfac0e9414eee5ac907c16d63241b7297b21a7
tests/dummy/config/environment.js
tests/dummy/config/environment.js
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, baseURL: '/', // Personally, hash is nicer for test work. The browser knows not // to do a full page refresh when you manually edit the url. locationType: 'hash', ...
/* jshint node: true */ module.exports = function(environment) { var ENV = { modulePrefix: 'dummy', environment: environment, baseURL: '/', // Personally, hash is nicer for test work. The browser knows not // to do a full page refresh when you manually edit the url. locationType: 'hash', ...
Revert "fix links from test page"
Revert "fix links from test page" This reverts commit 27dd0e3170bb185e385deed11b153d86983ae0c6.
JavaScript
mit
ember-animation/liquid-fire-velocity,byelipk/liquid-fire,jrjohnson/liquid-fire,ember-animation/liquid-fire,topaxi/liquid-fire,monegraph/liquid-fire,givanse/liquid-fire,totallymike/liquid-fire,chadhietala/liquid-fire,chadhietala/liquid-fire,givanse/liquid-fire,totallymike/liquid-fire,jrjohnson/liquid-fire,knownasilya/li...
--- +++ @@ -34,7 +34,7 @@ if (environment === 'test') { // Testem prefers this... ENV.baseURL = '/'; - ENV.locationType = 'none'; + ENV.locationType = 'auto'; // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false;
234a9ac5c3e2e76a38991523eeac2a6eb425df76
tests/unit/controllers/crate/version-test.js
tests/unit/controllers/crate/version-test.js
import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; import { A } from '@ember/array'; import Service from '@ember/service'; module('Unit | Controller | crate/version', function(hooks) { setupTest(hooks); const userId = 1; // stub the session service // https://guides.emberjs....
Add a unit test for notYankedOrIsOwner (authored by @efx).
Add a unit test for notYankedOrIsOwner (authored by @efx).
JavaScript
apache-2.0
rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io,rust-lang/crates.io
--- +++ @@ -0,0 +1,35 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; +import { A } from '@ember/array'; +import Service from '@ember/service'; + +module('Unit | Controller | crate/version', function(hooks) { + setupTest(hooks); + const userId = 1; + // stub the session se...
917becac84b4fc486d05efe5e0845210fb36a139
models/List_Gender.js
models/List_Gender.js
var keystone = require('keystone'), Types = keystone.Field.Types; // Create model. Additional options allow menu name to be used what auto-generating URLs var Gender = new keystone.List('Gender', { autokey: { path: 'key', from: 'gender', unique: true }, map: { name: 'gender' } }); // Create fields Gender.add({ ge...
Add Reference list model for Genders.
Add Reference list model for Genders.
JavaScript
mit
autoboxer/MARE,autoboxer/MARE
--- +++ @@ -0,0 +1,17 @@ +var keystone = require('keystone'), + Types = keystone.Field.Types; + +// Create model. Additional options allow menu name to be used what auto-generating URLs +var Gender = new keystone.List('Gender', { + autokey: { path: 'key', from: 'gender', unique: true }, + map: { name: 'gender' } +});...
8a3599bf87bcb5dbf621f669f27d7c498cb37f2e
files/jquery.leanmodal2/2.3/jQuery.leanModal2.min.js
files/jquery.leanmodal2/2.3/jQuery.leanModal2.min.js
// jQuery.leanModal2.min.js v2.3 - MIT Licensed by eustasy http://eustasy.org (function($){function leanModal_Close(modal_id){$('.js-target-jquery-leanmodal-overlay').fadeOut(300);$(modal_id).fadeOut(200);}$.fn.extend({leanModal:function(options){var defaults={top:100,overlayOpacity:0.5,closeButton:false,disableCloseOn...
Update project jQuery.leanModal2 to 2.3
Update project jQuery.leanModal2 to 2.3
JavaScript
mit
vvo/jsdelivr,vvo/jsdelivr,vvo/jsdelivr,vvo/jsdelivr,vvo/jsdelivr
--- +++ @@ -0,0 +1,2 @@ +// jQuery.leanModal2.min.js v2.3 - MIT Licensed by eustasy http://eustasy.org +(function($){function leanModal_Close(modal_id){$('.js-target-jquery-leanmodal-overlay').fadeOut(300);$(modal_id).fadeOut(200);}$.fn.extend({leanModal:function(options){var defaults={top:100,overlayOpacity:0.5,clos...
0dd064b77199e2c8125d50017450b30acc888084
lib/helpers/helpers.js
lib/helpers/helpers.js
/** * Created by JiaHao on 5/10/15. */ var os = require('os'); function platformIsWindows() { var platform = os.platform(); return platform.indexOf('win') > -1; } module.exports = { platformIsWindows: platformIsWindows };
Add helper to check if platform is windows
Add helper to check if platform is windows
JavaScript
mit
jiahaog/Revenant
--- +++ @@ -0,0 +1,14 @@ +/** + * Created by JiaHao on 5/10/15. + */ + +var os = require('os'); + +function platformIsWindows() { + var platform = os.platform(); + return platform.indexOf('win') > -1; +} + +module.exports = { + platformIsWindows: platformIsWindows +};
ee9bafc127c84dad9b11f3f97d5c6f13a7f76732
app/components/file-upload.js
app/components/file-upload.js
import Ember from 'ember'; import EmberUploader from 'ember-uploader'; const { FileField, Uploader } = EmberUploader; export default FileField.extend({ url: '', filesDidChange(files) { const uploadUrl = this.get('url'); const uploader = Uploader.create({ url: uploadUrl }); this.sendAction('start...
import Ember from 'ember'; import EmberUploader from 'ember-uploader'; const { FileField, Uploader } = EmberUploader; const { inject, computed } = Ember; const { service } = inject; let IliosUploader = Uploader.extend({ iliosHeaders: [], ajaxSettings: function() { let settings = this._super(...arguments); ...
Send authorization headers with upload requests
Send authorization headers with upload requests Our new simple auth library doesn’t do this automatically so we have to hand it on our own.
JavaScript
mit
jrjohnson/frontend,stopfstedt/frontend,stopfstedt/frontend,gboushey/frontend,thecoolestguy/frontend,djvoa12/frontend,gabycampagna/frontend,gabycampagna/frontend,thecoolestguy/frontend,dartajax/frontend,jrjohnson/frontend,dartajax/frontend,ilios/frontend,gboushey/frontend,ilios/frontend,djvoa12/frontend
--- +++ @@ -2,13 +2,38 @@ import EmberUploader from 'ember-uploader'; const { FileField, Uploader } = EmberUploader; +const { inject, computed } = Ember; +const { service } = inject; + +let IliosUploader = Uploader.extend({ + iliosHeaders: [], + ajaxSettings: function() { + let settings = this._super(...argu...
1ec6d8f49940e603778e006617dd5823fee8b23c
backend/scripts/conversion/fixproperties.js
backend/scripts/conversion/fixproperties.js
#!/usr/bin/env node "use strict"; var ropts = { db: process.env.MCDB || 'materialscommons', port: process.env.MCDB_PORT || 30815 }; console.log(ropts); var r = require('rethinkdbdash')(ropts); var bluebird = require('bluebird'); function SetupProperty(setupID, name, description, attribute, _type, value, uni...
Add script to add properties to processes that don't have any template properties.
Add script to add properties to processes that don't have any template properties.
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,64 @@ +#!/usr/bin/env node + +"use strict"; + +var ropts = { + db: process.env.MCDB || 'materialscommons', + port: process.env.MCDB_PORT || 30815 +}; + +console.log(ropts); +var r = require('rethinkdbdash')(ropts); +var bluebird = require('bluebird'); + +function SetupProperty(setupID, name, ...
706e7e4c22a6a1c94170588ec4370dfc9fe91ed3
app/scripts/app/utils/parse-fields-metadata.js
app/scripts/app/utils/parse-fields-metadata.js
function parseFields (payload) { if (Array.isArray(payload)) { payload.forEach(parseFields); return; } if (typeof payload === 'object' && payload.hasOwnProperty('fields')) { payload.fields = JSON.parse(payload.fields); } } export default parseFields;
Move parseFields function to its own module
Move parseFields function to its own module
JavaScript
mit
darvelo/wishlist,darvelo/wishlist
--- +++ @@ -0,0 +1,12 @@ +function parseFields (payload) { + if (Array.isArray(payload)) { + payload.forEach(parseFields); + return; + } + + if (typeof payload === 'object' && payload.hasOwnProperty('fields')) { + payload.fields = JSON.parse(payload.fields); + } +} + +export default parseFields;
c5b009d7122e448fd9e726ea5c1fe1bb1617920a
test/consistency.js
test/consistency.js
var tap = require("tap") var normalize = require("../lib/normalize") var path = require("path") var fs = require("fs") var _ = require("underscore") var async = require("async") var data, clonedData tap.test("consistent normalization", function(t) { path.resolve(__dirname, "./fixtures/read-package-json.json") fs....
var tap = require("tap") var normalize = require("../lib/normalize") var path = require("path") var fs = require("fs") var _ = require("underscore") var async = require("async") var data, clonedData var warn tap.test("consistent normalization", function(t) { path.resolve(__dirname, "./fixtures/read-package-json.jso...
Add some ways to get warnings.
Add some ways to get warnings.
JavaScript
bsd-2-clause
kemitchell/normalize-package-data,sindresorhus/normalize-package-data
--- +++ @@ -6,19 +6,24 @@ var async = require("async") var data, clonedData +var warn tap.test("consistent normalization", function(t) { path.resolve(__dirname, "./fixtures/read-package-json.json") fs.readdir (__dirname + "/fixtures", function (err, entries) { + // entries = ['coffee-script.json'] // ...
062ab472fd083b2ecbb2c022aa4dc4d7a24b4a9e
tests/benchmark/compare-trianglepath-construction-with-rounded-corners.js
tests/benchmark/compare-trianglepath-construction-with-rounded-corners.js
var suite = new PerfSuite({ name: 'RedRaphael Compare Trianglepath Construction With and Without Rounded Corners', jquery: true, assets: [ '../../package/raphael-min.js', '../../source/components/raphael.trianglepath.js' ], global: { setup: function() { if (type...
Add benchmark comparison for trianglepath construction with rounded corners.
Add benchmark comparison for trianglepath construction with rounded corners.
JavaScript
mit
fusioncharts/redraphael,AyanGhatak/redraphael,AyanGhatak/redraphael,fusioncharts/redraphael,AyanGhatak/redraphael,fusioncharts/redraphael
--- +++ @@ -0,0 +1,71 @@ +var suite = new PerfSuite({ + name: 'RedRaphael Compare Trianglepath Construction With and Without Rounded Corners', + jquery: true, + + assets: [ + '../../package/raphael-min.js', + '../../source/components/raphael.trianglepath.js' + ], + + global: { + se...
7757d2986ae9890091dcb8b5f984ac30f12f9e3a
lib/ctrls/trivagoCall.js
lib/ctrls/trivagoCall.js
'use strict' const crypto = require('crypto') const config = require('../config') const rp = require('request-promise') const Q = require('q') const _ = require('lodash') var fixDate = function (date) { return (date).toISOString().split('.')[0] + 'Z' } const protocol = 'https://' const endpoint = 'api.trivago.com'...
Make a generic trivago api call function
Make a generic trivago api call function
JavaScript
mit
TrvgoHack/Propsl
--- +++ @@ -0,0 +1,59 @@ +'use strict' + +const crypto = require('crypto') +const config = require('../config') +const rp = require('request-promise') +const Q = require('q') +const _ = require('lodash') + +var fixDate = function (date) { + return (date).toISOString().split('.')[0] + 'Z' +} + +const protocol = 'http...
0f32d2e5fbf71d859dc2dcafe3d94955ca455a19
6/postgressql-insert.js
6/postgressql-insert.js
var pg = require('pg'); var uri = 'postgres://fred:12345678@localhost/mydb'; pg.connect(uri, function(err, client, done) { if (err) { return console.error('error fetching client from pool', err); } var sqlStr = 'INSERT INTO myTable (name, date) VALUES ($1, $2)'; client.query(sqlStr, [ 'Fred', new D...
Add the example to use postgres to insert data into db.
Add the example to use postgres to insert data into db.
JavaScript
mit
nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference
--- +++ @@ -0,0 +1,13 @@ +var pg = require('pg'); +var uri = 'postgres://fred:12345678@localhost/mydb'; + +pg.connect(uri, function(err, client, done) { + if (err) { + return console.error('error fetching client from pool', err); + } + + var sqlStr = 'INSERT INTO myTable (name, date) VALUES ($1, $2)'; +...
cd2ea8efaaf7805df173c625d3938744273d5d9c
tests/unit/utilities/open-editor-test.js
tests/unit/utilities/open-editor-test.js
'use strict'; var openEditor = require('../../../lib/utilities/open-editor'); var expect = require('chai').expect; var td = require('testdouble'); describe('open-editor', function() { beforeEach(function() { td.replace(openEditor, '_env'); td.replace(openEditor, '_spawn'); }); afterEach(function() { ...
Add tests for "open-editor" utility
tests: Add tests for "open-editor" utility
JavaScript
mit
pzuraq/ember-cli,ef4/ember-cli,seawatts/ember-cli,patocallaghan/ember-cli,sivakumar-kailasam/ember-cli,jasonmit/ember-cli,fpauser/ember-cli,fpauser/ember-cli,Turbo87/ember-cli,mike-north/ember-cli,williamsbdev/ember-cli,rtablada/ember-cli,xtian/ember-cli,johanneswuerbach/ember-cli,lazybensch/ember-cli,givanse/ember-cli...
--- +++ @@ -0,0 +1,42 @@ +'use strict'; + +var openEditor = require('../../../lib/utilities/open-editor'); + +var expect = require('chai').expect; +var td = require('testdouble'); + +describe('open-editor', function() { + beforeEach(function() { + td.replace(openEditor, '_env'); + td.replace(openEditor, '_spaw...
99172fb251dd0dc052f7056e44751fe0851ecd15
test/resources/untyped-acl-ttl.js
test/resources/untyped-acl-ttl.js
module.exports = `@prefix acl: <http://www.w3.org/ns/auth/acl#>. @prefix foaf: <http://xmlns.com/foaf/0.1/> . <#authorization> # Not present: a acl:Authorization; acl:agent <https://alice.example.com/#me>; acl:accessTo <https://alice.example.com/docs/file1>; acl:mode acl:Read, acl:Wri...
Add untyped acl test resource
Add untyped acl test resource
JavaScript
mit
solid/solid-permissions
--- +++ @@ -0,0 +1,11 @@ +module.exports = `@prefix acl: <http://www.w3.org/ns/auth/acl#>. +@prefix foaf: <http://xmlns.com/foaf/0.1/> . + +<#authorization> + # Not present: a acl:Authorization; + + acl:agent + <https://alice.example.com/#me>; + acl:accessTo <https://alice.example.com/docs/file1>; + ...
7b8f2bebfaef9da1d59fd9cf25e93cebce4e9f19
backfeed.js
backfeed.js
/* backfeed.js */ var Backfeed = (function() { "use strict"; //define classes to add/remove const errorStatusClass = 'glyphicon-remove'; const errorGroupClass = 'has-error'; const successStatusClass = 'glyphicon-ok'; const successGroupClass = 'has-success'; //attach change listeners to each input var w...
Add first version of code.
Add first version of code. Until this point, development of this javascript was handled through codepen. However, this side project has reached a level of ambition that requires the power of real version control.
JavaScript
mit
whereswaldon/backfeed,whereswaldon/bill
--- +++ @@ -0,0 +1,66 @@ +/* backfeed.js */ +var Backfeed = (function() { + "use strict"; + //define classes to add/remove + const errorStatusClass = 'glyphicon-remove'; + const errorGroupClass = 'has-error'; + const successStatusClass = 'glyphicon-ok'; + const successGroupClass = 'has-success'; + + //attach c...
66864cbe083386e1f8b748f59938f8fd6b055199
src/answer_generators/zillow/zillow_link.js
src/answer_generators/zillow/zillow_link.js
/*jslint continue: true, devel: true, evil: true, indent: 2, plusplus: true, rhino: true, unparam: true, vars: true, white: true */ function isNonBlankString(s) { 'use strict'; return s && (s.trim().length > 0); } function generateResults(recognitionResults, q, context) { 'use strict'; var list = recognition...
Add Zillow link Answer Generator
Add Zillow link Answer Generator
JavaScript
apache-2.0
jtsay362/solveforall-example-plugins,jtsay362/solveforall-example-plugins
--- +++ @@ -0,0 +1,74 @@ +/*jslint continue: true, devel: true, evil: true, indent: 2, plusplus: true, rhino: true, unparam: true, vars: true, white: true */ +function isNonBlankString(s) { + 'use strict'; + return s && (s.trim().length > 0); +} + + +function generateResults(recognitionResults, q, context) { + 'us...
fe94556ea4dd84965662dabbba7e4c32f2402968
ui/src/shared/components/SourceIndicator.js
ui/src/shared/components/SourceIndicator.js
import React, {PropTypes} from 'react'; const SourceIndicator = React.createClass({ propTypes: { source: PropTypes.shape({}).isRequired, }, render() { const {source} = this.props; return ( <div className="source-indicator"> <span className="icon server"></span> {source && sourc...
import React, {PropTypes} from 'react'; const SourceIndicator = React.createClass({ propTypes: { sourceName: PropTypes.string, }, render() { const {sourceName} = this.props; if (!sourceName) { return null; } return ( <div className="source-indicator"> <span className="ico...
Change sourceIndicator to receive a string instead of an object
Change sourceIndicator to receive a string instead of an object
JavaScript
mit
influxdata/influxdb,influxdata/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdb/influxdb,nooproblem/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,...
--- +++ @@ -2,15 +2,18 @@ const SourceIndicator = React.createClass({ propTypes: { - source: PropTypes.shape({}).isRequired, + sourceName: PropTypes.string, }, render() { - const {source} = this.props; + const {sourceName} = this.props; + if (!sourceName) { + return null; + } ...
893eb08b44602119f0839f04a74703de033ae2d7
src/languages/ceylon.js
src/languages/ceylon.js
/* Language: Ceylon Author: Lucas Werkmeister <mail@lucaswerkmeister.de> */ function(hljs) { // 2.3. Identifiers and keywords var KEYWORDS = 'assembly module package import alias class interface object given value ' + 'assign void function new of extends satisfies abstracts in out return ' + 'break cont...
Add first version of Ceylon language file
Add first version of Ceylon language file
JavaScript
bsd-3-clause
liang42hao/highlight.js,highlightjs/highlight.js,adjohnson916/highlight.js,daimor/highlight.js,highlightjs/highlight.js,robconery/highlight.js,abhishekgahlot/highlight.js,weiyibin/highlight.js,delebash/highlight.js,sourrust/highlight.js,STRML/highlight.js,0x7fffffff/highlight.js,brennced/highlight.js,daimor/highlight.j...
--- +++ @@ -0,0 +1,29 @@ +/* +Language: Ceylon +Author: Lucas Werkmeister <mail@lucaswerkmeister.de> +*/ +function(hljs) { + // 2.3. Identifiers and keywords + var KEYWORDS = + 'assembly module package import alias class interface object given value ' + + 'assign void function new of extends satisfies abstrac...
88fe9e90862113d5207ab339a1e9a47c9bb8ef5d
chat-plugins/music-box.js
chat-plugins/music-box.js
/* Music Box chat-plugin * parses links into the HTML for music boxes * by panpawn */ var https = require("https"); exports.commands = { musicbox: function (target, room, user) { if (!target) return this.sendReply("/musicbox link, link, link - parses it to be in a music box") this.sendReply(par...
Implement music box parsing command
Implement music box parsing command
JavaScript
mit
BuzzyOG/Pokemon-Showdown,panpawn/Pokemon-Showdown,BuzzyOG/Pokemon-Showdown,panpawn/Gold-Server,Git-Worm/City-PS,panpawn/Gold-Server,BuzzyOG/Pokemon-Showdown,Git-Worm/City-PS,panpawn/Gold-Server,panpawn/Pokemon-Showdown
--- +++ @@ -0,0 +1,36 @@ +/* Music Box chat-plugin + * parses links into the HTML for music boxes + * by panpawn + */ + +var https = require("https"); + +exports.commands = { + musicbox: function (target, room, user) { + if (!target) return this.sendReply("/musicbox link, link, link - parses it to be in a m...
d894cec86eee44dfd07d3e906e80d4de145fafc8
static/service-worker.js
static/service-worker.js
var CACHE_NAME = 'v1' var CAHCED_DEFAULTS = [ '/', '/styles/main.css', '/styles/normalize.css', '/scripts/main.js', '/slides.json', 'https://fonts.googleapis.com/css?family=Material+Icons|Roboto:400,700' ] this.addEventListener('install', onInstall) this.addEventListener('fetch', onFet...
Fix service worker (sw path and scope were messed up)
Fix service worker (sw path and scope were messed up)
JavaScript
unlicense
ghzmdr/showtell,ghzmdr/showtell
--- +++ @@ -0,0 +1,65 @@ +var CACHE_NAME = 'v1' + +var CAHCED_DEFAULTS = [ + '/', + + '/styles/main.css', + '/styles/normalize.css', + + '/scripts/main.js', + + '/slides.json', + + 'https://fonts.googleapis.com/css?family=Material+Icons|Roboto:400,700' +] + +this.addEventListener('install', onIn...
f4c84d9c9b2cf7a15b947a6a1cb8d86e485431df
blueprints/ember-purify/index.js
blueprints/ember-purify/index.js
/*jshint node:true*/ module.exports = { name: 'ember-purify', afterinstall: function(options) { this.addBowerPackageToProject('DOMPurify', '^0.8.3'); } };
Install bower deps on addon install
Install bower deps on addon install
JavaScript
mit
sivakumar-kailasam/ember-purify,sivakumar-kailasam/ember-purify
--- +++ @@ -0,0 +1,8 @@ +/*jshint node:true*/ +module.exports = { + name: 'ember-purify', + + afterinstall: function(options) { + this.addBowerPackageToProject('DOMPurify', '^0.8.3'); + } +};
184cd407f85f39d310516672fa04a18dff7c4b0c
src/colors.js
src/colors.js
define([], function() { return { getColor: function(colorSeries, boundsArray, val) { for (var i in boundsArray) { if ((val-boundsArray[i]>=0) && (val-boundsArray[parseInt(i)+1]<0)) { return colorSeries[boundsArray.length][i]; } } ...
Make color information available to iwindow
Make color information available to iwindow No user-visible changes. If you don't plan to use the tract colors in the info window, disregard.
JavaScript
mit
codeforboston/ungentry,codeforboston/ungentry,codeforboston/ungentry,codeforboston/ungentry,codeforboston/ungentry
--- +++ @@ -0,0 +1,12 @@ +define([], function() { + return { + getColor: function(colorSeries, boundsArray, val) { + for (var i in boundsArray) { + if ((val-boundsArray[i]>=0) && (val-boundsArray[parseInt(i)+1]<0)) { + return colorSeries[boundsArray.length][i]; + ...
4be233251a810e6a74c3ffa271378e91e0148dca
backend/servers/mcapid/lib/dal/__tests__/files-tests.js
backend/servers/mcapid/lib/dal/__tests__/files-tests.js
const r = require('@lib/r'); const files = require('@dal/files')(r); const tutil = require('@lib/test-utils')(r); const dirUtils = require('@dal/dir-utils')(r); describe('Test moveFileToDirectory', () => { let project, dir1, fileInDir1; beforeAll(async() => { project = await tutil.createTestProject();...
Add tests for moving a file
Add tests for moving a file
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,31 @@ +const r = require('@lib/r'); +const files = require('@dal/files')(r); +const tutil = require('@lib/test-utils')(r); +const dirUtils = require('@dal/dir-utils')(r); + +describe('Test moveFileToDirectory', () => { + let project, dir1, fileInDir1; + + beforeAll(async() => { + proje...
ce177a9a20ddbe09072d0780069c8a49bc836cb0
lib/node_modules/@stdlib/repl/ctor/lib/workspace_aliases.js
lib/node_modules/@stdlib/repl/ctor/lib/workspace_aliases.js
/** * @license Apache-2.0 * * Copyright (c) 2019 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
Document workspace API completable arguments
Document workspace API completable arguments
JavaScript
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
--- +++ @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses...
76a2946b6dbb184bf252dd1c8b4d25e554e85499
lib/node_modules/@stdlib/process/umask/scripts/binary_to_symbolic.js
lib/node_modules/@stdlib/process/umask/scripts/binary_to_symbolic.js
'use strict'; var toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); var lpad = require( '@stdlib/string/left-pad' ); // Set this to "pretty" print results: var PRETTY_PRINT = false; var TOTAL; var masks; var bstr; var perm; var who; var tmp; var i; var j; // Total number of combinations (oc...
Add script to convert from binary representation to symbolic notation
Add script to convert from binary representation to symbolic notation
JavaScript
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
--- +++ @@ -0,0 +1,74 @@ +'use strict'; + +var toBinaryString = require( '@stdlib/number/uint16/base/to-binary-string' ); +var lpad = require( '@stdlib/string/left-pad' ); + +// Set this to "pretty" print results: +var PRETTY_PRINT = false; + +var TOTAL; +var masks; +var bstr; +var perm; +var who; +var tmp; +var i; +...
810af368e821a4ae67972ce3d03ccbfb7d155983
lib/service.js
lib/service.js
module.exports = function(options, callback) { var fs = require('fs'), restify = require('restify'), util = require('util'); var serverOptions = { name: 'queixinhas-API', version: '0.0.1' }; var server = restify.createServer(serverOptions); server.use(restify.acceptParser(server.accept...
Add the POST method for /images and /reports
Add the POST method for /images and /reports
JavaScript
mit
queixinhas/queixinhas-api
--- +++ @@ -0,0 +1,104 @@ +module.exports = function(options, callback) { + + var fs = require('fs'), + restify = require('restify'), + util = require('util'); + + var serverOptions = { + name: 'queixinhas-API', + version: '0.0.1' + }; + + var server = restify.createServer(serverOptions); + + ser...
361b0aad5ce1fb53ebc1558540f5076f5ec8dbb0
spec/confirm-challenge-list-spec.js
spec/confirm-challenge-list-spec.js
/* eslint-disable no-undef */ const controllers = require('../controllers'); // const db = require('../utils').db; const fixtures = require('../spec/fixtures'); const Challenges = new controllers.Challenges(); // const Performances = new controllers.Performances(); // const Results = new controllers.Results(); // cons...
Add test challenge list test
Add test challenge list test
JavaScript
mit
osumb/challenges,osumb/challenges,osumb/challenges,osumb/challenges
--- +++ @@ -0,0 +1,74 @@ +/* eslint-disable no-undef */ +const controllers = require('../controllers'); +// const db = require('../utils').db; +const fixtures = require('../spec/fixtures'); + +const Challenges = new controllers.Challenges(); +// const Performances = new controllers.Performances(); +// const Results =...
eb24559fd611dbfa6b125938809a7c016a37f46a
ut/tabPanes_TimePaneSpec.js
ut/tabPanes_TimePaneSpec.js
describe('tab-panes TimePaneCtrler', function() { var $rootScope; var $controller; beforeEach(module('popupApp')); beforeEach(inject(function(_$rootScope_, _$controller_) { $rootScope = _$rootScope_; $controller = _$controller_; })); function StoreItemFactoryMock() { return { loadItem: function(keys, st...
Create a spec for TimePaneCtrler
Create a spec for TimePaneCtrler
JavaScript
apache-2.0
shioyang/IDontDisturbMe,shioyang/IDontDisturbMe
--- +++ @@ -0,0 +1,45 @@ +describe('tab-panes TimePaneCtrler', function() { + var $rootScope; + var $controller; + beforeEach(module('popupApp')); + beforeEach(inject(function(_$rootScope_, _$controller_) { + $rootScope = _$rootScope_; + $controller = _$controller_; + })); + + function StoreItemFactoryMock() { + r...
1b2a2de06e98c609ed6832b9e85b1961c913c0d6
morse-codec.js
morse-codec.js
var morseCodec = function(options) { if (typeof options === 'undefined') { options = {}; } this.versions = { 'ITC': 'itc' }; var ditDuration = options.ditDuration || 100; var dahDuration = ditDuration * 3; var characterSeparationDuration = ditDuration * 3; var wordSepar...
Add library for handling morse code. This will be tapped when we want to send a pattern from the "not-yet-created" lights module.
Add library for handling morse code. This will be tapped when we want to send a pattern from the "not-yet-created" lights module. The current example is taking the number of active-builds and using that value as a pattern. Ex.) three active builds => ...-- where each dit/dah corresponds to lights being on (difference ...
JavaScript
mit
ritterim/sparkles
--- +++ @@ -0,0 +1,108 @@ +var morseCodec = function(options) { + if (typeof options === 'undefined') { + options = {}; + } + + this.versions = { + 'ITC': 'itc' + }; + + var ditDuration = options.ditDuration || 100; + var dahDuration = ditDuration * 3; + var characterSeparationDurat...
ad40a8a6eb20d07b6701680847d5d895415ea38f
bin/npm-yarn-compare.js
bin/npm-yarn-compare.js
#!/usr/bin/env node process.title = 'npm-yarn-compare'; let child_process = require('child_process'), prettyMs = require('pretty-ms'), clc = require('cli-color'); let packageName = process.argv[2]; console.log('🛀 Checking if yarn is installed...'); let cmdExist = child_process.execSync('hash yarn').toStrin...
Add binary with v1 code.
Add binary with v1 code.
JavaScript
mit
supreetpal/npmvsyarn
--- +++ @@ -0,0 +1,44 @@ +#!/usr/bin/env node + +process.title = 'npm-yarn-compare'; + +let child_process = require('child_process'), + prettyMs = require('pretty-ms'), + clc = require('cli-color'); + +let packageName = process.argv[2]; + +console.log('🛀 Checking if yarn is installed...'); +let cmdExist = chil...
4891d09f6754607b7b41551ea2a421588552db69
javascript/control_structure/control.js
javascript/control_structure/control.js
// operator if..elseif..else /* JavaScript has a similar set of control structures to other languages in the C family. Conditional statements are supported by if and else; you can chain them together if you like: */ var name = "Nick"; if ( name == "Mark"){ name+= "!"; }else if( name == "Nick"){ name +="!!"; }...
Structure of the operators if else
Structure of the operators if else
JavaScript
mit
niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript,niksolaz/Learning-Javacript
--- +++ @@ -0,0 +1,22 @@ +// operator if..elseif..else +/* +JavaScript has a similar set of control structures to other languages in the C family. +Conditional statements are supported by if and else; you can chain them together if you like: +*/ + +var name = "Nick"; +if ( name == "Mark"){ + name+= "!"; +}else if...
34280c7360244fea4918c829cf4045919bfc9498
www/js/init.js
www/js/init.js
// Insert script into the DOM function insertScript(src) { var a=document.createElement("script"); a.src=src; document.head.appendChild(a); } insertScript("https://raw.githubusercontent.com/salbahra/Sprinklers/master/www/js/jquery.min.js"); insertScript("https://raw.githubusercontent.com/salbahra/Sprinkler...
Add loader for Arduino firmware
Base: Add loader for Arduino firmware Point the Javascript URL to this URL: http://raw.githubusercontent.com/salbahra/Sprinklers/master/www/js/ This will automatically intercept the UI and load the mobile app instead
JavaScript
agpl-3.0
OpenSprinkler/OpenSprinkler-App,OpenSprinkler/OpenSprinkler-App,OpenSprinkler/OpenSprinkler-App,PeteBa/OpenSprinkler-App,PeteBa/OpenSprinkler-App,PeteBa/OpenSprinkler-App
--- +++ @@ -0,0 +1,38 @@ +// Insert script into the DOM +function insertScript(src) { + var a=document.createElement("script"); + a.src=src; + document.head.appendChild(a); +} + +insertScript("https://raw.githubusercontent.com/salbahra/Sprinklers/master/www/js/jquery.min.js"); +insertScript("https://raw.gith...
699a80458b1d7d3617b9d505ccd73fce99bca01f
src/trade-type-picker/helpText.js
src/trade-type-picker/helpText.js
export default ({ CALL: 'You win the payout if the exit spot is strictly higher than the entry spot.', PUT: 'You win the payout if the exit spot is strictly lower than the entry spot.', CALL2: 'You win the payout if the exit spot is strictly higher than the barrier.', PUT2: 'You win the payout if the ex...
Add help text for trading types
Add help text for trading types
JavaScript
mit
nuruddeensalihu/binary-next-gen,nuruddeensalihu/binary-next-gen,nazaninreihani/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen,nuruddeensalihu/binary-next-gen,binary-com/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen
--- +++ @@ -0,0 +1,22 @@ +export default ({ + CALL: 'You win the payout if the exit spot is strictly higher than the entry spot.', + PUT: 'You win the payout if the exit spot is strictly lower than the entry spot.', + CALL2: 'You win the payout if the exit spot is strictly higher than the barrier.', + PUT...
009e91723f6161dbe7bb08a2e607b2c4271bde74
test/test431.js
test/test431.js
if(typeof exports === 'object') { var assert = require("assert"); var alasql = require('..'); } describe('Test 431 error in 8 and 108 convert formats', function() { it('1. Should format time correctly', function(done) { var date = new Date(2016, 0, 1, 0, 0, 0); var correctTime = '00:00:00'; var res = ala...
Test for time conversion fix
Test for time conversion fix
JavaScript
mit
agershun/alasql,kanghj/alasql,kanghj/alasql,agershun/alasql,kanghj/alasql,agershun/alasql,agershun/alasql
--- +++ @@ -0,0 +1,17 @@ +if(typeof exports === 'object') { + var assert = require("assert"); + var alasql = require('..'); +} +describe('Test 431 error in 8 and 108 convert formats', function() { + + it('1. Should format time correctly', function(done) { + var date = new Date(2016, 0, 1, 0, 0, 0); + var correct...
f8d34c9c3b5e3f322ead929b4032d0e5c533e2cd
test/test10.js
test/test10.js
// Test suite for woad. // Run from 'test' subfolder 'use strict'; const lg = require('../woad.js'); const test = require('unit.js'); const fs = require('fs'); function testFunc() { console.log('test10 started - testing duplicate name.'); const fname1 = './test10f1.txt'; const fname2 = './test10f2.txt'; const tnam...
Test for duplicate name added.
Test for duplicate name added.
JavaScript
mit
kelvin-martin/woad
--- +++ @@ -0,0 +1,69 @@ +// Test suite for woad. +// Run from 'test' subfolder +'use strict'; +const lg = require('../woad.js'); +const test = require('unit.js'); +const fs = require('fs'); + +function testFunc() { + console.log('test10 started - testing duplicate name.'); + const fname1 = './test10f1.txt'; + const ...
8e1afd54645731ae67d115506e2a9cff418e2980
website/core/AltGridBlock.js
website/core/AltGridBlock.js
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ 'use strict'; const React = require('react'); const classNames = require('classnames'); class GridBlock extends R...
Introduce GridBlock component that doesn't parse markdown
Introduce GridBlock component that doesn't parse markdown Reviewed By: jstejada Differential Revision: D26202230 fbshipit-source-id: fa3fc259e1fc34ef5ce383c142ee45963e3354d6
JavaScript
mit
yungsters/relay,voideanvalue/relay,atxwebs/relay,kassens/relay,wincent/relay,facebook/relay,kassens/relay,wincent/relay,atxwebs/relay,wincent/relay,wincent/relay,voideanvalue/relay,josephsavona/relay,xuorig/relay,atxwebs/relay,josephsavona/relay,wincent/relay,facebook/relay,xuorig/relay,facebook/relay,kassens/relay,yun...
--- +++ @@ -0,0 +1,103 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +'use strict'; + +const React = require('react'); + +const classNames = require...
3637584f3c858a5025494d508193302e8a1cd8f8
test/hamjestSpec.js
test/hamjestSpec.js
'use strict'; var _ = require('lodash-node') , hamjest = require('../lib/hamjest') , assertFalse = require('./asserts').assertFalse ; describe('hamjest', function () { it('should not export undefined matchers', function () { _.forEach(hamjest, function (value, key) { assertFalse(_.isUndefined(value), 'Undefi...
Add minimal sanity test for hamjest exports
Add minimal sanity test for hamjest exports
JavaScript
mit
rluba/hamjest,rluba/hamjest
--- +++ @@ -0,0 +1,14 @@ +'use strict'; + +var _ = require('lodash-node') + , hamjest = require('../lib/hamjest') + , assertFalse = require('./asserts').assertFalse + ; + +describe('hamjest', function () { + it('should not export undefined matchers', function () { + _.forEach(hamjest, function (value, key) { + ass...
a38d85b0914b7fbcd3e30d7776390605d6c08d4e
examples/fisherman.js
examples/fisherman.js
const mineflayer = require('mineflayer') if (process.argv.length < 4 || process.argv.length > 6) { console.log('Usage : node scoreboard.js <host> <port> [<name>] [<password>]') process.exit(1) } const bot = mineflayer.createBot({ host: process.argv[2], port: parseInt(process.argv[3]), username: process.argv...
Add fishing and consume example
Add fishing and consume example
JavaScript
mit
PrismarineJS/mineflayer,andrewrk/mineflayer
--- +++ @@ -0,0 +1,89 @@ +const mineflayer = require('mineflayer') + +if (process.argv.length < 4 || process.argv.length > 6) { + console.log('Usage : node scoreboard.js <host> <port> [<name>] [<password>]') + process.exit(1) +} + +const bot = mineflayer.createBot({ + host: process.argv[2], + port: parseInt(proce...
4a1389a2844388d11b595a7fc7cf85213ce2e221
public/javascript/accountKitLogin.js
public/javascript/accountKitLogin.js
// initialize Account Kit with CSRF protection AccountKit_OnInteractive = function () { AccountKit.init( { appId: '169812573551460', state: 'csrf', version: 'v1.1', fbAppEventsEnabled: true, debug: true } ) } // login callback function loginCallback (...
Create handling of accountKit in client side
Create handling of accountKit in client side
JavaScript
mit
chandrajob365/ChatApp,chandrajob365/ChatApp
--- +++ @@ -0,0 +1,40 @@ +// initialize Account Kit with CSRF protection + AccountKit_OnInteractive = function () { + AccountKit.init( + { + appId: '169812573551460', + state: 'csrf', + version: 'v1.1', + fbAppEventsEnabled: true, + debug: true + } + ) + } + + // ...
49f2e660460a8fe3efb64e8037dd5a943f3a9999
public_html/type-racer-controller.js
public_html/type-racer-controller.js
function TypeRacerCtrl($scope) { this.selectedLevelName; this.selectedLevelSpeed; this.playerName; this.$onInit = function() { this.levels = [ { levelName: 'Beginner', charsPerSecond: 3 }, { levelName: 'Inte...
Add the controller for the type racer game.
Add the controller for the type racer game.
JavaScript
mit
gbelwariar/TypeRacer,gbelwariar/TypeRacer
--- +++ @@ -0,0 +1,55 @@ +function TypeRacerCtrl($scope) { + this.selectedLevelName; + this.selectedLevelSpeed; + this.playerName; + + this.$onInit = function() { + this.levels = [ + { + levelName: 'Beginner', + charsPerSecond: 3 + }, + ...
bb471dc55d06a5851acd35bb4ca79ee3811c6f0a
packages/es-components/src/components/base/spinner/Spinner.specs.js
packages/es-components/src/components/base/spinner/Spinner.specs.js
/* eslint-env jest */ import React from 'react'; import { render, cleanup } from 'react-testing-library'; import Spinner from './Spinner'; beforeEach(cleanup); it('does not include title when not provided', () => { const { queryByText } = render( <Spinner description="test spinner description" /> ); expect...
Add tests to Spinner component
Update: Add tests to Spinner component
JavaScript
mit
TWExchangeSolutions/es-components,jrios/es-components,TWExchangeSolutions/es-components,jrios/es-components,jrios/es-components
--- +++ @@ -0,0 +1,33 @@ +/* eslint-env jest */ + +import React from 'react'; +import { render, cleanup } from 'react-testing-library'; +import Spinner from './Spinner'; + +beforeEach(cleanup); + +it('does not include title when not provided', () => { + const { queryByText } = render( + <Spinner description="test...
eb6590a9b0685b1f36905bacfec1f1a9027f00d4
tools/nipponPrinterTests.js
tools/nipponPrinterTests.js
const minimist = require('minimist') const SerialPort = require('serialport') const portOptions = { autoOpen: false, baudRate: 115200, parity: 'odd', dataBits: 8, stopBits: 1, rtscts: false, xon: true, xoff: true } const args = minimist(process.argv.slice(2)) const device = args.dev || '/dev/ttyJ5' co...
Add test script for the Nippon kiosk printer
Add test script for the Nippon kiosk printer
JavaScript
unlicense
lamassu/lamassu-machine,lamassu/lamassu-machine,lamassu/lamassu-machine,lamassu/lamassu-machine
--- +++ @@ -0,0 +1,52 @@ +const minimist = require('minimist') +const SerialPort = require('serialport') + +const portOptions = { + autoOpen: false, + baudRate: 115200, + parity: 'odd', + dataBits: 8, + stopBits: 1, + rtscts: false, + xon: true, + xoff: true +} + +const args = minimist(process.argv.slice(2)) ...
e606304f9d074c8541aa45e376bb6cf3cc14137a
test/reducers/shogi/enhanceCanDropPosition_test.js
test/reducers/shogi/enhanceCanDropPosition_test.js
import shogi from '../../../frontend/reducers/shogi'; import * as Action from '../../../frontend/actions'; import Piece from '../../../frontend/src/shogi/piece'; import Board from '../../../frontend/src/shogi/board'; import memo from 'memo-is'; describe('shogi', () => { describe('ENHANCE_CAN_DROP_PIECE', () => { ...
Add reducer test for ENHANCE_CAN_DROP_PIECE.
Add reducer test for ENHANCE_CAN_DROP_PIECE.
JavaScript
mit
mgi166/usi-front,mgi166/usi-front
--- +++ @@ -0,0 +1,64 @@ +import shogi from '../../../frontend/reducers/shogi'; +import * as Action from '../../../frontend/actions'; +import Piece from '../../../frontend/src/shogi/piece'; +import Board from '../../../frontend/src/shogi/board'; +import memo from 'memo-is'; + +describe('shogi', () => { + describe('E...
f99b4a72a5871b49dd95fa41bdf66ada81912e7e
test/plugin/in/client_test.js
test/plugin/in/client_test.js
var client = require('../../../lib/plugin/in/client.js'), nock = require('nock'), here = require('here').here; describe('input plugin: client', function(){ var mockApiUrl = "http://test.com/json"; beforeEach(function(done) { var testJsonApiResponse = here(/* { "data": { "bio": ...
Add input plugin test. - client plugin added.
Add input plugin test. - client plugin added.
JavaScript
mit
hideack/evac
--- +++ @@ -0,0 +1,42 @@ +var client = require('../../../lib/plugin/in/client.js'), + nock = require('nock'), + here = require('here').here; + +describe('input plugin: client', function(){ + var mockApiUrl = "http://test.com/json"; + + beforeEach(function(done) { + var testJsonApiResponse = here(/* + { ...
74fcbee17bd99b0586a155b0794f561428181660
test/config/templates-schema.js
test/config/templates-schema.js
const fs = require('fs'); const path = require('path'); const jsYaml = require('js-yaml'); const should = require('should'); // eslint-disable-next-line no-unused-vars const Config = require('../../lib/config'); const schema = require('../../lib/schemas'); describe('EG templates schema validation', () => { ['basic',...
Add template json schema test
Add template json schema test
JavaScript
apache-2.0
ExpressGateway/express-gateway
--- +++ @@ -0,0 +1,19 @@ +const fs = require('fs'); +const path = require('path'); +const jsYaml = require('js-yaml'); +const should = require('should'); +// eslint-disable-next-line no-unused-vars +const Config = require('../../lib/config'); +const schema = require('../../lib/schemas'); + +describe('EG templates sch...
8cef34add0bbe730f4046faa9616aa99533bbe23
test/BitwiseHash.js
test/BitwiseHash.js
var assert = require('assert'), BitwiseHash = require('./../lib/BitwiseHash'); describe('BitwiseHash', function () { it('Should create instance', function () { var hash = new BitwiseHash('some data'); assert(hash instanceof BitwiseHash, 'Should be instance of BitwiseHash'); }); it('Sho...
Add test for bitwise hash
Add test for bitwise hash
JavaScript
mit
ghaiklor/data-2-hash
--- +++ @@ -0,0 +1,25 @@ +var assert = require('assert'), + BitwiseHash = require('./../lib/BitwiseHash'); + +describe('BitwiseHash', function () { + it('Should create instance', function () { + var hash = new BitwiseHash('some data'); + assert(hash instanceof BitwiseHash, 'Should be instance of B...
246fdaece68ae60c6f25fa59f27d9c4183371b9b
lib/logger.js
lib/logger.js
var Logger = function (config) { this.config = config; this.backend = this.config.backend || 'stdout' this.level = this.config.level || "LOG_INFO" if (this.backend == 'stdout') { this.util = require('util'); } else { if (this.backend == 'syslog') { this.util = require('node-syslog'); th...
var Logger = function (config) { this.config = config; this.backend = this.config.backend || 'stdout' this.level = this.config.level || "LOG_INFO" if (this.backend == 'stdout') { this.util = require('util'); } else { if (this.backend == 'syslog') { this.util = require('node-syslog'); th...
Tweak log formating to append colon and space to stdout type.
Tweak log formating to append colon and space to stdout type.
JavaScript
mit
VivienBarousse/statsd,blurredbits/statsd,tuxinaut/statsd,bmhatfield/statsd,DataDog/statsd,pagerinc/statsd,atsid/statsd,jmptrader/statsd,zzzbit/statsd,jxqlovejava/statsd,jxqlovejava/statsd,ngpestelos/statsd,jmptrader/statsd,tuxinaut/statsd,omniti-labs/statsd,ShalomCohen/statsd,Charlesdong/statsd,wyzssw/statsd,zzzbit/sta...
--- +++ @@ -18,9 +18,9 @@ log: function (msg, type) { if (this.backend == 'stdout') { if (!type) { - type = 'DEBUG: '; + type = 'DEBUG'; } - this.util.log(type + msg); + this.util.log(type + ": " + msg); } else { if (!type) { type = this.level
5baba1ee915859c95d0c3d1a5d56861f8a66df36
16/graphicsmagick-resize.js
16/graphicsmagick-resize.js
var gm = require('gm'); var dirpath = 'images/'; var imgname = 'download-logo.png'; var tmppath = 'tmp/'; gm(dirpath + imgname) .resize(300, 200) .write(tmppath + 'New_' + imgname, function (err) { if (err) throw err; console.log('done'); });
Add the example to resize the image file via garphicsmagick.
Add the example to resize the image file via garphicsmagick.
JavaScript
mit
nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference
--- +++ @@ -0,0 +1,13 @@ +var gm = require('gm'); +var dirpath = 'images/'; +var imgname = 'download-logo.png'; +var tmppath = 'tmp/'; + +gm(dirpath + imgname) + + .resize(300, 200) + .write(tmppath + 'New_' + imgname, function (err) { + if (err) + throw err; + console.log('done'); +...
bde9bf0bd609a89609088e4903fd921f0acdbe78
lib/compiler/ChildCompiler.js
lib/compiler/ChildCompiler.js
var extend = require('extend'); var Promise = require('bluebird'); var PluginError = require('../utils/PluginError'); /** * @param {Compilation} compilation * @param {Object} options * @param {string} options.name Name required, because it used as cache kay in parent compilation. * @param {string} [options.context...
Add promise wrapper over the child compiler
Add promise wrapper over the child compiler
JavaScript
mit
kisenka/docpack,kisenka/webpack-docs-plugin
--- +++ @@ -0,0 +1,64 @@ +var extend = require('extend'); +var Promise = require('bluebird'); +var PluginError = require('../utils/PluginError'); + +/** + * @param {Compilation} compilation + * @param {Object} options + * @param {string} options.name Name required, because it used as cache kay in parent compilation. ...
1f02ea68b643c87e2031f0a4d1ca870849708d65
test/kanban-board.spec.js
test/kanban-board.spec.js
import Board from '../src/components/kanban-board.vue' describe("KanbanBoard", () => { it("should have child components", () => { expect(Board.components.KanbanList).to.be.an('object') }) it("should have computed properties", () => { expect(Board.computed).to.be.an('object') expect...
Add tests for board vue component
Add tests for board vue component
JavaScript
mit
drayah/xerpa-kanban,drayah/xerpa-kanban
--- +++ @@ -0,0 +1,14 @@ +import Board from '../src/components/kanban-board.vue' + +describe("KanbanBoard", () => { + it("should have child components", () => { + expect(Board.components.KanbanList).to.be.an('object') + }) + + it("should have computed properties", () => { + expect(Board.compute...
2887771f4aa39e4065c43f485f308e23e5a4aec7
packages/backbone/package.js
packages/backbone/package.js
Package.describe({ summary: "A minimalist client-side MVC framework" }); Package.on_use(function (api) { // XXX Backbone requires either jquery or zepto api.use("jquery"); api.add_files("backbone.js", "client"); });
Package.describe({ summary: "A minimalist client-side MVC framework" }); Package.on_use(function (api, where) { // XXX Backbone requires either jquery or zepto api.use(["jquery", "json"]); where = where || ['client', 'server']; api.add_files("backbone.js", where); });
Allow backbone on the server also.
Allow backbone on the server also. Also, add json dependency.
JavaScript
mit
hristaki/meteor,TribeMedia/meteor,SeanOceanHu/meteor,akintoey/meteor,fashionsun/meteor,deanius/meteor,eluck/meteor,karlito40/meteor,meonkeys/meteor,pjump/meteor,AnjirHossain/meteor,sdeveloper/meteor,IveWong/meteor,jdivy/meteor,HugoRLopes/meteor,jenalgit/meteor,joannekoong/meteor,pjump/meteor,chasertech/meteor,D1no/mete...
--- +++ @@ -2,9 +2,10 @@ summary: "A minimalist client-side MVC framework" }); -Package.on_use(function (api) { +Package.on_use(function (api, where) { // XXX Backbone requires either jquery or zepto - api.use("jquery"); + api.use(["jquery", "json"]); - api.add_files("backbone.js", "client"); + where =...
bc79b09f2081e7af016580f6a383aee322617655
2013/js-inheritance-es6.js
2013/js-inheritance-es6.js
// ES6 variation with classes for "Classical inheritance in JS ES5". // // Eli Bendersky [http://eli.thegreenplace.net] // This code is in the public domain. class Shape { constructor(x, y) { this.x = x; this.y = y; } move(x, y) { this.x += x; this.y += y; } } class Circle extends Shape { c...
Add ES6 variant using classes
Add ES6 variant using classes
JavaScript
unlicense
eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog
--- +++ @@ -0,0 +1,44 @@ +// ES6 variation with classes for "Classical inheritance in JS ES5". +// +// Eli Bendersky [http://eli.thegreenplace.net] +// This code is in the public domain. + +class Shape { + constructor(x, y) { + this.x = x; + this.y = y; + } + + move(x, y) { + this.x += x; + this.y += y...
7ff5b1ccb90e096f5dbcbaa431bbcde5f208aca6
Akai/LPD8.Virek.control.js
Akai/LPD8.Virek.control.js
// Bitwig controller script for AKAI LPD // by Nick Donaldson, 2016 // // Global constants var SCRIPT_API_VERSION = 1; var SCRIPT_VERSION = "0.1"; var SCRIPT_UUID = "b5a7af1c-23b0-4d4c-b8b6-1ef889bbbee2"; var DEVICE_NAME = "LPD8"; var NUM_PORTS_IN = 1; var NUM_PORTS_OUT = 0; // Initialization and Controller Definiti...
Add LPD8 script for cross-device identification
Add LPD8 script for cross-device identification
JavaScript
cc0-1.0
ndonald2/bitwig-controller-scripts,ndonald2/bitwig-controller-scripts
--- +++ @@ -0,0 +1,20 @@ +// Bitwig controller script for AKAI LPD +// by Nick Donaldson, 2016 +// +// Global constants + +var SCRIPT_API_VERSION = 1; +var SCRIPT_VERSION = "0.1"; +var SCRIPT_UUID = "b5a7af1c-23b0-4d4c-b8b6-1ef889bbbee2"; + +var DEVICE_NAME = "LPD8"; +var NUM_PORTS_IN = 1; +var NUM_PORTS_OUT = 0; + +...
e5f244dd6892a07efb64763c8dda241de16d677f
notes/add_chart.js
notes/add_chart.js
// const User = require('./user') // const Key = require('./note-key').Key // const Note = require('./note-key').Note // const ScaleNote = require('./note-key').ScaleNote // const Chord = require('./chord-lyric').Chord // const Lyric = require('./chord-lyric').Lyric // const Measure = require('./measure') // const Sect...
Create sketch for adding chart.\n\nStill need to investigate adding when associations (user, note, etc.) already exist.
Create sketch for adding chart.\n\nStill need to investigate adding when associations (user, note, etc.) already exist.
JavaScript
agpl-3.0
flyrightsister/boxcharter,flyrightsister/boxcharter
--- +++ @@ -0,0 +1,57 @@ +// const User = require('./user') +// const Key = require('./note-key').Key +// const Note = require('./note-key').Note +// const ScaleNote = require('./note-key').ScaleNote +// const Chord = require('./chord-lyric').Chord +// const Lyric = require('./chord-lyric').Lyric +// const Measure = ...
aaaa73ca984792217bc4e1c1c9185be47250a8a8
hue.js
hue.js
HueBridge = function(server, username) { this.server = server; this.username = username; } HueBridge.prototype = { _apiCall: function(method, path, data, callback) { HTTP.call(method, "http://" + this.server + "/api/" + this.username + path, {}, function(error, result) { if (error) { console.l...
Implement basic Hue API control
Implement basic Hue API control
JavaScript
mit
iwazaru/notrebeausapin.fr,iwazaru/notrebeausapin.fr
--- +++ @@ -0,0 +1,46 @@ +HueBridge = function(server, username) { + this.server = server; + this.username = username; +} + +HueBridge.prototype = { + + _apiCall: function(method, path, data, callback) { + HTTP.call(method, "http://" + this.server + "/api/" + this.username + path, {}, function(error, result) { ...
ad030be7e8cbdbc6817d2b9436317a255687e7c3
spec/javascripts/mixerSpec.js
spec/javascripts/mixerSpec.js
describe("Mixer", function(){ var mixer; var song; beforeEach(function(){ mixer = []; song = new Howl({ urls: "https://s3.amazonaws.com/the-golden-record/Music/Soul+Jazz-Mike+Frederick.mp3" }); it("should be play a particular song", function() { // play song // expect player a...
Add skeleton of mixer tests for play and pause
Add skeleton of mixer tests for play and pause
JavaScript
mit
chi-bobolinks-2015/TheGoldenRecord,chi-bobolinks-2015/TheGoldenRecord,chi-bobolinks-2015/TheGoldenRecord
--- +++ @@ -0,0 +1,27 @@ +describe("Mixer", function(){ + var mixer; + var song; + + beforeEach(function(){ + mixer = []; + song = new Howl({ + urls: "https://s3.amazonaws.com/the-golden-record/Music/Soul+Jazz-Mike+Frederick.mp3" + + }); + + it("should be play a particular song", function() { + ...
754b5d1d5c6695cc944448bcb3336f8042b7e442
newswriter.js
newswriter.js
(function () { function run () { // (reads from quizServer.cfg and mypwd.txt) var config = require('./lib/config').config; var optsModule = require('./lib/opts.js'); var optsClass = new optsModule.optsClass(config); var opts = optsClass.getOpts(); if (!opts) ...
Add master run file to repo. Oops.
Add master run file to repo. Oops.
JavaScript
unlicense
fbennett/newswriter
--- +++ @@ -0,0 +1,45 @@ +(function () { + function run () { + + // (reads from quizServer.cfg and mypwd.txt) + var config = require('./lib/config').config; + + var optsModule = require('./lib/opts.js'); + var optsClass = new optsModule.optsClass(config); + var opts = opts...
2c091531f153b8d6b4a0d6d91fd351483030a1f8
test/cli/promptOptionsSpec.js
test/cli/promptOptionsSpec.js
var chai = require('chai'); var expect = chai.expect; var promptOptionsModule = require('../../bin/promptOptions')(); chai.should(); describe('As a user of the promptOptions module', function() { it('should return an object', function() { var test = promptOptionsModule; expect(test).to.be.a('ob...
Add tests for prompt options module
tests: Add tests for prompt options module
JavaScript
mit
code-computerlove/quarry,cartridge/cartridge-cli,code-computerlove/slate-cli
--- +++ @@ -0,0 +1,38 @@ +var chai = require('chai'); +var expect = chai.expect; + +var promptOptionsModule = require('../../bin/promptOptions')(); + +chai.should(); + +describe('As a user of the promptOptions module', function() { + + it('should return an object', function() { + var test = promptOptionsMod...
ee3e4a943a7077547af7dffcb12c4c42b613efcb
tests/e2e/saving-scenario_.js
tests/e2e/saving-scenario_.js
'use strict'; //https://github.com/angular/protractor/blob/master/docs/api.md //GetAttribute() returns "boolean" values and will return either "true" or null describe('Reports', function(){ var id = '1fueA5hrxIHxvRf7Btr_J6efDJ3qp-s9KV731wDc4OOaw'; var Report = require('../../app/report/report-page'); var ...
Add working draft of a saving scenario
Add working draft of a saving scenario
JavaScript
apache-2.0
28msec/nolap-report-editor
--- +++ @@ -0,0 +1,27 @@ +'use strict'; + +//https://github.com/angular/protractor/blob/master/docs/api.md +//GetAttribute() returns "boolean" values and will return either "true" or null +describe('Reports', function(){ + + var id = '1fueA5hrxIHxvRf7Btr_J6efDJ3qp-s9KV731wDc4OOaw'; + var Report = require('../.....
332f393ac7527800036ca24bf5b76d84af531a41
src/deck.js
src/deck.js
const Card = require('./card.js'); class Deck { constructor() { this.cards = []; for (let suit of Card.Suits()) { for (let rank of Card.Ranks()) { let card = new Card(rank, suit); this.cards.push(card); } } } shuffle() { let numberOfCards = this.cards.length; ...
const Card = require('./card.js'); class Deck { constructor() { this.cards = []; for (let suit of Card.Suits()) { for (let rank of Card.Ranks()) { let card = new Card(rank, suit); this.cards.push(card); } } } // Public: Performs a proper Fisher-Yates shuffle. // // Re...
Implement a proper Fisher-Yates shuffle.
Implement a proper Fisher-Yates shuffle.
JavaScript
mit
stvvan/slack-poker-bot,bdthinh/slack-poker-bot,CharlieHess/slack-poker-bot,rodrigomonteiro/slack-poker-bot,codevlabs/slack-poker-bot,sqlbyme/slack-poker-bot,jbomotti/slack-poker-bot,Andrey-Pavlov/slack-poker-bot,tim-mc/slack-poker-bot,bitzesty/slack-poker-bot,ysterp/poker,A-w-K/slack-poker-bot,Th3Mouk/slack-poker-bot,s...
--- +++ @@ -10,29 +10,33 @@ } } } - + + // Public: Performs a proper Fisher-Yates shuffle. + // + // Returns nothing; the shuffle is in-place. shuffle() { - let numberOfCards = this.cards.length; - - for (let index = 0; index < numberOfCards; index++) { - let newIndex = Deck.getR...
de4a7ee9cb31e257a3fe5ceb494586b19a412ba2
src/v2/stories/Bookmarklet.stories.js
src/v2/stories/Bookmarklet.stories.js
import React from 'react' import { storiesOf } from '@storybook/react' import Specimen from 'v2/stories/__components__/Specimen' import Bookmarklet from 'v2/components/Bookmarklet/components/Blocks' storiesOf('Bookmarklet', module).add('Bookmarklet', () => ( <Specimen> <Bookmarklet /> </Specimen> ))
Add story for bookmarklet component
Add story for bookmarklet component
JavaScript
mit
aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell
--- +++ @@ -0,0 +1,12 @@ +import React from 'react' +import { storiesOf } from '@storybook/react' + +import Specimen from 'v2/stories/__components__/Specimen' + +import Bookmarklet from 'v2/components/Bookmarklet/components/Blocks' + +storiesOf('Bookmarklet', module).add('Bookmarklet', () => ( + <Specimen> + <Boo...
d8b89e1d4bd4b6c0b58b3804f9b3502f9f80a5eb
ch02/fizz_buzz_2.js
ch02/fizz_buzz_2.js
/** * Created by larry on 8/28/16. */ for(var i = 1; i <= 100; i++) { if (i % 3 == 0 && i % 5 == 0) { console.log("FizzBuzz"); } else if (i % 3 == 0) { console.log("Fizz"); } else if (i % 5 == 0) { console.log("Buzz"); } else { console.log(i); } }
Write the second version of "Fizz Buzz."
Write the second version of "Fizz Buzz." This version handles all the cases in the actual game: * Print "FizzBuzz" if the value is evenly divisible by both 3 and 5 * Print "Fizz" if the value is evenly divisible by 3 * Print "Buzz" if the value is evenly divisble by 5 * Otherwise, print the value
JavaScript
apache-2.0
mrwizard82d1/eloquent-js
--- +++ @@ -0,0 +1,18 @@ +/** + * Created by larry on 8/28/16. + */ + +for(var i = 1; i <= 100; i++) { + if (i % 3 == 0 && i % 5 == 0) { + console.log("FizzBuzz"); + } + else if (i % 3 == 0) { + console.log("Fizz"); + } + else if (i % 5 == 0) { + console.log("Buzz"); + } + el...
cb260529a8585a8a5e34ff7962602e560be08e39
app/actions/__tests__/tasks.js
app/actions/__tests__/tasks.js
import * as actions from '../tasks'; describe('Task Actions', () => { let defaultId, defaultTask; beforeEach(() => { defaultId = 'someUniqueId'; defaultTask = { id: 'someIdString', name: 'Some task name' }; }); it('ADD_TASK should return the obj...
Add test coverage for actions
Add test coverage for actions
JavaScript
mit
CarlaCrandall/DoItNow,CarlaCrandall/DoItNow,CarlaCrandall/DoItNow
--- +++ @@ -0,0 +1,56 @@ +import * as actions from '../tasks'; + +describe('Task Actions', () => { + let defaultId, + defaultTask; + + beforeEach(() => { + defaultId = 'someUniqueId'; + defaultTask = { + id: 'someIdString', + name: 'Some task name' + }; + });...
ad3b613fc3eeb800a4c2a9d5f51d35debb9871c9
learning/javascript/TeamStats.js
learning/javascript/TeamStats.js
const team = { _players:[ { firstName: 'Cristiano', lastName: 'Ronaldo', age: 36 }, { firstName: 'Lionel', lastName: 'Messi', age:32 }, { firstName: 'Ice', lastName: 'Shi', ange:37 } ], _games:[ ...
Add project team stats on learning Object section
Add project team stats on learning Object section
JavaScript
apache-2.0
SpAiNiOr/mystudy,SpAiNiOr/mystudy,SpAiNiOr/mystudy
--- +++ @@ -0,0 +1,67 @@ +const team = { + _players:[ + { + firstName: 'Cristiano', + lastName: 'Ronaldo', + age: 36 + }, + { + firstName: 'Lionel', + lastName: 'Messi', + age:32 + }, + { + firstName: 'Ice', + lastName: 'Shi', + ...
ad1dde3af5b710077ce07d450d92f86762b70da0
week-7/javascript_olympics.js
week-7/javascript_olympics.js
/* PEER PARING CHALLENGE 7.6: JAVASCRIPT OLYMPICS WE PAIRED ON THIS CHALLENGE: Becca Nelson & Lars Johnson THIS CHALLENGE TOOK US: ___ Hours */ // ########################################################### // WARM UP // ########################################################### // BULK UP // ########...
Create JS Olympics file for 7.6
Create JS Olympics file for 7.6
JavaScript
mit
larsjx/phase-0,larsjx/phase-0,larsjx/phase-0
--- +++ @@ -0,0 +1,57 @@ +/* + + PEER PARING CHALLENGE 7.6: JAVASCRIPT OLYMPICS + + WE PAIRED ON THIS CHALLENGE: Becca Nelson & Lars Johnson + THIS CHALLENGE TOOK US: ___ Hours + +*/ +// ########################################################### +// WARM UP + + + + +// ############################################...
41aa5f27916122de2f7f12f9a5916c08b1800649
flow-typed/npm/@storybook/addon-actions_v4.x.x.js
flow-typed/npm/@storybook/addon-actions_v4.x.x.js
// flow-typed signature: 824de8c4d861db90a6471d410d3df917 // flow-typed version: <<STUB>>/@storybook/addon-actions_v4.0.0/flow_v0.90.0 /** * This is an autogenerated libdef stub for: * * '@storybook/addon-actions' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you t...
Add types for @storybook/addon-actions package
Add types for @storybook/addon-actions package
JavaScript
mit
moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0
--- +++ @@ -0,0 +1,24 @@ +// flow-typed signature: 824de8c4d861db90a6471d410d3df917 +// flow-typed version: <<STUB>>/@storybook/addon-actions_v4.0.0/flow_v0.90.0 + +/** + * This is an autogenerated libdef stub for: + * + * '@storybook/addon-actions' + * + * Fill this stub out by replacing all the `any` types. + * +...
5bffa73605614b0250d047033621e9591ddc578c
webextensions/common/common.js
webextensions/common/common.js
'use strict'; var configs; function log(aMessage, ...aArgs) { if (!configs || !configs.debug) return; console.log('reload-on-idle: ' + aMessage, ...aArgs); }; function createFilter() { try { return new RegExp(configs.filter, 'i'); } catch (e) { log(`"${configs.filter}" is not a valid expression.`...
Define the data structure for addon settings.
WE: Define the data structure for addon settings. This is a straight-forward translation of the XPCOM-based configuration. (Few options are missing for compatibility reasons, though) See 'reload-on-idle/content/config.xul' for details.
JavaScript
mpl-2.0
clear-code/reload-on-idle,clear-code/reload-on-idle,clear-code/reload-on-idle
--- +++ @@ -0,0 +1,25 @@ +'use strict'; + +var configs; + +function log(aMessage, ...aArgs) { + if (!configs || !configs.debug) + return; + console.log('reload-on-idle: ' + aMessage, ...aArgs); +}; + +function createFilter() { + try { + return new RegExp(configs.filter, 'i'); + } catch (e) { + log(`"${co...
c126dd52a5993b29eed8c87b32a6699c648d0570
js/components/immutableComponent.js
js/components/immutableComponent.js
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = require('react') class ImmutableComponent extends React.Component { shouldComponentUpdate (nextPr...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ const React = require('react') class ImmutableComponent extends React.Component { shouldComponentUpdate (nextPr...
Use nextProps for comparison not nextState
Use nextProps for comparison not nextState Auditors: da39a3ee5e6b4b0d3255bfef95601890afd80709@bridiver
JavaScript
mpl-2.0
MKuenzi/browser-laptop,timborden/browser-laptop,willy-b/browser-laptop,willy-b/browser-laptop,manninglucas/browser-laptop,timborden/browser-laptop,MKuenzi/browser-laptop,darkdh/browser-laptop,diasdavid/browser-laptop,diasdavid/browser-laptop,timborden/browser-laptop,darkdh/browser-laptop,Sh1d0w/browser-laptop,pmkary/br...
--- +++ @@ -5,8 +5,8 @@ const React = require('react') class ImmutableComponent extends React.Component { - shouldComponentUpdate (nextProps, nextState) { - return Object.keys(nextProps).some(prop => nextState !== this.props[prop]) + shouldComponentUpdate (nextProps) { + return Object.keys(nextProps).some...
8bab3396c6e13326d8aba4e31adac88d4f310399
src/common/bootstrap/bootstrap.js
src/common/bootstrap/bootstrap.js
/** * Enhances the angular bootstrap directive to allow it to stay open when the * user clicks inside the menu. */ angular.module('ui.bootstrap.dropdownToggle', []).directive('dropdownToggleNoClose', ['$document', '$location', '$window', function ($document, $location, $window) { var openElement = null, cl...
Add a variation on the Angular UI Bootstrap code which keeps the dropdown open as long as the clicks are inside the menu
Add a variation on the Angular UI Bootstrap code which keeps the dropdown open as long as the clicks are inside the menu
JavaScript
bsd-3-clause
trestle-pm/trestle
--- +++ @@ -0,0 +1,60 @@ +/** + * Enhances the angular bootstrap directive to allow it to stay open when the + * user clicks inside the menu. + */ +angular.module('ui.bootstrap.dropdownToggle', []).directive('dropdownToggleNoClose', + ['$document', '$location', '$window', function ($document, $location, $window) { +...
8ee1550f8931410495e329d04a3b6bd71a462e1f
app/models/customer.server.model.js
app/models/customer.server.model.js
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Customer Schema */ var CustomerSchema = new Schema({ firstName: { type: String, default: '', trim: true }, surName: { type: String, default: '', trim: true }, suburb: { type: String,...
Update as Day 10 Customer Model
Update as Day 10 Customer Model
JavaScript
mit
cheshiret/myMeanProject,cheshiret/myMeanProject,cheshiret/myMeanProject
--- +++ @@ -0,0 +1,66 @@ +'use strict'; + +/** + * Module dependencies. + */ +var mongoose = require('mongoose'), + Schema = mongoose.Schema; + +/** + * Customer Schema + */ +var CustomerSchema = new Schema({ + firstName: { + type: String, + default: '', + trim: true + }, + surName: { + type: String, + default: ...
c0304dcb326316638c41c209b76409e1853a8230
test/browser/refs.js
test/browser/refs.js
import { h, render, Component } from '../../src/preact'; /** @jsx h */ describe('refs', () => { let scratch; before( () => { scratch = document.createElement('div'); (document.body || document.documentElement).appendChild(scratch); }); beforeEach( () => { scratch.innerHTML = ''; }); after( () => { scr...
Add tests for `ref` :)
Add tests for `ref` :)
JavaScript
mit
neeharv/preact,developit/preact,gogoyqj/preact,neeharv/preact,developit/preact
--- +++ @@ -0,0 +1,90 @@ +import { h, render, Component } from '../../src/preact'; +/** @jsx h */ + +describe('refs', () => { + let scratch; + + before( () => { + scratch = document.createElement('div'); + (document.body || document.documentElement).appendChild(scratch); + }); + + beforeEach( () => { + scratch.inn...
988174a6294ab863be2961267174901440100944
test/mjsunit/test-path.js
test/mjsunit/test-path.js
var path = require("path"); process.mixin(require("./common")); var f = __filename; assert.equal(path.basename(f), "test-path.js"); assert.equal(path.basename(f, ".js"), "test-path"); assert.equal(path.extname(f), ".js"); assert.equal(path.dirname(f).substr(-13), "/test/mjsunit"); path.exists(f, function (y) { assert...
Add tests for path module.
Add tests for path module.
JavaScript
apache-2.0
dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,dreamllq/node,isaacs/nshtools,dreamllq/node,dreamllq/node,dreamllq/node
--- +++ @@ -0,0 +1,27 @@ +var path = require("path"); +process.mixin(require("./common")); + +var f = __filename; + +assert.equal(path.basename(f), "test-path.js"); +assert.equal(path.basename(f, ".js"), "test-path"); +assert.equal(path.extname(f), ".js"); +assert.equal(path.dirname(f).substr(-13), "/test/mjsunit"); ...
5470155907b3c85417b63e92e7b2d9c7c04690fc
test/test-api-util-cache.js
test/test-api-util-cache.js
module.exports = { setUp: function (callback) { var path = require('path'); this.cache = require('../lib/utils/cache'); this.cache.init({ "path" : path.resolve(__dirname, "../") + "/cache" }); this.cacheKey = "test"; this.cacheValue = "{test:tefdsafsafdsa...
Create test file for cache.
Create test file for cache.
JavaScript
mit
Solid-Interactive/grasshopper-api-js,Solid-Interactive/grasshopper-api-js
--- +++ @@ -0,0 +1,32 @@ +module.exports = { + setUp: function (callback) { + var path = require('path'); + + this.cache = require('../lib/utils/cache'); + this.cache.init({ + "path" : path.resolve(__dirname, "../") + "/cache" + }); + this.cacheKey = "test"; + t...
1017054e95ecb84155c54102705f8570e0199a49
polygerrit-ui/app/types/polymer-behaviors.js
polygerrit-ui/app/types/polymer-behaviors.js
/** * @license * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
Add mock mixin for Polymer.IronFitBehavior
Add mock mixin for Polymer.IronFitBehavior Polymer.IronFitBehavior doesn't have a mixin and should be added to component using Polymer.mixinBehavior([Polymer.IronFitBehavior]). Polymer linter doesn't process this correctly. To workaround it the mock mixin was added. It will be used in JSDoc comments after conversion t...
JavaScript
apache-2.0
GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit
--- +++ @@ -0,0 +1,52 @@ +/** + * @license + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licen...
2060d39c9d2690095ce5520ea0cf25bad1015c70
lib/core/behaviour/physics.js
lib/core/behaviour/physics.js
/** * @module Joy.Behaviour */ (function(J) { /** * TODO: Wouldn't it be nice? */ var Physics = J.Behaviour.extend({ INIT: function (options) {}, UPDATE: function () {} }); J.Behaviour.Physics = Physics; })(Joy);
Add Physics placeholder. Planned to be implemented soon.
Add Physics placeholder. Planned to be implemented soon.
JavaScript
mit
royquintanar/joy.js,endel/joy.js,royquintanar/joy.js
--- +++ @@ -0,0 +1,14 @@ +/** + * @module Joy.Behaviour + */ +(function(J) { + /** + * TODO: Wouldn't it be nice? + */ + var Physics = J.Behaviour.extend({ + INIT: function (options) {}, + UPDATE: function () {} + }); + + J.Behaviour.Physics = Physics; +})(Joy);
6088dceecde8bd76c02bc3860b17e3d4ba932289
lib/linters/trailing_semicolon.js
lib/linters/trailing_semicolon.js
'use strict'; module.exports = { name: 'trailingSemicolon', nodeTypes: ['rule', 'atrule'], message: 'All property declarations should end with a semicolon.', lint: function trailingSemicolonLinter (config, node) { var others = 0; if (node.ruleWithoutBody || !node.nodes.length) { ...
'use strict'; module.exports = { name: 'trailingSemicolon', nodeTypes: ['rule', 'atrule'], message: 'All property declarations should end with a semicolon.', lint: function trailingSemicolonLinter (config, node) { var others = 0; if (node.ruleWithoutBody || (node.nodes && !node.nodes....
Add an extra safety check to trailingSemicolon
Add an extra safety check to trailingSemicolon
JavaScript
mit
JoshuaKGoldberg/lesshint,runarberg/lesshint,lesshint/lesshint
--- +++ @@ -8,7 +8,7 @@ lint: function trailingSemicolonLinter (config, node) { var others = 0; - if (node.ruleWithoutBody || !node.nodes.length) { + if (node.ruleWithoutBody || (node.nodes && !node.nodes.length)) { return; }
a45f169d1917b5e5275818142a9033cdcdd25766
rules/application_access_override.js
rules/application_access_override.js
function (user, context, callback) { // Applications that are restricted var MOCO_MOFO_APPS = ['phonebook.mozilla.com', 'phonebook-dev.mozilla.com', 'login.mozilla.com', 'passwordreset.mozilla.com']; // LDAP groups allowed to access these applications var ALLOWED_GROUPS = ['team_moco', 'team_mofo']; if (MOCO...
Add support for auth0-side application access restriction override This fails authentication for specific applications directly from auth0, instead of letting the application decide. Mainly used for applications that do not have proper OIDC or SAML support with authorization management capabilities.
Add support for auth0-side application access restriction override This fails authentication for specific applications directly from auth0, instead of letting the application decide. Mainly used for applications that do not have proper OIDC or SAML support with authorization management capabilities.
JavaScript
mpl-2.0
mozilla-iam/auth0-deploy,mozilla-iam/auth0-deploy,jdow/auth0-deploy,jdow/auth0-deploy,tristanweir/auth0-deploy,tristanweir/auth0-deploy
--- +++ @@ -0,0 +1,24 @@ +function (user, context, callback) { + // Applications that are restricted + var MOCO_MOFO_APPS = ['phonebook.mozilla.com', 'phonebook-dev.mozilla.com', 'login.mozilla.com', 'passwordreset.mozilla.com']; + // LDAP groups allowed to access these applications + var ALLOWED_GROUPS = ['team_...
efdf64567548a52776c29f432911fce1a78a9bf5
test/in-view.offset.spec.js
test/in-view.offset.spec.js
import test from 'ava'; import inView from '../src/in-view'; test('inView.offset returns the offset', t => { t.true(inView.offset(50) === 50); }); test('inView.offset returns current offset if it doesn\'t receive a number', t => { t.true(inView.offset(10) === 10); t.true(inView.offset('foo') === 10); });
Add initial tests for inView.offset
Add initial tests for inView.offset
JavaScript
mit
kudago/in-view,camwiegert/in-view
--- +++ @@ -0,0 +1,11 @@ +import test from 'ava'; +import inView from '../src/in-view'; + +test('inView.offset returns the offset', t => { + t.true(inView.offset(50) === 50); +}); + +test('inView.offset returns current offset if it doesn\'t receive a number', t => { + t.true(inView.offset(10) === 10); + t.tr...
6d435c7da8a100b1520d0aedbb1974f0f41ee84f
test/test-multiple-batch.js
test/test-multiple-batch.js
// test-multiple-batch.js -- Multiple calls to addBatch() // // Copyright 2016 fuzzy.ai <evan@fuzzy.ai> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/lic...
Test for multiple addBatch() calls
Test for multiple addBatch() calls
JavaScript
apache-2.0
vowsjs/vows,fuzzy-ai/perjury
--- +++ @@ -0,0 +1,53 @@ +// test-multiple-batch.js -- Multiple calls to addBatch() +// +// Copyright 2016 fuzzy.ai <evan@fuzzy.ai> +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +...
de3d1a3c4cfbabc50e24c4acad51822daa7476e8
fakehue/simplebutton.js
fakehue/simplebutton.js
var MeshbluSocketIO = require('meshblu'); var SerialPort = require('serialport'); var tinycolor = require('tinycolor2'); var cfg = require('./meshblu.json'); var serport = null; var meshblu = null; SerialPort.list(function (err, ports) { ports.forEach(function(port) { if (port.vendorId == '1B4F') { conso...
Add temporary simple LED button
Add temporary simple LED button
JavaScript
mit
jamesbulpin/meshblu-connector-ledbutton
--- +++ @@ -0,0 +1,66 @@ +var MeshbluSocketIO = require('meshblu'); +var SerialPort = require('serialport'); +var tinycolor = require('tinycolor2'); + +var cfg = require('./meshblu.json'); + +var serport = null; +var meshblu = null; + +SerialPort.list(function (err, ports) { + ports.forEach(function(port) { + if ...
ba5cb655163ee7e2f646f0716ba3e9125567156b
files/require-css/0.1.8/css.min.js
files/require-css/0.1.8/css.min.js
define(function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n...
Update project require-css to 0.1.8
Update project require-css to 0.1.8
JavaScript
mit
fchasen/jsdelivr,RoberMac/jsdelivr,jtblin/jsdelivr,firulais/jsdelivr,labsvisual/jsdelivr,bdukes/jsdelivr,stevelacy/jsdelivr,vousk/jsdelivr,dpellier/jsdelivr,RoberMac/jsdelivr,ajibolam/jsdelivr,anilanar/jsdelivr,cake654326/jsdelivr,yaplas/jsdelivr,dnbard/jsdelivr,wallin/jsdelivr,CTres/jsdelivr,ndamofli/jsdelivr,ajkj/jsd...
--- +++ @@ -0,0 +1 @@ +define(function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)|...
e3f3e344eef2dadf3781a54d0fad7231d7e20ec0
array/array_merge2.js
array/array_merge2.js
//function to combine two one dimensional arrays to one function array_merge2(arr1, arr2) { return arr1.concat(arr2); } console.log(array_merge2([1, 2, 3], [4, 5]));
Create function that merge 2 arrays
chore: Create function that merge 2 arrays
JavaScript
mit
divyanshu-rawat/Basic-JS-Algorithms
--- +++ @@ -0,0 +1,8 @@ +//function to combine two one dimensional arrays to one + +function array_merge2(arr1, arr2) { + return arr1.concat(arr2); +} + +console.log(array_merge2([1, 2, 3], [4, 5])); +
14f9ee8730d2acfdc74a4963b1e1a8ea3f5ef47e
bin/upload-release.js
bin/upload-release.js
"use strict" let version = process.argv[2] let auth = process.argv[3] if (!auth) { console.log("Usage: upload-release.js [TAG] [github-user:password]") process.exit(1) } require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => { if (error) throw error let message = ...
Add a github release upload script
Add a github release upload script
JavaScript
mit
dperetti/CodeMirror,bfrohs/CodeMirror,xeronith/CodeMirror,codio/CodeMirror,hackmdio/CodeMirror,alur/CodeMirror,Jisuanke/CodeMirror,SidPresse/CodeMirror,vincentwoo/CodeMirror,wingify/CodeMirror,pabloferz/CodeMirror,MarcelGerber/CodeMirror,INTELOGIE/CodeMirror,alur/CodeMirror,dperetti/CodeMirror,jayaprabhakar/CodeMirror,...
--- +++ @@ -0,0 +1,35 @@ +"use strict" + +let version = process.argv[2] +let auth = process.argv[3] + +if (!auth) { + console.log("Usage: upload-release.js [TAG] [github-user:password]") + process.exit(1) +} + +require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => { + ...
4bbc2eefe6a89f38a5cf2b21a757acc86047b010
lib/youtube-track.js
lib/youtube-track.js
var ytdl = require('ytdl-core'); module.exports = YoutubeTrack = function(vid, cb) { var _this = this; var requestUrl = 'http://www.youtube.com/watch?v=' + vid; ytdl.getInfo(requestUrl, (err, info) => { if (err) cb(err, undefined); else { _this.vid = info.vid; _this.title = info.title; ...
Add YoutubeTrack class to represent a youtube track For future soundcloud support.
Add YoutubeTrack class to represent a youtube track For future soundcloud support.
JavaScript
mit
meew0/Lethe
--- +++ @@ -0,0 +1,18 @@ +var ytdl = require('ytdl-core'); + +module.exports = YoutubeTrack = function(vid, cb) { + var _this = this; + var requestUrl = 'http://www.youtube.com/watch?v=' + vid; + ytdl.getInfo(requestUrl, (err, info) => { + if (err) cb(err, undefined); + else { + _this.vid = info.vid; + ...
d9350a3749a7d33a425c3f5f499984ff52c8690b
src/exports/assets.js
src/exports/assets.js
import { Asset, BondBase, BondCorporate, BondGovernment, BondMortgage, Currency, CustomAsset, Derivative, BondOption, CFD, Equity, ForeignExchangeOption, Fund, ExchangeTradedFund, ForeignExchange, NonDeliverableForward, Index, BondFuture, BondFutureOption, EnergyFuture, EquityF...
Create exports folder for namespacing imports/exports.
Create exports folder for namespacing imports/exports.
JavaScript
apache-2.0
amaas-fintech/amaas-core-sdk-js
--- +++ @@ -0,0 +1,86 @@ +import { + Asset, + BondBase, + BondCorporate, + BondGovernment, + BondMortgage, + Currency, + CustomAsset, + Derivative, + BondOption, + CFD, + Equity, + ForeignExchangeOption, + Fund, + ExchangeTradedFund, + ForeignExchange, + NonDeliverableForward, + Index, + BondFuture,...
dce6f6ba0af831253b4351dd99735b3a28692335
test/components/Scrollbar/Scrollbar.spec.js
test/components/Scrollbar/Scrollbar.spec.js
import React from 'react'; import { mount } from 'enzyme'; import Scrollbar from '../../../src/components/Scrollbar/Scrollbar'; describe('<Scrollbar />', function () { beforeEach(function () { this.update = sinon.spy(); }); describe('when mounted', function () { it('add scrollbar using the Highcharts u...
Add tests for the Scrollbar component
Add tests for the Scrollbar component
JavaScript
mit
whawker/react-jsx-highcharts,AlexMayants/react-jsx-highcharts,whawker/react-jsx-highcharts,AlexMayants/react-jsx-highcharts
--- +++ @@ -0,0 +1,61 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Scrollbar from '../../../src/components/Scrollbar/Scrollbar'; + +describe('<Scrollbar />', function () { + beforeEach(function () { + this.update = sinon.spy(); + }); + + describe('when mounted', function () { + it...
b26d9ab3b9a031f52e8a1f40a20f3da625e561ba
js/i18n/zh-cn.js
js/i18n/zh-cn.js
plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","Filename":"文件名","Image format either wrong or not supported.":"图片格式错误...
Add language pack for Simplified Chinese.
Add language pack for Simplified Chinese.
JavaScript
agpl-3.0
envato/plupload,vitr/fend005-plupload,moxiecode/plupload,envato/plupload,vitr/fend005-plupload,moxiecode/plupload
--- +++ @@ -0,0 +1 @@ +plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","Filename":"文件名","Image format either wrong o...
f6b2e366048308c44de85eb573417d9d12472974
src/Problems/PairsWithDifferenceK.js
src/Problems/PairsWithDifferenceK.js
const test = require('tape') /** * Given an array arr of distinct integers and a nonnegative integer k, * write a function that returns an array of all pairs [x,y], * such that x - y = k. If no such pairs exist, return an empty array. * * Examples: * * input = [0, -1, -2, 2, 1], k = 1 * output: [[0, -1], [-1, ...
Add pairs with given difference
Add pairs with given difference
JavaScript
mit
ayastreb/cs101
--- +++ @@ -0,0 +1,74 @@ +const test = require('tape') + +/** + * Given an array arr of distinct integers and a nonnegative integer k, + * write a function that returns an array of all pairs [x,y], + * such that x - y = k. If no such pairs exist, return an empty array. + * + * Examples: + * + * input = [0, -1, -2, 2,...
f5b2b81e1b87583f54ecc6b3578e072205566875
popular_posts.js
popular_posts.js
var superagent = require('superagent'); var _ = require('lodash'); var fs = require('fs'); var path = require('path'); var frontMatter = require('front-matter'); var postsPath = path.join(__dirname, 'pages/posts'); var postFiles = fs.readdirSync(postsPath); var posts = _.map(postFiles, function(file) { var filePath...
Add script to pull piwik data, inject into posts
Add script to pull piwik data, inject into posts
JavaScript
mit
scottnonnenberg/blog,scottnonnenberg/blog,scottnonnenberg/blog
--- +++ @@ -0,0 +1,77 @@ +var superagent = require('superagent'); +var _ = require('lodash'); +var fs = require('fs'); +var path = require('path'); +var frontMatter = require('front-matter'); + +var postsPath = path.join(__dirname, 'pages/posts'); + +var postFiles = fs.readdirSync(postsPath); +var posts = _.map(postF...
001cacd3ddc41e01f230da17562d1c51835f7cb8
app/assets/javascripts/new_timeslot.js
app/assets/javascripts/new_timeslot.js
$(document).ready(function(){ $("#new-timeslot-form").submit(function(event){ event.preventDefault(); var data = createDate(); $("#modal_new_timeslot").modal('toggle'); $.ajax({ type: "POST", url: "/api/timeslots", data: { start: data } }).done(function(response) { ...
Create new timeslot with ajax call
Create new timeslot with ajax call
JavaScript
mit
theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board
--- +++ @@ -0,0 +1,36 @@ +$(document).ready(function(){ + + $("#new-timeslot-form").submit(function(event){ + event.preventDefault(); + var data = createDate(); + $("#modal_new_timeslot").modal('toggle'); + $.ajax({ + type: "POST", + url: "/api/timeslots", + data: { start: data } + ...
1d0b3c7cb45be76fe7002a6f428373606e24e192
Resources/public/js/tests/fieldTest.js
Resources/public/js/tests/fieldTest.js
describe('Test the field component', function() { /** * Get the textarea component */ function getFieldComponent(field) { var editorAdvancedFieldComponent = Vue.extend(editorAdvancedField); var store = new Vuex.Store({ state: { configuration: { ...
Add field component tests on tags.
Add field component tests on tags.
JavaScript
mit
IDCI-Consulting/ExtraFormBundle,IDCI-Consulting/ExtraFormBundle
--- +++ @@ -0,0 +1,82 @@ +describe('Test the field component', function() { + + /** + * Get the textarea component + */ + function getFieldComponent(field) { + var editorAdvancedFieldComponent = Vue.extend(editorAdvancedField); + + var store = new Vuex.Store({ + state: { + ...
821ff82302228712ce5eea057b5437074cd722c1
test/client/modules/videos/mark_as_favourite_spec.js
test/client/modules/videos/mark_as_favourite_spec.js
var expect = chai.expect; describe('markAsFavouriteService', function () { // console.log(angular.module('APP')) var $httpBackend; // var APP; var video = { _id: '123' } var apiUrl = '/api/v1/videos/' + video._id + '/mark_favourite'; beforeEach(module('APP')); beforeEach(inject(function ($injector) { ...
Test for mark as fav
Test for mark as fav
JavaScript
mit
sporto/devtalks.net
--- +++ @@ -0,0 +1,66 @@ +var expect = chai.expect; + +describe('markAsFavouriteService', function () { + + // console.log(angular.module('APP')) + var $httpBackend; + + // var APP; + var video = { + _id: '123' + } + + var apiUrl = '/api/v1/videos/' + video._id + '/mark_favourite'; + + beforeEach(module('APP')); + +...
f4a490fcbe4d751a6ef64c4e5a0ffe4c4919bea4
assets/js/pages/lessees/reservations.js
assets/js/pages/lessees/reservations.js
$(document).ready(function() { $('#reservation-table').DataTable({}); }); $('.btn-cancel').on('click', function() { if (confirm('Are you sure to cancel this reservation?')) { console.log('cancelled'); } }); $('.btn-view').on('click', function() { $('reservation-modal').modal('show'); });
Add script for lessee reservation list
Add script for lessee reservation list
JavaScript
mit
gctomakin/renTRMNL,gctomakin/renTRMNL,gctomakin/renTRMNL
--- +++ @@ -0,0 +1,13 @@ +$(document).ready(function() { + $('#reservation-table').DataTable({}); +}); + +$('.btn-cancel').on('click', function() { + if (confirm('Are you sure to cancel this reservation?')) { + console.log('cancelled'); + } +}); + +$('.btn-view').on('click', function() { + $('reservation-modal').mo...
33b7b330687c4daa4e04ffe1e4d0e23b942673c6
client/components/SignUp/SignUpPage.js
client/components/SignUp/SignUpPage.js
import React, { Component } from 'react'; import logo from '../../public/images/logo.png'; import PageFooter from '../PageFooter'; import SignUpForm from './SignUpForm'; import { connect } from 'react-redux'; class SignUpPage extends Component { constructor(props) { super(props); this.renderSignU...
Create container for SignUpForm component
Create container for SignUpForm component
JavaScript
mit
amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books
--- +++ @@ -0,0 +1,69 @@ +import React, { Component } from 'react'; +import logo from '../../public/images/logo.png'; +import PageFooter from '../PageFooter'; +import SignUpForm from './SignUpForm'; +import { connect } from 'react-redux'; + + + +class SignUpPage extends Component { + constructor(props) { + ...
1e7390448d7cd39522d122205e917f61438e7ba4
promise-it-wont-hurt/reject-a-promise.js
promise-it-wont-hurt/reject-a-promise.js
var q = require('q'); var deferred = q.defer(); deferred.promise.then(null, function(err) { console.log(err.message); }); setTimeout(deferred.reject, 300, new Error("REJECTED!"));
Complete 'Reject a promise' challenge in 'Promise it won't hurt' tutorial
Complete 'Reject a promise' challenge in 'Promise it won't hurt' tutorial
JavaScript
mit
PaoloLaurenti/nodeschool
--- +++ @@ -0,0 +1,7 @@ +var q = require('q'); +var deferred = q.defer(); +deferred.promise.then(null, function(err) { + console.log(err.message); +}); + +setTimeout(deferred.reject, 300, new Error("REJECTED!"));