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
7294b89a6bb296bf35f338c12fe5b8cc82504cb6
scrapper/index.js
scrapper/index.js
// Imports the Google Cloud client library const Datastore = require('@google-cloud/datastore') // Your Google Cloud Platform project ID const projectId = 'pirula-time' // Instantiates a client const datastore = Datastore({ projectId: projectId }) // The kind for the new entity const kind = 'time' // The name/ID f...
const Datastore = require('@google-cloud/datastore') const projectId = 'pirula-time' const datastore = Datastore({ projectId: projectId }) const kind = 'time' const averageKey = datastore.key([kind, 'average']) function scrape() { const data = { average: 1800, } return data } exports.doIt = function doIt...
Change scrapper trigger to http request
Change scrapper trigger to http request
JavaScript
mit
firefueled/pirula-time,firefueled/pirula-time,firefueled/pirula-time,firefueled/pirula-time,firefueled/pirula-time
--- +++ @@ -1,58 +1,37 @@ -// Imports the Google Cloud client library const Datastore = require('@google-cloud/datastore') - -// Your Google Cloud Platform project ID const projectId = 'pirula-time' - -// Instantiates a client const datastore = Datastore({ projectId: projectId }) -// The kind for the new ent...
43dddfa13f3738d4436b25972b8c22ee8a0ae165
js/models/article.js
js/models/article.js
Kpcc.Article = DS.Model.extend({ title : DS.attr(), short_title : DS.attr(), published_at : DS.attr(), byline : DS.attr(), teaser : DS.attr(), body : DS.attr(), public_url : DS.attr(), assets : DS.hasMany('asset'), audio ...
Kpcc.Article = DS.Model.extend({ title : DS.attr(), short_title : DS.attr(), published_at : DS.attr(), byline : DS.attr(), teaser : DS.attr(), body : DS.attr(), public_url : DS.attr(), assets : DS.hasMany('asset'), audio ...
Fix Reader to support non-model audio (no ID)
Fix Reader to support non-model audio (no ID)
JavaScript
mit
SCPR/kpcc-reader,SCPR/kpcc-reader,SCPR/kpcc-reader
--- +++ @@ -7,7 +7,7 @@ body : DS.attr(), public_url : DS.attr(), assets : DS.hasMany('asset'), - audio : DS.hasMany("audio"), + audio : DS.attr(), category : DS.belongsTo('category'), }); @@ -15,8 +15,7 @@ DS.EmbeddedRecordsMixin, ...
acb8969398c27fd29dd849e9b5072ac5df1997fc
app/assets/javascripts/frontend/text-character-count.js
app/assets/javascripts/frontend/text-character-count.js
// Gets character limit and allows no more $(function() { // Creates the character count elements $(".js-char-count").wrap("<div class='char-count'></div>") $(".js-char-count").after("<div class='char-text'>Character count: <span class='current-count'>0</span></div>"); // Includes charact limit if there is one...
// Gets character limit and allows no more $(function() { // Creates the character count elements $(".js-char-count").wrap("<div class='char-count'></div>") $(".js-char-count").after("<div class='char-text'>Character count: <span class='current-count'>0</span></div>"); // Includes charact limit if there is one...
Fix char count for Firefox
Fix char count for Firefox
JavaScript
mit
bitzesty/qae,bitzesty/qae,bitzesty/qae,bitzesty/qae
--- +++ @@ -14,6 +14,15 @@ // On keydown, gets character count $(".js-char-count").on('keyup', function () { + // Webkit counts a new line as a two characters + // IE doesn't use maxlength + var newline = " "; + + if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { + // Firefox ...
768db2ae414700b751dafd2e159ec40251d4beed
lib/graceful-exit.js
lib/graceful-exit.js
var utils = require("radiodan-client").utils, logger = utils.logger(__filename); module.exports = function(radiodan){ return function() { clearPlayers(radiodan.cache.players).then( function() { process.exit(0); }, function() { process.exit(1); } ); function cl...
var utils = require("radiodan-client").utils, logger = utils.logger(__filename); module.exports = function(radiodan){ return function() { return gracefulExit(radiodan); } }; function gracefulExit(radiodan) { // if promise does not resolve quickly enough, exit anyway setTimeout(exitWithCode(2), 3000); ret...
Exit process if clearing process does not finish within 3 seconds
Exit process if clearing process does not finish within 3 seconds App would previously refuse to exit if it could not send a successful clear message to each player.
JavaScript
apache-2.0
radiodan/magic-button,radiodan/magic-button
--- +++ @@ -2,27 +2,34 @@ logger = utils.logger(__filename); module.exports = function(radiodan){ + return function() { return gracefulExit(radiodan); } +}; + +function gracefulExit(radiodan) { + // if promise does not resolve quickly enough, exit anyway + setTimeout(exitWithCode(2), 3000); + + return cle...
1750b24540c65f4a0a29c2f5905aa885039db602
lib/platform.js
lib/platform.js
var isNode = require('is-node'); module.exports = (function () { if (typeof Deno !== 'undefined') { var env = Deno.permissions().env ? Deno.env() : {}; return { argv: Deno.args, color: !Deno.noColor ? 1 : 0, env: env, runtime: 'deno' }; }...
/*globals Deno*/ var isNode = require('is-node'); module.exports = (function () { if (typeof Deno !== 'undefined') { var env = Deno.permissions().env ? Deno.env() : {}; return { argv: Deno.args, color: !Deno.noColor ? 1 : 0, env: env, runtime: 'deno'...
Add a int exception for the check for Deno.
Add a int exception for the check for Deno.
JavaScript
mit
sunesimonsen/magicpen
--- +++ @@ -1,3 +1,4 @@ +/*globals Deno*/ var isNode = require('is-node'); module.exports = (function () {
fc51b12766d2be8fef8889bca13a2459f8f63d24
api/index.js
api/index.js
module.exports = function (config, next) { require('../db')(config, function (err, client) { if (err) { return next(err); } var messaging = require('../db/messaging')(config); var keyspace = config.keyspace || 'seguir'; // TODO: Refactor out into iteration over array of modules var auth = requ...
var path = require('path'); module.exports = function (config, next) { require('../db')(config, function (err, client) { if (err) { return next(err); } var messaging = require('../db/messaging')(config); var api = {}; api.client = client; api.config = config; api.messaging = messaging; ...
Make api initialisation more modular
Make api initialisation more modular
JavaScript
mit
gajjargaurav/seguir,cliftonc/seguir,tes/seguir
--- +++ @@ -1,3 +1,5 @@ +var path = require('path'); + module.exports = function (config, next) { require('../db')(config, function (err, client) { @@ -5,36 +7,17 @@ if (err) { return next(err); } var messaging = require('../db/messaging')(config); - var keyspace = config.keyspace || 'seguir'; - ...
5c31bef28451412a09bcc100fb08c2b41709d0ce
client/src/store/rootReducer.js
client/src/store/rootReducer.js
import { reducer as formReducer } from 'redux-form'; import { combineReducers } from 'redux'; import { routerReducer } from 'react-router-redux'; import { organization, starredBoard, notification, modals, board, home } from '../app/routes/home/modules/index'; import { signUp } from '../app/routes/signUp/module...
import { reducer as formReducer } from 'redux-form'; import { combineReducers } from 'redux'; import { routerReducer } from 'react-router-redux'; import { organization, starredBoard, notification, modals, board, home } from '../app/routes/home/modules/index'; import { signUp } from '../app/routes/signUp/module...
Add boardsMenu reducer to the store
Add boardsMenu reducer to the store
JavaScript
mit
Madmous/madClones,Madmous/Trello-Clone,Madmous/Trello-Clone,Madmous/madClones,Madmous/Trello-Clone,Madmous/madClones,Madmous/madClones
--- +++ @@ -15,6 +15,7 @@ import { login } from '../app/routes/login/modules/index'; import { + boardsMenu, popOver, app } from '../app/modules/index'; @@ -35,6 +36,7 @@ signUp, login, + boardsMenu, popOver, app,
5bdf8dd75843b06b72c3bee3dbe4dbefc7def43c
apps/main.js
apps/main.js
import React from 'react'; import { registerComponent } from 'react-native-playground'; import { StyleSheet, Text, View, } from 'react-native'; class App extends React.Component { render() { return ( <View style={styles.container}> <Text style={styles.instructions}> Edit and save wi...
import React from 'react'; import { registerComponent } from 'react-native-playground'; import { StatusBar, StyleSheet, Text, View, } from 'react-native'; class App extends React.Component { render() { return ( <View style={styles.container}> <Text style={styles.instructions}> Edi...
Use default barStyle in starter app
Use default barStyle in starter app
JavaScript
mit
rnplay/rnplay-web,rnplay/rnplay-web,rnplay/rnplay-web,rnplay/rnplay-web
--- +++ @@ -1,6 +1,7 @@ import React from 'react'; import { registerComponent } from 'react-native-playground'; import { + StatusBar, StyleSheet, Text, View, @@ -14,6 +15,8 @@ Edit and save with Cmd+S (Mac) or Ctrl+S (Windows). Changes will be reflected immediately in the simulator ...
9975351407a528dad840fda8309acfa132b9b431
service/security.js
service/security.js
/* * Copyright 2015 Mark Eschbach * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
/* * Copyright 2015 Mark Eschbach * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
Allow for no user states
Allow for no user states
JavaScript
apache-2.0
meschbach/onomate,meschbach/onomate,meschbach/onomate
--- +++ @@ -1,12 +1,12 @@ /* * Copyright 2015 Mark Eschbach - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * ...
654d58e164240d3ef35f5b2b3e3903f9eb554fa8
internals/testing/karma.conf.js
internals/testing/karma.conf.js
const webpackConfig = require('../webpack/webpack.test.config'); const path = require('path'); module.exports = (config) => { config.set({ frameworks: ['mocha', 'sinon-chai'], reporters: ['coverage', 'mocha'], browsers: ['Chrome'], autoWatch: false, singleRun: true, /** * Define the karma file. * ...
const webpackConfig = require('../webpack/webpack.test.config'); const path = require('path'); module.exports = (config) => { config.set({ frameworks: ['mocha', 'sinon-chai'], reporters: ['coverage', 'mocha'], browsers: process.env.TRAVIS ? ['ChromeTravis'] : ['Chrome'], autoWatch: false, singl...
Set up test support for travis.
Set up test support for travis.
JavaScript
mit
reauv/persgroep-app,reauv/persgroep-app
--- +++ @@ -5,7 +5,9 @@ config.set({ frameworks: ['mocha', 'sinon-chai'], reporters: ['coverage', 'mocha'], - browsers: ['Chrome'], + browsers: process.env.TRAVIS + ? ['ChromeTravis'] + : ['Chrome'], autoWatch: false, singleRun: true, @@ -34,15 +36,14 @@ webpackMiddleware: { noInfo:...
a51ddfe38c359c4127c19d1096966f5090ca73e4
config/express.js
config/express.js
// Create the application and define middleware. 'use strict'; var express = require('express'); var bodyParser = require('body-parser'); var router = require('./../app/routes')(); module.exports = function () { var app = express(); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyPars...
// Create the application and define middleware. 'use strict'; var express = require('express'); var bodyParser = require('body-parser'); var router = require('./../app/files/routes')(); module.exports = function () { var app = express(); app.use(bodyParser.urlencoded({ extended: true })); app.use(bo...
Fix reference to the routes folder of the files module.
Fix reference to the routes folder of the files module.
JavaScript
mit
andela-ioraelosi/hackshub-file-service
--- +++ @@ -5,7 +5,7 @@ var express = require('express'); var bodyParser = require('body-parser'); -var router = require('./../app/routes')(); +var router = require('./../app/files/routes')(); module.exports = function () {
bb7eb52313831da6a8c12324d220875fd25f68bf
routes/index.js
routes/index.js
var express = require('express'); var router = express.Router(); router.get('/checkouts/new', function(req, res, next) { res.render('index', { title: 'Express' }); }); module.exports = router;
var express = require('express'); var router = express.Router(); router.get('/', function(req, res, next) { res.render('index', { title: 'Express' }); }); router.get('/checkouts/new', function(req, res, next) { res.render('index', { title: 'Express' }); }); module.exports = router;
Update root route to point to new checkouts page
Update root route to point to new checkouts page
JavaScript
mit
braintree/braintree_express_example,braintree/braintree_express_example,ashutosh37/nodejs-braintree-firebase,ashutosh37/nodejs-braintree-firebase
--- +++ @@ -1,5 +1,9 @@ var express = require('express'); var router = express.Router(); + +router.get('/', function(req, res, next) { + res.render('index', { title: 'Express' }); +}); router.get('/checkouts/new', function(req, res, next) { res.render('index', { title: 'Express' });
a970aad03a6e0730e08caf98982caf4fe5eb5e29
test/unit/game_of_life.support.spec.js
test/unit/game_of_life.support.spec.js
describe('Support module', function () { var S = GameOfLife.Support; describe('For parsing canvas', function () { it('throws InvalidArgument if given other than canvas element', function () { expect(function () { S.parseCanvas($('<p>foo</p>')); }).toThrow(new S.InvalidArgument('Not a canvas...
describe('Support module', function () { var S = GameOfLife.Support; describe('For validating canvas', function () { it('throws InvalidArgument if given other than a canvas element', function () { expect(function () { S.validateCanvas($('<p>foo</p>')[0]); }).toThrow(new S.InvalidArgument('N...
Add unit tests for canvas validation
Add unit tests for canvas validation
JavaScript
mit
tkareine/game_of_life,tkareine/game_of_life,tkareine/game_of_life
--- +++ @@ -1,11 +1,15 @@ describe('Support module', function () { var S = GameOfLife.Support; - describe('For parsing canvas', function () { - it('throws InvalidArgument if given other than canvas element', function () { + describe('For validating canvas', function () { + it('throws InvalidArgument if ...
89da8456cb272201d66ba059b8d6e63af6c13a97
spec/util/config.js
spec/util/config.js
window.respokeTestConfig = { baseURL: 'http://testing.digiumlabs.com:3001' }; respoke.log.setLevel('silent'); window.doneOnceBuilder = function (done) { var called = false; return function (err) { if (!called) { called = true; done(err); } }; }; window.doneCountB...
window.respokeTestConfig = { baseURL: 'http://testing.digiumlabs.com:3001' }; respoke.log.setLevel('silent'); window.doneOnceBuilder = function (done) { var called = false; return function (err) { if (!called) { called = true; done(err); } }; }; // build a functi...
Add an explanation detailing behavior of doneCountBuilder.
Add an explanation detailing behavior of doneCountBuilder.
JavaScript
mit
respoke/respoke,respoke/respoke,respoke/respoke
--- +++ @@ -12,6 +12,9 @@ }; }; +// build a function which calls the done callback according to the following rules: +// 1. immediately if there is an error passed to it +// 2. when the function has been called $num times. window.doneCountBuilder = function (num, done) { return (function () { ...
4f0f14323f546e72e1d58c86710fc80b8c6129a3
drops/strider/index.js
drops/strider/index.js
module.exports = function(scope, argv) { return { install: function (done) { scope.applyConfig({ create: { Image: "niallo/strider:latest", }, start: { PublishAllPorts: !!argv.publish } }, function (err) { if (err) throw err; scope.ins...
module.exports = function(scope, argv) { return { install: function (done) { scope.applyConfig({ create: { Image: "niallo/strider:latest", Env: { /* https://github.com/Strider-CD/strider#configuring */ } }, start: { PublishAllPorts:...
Add a note on env configuration
Add a note on env configuration
JavaScript
isc
keyvanfatehi/ydm,kfatehi/ydm
--- +++ @@ -4,6 +4,9 @@ scope.applyConfig({ create: { Image: "niallo/strider:latest", + Env: { + /* https://github.com/Strider-CD/strider#configuring */ + } }, start: { PublishAllPorts: !!argv.publish
0b273ace2c3681814c9ca799f12482d99c27c015
src/schema/rpc.js
src/schema/rpc.js
'use strict'; const { reduceAsync, identity } = require('../utilities'); const { rpcHandlers } = require('../rpc'); // Returns a reducer function that takes the schema as input and output, // and iterate over rpc-specific reduce functions const getRpcReducer = function (name, postProcess) { const processors = getPr...
'use strict'; const { reduceAsync, identity } = require('../utilities'); const { rpcHandlers } = require('../rpc'); // Reducer function that takes the schema as input and output, // and iterate over rpc-specific reduce functions const rpcReducer = function ({ schema, processors, postProcess = identity }) { return r...
Fix function names being lost in binding
Fix function names being lost in binding
JavaScript
apache-2.0
autoserver-org/autoserver,autoserver-org/autoserver
--- +++ @@ -3,23 +3,9 @@ const { reduceAsync, identity } = require('../utilities'); const { rpcHandlers } = require('../rpc'); -// Returns a reducer function that takes the schema as input and output, +// Reducer function that takes the schema as input and output, // and iterate over rpc-specific reduce function...
e53bbb5735497395d1ea4cb5a6c13db69792bd19
scripts/nvim.js
scripts/nvim.js
/* eslint no-console:0 */ /** * Spawns an embedded neovim instance and returns Neovim API */ const cp = require('child_process'); const attach = require('../attach'); // const inspect = require('util').inspect; module.exports = (async function() { let proc; let socket; if (process.env.NVIM_LISTEN_ADDRESS) {...
/* eslint no-console:0 */ /** * Spawns an embedded neovim instance and returns Neovim API */ const cp = require('child_process'); const attach = require('../').attach; // const inspect = require('util').inspect; module.exports = (async function() { let proc; let socket; if (process.env.NVIM_LISTEN_ADDRESS) ...
Fix import for api script
Fix import for api script
JavaScript
mit
rhysd/node-client,neovim/node-client,neovim/node-client
--- +++ @@ -5,7 +5,7 @@ */ const cp = require('child_process'); -const attach = require('../attach'); +const attach = require('../').attach; // const inspect = require('util').inspect; module.exports = (async function() { @@ -22,4 +22,4 @@ const nvim = await attach({ proc, socket }); return nvim; -}(...
ec886703ac80b1a5fef912123dd3a64411aab320
bin/index.js
bin/index.js
#!/usr/bin/env node 'use strict'; // foreign modules const meow = require('meow'); // local modules const error = require('../lib/error.js'); const logger = require('../lib/utils/logger.js'); const main = require('../index.js'); // this module const cli = meow({ help: main.help, version: true }, { boolean: ...
#!/usr/bin/env node 'use strict'; // foreign modules const meow = require('meow'); // local modules const error = require('../lib/error.js'); const logger = require('../lib/utils/logger.js'); const main = require('../index.js'); // this module const cli = meow({ help: main.help, version: true }, { flags: { ...
Update meow options to be in line with v4.0.0
Update meow options to be in line with v4.0.0
JavaScript
bsd-3-clause
blinkmobile/bmp-cli
--- +++ @@ -17,17 +17,12 @@ help: main.help, version: true }, { - boolean: [ - 'only', - 'prune', - 'remote' - ], - defaults: { - only: false, - prune: false, - remote: false - }, - type: [ 'type' ] + flags: { + only: {type: 'boolean', default: false}, + prune: {type: 'boolean', d...
9c9365a8dbefe86a2275311b6c54a552c9640816
lib/rules/echidna/editor-ids.js
lib/rules/echidna/editor-ids.js
'use strict'; exports.name = "echidna.editor-ids"; exports.check = function (sr, done) { var editorIDs = sr.$('dd[data-editor-id]').map(function(index, element) { var strId = sr.$(element).attr('data-editor-id'); // If the ID is not a digit-only string, it gets filtered out if (/\d+/.test...
'use strict'; exports.name = "echidna.editor-ids"; exports.check = function (sr, done) { var editorIDs = sr.$('dd[data-editor-id]').map(function(index, element) { var strId = sr.$(element).attr('data-editor-id'); // If the ID is not a digit-only string, it gets filtered out if (/\d+/.test...
Replace cheerio's deprecated toArray() with get()
Replace cheerio's deprecated toArray() with get()
JavaScript
mit
w3c/specberus,dontcallmedom/specberus,w3c/specberus,w3c/specberus,dontcallmedom/specberus
--- +++ @@ -8,7 +8,7 @@ // If the ID is not a digit-only string, it gets filtered out if (/\d+/.test(strId)) return parseInt(strId, 10); - }).toArray(); + }).get(); sr.metadata('editorIDs', editorIDs);
0a302a6a1f5bc93c999d25a3b9fdda9aa09b61ba
source/merge.js
source/merge.js
function merge(...args) { let output = null, items = [...args]; while (items.length > 0) { const nextItem = items.shift(); if (!output) { output = Object.assign({}, nextItem); } else { output = mergeObjects(output, nextItem); } } return out...
function clone(obj) { return Object.setPrototypeOf(Object.assign({}, obj), Object.getPrototypeOf(obj)); } function merge(...args) { let output = null, items = [...args]; while (items.length > 0) { const nextItem = items.shift(); if (!output) { output = clone(nextItem); ...
Fix merging objects with prototypes
Fix merging objects with prototypes
JavaScript
mit
perry-mitchell/webdav-client,perry-mitchell/webdav-client
--- +++ @@ -1,10 +1,14 @@ +function clone(obj) { + return Object.setPrototypeOf(Object.assign({}, obj), Object.getPrototypeOf(obj)); +} + function merge(...args) { let output = null, items = [...args]; while (items.length > 0) { const nextItem = items.shift(); if (!output) { -...
54aa153de51b8dffe6fa3c609b5727d843c81219
app/ShoppingListController.js
app/ShoppingListController.js
angular.module('shoppingList').controller( 'ShoppingListController', ['$scope', '$window', function($scope, $window) { 'use strict'; var blankItem = { name: '', category: '', quantity: '', unit: '', notes: '' }; $scope.categories = [ 'Baking', 'Beverages', ...
angular.module('shoppingList').controller( 'ShoppingListController', ['$scope', '$window', function($scope, $window) { 'use strict'; var blankItem = { name: '', category: '', quantity: '', unit: '', notes: '' }; $scope.categories = [ 'Baking', 'Beverages', ...
Fix month in list name.
Fix month in list name.
JavaScript
apache-2.0
eheikes/shopping-list,eheikes/shopping-list
--- +++ @@ -32,7 +32,7 @@ $scope.isEditing = true; var now = new Date(); - $scope.name = 'Shopping ' + now.getMonth() + '/' + now.getDate() + '/' + now.getFullYear(); + $scope.name = 'Shopping ' + (now.getMonth() + 1) + '/' + now.getDate() + '/' + now.getFullYear(); $scope.listItems = [ ...
2984c139a235a206c25b5c959edca77d2a10fe97
ui/spec/utils/formattingSpec.js
ui/spec/utils/formattingSpec.js
import {formatBytes, formatRPDuration} from 'utils/formatting'; describe('Formatting helpers', () => { describe('formatBytes', () => { it('returns null when passed a falsey value', () => { const actual = formatBytes(null); expect(actual).to.equal(null); }); it('returns the correct value whe...
import {formatBytes, formatRPDuration} from 'utils/formatting'; describe('Formatting helpers', () => { describe('formatBytes', () => { it('returns null when passed a falsey value', () => { const actual = formatBytes(null); expect(actual).to.equal(null); }); it('returns the correct value whe...
Fix test to use ∞
Fix test to use ∞
JavaScript
agpl-3.0
brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf
--- +++ @@ -25,7 +25,7 @@ it("returns 'infinite' for a retention policy with a value of '0'", () => { const actual = formatRPDuration('0') - expect(actual).to.equal('infinite'); + expect(actual).to.equal('∞'); }); it('correctly formats retention policy durations', () => {
ecdd9c40790cfde9aa3e723d9cb206f61f8fa9f4
ui/src/common/services/index.js
ui/src/common/services/index.js
import alertsSvc from './Alerts.js'; import auditLogsSvc from './AuditLogs.js'; import authSvc from './Authorization.js'; import exportSvc from './ExportService.js'; import exprUtil from './ExpressionUtil.js'; import fieldFactory from './FieldFactory.js'; import formUtil from './FormUti...
import alertsSvc from './Alerts.js'; import auditLogsSvc from './AuditLogs.js'; import authSvc from './Authorization.js'; import exportSvc from './ExportService.js'; import exprUtil from './ExpressionUtil.js'; import fieldFactory from './FieldFactory.js'; import formUtil from './FormUti...
Build fixes. Removed the unused utility class.
Build fixes. Removed the unused utility class.
JavaScript
bsd-3-clause
krishagni/openspecimen,krishagni/openspecimen,krishagni/openspecimen
--- +++ @@ -10,7 +10,6 @@ import pluginLoader from './PluginLoader.js'; import pluginViews from './PluginViewsRegistry.js'; import routerSvc from './Router.js'; -import utility from './Utility.js'; export default { install(app) { @@ -27,8 +26,7 @@ itemsSvc: itemsSvc, plugin...
5e4c0f322cfa7a776e6c12807e7c1b67e3846234
geogoose/util.js
geogoose/util.js
var mongoose = require('mongoose'), _ = require('cloneextend'), adHocModels = {}; var adHocModel = function(collectionName, Schema, options) { if (!adHocModels[collectionName]) { var options = options || {}; if (options.strict == undefined) { options.strict = false; } ...
var mongoose = require('mongoose'), _ = require('cloneextend'), adHocModels = {}; var adHocModel = function(collectionName, Schema, options) { if (!adHocModels[collectionName]) { var options = options || {}; if (options.strict == undefined) { options.strict = false; } ...
Send bbox for Point features
Send bbox for Point features
JavaScript
mit
nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense
--- +++ @@ -22,6 +22,12 @@ var toGeoJSON = function(obj) { delete obj.bounds2d; + if (obj.bbox && !obj.bbox.length && obj.geometry.type == 'Point') { + obj.bbox = [ + obj.geometry.coordinates[0], obj.geometry.coordinates[1], + obj.geometry.coordinates[0], obj.geometry.coordina...
30f4b78c463b42973eef5779dfabea760232f22d
lib/util/createTransition.js
lib/util/createTransition.js
/* @flow */ import matchRoutePattern from 'match-route-pattern' import type { Screen, Transition, TransitionHandler, Location, QueryParameters } from '../types' export default function createTransition(pattern: string, handler: TransitionHandler): Transition { return function transition(location: Locatio...
/* @flow */ import matchRoutePattern from 'match-route-pattern' import type { Screen, Transition, TransitionHandler, Location, QueryParameters } from '../types' export default function createTransition(pattern: string, handler: TransitionHandler): Transition { return function transition(location: Locatio...
Allow to return raw data from transition handler
Allow to return raw data from transition handler
JavaScript
mit
vslinko/vstack-router
--- +++ @@ -18,7 +18,7 @@ return Promise.resolve(undefined) } - return handler(queryParameters) + return Promise.resolve(handler(queryParameters)) .then(screen => screen) // Flow fix } }
2439e002bf97aa5dd2086bc9d6cccc500b35a07f
load/mediator/tcp-handler.js
load/mediator/tcp-handler.js
'use strict' const BodyStream = require('./body-stream') exports.handleBodyRequest = (conn) => { new BodyStream(1024).pipe(conn) }
'use strict' const BodyStream = require('./body-stream') exports.handleBodyRequest = (conn) => { const length = 1024 * 1024 conn.write('HTTP/1.1 200 OK\n') conn.write('Content-Type: text/plain\n') conn.write('\n') new BodyStream(length).pipe(conn) }
Send HTTP response on TCP channel
Send HTTP response on TCP channel The load testing tools don't support plain TCP. OHM-556
JavaScript
mpl-2.0
jembi/openhim-core-js,jembi/openhim-core-js
--- +++ @@ -3,5 +3,9 @@ const BodyStream = require('./body-stream') exports.handleBodyRequest = (conn) => { - new BodyStream(1024).pipe(conn) + const length = 1024 * 1024 + conn.write('HTTP/1.1 200 OK\n') + conn.write('Content-Type: text/plain\n') + conn.write('\n') + new BodyStream(length).pipe(conn) }
4aabc4665ec47172415ea66e2593840a50b08ceb
scripts/test-e2e.js
scripts/test-e2e.js
const _ = require('lodash'); const exec = require('shell-utils').exec; const android = _.includes(process.argv, '--android'); const release = _.includes(process.argv, '--release'); const skipBuild = _.includes(process.argv, '--skipBuild'); run(); function run() { const platform = android ? `android` : `ios`; con...
const _ = require('lodash'); const exec = require('shell-utils').exec; const android = _.includes(process.argv, '--android'); const release = _.includes(process.argv, '--release'); const skipBuild = _.includes(process.argv, '--skipBuild'); const headless = _.includes(process.argv, '--headless'); run(); function run(...
Add headless option to e2e android
Add headless option to e2e android
JavaScript
mit
ceyhuno/react-native-navigation,wix/react-native-navigation,guyca/react-native-navigation,ceyhuno/react-native-navigation,chicojasl/react-native-navigation,wix/react-native-navigation,wix/react-native-navigation,thanhzusu/react-native-navigation,guyca/react-native-navigation,ceyhuno/react-native-navigation,ceyhuno/reac...
--- +++ @@ -4,18 +4,20 @@ const android = _.includes(process.argv, '--android'); const release = _.includes(process.argv, '--release'); const skipBuild = _.includes(process.argv, '--skipBuild'); +const headless = _.includes(process.argv, '--headless'); run(); function run() { - const platform = android ? `a...
0b527145181bc9f8aecf6a3f49eac23bccfba7eb
src/index.js
src/index.js
/* eslint-env browser */ import {findSingleNode, getFindDOMNode} from './helpers'; let findDOMNode = findDOMNode || (global && global.findDOMNode); function haveComponentWithXpath(component, expression) { findDOMNode = findDOMNode || getFindDOMNode(); const domNode = findDOMNode(component); document.body.appen...
/* eslint-env browser */ import {findSingleNode, getFindDOMNode} from './helpers'; let findDOMNode = findDOMNode || (global && global.findDOMNode); function haveDomNodeWithXpath(domNode, expression) { document.body.appendChild(domNode); const xpathNode = findSingleNode(expression, domNode.parentNode); document....
Remove unnecessary call to findDOMNode
fix: Remove unnecessary call to findDOMNode
JavaScript
mit
relekang/chai-have-xpath,davija/chai-have-xpath
--- +++ @@ -3,10 +3,7 @@ let findDOMNode = findDOMNode || (global && global.findDOMNode); -function haveComponentWithXpath(component, expression) { - findDOMNode = findDOMNode || getFindDOMNode(); - const domNode = findDOMNode(component); - +function haveDomNodeWithXpath(domNode, expression) { document.body...
a0651499089a9cb5648b08713dc6f298ea667f94
src/index.js
src/index.js
import Client from './client' import PullRequests from './pulls' import Repositories from './repos' import PageLinks from './paging' export default function (config) { return new Client(config, { PullRequests, Repositories, PageLinks }) }
import Client from './client' import Branches from './branches' import Issues from './issues' import PullRequests from './pulls' import Repositories from './repos' import PageLinks from './paging' export default function (config) { return new Client(config, { Branches, Issues, PullRequests, Repositor...
Add branches and issues to the api
Add branches and issues to the api
JavaScript
mit
jamsinclair/github-lite
--- +++ @@ -1,10 +1,14 @@ import Client from './client' +import Branches from './branches' +import Issues from './issues' import PullRequests from './pulls' import Repositories from './repos' import PageLinks from './paging' export default function (config) { return new Client(config, { + Branches, + ...
6b8328476ac25514dba5204ee3e3fbe423539fd0
src/index.js
src/index.js
import React, { Component } from 'react'; import ReactDom from 'react-dom'; import YTSearch from 'youtube-api-search'; import SearchBar from './components/search_bar'; import VideoList from './components/video_list'; import VideoDetail from './components/video_detail'; // const API_KEY = 'PLACE_YOUR_API_KEY_HERE'; cla...
import React, { Component } from 'react'; import ReactDom from 'react-dom'; import YTSearch from 'youtube-api-search'; import SearchBar from './components/search_bar'; import VideoList from './components/video_list'; import VideoDetail from './components/video_detail'; import file from './variables.js'; // const API_KE...
Add import for variables file, set a const API_KEY as the data from variables file.
Add import for variables file, set a const API_KEY as the data from variables file.
JavaScript
mit
JosephLeon/redux-simple-starter-tutorial,JosephLeon/redux-simple-starter-tutorial
--- +++ @@ -4,7 +4,9 @@ import SearchBar from './components/search_bar'; import VideoList from './components/video_list'; import VideoDetail from './components/video_detail'; +import file from './variables.js'; // const API_KEY = 'PLACE_YOUR_API_KEY_HERE'; +const API_KEY = file.data; class App extends Componen...
1b3b3c836cf46b5dcf108560d116d9555860c835
src/input.js
src/input.js
// Kind of like a singleton const Keyboard = { "KEY_UP": 38, "KEY_DOWN": 40, "KEY_LEFT": 37, "KEY_RIGHT": 39, "KEY_W": 87, "KEY_A": 65, "KEY_D": 68, "KEY_SPACE": 32, "keys": [], "keydown_handler": function(evt) { Keyboard.keys[evt.keyCode] = true; if (evt.keyCod...
// Kind of like a singleton const Keyboard = { "KEY_ESC": 27, "KEY_UP": 38, "KEY_DOWN": 40, "KEY_LEFT": 37, "KEY_RIGHT": 39, "KEY_W": 87, "KEY_A": 65, "KEY_D": 68, "KEY_SPACE": 32, "keys": [], "nKeysDown": 0, "keydown_handler": function(evt) { Keyboard.nKeysDown ...
Add any key test and ESC constant
Add any key test and ESC constant
JavaScript
mpl-2.0
nikosandronikos/spacebattle,nikosandronikos/spacebattle
--- +++ @@ -1,5 +1,6 @@ // Kind of like a singleton const Keyboard = { + "KEY_ESC": 27, "KEY_UP": 38, "KEY_DOWN": 40, "KEY_LEFT": 37, @@ -9,7 +10,9 @@ "KEY_D": 68, "KEY_SPACE": 32, "keys": [], + "nKeysDown": 0, "keydown_handler": function(evt) { + Keyboard.nKeysDown ...
9d90cb8c5f2b2b38c85bb80fe96cab2b6037d35c
lib/kill-ring.js
lib/kill-ring.js
/* global atom:true */ const _ = require('underscore-plus'); const clipboard = atom.clipboard; module.exports = class KillRing { constructor(limit=16) { this.buffer = []; this.sealed = true; this.limit = limit; } put(texts, forward=true) { if(this.sealed) this.push(texts); else t...
/* global atom:true */ const clipboard = atom.clipboard; module.exports = class KillRing { constructor(limit=16) { this.buffer = []; this.sealed = true; this.limit = limit; } put(texts, forward=true) { if(this.sealed) this.push(texts); else this.update(texts, forward); } sea...
Remove the requirement no longer being used
Remove the requirement no longer being used
JavaScript
mit
yasuyuky/transient-emacs,yasuyuky/transient-emacs
--- +++ @@ -1,5 +1,4 @@ /* global atom:true */ -const _ = require('underscore-plus'); const clipboard = atom.clipboard; module.exports =
535f14e8f463ce81d360204fde459c3ca3e49f97
src/elemental.js
src/elemental.js
(function(ns) { var namespaces = [this]; var attachBehavior = function($element, behavior) { var fn = namespaces; behavior.replace(/([^.]+)/g, function(object) { if(fn === namespaces) { for(var nextFn, index = 0; index < fn.length; ++index) { ne...
(function(ns) { var namespaces = [this]; var attachBehavior = function($element, behavior) { var fn = namespaces; behavior.replace(/([^.]+)/g, function(object) { if(fn === namespaces) { for(var nextFn, index = 0; index < fn.length; ++index) { ne...
Improve perfomance on large DOMs when container is not whole document.
Improve perfomance on large DOMs when container is not whole document.
JavaScript
mit
elementaljs/elementaljs,elementaljs/elementaljs
--- +++ @@ -30,11 +30,10 @@ ns.load = function(container) { var $selector; - if (container === document) { - $selector = $('[data-behavior]'); - } - else { - $selector = $(container).find("*").andSelf().filter("[data-behavior]"); + $selector = $('[data...
822a4132d2bb0e85372e8f7790b9bd4db9c5f17e
test/pnut.js
test/pnut.js
const chai = require('chai'); const chaiAsPromised = require('chai-as-promised'); const nock = require('nock'); chai.use(chaiAsPromised); chai.should(); const expect = chai.expect; const pnut = require('../lib/pnut'); describe('The pnut API wrapper', function () { before(function() { let root = 'https://api.p...
const chai = require('chai'); const chaiAsPromised = require('chai-as-promised'); const nock = require('nock'); chai.use(chaiAsPromised); chai.should(); const expect = chai.expect; const pnut = require('../lib/pnut'); describe('The pnut API wrapper', function () { before(function() { let base = 'https://api.p...
Rename variable for more consitency
Rename variable for more consitency
JavaScript
mit
kaiwood/pnut-butter
--- +++ @@ -11,12 +11,13 @@ describe('The pnut API wrapper', function () { before(function() { - let root = 'https://api.pnut.io' - nock(root) + let base = 'https://api.pnut.io'; + + nock(base) .get('/v0') .reply(200, {}) - nock(root) + nock(base) .get('/v0/posts/streams...
ee239ef4415590d899a71d8e42038a8bcd831f18
test/test.js
test/test.js
var assert = require('assert'); var configMergeLoader = require('../index.js'); describe('configMergeLoader', function() { it('should return an function', function() { assert.equal(typeof configMergeLoader, 'function'); }); });
var assert = require('assert'); var configMergeLoader = require('../index.js'); describe('configMergeLoader', function() { it('should return an function', function() { assert.equal(typeof configMergeLoader, 'function'); }); describe('the function', function() { var mergedObj = configMergeLoader(); ...
Test that function returns and object
Test that function returns and object
JavaScript
mit
bitfyre/config-merge-loader
--- +++ @@ -5,4 +5,12 @@ it('should return an function', function() { assert.equal(typeof configMergeLoader, 'function'); }); + + describe('the function', function() { + var mergedObj = configMergeLoader(); + + it('should return an object', function() { + assert.equal(typeof mergedObj, 'object'...
7b13df50ef46ddad708f0fd38c5d7f2891a1c56b
src/application/application.js
src/application/application.js
import $ from 'jquery'; import Radio from 'backbone.radio'; import nprogress from 'nprogress'; import Application from '../common/application'; import LayoutView from './layout-view'; let routerChannel = Radio.channel('router'); nprogress.configure({ showSpinner: false }); export default Application.extend({ ini...
import $ from 'jquery'; import _ from 'lodash'; import Radio from 'backbone.radio'; import nprogress from 'nprogress'; import Application from '../common/application'; import LayoutView from './layout-view'; let routerChannel = Radio.channel('router'); nprogress.configure({ showSpinner: false }); export default Ap...
Use _.defer instead of setTimeout
Use _.defer instead of setTimeout
JavaScript
isc
paulfalgout/marionette-strings,onelovelyname/marionette-wires,paulfalgout/marionette-strings,batpad/marionette-wires-tada,yuya-takeyama/marionette-wires,thejameskyle/marionette-wires,onelovelyname/marionette-wires,jkappers/marionette-wires,yuya-takeyama/marionette-wires,thejameskyle/marionette-wires,batpad/marionette-w...
--- +++ @@ -1,4 +1,5 @@ import $ from 'jquery'; +import _ from 'lodash'; import Radio from 'backbone.radio'; import nprogress from 'nprogress'; import Application from '../common/application'; @@ -26,11 +27,11 @@ onBeforeEnterRoute() { this.transitioning = true; // Don't show for synchronous route ch...
0e1a7d0eccd55f3a45f39794e17c4cfea6912b3b
examples/hierarchical/index.js
examples/hierarchical/index.js
import Finity from '../../src'; const submachineConfig = Finity .configure() .initialState('substate1') .getConfig(); const stateMachine = Finity .configure() .initialState('state1') .on('event1').transitionTo('state2') .state('state2') .submachine(submachineConfig) .global() ....
import Finity from '../../src'; const handleStateEnter = (state) => console.log(`Entering state '${state}'`); const handleStateExit = (state) => console.log(`Exiting state '${state}'`); const submachineConfig = Finity .configure() .initialState('substate2A') .on('event2').transitionTo('substate2B') .g...
Update hierarchical state machine example
Update hierarchical state machine example
JavaScript
mit
nickuraltsev/fluent-state-machine,nickuraltsev/finity,nickuraltsev/finity
--- +++ @@ -1,8 +1,15 @@ import Finity from '../../src'; + +const handleStateEnter = (state) => console.log(`Entering state '${state}'`); +const handleStateExit = (state) => console.log(`Exiting state '${state}'`); const submachineConfig = Finity .configure() - .initialState('substate1') + .initialState(...
b9cd5acaaf55baaac93f859699dc1fcbdb244dc5
test/testIndex.js
test/testIndex.js
"use strict"; var request = require("supertest"); var app = require("../js/server/app.js"); describe("App backend server", function () { it("should serve the index page", function (done) { request(app) .get("/index.html") .expect(200, done); }); });
"use strict"; var request = require("supertest"); var mongodb = require("mongodb"); var mongoUrl = "mongodb://mongodb:27017/myproject"; var app = require("../js/server/app.js"); describe("App backend server", function () { it("should serve the index page", function (done) { request(app) .get...
Test for simple save/reload of a List
Test for simple save/reload of a List Gotcha: there is no test DB separation yet, running the tests will drop the entire collection before each test.
JavaScript
mit
pixelistik/alreadydone,pixelistik/alreadydone,pixelistik/alreadydone
--- +++ @@ -1,6 +1,9 @@ "use strict"; var request = require("supertest"); +var mongodb = require("mongodb"); + +var mongoUrl = "mongodb://mongodb:27017/myproject"; var app = require("../js/server/app.js"); @@ -10,4 +13,54 @@ .get("/index.html") .expect(200, done); }); + + de...
5d7794078d159157860b76c93f1550be9418731d
src/title/TitleStream.js
src/title/TitleStream.js
/* @flow */ import React, { PureComponent } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import type { Narrow, Stream } from '../types'; import StreamIcon from '../streams/StreamIcon'; import { isTopicNarrow } from '../utils/narrow'; const styles = StyleSheet.create({ wrapper: { alignIte...
/* @flow */ import React, { PureComponent } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import type { Narrow, Stream } from '../types'; import StreamIcon from '../streams/StreamIcon'; import { isTopicNarrow } from '../utils/narrow'; const styles = StyleSheet.create({ wrapper: { alignIte...
Fix Stream title alignment issue on Android
Fix Stream title alignment issue on Android
JavaScript
apache-2.0
vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile
--- +++ @@ -13,6 +13,7 @@ }, streamRow: { flexDirection: 'row', + alignItems: 'center', }, streamText: { marginLeft: 4,
338d11b74b6ebcbc841688d21e17a296288dba1d
src/encoding/markdownToHTML.js
src/encoding/markdownToHTML.js
import marked from 'marked'; import htmlclean from 'htmlclean'; import he from 'he'; const renderer = new marked.Renderer(); renderer.listitem = (text) => { if (/<input[^>]+type="checkbox"/.test(text)) { return `<li class="task-list-item">${text}</li>\n`; } return `<li>${text}</li>\n`; }; renderer.code = (...
import marked from 'marked'; import htmlclean from 'htmlclean'; import he from 'he'; const renderer = new marked.Renderer(); renderer.listitem = (text) => { if (/<input[^>]+type="checkbox"/.test(text)) { return `<li class="task-list-item">${text}</li>\n`; } return `<li>${text}</li>\n`; }; renderer.code = (...
Add line break code at end of marked custom parser result
Add line break code at end of marked custom parser result
JavaScript
mit
oneteam-dev/draft-js-oneteam-rte-plugin,oneteam-dev/draft-js-oneteam-rte-plugin
--- +++ @@ -13,13 +13,13 @@ renderer.code = (code, language) => { const escapedCode = he.escape(code); - return `<pre${language ? ` data-language="${language}"` : ''}>${escapedCode}</pre>`; + return `<pre${language ? ` data-language="${language}"` : ''}>${escapedCode}</pre>\n`; }; renderer.paragraph = (te...
e91fac319f8c5254569163f83908a676c6141f94
spec/AddressBookSpec.js
spec/AddressBookSpec.js
describe('Address Book', function() { var addressB, thisContact; beforeEach(function() { addressB = new addressBook(); thisContact = new Contact(); }); it('should be able to add a contact', function() { addressB.addContact(thisContact); expect(addressB.getContact(0)).toBe(thisContact); }); it('should...
describe('Address Book', function() { var addressB, thisContact; beforeEach(function() { addressB = new addressBook(); thisContact = new Contact(); }); it('should be able to add a contact', function() { addressB.addContact(thisContact); expect(addressB.getContact(0)).toBe(thisContact); }); it('should...
Add test for async address book
Add test for async address book
JavaScript
mit
AthinaB/js-testing-jasmine,AthinaB/js-testing-jasmine
--- +++ @@ -18,3 +18,22 @@ expect(addressB.getContact(0)).not.toBeDefined(); }); }); + +describe('Async Address Book', function() { + var addressB = new addressBook(); + + /* + * the func getAsyncContacts should take as param + * a callback func and invokes it gets a response + */ + beforeEach(function(done) ...
1a12cf0c190e077d623f9a1fcad3f91cde5915c8
src/js/app/data_utils/store.js
src/js/app/data_utils/store.js
App.Store = DS.Store.extend({ findQuery: function(type, id){ id = id || {}; id.api_key = App.API_KEY; return this._super(type, id); }, allRecords: function(){ var typeMaps = this.get('typeMaps'), records = []; for (var key in typeMaps){ records = records.concat(typeMaps[key].re...
App.Store = DS.Store.extend({ findQuery: function(type, query){ query = query || {}; if (!this.container.lookup('router:main').namespace.AuthManager.isAuthenticated()){ query.api_key = 'a3yqP8KA1ztkIbq4hpokxEOwnUkleu2AMv0XsBWC0qLBKVL7pA'; } return this._super(type, query); }, allRecords: ...
Add the api_key to the query only if we're not authenticated some other way
Add the api_key to the query only if we're not authenticated some other way
JavaScript
mit
Mause/tumblr-ember
--- +++ @@ -1,9 +1,12 @@ App.Store = DS.Store.extend({ - findQuery: function(type, id){ - id = id || {}; - id.api_key = App.API_KEY; + findQuery: function(type, query){ + query = query || {}; - return this._super(type, id); + if (!this.container.lookup('router:main').namespace.AuthManager.isAuthen...
75d150dcbe15649754248f8628e136a7c40f7eab
scripts/ci-clean.js
scripts/ci-clean.js
/** * `npm run ci:clean` * * Cross-platform script to remove report directory for CI. */ const process = require('process'); const script = require('./script'); const reportDirPath = process.env.npm_package_config_report_dir_path; script.run(`rimraf ${reportDirPath}`);
/** * `npm run ci:clean` * * Cross-platform script to remove report directory for CI. */ const process = require('process'); const script = require('./script'); const reportDirPath = process.env.npm_package_config_report_dir_path; script.run(`rimraf ${reportDirPath}`); // Remove generated `.nyc_output/` because ...
Remove .nyc_output to prevent this dir from getting too large.
Remove .nyc_output to prevent this dir from getting too large.
JavaScript
mit
choonchernlim/front-end-stack,choonchernlim/front-end-stack
--- +++ @@ -9,3 +9,7 @@ const reportDirPath = process.env.npm_package_config_report_dir_path; script.run(`rimraf ${reportDirPath}`); + +// Remove generated `.nyc_output/` because it may get large over time. +// See https://github.com/istanbuljs/nyc/issues/197 +script.run('rimraf .nyc_output/');
27e7db50ae93d77c8578a4b104efe3f56fce064e
src/childrensize.js
src/childrensize.js
var computedStyle = require('computed-style'); module.exports = function(container) { if (!container) { return; } var children = [].slice.call(container.children, 0).filter(function (el) { var pos = computedStyle(el, 'position'); el.rect = el.getBoundingClientRect(); // store rect for later ...
var computedStyle = require('computed-style'); function toArray (nodeList) { var arr = []; for (var i=0, l=nodeList.length; i<l; i++) { arr.push(nodeList[i]); } return arr; } module.exports = function(container) { if (!container) { return; } var children = toArray(container.children).filter(funct...
Fix IE8 error when converting NodeList to Array
Fix IE8 error when converting NodeList to Array
JavaScript
mit
gardr/ext,gardr/ext
--- +++ @@ -1,9 +1,15 @@ var computedStyle = require('computed-style'); + +function toArray (nodeList) { + var arr = []; + for (var i=0, l=nodeList.length; i<l; i++) { arr.push(nodeList[i]); } + return arr; +} module.exports = function(container) { if (!container) { return; } - var children = [...
02e71c3c22b5563f05910a92bc1c7efa9cc7a3a9
src/background.js
src/background.js
var RESET_TIME = 3000; var timeout; var lastPress = Date.now(); var average = 0; var iterations = 1; chrome.browserAction.onClicked.addListener(function() { var elapsedTime = Date.now() - lastPress; lastPress = Date.now(); if (elapsedTime > RESET_TIME) { average = 0; iterations = 1; } else { avera...
var RESET_TIME = 3000; var timeout; var lastPress = performance.now(); var average = 0; var iterations = 1; chrome.browserAction.onClicked.addListener(function() { var elapsedTime = performance.now() - lastPress; lastPress = performance.now(); if (elapsedTime > RESET_TIME) { average = 0; iterations = 1;...
Use performance.now for better accuracy
Use performance.now for better accuracy
JavaScript
mit
chrisblazek/bpm-tapper,chrisblazek/bpm-tapper,chrisblazek/bpm-tapper
--- +++ @@ -1,12 +1,12 @@ var RESET_TIME = 3000; var timeout; -var lastPress = Date.now(); +var lastPress = performance.now(); var average = 0; var iterations = 1; chrome.browserAction.onClicked.addListener(function() { - var elapsedTime = Date.now() - lastPress; - lastPress = Date.now(); + var elapsedTime ...
968fae71469a3bb8a010f74c2c8244a4d26f429d
protractor.conf.js
protractor.conf.js
// @AngularClass exports.config = { baseUrl: 'http://localhost:8080/', allScriptsTimeout: 11000, framework: 'jasmine', jasmineNodeOpts: { defaultTimeoutInterval: 60000, showTiming: true }, capabilities: { 'browserName': 'chrome', 'chromeOptions': { 'args': ['show-fps-counter=true'...
// @AngularClass exports.config = { baseUrl: 'http://localhost:3000/', allScriptsTimeout: 11000, framework: 'jasmine', jasmineNodeOpts: { defaultTimeoutInterval: 60000, showTiming: true }, capabilities: { 'browserName': 'chrome', 'chromeOptions': { 'args': ['show-fps-counter=true'...
Change baseUrl to listen to port 3000; remove seleniumAddress and define seleniumServerJar instead to get selenium running
Change baseUrl to listen to port 3000; remove seleniumAddress and define seleniumServerJar instead to get selenium running
JavaScript
mit
burgerga/angular2-webpack-starter,benjaminleetmaa/hsoemRepo,psamit/angular-starter,Yaroslav-Andryushchenkov/epam-angular2,JerrolKrause/angular-ultimate-starter,vamurov/lazyImageLoad,bryant-pham/easyjudge,shattar/test-ng2-submodule-routing,stepkraft/factory-queue,DigitalGeek/angular2-webpack-starter,davidstellini/bvl-pa...
--- +++ @@ -1,7 +1,7 @@ // @AngularClass exports.config = { - baseUrl: 'http://localhost:8080/', + baseUrl: 'http://localhost:3000/', allScriptsTimeout: 11000, @@ -19,7 +19,7 @@ } }, - seleniumAddress: 'http://localhost:4444/wd/hub', + seleniumServerJar: './node_modules/protractor/selenium/se...
b3b75a6855b143e1e5fb208419eea2b8819b618d
src/utils/__tests__/isExportsOrModuleAssignment-test.js
src/utils/__tests__/isExportsOrModuleAssignment-test.js
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { statement } from '../../../tests/utils'; import isExportsOrModuleAssignment from '../isExportsOrModuleAssignment'; de...
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { statement, noopImporter } from '../../../tests/utils'; import isExportsOrModuleAssignment from '../isExportsOrModuleAs...
Add noop importer to isExportsOrModuleAssignment tests
Add noop importer to isExportsOrModuleAssignment tests
JavaScript
mit
reactjs/react-docgen,reactjs/react-docgen,reactjs/react-docgen
--- +++ @@ -6,26 +6,32 @@ * */ -import { statement } from '../../../tests/utils'; +import { statement, noopImporter } from '../../../tests/utils'; import isExportsOrModuleAssignment from '../isExportsOrModuleAssignment'; describe('isExportsOrModuleAssignment', () => { it('detects "module.exports = ...;"'...
ee81febc89910ea3bd5954e3ebf2b41bd400c604
src/decorators.js
src/decorators.js
// Debounce decorator for methods. // // See: https://github.com/wycats/javascript-decorators export const debounce = (duration) => (target, name, descriptor) => { const {value: fn} = descriptor let wrapper let lastCall = 0 function debounced () { const now = Date.now() if (now > lastCall + duration) {...
// Debounce decorator for methods. // // See: https://github.com/wycats/javascript-decorators export const debounce = (duration) => (target, name, descriptor) => { const {value: fn} = descriptor // This symbol is used to store the related data directly on the // current object. const s = Symbol() function d...
Fix @debounce to work correctly with multiple instances.
Fix @debounce to work correctly with multiple instances.
JavaScript
agpl-3.0
lmcro/xo-web,lmcro/xo-web,lmcro/xo-web,vatesfr/xo-web,vatesfr/xo-web
--- +++ @@ -4,22 +4,29 @@ export const debounce = (duration) => (target, name, descriptor) => { const {value: fn} = descriptor - let wrapper - let lastCall = 0 + // This symbol is used to store the related data directly on the + // current object. + const s = Symbol() + function debounced () { + let ...
3adfb577f9b4a5d7f28ccac40f17c867a6f7913c
lib/is-js-module.js
lib/is-js-module.js
'use strict'; var deferred = require('deferred') , fs = require('fs') , extname = require('path').extname , hasNodeSheBang = RegExp.prototype.test.bind(/^#![\u0021-\uffff]+(?:\/node|\/env node)\s/) , promisify = deferred.promisify , read = promisify(fs.read) , open = promisify(fs.open), close = pro...
'use strict'; var deferred = require('deferred') , fs = require('fs') , extname = require('path').extname , hasNodeSheBang = RegExp.prototype.test.bind(/^#![\u0021-\uffff]+(?:\/node|\/env node)\s/) , promisify = deferred.promisify , read = promisify(fs.read) , open = promisify(fs.open), close = pro...
Support JSOM as js module
Support JSOM as js module
JavaScript
isc
medikoo/movejs,medikoo/rename-module
--- +++ @@ -12,6 +12,7 @@ module.exports = function (filename) { var ext = extname(filename); if (ext === '.js') return deferred(true); + if (ext === '.json') return deferred(true); if (ext) return deferred(false); return open(filename, 'r')(function (fd) {
7cb07d2328863847644887eff660978e0699e22b
lib/post-manager.js
lib/post-manager.js
var _ = require('lodash-node/modern') // TODO: consider passing the taxonomy types to the constructor function PostManager() { this.posts = [] } PostManager.prototype.all = function() { return posts } PostManager.prototype.each = function(cb) { _.each(this.posts, cb) } PostManager.prototype.reset = function()...
var _ = require('lodash-node/modern') var natural = require('natural') var inflector = new natural.NounInflector() // TODO: consider passing the taxonomy types to the constructor function PostManager(taxonomyTypes) { this.posts = [] this.taxonomyTypes = taxonomyTypes this.taxonomies = {} _.each(this.taxonomyTy...
Add a method to add posts to the post manager that also categorizes them by taxonomy.
Add a method to add posts to the post manager that also categorizes them by taxonomy.
JavaScript
mit
philipwalton/ingen
--- +++ @@ -1,8 +1,32 @@ var _ = require('lodash-node/modern') +var natural = require('natural') +var inflector = new natural.NounInflector() // TODO: consider passing the taxonomy types to the constructor -function PostManager() { +function PostManager(taxonomyTypes) { this.posts = [] + this.taxonomyTypes = ...
c59d6500c9bad9d0c2b3745c71010797c4a107fc
lib/query-parser.js
lib/query-parser.js
'use strict' /** * @license * node-scrapy <https://github.com/eeshi/node-scrapy> * Copyright Stefan Maric, Adrian Obelmejias, and other contributors <https://github.com/eeshi/node-scrapy/graphs/contributors> * Released under MIT license <https://github.com/eeshi/node-scrapy/blob/master/LICENSE> */ module.exports...
'use strict' /** * @license * node-scrapy <https://github.com/eeshi/node-scrapy> * Copyright Stefan Maric, Adrian Obelmejias, and other contributors <https://github.com/eeshi/node-scrapy/graphs/contributors> * Released under MIT license <https://github.com/eeshi/node-scrapy/blob/master/LICENSE> */ module.exports...
Exclude filter expression from selector
Exclude filter expression from selector
JavaScript
mit
eeshi/node-scrapy
--- +++ @@ -18,7 +18,7 @@ } function extractSelector (query) { - return query.split(/\s*=>\s*/)[0] + return query.split(/\s*(=>|\|)\s*/)[0] } function extractGetter (query) {
daf3d146f9049a2ecc6cd732742fbc6d1b5ca2fc
lib/storeQuery/when.js
lib/storeQuery/when.js
var Statuses = require('../internalConstants').Statuses; function when(handlers) { handlers || (handlers = {}); var status = this.status; var handler = handlers[status.toLowerCase()]; if (!handler) { throw new Error('Could not find a ' + status + ' handler'); } switch (status) { case Statuses.PE...
var Statuses = require('../internalConstants').Statuses; function when(handlers) { handlers || (handlers = {}); var status = this.status; var handler = handlers[status.toLowerCase()]; if (!handler) { throw new Error('Could not find a ' + status + ' handler'); } switch (status) { case Statuses.PE...
Allow you to call other handler from a handler
Allow you to call other handler from a handler
JavaScript
mit
kwangkim/marty,oliverwoodings/marty,bigardone/marty,martyjs/marty,kwangkim/marty,Driftt/marty,martyjs/marty,CumpsD/marty-lib,thredup/marty-lib,thredup/marty,bigardone/marty,kwangkim/marty,goldensunliu/marty-lib,martyjs/marty-lib,bigardone/marty,oliverwoodings/marty,Driftt/marty,gmccrackin/marty-lib,thredup/marty,KeKs0r...
--- +++ @@ -12,11 +12,11 @@ switch (status) { case Statuses.PENDING: - return handler(); + return handler.call(handlers); case Statuses.FAILED: - return handler(this.error); + return handler.call(handlers, this.error); case Statuses.DONE: - return handler(this.result); + ...
19ba468f68bab037a04277edae68fc94e89378e5
lib/ui/dashboard.js
lib/ui/dashboard.js
var express = require('express'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var serveStatic = require('serve-static'); var errorhandler = require('errorhandler'); var less = require('less-middleware'); var path = require('path'); exports.register = function(application, ...
var express = require('express'); var bodyParser = require('body-parser'); var methodOverride = require('method-override'); var serveStatic = require('serve-static'); var errorhandler = require('errorhandler'); var less = require('less-middleware'); var path = require('path'); exports.register = function(application, ...
Use bodyParser.json() instead of bodyParser itself.
Use bodyParser.json() instead of bodyParser itself. See: http://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4
JavaScript
mit
KitaitiMakoto/express-droonga,droonga/express-droonga,droonga/express-droonga,KitaitiMakoto/express-droonga
--- +++ @@ -16,7 +16,7 @@ application.set('views', path.join(topDirectory, 'views')); application.set('view engine', 'jade'); - application.use(prefix, bodyParser()); + application.use(prefix, bodyParser.json()); application.use(prefix, methodOverride()); application.use(prefix, less(path.join(topDire...
c8c85828f4a82f45484d868efed645041b698536
app/js/lib/graph_sketcher/bezier.js
app/js/lib/graph_sketcher/bezier.js
define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) { return { numOfPts: 100, lineStyle: function(pts) { let n = pts.length - 1; let comb = []; let r; for (let r = 0; r <= n; r += 1) { /...
define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) { return { numOfPts: 100, lineStyle: function(pts) { let n = pts.length - 1; let comb = []; for (let r = 0; r <= n; r += 1) { // from the other ma...
Add additional 'let' decleration for inner loop and clean up
Add additional 'let' decleration for inner loop and clean up
JavaScript
mit
ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app
--- +++ @@ -6,7 +6,6 @@ let n = pts.length - 1; let comb = []; - let r; for (let r = 0; r <= n; r += 1) { // from the other math library!!!! not the same as Math!!!! comb.push(m.combinations(n, r)); @@ -16,7 +15,6 @@ le...
135011f4551a81e7f57ad373ca8c25cdfde49032
vue-typescript.js
vue-typescript.js
/* eslint-env node */ module.exports = { extends: [ "@vue/typescript", "./typescript.js" ], parser: require.resolve("vue-eslint-parser"), parserOptions: { parser: "@typescript-eslint/parser", sourceType: "module", ecmaFeatures: { jsx: true }, warnOnUnsupportedTypeScriptVersio...
/* eslint-env node */ module.exports = { extends: [ "./typescript.js" ], parser: require.resolve("vue-eslint-parser"), parserOptions: { parser: "@typescript-eslint/parser", sourceType: "module", ecmaFeatures: { jsx: true }, warnOnUnsupportedTypeScriptVersion: false, p...
Fix for recent changes to typescript plugin
Fix for recent changes to typescript plugin
JavaScript
mit
launchbadge/eslint-config-launchbadge
--- +++ @@ -1,12 +1,14 @@ /* eslint-env node */ module.exports = { - extends: [ "@vue/typescript", "./typescript.js" ], + extends: [ "./typescript.js" ], parser: require.resolve("vue-eslint-parser"), parserOptions: { parser: "@typescript-eslint/parser", sourceType: "module", ...
84cddaa35ebcd2a80313f715598e6fd07e964ec5
js/src/forum/addLockControl.js
js/src/forum/addLockControl.js
import { extend } from 'flarum/extend'; import DiscussionControls from 'flarum/utils/DiscussionControls'; import DiscussionPage from 'flarum/components/DiscussionPage'; import Button from 'flarum/components/Button'; export default function addLockControl() { extend(DiscussionControls, 'moderationControls', function(...
import { extend } from 'flarum/extend'; import DiscussionControls from 'flarum/utils/DiscussionControls'; import DiscussionPage from 'flarum/components/DiscussionPage'; import Button from 'flarum/components/Button'; export default function addLockControl() { extend(DiscussionControls, 'moderationControls', function(...
Fix extension to work with latest state changes
Fix extension to work with latest state changes Refs flarum/core#2156.
JavaScript
mit
flarum/flarum-ext-lock,flarum/flarum-ext-lock
--- +++ @@ -16,8 +16,8 @@ DiscussionControls.lockAction = function() { this.save({isLocked: !this.isLocked()}).then(() => { - if (app.current instanceof DiscussionPage) { - app.current.stream.update(); + if (app.current.matches(DiscussionPage)) { + app.current.get('stream').update();...
02310d90f950e0e4a5fdd493f57978fae681a429
webpack.config.js
webpack.config.js
'use strict'; var webpack = require('webpack'); var path = require('path'); module.exports = { entry: ['babel-polyfill', './src/js/reactTest.jsx'], output: { path: './public/js', filename: 'reactTest.js' }, module: { rules: [ { test: /\.(js|jsx)$/, include: path.resolve(__dirn...
'use strict'; var webpack = require('webpack'); var path = require('path'); module.exports = { entry: ['babel-polyfill', './src/js/reactTest.jsx'], output: { path: path.resolve(__dirname, 'public/js'), filename: 'reactTest.js' }, module: { rules: [ { test: /\.(js|jsx)$/, inclu...
Use absolute path for output folder of webpack
Use absolute path for output folder of webpack
JavaScript
agpl-3.0
BreakOutEvent/breakout-frontend
--- +++ @@ -5,7 +5,7 @@ module.exports = { entry: ['babel-polyfill', './src/js/reactTest.jsx'], output: { - path: './public/js', + path: path.resolve(__dirname, 'public/js'), filename: 'reactTest.js' }, module: {
1a9912ec8f7579ddc1f440015933f905070b3974
webpack.config.js
webpack.config.js
const path = require('path'); const webpack = require('webpack') module.exports = { module: { rules: [ { test: /\.html$/, use: 'raw-loader' } ] }, resolve: { modules: ['public/js', 'views/current', 'node_modules'] }, plugins: [ new webpac...
const path = require('path'); const webpack = require('webpack'); module.exports = { module: { rules: [ { test: /\.html$/, use: 'raw-loader' } ] }, resolve: { modules: ['public/js', 'views/current', 'node_modules'] }, plugins: [ new webpa...
Add source maps and uglifyjs
Webpack: Add source maps and uglifyjs
JavaScript
mit
iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher
--- +++ @@ -1,5 +1,5 @@ const path = require('path'); -const webpack = require('webpack') +const webpack = require('webpack'); module.exports = { module: { @@ -17,11 +17,13 @@ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" - }) + }), + new webpack.optimize.U...
811816ad35cda5c1baa16d00ed20276faa052401
webpack.config.js
webpack.config.js
var webpack = require("webpack"); /* eslint-disable no-undef */ var environment = process.env["NODE_ENV"] || "development"; module.exports = { entry: "./src/game", output: { path: __dirname + "/build", filename: "index.js" }, module: { preLoaders: [ // { test: /\.js$/, exclude: /node_modules/, loader: "e...
var webpack = require("webpack"); /* eslint-disable no-undef */ var environment = process.env["NODE_ENV"] || "development"; module.exports = { entry: "./src/game", output: { path: __dirname + "/build", filename: "index.js" }, module: { preLoaders: [ { test: /\.js$/, exclude: /node_modules/, loader: "esli...
Use eslint inside of webpack
Use eslint inside of webpack
JavaScript
mit
RiseAndShineGames/BugCatcher,RiseAndShineGames/LudumDare35,RiseAndShineGames/Polymorphic,RiseAndShineGames/Polymorphic,RiseAndShineGames/BugCatcher,CaldwellYSR/Bug_Catcher,RiseAndShineGames/LudumDare35,SplatJS/splat-ecs-starter-project,SplatJS/splat-ecs-starter-project,CaldwellYSR/Bug_Catcher
--- +++ @@ -11,7 +11,7 @@ }, module: { preLoaders: [ - // { test: /\.js$/, exclude: /node_modules/, loader: "eslint" } + { test: /\.js$/, exclude: /node_modules/, loader: "eslint-loader" } ], loaders: [ { test: /\.json$/, loader: "json" },
7f52d1670b86f9e750ada848b39a5e94417ed7ff
webpack.config.js
webpack.config.js
var path = require('path'); var CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { entry: [ './js/index.js' ], output: { path: path.join(__dirname, 'dist'), filename: 'app.js' }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, l...
var path = require('path'); var CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { entry: [ './js/index.js' ], output: { path: path.join(__dirname, 'dist'), filename: 'app.js' }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, l...
Use source maps in developer mode.
Use source maps in developer mode.
JavaScript
mit
concord-consortium/portal-report,concord-consortium/portal-report,concord-consortium/portal-report,concord-consortium/portal-report
--- +++ @@ -44,6 +44,7 @@ } ] }, + devtool: "source-map", plugins: [ new CopyWebpackPlugin([ {from: 'public'}
964f13a57f83d8418e8a9b82a0a93b5886862ff8
webpack.config.js
webpack.config.js
module.exports = { entry: { javascript: "./app/app.jsx" }, output: { path: __dirname, filename: "bundle.js" }, resolve: { extensions: ["", ".json", ".js", ".jsx"] }, module: { noParse: [/autoit.js/], loaders: [ { ...
module.exports = { entry: { javascript: "./app/app.jsx" }, output: { path: __dirname, filename: "bundle.js" }, resolve: { extensions: ["", ".json", ".js", ".jsx"] }, module: { noParse: [/autoit.js/], loaders: [ { ...
Fix sourcemap for dev mode
Fix sourcemap for dev mode
JavaScript
apache-2.0
anildigital/ruby-operators,anildigital/ruby-operators
--- +++ @@ -30,5 +30,5 @@ ] }, - devtool: "#inline-source-map" + devtool: 'source-map' }
d151aed6079c78314f2192a551c49d3fbd2e44d5
webpack.config.js
webpack.config.js
'use strict'; const webpack = require('webpack'); const env = process.env.NODE_ENV || 'development'; const isDev = env === 'development'; const devtool = isDev ? '#inline-source-map' : null; const uglify = isDev ? null : new webpack.optimize.UglifyJsPlugin({ output: { comments: false }, compress: { dead_code: ...
'use strict'; const webpack = require('webpack'); const env = process.env.NODE_ENV || 'development'; const isDev = env === 'development'; const devtool = isDev ? '#inline-source-map' : null; const uglify = isDev ? null : new webpack.optimize.UglifyJsPlugin({ output: { comments: false }, compress: { dead_code: ...
Add renderer setting for electron
Add renderer setting for electron
JavaScript
mit
akameco/PixivDeck,akameco/PixivDeck
--- +++ @@ -31,6 +31,7 @@ './renderer/index.js' ], debug: env === 'development', + target: 'electron', devtool, output: { path: `${__dirname}/dist`,
9697b8d10a8312fb9e07009ce62a8e380e68bc76
test/js/organismDetailsSpec.js
test/js/organismDetailsSpec.js
describe("Test the organismDetails file", function() { it("Test for getBestName", function() { expect(getBestName({})).toBe(''); }); });
describe("Test the organismDetails file", function() { it("Test for getBestName on empty set", function() { expect(getBestName({})).toBe(''); }); it("Test for getBestName with only sciname", function() { expect(getBestName({'scientificName': 'Mus musculus'})).toBe('Mus musculus'); expect(getBestName(...
Expand test case for getBestName
Expand test case for getBestName
JavaScript
mit
molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec
--- +++ @@ -1,6 +1,16 @@ describe("Test the organismDetails file", function() { - it("Test for getBestName", function() { + it("Test for getBestName on empty set", function() { + expect(getBestName({})).toBe(''); + }); + it("Test for getBestName with only sciname", function() { + expect(getBestName({'sci...
17455c2529c6dcbbee0fc21c8a89546be9472790
src/ol/colorlike.js
src/ol/colorlike.js
/** * @module ol/colorlike */ import {asString} from './color.js'; /** * @param {ol.Color|ol.ColorLike} color Color. * @return {ol.ColorLike} The color as an ol.ColorLike * @api */ export function asColorLike(color) { if (isColorLike(color)) { return /** @type {string|CanvasPattern|CanvasGradient} */ (col...
/** * @module ol/colorlike */ import {toString} from './color.js'; /** * @param {ol.Color|ol.ColorLike} color Color. * @return {ol.ColorLike} The color as an ol.ColorLike * @api */ export function asColorLike(color) { if (isColorLike(color)) { return /** @type {string|CanvasPattern|CanvasGradient} */ (col...
Use toString instead of asString in asColorLike
Use toString instead of asString in asColorLike To avoid the double `typeof color === 'string'` check
JavaScript
bsd-2-clause
ahocevar/ol3,stweil/openlayers,fredj/ol3,gingerik/ol3,mzur/ol3,openlayers/openlayers,stweil/ol3,oterral/ol3,stweil/openlayers,adube/ol3,ahocevar/ol3,stweil/ol3,geekdenz/ol3,mzur/ol3,fredj/ol3,tschaub/ol3,bjornharrtell/ol3,geekdenz/openlayers,fredj/ol3,geekdenz/openlayers,geekdenz/ol3,stweil/openlayers,tschaub/ol3,oterr...
--- +++ @@ -1,7 +1,7 @@ /** * @module ol/colorlike */ -import {asString} from './color.js'; +import {toString} from './color.js'; /** @@ -13,7 +13,7 @@ if (isColorLike(color)) { return /** @type {string|CanvasPattern|CanvasGradient} */ (color); } else { - return asString(/** @type {ol.Color} *...
83cb7f4c548d02de3d0ef1157e9a412e9a92f1f9
npm/test-lint.js
npm/test-lint.js
#!/usr/bin/env node require('shelljs/global'); require('colors'); var async = require('async'), ESLintCLIEngine = require('eslint').CLIEngine, LINT_SOURCE_DIRS = [ './lib/runner', './lib/authorizer', './lib/uvm/*.js', './lib/backpack', './test/system', './test/u...
#!/usr/bin/env node require('shelljs/global'); require('colors'); var async = require('async'), ESLintCLIEngine = require('eslint').CLIEngine, LINT_SOURCE_DIRS = [ './lib', './test/system', './test/unit', './test/integration', './npm/*.js', './index.js' ]; ...
Add all directories under lib to eslint config
Add all directories under lib to eslint config
JavaScript
apache-2.0
postmanlabs/postman-runtime,postmanlabs/postman-runtime
--- +++ @@ -6,10 +6,7 @@ ESLintCLIEngine = require('eslint').CLIEngine, LINT_SOURCE_DIRS = [ - './lib/runner', - './lib/authorizer', - './lib/uvm/*.js', - './lib/backpack', + './lib', './test/system', './test/unit', './test/integration',
743f896c562cd8cc9089937fc69c2d89e62f2466
src/bin/scry-css.js
src/bin/scry-css.js
#! /usr/bin/env node const program = require('commander') const PipelineRunner = require('../pipeline/runner') program .version('scry-css 0.2.0') .usage('[options] <type> <dir> <file...>') .option('-r --reporter [reporter]', 'Reporter', /^(console|json)$/i) .parse(process.argv) if (!program.args.length) { ...
#! /usr/bin/env node const program = require('commander') const PipelineRunner = require('../pipeline/runner') program .version('scry-css 0.2.1') .usage('[options] <type> <dir> <file...>') .option( '-r --reporter [reporter]', 'reporter (json/console), defaults to console', /^(console|json)$/i ) .par...
Fix version and improve help message.
Fix version and improve help message.
JavaScript
mit
ovidiubute/scry-css
--- +++ @@ -4,9 +4,12 @@ const PipelineRunner = require('../pipeline/runner') program - .version('scry-css 0.2.0') + .version('scry-css 0.2.1') .usage('[options] <type> <dir> <file...>') - .option('-r --reporter [reporter]', 'Reporter', /^(console|json)$/i) + .option( + '-r --reporter [reporter]', + ...
6a654de28eee0b37505e7623ddffcd3d1164a07d
middleware/index.js
middleware/index.js
var fs = require('fs'), path = require('path') files = fs.readdirSync(__dirname); // load in each file within this directory and attach it to exports files.forEach(function(file) { var name = path.basename(file, '.js'); if (name === 'index') return; module.exports[name] = require('./' + name); });
var fs = require('fs'), path = require('path') files = fs.readdirSync(__dirname); // load in each file within this directory and attach it to exports files.forEach(function(file) { var name = path.basename(file, '.js'), regex = new RegExp(/^_/); if (name === 'index' || name.match(regex) !== null) { ...
Update middleware loader to ignore any files with a leading '_'.
Update middleware loader to ignore any files with a leading '_'.
JavaScript
mit
linzjs/linz,linzjs/linz,linzjs/linz
--- +++ @@ -4,10 +4,13 @@ // load in each file within this directory and attach it to exports files.forEach(function(file) { - - var name = path.basename(file, '.js'); - - if (name === 'index') return; + + var name = path.basename(file, '.js'), + regex = new RegExp(/^_/); + + if (name === 'index' || name...
763798205711ef7b14876f47cda4dd63aaf21427
devmgmtV2/index.js
devmgmtV2/index.js
"use strict" let express = require("express"); let bodyParser = require('body-parser'); let cors = require('cors'); let app = express(); let { exec } = require('child_process') app.use(cors()) // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // parse application/json app...
"use strict" let express = require("express"); let bodyParser = require('body-parser'); let cors = require('cors'); let app = express(); let { exec } = require('child_process') app.use(cors()) // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: true })); // parse application/json app...
Fix init scripts and add NODE_PATH
Fix init scripts and add NODE_PATH
JavaScript
mit
projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP
--- +++ @@ -26,12 +26,21 @@ console.log(err); else { console.log("server running on port 8080"); - exec('mysql -u root -p < ./init.sql', (err, stdout, stderr) => { + exec('mysql -u root -proot < ./init.sql', (err, stdout, stderr) => { if (err) { + console.log...
f1e796076afa93d9f8a4e0b44434cd20695f3e29
template/_footer.js
template/_footer.js
// Expose Raven to the world window.Raven = Raven; })(window);
// Expose Raven to the world if (typeof define === 'function' && define.amd) { define(function() { return Raven; }); } else { window.Raven = Raven; } })(this);
Make Raven compatible with CommonJS
Make Raven compatible with CommonJS
JavaScript
bsd-3-clause
samgiles/raven-js,clara-labs/raven-js,PureBilling/raven-js,grelas/raven-js,danse/raven-js,getsentry/raven-js,danse/raven-js,getsentry/raven-js,samgiles/raven-js,benoitg/raven-js,eaglesjava/raven-js,housinghq/main-raven-js,getsentry/raven-js,vladikoff/raven-js,clara-labs/raven-js,Mappy/raven-js,hussfelt/raven-js,iodine/...
--- +++ @@ -1,4 +1,9 @@ + // Expose Raven to the world -window.Raven = Raven; +if (typeof define === 'function' && define.amd) { + define(function() { return Raven; }); +} else { + window.Raven = Raven; +} -})(window); +})(this);
61506b4ba4eb6ed3aadb5a02d802a92dfd520d36
client/src/components/main/index.js
client/src/components/main/index.js
import React, { Component } from 'react'; import { connect } from 'react-redux' import SearchBar from 'material-ui-search-bar' import _ from 'lodash' import './index.css' import SearchResults from '../searchresults' import { searchTomos } from '../../redux/ducks/tomos' class Main extends Component { onChange = (se...
import React, { Component } from 'react'; import { connect } from 'react-redux' import SearchBar from 'material-ui-search-bar' import _ from 'lodash' import './index.css' import SearchResults from '../searchresults' import { searchTomos } from '../../redux/ducks/tomos' class Main extends Component { constructor(pr...
Load all datasets by default
Load all datasets by default
JavaScript
bsd-3-clause
OpenChemistry/materialsdatabank,OpenChemistry/materialsdatabank,OpenChemistry/materialsdatabank,OpenChemistry/materialsdatabank
--- +++ @@ -9,6 +9,18 @@ class Main extends Component { + constructor(props) + { + super(props) + this.state = { + searchText: null + } + } + + componentWillMount = () => { + this.props.dispatch(searchTomos()); + } + onChange = (searchText) => { this.setState({ searchText @@ ...
4ae5004078a0e79ce44b61f8f63d88cb87c6fab2
toc_view.js
toc_view.js
"use strict"; var View = require("substance-application").View; var $$ = require("substance-application").$$; var Data = require("substance-data"); var Index = Data.Graph.Index; var _ = require("underscore"); // Substance.TOC.View // ========================================================================== var TOCV...
"use strict"; var View = require("substance-application").View; var $$ = require("substance-application").$$; var Data = require("substance-data"); var Index = Data.Graph.Index; var _ = require("underscore"); // Substance.TOC.View // ========================================================================== var TOCV...
Read document structure dynamically to be able to react on structural changes.
Read document structure dynamically to be able to react on structural changes.
JavaScript
mit
substance/toc
--- +++ @@ -13,14 +13,6 @@ View.call(this); this.docCtrl = docCtrl; - // Sniff into headings - // -------- - // - - this.headings = _.filter(this.docCtrl.getNodes(), function(node) { - return node.type === "heading"; - }); - this.$el.addClass("toc"); }; @@ -31,6 +23,10 @@ this.render = func...
bf6d7c1082b2a9c7e80fdce81f2b3c159f4bc61a
custom/loggers/winston/index.js
custom/loggers/winston/index.js
//Winston Logger Module const winston = require('winston'); let logLevel = "info"; //default if (process.env.NODE_ENV === "production") { logLevel = "error"; //logs error } else if (process.env.NODE_ENV === "staging") { logLevel = "info"; //logs info and error } const logger = new winston.Logger({ transpo...
//Winston Logger Module const winston = require('winston'); let logLevel = "info"; //default if (process.env.NODE_ENV === "production") { logLevel = "error"; //logs error } else if (process.env.NODE_ENV === "staging") { logLevel = "info"; //logs info and error } const logger = new winston.Logger({ transpo...
Disable file logging by default
Disable file logging by default
JavaScript
bsd-3-clause
renonick87/sdl_server,smartdevicelink/sdl_server,smartdevicelink/sdl_server,smartdevicelink/sdl_server,renonick87/sdl_server
--- +++ @@ -16,11 +16,13 @@ timestamp: true, level: logLevel }), + /* new winston.transports.File({ //write logs to a file as well level: logLevel, name: 'policy_logs', filename: 'policy_logs.log' }) + */ ],...
a27f39fbdb3a23d2d4a8264bfa4f3ee4f7b2c701
lib/commands/ember-cli-yuidoc.js
lib/commands/ember-cli-yuidoc.js
'use strict'; var Y = require('yuidocjs'); var rsvp = require('rsvp'); var optsGenerator = require('../options'); module.exports = { name: 'ember-cli-yuidoc', description: 'Generates html documentation using YUIDoc', run: function(opts, rawArgs) { var options = optsGenerator.generate(...
'use strict'; module.exports = { name: 'ember-cli-yuidoc', description: 'Generates html documentation using YUIDoc', run: function(opts, rawArgs) { var Y = require('yuidocjs'); var rsvp = require('rsvp'); var optsGenerator = require('../options'); var options = optsG...
Move require statements to the run command
Move require statements to the run command Yuidoc now requires an internet connection to work, and since this addon is required even if you're not using it at the moment, it was preventing users to work offline. TODO: Fix yuidoc itself. Having local assets would also fix #14
JavaScript
mit
cibernox/ember-cli-yuidoc,cibernox/ember-cli-yuidoc,mixonic/ember-cli-yuidoc,mixonic/ember-cli-yuidoc,greyhwndz/ember-cli-yuidoc,greyhwndz/ember-cli-yuidoc,VladimirTyrin/ember-cli-yuidoc,VladimirTyrin/ember-cli-yuidoc
--- +++ @@ -1,8 +1,5 @@ 'use strict'; -var Y = require('yuidocjs'); -var rsvp = require('rsvp'); -var optsGenerator = require('../options'); module.exports = { name: 'ember-cli-yuidoc', @@ -10,7 +7,10 @@ description: 'Generates html documentation using YUIDoc', run: function(opts...
70b48677ffeb89bdc83cfd6dd0e645a613d2593c
website/src/components/Home.js
website/src/components/Home.js
import React from 'react'; import LoadingContainer from '../containers/LoadingContainer'; import PathResultsContainer from '../containers/PathResultsContainer'; import ErrorMessageContainer from '../containers/ErrorMessageContainer'; import SearchButtonContainer from '../containers/SearchButtonContainer'; import ToArt...
import React from 'react'; import LoadingContainer from '../containers/LoadingContainer'; import PathResultsContainer from '../containers/PathResultsContainer'; import ErrorMessageContainer from '../containers/ErrorMessageContainer'; import SearchButtonContainer from '../containers/SearchButtonContainer'; import ToArt...
Fix wrong input component order
Fix wrong input component order
JavaScript
mit
jwngr/sdow,jwngr/sdow,jwngr/sdow,jwngr/sdow
--- +++ @@ -17,9 +17,9 @@ <MainContent> <P>Find the shortest paths from</P> <InputFlexContainer> + <FromArticleInputContainer /> + <P style={{margin: '20px 24px'}}>to</P> <ToArticleInputContainer /> - <P style={{margin: '20px 24px'}}>to</P> - <FromArticleInputCo...
6adaa4847545b2ba7564bfc952a542d1ac9d5629
web/static/codesearch.js
web/static/codesearch.js
"use strict"; var Codesearch = function() { return { socket: null, delegate: null, connect: function(delegate) { if (Codesearch.socket !== null) return; console.log("Connecting..."); Codesearch.remote = null; Codesearch.delegate = delegate; var socket = io.connect(doc...
"use strict"; var Codesearch = function() { return { socket: null, delegate: null, connect: function(delegate) { if (Codesearch.socket !== null) return; console.log("Connecting..."); Codesearch.remote = null; Codesearch.delegate = delegate; var socket = io.connect("ht...
Use a full URL for socket.io.
Use a full URL for socket.io.
JavaScript
bsd-2-clause
lekkas/livegrep,paulproteus/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,paulproteus/livegrep,wfxiang08/livegrep,lekkas/livegrep,lekkas/livegrep,lekkas/livegrep,lekkas/livegrep,paulproteus/livegrep,paulproteus/livegrep,lekkas/livegrep,paulproteus/livegrep,paulproteus/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,wfx...
--- +++ @@ -9,7 +9,7 @@ console.log("Connecting..."); Codesearch.remote = null; Codesearch.delegate = delegate; - var socket = io.connect(document.location.host.replace(/:\d+$/, '') + ":8910"); + var socket = io.connect("http://" + document.location.host.replace(/:\d+$/, '') + ":8910");...
6a04d1e2fee23066f9647a4caa38bea3395a4bf2
tools/pre-commit.js
tools/pre-commit.js
'use strict'; var exec = require('child_process').exec; function fail() { process.stdout.write( 'Style check failed (see the above output).\n' + 'If you still wish to commit your code, run git commit -n to skip this check.\n' ); process.exit(1); } exec('git diff --staged --name-status', function (error, stdou...
'use strict'; var exec = require('child_process').exec; var path = require('path'); function fail() { process.stdout.write( 'Style check failed (see the above output).\n' + 'If you still wish to commit your code, run git commit -n to skip this check.\n' ); process.exit(1); } exec('git diff --staged --name-sta...
Convert Unix path to Windows path in jshint command (in node_modules)
Convert Unix path to Windows path in jshint command (in node_modules) Story #103
JavaScript
mit
GooTechnologies/goojs,GooTechnologies/goojs,GooTechnologies/goojs
--- +++ @@ -1,6 +1,7 @@ 'use strict'; var exec = require('child_process').exec; +var path = require('path'); function fail() { process.stdout.write( @@ -26,7 +27,8 @@ process.exit(0); } - var child = exec('node_modules/.bin/jshint --reporter=tools/jshint-reporter.js ' + files.join(' ')); + var command...
70dbfc53eecaa00ffc91c1b4c7dc63ae9a4ac653
test/unit/layout.js
test/unit/layout.js
describe('layout tests', function () { it('Should have MaterialLayout globally available', function () { expect(MaterialLayout).to.be.a('function'); }); it('Should be upgraded to a MaterialLayout successfully', function () { var el = document.createElement('div'); el.innerHTML = '<div...
describe('layout tests', function () { it('Should have MaterialLayout globally available', function () { expect(MaterialLayout).to.be.a('function'); }); it('Should be upgraded to a MaterialLayout successfully', function () { var el = document.createElement('div'); el.innerHTML = '<div...
Update MaterialLayout unit test with chai-jquery
Update MaterialLayout unit test with chai-jquery
JavaScript
apache-2.0
Ubynano/material-design-lite,NaveenNs123/material-design-lite,wonder-coders/material-design-lite,Mannaio/javascript-course,manohartn/material-design-lite,francisco-filho/material-design-lite,Creepypastas/material-design-lite,Ninir/material-design-lite,suman28/material-design-lite,rvanmarkus/material-design-lite,samthor...
--- +++ @@ -15,7 +15,6 @@ parent.appendChild(el); // MaterialLayout.init() expects a parent componentHandler.upgradeElement(el, 'MaterialLayout'); - var upgraded = el.getAttribute('data-upgraded'); - expect(upgraded).to.contain('MaterialLayout'); + expect($(el)).to.have.data('upgraded',...
0cf9aa8f61ccfc3720de7a2d9d017c97c1b79205
filter-truncate.js
filter-truncate.js
/** * Return a truncated version of a string * @param {string} input * @param {integer} length * @param {boolean} killwords * @param {string} end * @return {string} */ PolymerExpressions.prototype.truncate = function (input, length, killwords, end) { var orig = input; lengt...
/** * Return a truncated version of a string * @param {string} input * @param {integer} length * @param {boolean} killwords * @param {string} end * @return {string} */ PolymerExpressions.prototype.truncate = function (input, length, killwords, end) { var orig = input; length = length || 255; if(!...
Add check to ensure truncate does not error
Add check to ensure truncate does not error - check if input exists before acting on it - silences thrown error - spirit of template filter, do nothing rather than fail if input is incorrect
JavaScript
apache-2.0
addyosmani/polymer-filters,eumendoza/polymer-filters,addyosmani/polymer-filters,eumendoza/polymer-filters
--- +++ @@ -1,15 +1,17 @@ /** * Return a truncated version of a string - * @param {string} input - * @param {integer} length - * @param {boolean} killwords - * @param {string} end - * @return {string} + * @param {string} input + * @param {integer} length + * @param {boolean} killw...
94e178e8e3cea8c4f0ebd32b7b47ffea9da6ee78
src/RowSizeControls/index.js
src/RowSizeControls/index.js
import React, { Component } from 'react'; class RowSizeControls extends Component { render() { return ( <div style={{textAlign: 'center'}}> <label>Images per row</label> <input style={{ display: 'block', margin: '0 auto', }} type="range"...
import React, { Component } from 'react'; class RowSizeControls extends Component { render() { return ( <div style={{textAlign: 'center'}}> <label>{this.props.value} images per row</label> <input style={{ display: 'block', margin: '0 auto', }} ...
Add rowLength to slider label
Add rowLength to slider label
JavaScript
mit
stevula/gallery,stevula/gallery
--- +++ @@ -4,7 +4,7 @@ render() { return ( <div style={{textAlign: 'center'}}> - <label>Images per row</label> + <label>{this.props.value} images per row</label> <input style={{ display: 'block', @@ -15,7 +15,6 @@ max="10" value={thi...
6053b42bcf2d2cfe9604f9923b06b9a0151f3b15
lib/index.js
lib/index.js
'use strict'; module.exports = function(html, attachments) { attachments.forEach(function(attachment) { attachment.applied = false; var regexps = [ (attachment.fileName) ? new RegExp('<img[^>]*cid:' + attachment.fileName + '[@"\'][^>]*>', 'ig') : undefined, (attachment.contentId) ? new RegExp('<...
'use strict'; module.exports = function(html, attachments) { attachments.forEach(function(attachment) { attachment.applied = false; var regexps = [ (attachment.fileName) ? new RegExp('<img[^>]*cid:' + attachment.fileName.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&") + '[@"\'][^>]*>', 'ig') : undefine...
Fix a bug in removing cid img without attachments
Fix a bug in removing cid img without attachments
JavaScript
mit
AnyFetch/npm-cid
--- +++ @@ -5,8 +5,8 @@ attachment.applied = false; var regexps = [ - (attachment.fileName) ? new RegExp('<img[^>]*cid:' + attachment.fileName + '[@"\'][^>]*>', 'ig') : undefined, - (attachment.contentId) ? new RegExp('<img[^>]*cid:' + attachment.contentId + '[@"\'][^>]*>', 'ig') : undefined, + ...
f114a28c3c2d724712d992f7a81efa3604bcc224
lib/index.js
lib/index.js
'use strict' const _ = require('lodash') const hasLoop = (flow) => { if (Array.isArray(flow)) { return _validate(flow) } else if (flow.states) { return _validate(flow.states) } return { status: "error", message: "Flow not found!" } } const _validate = (states) => { const paths = states.r...
'use strict' const _ = require('lodash') const hasLoop = (flow) => { if (Array.isArray(flow)) { return _validate(flow) } else if (flow.states) { return _validate(flow.states) } return { status: "error", message: "Flow not found!" } } const _validate = (states) => { const paths = states.r...
Fix return acc when not push a state
[UPDATE] Fix return acc when not push a state
JavaScript
mit
josemanu/flowx-loop-validator
--- +++ @@ -19,8 +19,8 @@ const paths = states.reduce((acc, state) => { if (state.automatic) { acc.push({ from: state.name, to: state.transitions[0].to }) - return acc } + return acc }, []) while (paths.length > 0) {
28a68feafafc98c1fa981751785c4319fd64ac60
lib/index.js
lib/index.js
var debug = require('debug')('metalsmith-copy'), path = require('path'), cloneDeep = require('lodash').cloneDeep; minimatch = require('minimatch'); module.exports = plugin; function plugin(options) { return function(files, metalsmith, done) { if (!options.directory && !options.extension && !options....
var debug = require('debug')('metalsmith-copy'), path = require('path'), cloneDeep = require('lodash').cloneDeep, minimatch = require('minimatch'); module.exports = plugin; function plugin(options) { return function(files, metalsmith, done) { if (!options.directory && !options.extension && !options....
Fix imports that broke when running in strict mode
Fix imports that broke when running in strict mode The badly place semicolon triggered "undefined variable" errors.
JavaScript
mit
mattwidmann/metalsmith-copy
--- +++ @@ -1,6 +1,6 @@ var debug = require('debug')('metalsmith-copy'), path = require('path'), - cloneDeep = require('lodash').cloneDeep; + cloneDeep = require('lodash').cloneDeep, minimatch = require('minimatch'); module.exports = plugin;
ffcf2e2ff94d8abc2e2b047ccd975be7449ee198
lib/index.js
lib/index.js
var easymongo = require('easymongo'); module.exports = function(options) { var mongo = new easymongo(options); return { find: function(collection, params, options) { return function(fn) { mongo.find(collection, params, options, fn); }; }, save: function(collection, params) { ...
var EasyMongo = require('easymongo'); module.exports = function(server, options) { var mongo = new EasyMongo(server, options); return { find: function(table, params, options) { return function(fn) { mongo.find(table, params, options, fn); }; }, findById: function(table, id) { ...
Add constructor arguments. Fix deprecated API. Add findById, removeById and count methods.
Add constructor arguments. Fix deprecated API. Add findById, removeById and count methods.
JavaScript
mit
meritt/co-easymongo
--- +++ @@ -1,24 +1,42 @@ -var easymongo = require('easymongo'); +var EasyMongo = require('easymongo'); -module.exports = function(options) { - var mongo = new easymongo(options); +module.exports = function(server, options) { + var mongo = new EasyMongo(server, options); return { - find: function(collecti...
6c527183631acd6398ed279cb2f054a8672600c1
tests/specs/extensible/auto-transport/main.js
tests/specs/extensible/auto-transport/main.js
seajs.on('compiled', function(mod) { if (mod.uri.indexOf('jquery.js') > -1) { window.jQuery = window.$ = mod.exports } }) seajs.on('compile', function(mod) { if (mod.uri.indexOf('cookie.js') > -1) { mod.exports = $.cookie } }) seajs.config({ preload: ['./auto-transport/jquery'] }).use('./auto-trans...
seajs.on('compiled', function(mod) { if (mod.uri.indexOf('jquery.js') > -1) { global.jQuery = global.$ = mod.exports } }) seajs.on('compile', function(mod) { if (mod.uri.indexOf('cookie.js') > -1) { mod.exports = $.cookie } }) seajs.config({ preload: ['./auto-transport/jquery'] }).use('./auto-trans...
Change window to global for Node.js
Change window to global for Node.js
JavaScript
mit
coolyhx/seajs,yern/seajs,longze/seajs,MrZhengliang/seajs,lee-my/seajs,baiduoduo/seajs,liupeng110112/seajs,ysxlinux/seajs,yern/seajs,angelLYK/seajs,wenber/seajs,evilemon/seajs,wenber/seajs,miusuncle/seajs,lee-my/seajs,yuhualingfeng/seajs,LzhElite/seajs,121595113/seajs,judastree/seajs,wenber/seajs,twoubt/seajs,eleanors/S...
--- +++ @@ -1,7 +1,7 @@ seajs.on('compiled', function(mod) { if (mod.uri.indexOf('jquery.js') > -1) { - window.jQuery = window.$ = mod.exports + global.jQuery = global.$ = mod.exports } })
1610d0389c7e0a7a10988d191e6dd3a08ea8712d
src/js/modules_enabled.js
src/js/modules_enabled.js
/*=include modules/accessor.js */ /*=include modules/ajax.js */ /*=include modules/calculation_colums.js */ /*=include modules/clipboard.js */ /*=include modules/download.js */ /*=include modules/edit.js */ /*=include modules/filter.js */ /*=include modules/format.js */ /*=include modules/frozen_columns.js */ /*=includ...
/*=include modules/accessor.js */ /*=include modules/ajax.js */ /*=include modules/calculation_colums.js */ /*=include modules/clipboard.js */ /*=include modules/download.js */ /*=include modules/edit.js */ /*=include modules/filter.js */ /*=include modules/format.js */ /*=include modules/frozen_columns.js */ /*=includ...
Fix improper case from 'KeyBindings' to keybindings causing build failures on linux.
Fix improper case from 'KeyBindings' to keybindings causing build failures on linux.
JavaScript
mit
olifolkerd/tabulator
--- +++ @@ -11,7 +11,7 @@ /*=include modules/group_rows.js */ /*=include modules/history.js */ /*=include modules/html_table_import.js */ -/*=include modules/Keybindings.js */ +/*=include modules/keybindings.js */ /*=include modules/moveable_columns.js */ /*=include modules/moveable_rows.js */ /*=include module...
0a2be4064b2ec75d428f55861f2c8d35727a0ee5
lib/tools.js
lib/tools.js
var tools = module.exports = exports = {}, debug = require('debug')('turnkey'); tools.default_cfg = function() { var cfg = { // Required Options -------------------------------------------------------- router: undefined, /* Express JS Router */ model: undefined, /* Mongoose model */ ...
var tools = module.exports = exports = {}, debug = require('debug')('turnkey'); tools.default_cfg = function() { var cfg = { // Required Options -------------------------------------------------------- router: undefined, /* Express JS Router */ model: undefined, /* Mongoose model */ ...
Modify default deserialize user function
Modify default deserialize user function
JavaScript
mit
uhray/turnkey
--- +++ @@ -17,10 +17,7 @@ forgot_limit: 1000 * 60 * 60, // 1 hour deserialize: function(id, cb) { - cfg.model.findOne({ _id: id }, function(e, d) { - d = (d && d.toJSON) ? d.toJSON({ getters: true }) : d; - cb(e, d); - }); + cfg.model.findById(id).lean().exec(cb); }, ...
038c140deb2618833172bd48c59adb7f21e49205
gulp/tasks/configure.sandbox.js
gulp/tasks/configure.sandbox.js
'use strict'; const gulp = require('gulp'); const helper = require('gulp/helper'); gulp.task('configure:sandbox', cb => { const isNotEmpty = helper.validators.isNotEmpty; const questions = [ { type: 'input', name: 'url', message: 'What is your Profile URL address?', default: 'https://w...
'use strict'; const gulp = require('gulp'); const helper = require('gulp/helper'); gulp.task('configure:sandbox', cb => { const isNotEmpty = helper.validators.isNotEmpty; const questions = [ { type: 'input', name: 'url', message: 'What is your Profile URL address?', default: 'https://w...
Use 'password' type for a field with a token value.
Use 'password' type for a field with a token value.
JavaScript
mit
radekk/webtask-mfa-monitor,radekk/mfa-monitor,radekk/webtask-tfa-monitor
--- +++ @@ -20,7 +20,7 @@ validate: isNotEmpty }, { - type: 'input', + type: 'password', name: 'token', message: 'What is your token value?', validate: isNotEmpty
9dcfc85a24e0ea81397c7a7541375d6f8aac98a3
src/es6/Machete.js
src/es6/Machete.js
export class Machete { // TODO: Implement polyfills /** * Utility function to get an element from the DOM. * It is needed because everytime we get an element from the DOM, * we reset its style to make sure code works as needed. * @param string selector CSS selector * @return Elem...
export class Machete { // TODO: Implement polyfills /** * Utility function to get an element from the DOM. * It is needed because everytime we get an element from the DOM, * we reset its style to make sure code works as needed. * @param string selector CSS selector * @return Elem...
Split DOM element selection and style reset
machete: Split DOM element selection and style reset
JavaScript
mpl-2.0
Technohacker/machete
--- +++ @@ -9,8 +9,11 @@ * @return Element Selected element */ static getDOMElement(selector) { - let element = document.querySelector(selector), - style = window.getComputedStyle(element); + return Machete.resetStyles(document.querySelector(selector)); + } + ...
263f22fb4a56ede32e07f455db8a0e5a02e5dab2
.eslintrc.js
.eslintrc.js
/* eslint-env node */ module.exports = { root: true, parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true, }, ecmaVersion: 2020, sourceType: 'module', }, plugins: ['@typescript-eslint', 'jest', 'react-hooks', 'prettier'], extends: [ 'eslint:recommended',...
/* eslint-env node */ module.exports = { root: true, parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true, }, ecmaVersion: 2020, sourceType: 'module', }, plugins: ['@typescript-eslint', 'jest', 'react-hooks', 'prettier'], extends: [ 'eslint:recommended',...
Use updated prettier ESLint config
Use updated prettier ESLint config
JavaScript
mit
hugo/hugo.github.com,hugo/hugo.github.com
--- +++ @@ -17,7 +17,7 @@ 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', - 'prettier/react', + 'prettier', ], settings: { react: {
f581907321b60c1bfc0db9dff09b9028a8b7f0f6
src/styles/theme.js
src/styles/theme.js
const theme = { color: { grey: '#DDDDDD', black: '#111111', }, font: { sans: `'Lora', sans-serif`, serif: `'Raleway', serif`, }, }; export default theme;
const theme = { color: { grey: '#DDDDDD', black: '#111111', }, font: { sans: `'Lora', sans-serif`, serif: `'Raleway', serif`, }, sizes: { mobileS: '320px', mobileM: '375px', mobileL: '425px', tablet: '768px', laptop: '1024px', laptopL: '1440px', desktop: '2560px', ...
Add sizes to make it easier @medias
Add sizes to make it easier @medias
JavaScript
mit
raulfdm/cv
--- +++ @@ -7,6 +7,15 @@ sans: `'Lora', sans-serif`, serif: `'Raleway', serif`, }, + sizes: { + mobileS: '320px', + mobileM: '375px', + mobileL: '425px', + tablet: '768px', + laptop: '1024px', + laptopL: '1440px', + desktop: '2560px', + }, }; export default theme;
25a08afe9810fdd9299e5f8a51445344de560e11
src/lib/expand-department.js
src/lib/expand-department.js
const departments = new Map(Object.entries({ AR: 'ART', AS: 'ASIAN', BI: 'BIO', CH: 'CHEM', CS: 'CSCI', EC: 'ECON', ES: 'ENVST', HI: 'HIST', MU: 'MUSIC', PH: 'PHIL', PS: 'PSCI', RE: 'REL', SA: 'SOAN', })) export default function expandDepartment(dept) { if (departments.has(dept)) { return departments.g...
const departments = new Map(Object.entries({ AR: 'ART', AS: 'ASIAN', BI: 'BIO', CH: 'CHEM', CS: 'CSCI', EC: 'ECON', EN: 'ENGL', ES: 'ENVST', HI: 'HIST', MU: 'MUSIC', PH: 'PHIL', PS: 'PSCI', RE: 'REL', SA: 'SOAN', })) export default function expandDepartment(dept) { if (departments.has(dept)) { return ...
Add "EN" as a valid department shorthand
Add "EN" as a valid department shorthand for the EN/LI 250 course.
JavaScript
agpl-3.0
hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook
--- +++ @@ -5,6 +5,7 @@ CH: 'CHEM', CS: 'CSCI', EC: 'ECON', + EN: 'ENGL', ES: 'ENVST', HI: 'HIST', MU: 'MUSIC',
2fd60c6d2599d991c8d05ad101844ea840bc1528
js/style-select.js
js/style-select.js
/* * style-select.js * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js * * Changes the stylesheet chooser links to a <select> * * Released under the MIT license * Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org> * * Usage: * $config['additional_javascript'][] = 'js...
/* * style-select.js * https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js * * Changes the stylesheet chooser links to a <select> * * Released under the MIT license * Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org> * * Usage: * $config['additional_javascript'][] = 'js...
Select chosen stylesheet on load
Select chosen stylesheet on load
JavaScript
mit
kimoi/Tinyboard,savetheinternet/Tinyboard,kimoi/Tinyboard,kimoi/Tinyboard,savetheinternet/Tinyboard,savetheinternet/Tinyboard,kimoi/Tinyboard
--- +++ @@ -19,11 +19,12 @@ var i = 1; stylesDiv.children().each(function() { - stylesSelect.append( - $('<option></option>') - .text(this.innerText.replace(/(^\[|\]$)/g, '')) - .val(i) - ); + var opt = $('<option></option>') + .text(this.innerText.replace(/(^\[|\]$)/g, '')) + .val(i); + if ($(...
e661eea9ec561302f48d24dd6b8ed05d262240ad
add-jira-links-to-description.js
add-jira-links-to-description.js
(() => { const $input = document.querySelector('#pull_request_body'); if (!$input || $input.textLength > 0) { return; } jiraLinks = []; document.querySelectorAll('.commit-message').forEach((commitMessage) => { commitMessage.textContent.match(/BSD-\d+/g).forEach((jiraId) => { jiraLinks.push(`[${...
(() => { const $title = document.querySelector('#pull_request_title'); const $description = document.querySelector('#pull_request_body'); if (!$title || !$description) { return; } const idSet = new Set() document.querySelectorAll('.commit-message').forEach((commitMessage) => { match = commitMessage...
Fix title handling for multiple tags
Fix title handling for multiple tags
JavaScript
mit
marionm/pivotal-github-chrome,marionm/pivotal-github-chrome
--- +++ @@ -1,17 +1,39 @@ (() => { - const $input = document.querySelector('#pull_request_body'); - if (!$input || $input.textLength > 0) { + const $title = document.querySelector('#pull_request_title'); + const $description = document.querySelector('#pull_request_body'); + if (!$title || !$description) { ...
e67bf05ecc75244b5b54020939f177b715168f70
src/components/Checkbox.js
src/components/Checkbox.js
import React from 'react' export const Checkbox = ({ id, nodes, onToggle }) => { const node = nodes[id] const { key, childIds, checked } = node const handleChange = () => { onToggle(id) } return ( <React.Fragment key={id}> {key && <li> <input type='checkbox' checked={checked...
import React from 'react' export const Checkbox = ({ id, nodes, onToggle }) => { const node = nodes[id] const { key, childIds, checked } = node const handleChange = () => onToggle(id) return ( <React.Fragment key={id}> {key && <li> <input type='checkbox' checked={checked} classNam...
Remove braces for one line functions
Remove braces for one line functions
JavaScript
mit
joelgeorgev/react-checkbox-tree,joelgeorgev/react-checkbox-tree
--- +++ @@ -4,9 +4,7 @@ const node = nodes[id] const { key, childIds, checked } = node - const handleChange = () => { - onToggle(id) - } + const handleChange = () => onToggle(id) return ( <React.Fragment key={id}>
e06d0ff85d4989a0e981fb33f836baef23d1bc3d
app/assets/javascripts/events.js
app/assets/javascripts/events.js
$(document).ready(function() { $('#upload_form').change(function () { $('#upload_form_label').hide(); $('#upload_form').hide(); $('#upload_progress').show(); $('#upload_form').submit(); }); $('#propagate_races').live('ajax:beforeSend', function() { $('#propagate_races').hide(); $('#p...
$(document).ready(function() { $('#upload_form').change(function () { $('#upload_form_label').hide(); $('#upload_form').hide(); $('#upload_progress').show(); $('#upload_form').submit(); }); $('#propagate_races').bind('ajax:beforeSend', function() { $('#propagate_races').hide(); $('#p...
Use jquery-rails bind() in place of live()
Use jquery-rails bind() in place of live()
JavaScript
mit
scottwillson/racing_on_rails,scottwillson/racing_on_rails,scottwillson/racing_on_rails,scottwillson/racing_on_rails
--- +++ @@ -6,12 +6,12 @@ $('#upload_form').submit(); }); - $('#propagate_races').live('ajax:beforeSend', function() { + $('#propagate_races').bind('ajax:beforeSend', function() { $('#propagate_races').hide(); $('#propagate_races_progress').show(); }); - $('#destroy_races').live('ajax:...
73464c8f531da3aa082f681fc263c1debcc7ad3f
app/reducers/modal/index.test.js
app/reducers/modal/index.test.js
import reducer from './'; describe('Modal reducer', () => { let initialState; let state; let actionType; let payload; const callReducer = () => reducer(state, { type: actionType, payload }); beforeEach(() => { initialState = { isOpen: false, modalName: '', modalOptions: {} }; ...
import reducer from './'; describe('Modal reducer', () => { let initialState; let state; let actionType; let payload; const callReducer = () => reducer(state, { type: actionType, payload }); beforeEach(() => { initialState = { isOpen: false, modalName: '', modalOptions: {} }; ...
Use initialState in Modal reducer spec
Use initialState in Modal reducer spec
JavaScript
mit
fs/react-base,fs/react-base,fs/react-base
--- +++ @@ -60,11 +60,7 @@ }); it('returns initial state', () => { - expect(callReducer()).toEqual({ - isOpen: false, - modalName: '', - modalOptions: {} - }); + expect(callReducer()).toEqual(initialState); }); }); });
354ace46a5860a938fb163b316e9c86dc60deae7
build/dev.sugar.js
build/dev.sugar.js
// webpack config file for develop sugar.js module.exports = { 'entry': './src/main/index', 'output': { 'path': './bundle', 'library': 'Sugar', 'libraryTarget': 'umd', 'filename': 'sugar.js' }, 'module': { 'loaders': [ { 'test': /\.js$/, 'exclude': /(node_modules|bower_components)/, 'loade...
// webpack config file for develop sugar.js module.exports = { 'entry': './src/main/index', 'output': { 'path': './bundle', 'library': 'Sugar', 'libraryTarget': 'umd', 'filename': 'sugar.js' }, 'module': { 'loaders': [ { 'test': /\.js$/, 'exclude': /(node_modules|bower_components)/, 'loade...
Change webpack devtool to source-map.
Change webpack devtool to source-map.
JavaScript
mit
tangbc/sugar,tangbc/sugar,tangbc/sugar
--- +++ @@ -20,5 +20,5 @@ } ] }, - 'devtool': 'inline-source-map' + 'devtool': 'source-map' }
c593ba742b86fceb8fdb13a7aac7adfa0ea9a95f
lib/environment.js
lib/environment.js
daysUntilExpiration = function() { var daysToWait = 1; var daysAgo = new Date(); daysAgo.setDate(daysAgo.getDate()-daysToWait); return daysAgo; }
daysUntilExpiration = function() { var daysToWait = 90; var daysAgo = new Date(); daysAgo.setDate(daysAgo.getDate()-daysToWait); return daysAgo; }
Change expiration to 90 days
Change expiration to 90 days
JavaScript
mit
tizol/wework,kaoskeya/wework,BENSEBTI/wework,chrisshayan/wework,num3a/wework,inderpreetsingh/wework,kaoskeya/wework,tizol/wework,EtherCasts/wework,nate-strauser/wework,princesust/wework,princesust/wework,chrisshayan/wework,BENSEBTI/wework,nate-strauser/wework,inderpreetsingh/wework,num3a/wework,EtherCasts/wework
--- +++ @@ -1,5 +1,5 @@ daysUntilExpiration = function() { - var daysToWait = 1; + var daysToWait = 90; var daysAgo = new Date(); daysAgo.setDate(daysAgo.getDate()-daysToWait); return daysAgo;
9de35c415a1cb7d976e674cffe46d9e5fac7f149
web/assets/scripts/index.js
web/assets/scripts/index.js
/** * Created by ogiba on 20.08.2017. */ window.addEventListener("DOMContentLoaded", function () { setupScrollListener(); setupAlertListener(); }); function setupScrollListener() { var navBar = $('#nav-bar'); var titleBar = $('.app-title'); var distance = navBar.offset().top; var titleBarDis...
/** * Created by ogiba on 20.08.2017. */ window.addEventListener("DOMContentLoaded", function () { setupScrollListener(); setupAlertListener(); }); function setupScrollListener() { var navBar = $('#nav-bar'); var titleBar = $('.app-title'); var distance = navBar.offset().top; var titleBarDis...
Fix setting close event error that ocurred when alert was not placed in view
[CookiesInfo] Fix setting close event error that ocurred when alert was not placed in view
JavaScript
bsd-2-clause
ogiba/FamilyTree,ogiba/FamilyTree,ogiba/FamilyTree
--- +++ @@ -23,9 +23,13 @@ } function setupAlertListener() { - $("#cookieInfo").on("close.bs.alert", function () { - updateCookieInfo(); - }); + let cookieALert = $("#cookieInfo"); + + if (cookieALert.length) { + cookieALert.on("close.bs.alert", function () { + updateCookieInf...
1eb106bba3da496ff732ccf02a69e72c43d55e58
client/app/match/match.js
client/app/match/match.js
angular.module( 'moviematch.match', [] ) .controller( 'MatchController', function( $scope, Match ) { $scope.movie = {}; $scope.session = {}; $scope.user = {}; $scope.user.name = "Julie"; $scope.session.name = "Girls Night Out"; $scope.movie = { name: "Gone With The Wind", year: "1939", ratin...
angular.module( 'moviematch.match', [] ) .controller( 'MatchController', function( $scope, Match ) { $scope.movie = {}; $scope.session = {}; $scope.user = {}; $scope.user.name = "Julie"; $scope.session.name = "Girls Night Out"; $scope.movie = { name: "Gone With The Wind", year: "1939", ratin...
Make yes/no function definitions rather than function executions
Make yes/no function definitions rather than function executions
JavaScript
mpl-2.0
RubiginousChanticleer/rubiginouschanticleer,CantillatingZygote/rubiginouschanticleer,RubiginousChanticleer/rubiginouschanticleer,CantillatingZygote/rubiginouschanticleer
--- +++ @@ -22,6 +22,6 @@ cast: "Clark Cable, Vivian Leigh, Thomas Mitchell" } - $scope.yes = Match.sendVote( $scope.session.id, $scope.user.id, $scope.movie.id, true ); - $scope.no = Match.sendVote( $scope.session.id, $scope.user.id, $scope.movie.id, false ); + $scope.yes = function() { Match.sendVote( ...