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 |
|---|---|---|---|---|---|---|---|---|---|---|
e019d9c26f2be9d571016a9c606c3635437af323 | scripts/init-db.js | scripts/init-db.js | /**
* Generate the dbtables
* and generate a user with a post
*
* username = batman
* password = robin
*/
const path = require('path')
require('dotenv').load({ path: path.resolve(__dirname, '../../', '.env') });
const bcrypt = require('bcryptjs')
const fs = require('fs-promise')
const mysql = require('mysql')
con... | Write a script to setup db and a test user & post | Write a script to setup db and a test user & post
| JavaScript | mit | chamsocial/Chamsocial,chamsocial/Chamsocial,chamsocial/Chamsocial | ---
+++
@@ -0,0 +1,107 @@
+/**
+ * Generate the dbtables
+ * and generate a user with a post
+ *
+ * username = batman
+ * password = robin
+ */
+const path = require('path')
+require('dotenv').load({ path: path.resolve(__dirname, '../../', '.env') });
+const bcrypt = require('bcryptjs')
+const fs = require('fs-promi... | |
ea8d07da420713a6adc1c3ac50402e9adbc6a88c | test/fitness-scoring.js | test/fitness-scoring.js | const {scoreScenario, boilDownIndividualScore} = require('../app/fitness-scoring.js');
const assert = require('assert');
describe('scoreScenario', () => {
it('assigns fitness scores for individuals', () => {
const scenario = {
id: 1,
participants: ['Nick'],
initialPositions: {
Nick: {... | Add tests for fitness behaviour and bug | Add tests for fitness behaviour and bug
| JavaScript | mit | helix-pi/helix-pi,Widdershin/helix-pi,helix-pi/helix-pi,Widdershin/helix-pi | ---
+++
@@ -0,0 +1,93 @@
+const {scoreScenario, boilDownIndividualScore} = require('../app/fitness-scoring.js');
+
+const assert = require('assert');
+
+describe('scoreScenario', () => {
+ it('assigns fitness scores for individuals', () => {
+ const scenario = {
+ id: 1,
+ participants: ['Nick'],
+
+ ... | |
68f52baec830b28259d5d486b3dcf892e51285d3 | server.js | server.js | var dgram = require("dgram");
var socket = dgram.createSocket("udp4");
socket.on("error", function (err) {
console.log("server error:\n" + err.stack);
socket.close();
});
socket.on("message", function (msg, rinfo) {
var jsonObj = { message: msg.toString('utf8').replace(/\r?\n|\r/g, " "), tags: ['sawyer'], sawy... | Read syslog data and outputs to console as JSON | Read syslog data and outputs to console as JSON
| JavaScript | bsd-3-clause | genebean/sawyer | ---
+++
@@ -0,0 +1,21 @@
+var dgram = require("dgram");
+
+var socket = dgram.createSocket("udp4");
+
+socket.on("error", function (err) {
+ console.log("server error:\n" + err.stack);
+ socket.close();
+});
+
+socket.on("message", function (msg, rinfo) {
+ var jsonObj = { message: msg.toString('utf8').replace(/\r... | |
fbe55dba68fb2542fd12e4daf5bd1203d356bb5c | lib/util/hook.js | lib/util/hook.js |
/**
* This is our "Hook" class that allows a script to hook into the lifecyle of the
* "configure", "build" and "clean" commands. It's basically a hack into the
* module.js file to allow custom hooks into the module-space, specifically to
* make the global scope act as an EventEmitter.
*/
var fs = require('fs')
... | Add the 'createHook()' function. Rather hacky but oh well... | Add the 'createHook()' function. Rather hacky but oh well...
| JavaScript | mit | maghoff/node-gyp,spacelis/node-gyp,spacelis/node-gyp,maghoff/node-gyp,tepez/node-gyp,pombredanne/pangyp,saper/node-gyp,yorkie/node-gyp,justinmchase/node-gyp,overra/node-gyp,MiniGod/nw-gyp,implausible/pangyp,CodeJockey/node-ninja,rvagg/pangyp,watonyweng/node-gyp,atiti/pangyp,nodegit/node-gyp,jqk6/node-gyp,fengmk2/node-g... | ---
+++
@@ -0,0 +1,47 @@
+
+/**
+ * This is our "Hook" class that allows a script to hook into the lifecyle of the
+ * "configure", "build" and "clean" commands. It's basically a hack into the
+ * module.js file to allow custom hooks into the module-space, specifically to
+ * make the global scope act as an EventEmit... | |
56b7877f251fdd0b9cd53dfa6d0d19f9fd6b7d8f | tests/ids/add_ids.js | tests/ids/add_ids.js | /* bender-tags: editor,unit */
/* bender-ckeditor-plugins: autoid */
'use strict';
bender.editor = {
config: {
enterMode: CKEDITOR.ENTER_P
}
};
bender.test({
setUp: function() {
this.editor = this.editorBot.editor;
},
'test it can add a unique id to a heading': function() {
var bot = this.editorBo... | Add start of tests for checking that plugin adds ids correctly on initial load | Add start of tests for checking that plugin adds ids correctly on initial load
| JavaScript | mit | PolicyStat/ckeditor-plugin-autoid-headings,PolicyStat/ckeditor-plugin-autoid-headings | ---
+++
@@ -0,0 +1,40 @@
+/* bender-tags: editor,unit */
+/* bender-ckeditor-plugins: autoid */
+
+'use strict';
+
+bender.editor = {
+ config: {
+ enterMode: CKEDITOR.ENTER_P
+ }
+};
+
+bender.test({
+ setUp: function() {
+ this.editor = this.editorBot.editor;
+ },
+
+ 'test it can add a unique id to a headin... | |
9b7b663c33e9dea0e21ac778712f4dfa8f507883 | sandbox/sangmee.js | sandbox/sangmee.js | function deleteDestination(place) {
function placeToDelete(){
return place;
};
// delete user's destination
// NEED TO REPLACE USERNAME WITH CURRENT USER UID
usersRef.child('sangmee/destinations').orderByKey().on('child_added', function(snapshot){
snapshot.forEach(function(destination){
if(des... | Add method to delete users destination | Add method to delete users destination
| JavaScript | mit | okjill/scout,okjill/scout,okjill/scout,okjill/scout | ---
+++
@@ -0,0 +1,29 @@
+function deleteDestination(place) {
+ function placeToDelete(){
+ return place;
+ };
+
+// delete user's destination
+// NEED TO REPLACE USERNAME WITH CURRENT USER UID
+ usersRef.child('sangmee/destinations').orderByKey().on('child_added', function(snapshot){
+
+ snapshot.forEac... | |
ce34ddf2c1dc99050e669f24f6f35794bbe956a0 | lib/datapacktypes/product2.js | lib/datapacktypes/product2.js | var Product2 = module.exports = function(vlocity) {
this.vlocity = vlocity;
};
Product2.prototype.childrenExport = async function(inputMap) {
try {
var jobInfo = inputMap.jobInfo;
var childrenDataPacks = inputMap.childrenDataPacks;
var dataPackType = childrenDataPacks[0].VlocityDataPackType;
let querySt... | Update to have Children for Product2 run in JavaScript | Update to have Children for Product2 run in JavaScript
| JavaScript | mit | vlocityinc/vlocity_build,vlocityinc/vlocity_build,vlocityinc/vlocity_build | ---
+++
@@ -0,0 +1,46 @@
+var Product2 = module.exports = function(vlocity) {
+ this.vlocity = vlocity;
+};
+
+Product2.prototype.childrenExport = async function(inputMap) {
+ try {
+ var jobInfo = inputMap.jobInfo;
+ var childrenDataPacks = inputMap.childrenDataPacks;
+
+ var dataPackType = childrenDataPacks[0... | |
987f8fb93621526c42b7866af816f01b6d7fced4 | lib/mongoskin/gridfs.js | lib/mongoskin/gridfs.js | var GridStore = require('mongodb').GridStore;
/**
* @param filename: filename or ObjectId
*/
var SkinGridStore = exports.SkinGridStore = function(skinDb) {
this.skinDb = skinDb;
}
/**
* @param filename: filename or ObjectId
* callback(err, gridStoreObject)
*/
SkinGridStore.prototype.open = function(filename,... | var GridStore = require('mongodb').GridStore;
/**
* @param filename: filename or ObjectId
*/
var SkinGridStore = exports.SkinGridStore = function(skinDb) {
this.skinDb = skinDb;
}
/**
* @param filename: filename or ObjectId
* callback(err, gridStoreObject)
*/
SkinGridStore.prototype.open = function(id, filen... | Allow opening a file by id and name | Allow opening a file by id and name
| JavaScript | mit | kissjs/node-mongoskin,microlv/node-mongoskin,mleanos/node-mongoskin,dropfen/node-mongoskin | ---
+++
@@ -11,13 +11,13 @@
* @param filename: filename or ObjectId
* callback(err, gridStoreObject)
*/
-SkinGridStore.prototype.open = function(filename, mode, options, callback){
+SkinGridStore.prototype.open = function(id, filename, mode, options, callback){
if(!callback){
callback = options;
o... |
93e2ebe6e77256e9102019350f0969ee3470e813 | src/doc_injector.js | src/doc_injector.js | var DocInjector = {
init: function() {
var that = this;
$.each(this.data, function(i, docReference) {
that.inject(docReference)
});
},
data: [{
"api_url": "http://developer.github.com/v3/meta/#meta",
"method_name":"meta"
}],
inject: function(docReference) {
var anchor = docReference.api_url.split("#... | Add initial API docs js injector | Add initial API docs js injector
| JavaScript | mit | joeyw/octodoctotron,joeyw/octodoctotron,joeyw/octodoctotron | ---
+++
@@ -0,0 +1,20 @@
+var DocInjector = {
+ init: function() {
+ var that = this;
+ $.each(this.data, function(i, docReference) {
+ that.inject(docReference)
+ });
+ },
+ data: [{
+ "api_url": "http://developer.github.com/v3/meta/#meta",
+ "method_name":"meta"
+ }],
+ inject: function(docReference) {
+ va... | |
84c329ce0406b08649bb2c667e5b0e3f4c3e1132 | lib/util/TradingPair.js | lib/util/TradingPair.js |
/*
*
* poloniex-unofficial
* https://git.io/polonode
*
* Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency
* exchange APIs.
*
* Copyright (c) 2016 Tyler Filla
*
* This software may be modified and distributed under the terms of the MIT
* license. See the LICENSE file for details.
*
*/... | Implement basic representation of a trading pair | Implement basic representation of a trading pair
| JavaScript | mit | tylerfilla/node-poloniex-unofficial | ---
+++
@@ -0,0 +1,125 @@
+
+/*
+ *
+ * poloniex-unofficial
+ * https://git.io/polonode
+ *
+ * Yet another unofficial Node.js wrapper for the Poloniex cryptocurrency
+ * exchange APIs.
+ *
+ * Copyright (c) 2016 Tyler Filla
+ *
+ * This software may be modified and distributed under the terms of the MIT
+ * license.... | |
84157c3942725eaaf928a08ad5ac3ba389dc141a | server/routes/users/index.js | server/routes/users/index.js | import express from 'express';
import * as userController from '../../controllers/users';
const user = express.Router();
// define route controllers for creating sign up, login and sign out
user.post('/signup', userController.signUp);
user.post('/signin', userController.signIn);
user.get('/signout', userController.... | Set up '/signup' to use User controller | Set up '/signup' to use User controller
| JavaScript | apache-2.0 | larrystone/BC-26-More-Recipes,larrystone/BC-26-More-Recipes | ---
+++
@@ -0,0 +1,13 @@
+import express from 'express';
+
+import * as userController from '../../controllers/users';
+
+const user = express.Router();
+
+// define route controllers for creating sign up, login and sign out
+user.post('/signup', userController.signUp);
+user.post('/signin', userController.signIn);
+... | |
fae9ab2828b9e5a4c19a65a7e2918b9e33b60558 | src/shared/keypaths.js | src/shared/keypaths.js | const refPattern = /\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g;
const splitPattern = /([^\\](?:\\\\)*)\./;
const escapeKeyPattern = /\\|\./g;
const unescapeKeyPattern = /((?:\\)+)\1|\\(\.)/g;
export function escapeKey ( key ) {
if ( typeof key === 'string' ) {
return key.replace( escapeKeyPattern, '\\$&' );
}
return key... | const refPattern = /\[\s*(\*|[0-9]|[1-9][0-9]+)\s*\]/g;
const splitPattern = /([^\\](?:\\\\)*)\./;
const escapeKeyPattern = /\\|\./g;
const unescapeKeyPattern = /((?:\\)+)\1|\\(\.)/g;
export function escapeKey ( key ) {
if ( typeof key === 'string' ) {
return key.replace( escapeKeyPattern, '\\$&' );
}
return key... | Make splitKeypath() work in old IE | Make splitKeypath() work in old IE
| JavaScript | mit | marcalexiei/ractive,ISNIT0/ractive,marcalexiei/ractive,marcalexiei/ractive,ISNIT0/ractive,ractivejs/ractive,ractivejs/ractive,ractivejs/ractive,ISNIT0/ractive | ---
+++
@@ -16,12 +16,18 @@
}
export function splitKeypath ( keypath ) {
- let parts = normalise( keypath ).split( splitPattern ),
- result = [];
+ let result = [],
+ match;
- for ( let i = 0; i < parts.length; i += 2 ) {
- result.push( parts[i] + ( parts[i + 1] || '' ) );
+ keypath = normalise( keypath );
+... |
c365f8c33825e67846d40e651f4bb7dd063461c5 | lib/extensions.js | lib/extensions.js | var semver = require('semver'),
runtimeVersion = semver.parse(process.version);
/**
* Get Runtime Name
*
* @api private
*/
function getRuntimeName() {
return process.execPath
.split(/[\\/]+/).pop()
.split('.').shift();
}
/**
* Get unique name of binary for current platform
*
* @api priva... | var semver = require('semver'),
runtimeVersion = semver.parse(process.version);
/**
* Get Runtime Name
*
* @api private
*/
function getRuntimeName() {
var runtime = process.execPath
.split(/[\\/]+/).pop()
.split('.').shift();
return runtime === 'node' || runtime === 'nodejs' ? 'node' : ru... | Normalize runtime name for binary installation | Normalize runtime name for binary installation
| JavaScript | mit | Vitogee/node-sass,littlepoolshark/node-sass,paulcbetts/node-sass,nschonni/node-sass,quentinyang/node-sass,justame/node-sass,Smartbank/node-sass,justame/node-sass,SomeoneWeird/node-sass,pmq20/node-sass,chriseppstein/node-sass,yanickouellet/node-sass,besarthoxhaj/node-sass,am11/node-sass,kylecho/node-sass,nibblebot/node-... | ---
+++
@@ -8,9 +8,11 @@
*/
function getRuntimeName() {
- return process.execPath
+ var runtime = process.execPath
.split(/[\\/]+/).pop()
.split('.').shift();
+
+ return runtime === 'node' || runtime === 'nodejs' ? 'node' : runtime;
}
/** |
394cbfd34ee9439048e266fc824432a5a6edec25 | test/player-eats-virus-test.js | test/player-eats-virus-test.js | const chai = require('chai');
const assert = chai.assert;
const Player = require('../public/online-player');
const Virus = require('../lib/virus');
describe('Player eating viruses', function(){
context('Player is large enough to consume virus', function() {
it('deletes the virus from the viruses array', functi... | Add test for player eats virus | Add test for player eats virus
| JavaScript | mit | jecrockett/gametime,jecrockett/gametime | ---
+++
@@ -0,0 +1,66 @@
+const chai = require('chai');
+const assert = chai.assert;
+
+const Player = require('../public/online-player');
+const Virus = require('../lib/virus');
+
+describe('Player eating viruses', function(){
+ context('Player is large enough to consume virus', function() {
+
+ it('deletes the ... | |
66cfb46a9a824b185f7ff3b8c74e666fd80436be | lib/number.with.commas.js | lib/number.with.commas.js | "use static";
function numberWithCommas(number) {
var parts = number.toString().split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
return parts.join(".");
}
Handlebars.registerHelper('commas', numberWithCommas);
| Format numbers with thousand seperators | Format numbers with thousand seperators
| JavaScript | bsd-2-clause | narthollis/eve-skillplan-webapp,narthollis/eve-skillplan-webapp | ---
+++
@@ -0,0 +1,10 @@
+"use static";
+
+function numberWithCommas(number) {
+ var parts = number.toString().split(".");
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+ return parts.join(".");
+}
+
+Handlebars.registerHelper('commas', numberWithCommas);
+ | |
5dcc55153ee9f81058f01d22a4db8a215b221966 | squanch.js | squanch.js | const squanch = (...patterns) => {
return v => {
const primitives = ['Number', 'String', 'Boolean', 'Symbol'];
const isIdentical = (p, v) => p === v;
const isNull = (p, v) => isIdentical(null, p) && isIdentical(p, v);
const isUndefined = (p, v) => isIdentical(undefined, p) && isIdentical(p, v);
const isPrim... | Add initial pattern matching logic | Add initial pattern matching logic
get schwifty! | JavaScript | mit | magbicaleman/squanch | ---
+++
@@ -0,0 +1,36 @@
+const squanch = (...patterns) => {
+ return v => {
+ const primitives = ['Number', 'String', 'Boolean', 'Symbol'];
+
+ const isIdentical = (p, v) => p === v;
+ const isNull = (p, v) => isIdentical(null, p) && isIdentical(p, v);
+ const isUndefined = (p, v) => isIdentical(undefined, p) &&... | |
e2558b0870f368dcbf7a3defa63167384f521c66 | html2md.js | html2md.js | #!/usr/bin/env node
var fs = require('fs')
toMarkdown = require('to-markdown');
fn = process.argv[2]
fs.readFile(fn, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
converter = {
filter: ['span', 'title', 'meta', 'style'],
replacement: function(content) {
if (
content.tagName == '... | Add html->md script (moved from wkoszek/me/scripts) | Add html->md script (moved from wkoszek/me/scripts)
| JavaScript | bsd-2-clause | wkoszek/tools,wkoszek/tools,wkoszek/tools | ---
+++
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+
+var fs = require('fs')
+toMarkdown = require('to-markdown');
+
+fn = process.argv[2]
+
+fs.readFile(fn, 'utf8', function (err,data) {
+ if (err) {
+ return console.log(err);
+ }
+ converter = {
+ filter: ['span', 'title', 'meta', 'style'],
+ replacement: function(co... | |
cdd10264a128017b80b501e183c2925e30048a43 | server/index.js | server/index.js | const express = require('express');
const redis = require("redis");
const session = require('express-session');
const RedisStore = require('connect-redis')(session);
const passport = require('passport');
const path = require('path');
const app = express();
const server = require('http').createServer(app);
const io = re... | const express = require('express');
const redis = require("redis");
const session = require('express-session');
const RedisStore = require('connect-redis')(session);
const passport = require('passport');
const path = require('path');
const app = express();
const server = require('http').createServer(app);
const io = re... | Add csurf to protect against CSRF attacks | Add csurf to protect against CSRF attacks
| JavaScript | bsd-3-clause | zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good,karuppiah7890/Mail-for-Good,zhakkarn/Mail-for-Good,zhakkarn/Mail-for-Good,karuppiah7890/Mail-for-Good | ---
+++
@@ -7,6 +7,7 @@
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io')(server);
+const csrf = require('csurf');
require('dotenv').config();
@@ -18,7 +19,7 @@
const client = redis.createClient();
-client.on("error", err => console.log(`Error: ${err... |
7022aa26b0ef3a0610b5f80255bc95d8d29027a7 | tests/hello.js | tests/hello.js | // Copyright 2015 Samsung Electronics Co., Ltd.
// Copyright 2015 University of Szeged.
//
// 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.... | Add a "Hello JerryScript!" program to the tests | Add a "Hello JerryScript!" program to the tests
The current code base does not contain any "first JavaScript
program" for those who build JerryScript for Linux console. It
does contain a LED-blinking example -- blinky.js -- but that's
only useful on an developer board where LEDs-to-be-blinked are
available. And the re... | JavaScript | apache-2.0 | zherczeg/jerryscript,jack60504/jerryscript,slaff/jerryscript,bzsolt/jerryscript,robertsipka/jerryscript,loki04/jerryscript,LaszloLango/jerryscript,slaff/jerryscript,akosthekiss/jerryscript,bzsolt/jerryscript,jerryscript-project/jerryscript,martijnthe/jerryscript,tilmannOSG/jerryscript,martijnthe/jerryscript,LaszloLango... | ---
+++
@@ -0,0 +1,16 @@
+// Copyright 2015 Samsung Electronics Co., Ltd.
+// Copyright 2015 University of Szeged.
+//
+// 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:/... | |
944f8f79929e732b6554b7648dac0188213ca540 | app/components/api.js | app/components/api.js | export function get(path) {
return request('GET', path, '', {});
}
export function post(path, body, signature) {
return request('POST', path, body, signature);
}
function request(verb, path, body, signature) {
return fetch(path, Object.assign({
method: verb,
headers: {
'Accept': 'application/json'... | Move API functions into separate file | Move API functions into separate file
| JavaScript | apache-2.0 | dillonhafer/garage-ios,dillonhafer/garage-ios | ---
+++
@@ -0,0 +1,19 @@
+export function get(path) {
+ return request('GET', path, '', {});
+}
+
+export function post(path, body, signature) {
+ return request('POST', path, body, signature);
+}
+
+function request(verb, path, body, signature) {
+ return fetch(path, Object.assign({
+ method: verb,
+ header... | |
98c536016b4c8d2364b854b835ad347038dc49dd | tests/utils/time/TimeParserTests.js | tests/utils/time/TimeParserTests.js | /** @ignore */
const TimeParser = requireApp('utils/time/TimeParser');
/** @ignore */
const assert = require('assert');
describe('app/utils/time/TimeParser', () => {
describe('#parse()', () => {
it('returns format, time array and seconds as an object', () => {
let time = TimeParser.parse('2h2s'... | Add tests for time parser utility | Add tests for time parser utility
| JavaScript | mit | Senither/AvaIre | ---
+++
@@ -0,0 +1,40 @@
+/** @ignore */
+const TimeParser = requireApp('utils/time/TimeParser');
+/** @ignore */
+const assert = require('assert');
+
+describe('app/utils/time/TimeParser', () => {
+ describe('#parse()', () => {
+ it('returns format, time array and seconds as an object', () => {
+ ... | |
7f61cb688bdd653a05f8d44bb242f63732acdcc2 | node-tests/blueprints/mixin-test.js | node-tests/blueprints/mixin-test.js | 'use strict';
var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
var setupTestHooks = blueprintHelpers.setupTestHooks;
var emberNew = blueprintHelpers.emberNew;
var emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
var expect = require('ember-cli-blueprint-test-helpers/chai').expe... | Add inital test for mixin blueprint | Add inital test for mixin blueprint
| JavaScript | mit | kimroen/ember-cli-coffeescript,kimroen/ember-cli-coffeescript,kimroen/ember-cli-coffeescript | ---
+++
@@ -0,0 +1,48 @@
+'use strict';
+
+var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
+var setupTestHooks = blueprintHelpers.setupTestHooks;
+var emberNew = blueprintHelpers.emberNew;
+var emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
+
+var expect = require('ember-cli... | |
68235553f0d6fda45339cbf88b4998942ca5037c | i18n/jquery.spectrum-es.js | i18n/jquery.spectrum-es.js | // Spectrum Colorpicker
// Spanish (es) localization
// https://github.com/bgrins/spectrum
(function ( $ ) {
var localization = $.spectrum.localization["es"] = {
cancelText: "Cancelar",
chooseText: "Elegir",
clearText: "Borrar color seleccionado",
noColorSelectedText: "Ningn color ... | // Spectrum Colorpicker
// Spanish (es) localization
// https://github.com/bgrins/spectrum
(function ( $ ) {
var localization = $.spectrum.localization["es"] = {
cancelText: "Cancelar",
chooseText: "Elegir",
clearText: "Borrar color seleccionado",
noColorSelectedText: "Ningún color... | Fix Spanish language file encoding (UTF-8). | Fix Spanish language file encoding (UTF-8).
| JavaScript | mit | ginlime/spectrum,GerHobbelt/spectrum,liitii/spectrum,GerHobbelt/spectrum,ajssd/spectrum,maurojs25/spectrum,kotmatpockuh/spectrum,liitii/spectrum,safareli/spectrum,ginlime/spectrum,shawinder/spectrum,armanforghani/spectrum,bgrins/spectrum,ajssd/spectrum,kotmatpockuh/spectrum,safareli/spectrum,c9s/spectrum,shawinder/spec... | ---
+++
@@ -8,8 +8,8 @@
cancelText: "Cancelar",
chooseText: "Elegir",
clearText: "Borrar color seleccionado",
- noColorSelectedText: "Ningn color seleccionado",
- togglePaletteMoreText: "Ms",
+ noColorSelectedText: "Ningún color seleccionado",
+ togglePaletteMore... |
3a0dfb0a715d352ff612059a924a8992006fa6c9 | 25/passport-facebook.js | 25/passport-facebook.js | var passport = require('passport');
var FacebookStrategy = require('passport-facebook').Strategy;
var express = require('express');
var cookieSession = require('cookie-session');
var app = express();
app.use(cookieSession({keys: ['asdfghjkl!@#$%ASDFGHJ']}))
app.use(passport.initialize());
app.use(passport.session());
... | Add the example to get the authorization from facebook. | Add the example to get the authorization from facebook.
| JavaScript | mit | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | ---
+++
@@ -0,0 +1,65 @@
+var passport = require('passport');
+var FacebookStrategy = require('passport-facebook').Strategy;
+var express = require('express');
+
+var cookieSession = require('cookie-session');
+var app = express();
+app.use(cookieSession({keys: ['asdfghjkl!@#$%ASDFGHJ']}))
+app.use(passport.initializ... | |
b85b349730792bfc7721d343467a831a7304e1a8 | client/app/data/validator/Email.js | client/app/data/validator/Email.js | Ext.define('Starter.data.validator.Email', {
override: 'Ext.data.validator.Email',
validate: function(value) {
if (value === undefined || value === null || Ext.String.trim(value).length === 0) {
return true;
}
var matcher = this.getMatcher(), result = matcher && matcher.test(value);
return result ? result... | Change the email validator so it also works for optional fields | Change the email validator so it also works for optional fields | JavaScript | apache-2.0 | ralscha/eds-starter6-mongodb,ralscha/eds-starter6-mongodb,ralscha/eds-starter6-mongodb | ---
+++
@@ -0,0 +1,11 @@
+Ext.define('Starter.data.validator.Email', {
+ override: 'Ext.data.validator.Email',
+
+ validate: function(value) {
+ if (value === undefined || value === null || Ext.String.trim(value).length === 0) {
+ return true;
+ }
+ var matcher = this.getMatcher(), result = matcher && matcher.te... | |
6a6e35d90b2da1265911c1c4ebdf5082b2d1e777 | test/reducers/gui_test.js | test/reducers/gui_test.js | /* eslint-disable max-len */
import { UPDATE_LOCATION } from 'react-router-redux'
import { expect, // sinon
} from '../spec_helper'
import * as subject from '../../src/reducers/gui'
describe('gui reducer', () => {
describe('initial state', () => {
it('sets up a default initialState', () => {
expect(... | Add basic gui reducer test | Add basic gui reducer test
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp | ---
+++
@@ -0,0 +1,15 @@
+/* eslint-disable max-len */
+import { UPDATE_LOCATION } from 'react-router-redux'
+import { expect, // sinon
+ } from '../spec_helper'
+import * as subject from '../../src/reducers/gui'
+
+describe('gui reducer', () => {
+ describe('initial state', () => {
+ it('sets up a default ... | |
57e0abe38feb077cfb1e33414813d5bc704d150e | week-7/variables-objects.js | week-7/variables-objects.js | // JavaScript Variables and Objects
// I paired by myself on this challenge.
// __________________________________________
// Write your code below.
var secretNumber = 7;
var password = "just open the door"
var allowedIn = false;
var members = ["John", "Susan", "Tom", "Mary"]
// __________________________________... | Add 7.3 variables and objects | Add 7.3 variables and objects
| JavaScript | mit | marcus-a-davis/phase-0,marcus-a-davis/phase-0,marcus-a-davis/phase-0 | ---
+++
@@ -0,0 +1,80 @@
+// JavaScript Variables and Objects
+
+// I paired by myself on this challenge.
+
+// __________________________________________
+// Write your code below.
+
+
+var secretNumber = 7;
+var password = "just open the door"
+var allowedIn = false;
+var members = ["John", "Susan", "Tom", "Mary"]
... | |
558503a4eb6e696294255161d5d83645c89702d5 | migrations/20160728121504-update-chat-channels-to-be-more-flexible.js | migrations/20160728121504-update-chat-channels-to-be-more-flexible.js | exports.up = function(db, cb) {
db.runSql(`
CREATE TABLE channels (
name citext PRIMARY KEY,
private boolean NOT NULL DEFAULT false,
high_traffic boolean NOT NULL DEFAULT false,
topic text,
password text
);`, addChannelNameConstraint)
function addChannelNameConst... | Update the database structure of the chat channels to be more flexible. | Update the database structure of the chat channels to be more flexible.
| JavaScript | mit | ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery | ---
+++
@@ -0,0 +1,96 @@
+exports.up = function(db, cb) {
+ db.runSql(`
+ CREATE TABLE channels (
+ name citext PRIMARY KEY,
+ private boolean NOT NULL DEFAULT false,
+ high_traffic boolean NOT NULL DEFAULT false,
+ topic text,
+ password text
+ );`, addChannelNameConstra... | |
851dc3c21b3b98d60965cda6368623a3750c3c22 | client/webpack.common.config.js | client/webpack.common.config.js | // Common webpack configuration used by webpack.hot.config and webpack.rails.config.
const path = require('path');
module.exports = {
// the project dir
context: __dirname,
entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'],
resolve: {
root: [
path.join(__dirname, 'scripts'),
path.j... | // Common webpack configuration used by webpack.hot.config and webpack.rails.config.
const path = require('path');
module.exports = {
// the project dir
context: __dirname,
entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'],
resolve: {
root: [
path.join(__dirname, 'scripts'),
path.j... | Add additional jquery expose-loader to global $ | Add additional jquery expose-loader to global $
| JavaScript | mit | szyablitsky/react-webpack-rails-tutorial,yakovenkodenis/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,janklimo/react-webpack-rails-tutorial,shunwen/react-webpack-rails-tutorial,Rvor/react-webpack-rails-tutorial,jeffthemaximum/jeffline,janklimo/react-webpack-rails-tutorial,suzukaze/react-webpack-rail... | ---
+++
@@ -21,6 +21,7 @@
// React is necessary for the client rendering:
{test: require.resolve('react'), loader: 'expose?React'},
{test: require.resolve('jquery'), loader: 'expose?jQuery'},
+ {test: require.resolve('jquery'), loader: 'expose?$'},
],
},
}; |
1ea2a51a7d944e5e0abf15ff23c959085178adf5 | week-7/nums_commas.js | week-7/nums_commas.js | // Separate Numbers with Commas in JavaScript **Pairing Challenge**
// I worked on this challenge with: Joseph Scott.
// Pseudocode
// turn number into string, split it into an array, & reverse it
// iterate through array
// push each value to new output array
// if value's index+1 is divisible by 3, then push a com... | Add code and reflection for challenge. | Add code and reflection for challenge.
| JavaScript | mit | svcastaneda/phase-0,svcastaneda/phase-0,svcastaneda/phase-0 | ---
+++
@@ -0,0 +1,74 @@
+// Separate Numbers with Commas in JavaScript **Pairing Challenge**
+
+
+// I worked on this challenge with: Joseph Scott.
+
+// Pseudocode
+// turn number into string, split it into an array, & reverse it
+// iterate through array
+// push each value to new output array
+// if value's index... | |
ee570a8136252524eadf44a52c2e502c1d5e24f1 | index.js | index.js | const logger = require('./lib/logging')
const make = require('./lib/make')
const random = require('./lib/random')
const utils = require('./lib/utils')
module.exports = {
logger,
random,
make,
utils
}
| Add entry point for node package | Add entry point for node package
| JavaScript | mpl-2.0 | MozillaSecurity/octo | ---
+++
@@ -0,0 +1,11 @@
+const logger = require('./lib/logging')
+const make = require('./lib/make')
+const random = require('./lib/random')
+const utils = require('./lib/utils')
+
+module.exports = {
+ logger,
+ random,
+ make,
+ utils
+} | |
d26711169f97188af5600ce48897e6332cb6b024 | index.js | index.js | /**
* Detect Electron renderer process, which is node, but we should
* treat as a browser.
*/
if ((process || {}).type === 'renderer') {
module.exports = require('./browser');
} else {
module.exports = require('./node');
}
| Add a switch to flip between electron and node | Add a switch to flip between electron and node
| JavaScript | mit | visionmedia/debug,jabaz/debug,jabaz/debug | ---
+++
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if ((process || {}).type === 'renderer') {
+ module.exports = require('./browser');
+} else {
+ module.exports = require('./node');
+} | |
28637a6017dd9dd142d795e6600eb31b2f4a48fe | Easy/070_Clibing_Stairs.js | Easy/070_Clibing_Stairs.js | /**
* @param {number} n
* @return {number}
*/
var climbStairs = function(n) {
var ans = [1,1,2];
for (var i = 3; i <= n; i++) {
ans[i] = ans[i - 1] + ans[i - 2];
}
return ans[n];
};
| Add solution to question 70 | Add solution to question 70
| JavaScript | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | ---
+++
@@ -0,0 +1,13 @@
+/**
+ * @param {number} n
+ * @return {number}
+ */
+var climbStairs = function(n) {
+ var ans = [1,1,2];
+
+ for (var i = 3; i <= n; i++) {
+ ans[i] = ans[i - 1] + ans[i - 2];
+ }
+
+ return ans[n];
+}; | |
d14ab90a3d1d459d277beb24d987fc634f7dcaf1 | files/transportapi.js/0.0.1/transportapi.min.js | files/transportapi.js/0.0.1/transportapi.min.js | var TransportAPI=function(){var a="",b="",c="http://transportapi.com/v3",d=function(){return"app_id="+a+"&api_key="+b+"&callback=?"},e=function(a,b){return function(){$.ajax({url:a,dataType:"jsonp",timeout:1e4}).done(b).fail(function(){console.log("transportAPIcall FAIL. URL:"+a)})}};return{init:function(c,d){a=c,b=d},... | Update project transportapi.js to 0.0.1 | Update project transportapi.js to 0.0.1
| JavaScript | mit | Swatinem/jsdelivr,walkermatt/jsdelivr,royswastik/jsdelivr,firulais/jsdelivr,bdukes/jsdelivr,ManrajGrover/jsdelivr,ntd/jsdelivr,labsvisual/jsdelivr,justincy/jsdelivr,alexmojaki/jsdelivr,firulais/jsdelivr,Sneezry/jsdelivr,garrypolley/jsdelivr,tomByrer/jsdelivr,dpellier/jsdelivr,yaplas/jsdelivr,bonbon197/jsdelivr,Metrakit... | ---
+++
@@ -0,0 +1 @@
+var TransportAPI=function(){var a="",b="",c="http://transportapi.com/v3",d=function(){return"app_id="+a+"&api_key="+b+"&callback=?"},e=function(a,b){return function(){$.ajax({url:a,dataType:"jsonp",timeout:1e4}).done(b).fail(function(){console.log("transportAPIcall FAIL. URL:"+a)})}};return{ini... | |
b6ced965ce852c91998b9b9fd08c8120ad5f973c | index.js | index.js |
var postcss = require('postcss'),
color = require('color');
module.exports = postcss.plugin('postcss-lowvision', function () {
return function (css) {
css.walkDecls('color', function (decl) {
var val = decl.value;
var rgb = color(val);
rgb = rgb.rgbArray();
... |
var postcss = require('postcss'),
color = require('color');
module.exports = postcss.plugin('postcss-lowvision', function () {
return function (css) {
css.walkDecls('color', function (decl) {
var val = decl.value;
var rgb = color(val);
rgb = rgb.rgbArray();
... | Fix error - transparent not defined | Fix error - transparent not defined
| JavaScript | mit | keukenrolletje/postcss-lowvision | ---
+++
@@ -8,7 +8,7 @@
var val = decl.value;
var rgb = color(val);
rgb = rgb.rgbArray();
- decl.value = transparent;
+ decl.value = 'transparent';
decl.cloneAfter({ prop: 'text-shadow',
value: '0 0 5px rgba(' + r... |
b615be2f238a488b17a394d0b2d0572541164c95 | ui/src/kapacitor/components/LogsTable.js | ui/src/kapacitor/components/LogsTable.js | import React, {PropTypes} from 'react'
import InfiniteScroll from 'shared/components/InfiniteScroll'
import LogsTableRow from 'src/kapacitor/components/LogsTableRow'
const LogsTable = ({logs, onToggleExpandLog}) =>
<div className="logs-table--container">
<div className="logs-table--header">
<h2 className=... | import React, {PropTypes} from 'react'
import LogsTableRow from 'src/kapacitor/components/LogsTableRow'
import FancyScrollbar from 'src/shared/components/FancyScrollbar'
const numLogsToRender = 200
const LogsTable = ({logs, onToggleExpandLog}) =>
<div className="logs-table--container">
<div className="logs-tab... | Remove infinite scroll from logs table and render only 200 most recent logs | Remove infinite scroll from logs table and render only 200 most recent logs
| JavaScript | mit | li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,influxdb/influxdb,influxdata/influxdb,mark-rushakoff/influxdb,mark-rushakoff/influ... | ---
+++
@@ -1,29 +1,30 @@
import React, {PropTypes} from 'react'
-import InfiniteScroll from 'shared/components/InfiniteScroll'
import LogsTableRow from 'src/kapacitor/components/LogsTableRow'
+import FancyScrollbar from 'src/shared/components/FancyScrollbar'
+
+const numLogsToRender = 200
const LogsTable = ({... |
37ea3cd02080533bb1fd8f9794f06eef83a6f4eb | example/MultiModule.js | example/MultiModule.js |
/**
* This is a class/module.
* @class class1
* @module module1
*/
/**
* This is another class/module.
* @class class2
* @module module2
*/
/**
* This is a module that's a private class.
* @class class3
* @module module3
*/
/**
* This is another something.
* @class class4
* @module module4
*/
/**
... | Add more simple modules/classes to test example | Add more simple modules/classes to test example
| JavaScript | mit | kevinlacotaco/yuidoc-bootstrap-theme,wyantb/yuidoc-bootstrap-theme,naturalatlas/yuidoc-lucid-theme,kevinlacotaco/yuidoc-bootstrap-theme,wyantb/yuidoc-bootstrap-theme,wyantb/yuidoc-bootstrap-theme,kevinlacotaco/yuidoc-bootstrap-theme,naturalatlas/yuidoc-lucid-theme | ---
+++
@@ -0,0 +1,30 @@
+
+/**
+ * This is a class/module.
+ * @class class1
+ * @module module1
+ */
+
+/**
+ * This is another class/module.
+ * @class class2
+ * @module module2
+ */
+
+/**
+ * This is a module that's a private class.
+ * @class class3
+ * @module module3
+ */
+
+/**
+ * This is another something... | |
d3371d4c6eff5c69ff3c904f76541b3c6277355a | src/util/find-element-in-registry.js | src/util/find-element-in-registry.js | import customElements from '../native/custom-elements';
export default function (elem) {
const tagName = elem.tagName;
if (!tagName) {
return;
}
const tagNameLc = tagName.toLowerCase();
const tagNameDefinition = customElements.get(tagNameLc);
if (tagNameDefinition) {
return tagNameDefinition;
... | Add a utility for getting an element definition from the registry base on the element itself. | Add a utility for getting an element definition from the registry base on the element itself.
| JavaScript | mit | chrisdarroch/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs,skatejs/skatejs | ---
+++
@@ -0,0 +1,23 @@
+import customElements from '../native/custom-elements';
+
+export default function (elem) {
+ const tagName = elem.tagName;
+
+ if (!tagName) {
+ return;
+ }
+
+ const tagNameLc = tagName.toLowerCase();
+ const tagNameDefinition = customElements.get(tagNameLc);
+
+ if (tagNameDefini... | |
51fab14d010e8187d2691f205439722faac03837 | test/addCreateAndModified-test.js | test/addCreateAndModified-test.js | var vows = require('vows')
, assert = require('assert')
, mongoose = require('mongoose')
, timestamp = require('../lib/addCreatedAndModified')
, util = require('util')
// DB setup
mongoose.connect('mongodb://localhost/mongoose_troop')
// Setting up test schema
var Schema = mongoose.Schema
, ObjectId = Sch... | Test case for addCreateAndModified plugin | Test case for addCreateAndModified plugin
| JavaScript | mit | tblobaum/mongoose-troop,janez89/mongoose-utilities,iliakan/mongoose-troop | ---
+++
@@ -0,0 +1,40 @@
+var vows = require('vows')
+ , assert = require('assert')
+ , mongoose = require('mongoose')
+ , timestamp = require('../lib/addCreatedAndModified')
+ , util = require('util')
+
+// DB setup
+mongoose.connect('mongodb://localhost/mongoose_troop')
+
+// Setting up test schema
+var Schem... | |
943e66b8b52cadeb4959378b608cc91ed2d28cb4 | lib/natural/util/stopwords_zh.js | lib/natural/util/stopwords_zh.js | /*
Copyright (c) 2011, David Przybilla, Chris Umbel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | Add stopwords which have little meaning and can be excluded from analysis for Chinese. | Add stopwords which have little meaning and can be excluded from analysis for Chinese.
| JavaScript | mit | ahmedshuhel/natural,kjhenner/natural,PTaylour/natural,NaturalNode/natural,mamaral/natural,Hugo-ter-Doest/natural,itamayo/natural,mcanthony/natural,walkingdoctors/natural,dpraimeyuu/natural,levy5674/natural,moos/natural,PMSI-AlignAlytics/natural,karimsa/natural,Logicify/natural,polymaths/natural | ---
+++
@@ -0,0 +1,45 @@
+/*
+Copyright (c) 2011, David Przybilla, Chris Umbel
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+t... | |
846a954d365408a8571c30c22e88beb3c91bd949 | context-test.js | context-test.js | var Buffer = require('buffer').Buffer;
var readline = require('readline');
var gss = require('./index.js');
var creds = gss.acquireCredential(null, 0,
[gss.KRB5_MECHANISM], gss.C_INITIATE);
var zsrName = gss.importName('host@zsr.mit.edu', gss.C_NT_HOSTBASED_SERVICE);
var context = gs... | Add a test program for an initiator context | Add a test program for an initiator context
| JavaScript | mit | roost-im/node-gss,roost-im/node-gss,roost-im/node-gss | ---
+++
@@ -0,0 +1,32 @@
+var Buffer = require('buffer').Buffer;
+var readline = require('readline');
+
+var gss = require('./index.js');
+
+var creds = gss.acquireCredential(null, 0,
+ [gss.KRB5_MECHANISM], gss.C_INITIATE);
+var zsrName = gss.importName('host@zsr.mit.edu', gss.C_NT_H... | |
16e3b3de48b4ee6d391d647ab49dc92e3347204c | eloquent_js/chapter15/ch15_ex03.js | eloquent_js/chapter15/ch15_ex03.js | function asTabs(node) {
for (let child of node.children) {
let label = child.getAttribute("data-tabname");
let button = document.createElement("button");
button.appendChild(document.createTextNode(label));
button.addEventListener(
"click",
event => changeTab(event.target.firstChild.nodeValue)
);
chil... | Add chapter 15, exercise 3 | Add chapter 15, exercise 3
| JavaScript | mit | bewuethr/ctci | ---
+++
@@ -0,0 +1,39 @@
+function asTabs(node) {
+ for (let child of node.children) {
+ let label = child.getAttribute("data-tabname");
+ let button = document.createElement("button");
+ button.appendChild(document.createTextNode(label));
+ button.addEventListener(
+ "click",
+ event => changeTab(event.targe... | |
5b98216ecbcff1bd99ffd8f98630a069d4ad3f2b | test/reporters/console-gjs.js | test/reporters/console-gjs.js | 'use strict';
var deferred = require('deferred');
module.exports = function (t, a) {
var report = [{ message: 'Lorem ipsum', character: 1, line: 1 }], invoked;
report.src = 'Lorem ipsum';
report.options = {};
t(deferred({ 'foo': report }), { log: function (str) {
a(typeof str, 'string', "Log string");
invoked... | Test for gjs style report | Test for gjs style report
| JavaScript | mit | medikoo/xlint,medikoo/xlint | ---
+++
@@ -0,0 +1,14 @@
+'use strict';
+
+var deferred = require('deferred');
+
+module.exports = function (t, a) {
+ var report = [{ message: 'Lorem ipsum', character: 1, line: 1 }], invoked;
+ report.src = 'Lorem ipsum';
+ report.options = {};
+ t(deferred({ 'foo': report }), { log: function (str) {
+ a(typeof st... | |
54cf7c53c2077520011bbc9f7c6e95e581cea2be | test/components/FactionSwitch.spec.js | test/components/FactionSwitch.spec.js | import { React, sinon, assert, expect, TestUtils } from '../test_exports';
import FactionSwitch from '../../src/js/components/FactionSwitch';
import * as MapActions from '../../src/js/actions/MapActions';
const props = {
ontext: 'radiant',
offtext: 'dire',
isRadiant: true,
switchFaction: MapActions.switchFacti... | Create test with clicking simulation | Create test with clicking simulation
| JavaScript | mit | kusera/sentrii,kusera/sentrii | ---
+++
@@ -0,0 +1,42 @@
+import { React, sinon, assert, expect, TestUtils } from '../test_exports';
+import FactionSwitch from '../../src/js/components/FactionSwitch';
+import * as MapActions from '../../src/js/actions/MapActions';
+
+const props = {
+ ontext: 'radiant',
+ offtext: 'dire',
+ isRadiant: true,
+ s... | |
1c37233c9af23749fea11b52423c64f18fd0be1a | migrations/20171228201331_agenda-tags-image.js | migrations/20171228201331_agenda-tags-image.js |
exports.up = function (knex, Promise) {
return Promise.all([
knex.schema.table('agenda', function (table) {
table.string('image');
}),
knex.schema.createTable('tags', function (table) {
table.increments('id').notNullable().primary();
table.string('tag').notNullable();
}),
knex... | Add migration file for agenda tags and image | Add migration file for agenda tags and image
| JavaScript | mit | voxpelli/node-one-page,voxpelli/node-one-page | ---
+++
@@ -0,0 +1,28 @@
+
+exports.up = function (knex, Promise) {
+ return Promise.all([
+ knex.schema.table('agenda', function (table) {
+ table.string('image');
+ }),
+
+ knex.schema.createTable('tags', function (table) {
+ table.increments('id').notNullable().primary();
+ table.string('t... | |
dfa25e23b43c3464b8cd18fc70f5bd69e8e9644d | test-fixtures/migration-data.js | test-fixtures/migration-data.js | export const round1 = {
'Bridge.currentRound': '1',
'Bridge.maker': '0',
'Bridge.players': '[{"bid":null,"win":null,"_buffer":{"lastRound":null,"combo":null,"miss":null,"maxCombo":null,"sum":null},"score":[],"name":"Jonathan"},{"bid":null,"win":null,"_buffer":{"lastRound":null,"combo":null,"miss":null,"maxCombo":... | Add test fixtures for data in v1.0.0 | Add test fixtures for data in v1.0.0
| JavaScript | mit | Holi0317/bridge-calc,Holi0317/bridge-calc,Holi0317/bridge-calc | ---
+++
@@ -0,0 +1,15 @@
+export const round1 = {
+ 'Bridge.currentRound': '1',
+ 'Bridge.maker': '0',
+ 'Bridge.players': '[{"bid":null,"win":null,"_buffer":{"lastRound":null,"combo":null,"miss":null,"maxCombo":null,"sum":null},"score":[],"name":"Jonathan"},{"bid":null,"win":null,"_buffer":{"lastRound":null,"comb... | |
ad31d7b15df5c18f922d026a62ea7cce6056054e | website/app/application/services/prov-template.js | website/app/application/services/prov-template.js | Application.Services.factory("provTemplate", [provTemplate]);
function provTemplate() {
var service = {
_handleProcessStep: function(templates, filesRequired) {
if (templates.length !== 0) {
return templates[0].template_name;
}
// templates.length === 0... | Add service for determining things to do with templates. | Add service for determining things to do with templates.
| 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,100 @@
+Application.Services.factory("provTemplate", [provTemplate]);
+
+function provTemplate() {
+ var service = {
+
+ _handleProcessStep: function(templates, filesRequired) {
+ if (templates.length !== 0) {
+ return templates[0].template_name;
+ }
+... | |
6558cbf9032ad066b42e7e91c33fc4a5a7c63d96 | test/js/spec/vent-constructor.js | test/js/spec/vent-constructor.js | define([
'js-utils/js/vent-constructor',
'underscore'
], function(VentConstructor, _) {
describe('Vent constructor', function() {
beforeEach(function() {
this.clock = sinon.useFakeTimers();
this.router = jasmine.createSpyObj('router', ['navigate']);
this.vent =... | Add tests for vent constructor. [rev: matthew.gordon2] | Add tests for vent constructor. [rev: matthew.gordon2]
| JavaScript | mit | hpautonomy/jsWhatever,hpe-idol/jsWhatever,hpe-idol/jsWhatever,hpautonomy/jsWhatever,hpautonomy/jsWhatever,hpe-idol/jsWhatever | ---
+++
@@ -0,0 +1,39 @@
+define([
+ 'js-utils/js/vent-constructor',
+ 'underscore'
+], function(VentConstructor, _) {
+
+ describe('Vent constructor', function() {
+
+ beforeEach(function() {
+ this.clock = sinon.useFakeTimers();
+
+ this.router = jasmine.createSpyObj('router', ... | |
0703d3d0d20aa9056448af5afd236d3f8d845721 | test/validators/boolean.spec.js | test/validators/boolean.spec.js | import { expect } from 'chai';
import validator from '../../lib';
describe('Boolean validator', () => {
const rules = {
paid: ['boolean']
};
context('when given false', () => {
it('should success', () => {
const result = validator.validate(rules, {paid: false});
const err = result.messages;
... | Add test cases for boolean validation rule | Add test cases for boolean validation rule
| JavaScript | mit | sendyhalim/satpam,cermati/satpam | ---
+++
@@ -0,0 +1,53 @@
+import { expect } from 'chai';
+import validator from '../../lib';
+
+describe('Boolean validator', () => {
+ const rules = {
+ paid: ['boolean']
+ };
+
+ context('when given false', () => {
+ it('should success', () => {
+ const result = validator.validate(rules, {paid: false}... | |
9906576240c224e31e5813a7243c503f084e293b | src/utils/hilbert-curve.js | src/utils/hilbert-curve.js | /* eslint-disable no-plusplus,no-bitwise */
// Adapted from Jason Davies: https://www.jasondavies.com/hilbert-curve/
const hilbert = (function () {
// From Mike Bostock: http://bl.ocks.org/597287
// Adapted from Nick Johnson: http://bit.ly/biWkkq
const pairs = [
[[0, 3], [1, 0], [3, 1], [2, 0]],
[[2, 1],... | Add code for Hilbert curve | Add code for Hilbert curve
| JavaScript | mit | flekschas/hipiler,flekschas/hipiler,flekschas/hipiler | ---
+++
@@ -0,0 +1,60 @@
+/* eslint-disable no-plusplus,no-bitwise */
+
+// Adapted from Jason Davies: https://www.jasondavies.com/hilbert-curve/
+const hilbert = (function () {
+ // From Mike Bostock: http://bl.ocks.org/597287
+ // Adapted from Nick Johnson: http://bit.ly/biWkkq
+ const pairs = [
+ [[0, 3], [1... | |
5c3bfa6a83689bafe404041987250c455c82a5f9 | spec/unit/matrix-client.spec.js | spec/unit/matrix-client.spec.js | "use strict";
var sdk = require("../..");
var MatrixClient = sdk.MatrixClient;
var utils = require("../test-utils");
describe("MatrixClient", function() {
var userId = "@alice:bar";
var client;
beforeEach(function() {
utils.beforeEach(this);
});
describe("getSyncState", function() {
... | Add stub unit tests for syncing | Add stub unit tests for syncing
| JavaScript | apache-2.0 | krombel/matrix-js-sdk,matrix-org/matrix-js-sdk,krombel/matrix-js-sdk,matrix-org/matrix-js-sdk,krombel/matrix-js-sdk,matrix-org/matrix-js-sdk,williamboman/matrix-js-sdk,matrix-org/matrix-js-sdk,williamboman/matrix-js-sdk,williamboman/matrix-js-sdk | ---
+++
@@ -0,0 +1,77 @@
+"use strict";
+var sdk = require("../..");
+var MatrixClient = sdk.MatrixClient;
+var utils = require("../test-utils");
+
+describe("MatrixClient", function() {
+ var userId = "@alice:bar";
+ var client;
+
+ beforeEach(function() {
+ utils.beforeEach(this);
+ });
+
+ de... | |
7500fb9b8c55f7468accf6d9a7e0dcb5a5b4d5ef | test/modules.node.test.js | test/modules.node.test.js | var modules = require('../lib/middleware/modules')
, fs = require('fs');
function MockRequest() {
}
function MockResponse(done) {
this.headers = {};
this._done = done;
}
MockResponse.prototype.setHeader = function(name, value) {
this.headers[name] = value;
}
MockResponse.prototype.end = function(data) {
... | Test case for serving Node program. | Test case for serving Node program.
| JavaScript | mit | jaredhanson/jsmt | ---
+++
@@ -0,0 +1,53 @@
+var modules = require('../lib/middleware/modules')
+ , fs = require('fs');
+
+
+function MockRequest() {
+}
+
+function MockResponse(done) {
+ this.headers = {};
+ this._done = done;
+}
+
+MockResponse.prototype.setHeader = function(name, value) {
+ this.headers[name] = value;
+}
+
+Mock... | |
e1f74e4ca49c6d08b9cf18483acf187b14c47242 | test/processtimes.test.js | test/processtimes.test.js | 'use strict';
//Load Config File
var fs = require('fs');
var processTimes = require('../processtimes');
//Require Module
var log4js = require('log4js');
var logger = log4js.getLogger('unit-test');
exports['Test Checking Time Format Function'] ={
'Test checkTimeFormat sucess(12:00)':function(test){
... | Test the function which will process times | Test the function which will process times
| JavaScript | apache-2.0 | dollars0427/SQLwatcher | ---
+++
@@ -0,0 +1,41 @@
+'use strict';
+
+//Load Config File
+var fs = require('fs');
+var processTimes = require('../processtimes');
+
+//Require Module
+
+var log4js = require('log4js');
+var logger = log4js.getLogger('unit-test');
+
+exports['Test Checking Time Format Function'] ={
+
+ 'Test checkTimeForm... | |
323fd8981dd021516d6e8f00930b586bcb900284 | Medium/096_Unique_Binary_Search_Trees.js | Medium/096_Unique_Binary_Search_Trees.js | /**
* @param {number} n
* @return {number}
*/
var numTrees = function(n) {
var dp = [0, 1];
var less = 0;
var more = 0;
dp[n] = dp[n] || 0;
for (var i = 1; i <= n; i++) {
less = i - 1;
more = n - i;
if (!dp[less]) {
dp[less] = numTrees(less)
}
... | Add solution to question 096 | Add solution to question 096
| JavaScript | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | ---
+++
@@ -0,0 +1,30 @@
+/**
+ * @param {number} n
+ * @return {number}
+ */
+var numTrees = function(n) {
+ var dp = [0, 1];
+ var less = 0;
+ var more = 0;
+
+ dp[n] = dp[n] || 0;
+ for (var i = 1; i <= n; i++) {
+ less = i - 1;
+ more = n - i;
+ if (!dp[less]) {
+ dp... | |
6e8a1628d0468446a4f04306534d9325a93f6f6d | test/composer/lifecycle-os-deps-test.js | test/composer/lifecycle-os-deps-test.js | var assert = require('assert'),
path = require('path'),
nock = require('nock'),
vows = require('vows'),
helpers = require('../helpers'),
macros = require('../helpers/macros'),
mock = require('../helpers/mock'),
quill = require('../../lib/quill'),
wtfos = require('wtfos');
wtfos.result =... | Add missing lifecycle OS deps test | [test] Add missing lifecycle OS deps test
| JavaScript | mit | opsmezzo/quill | ---
+++
@@ -0,0 +1,53 @@
+var assert = require('assert'),
+ path = require('path'),
+ nock = require('nock'),
+ vows = require('vows'),
+ helpers = require('../helpers'),
+ macros = require('../helpers/macros'),
+ mock = require('../helpers/mock'),
+ quill = require('../../lib/quill'),
+ wtfos... | |
cd5ceceffef29fcd87b465d9a29ab5975acab6a7 | src/js/helpers/qajaxWrapper.js | src/js/helpers/qajaxWrapper.js | var qajax = require("qajax");
var qajaxWrapper = function (options) {
var response = {
status: null,
body: null
};
var parseResponse = function (xhr) {
response.status = xhr.status;
try {
response.body = JSON.parse(xhr.responseText);
} catch (e) {
response.body = xhr.responseText... | var qajax = require("qajax");
var uniqueCalls = [];
function removeCall(options) {
uniqueCalls.splice(uniqueCalls.indexOf(options.url), 1);
}
var qajaxWrapper = function (options) {
if (!options.concurrent) {
if (uniqueCalls.indexOf(options.url) > -1) {
return {
error: () => { return this; },
... | Return stub request object on concurrent request | Return stub request object on concurrent request | JavaScript | apache-2.0 | watonyweng/marathon-ui,cribalik/marathon-ui,cribalik/marathon-ui,mesosphere/marathon-ui,yp-engineering/marathon-ui,janisz/marathon-ui,mesosphere/marathon-ui,yp-engineering/marathon-ui,Raffo/marathon-ui,watonyweng/marathon-ui,janisz/marathon-ui,Raffo/marathon-ui | ---
+++
@@ -1,6 +1,22 @@
var qajax = require("qajax");
+var uniqueCalls = [];
+
+function removeCall(options) {
+ uniqueCalls.splice(uniqueCalls.indexOf(options.url), 1);
+}
+
var qajaxWrapper = function (options) {
+ if (!options.concurrent) {
+ if (uniqueCalls.indexOf(options.url) > -1) {
+ return {
+... |
b84879cd0ec21e1f7c0dcf8b503560d56e66a6c4 | tests/unit/components/LCircleMarker.spec.js | tests/unit/components/LCircleMarker.spec.js | import { getWrapperWithMap } from '@/tests/test-helpers';
import { testCircleFunctionality } from '@/tests/mixin-tests/circle-tests';
import LCircleMarker from '@/components/LCircleMarker.vue';
import L from 'leaflet';
describe('component: LCircleMarker.vue', () => {
test('LCircleMarker.vue has a mapObject', () => {... | Add tests for LCircleMarker component | Add tests for LCircleMarker component
| JavaScript | mit | KoRiGaN/Vue2Leaflet | ---
+++
@@ -0,0 +1,77 @@
+import { getWrapperWithMap } from '@/tests/test-helpers';
+import { testCircleFunctionality } from '@/tests/mixin-tests/circle-tests';
+import LCircleMarker from '@/components/LCircleMarker.vue';
+import L from 'leaflet';
+
+describe('component: LCircleMarker.vue', () => {
+ test('LCircleMa... | |
ac82e1dfda63c2140559ae1ec2e452f737be9291 | template/js/more-recipe.js | template/js/more-recipe.js |
var counter = 0;
$("#up-vote").click(function() {
counter++;
$("#count").text(counter);
});
$("#down-vote").click(function() {
counter--;
$("#count").text(counter);
}) | Add up-vote & down-vote functionality | Add up-vote & down-vote functionality
| JavaScript | mit | iidrees/More-Recipes,iidrees/More-Recipes | ---
+++
@@ -0,0 +1,10 @@
+
+var counter = 0;
+$("#up-vote").click(function() {
+ counter++;
+ $("#count").text(counter);
+});
+$("#down-vote").click(function() {
+ counter--;
+ $("#count").text(counter);
+}) | |
b5616985757ade1f8981c1330a605677bf2c3a82 | test/components/Header.spec.js | test/components/Header.spec.js | import { React, sinon, assert, expect, TestUtils } from '../test_exports';
import Header from '../../src/js/components/Header';
describe('Header component', () => {
let sandbox, header, container, titleGroup, title, subtitle, navbar, navItems;
let findDOMWithClass = TestUtils.findRenderedDOMComponentWithClass;
l... | Add basic component testing for Header | Add basic component testing for Header
| JavaScript | mit | kusera/sentrii,kusera/sentrii | ---
+++
@@ -0,0 +1,27 @@
+import { React, sinon, assert, expect, TestUtils } from '../test_exports';
+import Header from '../../src/js/components/Header';
+
+describe('Header component', () => {
+ let sandbox, header, container, titleGroup, title, subtitle, navbar, navItems;
+ let findDOMWithClass = TestUtils.findR... | |
3d550711e29ab3be257b65350afe583c39b7f1c7 | 9/child_process_ls.js | 9/child_process_ls.js | var child_process = require('child_process');
var ls = child_process.spawn('ls', [ '-lh', '/usr' ]);
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
ls.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
ls.on('close', function (code) {
console.log('child p... | Add the example to list the folder with child process. | Add the example to list the folder with child process.
| JavaScript | mit | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | ---
+++
@@ -0,0 +1,15 @@
+var child_process = require('child_process');
+
+var ls = child_process.spawn('ls', [ '-lh', '/usr' ]);
+
+ls.stdout.on('data', function (data) {
+ console.log('stdout: ' + data);
+});
+
+ls.stderr.on('data', function (data) {
+ console.log('stderr: ' + data);
+});
+
+ls.on('close', fu... | |
a2bcc2373e3dbb2313878e303612ed8c13807e59 | app/resources/v1/users_streets_pg.js | app/resources/v1/users_streets_pg.js | const { User, Street } = require('../../db/models')
const { ERRORS } = require('../../../lib/util')
const logger = require('../../../lib/logger.js')()
exports.get = async function (req, res) {
// Flag error if user ID is not provided
if (!req.params.user_id) {
res.status(400).send('Please provide user ID.')
... | Add users_streets api with sequelize | Add users_streets api with sequelize
| JavaScript | bsd-3-clause | codeforamerica/streetmix,codeforamerica/streetmix,codeforamerica/streetmix | ---
+++
@@ -0,0 +1,78 @@
+const { User, Street } = require('../../db/models')
+const { ERRORS } = require('../../../lib/util')
+const logger = require('../../../lib/logger.js')()
+
+exports.get = async function (req, res) {
+ // Flag error if user ID is not provided
+ if (!req.params.user_id) {
+ res.status(400)... | |
128ea7db413c3f49832949d8d0f2fff97d2f8701 | lib/handlers/providers/index.js | lib/handlers/providers/index.js | "use strict";
var Anyfetch = require('anyfetch');
module.exports.get = function get(req, res, next) {
var anyfetchClient = new Anyfetch(req.accessToken.token);
anyfetchClient.getDocuments({
fields: 'facets.provider'
}, function updated(err, res) {
if(!err) {
var providers = res.facets.providers;
... | Add new endpoint (to replace start) | Add new endpoint (to replace start)
| JavaScript | mit | AnyFetch/companion-server | ---
+++
@@ -0,0 +1,17 @@
+"use strict";
+var Anyfetch = require('anyfetch');
+
+module.exports.get = function get(req, res, next) {
+ var anyfetchClient = new Anyfetch(req.accessToken.token);
+ anyfetchClient.getDocuments({
+ fields: 'facets.provider'
+ }, function updated(err, res) {
+ if(!err) {
+ var... | |
15825eacb313872cfe6d8afff52a93604127e8dd | src/physics/arcade/inc/tilemap/TileIntersectsBody.js | src/physics/arcade/inc/tilemap/TileIntersectsBody.js | var TileIntersectsBody = function (tileWorldRect, body)
{
if (body.isCircle)
{
return false;
}
else
{
return !(
body.right <= tileWorldRect.left ||
body.bottom <= tileWorldRect.top ||
body.position.x >= tileWorldRect.right ||
body.posit... | var TileIntersectsBody = function (tileWorldRect, body)
{
// Currently, all bodies are treated as rectangles when colliding with a Tile. Eventually, this
// should support circle bodies when those are less buggy in v3.
return !(
body.right <= tileWorldRect.left ||
body.bottom <= tileWorldRe... | Add note about circle bodies not currently being supported in Arcade tile intersection | Add note about circle bodies not currently being supported in Arcade tile intersection
| JavaScript | mit | photonstorm/phaser,TukekeSoft/phaser,TukekeSoft/phaser,BeanSeed/phaser,mahill/phaser,spayton/phaser,photonstorm/phaser,pixelpicosean/phaser,spayton/phaser,TukekeSoft/phaser,rblopes/phaser,BeanSeed/phaser,englercj/phaser,mahill/phaser | ---
+++
@@ -1,18 +1,14 @@
var TileIntersectsBody = function (tileWorldRect, body)
{
- if (body.isCircle)
- {
- return false;
- }
- else
- {
- return !(
- body.right <= tileWorldRect.left ||
- body.bottom <= tileWorldRect.top ||
- body.position.x >= tileW... |
0c5f9eda34a90954a94c2e9aa657d2256fe0208f | flow-typed/npm/react-ui-validations_v0.x.x.js | flow-typed/npm/react-ui-validations_v0.x.x.js | // flow-typed signature: 291855e84801d873d854919a58e86373
// flow-typed version: <<STUB>>/react-ui-validations_v0.0.0/flow_v0.90.0
/**
* This is an autogenerated libdef stub for:
*
* 'react-ui-validations'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share ... | Add types for react-ui-validation package | Add types for react-ui-validation package
| JavaScript | mit | moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0,moira-alert/web2.0 | ---
+++
@@ -0,0 +1,84 @@
+// flow-typed signature: 291855e84801d873d854919a58e86373
+// flow-typed version: <<STUB>>/react-ui-validations_v0.0.0/flow_v0.90.0
+
+/**
+ * This is an autogenerated libdef stub for:
+ *
+ * 'react-ui-validations'
+ *
+ * Fill this stub out by replacing all the `any` types.
+ *
+ * Once ... | |
72af2a8f45fad46be6f01a52a2ff40507b2a450c | frontend/src/containers/DeleteNotification.js | frontend/src/containers/DeleteNotification.js | import React from 'react';
export default class DeleteNotification extends React.Component {
render() {
return(
<div className='notification'>
<p>The victim has been deleted.</p>
<div className='btn underline' onClick={ this.props.onUndo }>Undo</div>
... | Add notification once victim deleted | Add notification once victim deleted
| JavaScript | mit | dimriou/rupture,dimriou/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,esarafianou/rupture,dionyziz/rupture,dimkarakostas/rupture,dimriou/rupture,dionyziz/rupture,dionyziz/rupture,dimriou/rupture,dimkarakostas/rupture,dimriou/rupture,dimkarakostas/rupture,esarafianou/rupture,dimkarakostas/rupture,di... | ---
+++
@@ -0,0 +1,14 @@
+import React from 'react';
+
+export default class DeleteNotification extends React.Component {
+ render() {
+ return(
+ <div className='notification'>
+ <p>The victim has been deleted.</p>
+ <div className='btn underline' onClick={ this.pr... | |
24e779a15d7a21d0f64ad90402ff8a30e0fc8ea3 | js/es6-playground/06-defaut-rest-spread.js | js/es6-playground/06-defaut-rest-spread.js | // 06 - Callee-evaluated default parameter values.
// Default params
function mul(a, b = 100) {
return a * b;
}
console.log("MUL: ", mul(5));
function sum(a, b = getSum()) {
return a + b;
}
var getSum = () => 100;
console.log("SUM: ", sum(5));
// Rest parameters
function rest1(x, ...y) {
return x + y.length;... | Add es6 default, rest, spread params examples | Add es6 default, rest, spread params examples
| JavaScript | mit | petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox,petarov/sandbox | ---
+++
@@ -0,0 +1,34 @@
+// 06 - Callee-evaluated default parameter values.
+
+// Default params
+
+function mul(a, b = 100) {
+ return a * b;
+}
+console.log("MUL: ", mul(5));
+
+function sum(a, b = getSum()) {
+ return a + b;
+}
+var getSum = () => 100;
+console.log("SUM: ", sum(5));
+
+// Rest parameters
+
+fun... | |
69ac01bce7a2c4f657e7fa44d5d51696cb788354 | index.js | index.js | var rabbit = require('./rabbit');
var config = require('./rabbit.json');
var commandLineArgs = require('command-line-args');
var args = commandLineArgs([{ name: 'port', alias: 'p' }]).parse();
var socketConfig = require('./socket');
var socketInst = null;
var queue = require('./queue');
rabbit.connect().then(functi... | Add an application that gets messages from rabbit and pushes them into a socket. | Add an application that gets messages from rabbit and pushes them into a socket.
| JavaScript | mit | RenovoSolutions/socket-server | ---
+++
@@ -0,0 +1,27 @@
+var rabbit = require('./rabbit');
+var config = require('./rabbit.json');
+var commandLineArgs = require('command-line-args');
+
+var args = commandLineArgs([{ name: 'port', alias: 'p' }]).parse();
+
+var socketConfig = require('./socket');
+var socketInst = null;
+
+var queue = require('./q... | |
1632ae052f0a5061c09c3c00afc236ad7296ef46 | feature-detects/pointerlock-api.js | feature-detects/pointerlock-api.js | // https://developer.mozilla.org/en-US/docs/API/Pointer_Lock_API
Modernizr.addTest('pointerlock',!!Modernizr.prefixed('pointerLockElement', document));
| Add pointerlock api feature detect | Add pointerlock api feature detect
| JavaScript | mit | Modernizr/Modernizr,Modernizr/Modernizr | ---
+++
@@ -0,0 +1,4 @@
+// https://developer.mozilla.org/en-US/docs/API/Pointer_Lock_API
+
+Modernizr.addTest('pointerlock',!!Modernizr.prefixed('pointerLockElement', document));
+ | |
8001fd55e826485c10c993184e1a0016f07bb858 | src/main/webapp/app/entities/participation/participation-delete-dialog.controller.js | src/main/webapp/app/entities/participation/participation-delete-dialog.controller.js | (function () {
'use strict';
angular
.module('exerciseApplicationApp')
.controller('ParticipationDeleteController', ParticipationDeleteController);
ParticipationDeleteController.$inject = ['$uibModalInstance', 'entity', 'Participation'];
function ParticipationDeleteController($uibModa... | (function () {
'use strict';
angular
.module('exerciseApplicationApp')
.controller('ParticipationDeleteController', ParticipationDeleteController);
ParticipationDeleteController.$inject = ['$uibModalInstance', 'entity', 'Participation'];
function ParticipationDeleteController($uibModa... | Make deleting build plan and repository default when deleting participation | Make deleting build plan and repository default when deleting participation
| JavaScript | mit | ls1intum/ArTEMiS,ls1intum/ArTEMiS,ls1intum/ArTEMiS,ls1intum/ArTEMiS,LisLo/ArTEMiS,LisLo/ArTEMiS,ls1intum/ArTEMiS,LisLo/ArTEMiS,ls1intum/ArTEMiS | ---
+++
@@ -11,6 +11,9 @@
var vm = this;
vm.participation = entity;
+ vm.deleteBuildPlan = true;
+ vm.deleteRepository = true;
+
vm.clear = clear;
vm.confirmDelete = confirmDelete;
|
25d0b59a3791063c815d7b83748f410c1a58df5b | src/monster-array.js | src/monster-array.js | /*jshint esnext: true*/
/*jshint browser: true*/
'use strict'
function randBetween(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function monsterObject() {
return {
// context: window.sprite_canvas.getContext('2d'),
width: 32,
height: 16,
leftIndex: ... | Add randbetween- and two monster-functions | Add randbetween- and two monster-functions
| JavaScript | mit | Mattiaslndstrm/koopa-paratroopas,Mattiaslndstrm/koopa-paratroopas,Mattiaslndstrm/koopa-paratroopas | ---
+++
@@ -0,0 +1,54 @@
+/*jshint esnext: true*/
+/*jshint browser: true*/
+'use strict'
+
+function randBetween(min, max) {
+ return Math.floor(Math.random() * (max - min + 1)) + min;
+}
+
+function monsterObject() {
+
+ return {
+ // context: window.sprite_canvas.getContext('2d'),
+ width: 32,... | |
59dddf88dc67724a18b38bf1d6b45f4fa3e4aaa3 | test/load-test.js | test/load-test.js | var nock = require('nock');
var Loader = require('../lib/load');
var defaultOptions = {
urls: ['http://example.com']
};
var should = require('should')
describe('Load', function(){
describe('#getLoadedFilename', function(){
it('should return nothing if no filename was set for url before', function(){
var... | Add tests for getLoadedFilename, setLoadedFilename, getAllLoadedFilenames and getFilename functions of loader object | Add tests for getLoadedFilename, setLoadedFilename, getAllLoadedFilenames and getFilename functions of loader object
| JavaScript | mit | s0ph1e/node-website-scraper,Flamenco/node-website-scraper,aivus/node-website-scraper,website-scraper/node-website-scraper,s0ph1e/node-website-scraper,aivus/node-website-scraper,website-scraper/node-website-scraper,Flamenco/node-website-scraper | ---
+++
@@ -0,0 +1,71 @@
+var nock = require('nock');
+var Loader = require('../lib/load');
+
+var defaultOptions = {
+ urls: ['http://example.com']
+};
+
+var should = require('should')
+describe('Load', function(){
+ describe('#getLoadedFilename', function(){
+ it('should return nothing if no filename was set ... | |
b2d24110d49b6e2b694237e3fe0d8263ef684e68 | src/sandbox.tasker.js | src/sandbox.tasker.js | const vm = require('vm');
const fs = require('fs');
const path = require('path');
function convertVariablesToWhatTaskerWouldSend(taskerLocalVariables) {
const convertedTaskerLocalVariables = {};
Object.getOwnPropertyNames(taskerLocalVariables).forEach((propertyName) => {
const propertyValue = taskerLoc... | Add sandbox to test Tasker JavaScript helpers | Add sandbox to test Tasker JavaScript helpers
| JavaScript | mit | StephenGregory/TaskerJavaScriptHelpers | ---
+++
@@ -0,0 +1,54 @@
+const vm = require('vm');
+const fs = require('fs');
+const path = require('path');
+
+function convertVariablesToWhatTaskerWouldSend(taskerLocalVariables) {
+ const convertedTaskerLocalVariables = {};
+ Object.getOwnPropertyNames(taskerLocalVariables).forEach((propertyName) => {
+ ... | |
29af056784a9695da0a1d71587f2f1e1a12e4517 | deckglue/static/learning/js/show_answer.js | deckglue/static/learning/js/show_answer.js | function show_answer() {
if ($("#answer").is(':visible')) {
return;
}
$("#answer").show()
$("#rating").show()
$("#preanswer").hide()
}
if ($.urlParam('showAnswer')=='true'){
$(show_answer);
} | Add show answer js function for learning | Add show answer js function for learning
| JavaScript | mit | DummyDivision/Tsune,DummyDivision/Tsune,DummyDivision/Tsune | ---
+++
@@ -0,0 +1,12 @@
+function show_answer() {
+ if ($("#answer").is(':visible')) {
+ return;
+ }
+ $("#answer").show()
+ $("#rating").show()
+ $("#preanswer").hide()
+}
+
+if ($.urlParam('showAnswer')=='true'){
+ $(show_answer);
+} | |
a52738276cda5027862acddfbd9f88d82f757b62 | src/app/components/facebook/LoginStatus.js | src/app/components/facebook/LoginStatus.js | import React from 'react';
import THREE from 'three';
export default class LoginStatus extends React.Component
{
static propTypes = {
isConnected: React.PropTypes.bool,
position: React.PropTypes.instanceOf(THREE.Vector3),
frameNumber: React.PropTypes.number
};
static defaultProps =... | Create Facebook Login Status 3D component (display rotating fb box when connected) | Create Facebook Login Status 3D component (display rotating fb box when connected)
| JavaScript | apache-2.0 | Colmea/facebook-webvr,Colmea/facebook-webvr | ---
+++
@@ -0,0 +1,46 @@
+import React from 'react';
+import THREE from 'three';
+
+export default class LoginStatus extends React.Component
+{
+ static propTypes = {
+ isConnected: React.PropTypes.bool,
+ position: React.PropTypes.instanceOf(THREE.Vector3),
+ frameNumber: React.PropTypes.numb... | |
780dcdde1a9c6ae437f9aec82de55997b75e2e8c | 16/sharp-crop.js | 16/sharp-crop.js | var sharp = require('sharp');
var dirpath = 'images/';
var imgname = 'download-logo.png';
var tmppath = 'tmp/'
sharp(dirpath + imgname)
.resize(50, 100)
.crop()
.toFile(tmppath + 'New_' + imgname, function (err, info) {
if (err)
throw err;
console.log('done');
}); | Add the example to crop image via sharp. | Add the example to crop image via sharp.
| JavaScript | mit | nicebook/Node.js-Reference,nicebook/Node.js-Reference,nicebook/Node.js-Reference | ---
+++
@@ -0,0 +1,14 @@
+var sharp = require('sharp');
+
+var dirpath = 'images/';
+var imgname = 'download-logo.png';
+var tmppath = 'tmp/'
+
+sharp(dirpath + imgname)
+ .resize(50, 100)
+ .crop()
+ .toFile(tmppath + 'New_' + imgname, function (err, info) {
+ if (err)
+ throw err;
+ ... | |
da4102c5fbf0303f8a394ceb42a28909db8470f5 | test/test.extends.js | test/test.extends.js | var Twig = Twig || require("../twig"),
twig = twig || Twig.twig;
describe("Twig.js Extensions ->", function() {
it("should be able to extend a meta-type tag", function() {
var flags = {};
Twig.extend(function(Twig) {
Twig.exports.extendTag({
type: "flag",
regex: /^fla... | Add test with examples of extending twig.js with new tags | Add test with examples of extending twig.js with new tags
| JavaScript | bsd-2-clause | rafaellyra/twig.js,justjohn/twig.js,AndBicScadMedia/twig.js,roelvanduijnhoven/twig.js,felicast/twig.js,moodtraffic/twig.js,PeterDaveHello/twig.js,rafaellyra/twig.js,rafaellyra/twig.js,DethCount/twig.js,sarahjean/twig.js,targos/twig.js,plepe/twig.js,roelvanduijnhoven/twig.js,DethCount/twig.js,PeterDaveHello/twig.js,mood... | ---
+++
@@ -0,0 +1,105 @@
+var Twig = Twig || require("../twig"),
+ twig = twig || Twig.twig;
+
+describe("Twig.js Extensions ->", function() {
+ it("should be able to extend a meta-type tag", function() {
+ var flags = {};
+
+ Twig.extend(function(Twig) {
+ Twig.exports.extendTag({
+ t... | |
1d4c0a9f9d64e34df4947c573272468f31333c9c | src/components/buttonGroup/buttonGroup.stories.spec.js | src/components/buttonGroup/buttonGroup.stories.spec.js | import React from 'react';
import ButtonGroup from './ButtonGroup';
import Button from '../button';
export default {
component: ButtonGroup,
title: 'ButtonGroup',
};
const Wrapper = ({ children }) => <div style={{ minHeight: '60px' }}>{children}</div>;
export const Main = () => (
<div>
{['primary', 'secon... | Add a test story for the ButtonGroup component | Add a test story for the ButtonGroup component
| JavaScript | mit | teamleadercrm/teamleader-ui | ---
+++
@@ -0,0 +1,50 @@
+import React from 'react';
+
+import ButtonGroup from './ButtonGroup';
+import Button from '../button';
+
+export default {
+ component: ButtonGroup,
+ title: 'ButtonGroup',
+};
+
+const Wrapper = ({ children }) => <div style={{ minHeight: '60px' }}>{children}</div>;
+
+export const Main =... | |
d91d76016cfc3ee0c65fda07830e858394b2aed6 | server/watson.js | server/watson.js | var watson = require('watson-developer-cloud');
var speech_to_text = watson.speech_to_text({
username: '{andrew.p.bresee@gmail.com}',
password: '{speechdoctor499}',
version: 'v1'
});
speech_to_text.getModels({}, function(err, models) {
if (err)
console.log('error:', err);
else
console.log(JSON.strin... | Change test to stop after ten words | Change test to stop after ten words
| JavaScript | mit | nonchalantkettle/SpeechDoctor,nonchalantkettle/SpeechDoctor,alexxisroxxanne/SpeechDoctor,alexxisroxxanne/SpeechDoctor | ---
+++
@@ -0,0 +1,28 @@
+var watson = require('watson-developer-cloud');
+
+var speech_to_text = watson.speech_to_text({
+ username: '{andrew.p.bresee@gmail.com}',
+ password: '{speechdoctor499}',
+ version: 'v1'
+});
+
+speech_to_text.getModels({}, function(err, models) {
+ if (err)
+ console.log('error:', e... | |
5c0a8630512a4a417ef69c6bba917dcaf05b888d | src/Clastic/BackofficeBundle/Resources/public/scripts/form.parsley.js | src/Clastic/BackofficeBundle/Resources/public/scripts/form.parsley.js | (function() {
var $form = $('form');
$form.parsley();
$.listen('parsley:form:validated', function() {
var $tabpanel = $form.find('.tabpanel');
if ($tabpanel.length) {
var $firstError = $tabpanel.find('.parsley-error').first();
if ($firstError) {
var $t... | (function() {
var $form = $('form');
$form.parsley();
$.listen('parsley:form:validated', function() {
var $tabpanel = $form.find('.tabpanel');
if ($tabpanel.length) {
var $firstError = $tabpanel.find('.parsley-error').first();
if ($firstError.length) {
... | Fix show of last tab when validating valid form. | [Backoffice] Fix show of last tab when validating valid form.
Fixes #50.
| JavaScript | mit | Windmolders/Clastic,Clastic/Clastic,Windmolders/Clastic,Clastic/Clastic,NoUseFreak/Clastic,Windmolders/Clastic,NoUseFreak/Clastic,NoUseFreak/Clastic,Clastic/Clastic | ---
+++
@@ -5,7 +5,7 @@
var $tabpanel = $form.find('.tabpanel');
if ($tabpanel.length) {
var $firstError = $tabpanel.find('.parsley-error').first();
- if ($firstError) {
+ if ($firstError.length) {
var $tab = $form.find('[role="tablist"] li').eq($f... |
ecd884fee79194456258c2f6384fb8f0a4109480 | app/admin-tab/processes/process/route.js | app/admin-tab/processes/process/route.js | import Ember from 'ember';
export default Ember.Route.extend({
params: null,
model: function(params /*, transition*/ ) {
this.set('params', params);
return this.get('store').find('processinstance', params.process_id).then((processInstance) => {
return processInstance.followLink('processExecutions').t... | import Ember from 'ember';
export default Ember.Route.extend({
params: null,
model: function(params /*, transition*/ ) {
this.set('params', params);
return this.get('store').find('processinstance', params.process_id).then((processInstance) => {
return processInstance.followLink('processExecutions').t... | Remove the interval check for child processes | Remove the interval check for child processes
| JavaScript | apache-2.0 | lvuch/ui,rancher/ui,rancher/ui,westlywright/ui,westlywright/ui,rancherio/ui,vincent99/ui,westlywright/ui,rancherio/ui,nrvale0/ui,rancher/ui,rancherio/ui,nrvale0/ui,nrvale0/ui,pengjiang80/ui,ubiquityhosting/rancher_ui,lvuch/ui,vincent99/ui,lvuch/ui,pengjiang80/ui,pengjiang80/ui,ubiquityhosting/rancher_ui,ubiquityhosting... | ---
+++
@@ -16,24 +16,5 @@
//do some errors
});
});
- },
- intervalId: null,
- setupController: function(controller, model) {
- this._super(controller, model);
- const intervalCount = 2000;
- if (!this.get('intervalId')) {
- this.set('intervalId', setInterval(() => {
- thi... |
61461eba5bcc91a01eb565c52a615e33ccb256d7 | bezier-curve/js/point.js | bezier-curve/js/point.js | /*exported Point, Endpoint, ControlPoint*/
var Point = (function() {
'use strict';
function Point( x, y ) {
this.x = x;
this.y = y;
}
Point.prototype.add = function( x, y ) {
this.x += x;
this.y += y;
return this;
};
Point.prototype.sub = function( x, y ) {
this.x -= x;
this.y... | Add separate Point classes file. | bezier-curve: Add separate Point classes file.
| JavaScript | mit | razh/experiments,razh/experiments,razh/experiments | ---
+++
@@ -0,0 +1,60 @@
+/*exported Point, Endpoint, ControlPoint*/
+var Point = (function() {
+ 'use strict';
+
+ function Point( x, y ) {
+ this.x = x;
+ this.y = y;
+ }
+
+ Point.prototype.add = function( x, y ) {
+ this.x += x;
+ this.y += y;
+ return this;
+ };
+
+ Point.prototype.sub = fun... | |
8c6ca6582e54d8911678cac49c8d9e43433fc524 | javascript/ql/test/library-tests/TaintTracking/summarize-store-load-in-call.js | javascript/ql/test/library-tests/TaintTracking/summarize-store-load-in-call.js | import * as dummy from 'dummy';
function blah(obj) {
obj.prop = obj.prop + "x";
return obj.prop;
}
function test() {
sink(blah(source())); // NOT OK
blah(); // ensure more than one call site exists
}
| Add test showing missing flow | JS: Add test showing missing flow
| JavaScript | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | ---
+++
@@ -0,0 +1,12 @@
+import * as dummy from 'dummy';
+
+function blah(obj) {
+ obj.prop = obj.prop + "x";
+ return obj.prop;
+}
+
+function test() {
+ sink(blah(source())); // NOT OK
+
+ blah(); // ensure more than one call site exists
+} | |
e7bd02fba22ec513b4c7057ed483edd9c7769e4f | server/seeders/20170731120851-roles.js | server/seeders/20170731120851-roles.js | 'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.bulkInsert('Roles',
[{
role: 'admin',
createdAt: new Date(),
updatedAt: new Date()
},
{
role: 'user',
createdAt: new Date(),
updatedAt: new Date()
}... | Define role types in seeders folder | Define role types in seeders folder
| JavaScript | mit | vynessa/dman,vynessa/dman | ---
+++
@@ -0,0 +1,29 @@
+'use strict';
+
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.bulkInsert('Roles',
+ [{
+ role: 'admin',
+ createdAt: new Date(),
+ updatedAt: new Date()
+ },
+
+ {
+ role: 'user',
+ createdAt: new Date... | |
e38f50526425c23f38e08d3f163a93a5534b6c8b | client/userlist.js | client/userlist.js | var UserList = React.createClass({
componentDidMount: function() {
socket.on('join', this._join);
socket.on('part', this._part);
},
render: function() {
return (
<ul id='online-list'>
<li>
<img src='https://avatars.githubusercontent.com... | var UserList = React.createClass({
componentDidMount: function() {
socket.on('join', this._join);
socket.on('part', this._part);
},
render: function() {
return (
<ul id='online-list'></ul>
);
},
_join: function(username) {
if (username != myUsernam... | Remove placeholder content from online list | Remove placeholder content from online list
| JavaScript | mit | gtklocker/ting,VitSalis/ting,mbalamat/ting,gtklocker/ting,VitSalis/ting,dionyziz/ting,VitSalis/ting,mbalamat/ting,mbalamat/ting,odyvarv/ting-1,sirodoht/ting,odyvarv/ting-1,dionyziz/ting,dionyziz/ting,odyvarv/ting-1,odyvarv/ting-1,sirodoht/ting,sirodoht/ting,mbalamat/ting,VitSalis/ting,gtklocker/ting,gtklocker/ting,siro... | ---
+++
@@ -5,12 +5,7 @@
},
render: function() {
return (
- <ul id='online-list'>
- <li>
- <img src='https://avatars.githubusercontent.com/dionyziz' alt='' class='avatar' />
- <span>dionyziz</span>
- </li>
- <... |
2a790870e79764ef76614a3a870b2aba09ff4784 | test/api/ripple_transactions.js | test/api/ripple_transactions.js | var assert = require("assert");
describe('APi for Ripple Transactions', function(){
describe('creating a ripple transaction', function(){
it('should require a ripple address id of the recipient user', function(fn){
});
it('should require a ripple address id of the sending user', function(fn){
... | Add API level test descriptions. for ripple transactions. | [TEST] Add API level test descriptions. for ripple transactions.
| JavaScript | isc | xdv/gatewayd,xdv/gatewayd,crazyquark/gatewayd,crazyquark/gatewayd,Parkjeahwan/awegeeks,whotooktwarden/gatewayd,whotooktwarden/gatewayd,zealord/gatewayd,zealord/gatewayd,Parkjeahwan/awegeeks | ---
+++
@@ -0,0 +1,68 @@
+var assert = require("assert");
+
+describe('APi for Ripple Transactions', function(){
+
+ describe('creating a ripple transaction', function(){
+
+ it('should require a ripple address id of the recipient user', function(fn){
+
+ });
+
+ it('should require a ripple address id... | |
6c9d24b533197af8e17406b38850a679a4bd2dab | is.js | is.js | // is.js 0.0.1
// Author Aras Atasaygin
;(function() {
// Baseline
// --------
// root object is window in the browser
var root = this;
// define is object, current version and configs
var is = {};
is.version = '0.0.1';
is.config = {};
// TODO: Add AMD and CommonJS support
// is object set global to the ... | // is.js 0.0.1
// Author Aras Atasaygin
;(function() {
// Baseline
// --------
// root object is window in the browser
var root = this;
// define is object, current version and configs
var is = {};
is.version = '0.0.1';
is.config = {};
// TODO: Add AMD and CommonJS support
/... | Add first type(array) check method. | Add first type(array) check method.
| JavaScript | mit | dkfiresky/is.js,arasatasaygin/is.js,ekaradon/is.js,arasatasaygin/is.js,ryantemple/is.js,rlugojr/is.js,ironmaniiith/is.js,hi-q/is.js,jaspreet21anand/isjs,fermanakgun/is.js,rlugojr/is.js,dstyle0210/is.js,iLikeKoffee/is.js,dstyle0210/is.js,iLikeKoffee/is.js,dkfiresky/is.js,ironmaniiith/is.js,polymaths/is.js,ErikaLim/is.js... | ---
+++
@@ -1,62 +1,62 @@
-// is.js 0.0.1
-// Author Aras Atasaygin
+// is.js 0.0.1
+// Author Aras Atasaygin
;(function() {
- // Baseline
- // --------
+ // Baseline
+ // --------
- // root object is window in the browser
- var root = this;
+ // root object is window in the browser
+ var root = th... |
ac539da7a32fac98c5a6266e0b2d88c336623b83 | tests/stack-test.js | tests/stack-test.js |
"use strict";
/**
* Test cases for eStack data structure
*/
describe("eStack - isstack query", function () {
it("should return type of eStack", function () {
var stack = new eStack();
expect(stack.getType()).toBe('eStack');
});
});
describe("eStack - add element to stack", function () {
it("should... | Add unit test cases for eStack | Add unit test cases for eStack
| JavaScript | mit | toystars/eStructures,toystars/eStructures | ---
+++
@@ -0,0 +1,80 @@
+
+"use strict";
+
+/**
+ * Test cases for eStack data structure
+ */
+
+describe("eStack - isstack query", function () {
+ it("should return type of eStack", function () {
+ var stack = new eStack();
+ expect(stack.getType()).toBe('eStack');
+ });
+});
+
+describe("eStack - add ele... | |
bc24531aeb7dcf75783010d5ea0612bec0110213 | test/server/routes.spec.js | test/server/routes.spec.js | /*
* Copyright (c) 2015-2017 Steven Soloff
*
* This is free software: you can redistribute it and/or modify it under the
* terms of the MIT License (https://opensource.org/licenses/MIT).
* This software comes with ABSOLUTELY NO WARRANTY.
*/
'use strict'
const express = require('express')
const routes = require(... | Add unit tests for routes module | Add unit tests for routes module
| JavaScript | mit | ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js | ---
+++
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015-2017 Steven Soloff
+ *
+ * This is free software: you can redistribute it and/or modify it under the
+ * terms of the MIT License (https://opensource.org/licenses/MIT).
+ * This software comes with ABSOLUTELY NO WARRANTY.
+ */
+
+'use strict'
+
+const express = requ... | |
4430ec180e46f7bb25706b1958d906d7528200da | script/gen-an.js | script/gen-an.js | import Hackpad from 'hackpad'
import To_markdown from 'to-markdown'
import To_XML from 'xml'
// help: CLIENT_ID=xxx SECRET=yyy babel-node script/gen-an.js [pad_id]
// ex: CLIENT_ID=xxx SECRET=yyy babel-node script/gen-an.js 3RvGJjHbZ3Z
// Get your Client ID and Secret from https://g0v.hackpad.com/ep/account/settings/
... | Add Akoma Ntoso xml format generator | Add Akoma Ntoso xml format generator
| JavaScript | cc0-1.0 | appleboy/react.vtaiwan.tw,g0v/react.vtaiwan.tw,g0v/react.vtaiwan.tw,appleboy/react.vtaiwan.tw,g0v/react.vtaiwan.tw | ---
+++
@@ -0,0 +1,50 @@
+import Hackpad from 'hackpad'
+import To_markdown from 'to-markdown'
+import To_XML from 'xml'
+
+// help: CLIENT_ID=xxx SECRET=yyy babel-node script/gen-an.js [pad_id]
+// ex: CLIENT_ID=xxx SECRET=yyy babel-node script/gen-an.js 3RvGJjHbZ3Z
+// Get your Client ID and Secret from https://g0v... | |
36f6802efb50a0cccc5d6c2f454bdb800d71871c | stories/box.js | stories/box.js | import React from 'react';
import PropTable from './components/propTable';
import { storiesOf } from '@storybook/react';
import { checkA11y } from 'storybook-addon-a11y';
import { withInfo } from '@storybook/addon-info';
import { withKnobs, number, select } from '@storybook/addon-knobs/react';
import {Box, TextBody} fr... | Add story for our Box component | Add story for our Box component
| JavaScript | mit | teamleadercrm/teamleader-ui | ---
+++
@@ -0,0 +1,43 @@
+import React from 'react';
+import PropTable from './components/propTable';
+import { storiesOf } from '@storybook/react';
+import { checkA11y } from 'storybook-addon-a11y';
+import { withInfo } from '@storybook/addon-info';
+import { withKnobs, number, select } from '@storybook/addon-knobs/... | |
daa63e10a6f460bddcd7edc7473b3f01ec0687e8 | src/gamestate.js | src/gamestate.js | function GameState() {
"use strict";
}
//The following functions do nothing since they're intended to be overwritten.
GameState.prototype.update = function update(deltaTime) {
"use strict";
};
GameState.prototype.render = function render(screen) {
"use strict";
};
GameState.prototype.willDisappear = fun... | Add a GameState super class. | Add a GameState super class.
| JavaScript | mit | zedutchgandalf/OpenJGL,zedutchgandalf/OpenJGL | ---
+++
@@ -0,0 +1,26 @@
+function GameState() {
+ "use strict";
+}
+
+//The following functions do nothing since they're intended to be overwritten.
+
+GameState.prototype.update = function update(deltaTime) {
+ "use strict";
+};
+
+GameState.prototype.render = function render(screen) {
+ "use strict";
+};
... | |
8e03d10e5b2e9836a80de5b385b2be2ec5bcd954 | scripts/bundleMiddlewaresForBrowsers.js | scripts/bundleMiddlewaresForBrowsers.js | 'use strict';
var browserify = require('browserify'),
babelify = require('babelify'),
path = require('path');
var babelOptions = {
presets: ['es2015', 'stage-1'],
plugins: ['transform-runtime'],
compact: false
};
var browserifyOptions = {
standalone: 'rotorjsMiddlewares',
debug: true
};
browserify(... | Add script for bundle middlewares | scripts/bundleForBrowsers.js: Add script for bundle middlewares
| JavaScript | mit | kuraga/rotorjs,kuraga/rotorjs | ---
+++
@@ -0,0 +1,20 @@
+'use strict';
+
+var browserify = require('browserify'),
+ babelify = require('babelify'),
+ path = require('path');
+
+var babelOptions = {
+ presets: ['es2015', 'stage-1'],
+ plugins: ['transform-runtime'],
+ compact: false
+};
+var browserifyOptions = {
+ standalone: 'rotorjsMid... | |
724cacbc65fea63a4ed6a2a1f4b8a1e430ad12ee | src/constants/app_config.js | src/constants/app_config.js | // CARTO table names lookup
export const cartoTables = {
nyc_borough: 'nyc_borough',
nyc_city_council: 'nyc_city_council',
nyc_community_board: 'nyc_community_board',
nyc_neighborhood: 'nyc_neighborhood',
nyc_nypd_precinct: 'nyc_nypd_precinct',
nyc_zip_codes: 'nyc_zip_codes',
nyc_crashes: 'export2016_07'
... | Create app config file with Carto table name look up & basemap url | Create app config file with Carto table name look up & basemap url
| JavaScript | mit | clhenrick/nyc-crash-mapper,clhenrick/nyc-crash-mapper,clhenrick/nyc-crash-mapper | ---
+++
@@ -0,0 +1,13 @@
+// CARTO table names lookup
+export const cartoTables = {
+ nyc_borough: 'nyc_borough',
+ nyc_city_council: 'nyc_city_council',
+ nyc_community_board: 'nyc_community_board',
+ nyc_neighborhood: 'nyc_neighborhood',
+ nyc_nypd_precinct: 'nyc_nypd_precinct',
+ nyc_zip_codes: 'nyc_zip_code... | |
fc2362735170afa9929af9ef6cecd1b72d45f307 | src/data/types/ContentType.js | src/data/types/ContentType.js | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import {
GraphQLObjectType as ObjectType,
GraphQLStrin... | Create a template type (content type). | Create a template type (content type).
| JavaScript | mit | happyboy171/Feeding-Fish-View- | ---
+++
@@ -0,0 +1,26 @@
+/**
+ * React Starter Kit (https://www.reactstarterkit.com/)
+ *
+ * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.txt file in the root directory of this source tree.
+ */
+
+import {
+ GraphQLOb... | |
08718e760bf9e1dca5d8c515ebe0484b7678909d | lib/index.js | lib/index.js | var net = require('net');
var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});
server.listen(1337, '127.0.0.1'); | Add the simple socket exmaple | Add the simple socket exmaple
| JavaScript | mit | FuriKuri/info-bundling | ---
+++
@@ -0,0 +1,8 @@
+var net = require('net');
+
+var server = net.createServer(function (socket) {
+ socket.write('Echo server\r\n');
+ socket.pipe(socket);
+});
+
+server.listen(1337, '127.0.0.1'); | |
202e9ae88bfcdc392f396a9aeb08936bf2f50c0e | spec/frontend/dummy_spec.js | spec/frontend/dummy_spec.js | describe('dummy test', () => {
it('waits for a loooooong time', () => {
setTimeout(() => {
throw new Error('broken');
}, 10000);
});
});
| Add dummy test with setTimeout() | Add dummy test with setTimeout()
| JavaScript | mit | mmkassem/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,iiet/iiet-git,mmkassem/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,stoplightio/gitlabhq | ---
+++
@@ -0,0 +1,7 @@
+describe('dummy test', () => {
+ it('waits for a loooooong time', () => {
+ setTimeout(() => {
+ throw new Error('broken');
+ }, 10000);
+ });
+}); | |
c2cdd3270d6914328650bd7b5b9a8343fc3fd53c | connectors/v2/thisismyjam.js | connectors/v2/thisismyjam.js | 'use strict';
/* global Connector */
Connector.playerSelector = '#player-inner';
Connector.artistSelector = '#artist-name';
Connector.trackSelector = '#track-title';
Connector.isPlaying = function () {
return $('#playPause').hasClass('playing');
};
| 'use strict';
/* global Connector */
Connector.playerSelector = '.foundaudio-player';
Connector.artistSelector = '.foundaudio-artist';
Connector.trackSelector = '.foundaudio-title';
Connector.trackArtImageSelector = '.foundaudio-cover img';
Connector.playButtonSelector = '#foundAudioPlay';
| Fix This Is My Jam connector | Fix This Is My Jam connector
The Soundcloud player still is not supported.
| JavaScript | mit | david-sabata/web-scrobbler,Paszt/web-scrobbler,david-sabata/web-scrobbler,inverse/web-scrobbler,galeksandrp/web-scrobbler,carpet-berlin/web-scrobbler,Paszt/web-scrobbler,carpet-berlin/web-scrobbler,galeksandrp/web-scrobbler,ex47/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,alexesprit/web-scrobbler,ex47/web-scrobbler... | ---
+++
@@ -2,12 +2,12 @@
/* global Connector */
-Connector.playerSelector = '#player-inner';
+Connector.playerSelector = '.foundaudio-player';
-Connector.artistSelector = '#artist-name';
+Connector.artistSelector = '.foundaudio-artist';
-Connector.trackSelector = '#track-title';
+Connector.trackSelector = '... |
3007c98f3a4366e1ae3bb1e50c141e7d938d2782 | ko-mappings.js | ko-mappings.js | /**
* A SET OF COOL MAPPINGS FOR KNOCKOUT.JS
* @author zipang
* @copyright 2014 - EIDOLON LABS
*/
(function() {
if (!ko) {
if (console) console.log("Knockout.JS not present.")
return;
}
// =============================================================
// Add new custom mappings for usual attributes href, ... | Add usual attributes mapping: href, src, title, alt, placeholder, and the smart className mapping that bind a property to a list of values for a class name | Add usual attributes mapping: href, src, title, alt, placeholder, and the smart className mapping that bind a property to a list of values for a class name
| JavaScript | mit | zipang/ko-dings | ---
+++
@@ -0,0 +1,75 @@
+/**
+ * A SET OF COOL MAPPINGS FOR KNOCKOUT.JS
+ * @author zipang
+ * @copyright 2014 - EIDOLON LABS
+ */
+
+(function() {
+
+ if (!ko) {
+ if (console) console.log("Knockout.JS not present.")
+ return;
+ }
+
+ // =============================================================
+ // Add new c... | |
d584fdbf135e54ebd6281abdb771cf132a7c88c5 | client/api.js | client/api.js | import request from 'superagent';
class API {
sidebarItems(callback) {
request
.get('/all_dates')
.end((err, response) => {
callback(response);
})
}
}
export default API;
| Add class to fetch data from the server backend | Add class to fetch data from the server backend | JavaScript | mit | jaischeema/panorma,jaischeema/panorma,jaischeema/panorma | ---
+++
@@ -0,0 +1,13 @@
+import request from 'superagent';
+
+class API {
+ sidebarItems(callback) {
+ request
+ .get('/all_dates')
+ .end((err, response) => {
+ callback(response);
+ })
+ }
+}
+
+export default API; | |
c6503a28d95702a4004bc1f66f00bb40c978ad13 | lib/index.js | lib/index.js | 'use strict';
var traverse = require('./util/traverse');
var deref = require('deref');
module.exports = function(schema, refs) {
return traverse(deref()(schema, refs, true));
};
| 'use strict';
var traverse = require('./util/traverse');
var deref = require('deref');
module.exports = function(schema, refs) {
var $ = deref();
if (Array.isArray(refs)) {
return traverse($(schema, refs, true));
} else {
$.refs = refs || {};
}
return traverse($(schema, true));
};
| Allow array or object for refs; fix | Allow array or object for refs; fix
| JavaScript | mit | json-schema-faker/json-schema-faker,rlugojr/json-schema-faker,Scorpil/json-schema-faker,rlugojr/json-schema-faker,json-schema-faker/json-schema-faker,Gash003/json-schema-faker,whitlockjc/json-schema-faker,presidento/json-schema-faker,pateketrueke/json-schema-faker,rlugojr/json-schema-faker | ---
+++
@@ -5,5 +5,13 @@
var deref = require('deref');
module.exports = function(schema, refs) {
- return traverse(deref()(schema, refs, true));
+ var $ = deref();
+
+ if (Array.isArray(refs)) {
+ return traverse($(schema, refs, true));
+ } else {
+ $.refs = refs || {};
+ }
+
+ return traverse($(schem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.