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
e5d4685e2aec3c40253a62f75b1266024ad3af2f
src/server/config/index.js
src/server/config/index.js
import Joi from 'joi'; import jsonServerConfig from 'config/server.json'; import schema from './schema.js'; class ServerConfig { constructor() { this._jsonConfig = jsonServerConfig; /** * Validate the JSON config */ try { Joi.validate(this._jsonConfig, schema); } catch (e) { co...
import Joi from 'joi'; import jsonServerConfig from 'config/server.json'; import schema from './schema.js'; class ServerConfig { constructor() { /** * Validate the JSON config */ try { this._jsonConfig = Joi.validate(jsonServerConfig, schema).value; } catch (e) { console.error('The ...
Update logger and add config
Update logger and add config
JavaScript
mit
LuudJanssen/plus-min-list,LuudJanssen/plus-min-list,LuudJanssen/plus-min-list
--- +++ @@ -4,13 +4,11 @@ class ServerConfig { constructor() { - this._jsonConfig = jsonServerConfig; - /** * Validate the JSON config */ try { - Joi.validate(this._jsonConfig, schema); + this._jsonConfig = Joi.validate(jsonServerConfig, schema).value; } catch (e) { ...
4d6139bcd9af2b8acd02343330bbbe74bbe7a7a1
lib/config.js
lib/config.js
var fs = require('fs'); module.exports = function(opts) { this.options = opts; if (!opts.handlebars) this.options.handlebars = require('handlebars'); if (opts.template) { var fileData = fs.readFileSync(this.options.template); this.template = this.options.handlebars.compile(fileData.toString(), {noEscap...
var fs = require('fs'); module.exports = function(opts) { var fileData; this.options = opts; if (!opts.handlebars) this.options.handlebars = require('handlebars'); if (opts.template) { try { fileData = fs.readFileSync(this.options.template); } catch (e) { throw new Error('Error loadin...
Throw errors if a template is not set, or if a template can't be loaded
Throw errors if a template is not set, or if a template can't be loaded
JavaScript
mit
spacedoc/spacedoc,gakimball/supercollider,spacedoc/spacedoc
--- +++ @@ -1,13 +1,23 @@ var fs = require('fs'); module.exports = function(opts) { + var fileData; this.options = opts; if (!opts.handlebars) this.options.handlebars = require('handlebars'); if (opts.template) { - var fileData = fs.readFileSync(this.options.template); + try { + fileData ...
a34125408ec298bbe4083ee06db8727a59028688
tests/dummy/app/routes/application.js
tests/dummy/app/routes/application.js
import Ember from 'ember'; export default Ember.Route.extend({ setupController: function() { this.controllerFor( 'pagination' ).get( 'translateService' ).setDictionary( Ember.Object.create({ 'PAGINATION_DISPLAYING' : 'Displaying', 'DEVICE_LIST_PAGINATION_LABEL' : 'Viewing...
import Ember from 'ember'; export default Ember.Route.extend({ setupController: function() { this.controllerFor( 'pagination' ).get( 'translateService' ).setDictionary( Ember.Object.create({ 'PAGINATION_DISPLAYING' : 'Displaying', 'DEVICE_LIST_PAGINATION_LABEL' : 'Viewing...
Tweak grid demo column header text
Tweak grid demo column header text
JavaScript
mit
Suven/sl-ember-components,erangeles/sl-ember-components,theoshu/sl-ember-components,theoshu/sl-ember-components,notmessenger/sl-ember-components,softlayer/sl-ember-components,azizpunjani/sl-ember-components,Suven/sl-ember-components,alxyuu/sl-ember-components,azizpunjani/sl-ember-components,juwara0/sl-ember-components,...
--- +++ @@ -7,8 +7,8 @@ 'DEVICE_LIST_PAGINATION_LABEL' : 'Viewing {0} to {1} of {2} Devices', 'DEVICE_LIST_PAGINATION_PER_PAGE' : ' per page', 'HOSTNAME': 'Hostname', - 'IPADDRESS': 'Ip Address', - 'DEVICETYPE': 'DeviceType', + 'IPADDRESS': 'IP Addr...
9f2af655b2502eaed5f899651ab652f8561c92c2
src/editor.js
src/editor.js
var h = require('html') var Panel = require('panel') function Editor() { this.layersPanel = new Panel(this, 215, h('.layers-panel')) this.inspectorPanel = new Panel(this, 215, h('.inspector-panel')) this.el = h('.editor', [ this.layersPanel.el, h('.canvas'), this.inspectorPanel.el ]) } Editor.pro...
var h = require('html') var Panel = require('panel') function Editor() { this.layersPanel = new Panel(this, 215, h('.layers-panel')) this.inspectorPanel = new Panel(this, 215, h('.inspector-panel')) this.el = h('.editor', [ this.layersPanel.el, h('.canvas'), this.inspectorPanel.el ]) } Editor.pro...
Add parameters to stub loading/saving methods
Add parameters to stub loading/saving methods
JavaScript
unlicense
freedraw/core,freedraw/core
--- +++ @@ -17,11 +17,11 @@ return this } -Editor.prototype.getData = function() { +Editor.prototype.getData = function(type) { throw new Error("Unimplemented") } -Editor.prototype.loadData = function() { +Editor.prototype.loadData = function(type, data) { throw new Error("Unimplemented") }
ead1e86c6edeef2a064d417535b445c11eb18d47
src/renderField.js
src/renderField.js
import React from 'react' export const isRequired = (schema, fieldName) => { if (!schema.required) { return false } return (schema.required.indexOf(fieldName) != 1) } const renderField = (fieldSchema, fieldName, theme, prefix = '') => { const widget = fieldSchema.format || fieldSchema.type || ...
import React from 'react' export const isRequired = (schema, fieldName) => { if (!schema.required) { return false } return (schema.required.indexOf(fieldName) != 1) } const renderField = (fieldSchema, fieldName, theme, prefix = '') => { const widget = fieldSchema.widget || fieldSchema.type || ...
Change format to widget to be more friendly with ajv
Change format to widget to be more friendly with ajv
JavaScript
mit
Limenius/liform-react
--- +++ @@ -8,7 +8,7 @@ } const renderField = (fieldSchema, fieldName, theme, prefix = '') => { - const widget = fieldSchema.format || fieldSchema.type || 'object' + const widget = fieldSchema.widget || fieldSchema.type || 'object' if (!theme[widget]) { throw new Error('liform: ' + widget + ' ...
17caa86e56c41bc5ce4092b1162b6cc5a12aa95f
example/nestedListView/NodeView.js
example/nestedListView/NodeView.js
/* @flow */ import React from 'react' import {TouchableOpacity, View, FlatList} from 'react-native' export default class NodeView extends React.PureComponent { componentWillMount = () => { let rootChildren = this.props.getChildren(this.props.node) if (rootChildren) { rootChildren = rootChildren.m...
/* @flow */ import React from 'react' import {TouchableOpacity, View, FlatList} from 'react-native' export default class NodeView extends React.PureComponent { componentWillMount = () => { let rootChildren = this.props.getChildren(this.props.node) if (rootChildren) { rootChildren = rootChildren.m...
Fix issue in flat list
Fix issue in flat list
JavaScript
mit
fjmorant/react-native-nested-listview,fjmorant/react-native-nested-listview,fjmorant/react-native-nested-listview
--- +++ @@ -18,11 +18,14 @@ } onNodePressed = (node: any) => { - const newState = rootChildren = this.state.data.map((child, index) => { - return this.props.searchTree(this.state.data[index], node) - }) - - this.setState({data: newState}) + if (this.state.data) { + const newState = rootC...
91451bab35e3e683d0c77c71f0ba1dbbf25ac302
app/controllers/account.js
app/controllers/account.js
var express = require('express'), router = express.Router(), passport = require('passport'); module.exports = function (app) { app.use('/account', router); }; router.get('/', function (req, res, next) { console.log('User: ', req); res.render('account', { title: 'Libbie: quickly add books to Goodreads!', user...
var express = require('express'), router = express.Router(), passport = require('passport'); module.exports = function (app) { app.use('/account', router); }; router.get('/', function (req, res, next) { console.log('User: ', req); res.render('account', { title: 'Libbie: quickly add books to Goodreads!', user...
Fix due to removed clientInfo property
Fix due to removed clientInfo property
JavaScript
apache-2.0
Mobius5150/libbie,Mobius5150/libbie
--- +++ @@ -10,7 +10,7 @@ console.log('User: ', req); res.render('account', { title: 'Libbie: quickly add books to Goodreads!', - userName: req.user.clientInfo.displayName, + userName: req.user.displayName, shelves: [ { name: 'Owned books', value: 'owned-books' }, ],
87d77b7bb4a5ee73004c65df99649a491b58df87
test/unit/unit.js
test/unit/unit.js
'use strict'; require.config({ baseUrl: '../lib', paths: { 'test': '..', 'forge': 'forge.min', 'stringencoding': 'stringencoding.min' }, shim: { sinon: { exports: 'sinon', } } }); // add function.bind polyfill if (!Function.prototype.bind) { ...
'use strict'; require.config({ baseUrl: '../lib', paths: { 'test': '..', 'forge': 'forge.min', 'stringencoding': 'stringencoding.min' } }); // add function.bind polyfill if (!Function.prototype.bind) { Function.prototype.bind = function(oThis) { if (typeof this !== "fun...
Remove useless sinon require shim
Remove useless sinon require shim
JavaScript
mit
whiteout-io/smtpclient,huangxok/smtpclient,huangxok/smtpclient,emailjs/emailjs-smtp-client,whiteout-io/smtpclient,emailjs/emailjs-smtp-client
--- +++ @@ -6,11 +6,6 @@ 'test': '..', 'forge': 'forge.min', 'stringencoding': 'stringencoding.min' - }, - shim: { - sinon: { - exports: 'sinon', - } } });
7ff6cd7e5b3993c62151f1ae57e146bbc9d2a13f
model/Post.js
model/Post.js
/*jslint eqeq: true, indent: 2, node: true, plusplus: true, regexp: true, unparam: true, vars: true, nomen: true */ 'use strict'; var Schema = require('mongoose').Schema; /** * The article schema. */ var PostSchema = new Schema({ type: {type: Number, 'default': 0}, authorId: String, catalogId: {type: String, ...
/*jslint eqeq: true, indent: 2, node: true, plusplus: true, regexp: true, unparam: true, vars: true, nomen: true */ 'use strict'; var Schema = require('mongoose').Schema; /** * The article schema. */ var PostSchema = new Schema({ type: {type: Number, 'default': 0}, authorId: String, catalogId: {type: String, ...
Fix wrong type for title in post model.
Fix wrong type for title in post model.
JavaScript
bsd-3-clause
neuola/neuola-data
--- +++ @@ -11,7 +11,7 @@ authorId: String, catalogId: {type: String, ref: 'Catalog'}, tags: [String], - title: Number, + title: String, content: String, date: {type: Date, 'default': Date.now} });
c13ba4cb8088fa883c7e399715608b2e16fed77c
karma.conf.js
karma.conf.js
module.exports = function(config) { config.set({ frameworks: ['mocha'], exclude: ['build/test/external.spec.js'], files: [ 'vendor/es5-shim.js', 'vendor/es5-sham.js', 'vendor/rsvp.js', 'vendor/unexpected-magicpen.min.js', 'build/test/promisePolyfill.js', 'unexpected.j...
module.exports = function(config) { config.set({ frameworks: ['mocha'], exclude: ['build/test/external.spec.js'], files: [ 'vendor/es5-shim.js', 'vendor/es5-sham.js', 'vendor/rsvp.js', 'vendor/unexpected-magicpen.min.js', 'build/test/promisePolyfill.js', 'unexpected.j...
Use the progress reporter for karma
Use the progress reporter for karma
JavaScript
mit
unexpectedjs/unexpected
--- +++ @@ -28,6 +28,8 @@ base: 'ChromeHeadless', flags: ['--no-sandbox'] } - } + }, + + reporters: ['progress'] }); };
6a38487871bbfe84b915eac40bcb82a7bf742cb3
tilt-client/spec/sock_spec.js
tilt-client/spec/sock_spec.js
describe('Sock object', function() { var socket; var pong; var joinRoom; beforeEach(function() { }); afterEach(function() { }); it('should exist', function() { expect(window.Tilt.Sock).toBeDefined(); }); it('should connect and return a new sock object', function() { expect(window.Tilt.con...
describe('Sock object', function() { var socket; var pong; var joinRoom; beforeEach(function() { }); afterEach(function() { }); it('should exist', function() { expect(window.Tilt.Sock).toBeDefined(); }); it('should connect and return a new sock object', function() { expect(window.Tilt.con...
Add a test for controllers
Add a test for controllers
JavaScript
mit
tilt-js/tilt.js
--- +++ @@ -25,4 +25,14 @@ expect(emits[emits.length - 1]).toEqual(['msg', 'cntID', ['msgname', 'argblah']]); }); }); + + describe('for controllers', function() { + it('should emit messages', function() { + var s = window.Tilt.connect('10.0.0.1', 'gameidhere'); + + s.emit('msgname', 'argb...
a387535d2d6fdc1d6391ce46f2de98e08209fea1
static/js/feature_flags.js
static/js/feature_flags.js
var feature_flags = (function () { var exports = {}; exports.mark_read_at_bottom = true; exports.summarize_read_while_narrowed = true; exports.twenty_four_hour_time = _.contains([], page_params.email); exports.dropbox_integration = page_params.staging || _.contains(['dropbox.com'], ...
var feature_flags = (function () { var exports = {}; exports.mark_read_at_bottom = true; exports.summarize_read_while_narrowed = true; exports.twenty_four_hour_time = _.contains([], page_params.email); exports.dropbox_integration = page_params.staging || _.contains(['dropbox.com'], ...
Enable muting for internal MIT users.
Enable muting for internal MIT users. (imported from commit 82dc8c620c5f9af5b7a366bd16aee9125b9ba634)
JavaScript
apache-2.0
MayB/zulip,fw1121/zulip,peguin40/zulip,stamhe/zulip,brainwane/zulip,vikas-parashar/zulip,voidException/zulip,ericzhou2008/zulip,mahim97/zulip,babbage/zulip,souravbadami/zulip,easyfmxu/zulip,proliming/zulip,bssrdf/zulip,qq1012803704/zulip,xuanhan863/zulip,voidException/zulip,alliejones/zulip,guiquanz/zulip,yocome/zulip,...
--- +++ @@ -26,7 +26,12 @@ exports.alert_words = _.contains(['reddit.com', 'mit.edu', 'zulip.com'], page_params.domain); -exports.muting = page_params.staging; + +var zulip_mit_emails = []; + +var is_zulip_mit_user = _.contains(zulip_mit_emails, page_params.email); + +exports.muting = page_params.staging || is_...
de7b6aed2c248de3bcedc7f6b2ceba2d6de7558d
.eslintrc.js
.eslintrc.js
module.exports = { env: { browser: true, es6: true, }, globals: { afterEach: true, beforeEach: true, chrome: true, expect: true, jest: true, beforeEach: true, afterEach: true, describe: true, test: true, }, extends: [ 'eslint:recommended', 'plugin:flowtype/r...
module.exports = { env: { browser: true, es6: true, }, globals: { afterEach: true, beforeEach: true, chrome: true, describe: true, expect: true, jest: true, test: true, }, extends: [ 'eslint:recommended', 'plugin:flowtype/recommended', 'plugin:react/recommended'...
Remove duplicate keys in eslint `globals`
Remove duplicate keys in eslint `globals`
JavaScript
mit
jacobSingh/tabwrangler,tabwrangler/tabwrangler,tabwrangler/tabwrangler,tabwrangler/tabwrangler,jacobSingh/tabwrangler
--- +++ @@ -7,11 +7,9 @@ afterEach: true, beforeEach: true, chrome: true, + describe: true, expect: true, jest: true, - beforeEach: true, - afterEach: true, - describe: true, test: true, }, extends: [
aa9c0c1abbcec19a1c7d179f262f228977637e88
.eslintrc.js
.eslintrc.js
module.exports = { "env": { "node": true }, "extends": "eslint:recommended", "rules": { "indent": [ "error", 2 ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "single" ], "semi": [ "error", "always" ] } };
module.exports = { "env": { "es6": true, "node": true }, "extends": "eslint:recommended", "rules": { "indent": [ "error", 2 ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "single" ], "semi": [ "error", "always" ...
Enable ES6 support for const
Enable ES6 support for const
JavaScript
mit
raszi/node-tmp,raszi/node-tmp,coldrye-collaboration/node-tmp
--- +++ @@ -1,5 +1,6 @@ module.exports = { "env": { + "es6": true, "node": true }, "extends": "eslint:recommended",
54457cc5cde30a6f0647dd6603d328c3a04e72cb
.eslintrc.js
.eslintrc.js
module.exports = { 'env': { 'commonjs': true, 'es6': true, 'node': true, 'browser': true, 'jest': true, 'mocha': true, 'jasmine': true, }, 'extends': 'eslint:recommended', 'parser': 'babel-eslint', 'parserOptions': { 'sourceType': 'module' }, 'rules': { 'no-console': 0,...
module.exports = { plugins: [ 'html' ], 'env': { 'commonjs': true, 'es6': true, 'node': true, 'browser': true, 'jest': true, 'mocha': true, 'jasmine': true, }, 'extends': 'eslint:recommended', 'parser': 'babel-eslint', 'parserOptions': { 'sourceType': 'module' }, 'r...
Add eslint-plugin-html to config file
Add eslint-plugin-html to config file
JavaScript
mpl-2.0
mozilla-iot/gateway,moziot/gateway,mozilla-iot/gateway,mozilla-iot/gateway,moziot/gateway,mozilla-iot/gateway,moziot/gateway,mozilla-iot/gateway
--- +++ @@ -1,4 +1,7 @@ module.exports = { + plugins: [ + 'html' + ], 'env': { 'commonjs': true, 'es6': true,
464cfab7ac74137a2f7e5be052dac81d06386380
lang/langs.js
lang/langs.js
var langs = { 'de':'deutsch', 'en':'english', 'es':'español', 'fr':'français', 'it':'italiano', 'ja':'日本', 'ko':'한국어', 'pl':'polski', 'pt':'português', 'ru':'русский', 'sv':'svenska', 'tr':'türkçe', 'uk':'українська', 'zh_cn':'简体中文' };
var langs = { 'de':'deutsch', 'en':'english', 'es':'español', 'fr':'français', 'it':'italiano', 'ja':'日本語', 'ko':'한국어', 'pl':'polski', 'pt':'português', 'ru':'русский', 'sv':'svenska', 'tr':'türkçe', 'uk':'українська', 'zh_cn':'简体中文' };
Change language name 'Japan' to 'Japanese'.
Change language name 'Japan' to 'Japanese'.
JavaScript
mpl-2.0
snazzysanoj/snazzysanoj.github.io,JamesKent/adarkroom,ngosang/adarkroom,sbakht/adarkroom,ikoan/adarkroom,doublespeakgames/adarkroom,Continuities/adarkroom,Pioneer11X/adarkroom,DDReaper/adarkroom,snazzysanoj/snazzysanoj.github.io,pablo-new17/adarkroom,sbakht/adarkroom,ngosang/adarkroom,bdorer/adarkroom,Razynoir/adarkroo...
--- +++ @@ -4,7 +4,7 @@ 'es':'español', 'fr':'français', 'it':'italiano', - 'ja':'日本', + 'ja':'日本語', 'ko':'한국어', 'pl':'polski', 'pt':'português',
e50830b890710e142a25ecc6b31145fc11ebe3c1
lib/config.js
lib/config.js
/** * In-Memory configuration storage */ let Config = { isInitialized: false, debug: true, overridePublishFunction: true, mutationDefaults: { pushToRedis: true, optimistic: true, }, passConfigDown: false, redis: { port: 6379, host: '127.0.0.1', }, gl...
/** * In-Memory configuration storage */ let Config = { isInitialized: false, debug: false, overridePublishFunction: true, mutationDefaults: { pushToRedis: true, optimistic: true, }, passConfigDown: false, redis: { port: 6379, host: '127.0.0.1', }, g...
Change default debug behavior back to false
Change default debug behavior back to false
JavaScript
mit
cult-of-coders/redis-oplog
--- +++ @@ -3,7 +3,7 @@ */ let Config = { isInitialized: false, - debug: true, + debug: false, overridePublishFunction: true, mutationDefaults: { pushToRedis: true,
4d56e2224c0292d1989e1c5c2a6d512925fa983a
lib/writer.js
lib/writer.js
var _ = require('underscore'), fs = require('fs'); function Writer() { function gen(templates, numSegments, params, outFile, cb) { var stream = fs.createWriteStream(outFile, { flags: 'w', encoding: 'utf-8' }), segmentId = 0; stream.on('error', function (err) { console.error('Error: ...
var _ = require('underscore'), fs = require('fs'); function Writer() { function gen(templates, numSegments, params, outFile, cb) { var stream = fs.createWriteStream(outFile, { flags: 'w', encoding: 'utf-8' }), segmentId = 0; stream.on('error', function (err) { console.error('Error: ...
Apply params in header and footer.
Apply params in header and footer.
JavaScript
mit
cliffano/datagen
--- +++ @@ -16,25 +16,22 @@ cb(); }); - stream.write(templates.header); - - function _writeSegment(segmentId) { - var segment = templates.segment; - params.segment_id = segmentId; - - function _apply(param) { - segment = segment.replace(new RegExp('{' + param + '}', 'g'...
7618f5f225ed9a0c87e37fc941fb1a045838372b
null-prune.js
null-prune.js
/* eslint-env amd */ (function (name, definition) { if (typeof define === 'function') { // AMD define(definition) } else if (typeof module !== 'undefined' && module.exports) { // Node.js module.exports = definition() } else { // Browser window[name] = definition() } })('nullPrune', funct...
/* eslint-env amd */ (function (name, definition) { if (typeof define === 'function') { // AMD define(definition) } else if (typeof module !== 'undefined' && module.exports) { // Node.js module.exports = definition() } else { // Browser window[name] = definition() } })('nullPrune', funct...
Make it compatible with old browsers
Make it compatible with old browsers
JavaScript
apache-2.0
cskeppstedt/null-prune
--- +++ @@ -11,20 +11,17 @@ window[name] = definition() } })('nullPrune', function () { - function hasOwnProperty (obj, property) { - return Object.prototype.hasOwnProperty.call(obj, property) - } - function isObject (input) { return input && (typeof input === 'object') } - function keys (...
2a7b7d5fac3e7024af573dc21028bb29e7a05efd
test/setup.js
test/setup.js
steal('can/util/mvc.js') .then('funcunit/qunit', 'can/util/fixture') .then(function() { var oldmodule = window.module; // Set the test timeout to five minutes QUnit.config.hidepassed = true; QUnit.config.testTimeout = 300000; if ( console && console.log ) { QUnit.log(function( details ) { if ( ! details....
steal('can/util/mvc.js') .then('funcunit/qunit', 'can/util/fixture') .then(function() { var oldmodule = window.module; // Set the test timeout to five minutes QUnit.config.hidepassed = true; QUnit.config.testTimeout = 300000; if ( typeof console !== "undefined" && console.log ) { QUnit.log(function( details...
Fix to console check causing breaks in IE.
Fix to console check causing breaks in IE.
JavaScript
mit
patrick-steele-idem/canjs,cohuman/canjs,scorphus/canjs,rasjani/canjs,rjgotten/canjs,patrick-steele-idem/canjs,juristr/canjs,azazel75/canjs,rasjani/canjs,UXsree/canjs,mindscratch/canjs,sporto/canjs,dispatchrabbi/canjs,dimaf/canjs,rasjani/canjs,cohuman/canjs,jebaird/canjs,Psykoral/canjs,scorphus/canjs,schmod/canjs,airhad...
--- +++ @@ -7,7 +7,7 @@ // Set the test timeout to five minutes QUnit.config.hidepassed = true; QUnit.config.testTimeout = 300000; - if ( console && console.log ) { + if ( typeof console !== "undefined" && console.log ) { QUnit.log(function( details ) { if ( ! details.result ) { console.log( "FAILUR...
6720ea61038cf20824fe2b2e1c02db99a569cd3e
lib/variation-matches.js
lib/variation-matches.js
var basename = require('path').basename; module.exports = variationMatches; function variationMatches(variations, path) { var result; variations.some(function(variation) { variation.chain.some(function(dir) { var parts = path.split(new RegExp("/"+dir+"/")); var found = parts.len...
module.exports = variationMatches; function variationMatches(variations, path) { var result; variations.some(function(variation) { variation.chain.some(function(dir) { var parts = path.split(new RegExp("/"+dir+"/")); var found = parts.length > 1; if (found) result = ...
Fix variation matches with variations
Fix variation matches with variations
JavaScript
mit
stephanwlee/mendel,stephanwlee/mendel,yahoo/mendel,yahoo/mendel
--- +++ @@ -1,4 +1,3 @@ -var basename = require('path').basename; module.exports = variationMatches; function variationMatches(variations, path) { @@ -9,7 +8,7 @@ var found = parts.length > 1; if (found) result = { variation: variation, - dir: basename(dir...
a11095a4d2b16822d79c3cea0500849fbbfc9fd0
server/data/Movie.js
server/data/Movie.js
const mongoose = require('mongoose') const uniqueValidator = require('mongoose-unique-validator') const paginate = require('mongoose-paginate') const requiredValidationMessage = '{PATH} is required' let movieSchema = mongoose.Schema({ title: { type: String, required: requiredValidationMessage, trim: true }, image:...
const mongoose = require('mongoose') const uniqueValidator = require('mongoose-unique-validator') const paginate = require('mongoose-paginate') const requiredValidationMessage = '{PATH} is required' let movieSchema = mongoose.Schema({ title: { type: String, required: requiredValidationMessage, trim: true }, image:...
Change 'year' from persistent to virtual and get from 'releaseDate'
Change 'year' from persistent to virtual and get from 'releaseDate'
JavaScript
mit
iliandj/express-architecture,iliandj/express-architecture
--- +++ @@ -6,15 +6,22 @@ let movieSchema = mongoose.Schema({ title: { type: String, required: requiredValidationMessage, trim: true }, image: [{ path: String, alt: String, title: String }], - year: { type: String }, rating: { type: Number, default: 0 }, description: { type: String, default: '' }, ca...
9d2deacd0ee28da9ae78dc16f7174d3f5d593b32
src/apps/global-nav-items.js
src/apps/global-nav-items.js
const fs = require('fs') const path = require('path') const { compact, sortBy, concat, includes } = require('lodash') const config = require('../config') const urls = require('../lib/urls') const subApps = fs.readdirSync(__dirname) const APP_GLOBAL_NAV_ITEMS = compact( subApps.map((subAppDir) => { const consta...
const fs = require('fs') const path = require('path') const { compact, sortBy, concat, includes } = require('lodash') const urls = require('../lib/urls') const subApps = fs.readdirSync(__dirname) const APP_GLOBAL_NAV_ITEMS = compact( subApps.map((subAppDir) => { const constantsPath = path.join(__dirname, subAp...
Remove deprecated MI site from GLOBAL_NAV_ITEMS
Remove deprecated MI site from GLOBAL_NAV_ITEMS
JavaScript
mit
uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2
--- +++ @@ -2,7 +2,6 @@ const path = require('path') const { compact, sortBy, concat, includes } = require('lodash') -const config = require('../config') const urls = require('../lib/urls') const subApps = fs.readdirSync(__dirname) @@ -26,19 +25,11 @@ APP_GLOBAL_NAV_ITEMS, (globalNavItem) => globalNavIt...
08ca837aca83e7c8cab88244f69db3cdac4de0e0
components/utils/testing.js
components/utils/testing.js
import React from 'react'; import TestUtils from 'react-addons-test-utils'; export default { renderComponent(Component, props = {}, state = {}) { const component = TestUtils.renderIntoDocument(<Component {...props} />); if (state !== {}) { component.setState(state); } return component; }, shallowRen...
import React from 'react'; import TestUtils from 'react-dom/test-utils'; export default { renderComponent(Component, props = {}, state = {}) { const component = TestUtils.renderIntoDocument(<Component {...props} />); if (state !== {}) { component.setState(state); } return component; }, shallowRender...
Update tests to use react-dom/test-utils
Update tests to use react-dom/test-utils
JavaScript
mit
react-toolbox/react-toolbox,react-toolbox/react-toolbox,react-toolbox/react-toolbox
--- +++ @@ -1,5 +1,5 @@ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import TestUtils from 'react-dom/test-utils'; export default { renderComponent(Component, props = {}, state = {}) {
3b0d8f70ba2091d20dc91ea5235c0479a16f2991
www/app/filters/app.filters.number.js
www/app/filters/app.filters.number.js
'use strict'; /* * Number Filters * * In HTML Template Binding * {{ filter_expression | filter : expression : comparator}} * * In JavaScript * $filter('filter')(array, expression, comparator) * * https://docs.angularjs.org/api/ng/filter/filter */ var app = angular.module('app.filters.number', []); app.f...
'use strict'; /* * Number Filters * * In HTML Template Binding * {{ filter_expression | filter : expression : comparator}} * * In JavaScript * $filter('filter')(array, expression, comparator) * * https://docs.angularjs.org/api/ng/filter/filter */ var app = angular.module('app.filters.number', []); app.f...
Set the timezone on MySQL formatted dates.
Set the timezone on MySQL formatted dates.
JavaScript
mit
rachellcarbone/angular-seed,rachellcarbone/angular-seed,rachellcarbone/angular-seed
--- +++ @@ -28,6 +28,6 @@ if (!value) { return value; } - return moment(value, 'YYYY-MM-DD HH:mm:ss').format('M/D/YYYY h:mm a'); + return moment(value, 'YYYY-MM-DD HH:mm:ss').tz('America/New_York').format('M/D/YYYY h:mm a'); }; });
946eb3a92be4e3452f837130e5053643544ea08b
lib/app.js
lib/app.js
"use strict"; var zlib = require("zlib"); var cors = require("cors"), express = require("express"); var SyslogFilter = require("./syslog-filter"); module.exports = function(source) { var app = express(); app.disable('x-powered-by'); app.use(cors()); app.get("/:ps(\\w*)?", function(req, res, next) { ...
"use strict"; var stream = require("stream"), zlib = require("zlib"); var cors = require("cors"), express = require("express"); var SyslogFilter = require("./syslog-filter"); module.exports = function(nexus) { var app = express(); app.disable('x-powered-by'); app.use(cors()); app.get("/:ps(\\w*)?...
Unplug client streams when requests end
Unplug client streams when requests end
JavaScript
isc
mojodna/log-nexus
--- +++ @@ -1,13 +1,14 @@ "use strict"; -var zlib = require("zlib"); +var stream = require("stream"), + zlib = require("zlib"); var cors = require("cors"), express = require("express"); var SyslogFilter = require("./syslog-filter"); -module.exports = function(source) { +module.exports = function(ne...
b94e3b3d2060456bd052a3cdde057f48a7e0ca91
lib/cli.js
lib/cli.js
'use strict'; var path = require('path'), opener = require('opener'), chalk = require('chalk'), pkg = require('../package.json'), server = require('./server'), program = require('commander'); function getConfigPath(config) { return path.resolve(config); } exports.run = function() { program...
'use strict'; var path = require('path'), opener = require('opener'), chalk = require('chalk'), pkg = require('../package.json'), server = require('./server'), program = require('commander'); exports.run = function() { program .version(pkg.version) .allowUnknownOption(true) ...
Add notification about gemini config overriding
Add notification about gemini config overriding
JavaScript
mit
gemini-testing/gemini-gui,gemini-testing/gemini-gui
--- +++ @@ -6,18 +6,19 @@ server = require('./server'), program = require('commander'); -function getConfigPath(config) { - return path.resolve(config); -} - exports.run = function() { program .version(pkg.version) .allowUnknownOption(true) .option('-p, --port <port>', ...
5ad85f1120a19885ad11ade6a607542b6ea2e3ea
src/components/Logo/index.js
src/components/Logo/index.js
import React from 'react'; import SVGInline from 'react-svg-inline'; import svg from '../../static/logo.svg'; const Logo = (props) => { return ( <SVGInline svg={svg} desc={props.desc} width={props.width} height={props.height} /> ); }; Logo.propTy...
import React from 'react'; import SVGInline from 'react-svg-inline'; import svg from '../../static/logo.svg'; const Logo = (props) => { return ( <SVGInline svg={svg} desc={props.desc} width={props.width} height={props.height} cleanup={['width', 'h...
Fix weird logo size on Firefox
Fix weird logo size on Firefox
JavaScript
mit
devnews/web,devnews/web
--- +++ @@ -9,6 +9,7 @@ desc={props.desc} width={props.width} height={props.height} + cleanup={['width', 'height']} /> ); }; @@ -22,7 +23,7 @@ Logo.defaultProps = { desc: 'devnews logo', width: 'auto', - height: '20', + height: '20px', ...
2cb117bd56c5508c4abf885c6b8ed4d4c043462a
src/components/search_bar.js
src/components/search_bar.js
import React from 'react' //class-based component (ES6) class SearchBar extends React.Component { render() { //method definition in ES6 return <input />; } } export default SearchBar;
import React, { Component } from 'react' //class-based component (ES6) class SearchBar extends Component { render() { //method definition in ES6 return <input />; } } export default SearchBar;
Refactor to ES6 syntactic sugar
Refactor to ES6 syntactic sugar
JavaScript
mit
phirefly/react-redux-starter,phirefly/react-redux-starter
--- +++ @@ -1,7 +1,7 @@ -import React from 'react' +import React, { Component } from 'react' //class-based component (ES6) -class SearchBar extends React.Component { +class SearchBar extends Component { render() { //method definition in ES6 return <input />; }
e0c685d096bac50e01946d43ab1c7c034ae68d98
src/config/globalSettings.js
src/config/globalSettings.js
/** * Global settings that do not change in a production environment */ if (typeof window === 'undefined') { // For tests global.window = {} } window.appSettings = { headerHeight: 60, drawerWidth: 250, drawerAnimationDuration:500, icons: { navbarArchive: 'ios-box', navbarEye...
/** * Global settings that do not change in a production environment */ if (typeof window === 'undefined') { // For tests global.window = {} } window.appSettings = { boardOuterMargin: 30, boardPostMargin: 25, // The following settings can't be changed explcitly. // Needs to be kept in sync ...
Add view ID's and board layout options
feat(appSettings): Add view ID's and board layout options
JavaScript
mit
AdamSalma/Lurka,AdamSalma/Lurka
--- +++ @@ -8,16 +8,25 @@ } window.appSettings = { + boardOuterMargin: 30, + boardPostMargin: 25, + + // The following settings can't be changed explcitly. + // Needs to be kept in sync with src/styles/base/variables headerHeight: 60, drawerWidth: 250, - drawerAnimationDuration:500, + ...
382a847bbc4b483829e3ca3e8fb4169cc6649b92
src/menu-item-content/menu-item-content-directive.js
src/menu-item-content/menu-item-content-directive.js
'use strict'; angular.module('eehMenuBs3').directive('eehMenuBs3MenuItemContent', MenuItemContentDirective); /** @ngInject */ function MenuItemContentDirective(eehNavigation) { return { restrict: 'A', scope: { menuItem: '=eehMenuBs3MenuItemContent' }, templateUrl: 'templ...
'use strict'; angular.module('eehMenuBs3').directive('eehMenuBs3MenuItemContent', MenuItemContentDirective); /** @ngInject */ function MenuItemContentDirective(eehMenu) { return { restrict: 'A', scope: { menuItem: '=eehMenuBs3MenuItemContent' }, templateUrl: 'template/ee...
Fix names and paths in menu item content directive
Fix names and paths in menu item content directive
JavaScript
mit
MenuJS/eeh-menu-bs3,MenuJS/eeh-menu-bs3
--- +++ @@ -2,16 +2,16 @@ angular.module('eehMenuBs3').directive('eehMenuBs3MenuItemContent', MenuItemContentDirective); /** @ngInject */ -function MenuItemContentDirective(eehNavigation) { +function MenuItemContentDirective(eehMenu) { return { restrict: 'A', scope: { menuItem:...
9846027ab68bccc2eb2ccfacc5a3f7c3a84c6793
alien4cloud-ui/yo/app/scripts/services/rest_technical_error_interceptor.js
alien4cloud-ui/yo/app/scripts/services/rest_technical_error_interceptor.js
'use strict'; angular.module('alienUiApp').factory('restTechnicalErrorInterceptor', ['$rootScope', '$q', '$window', 'toaster', '$translate', function($rootScope, $q, $window, toaster, $translate) { var extractErrorMessage = function(rejection) { if (UTILS.isDefinedAndNotNull(rejection.data)) { if ...
'use strict'; angular.module('alienUiApp').factory('restTechnicalErrorInterceptor', ['$rootScope', '$q', '$window', 'toaster', '$translate', function($rootScope, $q, $window, toaster, $translate) { var extractErrorMessage = function(rejection) { if (UTILS.isDefinedAndNotNull(rejection.data)) { if ...
Fix double error message when "tour" is missing
Fix double error message when "tour" is missing
JavaScript
apache-2.0
ahgittin/alien4cloud,broly-git/alien4cloud,ahgittin/alien4cloud,PierreLemordant/alien4cloud,broly-git/alien4cloud,broly-git/alien4cloud,PierreLemordant/alien4cloud,ngouagna/alien4cloud,loicalbertin/alien4cloud,loicalbertin/alien4cloud,broly-git/alien4cloud,loicalbertin/alien4cloud,ngouagna/alien4cloud,igorng/alien4clou...
--- +++ @@ -37,7 +37,7 @@ var error = extractErrorMessage(rejection); // Display the toaster message on top with 4000 ms display timeout // Don't shot toaster for "tour" guides - if (error.data.indexOf('/data/guides') < 0) { + if (rejection.config.url.indexOf('data/guides') < ...
8f5b0dcd02f2b5b81139cba0c757a33d37204070
app/js/arethusa.core/directives/lang_specific.js
app/js/arethusa.core/directives/lang_specific.js
'use strict'; angular.module('arethusa.core').directive('langSpecific', [ 'languageSettings', function(languageSettings) { return { restrict: 'A', link: function(scope, element, attrs) { var settings = languageSettings.getFor('treebank'); if (settings) { element.attr('lang...
'use strict'; angular.module('arethusa.core').directive('langSpecific', [ 'languageSettings', function(languageSettings) { return { restrict: 'A', link: function(scope, element, attrs) { var settings = languageSettings.getFor('treebank') || languageSettings.getFor('hebrewMorph'); if...
Check hebrew document in langSpecific
Check hebrew document in langSpecific Very troublesome to hardcode this - we have to defer a decision on this a little longer.
JavaScript
mit
Masoumeh/arethusa,PonteIneptique/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa
--- +++ @@ -6,7 +6,7 @@ return { restrict: 'A', link: function(scope, element, attrs) { - var settings = languageSettings.getFor('treebank'); + var settings = languageSettings.getFor('treebank') || languageSettings.getFor('hebrewMorph'); if (settings) { element.att...
37267f761c06cd6ff101e96a484c8f61b017fb5a
server/config/config.js
server/config/config.js
var path = require('path'); var rootPath = path.normalize(__dirname + '/../../'); module.exports = { local: { baseUrl: 'http://localhost:3051', db: 'mongodb://localhost/rp_local', rootPath: rootPath, port: process.env.PORT || 3051 }, staging : { baseUrl: 'http://...
var path = require('path'); var rootPath = path.normalize(__dirname + '/../../'); module.exports = { local: { baseUrl: 'http://localhost:3030', db: 'mongodb://localhost/rp_local', rootPath: rootPath, port: process.env.PORT || 3030 }, staging : { baseUrl: 'http://...
Add to download links ng-csv
Add to download links ng-csv
JavaScript
mit
NRGI/rp-org-frontend,NRGI/rp-org-frontend
--- +++ @@ -3,10 +3,10 @@ module.exports = { local: { - baseUrl: 'http://localhost:3051', + baseUrl: 'http://localhost:3030', db: 'mongodb://localhost/rp_local', rootPath: rootPath, - port: process.env.PORT || 3051 + port: process.env.PORT || 3030 }, st...
38ed99078ce7ed579dd72eb1fd493ce756473b59
server/config/routes.js
server/config/routes.js
module.exports = function(app, express) { // Facebook OAuth app.get('/auth/facebook', function(req, res) { res.send('Facebook OAuth'); }); app.get('/auth/facebook/callback', function(req, res) { res.send('Callback for Facebook OAuth'); }); // User Creation app.route('/api/users') .post(funct...
module.exports = function(app, express) { // Facebook OAuth app.get('/auth/facebook', function(req, res) { res.send('Facebook OAuth'); }); app.get('/auth/facebook/callback', function(req, res) { res.send('Callback for Facebook OAuth'); }); // User Creation app.route('/api/users') .post(funct...
Add endpoints for Room creation (start of lecture), Note Creation (end of lecture), Editing Notes
Add endpoints for Room creation (start of lecture), Note Creation (end of lecture), Editing Notes
JavaScript
mit
folksy-squid/Picky-Notes,inspiredtolive/Picky-Notes,derektliu/Picky-Notes,derektliu/Picky-Notes,inspiredtolive/Picky-Notes,derektliu/Picky-Notes,folksy-squid/Picky-Notes,inspiredtolive/Picky-Notes,folksy-squid/Picky-Notes
--- +++ @@ -19,4 +19,30 @@ .delete(function(req, res) { res.send('Delete the user'); }); + + // Room Creation + app.post('/api/rooms', function(req, res) { + res.send('Create a room'); + }); + + // Note Creation + app.post('/api/notes/new', function(req, res) { + res.send('End of lecture, ...
d1785feb25125bf750daa35b3612124fc72e30b3
app/scripts/timetable_builder/views/ExamsView.js
app/scripts/timetable_builder/views/ExamsView.js
define(['backbone.marionette', './ExamView', 'hbs!../templates/exams'], function (Marionette, ExamView, template) { 'use strict'; return Marionette.CompositeView.extend({ tagName: 'table', className: 'table table-bordered table-condensed', itemView: ExamView, itemViewContainer: 'tbody...
define(['backbone.marionette', './ExamView', 'hbs!../templates/exams'], function (Marionette, ExamView, template) { 'use strict'; return Marionette.CompositeView.extend({ tagName: 'table', className: 'table table-bordered table-condensed', itemView: ExamView, itemViewContainer: 'tbody...
Use getItemViewContainer() for safety - it ensures $itemViewContainer exists
Use getItemViewContainer() for safety - it ensures $itemViewContainer exists
JavaScript
mit
chunqi/nusmods,nusmodifications/nusmods,nathanajah/nusmods,chunqi/nusmods,nathanajah/nusmods,zhouyichen/nusmods,mauris/nusmods,zhouyichen/nusmods,nathanajah/nusmods,Yunheng/nusmods,Yunheng/nusmods,mauris/nusmods,mauris/nusmods,chunqi/nusmods,zhouyichen/nusmods,nusmodifications/nusmods,zhouyichen/nusmods,nusmodification...
--- +++ @@ -16,7 +16,7 @@ }, appendHtml: function (compositeView, itemView, index) { - var childrenContainer = compositeView.$itemViewContainer; + var childrenContainer = this.getItemViewContainer(compositeView); var children = childrenContainer.children(); if (children...
271974693930334174db0a01a86a7cffd3f7f9e0
src/ObjectLocator.js
src/ObjectLocator.js
class ObjectLocator { constructor(fs, objectName) { this.fs = fs; this.objectName = objectName; this.objects = []; this.objectDirectoryName = "objects"; } run() { this.loadAllObjects(this.objectName); return this.objects; } loadAllObjects(dependency...
class ObjectLocator { constructor(fs, objectName) { this.fs = fs; this.objectName = objectName; this.objects = []; this.objectDirectoryName = "objects"; } run() { this.loadAllObjects(this.objectName); return this.objects; } loadAllObjects(dependency...
Make driver object filename case-insensitive
Make driver object filename case-insensitive
JavaScript
mit
generationtux/cufflink
--- +++ @@ -13,7 +13,7 @@ } loadAllObjects(dependencyName) { - let fileData = this.fs.readFileSync(process.cwd() + `/${this.objectDirectoryName}/${dependencyName}.json`); + let fileData = this.fs.readFileSync(process.cwd() + `/${this.objectDirectoryName}/${dependencyName.toLowerCase()}.json`...
0ca10de801a0104fa3d9d3f23b074591672f2318
server/lib/redirects.js
server/lib/redirects.js
const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], ['lucaschmid.net/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request...
const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], ['ls7.ch/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request.host}${...
Make the fjs redirect shorter
Make the fjs redirect shorter
JavaScript
mit
Kriegslustig/lucaschmid.net,Kriegslustig/lucaschmid.net,Kriegslustig/lucaschmid.net
--- +++ @@ -1,6 +1,6 @@ const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], - ['lucaschmid.net/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] + ['ls7.ch/fjs', 'https://github.com/kriegslustig/presentation-functional-javas...
f585a93f9b3d9a830e752bd205c5427f7e1c4ac2
character_sheet/js/main.js
character_sheet/js/main.js
// Source: http://stackoverflow.com/a/1830844 function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function AppViewModel() { this.statStrength = ko.observable(); this.statEndurance = ko.observable(); this.statAgility = ko.observable(); this.statSpeed = ko.observable(); this.stat...
// Source: http://stackoverflow.com/a/1830844 function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function statBonus(statValue) { if(!isNumber(statValue)) { return false; } switch(+statValue) { // cast to number case 0: return "–"; break; ...
Add function to determine stat bonus from value.
Add function to determine stat bonus from value.
JavaScript
bsd-2-clause
vegarbg/horizon
--- +++ @@ -1,6 +1,46 @@ // Source: http://stackoverflow.com/a/1830844 function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); +} + +function statBonus(statValue) { + if(!isNumber(statValue)) { + return false; + } + switch(+statValue) { // cast to number + case 0: + ...
0175c92b62010f33e7410cc0e6a5121ad87e52ba
templates/system/modules/ph7cms-donation/themes/base/js/donationbox.js
templates/system/modules/ph7cms-donation/themes/base/js/donationbox.js
/* * Author: Pierre-Henry Soria <hello@ph7cms.com> * Copyright: (c) 2015-2017, Pierre-Henry Soria. All Rights Reserved. * License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. */ var $validationBox = (function () { $.get(pH7Url.base + 'ph7cms-don...
/* * Author: Pierre-Henry Soria <hello@ph7cms.com> * Copyright: (c) 2015-2017, Pierre-Henry Soria. All Rights Reserved. * License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. */ var $donationBox = (function () { $.get(pH7Url.base + 'ph7cms-donat...
Rename variable for more appropriate name
Rename variable for more appropriate name
JavaScript
mit
pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS
--- +++ @@ -4,7 +4,7 @@ * License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. */ -var $validationBox = (function () { +var $donationBox = (function () { $.get(pH7Url.base + 'ph7cms-donation/main/donationbox', function (oData) { $.colorbox({ ...
f337cf6f58d0b0da1435e49023a2e7cf5d9d33d9
protocols/discord.js
protocols/discord.js
const Core = require('./core'); class Discord extends Core { constructor() { super(); this.dnsResolver = { resolve: function(address) {return {address: address} } }; } async run(state) { this.usedTcp = true; const raw = await this.request({ uri: 'https://discordapp.com/api/guilds/' + this....
const Core = require('./core'); class Discord extends Core { constructor() { super(); this.dnsResolver = { resolve: function(address) {return {address: address} } }; } async run(state) { this.usedTcp = true; const raw = await this.request({ uri: 'https://discordapp.com/api/guilds/' + this....
Remove discriminator's from player names
Remove discriminator's from player names The widget API seems to always set discriminator to 0000
JavaScript
mit
sonicsnes/node-gamedig
--- +++ @@ -20,9 +20,7 @@ } state.players = json.members.map(v => { return { - name: v.username + '#' + v.discriminator, - username: v.username, - discriminator: v.discriminator, + name: v.username, team: v.status } });
7cf8d2f042c73277630a375f11c74ba8fe047e33
jujugui/static/gui/src/app/components/user-menu/user-menu.js
jujugui/static/gui/src/app/components/user-menu/user-menu.js
/* Copyright (C) 2017 Canonical Ltd. */ 'use strict'; const PropTypes = require('prop-types'); const React = require('react'); const ButtonDropdown = require('../button-dropdown/button-dropdown'); /** Provides a user menu to the header - shows Profile, Account and Logout links. If user is not logged in the user i...
/* Copyright (C) 2017 Canonical Ltd. */ 'use strict'; const PropTypes = require('prop-types'); const React = require('react'); const ButtonDropdown = require('../button-dropdown/button-dropdown'); /** Provides a user menu to the header - shows Profile, Account and Logout links. If user is not logged in the user i...
Remove unused user menu methods.
Remove unused user menu methods.
JavaScript
agpl-3.0
mitechie/juju-gui,mitechie/juju-gui,mitechie/juju-gui,mitechie/juju-gui
--- +++ @@ -9,37 +9,25 @@ Provides a user menu to the header - shows Profile, Account and Logout links. If user is not logged in the user icon is replaced with a login button. */ -class UserMenu extends React.Component { - - _toggleDropdown() { - this.refs.buttonDropdown._toggleDropdown(); - } - - _handl...
25dbfe06d90c794525c956bf08ccecc1b7c8d8fc
addon/components/mapbox-gl-source.js
addon/components/mapbox-gl-source.js
import Ember from 'ember'; import layout from '../templates/components/mapbox-gl-source'; const { Component, computed, get, getProperties, guidFor } = Ember; export default Component.extend({ layout, tagName: '', map: null, dataType: 'geojson', data: null, sourceId: computed({ get() { ...
import Ember from 'ember'; import layout from '../templates/components/mapbox-gl-source'; const { Component, computed, get, getProperties, guidFor } = Ember; export default Component.extend({ layout, tagName: '', map: null, dataType: 'geojson', data: null, options: null, sourceId: computed(...
Support any options mapbox source supports. Maintain backwards compatibility.
Support any options mapbox source supports. Maintain backwards compatibility.
JavaScript
mit
kturney/ember-mapbox-gl,kturney/ember-mapbox-gl
--- +++ @@ -17,6 +17,8 @@ dataType: 'geojson', data: null, + options: null, + sourceId: computed({ get() { return guidFor(this); @@ -31,9 +33,17 @@ this._super(...arguments); const { sourceId, dataType, data } = getProperties(this, 'sourceId', 'dataType', 'data'); + let options ...
142681d8ae8c96c30c03752426d6124d64e24c9a
server/readings-daily-aggregates/publications.js
server/readings-daily-aggregates/publications.js
Meteor.publish("dailyMeasuresBySensor", (sensorId, dayStart, dayEnd) => { check(sensorId, String); check(dayStart, String); check(dayEnd, String); return ReadingsDailyAggregates.find({ sensorId, day: { $gte: dayStart, $lte: dayEnd } }) });
Meteor.publish("dailyMeasuresBySensor", (sensorId, source, dayStart, dayEnd) => { check(sensorId, String); check(source, String); check(dayStart, String); check(dayEnd, String); return ReadingsDailyAggregates.find({ sensorId, source, day: { $gte: dayStart, ...
Change publication of sensor-daily-aggregates to include source.
Change publication of sensor-daily-aggregates to include source.
JavaScript
apache-2.0
innowatio/iwwa-back,innowatio/iwwa-back
--- +++ @@ -1,9 +1,11 @@ -Meteor.publish("dailyMeasuresBySensor", (sensorId, dayStart, dayEnd) => { +Meteor.publish("dailyMeasuresBySensor", (sensorId, source, dayStart, dayEnd) => { check(sensorId, String); + check(source, String); check(dayStart, String); check(dayEnd, String); return Reading...
26d299abc795cd90a5d2a3130e2a04e187e84799
pac_script.js
pac_script.js
var BOARD_HEIGHT = 288; var BOARD_WIDTH = 224; var VERT_TILES = BOARD_HEIGHT / 8; var HORIZ_TILES = BOARD_WIDTH / 8; gameBoard = new Array(VERT_TILES); for(var y = 0; y < VERT_TILES; y++) { gameBoard[y] = new Array(HORIZ_TILES); for(var x = 0; x < HORIZ_TILES; x++) { gameBoard[y][x] = 0; } }
var BOARD_HEIGHT = 288; var BOARD_WIDTH = 224; var VERT_TILES = BOARD_HEIGHT / 8; var HORIZ_TILES = BOARD_WIDTH / 8; gameBoard = new Array(VERT_TILES); for(var y = 0; y < VERT_TILES; y++) { gameBoard[y] = new Array(HORIZ_TILES); for(var x = 0; x < HORIZ_TILES; x++) { gameBoard[y][x] = 0; } } var ready = fun...
Add ready function in js with IE8 compatibility
Add ready function in js with IE8 compatibility
JavaScript
mit
peternatewood/pac-man-replica,peternatewood/pac-man-replica
--- +++ @@ -10,3 +10,19 @@ gameBoard[y][x] = 0; } } + +var ready = function(fun) { + if(document.readyState != "loading") { + fun(); + } + else if(document.addEventListener) { + document.addEventListener("DOMContentLoaded", fun); + } + else { + document.attachEvent("onreadystatechange", functio...
721294c2debd50f91f191c60aa8183ac11b74bd0
src/js/components/dateRangePicker.js
src/js/components/dateRangePicker.js
// @flow /* flowlint * untyped-import:off */ import * as React from 'react'; import Datepicker from '@salesforce/design-system-react/components/date-picker'; const dateRangePicker = ({onChange, startName, endName} : {startName: string, endName: string, onChange : (...
// @flow /* flowlint * untyped-import:off */ import * as React from 'react'; import Datepicker from '@salesforce/design-system-react/components/date-picker'; import Button from '@salesforce/design-system-react/components/button'; import { useState } from 'react'; const dateRangePicker = ({onChange, startName, ...
Allow clearing of date ranges.
Allow clearing of date ranges.
JavaScript
bsd-3-clause
SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci
--- +++ @@ -5,27 +5,55 @@ import * as React from 'react'; import Datepicker from '@salesforce/design-system-react/components/date-picker'; +import Button from '@salesforce/design-system-react/components/button'; +import { useState } from 'react'; -const dateRangePicker = ({onChange, startName, endName} : +cons...
ec279560086ca1addd3b6ea20ec6516bdd351fd9
views/home.js
views/home.js
import React from "react-native"; import LocalitiesFiltered from "./localities-filtered"; export default class Home extends React.Component { render() { return <LocalitiesFiltered {...this.props} />; } }
import React from "react-native"; import LocalitiesController from "./localities-controller"; export default class Home extends React.Component { render() { return <LocalitiesController {...this.props} />; } }
Remove filter from my localities
Remove filter from my localities
JavaScript
unknown
wesley1001/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods,scrollback/io.scrollback.neighborhoods,wesley1001/io.scrollback.neighborhoods
--- +++ @@ -1,8 +1,8 @@ import React from "react-native"; -import LocalitiesFiltered from "./localities-filtered"; +import LocalitiesController from "./localities-controller"; export default class Home extends React.Component { render() { - return <LocalitiesFiltered {...this.props} />; + retur...
a1bcbe2c769e14ecbc54af8587c91555e268bf25
service.js
service.js
/*! **| PonkBot **| A chat bot for CyTube **| **@author Xaekai **@copyright 2017 **@license MIT */ 'use strict'; const PonkBot = require('./lib/ponkbot.js'); const argv = require('minimist')(process.argv.slice(2)); const configfile = typeof argv.config == "String" ? argv.config : "./config"; const config =...
/*! **| PonkBot **| A chat bot for CyTube **| **@author Xaekai **@copyright 2017 **@license MIT */ 'use strict'; const PonkBot = require('./lib/ponkbot.js'); function getConfig(args){ let config = './config.js'; config = typeof args.config == "string" ? args.config : config; // Check for relati...
Improve handling of missing config file
Improve handling of missing config file
JavaScript
mit
Xaekai/PonkBot
--- +++ @@ -11,8 +11,27 @@ const PonkBot = require('./lib/ponkbot.js'); +function getConfig(args){ + let config = './config.js'; + config = typeof args.config == "string" ? args.config : config; + + // Check for relative path without leading "./" + if( !config.match(/^\//) && config.match(/\//)){ + ...
1e2e796d806f87ebd0eae4e7f68394ec0730febe
src/app/myOrders/orders/js/orders.config.js
src/app/myOrders/orders/js/orders.config.js
angular.module('orderCloud') .config(OrdersConfig) ; function OrdersConfig($stateProvider) { $stateProvider .state('orders', { parent: 'account', templateUrl: 'myOrders/orders/templates/orders.html', controller: 'OrdersCtrl', controllerAs: 'orders', ...
angular.module('orderCloud') .config(OrdersConfig) ; function OrdersConfig($stateProvider) { $stateProvider .state('orders', { parent: 'account', templateUrl: 'myOrders/orders/templates/orders.html', controller: 'OrdersCtrl', controllerAs: 'orders', ...
Add status as a query param for orders state
Add status as a query param for orders state
JavaScript
mit
spencerwalker/angular-buyer,crhistianr/angular-buyer,ordercloud-api/angular-buyer,crhistianr/angular-buyer,spencerwalker/angular-buyer,Four51/demo_buyer,ordercloud-api/angular-buyer,Four51/demo_buyer
--- +++ @@ -12,7 +12,7 @@ data: { pageTitle: 'Orders' }, - url: '/orders/:tab?fromDate&toDate&search&page&pageSize&searchOn&sortBy&filters', + url: '/orders/:tab?fromDate&toDate&search&page&pageSize&searchOn&sortBy&status&filters', resolve:...
79b97488d91f194721d1d2c9a0c612e2b18307ec
public/app.js
public/app.js
function something() { var x =window.localStorage.getItem('cc'); x = x * 1 + 1; window.localStorage.setItem('cc', x); alert(x); } function add_to_cart(id) { var key_id = 'product_' + id; var x = window.localStorage.getItem(key_id); x = x * 1 + 1; window.localStorage.setItem(key_id, x); // var ...
function something() { var x =window.localStorage.getItem('cc'); x = x * 1 + 1; window.localStorage.setItem('cc', x); alert(x); } function add_to_cart(id) { var key_id = 'product_' + id; var x = window.localStorage.getItem(key_id); x = x * 1 + 1; window.localStorage.setItem(key_id, x); }
Fix 2 Show numbers of products on cart
Fix 2 Show numbers of products on cart
JavaScript
mit
airwall/PizzaShop,airwall/PizzaShop,airwall/PizzaShop
--- +++ @@ -21,23 +21,6 @@ x = x * 1 + 1; window.localStorage.setItem(key_id, x); - // var total = 0; //Total numbers of products ordered - - - - // for(var i in localStorage) - // { - // console.log(localStorage[i]); - // } - // for(var i=0, len=localStorage.length; i<len; i++) { - // var ke...
26799b61303d713c055705876e6e070c7726527f
src/index.js
src/index.js
import http from "http" import { app, CONFIG } from "./server" let currentApp = null const server = http.createServer(app) server.listen(CONFIG.port) console.log(`GraphQL-server listening on port ${CONFIG.port}.`) if (module.hot) { module.hot.accept(["./server", "./graphql"], () => { server.removeListener("requ...
import http from "http" import { app, CONFIG } from "./server" let currentApp = app const server = http.createServer(app) server.listen(CONFIG.port) console.log(`GraphQL-server listening on port ${CONFIG.port}.`) if (module.hot) { module.hot.accept(["./server", "./graphql"], () => { server.removeListener("reque...
Fix issue in hot reloading
Fix issue in hot reloading
JavaScript
mit
DevNebulae/ads-pt-api
--- +++ @@ -1,7 +1,7 @@ import http from "http" import { app, CONFIG } from "./server" -let currentApp = null +let currentApp = app const server = http.createServer(app) server.listen(CONFIG.port) console.log(`GraphQL-server listening on port ${CONFIG.port}.`)
394ab4a2d670415e792504aaa25dbe7cb2b619ae
src/index.js
src/index.js
// require('./contentmeter.js'); import ContentMeter from './ContentMeter.js'; module.exports = ContentMeter;
// require('./contentmeter.js'); import ContentMeter from './ContentMeter.js'; // module.exports = ContentMeter;
Hide module.exports for rollup compatibility
Hide module.exports for rollup compatibility
JavaScript
mit
bezet/baza-contentmeter
--- +++ @@ -1,3 +1,3 @@ // require('./contentmeter.js'); import ContentMeter from './ContentMeter.js'; -module.exports = ContentMeter; +// module.exports = ContentMeter;
a54a5cbd19a400a13a071685f54de611391e62b5
webpack.config.js
webpack.config.js
var path = require("path"); module.exports = { cache: true, entry: "./js/main.js", devtool: "#source-map", output: { path: path.resolve("./build"), filename: "bundle.js", sourceMapFilename: "[file].map", publicPath: "/build/", stats: { colors: true }, }, ...
var path = require("path"); module.exports = { cache: true, entry: "./js/main.js", devtool: "#source-map", output: { path: path.resolve("./build"), filename: "bundle.js", sourceMapFilename: "[file].map", publicPath: "/build/", stats: { colors: true }, }, ...
Change to react from react-with-addons
Change to react from react-with-addons
JavaScript
mpl-2.0
bbondy/khan-academy-fxos,bbondy/khan-academy-fxos
--- +++ @@ -32,7 +32,7 @@ }, resolve: { alias: { - "react": path.resolve("node_modules/react/dist/react-with-addons.js"), + "react": path.resolve("node_modules/react/dist/react.js"), "underscore": path.resolve("node_modules/underscore/underscore-min.js"), ...
43e6579c55ff8eb592d864c7cfc4858ca69e25ef
src/mongo.js
src/mongo.js
var mongoose = require('mongoose'); mongoose.connect(process.env.MONGO_URI); mongoose.Model.prototype.psave = function () { var that = this; return new Promise(function (resolve) { that.save(function (err) { if (err) { throw err } resolve(); ...
var mongoose = require('mongoose'); // polyfill of catch // https://github.com/aheckmann/mpromise/pull/14 require('mongoose/node_modules/mpromise').prototype.catch = function (onReject) { return this.then(undefined, onReject); }; mongoose.connect(process.env.MONGO_URI); /** * Saves the model and returns a prom...
Modify model and add polyfill of promise.catch
Modify model and add polyfill of promise.catch
JavaScript
mit
kt3k/pomodoro-meter,kt3k/pomodoro-meter,kt3k/pomodoro-meter
--- +++ @@ -1,7 +1,17 @@ var mongoose = require('mongoose'); + +// polyfill of catch +// https://github.com/aheckmann/mpromise/pull/14 +require('mongoose/node_modules/mpromise').prototype.catch = function (onReject) { + return this.then(undefined, onReject); +}; + mongoose.connect(process.env.MONGO_URI); +/*...
f7f7d921e1153a86c74d5dfb2d728095313885f9
extension.js
extension.js
const UPower = imports.ui.status.power.UPower const Main = imports.ui.main let watching function bind () { getBattery(proxy => { watching = proxy.connect('g-properties-changed', update) }) } function unbind () { getBattery(proxy => { proxy.disconnect(watching) }) } function show () { getBattery((p...
const UPower = imports.ui.status.power.UPower const Main = imports.ui.main let watching function bind () { getBattery(proxy => { watching = proxy.connect('g-properties-changed', update) }) } function unbind () { getBattery(proxy => { proxy.disconnect(watching) }) } function show () { getBattery((p...
Improve logic for more edge cases
Improve logic for more edge cases
JavaScript
mit
ai/autohide-battery
--- +++ @@ -29,9 +29,13 @@ function update () { getBattery(proxy => { - let isBattery = proxy.Type === UPower.DeviceKind.BATTERY - let notDischarging = proxy.State !== UPower.DeviceState.DISCHARGING - if (isBattery && notDischarging && proxy.Percentage === 100) { + let isDischarging = proxy.State ==...
810136cdab53dcc29751cb4584f9012c73aed0c3
src/javascript/_common/check_new_release.js
src/javascript/_common/check_new_release.js
const moment = require('moment'); const urlForStatic = require('./url').urlForStatic; const getStaticHash = require('./utility').getStaticHash; // only reload if it's more than 10 minutes since the last reload const shouldForceReload = last_reload => !last_reload || +last_reload + (10 * 60 * 1000) < moment().v...
const moment = require('moment'); const urlForStatic = require('./url').urlForStatic; const getStaticHash = require('./utility').getStaticHash; const LocalStore = require('../_common/storage').LocalStore; // only reload if it's more than 10 minutes since the last reload const shouldForceReload = last_reload...
Use LocalStore to have a fallback when localStorage is not avail.
Use LocalStore to have a fallback when localStorage is not avail.
JavaScript
apache-2.0
kellybinary/binary-static,ashkanx/binary-static,kellybinary/binary-static,binary-com/binary-static,ashkanx/binary-static,kellybinary/binary-static,binary-com/binary-static,ashkanx/binary-static,binary-com/binary-static
--- +++ @@ -1,15 +1,16 @@ const moment = require('moment'); const urlForStatic = require('./url').urlForStatic; const getStaticHash = require('./utility').getStaticHash; +const LocalStore = require('../_common/storage').LocalStore; // only reload if it's more than 10 minutes since the last reload co...
03a6a9e6a2e50fcb5d8a425e7a6275f30e8e95f1
src/modules/search/components/UnitSuggestions.js
src/modules/search/components/UnitSuggestions.js
import React from 'react'; import {Link} from 'react-router'; import ObservationStatus from '../../unit/components/ObservationStatus'; import {getAttr, getUnitIconURL, getServiceName, getObservation} from '../../unit/helpers'; const UnitSuggestion = ({unit, ...rest}) => <Link to={`/unit/${unit.id}`} className="searc...
import React from 'react'; import {Link} from 'react-router'; import ObservationStatus from '../../unit/components/ObservationStatus'; import {getUnitIconURL, getServiceName, getObservation} from '../../unit/helpers'; const UnitSuggestion = ({unit, ...rest}, context) => <Link to={`/unit/${unit.id}`} className="searc...
Fix translations for unit fields in search suggestions
Fix translations for unit fields in search suggestions
JavaScript
mit
nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map,nordsoftware/outdoors-sports-map
--- +++ @@ -1,17 +1,21 @@ import React from 'react'; import {Link} from 'react-router'; import ObservationStatus from '../../unit/components/ObservationStatus'; -import {getAttr, getUnitIconURL, getServiceName, getObservation} from '../../unit/helpers'; +import {getUnitIconURL, getServiceName, getObservation} from...
4f61ec02643d6c200301c63c56c40c58bb6a3209
src/utils.js
src/utils.js
export function createPostbackAction(label, input, issuedAt) { return { type: 'postback', label, data: JSON.stringify({ input, issuedAt, }), }; } export function createFeedbackWords(feedbacks) { let positive = 0, negative = 0; feedbacks.forEach(e => { if (e.score > 0) { po...
export function createPostbackAction(label, input, issuedAt) { return { type: 'postback', label, data: JSON.stringify({ input, issuedAt, }), }; } export function createFeedbackWords(feedbacks) { let positive = 0; let negative = 0; feedbacks.forEach(e => { if (e.score > 0) { ...
Reword and add emoji on reference
Reword and add emoji on reference
JavaScript
mit
cofacts/rumors-line-bot,cofacts/rumors-line-bot,cofacts/rumors-line-bot
--- +++ @@ -10,7 +10,8 @@ } export function createFeedbackWords(feedbacks) { - let positive = 0, negative = 0; + let positive = 0; + let negative = 0; feedbacks.forEach(e => { if (e.score > 0) { positive++; @@ -28,5 +29,5 @@ export function createReferenceWords(reference) { if (reference) ...
168bd2c28dedbed8b7c22a97138bf33d487250e4
app/assets/javascripts/parent-taxon-prefix-preview.js
app/assets/javascripts/parent-taxon-prefix-preview.js
(function (Modules) { "use strict"; Modules.ParentTaxonPrefixPreview = function () { this.start = function(el) { var $parentSelectEl = $(el).find('select.js-parent-taxon'); var $pathPrefixEl = $(el).find('.js-path-prefix-hint'); updateBasePathPreview(); $parentSelectEl.change(updateBas...
(function (Modules) { "use strict"; Modules.ParentTaxonPrefixPreview = function () { this.start = function(el) { var $parentSelectEl = $(el).find('select.js-parent-taxon'); var $pathPrefixEl = $(el).find('.js-path-prefix-hint'); function getParentPathPrefix(callback) { var parentTaxo...
Move the ParentTaxonPrefixPreview logic to the bottom
Move the ParentTaxonPrefixPreview logic to the bottom The functions are hoisted anyway.
JavaScript
mit
alphagov/content-tagger,alphagov/content-tagger,alphagov/content-tagger
--- +++ @@ -5,9 +5,6 @@ this.start = function(el) { var $parentSelectEl = $(el).find('select.js-parent-taxon'); var $pathPrefixEl = $(el).find('.js-path-prefix-hint'); - - updateBasePathPreview(); - $parentSelectEl.change(updateBasePathPreview); function getParentPathPrefix(callb...
429d78580b2f78b0bb12c79fe182c77986f89a5d
server/utils/get-db-sort-index-map.js
server/utils/get-db-sort-index-map.js
// Returns primitive { ownerId: sortIndexValue } map for provided sortKeyPath 'use strict'; var ensureString = require('es5-ext/object/validate-stringifiable-value') , ee = require('event-emitter') , memoize = require('memoizee') , dbDriver = require('mano').dbDriver; module.exports = memoiz...
// Returns primitive { ownerId: sortIndexValue } map for provided sortKeyPath 'use strict'; var ensureString = require('es5-ext/object/validate-stringifiable-value') , ee = require('event-emitter') , memoize = require('memoizee') , dbDriver = require('mano').dbDriver , isArray = Array.isAr...
Support for multiple storage names
Support for multiple storage names
JavaScript
mit
egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations
--- +++ @@ -5,19 +5,33 @@ var ensureString = require('es5-ext/object/validate-stringifiable-value') , ee = require('event-emitter') , memoize = require('memoizee') - , dbDriver = require('mano').dbDriver; + , dbDriver = require('mano').dbDriver + + , isArray = Array.isArray; module...
7fa801c636d9b4bc3176699c154b927b8389cf8f
app/assets/javascripts/tagger/onClick/publishButton.js
app/assets/javascripts/tagger/onClick/publishButton.js
$(function() { $("#publishButton").click( function() { showPleaseWait('Publishing... (This can take some time depending on the number of resources you have selected..)'); if (!$(this).hasClass('disabled')) { // First save the draft state var str = processJSONOutput(); ...
$(function() { $("#publishButton").click( function() { if (!$(this).hasClass('disabled')) { showPleaseWait('Publishing... (This can take some time depending on the number of resources you have selected..)'); // First save the draft state var str = processJSONOutput(); ...
Move please wait to inside the block so we don't show it if its not actually publishing
Move please wait to inside the block so we don't show it if its not actually publishing
JavaScript
apache-2.0
inbloom/APP-tagger,inbloom/APP-tagger
--- +++ @@ -1,9 +1,9 @@ $(function() { $("#publishButton").click( function() { - showPleaseWait('Publishing... (This can take some time depending on the number of resources you have selected..)'); + if (!$(this).hasClass('disabled')) { + showPleaseWait('Publishing... (This can take ...
d2c4c56877f64262d2d7637021f94af75671e909
stamper.js
stamper.js
var page = require('webpage').create(), system = require('system'), address, output, size; if (system.args.length < 4 || system.args.length > 5) { console.log('Usage: '+system.args[0]+' URL selector filename [zoom]'); phantom.exit(1); } else { address = system.args[1]; selector = system.args[2]...
var page = require('webpage').create(), system = require('system'), address, output, size; page.viewportSize = { width: 640, height: 480 }; if (system.args.length < 4 || system.args.length > 5) { console.log('Usage: '+system.args[0]+' URL selector filename [zoom]'); phantom.exit(1); } else { a...
Set viewport size to 640 x 480
Set viewport size to 640 x 480
JavaScript
mit
buo/stamper
--- +++ @@ -1,6 +1,11 @@ var page = require('webpage').create(), system = require('system'), address, output, size; + +page.viewportSize = { + width: 640, + height: 480 +}; if (system.args.length < 4 || system.args.length > 5) { console.log('Usage: '+system.args[0]+' URL selector filename [zoom]'...
3bd40745f69a0f44bcb47dd77180e3a675fc851a
back/controllers/index.controller.js
back/controllers/index.controller.js
const path = require('path'); const express = require('express'); const router = express.Router(); const log = require('../logger'); const wordsRepository = new (require("../repositories/word.repository"))(); router.get('/', (req, res) => { wordsRepository.getRandomWords(6) .then(words => { res.render("ind...
const path = require('path'); const express = require('express'); const router = express.Router(); const log = require('../logger'); const wordsRepository = new (require("../repositories/word.repository"))(); router.get('/', (req, res) => { wordsRepository.getRandomWords(6) .then(words => { res.render("ind...
Add mapping to angular routes
feat(back): Add mapping to angular routes
JavaScript
bsd-3-clause
Saka7/word-kombat,Saka7/word-kombat,Saka7/word-kombat,Saka7/word-kombat
--- +++ @@ -17,9 +17,15 @@ }) }); -router.get(['/chat', '/account', '/leaderboards'], (req, res) => { - const mainFilePath = path.join(__dirname, '..', '..', 'front', 'dist', 'index.html'); - res.sendFile(path.join(mainFilePath)); +router.get([ + '/chat', + '/account', + '/leaderboards', + '/signin', + ...
2b4f8c7d914a2539af765ee2d1a56688073b2c25
app/assets/javascripts/express_admin/utility.js
app/assets/javascripts/express_admin/utility.js
$(function() { // toggle on/off switch $(document).on('click', '[data-toggle]', function() { targetHide = $(this).data('toggle-hide') targetShow = $(this).data('toggle-show') $('[data-toggle-name="' + targetHide + '"]').addClass('hide') $('[data-toggle-name="' + targetShow + '"]').removeClass('hi...
$(function() { // toggle on/off switch $(document).on('click', '[data-toggle]', function() { targetHide = $(this).data('toggle-hide') targetShow = $(this).data('toggle-show') $('[data-toggle-name="' + targetHide + '"]').addClass('hide') $('[data-toggle-name="' + targetShow + '"]').removeClass('hi...
Remove the auto focus on element toggle feature
Remove the auto focus on element toggle feature
JavaScript
mit
aelogica/express_admin,aelogica/express_admin,aelogica/express_admin,aelogica/express_admin
--- +++ @@ -6,7 +6,6 @@ targetShow = $(this).data('toggle-show') $('[data-toggle-name="' + targetHide + '"]').addClass('hide') $('[data-toggle-name="' + targetShow + '"]').removeClass('hide') - .find('input:text, textarea').first().focus() }); /...
6bb308cd9a8860e6b99d9c23e070386883feaf17
bundles/routing/bundle/inapprouting/instance.js
bundles/routing/bundle/inapprouting/instance.js
/** * This bundle logs the map click coordinates to the console. This is a demonstration of using DefaultExtension. * * @class Oskari.routing.bundle.inapprouting.InAppRoutingBundleInstance */ Oskari.clazz.define('Oskari.routing.bundle.inapprouting.InAppRoutingBundleInstance', /** * @method create called automa...
/** * This bundle logs the map click coordinates to the console. This is a demonstration of using DefaultExtension. * * @class Oskari.routing.bundle.inapprouting.InAppRoutingBundleInstance */ Oskari.clazz.define('Oskari.routing.bundle.inapprouting.InAppRoutingBundleInstance', /** * @method create called automa...
Make backend call for calculating route
Make backend call for calculating route
JavaScript
mit
uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend,uhef/Oskari-Routing-frontend
--- +++ @@ -25,13 +25,12 @@ getName : function () { return this.__name; }, - start: function() { - var sandbox = Oskari.getSandbox(); - console.log('Starting bundle with sandbox: ', sandbox); - }, eventHandlers: { 'MapClickedEvent': function (event) { - console.log(...
5387eae85dcaf6051d0d9fde7c108509d8cd7755
sandbox/run_rhino.js
sandbox/run_rhino.js
load('bower_components/qunit/qunit/qunit.js'); load('bower_components/qunit-tap/lib/qunit-tap.js'); load('bower_components/power-assert-formatter/lib/power-assert-formatter.js'); load('bower_components/empower/lib/empower.js'); (function () { qunitTap(QUnit, print, { showModuleNameOnFailure: true, ...
load('bower_components/qunit/qunit/qunit.js'); load('bower_components/qunit-tap/lib/qunit-tap.js'); load('bower_components/estraverse/estraverse.js'); load('bower_components/power-assert-formatter/lib/power-assert-formatter.js'); load('bower_components/empower/lib/empower.js'); (function () { qunitTap(QUnit, print...
Update Rhino example since power-assert-formatter requires estraverse as runtime dependency.
Update Rhino example since power-assert-formatter requires estraverse as runtime dependency.
JavaScript
mit
twada/power-assert,saneyuki/power-assert,power-assert-js/power-assert,twada/power-assert,falsandtru/power-assert,yagitoshiro/power-assert,falsandtru/power-assert,power-assert-js/power-assert,saneyuki/power-assert,yagitoshiro/power-assert
--- +++ @@ -1,5 +1,6 @@ load('bower_components/qunit/qunit/qunit.js'); load('bower_components/qunit-tap/lib/qunit-tap.js'); +load('bower_components/estraverse/estraverse.js'); load('bower_components/power-assert-formatter/lib/power-assert-formatter.js'); load('bower_components/empower/lib/empower.js');
ff82e198ca173fdbb5837982c3795af1dec3a15d
aura-components/src/main/components/ui/abstractList/abstractListRenderer.js
aura-components/src/main/components/ui/abstractList/abstractListRenderer.js
/* * Copyright (C) 2013 salesforce.com, inc. * * 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 ...
/* * Copyright (C) 2013 salesforce.com, inc. * * 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 ...
Make renderer polymorphically call updateEmptyListContent
Make renderer polymorphically call updateEmptyListContent @bug W-3836575@ @rev trey.washington@
JavaScript
apache-2.0
forcedotcom/aura,forcedotcom/aura,madmax983/aura,forcedotcom/aura,forcedotcom/aura,forcedotcom/aura,madmax983/aura,madmax983/aura,madmax983/aura,madmax983/aura,madmax983/aura
--- +++ @@ -25,10 +25,11 @@ this.superAfterRender(); helper.updateEmptyListContent(component); }, - rerender : function(component, helper){ + rerender : function(component){ this.superRerender(); - if (component.getConcreteComponent().isDirty('v.items')) { - hel...
582e35fe2da8239bec3675e837cb704f7275f1fc
examples/backbone_marionette/js/TodoMVC.Todos.js
examples/backbone_marionette/js/TodoMVC.Todos.js
/*global TodoMVC */ 'use strict'; TodoMVC.module('Todos', function (Todos, App, Backbone) { // Todo Model // ---------- Todos.Todo = Backbone.Model.extend({ defaults: { title: '', completed: false, created: 0 }, initialize: function () { if (this.isNew()) { this.set('created', Date.now()); ...
/*global TodoMVC */ 'use strict'; TodoMVC.module('Todos', function (Todos, App, Backbone) { // Todo Model // ---------- Todos.Todo = Backbone.Model.extend({ defaults: { title: '', completed: false, created: 0 }, initialize: function () { if (this.isNew()) { this.set('created', Date.now()); ...
Move attribute comparator with others
Move attribute comparator with others
JavaScript
mit
skatejs/todomvc,luxiaojian/todomvc,amy-chiu/todomvc,sophiango/todomvc,raiamber1/todomvc,Granze/todomvc,webcoding/todomvc,laomagege/todomvc,wangcan2014/todomvc,digideskio/todomvc,planttheidea/todomvc,wangjun/todomvc,vanyadymousky/todomvc,nbr1ninrsan2/todomvc,msi008/todomvc,mboudreau/todomvc,watonyweng/todomvc,nancy44/to...
--- +++ @@ -45,6 +45,8 @@ localStorage: new Backbone.LocalStorage('todos-backbone-marionette'), + comparator: 'created', + getCompleted: function () { return this.filter(this._isCompleted); }, @@ -53,8 +55,6 @@ return this.reject(this._isCompleted); }, - comparator: 'created', - _isComp...
acbd127fda54894c0f99b8f852c39402049bcabf
templates/sb-admin-v2/js/sb-admin.js
templates/sb-admin-v2/js/sb-admin.js
$(function() { $('#side-menu').metisMenu(); }); //Loads the correct sidebar on window load, //collapses the sidebar on window resize. $(function() { $(window).bind("load resize", function() { console.log($(this).width()) if ($(this).width() < 768) { $('div.sidebar-collapse').addCl...
$(function() { $('#side-menu').metisMenu(); }); //Loads the correct sidebar on window load, //collapses the sidebar on window resize. $(function() { $(window).bind("load resize", function() { if (this.window.innerWidth < 768) { $('div.sidebar-collapse').addClass('collapse') } else...
Use innerWindow as conditional comparison for appending/removing collapse class
Use innerWindow as conditional comparison for appending/removing collapse class
JavaScript
apache-2.0
habibmasuro/startbootstrap,roth1002/startbootstrap,javierperezferrada/startbootstrap,thejavamonk/startbootstrap,Sabertn/startbootstrap,agustik/startbootstrap,WangRex/startbootstrap,anupamme/startbootstrap,IronSummitMedia/startbootstrap,lee15/startbootstrap,lee15/startbootstrap,dguardia/startbootstrap,roth1002/startboot...
--- +++ @@ -8,8 +8,7 @@ //collapses the sidebar on window resize. $(function() { $(window).bind("load resize", function() { - console.log($(this).width()) - if ($(this).width() < 768) { + if (this.window.innerWidth < 768) { $('div.sidebar-collapse').addClass('collapse') ...
d4b1e50aa6d35fffc4e6ce579ea33c97d2799614
selfish-youtube.user.js
selfish-youtube.user.js
// ==UserScript== // @name Selfish Youtube // @namespace https://github.com/ASzc/selfish-youtube // @description On the watch page, prevent the share panel from being switched to after pressing Like // @include http://youtube.com/* // @include http://*.youtube.co...
// ==UserScript== // @name Selfish Youtube // @namespace https://github.com/ASzc/selfish-youtube // @description On the watch page, remove the share panel. // @include http://youtube.com/* // @include http://*.youtube.com/* // @include https://youtube...
Change to simple removal of the share panel and button
Change to simple removal of the share panel and button
JavaScript
mit
ASzc/selfish-youtube
--- +++ @@ -1,27 +1,26 @@ // ==UserScript== // @name Selfish Youtube // @namespace https://github.com/ASzc/selfish-youtube -// @description On the watch page, prevent the share panel from being switched to after pressing Like +// @description On the watch page, remove the s...
e16769cfb773e9e07b32e30ebebe9338f635b8e7
common.blocks/link/link.tests/simple.bemjson.js
common.blocks/link/link.tests/simple.bemjson.js
({ block : 'page', title : 'bem-components: link', mods : { theme : 'normal' }, head : [ { elem : 'css', url : '_simple.css' }, { elem : 'js', url : '_simple.js' } ], content : [ { block : 'link', content : 'Empty link 1' }, { ...
({ block : 'page', title : 'bem-components: link', mods : { theme : 'normal' }, head : [ { elem : 'css', url : '_simple.css' }, { elem : 'js', url : '_simple.js' } ], content : ['default', 'simple', 'normal'].map(function(theme, i) { var content = [ { bloc...
Add example cases for block:link
Add example cases for block:link
JavaScript
mpl-2.0
just-boris/bem-components,just-boris/bem-components,pepelsbey/bem-components,pepelsbey/bem-components,dojdev/bem-components,tadatuta/bem-components,tadatuta/bem-components,dojdev/bem-components,tadatuta/bem-components,pepelsbey/bem-components,dojdev/bem-components,just-boris/bem-components
--- +++ @@ -6,47 +6,51 @@ { elem : 'css', url : '_simple.css' }, { elem : 'js', url : '_simple.js' } ], - content : [ - { - block : 'link', - content : 'Empty link 1' - }, - { - block : 'link', - url : { - block ...
68045361c6f994e015f2d28026a443d67fc0507a
common/predictive-text/unit_tests/in_browser/cases/top-level-lmlayer.js
common/predictive-text/unit_tests/in_browser/cases/top-level-lmlayer.js
var assert = chai.assert; describe('LMLayer', function () { describe('[[constructor]]', function () { it('should construct with zero arguments', function () { let lmLayer = new LMLayer(); assert.instanceOf(lmLayer, LMLayer); }); }); describe('#initialize()', function () { // TODO: implem...
var assert = chai.assert; describe('LMLayer', function () { describe('[[constructor]]', function () { it('should construct with zero arguments', function () { let lmLayer = new LMLayer(); assert.instanceOf(lmLayer, LMLayer); }); }); describe('#asBlobURI()', function () { // #asBlobURI() ...
Remove test for configuration-negotiation (not applicable to dummy model).
Remove test for configuration-negotiation (not applicable to dummy model).
JavaScript
apache-2.0
tavultesoft/keymanweb,tavultesoft/keymanweb
--- +++ @@ -5,21 +5,6 @@ it('should construct with zero arguments', function () { let lmLayer = new LMLayer(); assert.instanceOf(lmLayer, LMLayer); - }); - }); - - describe('#initialize()', function () { - // TODO: implement configuration negotiation? - it.skip('should yield a reasonable...
27b62998e1c57d39bcd051c7c9d75ed487136af7
routes/main.js
routes/main.js
var express = require('express'); var utils = require('../utils'); var router = express.Router(); /** * Render the home page. */ router.get('/', function(req, res) { res.render('index.jade'); }); /** * Render the dashboard page. */ router.get('/dashboard', utils.requireLogin, function(req, res) { res.rende...
var express = require('express'); var utils = require('../utils'); var router = express.Router(); /** * Render the home page. */ router.get('/', function(req, res) { res.render('user/index.jade'); }); /** * Render the dashboard page. */ router.get('/dashboard', utils.requireLogin, function(req, res) { res....
Change the index default jade file
Change the index default jade file
JavaScript
mit
DecisionSystemsGroup/dsg.teiste.gr,DecisionSystemsGroup/dsg.teiste.gr,DecisionSystemsGroup/dsg.teiste.gr,DecisionSystemsGroup/dsg.teiste.gr
--- +++ @@ -8,7 +8,7 @@ * Render the home page. */ router.get('/', function(req, res) { - res.render('index.jade'); + res.render('user/index.jade'); });
f25865901f69302ca1f924ebb1644506ce6ec63c
index.js
index.js
/** Copyright 2015 Covistra Technologies Inc. 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 to in wr...
/** Copyright 2015 Covistra Technologies Inc. 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 to in wr...
Connect the socket.io instance to the API connection only
Connect the socket.io instance to the API connection only
JavaScript
apache-2.0
Covistra/hapi-plugin-covistra-socket
--- +++ @@ -20,12 +20,15 @@ "use strict"; exports.register = function (server, options, next) { - server.log(['plugin', 'info'], "Registering the Socket plugin"); - - var io = SocketIO.listen(server.listener); var log = server.plugins['covistra-system'].systemLog; var config = server.plugins['ha...
2fb53769d3e52170accaa7b978ca7eb1ca4f5ba0
index.js
index.js
import $ from 'jquery'; export default function plugit( pluginName, pluginClass ) { let dataName = `plugin_${pluginName}`; $.fn[pluginName] = function( options ) { return this.each( function() { let $this = $( this ); let data = $this.data( dataName ); if ( ! data ) { $this.data( dataName, ( data = ...
import $ from 'jquery'; export default function plugit( pluginName, pluginClass ) { let dataName = `plugin_${pluginName}`; $.fn[pluginName] = function( opts ) { return this.each( function() { let $this = $( this ); let data = $this.data( dataName ); let options = $.extend( {}, this._defaults, opts ); ...
Add cached element and props before construction, merge defaults.
Add cached element and props before construction, merge defaults.
JavaScript
mit
statnews/pugin
--- +++ @@ -3,10 +3,14 @@ export default function plugit( pluginName, pluginClass ) { let dataName = `plugin_${pluginName}`; - $.fn[pluginName] = function( options ) { + $.fn[pluginName] = function( opts ) { return this.each( function() { let $this = $( this ); let data = $this.data( dataName ); + l...
7482a98a1050118ec5f52568ea66945e5429162f
index.js
index.js
var gulp = require('gulp'); var elixir = require('laravel-elixir'); var urlAdjuster = require('gulp-css-url-adjuster'); /* |---------------------------------------------------------------- | adjust css urls for images and stuff |---------------------------------------------------------------- | | A wrapper for gu...
var gulp = require('gulp'); var elixir = require('laravel-elixir'); var urlAdjuster = require('gulp-css-url-adjuster'); var files = []; /* |---------------------------------------------------------------- | adjust css urls for images and stuff |---------------------------------------------------------------- | | ...
Allow for multiple files to be urlAdjsted.
Allow for multiple files to be urlAdjsted.
JavaScript
mit
farrrr/laravel-elixir-css-url-adjuster
--- +++ @@ -1,6 +1,7 @@ var gulp = require('gulp'); var elixir = require('laravel-elixir'); var urlAdjuster = require('gulp-css-url-adjuster'); +var files = []; /* |---------------------------------------------------------------- @@ -13,10 +14,22 @@ elixir.extend('urlAdjuster', function(input, options, out...
db100aa0ca744fb152d32b1453135c5175b78125
index.js
index.js
'use strict' const express = require('express') const bodyParser = require('body-parser') const config = require('./config') const app = express() const publisher = require('./publisher') var cronJob = require('cron').CronJob app.set('port', (process.env.PORT || config.PORT)) app.use(bodyParser.urlencoded({extended:...
'use strict' const express = require('express') const bodyParser = require('body-parser') const config = require('./config') const app = express() const publisher = require('./publisher') var cronJob = require('cron').CronJob app.set('port', (process.env.PORT || config.PORT)) app.use(bodyParser.urlencoded({extended:...
Change time frequency to publish message
Change time frequency to publish message
JavaScript
mit
igroomgrim/Crypty
--- +++ @@ -25,9 +25,9 @@ console.log(`Running Crypty on port : ${app.get('port')}`) var cryptoJob = new cronJob({ - cronTime: '0 */20 * * * *', + cronTime: '0 */60 * * * *', onTick: function () { - // Publish every 20 min + // Publish every 60 min publisher.publish() }, ...
0cb448c2978cdb213e9dc04ccad7fcc571f519c7
index.js
index.js
'use strict'; var nomnom = require('nomnom'); var signal = require('./lib/signal'); var tree = require('./lib/tree'); var task = function (name, callback, options) { var command = nomnom.command(name); options.forEach(function (option) { command = command.option(option.name, { abbr: opti...
'use strict'; var nomnom = require('nomnom'); var signal = require('./lib/signal'); var tree = require('./lib/tree'); var task = function (name, callback, options) { options = options || []; var command = nomnom.command(name); options.forEach(function (option) { command = command.option(option....
Allow task third parameter to be optional
Allow task third parameter to be optional
JavaScript
mit
byggjs/bygg
--- +++ @@ -6,6 +6,8 @@ var tree = require('./lib/tree'); var task = function (name, callback, options) { + options = options || []; + var command = nomnom.command(name); options.forEach(function (option) {
7e6be2fd2346557fc81bd544ac8745021c50e266
index.js
index.js
'use strict'; var toStr = Number.prototype.toString; module.exports = function isNumberObject(value) { if (typeof value === 'number') { return true; } if (typeof value !== 'object') { return false; } try { toStr.call(value); return true; } catch (e) { return false; } };
'use strict'; var toStr = Number.prototype.toString; var tryNumberObject = function tryNumberObject(value) { try { toStr.call(value); return true; } catch (e) { return false; } }; module.exports = function isNumberObject(value) { if (typeof value === 'number') { return true; } if (typeof value !== 'object'...
Improve optimizability of the non-try/catch part.
Improve optimizability of the non-try/catch part.
JavaScript
mit
ljharb/is-number-object
--- +++ @@ -1,10 +1,7 @@ 'use strict'; var toStr = Number.prototype.toString; - -module.exports = function isNumberObject(value) { - if (typeof value === 'number') { return true; } - if (typeof value !== 'object') { return false; } +var tryNumberObject = function tryNumberObject(value) { try { toStr.call(val...
0f375c2e85a348ce377cd7c6eced277b47a470ba
index.js
index.js
#!/usr/bin/env node /** * index.js * * for `character-map` command */ var opts = require('minimist')(process.argv.slice(2)); var opentype = require('opentype.js'); if (!opts.f || typeof opts.f !== 'string') { console.log('use -f to specify your font path, TrueType and OpenType supported'); return; } opentype....
#!/usr/bin/env node /** * index.js * * for `character-map` command */ var opts = require('minimist')(process.argv.slice(2)); var opentype = require('opentype.js'); if (!opts.f || typeof opts.f !== 'string') { console.log('use -f to specify your font path, TrueType and OpenType supported'); return; } opentype....
Fix broken iteration of items in Opentype.js slyphs object
Fix broken iteration of items in Opentype.js slyphs object
JavaScript
mit
bitinn/character-map
--- +++ @@ -20,17 +20,19 @@ return; } - if (!font.glyphs || font.glyphs.length === 0) { + var glyphs = font.glyphs.glyphs; + if (!glyphs || glyphs.length === 0) { console.log('no glyphs found in this font'); return; } var table = ''; - font.glyphs.forEach(function(glyph) { + Object.keys(glyphs).for...
73eb904356c11abab11481a9585005afc017edd8
src/conjure/fragment.js
src/conjure/fragment.js
'use strict'; export default class Fragment { render () { return null; } /** * Generic event handler. Turns class methods into closures that can be used as event handlers. If you need to use * data from the event object, or have access to the event object in general, use handleEvent inst...
'use strict'; export default class Fragment { render () { return null; } /** * Generic event handler. Turns class methods into closures that can be used as event handlers. If you need to use * data from the event object, or have access to the event object in general, use handleEvent inst...
Change order of arguments in Fragment.handle
Change order of arguments in Fragment.handle
JavaScript
mit
smiley325/conjure
--- +++ @@ -11,7 +11,7 @@ * * For non class methods (or methods that call into a different `this`, use framework/utils/handle). */ - handle (fn, final=false, args) { + handle (fn, args, final=false) { var self = this; return function (ev) {
70c052fb4faeafd3fa31fc3d030f70b5aed19b5c
src/internal/_curryN.js
src/internal/_curryN.js
var _arity = require('./_arity'); /** * Internal curryN function. * * @private * @category Function * @param {Number} length The arity of the curried function. * @return {array} An array of arguments received thus far. * @param {Function} fn The function to curry. */ module.exports = function _curryN(length, ...
var _arity = require('./_arity'); /** * Internal curryN function. * * @private * @category Function * @param {Number} length The arity of the curried function. * @param {Array} An array of arguments received thus far. * @param {Function} fn The function to curry. * @return {Function} The curried function. */...
Fix param/return documentation for internal curryN
Fix param/return documentation for internal curryN fix(_curryN) fix capitalization in return type
JavaScript
mit
jimf/ramda,arcseldon/ramda,maowug/ramda,kedashoe/ramda,asaf-romano/ramda,ccorcos/ramda,iofjuupasli/ramda,jimf/ramda,asaf-romano/ramda,besarthoxhaj/ramda,Bradcomp/ramda,davidchambers/ramda,ramda/ramda,svozza/ramda,arcseldon/ramda,maowug/ramda,Nigiss/ramda,CrossEye/ramda,angeloocana/ramda,angeloocana/ramda,Nigiss/ramda,r...
--- +++ @@ -7,8 +7,9 @@ * @private * @category Function * @param {Number} length The arity of the curried function. - * @return {array} An array of arguments received thus far. + * @param {Array} An array of arguments received thus far. * @param {Function} fn The function to curry. + * @return {Function} The ...
d14a4867f19147c40efa0d09fc1d623f7373424c
packages/accounts-oauth/package.js
packages/accounts-oauth/package.js
Package.describe({ summary: "Common code for OAuth-based login services", version: "1.3.0", }); Package.onUse(api => { api.use('check', 'server'); api.use('webapp', 'server'); api.use(['accounts-base', 'ecmascript'], ['client', 'server']); // Export Accounts (etc) to packages using this one. api.imply('a...
Package.describe({ summary: "Common code for OAuth-based login services", version: "1.3.1", }); Package.onUse(api => { api.use('check', 'server'); api.use('webapp', 'server'); api.use(['accounts-base', 'ecmascript'], ['client', 'server']); // Export Accounts (etc) to packages using this one. api.imply('a...
Bump patch version of accounts-oauth
Bump patch version of accounts-oauth
JavaScript
mit
Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor
--- +++ @@ -1,6 +1,6 @@ Package.describe({ summary: "Common code for OAuth-based login services", - version: "1.3.0", + version: "1.3.1", }); Package.onUse(api => {
1db4ea20c6ce67559a5c28b6b423abe292354dd8
app/assets/javascripts/mr_notes/index.js
app/assets/javascripts/mr_notes/index.js
import Vue from 'vue'; import notesApp from '../notes/components/notes_app.vue'; import discussionCounter from '../notes/components/discussion_counter.vue'; import store from '../notes/stores'; export default function initMrNotes() { // eslint-disable-next-line no-new new Vue({ el: '#js-vue-mr-discussions', ...
import Vue from 'vue'; import notesApp from '../notes/components/notes_app.vue'; import discussionCounter from '../notes/components/discussion_counter.vue'; import store from '../notes/stores'; export default function initMrNotes() { // eslint-disable-next-line no-new new Vue({ el: '#js-vue-mr-discussions', ...
Set noteableType on noteableData as provided from DOM dataset
Set noteableType on noteableData as provided from DOM dataset
JavaScript
mit
jirutka/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,dreampet/gitlab,iiet/iiet-git,axilleas/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,dreampet/gitlab,jirutka/gitlabhq,iiet/iiet-...
--- +++ @@ -13,8 +13,11 @@ data() { const notesDataset = document.getElementById('js-vue-mr-discussions') .dataset; + const noteableData = JSON.parse(notesDataset.noteableData); + noteableData.noteableType = notesDataset.noteableType; + return { - noteableData: JSON.parse(...
efbb2dbe9425a831507ccbab1843784b525a255a
src/Mailer.js
src/Mailer.js
/* * @Author: Mike Reich * @Date: 2016-01-26 11:48:16 * @Last Modified 2016-01-26 */ 'use strict'; import MandrilService from './MandrilService' export default class Mailer { constructor(app) { new MandrilService(app) this.app = app; this.mailer = app.get('mailer') this._services = []; th...
/* * @Author: Mike Reich * @Date: 2016-01-26 11:48:16 * @Last Modified 2016-01-26 */ 'use strict'; import MandrilService from './MandrilService' export default class Mailer { constructor(app) { this.app = app; this.mailer = app.get('mailer') if(this.app.config.MANDRILL_APIKEY || app.config.mandril...
Make Mandrill install only if service APIKEYs exist
Make Mandrill install only if service APIKEYs exist
JavaScript
mit
nxus/mailer
--- +++ @@ -11,10 +11,10 @@ export default class Mailer { constructor(app) { - new MandrilService(app) - this.app = app; this.mailer = app.get('mailer') + + if(this.app.config.MANDRILL_APIKEY || app.config.mandrill.api_key) new MandrilService(app) this._services = []; this.mailer.gat...
49ada139533acf0a1e743de8cf2cd7e668efb824
app/scripts/views/visits/date_divider.js
app/scripts/views/visits/date_divider.js
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ define([ 'underscore', 'moment', 'views/base', 'stache!templates/visits/date_divider', ], function (_, mom...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ define([ 'underscore', 'moment', 'views/base', 'stache!templates/visits/date_divider', ], function (_, mom...
Change date heading to use day of month with ordinal
fix(visit): Change date heading to use day of month with ordinal
JavaScript
mpl-2.0
mozilla/chronicle,mozilla/chronicle,mozilla/chronicle
--- +++ @@ -35,7 +35,7 @@ } else if (diff === -1) { formattedDate = 'Yesterday'; } else { - formattedDate = this.date.format('MMMM do'); + formattedDate = this.date.format('MMMM Do'); } return formattedDate;
221852e851ed84d1d8e2f5db6e973f0a8fcc7307
node4.js
node4.js
module.exports = { extends: [ './base.js' ], plugins: [ 'node' ], rules: { 'node/no-unsupported-features': 'error', 'node/no-deprecated-api': 'error', 'generator-star-spacing': ['error', { before: true }], 'template-curly-spacing': ['error', 'always'], 'prefer-arrow-callback': 'er...
module.exports = { extends: [ './base.js' ], plugins: [ 'node' ], rules: { 'node/no-unsupported-features': 'error', 'node/no-deprecated-api': 'error', 'generator-star-spacing': ['error', { before: true }], 'template-curly-spacing': ['error', 'always'], 'prefer-arrow-callback': 'er...
Fix sourceType in server config
Fix sourceType in server config
JavaScript
mit
logux/eslint-config-logux
--- +++ @@ -29,5 +29,8 @@ }, env: { es6: true + }, + parserOptions: { + sourceType: 'script' } }
700610e9881e6d19aaef5a8c6257b4cd6679f326
chrome/browser/resources/print_preview.js
chrome/browser/resources/print_preview.js
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var localStrings = new LocalStrings(); /** * Window onload handler, sets up the page. */ function load() { chrome.send('getPrinters'); }; /** *...
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var localStrings = new LocalStrings(); /** * Window onload handler, sets up the page. */ function load() { $('cancel-button').addEventListener('c...
Print Preview: Hook up the cancel button.
Print Preview: Hook up the cancel button. BUG=57895 TEST=manual Review URL: http://codereview.chromium.org/5151009 git-svn-id: http://src.chromium.org/svn/trunk/src@66822 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: b25a2a4aa82aa8107b7f95d2e4a61633652024d7
JavaScript
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u...
--- +++ @@ -8,6 +8,10 @@ * Window onload handler, sets up the page. */ function load() { + $('cancel-button').addEventListener('click', function(e) { + window.close(); + }); + chrome.send('getPrinters'); };
84414914d90dc00b512be0ba838b9df95399253d
src/api/baseUrl.js
src/api/baseUrl.js
export default function getBaseUrl() { const inDevelopment = window.location.hostname === 'localhost'; return inDevelopment ? 'http://localhost:3001/' : '/' }
export default function getBaseUrl() { return getQueryStringParameterByName('useMockApi') ? 'http://localhost:3001/' : '/'; } function getQueryStringParameterByName(name, url) { url = url || window.location.href; console.log(url.indexOf(name) > -1, url); return url.indexOf(name) > -1; }
Check for mock api in path
Check for mock api in path
JavaScript
mit
chrisrymer/js-dev-env,chrisrymer/js-dev-env
--- +++ @@ -1,4 +1,9 @@ export default function getBaseUrl() { - const inDevelopment = window.location.hostname === 'localhost'; - return inDevelopment ? 'http://localhost:3001/' : '/' + return getQueryStringParameterByName('useMockApi') ? 'http://localhost:3001/' : '/'; } + +function getQueryStringParameterByNa...
ddedc841fb1459118668496987704e085d315a83
client/templates/duplicates/duplicates.js
client/templates/duplicates/duplicates.js
Template.duplicates.onRendered(function() { var playlist_id = Router.current().params['_id'] Meteor.call('getDuplicateTracksFromPlaylist', playlist_id, function(err, response) { console.log(response); Session.set('duplicateTracks', response); Session.set('loadedDuplicates', true); ...
Template.duplicates.onRendered(function() { Session.set('loadedDuplicates', false); var playlist_id = Router.current().params['_id'] Meteor.call('getDuplicateTracksFromPlaylist', playlist_id, function(err, response) { console.log(response); Session.set('duplicateTracks', response); ...
Make spinner reappear on subsequent visits
Make spinner reappear on subsequent visits
JavaScript
mit
Assios/Spotify-Deduplicator,Assios/Spotify-Deduplicator
--- +++ @@ -1,4 +1,6 @@ Template.duplicates.onRendered(function() { + + Session.set('loadedDuplicates', false); var playlist_id = Router.current().params['_id']
e3f82b199c2f1e287b3d7892584c0836b894316e
Resources/utils/utils.js
Resources/utils/utils.js
var Utils = {}; (function() { Utils.convertTemp = function(temp) { if(Ti.App.Properties.getString('units','c')==='f') { return Math.round(temp*1.8+32) +'\u00b0F'; // convert to Fahrenheit & append degree symbol-F } else { return temp +'\u00b0C'; } }; Utils.weatherIcon = functio...
var Utils = {}; (function() { Utils.convertTemp = function(temp) { if(Ti.App.Properties.getString('units','c')==='f') { return Math.round(temp*1.8+32) +'\u00b0F'; // convert to Fahrenheit & append degree symbol-F } else { return temp +'\u00b0C'; } }; Utils.weatherIcon = functio...
Add caching mechanism for weather icons.
Add caching mechanism for weather icons.
JavaScript
apache-2.0
danielhanold/DannySink
--- +++ @@ -13,13 +13,29 @@ // Determine if this icon is already downloaded. var appDir = Ti.Filesystem.applicationDataDirectory; var file = Ti.Filesystem.getFile(appDir, 'weathericons/' + iconName); - // If the file does not already exists, download and store it. + + // If the file already e...
bbd0d87faade33d2a072b012ad163aa8ac1973c2
src/util/reactify.js
src/util/reactify.js
import Bit from '../components/Bit' import { createElement } from 'react' const COMMENT_TAG = '--' const DEFAULT_TAG = Bit // eslint-disable-next-line max-params function parse (buffer, doc, options, key) { switch (doc.type) { case 'text': return [...buffer, doc.content] case 'tag': { if (doc.na...
import Bit from '../components/Bit' import { createElement } from 'react' const COMMENT_TAG = '--' const DEFAULT_TAG = Bit // eslint-disable-next-line max-params function parse (buffer, doc, options, key) { switch (doc.type) { case 'text': return [...buffer, doc.content] case 'tag': { let childr...
Fix bug that caused HTML comments to halt all additional parsing
Fix bug that caused HTML comments to halt all additional parsing
JavaScript
mit
dlindahl/stemcell,dlindahl/stemcell
--- +++ @@ -10,14 +10,14 @@ case 'text': return [...buffer, doc.content] case 'tag': { - if (doc.name.startsWith(COMMENT_TAG)) { - return buffer - } - const tag = options.mappings[doc.name] || DEFAULT_TAG let children = reactify(doc.children, options, key) if (!chi...
83f96ed1f8fb5938b6b1c129ec19f3f7f1892ae1
src/test/ed/db/find2.js
src/test/ed/db/find2.js
// Test object id find. function testObjectIdFind( db ) { r = db.ed_db_find2_oif; r.drop(); z = [ {}, {}, {} ]; for( i = 0; i < z.length; ++i ) r.save( z[ i ] ); center = r.find( { _id: z[ 1 ]._id } ); assert.eq( 1, center.count() ); assert.eq( z[ 1 ]._id, center[ 0 ]._id ); lef...
// Test object id sorting. function testObjectIdFind( db ) { r = db.ed_db_find2_oif; r.drop(); for( i = 0; i < 3; ++i ) r.save( {} ); f = r.find().sort( { _id: 1 } ); assert.eq( 3, f.count() ); assert( f[ 0 ]._id < f[ 1 ]._id ); assert( f[ 1 ]._id < f[ 2 ]._id ); } db = connect( "test" ...
Test shouldn't assume object ids are strictly increasing
Test shouldn't assume object ids are strictly increasing
JavaScript
apache-2.0
babble/babble,babble/babble,babble/babble,babble/babble,babble/babble,babble/babble
--- +++ @@ -1,24 +1,16 @@ -// Test object id find. +// Test object id sorting. function testObjectIdFind( db ) { r = db.ed_db_find2_oif; r.drop(); - z = [ {}, {}, {} ]; - for( i = 0; i < z.length; ++i ) - r.save( z[ i ] ); - - center = r.find( { _id: z[ 1 ]._id } ); - assert.eq( 1, cent...
bcd2285e1e385ac8b527a0100470b073f9416210
routes/user.js
routes/user.js
var env = require('../lib/environment'); var persona = require('../lib/persona'); var util = require('util'); exports.login = function(req, res){ if (req.method === 'GET') return res.render("login.html"); var assertion = req.body.assertion; persona.verify(assertion, function (err, email) { if (err) ...
var env = require('../lib/environment'); var persona = require('../lib/persona'); var util = require('util'); exports.login = function(req, res){ if (req.method === 'GET') return res.render("login.html"); var assertion = req.body.assertion; persona.verify(assertion, function (err, email) { if (err) ...
Allow regexp for authorized array.
Allow regexp for authorized array.
JavaScript
mpl-2.0
kayaelle/msol-badger,bdgio/msol-site,kayaelle/msol-badger,kayaelle/msol-badger,bdgio/msol-site,mozilla/openbadger,bdgio/msol-site,mozilla/openbadger
--- +++ @@ -38,5 +38,12 @@ function userIsAuthorized(email) { var admins = env.get('admins'); - return admins.indexOf(email) >= -1; + var authorized = false; + admins.forEach(function (admin) { + if (authorized) return; + var adminRe = new RegExp(admin.replace('*', '.+?')); + if (adminRe.test(email)...
9ba19962871bac5bcf79db9be6252d0cc5cd966a
src/js/main.js
src/js/main.js
$(".hamburger").click(function () { $('.slider').slideToggle(); });
$(".hamburger").click(function () { $('.slider').slideToggle(); }); //TODO: Write own CSS animation or use animate.css or alternative
Add TODO to fix animation.
Add TODO to fix animation.
JavaScript
cc0-1.0
ShayHall/shayhall.github.io,ShayHall/shayhall.github.io
--- +++ @@ -1,3 +1,3 @@ $(".hamburger").click(function () { $('.slider').slideToggle(); -}); +}); //TODO: Write own CSS animation or use animate.css or alternative
b58632ecc31006ecb64f1879abc55537d44125b8
src/js/util.js
src/js/util.js
let Q = require("q"); module.exports = { // `pcall` takes a function that takes a set of arguments and // a callback (NON-Node.js style) and turns it into a promise // that gets resolved with the arguments to the callback. pcall: function(fn) { let deferred = Q.defer(); let callback = function() { ...
let Q = require("q"); module.exports = { // `pcall` takes a function that takes a set of arguments and // a callback (NON-Node.js style) and turns it into a promise // that gets resolved with the arguments to the callback. pcall: function(fn) { let deferred = Q.defer(); let callback = function() { ...
Add logging for pcall errors
Add logging for pcall errors
JavaScript
mit
jaredsohn/mutetab,jaredsohn/mutetab,jaredsohn/mutetab
--- +++ @@ -8,6 +8,10 @@ let deferred = Q.defer(); let callback = function() { deferred.resolve(Array.prototype.slice.call(arguments)[0]); + let message = chrome.runtime.lastError.message; + if (message != "") { + console.log("pcall message: " + message); + } }; let ne...
aacc74db050f1ba5889a12a35014d83070ed028b
src/mochito.js
src/mochito.js
'use strict'; var JsMockito = require('jsmockito').JsMockito; var JsHamcrest = require('jsmockito/node_modules/jshamcrest').JsHamcrest; var mochito = { installTo: function(target) { JsMockito.Integration.importTo(target); JsHamcrest.Integration.copyMembers(target); } }; mochito.installTo(mochito); module...
'use strict'; var JsMockito = require('jsmockito').JsMockito; // NOTE: the line below only works if you are using NPM 3, and even then it might fail! var JsHamcrest = require('jshamcrest').JsHamcrest; var mochito = { installTo: function(target) { JsMockito.Integration.importTo(target); JsHamcrest.Integratio...
Update to work in NPM 3
Update to work in NPM 3
JavaScript
apache-2.0
dchambers/mochito
--- +++ @@ -1,7 +1,8 @@ 'use strict'; var JsMockito = require('jsmockito').JsMockito; -var JsHamcrest = require('jsmockito/node_modules/jshamcrest').JsHamcrest; +// NOTE: the line below only works if you are using NPM 3, and even then it might fail! +var JsHamcrest = require('jshamcrest').JsHamcrest; var mochi...
8a5ae248a879106ab6f41cfdf8772ecd1bf667ab
src/logger_test.js
src/logger_test.js
/** * @module src/logger_test */ 'use strict' const test = require('unit.js') const logger = require('./logger') const sinon = test.sinon describe('src/logger', () => { it('load', () => { test.function(logger) }) describe('logger function', () => { it('should return a child bunyan logger', () => {...
Add unit tests for 100% coverage logger module
Add unit tests for 100% coverage logger module
JavaScript
mit
cflynn07/simple-producer-consumer,cflynn07/simple-producer-consumer
--- +++ @@ -0,0 +1,26 @@ +/** + * @module src/logger_test + */ +'use strict' + +const test = require('unit.js') + +const logger = require('./logger') + +const sinon = test.sinon + +describe('src/logger', () => { + + it('load', () => { + test.function(logger) + }) + + describe('logger function', () => { + it(...
d22f47cff38a0f65ae6e5fde9f1f6517ec0f2c57
spec/util/stringTest.js
spec/util/stringTest.js
const string = require('../../src/util/string.js'); describe('string', () => { it('exports string', () => { expect(string).toBeDefined(); }); describe('mapAscii', () => { it('should return same result for no-ops', () => { const before = string.mapAscii('', ''); const after = string.mapAscii(...
const string = require('../../src/util/string.js'); describe('string', () => { it('exports string', () => { expect(string).toBeDefined(); }); describe('mapAscii', () => { it('should return same result for no-ops', () => { const before = string.mapAscii('', ''); const after = string.mapAscii(...
Fix no-op test for string library.
Fix no-op test for string library.
JavaScript
mit
PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge
--- +++ @@ -24,7 +24,7 @@ const LEET = string.mapAscii('let', '137'); it('should be a no-op for empty strings', () => { - expect(string.translate('', '', '')).toEqual(''); + expect(string.translate('', NO_OP)).toEqual(''); }); it('should be a no-op for empty translations', () => {
2d092c88e1d45102dd32b9a9b92c7a1f5bd00d13
src/server/main.js
src/server/main.js
/* eslint-disable no-console */ import AccessTokenRetriever from './access-token-retriever'; import ConfigurationProvider from './configuration-provider'; import WebServer from './web-server'; import WindowsGraphUsersRetriever from './windows-graph-users-retriever'; export default class Main { constructor() { t...
/* eslint-disable no-console */ import AccessTokenRetriever from './access-token-retriever'; import ConfigurationProvider from './configuration-provider'; import WebServer from './web-server'; import WindowsGraphUsersRetriever from './windows-graph-users-retriever'; import RandomUsersRetriever from './random-users-ret...
Use RandomUsersRetriever when ENDPOINT_ID is not set
Use RandomUsersRetriever when ENDPOINT_ID is not set
JavaScript
mit
ritterim/star-orgs,kendaleiv/star-orgs,ritterim/star-orgs,kendaleiv/star-orgs
--- +++ @@ -4,6 +4,7 @@ import ConfigurationProvider from './configuration-provider'; import WebServer from './web-server'; import WindowsGraphUsersRetriever from './windows-graph-users-retriever'; +import RandomUsersRetriever from './random-users-retriever'; export default class Main { constructor() { @@ -2...