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
bc83a3b4a6b834e972cb2a723e692ec8491a290b
gulpfile.js
gulpfile.js
/** * @author Frank David Corona Prendes <frankdavid.corona@gmail.com> * @copyright MIT 2016 Frank David Corona Prendes * @description Tarea Gulp para la compresion de ficheros JS * @version 1.0.1 */ (function () { 'use strict'; var gulp = require('gulp'); var uglify = require('gulp-uglify'); var ...
/** * @author Frank David Corona Prendes <frankdavid.corona@gmail.com> * @copyright MIT 2016 Frank David Corona Prendes * @description Tarea Gulp para la compresion de ficheros JS * @version 1.0.1 */ (function () { 'use strict'; var gulp = require('gulp'); var uglify = require('gulp-uglify'); var ...
Change name of the default task
Change name of the default task
JavaScript
mit
frankdavidcorona/gcompress
--- +++ @@ -14,7 +14,7 @@ var recursive = require('recursive-readdir'); var logger = require('gulp-logger'); - gulp.task('gcompress', function () { + gulp.task('default', function () { recursive('"' + [argv.source + '"' + '/**/*.js'], function (err, file) { var options = { ...
1e0b79aa7b62e3162b98c277db248236b75f3a4a
gulpfile.js
gulpfile.js
var gulp = require('gulp'), concat = require('gulp-concat'), rename = require('gulp-rename'), uglify = require('gulp-uglify'); var SRC = 'src/*.js'; var DEST = 'dist/'; gulp.task('build', function() { gulp.src(SRC) .pipe(concat('jsonapi-datastore.js')) .pipe(gulp.dest(DEST)) .pipe(uglify()) ...
var gulp = require('gulp'), concat = require('gulp-concat'), rename = require('gulp-rename'), uglify = require('gulp-uglify'), mocha = require('gulp-mocha'); var SRC = 'src/*.js', DEST = 'dist/'; gulp.task('build', function() { gulp.src(SRC) .pipe(concat('jsonapi-datastore.js')) .pipe(gu...
Add gulp task for testing.
Add gulp task for testing.
JavaScript
mit
jamesdixon/jsonapi-datastore,niksy/jsonapi-datastore,beauby/jsonapi-datastore,jprincipe/jsonapi-datastore
--- +++ @@ -1,10 +1,11 @@ var gulp = require('gulp'), concat = require('gulp-concat'), rename = require('gulp-rename'), - uglify = require('gulp-uglify'); + uglify = require('gulp-uglify'), + mocha = require('gulp-mocha'); -var SRC = 'src/*.js'; -var DEST = 'dist/'; +var SRC = 'src/*.js', + D...
ffd4229e0940e26d7e4d5e948180c40bf14eb871
lib/sandbox.js
lib/sandbox.js
/* * Sandbox - A stripped down object of things that plugins can perform. * This object will be passed to plugins on command and hook execution. */ Sandbox = function(irc, commands, usage) { this.bot = { say: function(to, msg) { irc.say(to, msg); }, action: function(to, msg) { irc.action(t...
var path = require('path'); /* * Sandbox - A stripped down object of things that plugins can perform. * This object will be passed to plugins on command and hook execution. */ Sandbox = function(irc, commands, usage) { this.bot = { say: function(to, msg) { irc.say(to, msg); }, action: function(...
Add AdminSandbox for use with admin plugins.
Add AdminSandbox for use with admin plugins.
JavaScript
mit
jirwin/treslek,rackerlabs/treslek
--- +++ @@ -1,3 +1,5 @@ +var path = require('path'); + /* * Sandbox - A stripped down object of things that plugins can perform. * This object will be passed to plugins on command and hook execution. @@ -19,4 +21,76 @@ }; +/* + * Update Sandbox. + */ +Sandbox.prototype.update = function(commands, usage) { +...
d4b4d280ac3948dba4fe682deded95423e165685
polyglot/src/test/resources/test-js-plugins/hello-interceptor.js
polyglot/src/test/resources/test-js-plugins/hello-interceptor.js
export const options = { name: "helloWorldInterceptor", description: "modifies the response of helloWorldService", interceptPoint: "RESPONSE" } export function handle(req, res) { LOGGER.debug('response {}', res.getContent()); const rc = JSON.parse(res.getContent() || '{}'); let modifiedBody = ...
export const options = { name: "helloWorldInterceptor", description: "modifies the response of helloWorldService", interceptPoint: "RESPONSE" } export function handle(req, res) { LOGGER.debug('response {}', res.getContent()); const rc = JSON.parse(res.getContent() || '{}'); let modifiedBody = ...
Fix resolve() on test js interceptor
:bug: Fix resolve() on test js interceptor [skip ci]
JavaScript
agpl-3.0
SoftInstigate/restheart,SoftInstigate/restheart,SoftInstigate/restheart,SoftInstigate/restheart
--- +++ @@ -18,5 +18,5 @@ } export function resolve(req) { - return req.isHandledBy("helloWorldService") && req.isGet() && req.getContent(); + return req.isHandledBy("helloWorldService") && req.isGet() && req.getContent() !== null; }
d1eb4d23bdf6d84a17a9ef7175f6901ca7f40178
migrations/2_deploy_contracts.js
migrations/2_deploy_contracts.js
// var usingOraclize = artifacts.require("./usingOraclize.sol"); var Arbiter = artifacts.require("./Arbiter.sol"); var Judge = artifacts.require("./Judge.sol"); var ComputationService = artifacts.require("./ComputationService.sol"); module.exports = function(deployer) { //deployer.deploy(usingOraclize); //deployer...
// var usingOraclize = artifacts.require("./usingOraclize.sol"); var Arbiter = artifacts.require("./Arbiter.sol"); var Judge = artifacts.require("./Judge.sol"); var ComputationService = artifacts.require("./ComputationService.sol"); module.exports = function(deployer) { var arbiter, judge, computation; deployer.d...
Include registratin of judge and services in arbiter
Include registratin of judge and services in arbiter
JavaScript
mit
nud3l/verifying-computation-solidity,nud3l/verifying-computation-solidity
--- +++ @@ -4,20 +4,40 @@ var ComputationService = artifacts.require("./ComputationService.sol"); module.exports = function(deployer) { - //deployer.deploy(usingOraclize); - //deployer.link(ConvertLib, MetaCoin); - var contracts = []; + var arbiter, judge, computation; - // deploy one Arbiter - contracts....
a1354ce9155bb6609f56421033a5e889372d2b63
tetris.js
tetris.js
var removeExcessSpaces = function(htmlString) { var processedString = htmlString.replace(/\s+</g, '<'); processedString = processedString.replace(/>\s+/g, '>'); processedString = processedString.replace(/\:</g, ': <'); return processedString; } var ready = function(fn) { if(document.readyState != 'loading') { ...
var removeExcessSpaces = function(htmlString) { var processedString = htmlString.replace(/\s+</g, '<'); processedString = processedString.replace(/>\s+/g, '>'); processedString = processedString.replace(/_/g, ' '); return processedString; } var ready = function(fn) { if(document.readyState != 'loading') { f...
Update whitespace removal to convert underscores to spaces
Update whitespace removal to convert underscores to spaces
JavaScript
mit
peternatewood/tetrelementis,RoyTuesday/tetrelementis,RoyTuesday/tetrelementis,peternatewood/tetrelementis
--- +++ @@ -1,7 +1,7 @@ var removeExcessSpaces = function(htmlString) { var processedString = htmlString.replace(/\s+</g, '<'); processedString = processedString.replace(/>\s+/g, '>'); - processedString = processedString.replace(/\:</g, ': <'); + processedString = processedString.replace(/_/g, ' '); return p...
b48f8416fd6637d7fce284ff4e47b01df4829d57
src/core/AudioletParameter.js
src/core/AudioletParameter.js
var AudioletParameter = new Class({ initialize: function(node, inputIndex, value) { this.node = node; if (typeof inputIndex != 'undefined' && inputIndex != null) { this.input = node.inputs[inputIndex]; } else { this.input = null; } this.value =...
var AudioletParameter = new Class({ initialize: function(node, inputIndex, value) { this.node = node; if (typeof inputIndex != 'undefined' && inputIndex != null) { this.input = node.inputs[inputIndex]; } else { this.input = null; } this.value =...
Simplify isStatic and isDynamic logic, and make sure they return boolean values
Simplify isStatic and isDynamic logic, and make sure they return boolean values
JavaScript
apache-2.0
oampo/Audiolet,Kosar79/Audiolet,oampo/Audiolet,kn0ll/Audiolet,Kosar79/Audiolet,Kosar79/Audiolet,mcanthony/Audiolet,kn0ll/Audiolet,mcanthony/Audiolet,bobby-brennan/Audiolet,bobby-brennan/Audiolet
--- +++ @@ -12,14 +12,16 @@ isStatic: function() { var input = this.input; - return (!(input && - input.connectedFrom.length && - !(input.buffer.isEmpty))); + return (input == null || + input.connectedFrom.length == 0 || + i...
1935b925cc03c9e0d711b7e63c441580394e6d16
addon-test-support/index.js
addon-test-support/index.js
import { getContext, settled } from '@ember/test-helpers'; import { run } from '@ember/runloop'; export function setBreakpoint(breakpoint) { let breakpointArray = Array.isArray(breakpoint) ? breakpoint : [breakpoint]; let { owner } = getContext(); let breakpoints = owner.lookup('breakpoints:main'); let media =...
import { getContext, settled } from '@ember/test-helpers'; import { run } from '@ember/runloop'; export function setBreakpoint(breakpoint) { let breakpointArray = Array.isArray(breakpoint) ? breakpoint : [breakpoint]; let { owner } = getContext(); let breakpoints = owner.lookup('breakpoints:main'); let media =...
Make test support setBreakpoint IE11 compatible
Make test support setBreakpoint IE11 compatible
JavaScript
mit
freshbooks/ember-responsive,freshbooks/ember-responsive
--- +++ @@ -7,7 +7,8 @@ let breakpoints = owner.lookup('breakpoints:main'); let media = owner.lookup('service:media'); - for (let breakpointName of breakpointArray) { + for (let i = 0; i < breakpointArray.length; i++) { + let breakpointName = breakpointArray[i]; if (breakpointName === 'auto') { ...
c3a05985a25b38714e54de13c865f5322dc1b9d3
examples/method_routing/server.js
examples/method_routing/server.js
var jayson = require(__dirname + '/../..'); var format = require('util').format; var methods = { // a method that prints every request add: function(a, b, callback) { callback(null, a + b); } }; var server = jayson.server(methods, { router: function(method) { // regular by-name routing first if(ty...
var jayson = require(__dirname + '/../..'); var format = require('util').format; var methods = { // a method that prints every request add: function(a, b, callback) { callback(null, a + b); } }; var server = jayson.server(methods, { router: function(method) { // regular by-name routing first if(ty...
Convert method routing example to new method definition
Convert method routing example to new method definition
JavaScript
mit
taoyuan/jayson,Lughino/jayson,Meettya/jayson,tedeh/jayson,taoyuan/remjson,tedeh/jayson
--- +++ @@ -12,7 +12,10 @@ router: function(method) { // regular by-name routing first if(typeof(this._methods[method]) === 'function') return this._methods[method]; - if(method === 'add_2') return this._methods.add.bind(this, 2); + if(method === 'add_2') { + var fn = server.getMethod('add').g...
253d4358a60fb685b2e5583bb9a9245ed42ef140
examples/method_routing/server.js
examples/method_routing/server.js
var jayson = require(__dirname + '/../..'); var format = require('util').format; var methods = { // a method that prints every request add: function(a, b, callback) { callback(null, a + b); } }; var server = jayson.server(methods, { router: function(method) { // regular by-name routing first if(ty...
var jayson = require(__dirname + '/../..'); var format = require('util').format; var methods = { // a method that prints every request add: function(a, b, callback) { callback(null, a + b); } }; var server = jayson.server(methods, { router: function(method) { // regular by-name routing first if(ty...
Convert method routing example to new method definition
Convert method routing example to new method definition
JavaScript
mit
Meettya/jayson,tedeh/jayson,Lughino/jayson,taoyuan/jayson,tedeh/jayson,taoyuan/remjson
--- +++ @@ -12,7 +12,10 @@ router: function(method) { // regular by-name routing first if(typeof(this._methods[method]) === 'function') return this._methods[method]; - if(method === 'add_2') return this._methods.add.bind(this, 2); + if(method === 'add_2') { + var fn = server.getMethod('add').g...
627acdbfdeae585e449162fa15275df7ea270215
src/js/ripple/utils.web.js
src/js/ripple/utils.web.js
var exports = module.exports = require('./utils.js'); // We override this function for browsers, because they print objects nicer // natively than JSON.stringify can. exports.logObject = function (msg, obj) { if (/MSIE/.test(navigator.userAgent)) { console.log(msg, JSON.stringify(obj)); } else { console.lo...
var exports = module.exports = require('./utils.js'); // We override this function for browsers, because they print objects nicer // natively than JSON.stringify can. exports.logObject = function (msg, obj) { var args = Array.prototype.slice.call(arguments, 1); args = args.map(function(arg) { if (/MSIE/.test(...
Update in-browser logging to accommodate n-args
Update in-browser logging to accommodate n-args
JavaScript
isc
darkdarkdragon/ripple-lib,ripple/ripple-lib,ripple/ripple-lib,wilsonianb/ripple-lib,wilsonianb/ripple-lib,darkdarkdragon/ripple-lib,ripple/ripple-lib,darkdarkdragon/ripple-lib,wilsonianb/ripple-lib,ripple/ripple-lib
--- +++ @@ -3,9 +3,17 @@ // We override this function for browsers, because they print objects nicer // natively than JSON.stringify can. exports.logObject = function (msg, obj) { - if (/MSIE/.test(navigator.userAgent)) { - console.log(msg, JSON.stringify(obj)); - } else { - console.log(msg, "", obj); - }...
4b0c212b213b91fc37031c08aae5a30337728c79
public/script.js
public/script.js
'use strict'; /* * Tanura demo app. * * This is the main script of the app demonstrating Tanura's features. */ /** * Bootstrapping routine. */ window.onload = () => { console.log("Initializing Tanura..."); tanura.init( {video: true}, () => { console.log("Initialized."); ...
'use strict'; /* * Tanura demo app. * * This is the main script of the app demonstrating Tanura's features. */ /** * Bootstrapping routine. */ window.onload = () => { console.log("Initializing Tanura..."); tanura.init( {video: true}, () => { console.log("Initialized."); ...
Use the new event names in the demo.
Use the new event names in the demo.
JavaScript
agpl-3.0
theOtherNuvanda/Tanura,theOtherNuvanda/Tanura,theOtherNuvanda/Tanura
--- +++ @@ -18,7 +18,7 @@ // Example of how to handle Tanura's internally generated events. tanura.eventHandler.register( - 'resize', + 'client_resized', () => console.log("Caught a resize.")); }); }
1a024423c0ca91047eaeaa2d7fdc397d5a3b0635
src/components/apply/SubmitButton.js
src/components/apply/SubmitButton.js
import React, { Component } from 'react' import PropTypes from 'prop-types' import api from 'api' import { LargeButton } from '@hackclub/design-system' class SubmitButton extends Component { static propTypes = { status: PropTypes.oneOf(['incomplete', 'complete', 'submitted']).isRequired, applicationId: PropT...
import React, { Component } from 'react' import PropTypes from 'prop-types' import api from 'api' import { LargeButton } from '@hackclub/design-system' class SubmitButton extends Component { static propTypes = { status: PropTypes.oneOf(['incomplete', 'complete', 'submitted']).isRequired, applicationId: PropT...
Add 3 second delay to application submission
Add 3 second delay to application submission
JavaScript
mit
hackclub/website,hackclub/website,hackclub/website
--- +++ @@ -16,20 +16,21 @@ handleSubmit = () => { const { status, applicationId, callback } = this.props this.setState({ loading: true }) + if (status !== 'complete') return null // NOTE(@maxwofford): Give it 3 seconds of waiting to build up anticipation - if (status !== 'complete') return nu...
faa0e6ac15aca4dbae679cc20da587b4254f91ed
src/chrome/notification.js
src/chrome/notification.js
export class Notification { /** * @typedef NotificationOptions * @property {string} title * @property {string} message * @property {('basic'|'sms')} [type='basic'] */ /** * * @param {NotificationOptions} options */ constructor(options) { this.read = false; this.title = options.tit...
export class Notification { /** * @typedef NotificationData * @property {boolean} [read] * @property {string} title * @property {string} message * @property {('basic'|'sms')} [type='basic'] */ /** * * @param {NotificationData} data */ constructor(data) { this.read = 'read' in data ...
Add fromJSON, fix bug in toJSON
Add fromJSON, fix bug in toJSON
JavaScript
mit
nextgensparx/quantum-router,nextgensparx/quantum-router
--- +++ @@ -1,6 +1,7 @@ export class Notification { /** - * @typedef NotificationOptions + * @typedef NotificationData + * @property {boolean} [read] * @property {string} title * @property {string} message * @property {('basic'|'sms')} [type='basic'] @@ -8,12 +9,12 @@ /** * - * @param...
067de672c56f6e61d0563bf2deac4a0b67a8f8e4
src/components/apply/SubmitButton.js
src/components/apply/SubmitButton.js
import React, { Component } from 'react' import api from 'api' import storage from 'storage' import { LargeButton } from '@hackclub/design-system' class SubmitButton extends Component { constructor(props) { super(props) this.handleSubmit = this.handleSubmit.bind(this) } handleSubmit() { const { stat...
import React, { Component } from 'react' import api from 'api' import storage from 'storage' import { LargeButton } from '@hackclub/design-system' class SubmitButton extends Component { constructor(props) { super(props) this.handleSubmit = this.handleSubmit.bind(this) } handleSubmit() { const { stat...
Remove alert on application submission
Remove alert on application submission
JavaScript
mit
hackclub/website,hackclub/website,hackclub/website
--- +++ @@ -22,7 +22,6 @@ }) .then(json => { callback(json) - alert('Your application has been submitted!') }) .catch(e => { alert(e.statusText)
87fd189a152a926ba4a5b66bcdc70f09e7e6f6ec
js/turducken.js
js/turducken.js
"use strict"; function User( fName, lName) { this.fName = fName; this.lName = lName; //this.img = img; //need to add images and urls... this.posts = []; } User.prototype.newPost = function( content, socMedia ) { this.posts.push( new Post( content, socMedia )); } function pushToLocalStorage( user ...
"use strict"; function User( fName, lName) { this.fName = fName; this.lName = lName; //this.img = img; //need to add images and urls... this.posts = []; } User.prototype.newPost = function( content, socMedia ) { this.posts.push( new Post( content, socMedia )); } User.prototype.render = function(...
Reorder functions to align with execution flow.
Reorder functions to align with execution flow.
JavaScript
mit
sevfitz/turducken,sevfitz/turducken
--- +++ @@ -9,6 +9,17 @@ User.prototype.newPost = function( content, socMedia ) { this.posts.push( new Post( content, socMedia )); +} + + +User.prototype.render = function() { + console.table( this.posts ); +} + +function Post( content, socMedia ){ + this.content = content; + this.socMedia = socMedia...
8885b2f7712407d05d677b2c03822a40843509aa
js/calci.js
js/calci.js
$(document).ready(function() { $('.key').click(function() { var number = $(this).text(); $('#preview').append(number); }); });
function handleInput(key) { $('#preview').append(key); } $(document).ready(function() { $('.key').click(function() { var key = $(this).text(); if(key == "0") { if($('#preview').html() != "0") { handleInput(key); } } else { handleInput(key); } }); });
Handle edge cases with zero key
Handle edge cases with zero key
JavaScript
mit
CodeAstra/calculator,CodeAstra/calculator
--- +++ @@ -1,6 +1,16 @@ +function handleInput(key) { + $('#preview').append(key); +} + $(document).ready(function() { $('.key').click(function() { - var number = $(this).text(); - $('#preview').append(number); + var key = $(this).text(); + if(key == "0") { + if($('#preview').html() != "0") { + ...
bd87fe2da4bbf994ad72226de12c00ecf01223a2
src/client/sendMessages.js
src/client/sendMessages.js
'use strict'; /* This declares the function that will send a message */ function sendMessage(e) { e.preventDefault(); const inputNode = e.target.message; const message = inputNode.value; console.log("Sending message:", message); // Clear node inputNode.value = ''; // Send the message const xhr = new ...
'use strict'; /* This declares the function that will send a message */ function sendMessage(e) { e.preventDefault(); const inputNode = e.target.message; const message = inputNode.value + '\n'; console.log("Sending message:", message); // Clear node inputNode.value = ''; // Send the message const xhr...
Add newline to all sent messages
Add newline to all sent messages
JavaScript
mit
The1502Initiative/Instantaneous,The1502Initiative/Instantaneous,The1502Initiative/Instantaneous
--- +++ @@ -5,7 +5,7 @@ function sendMessage(e) { e.preventDefault(); const inputNode = e.target.message; - const message = inputNode.value; + const message = inputNode.value + '\n'; console.log("Sending message:", message); // Clear node inputNode.value = '';
f262509674196d05fc929b5b7c111a3a66f6f92c
app/actions/asyncActions.js
app/actions/asyncActions.js
import AsyncQueue from '../utils/asyncQueueStructures'; let asyncQueue = new AsyncQueue(); const endAsync = () => { return { type: 'ASYNC_INACTIVE' }; }; const callAsync = (dispatchFn, delay = 500, dispatchEnd, newState) => { if (!asyncQueue.size) { asyncQueue.listenForEnd(dispatchEnd); } asyncQueue.add(...
import AsyncQueue from '../utils/asyncQueueStructures'; let asyncQueue = new AsyncQueue(); const endAsync = () => ({ type: 'ASYNC_INACTIVE' }); const startAsync = () => ({ type: 'ASYNC_ACTIVE' }); const callAsync = (dispatchFn, newState) => (dispatch, getState) => { if (!asyncQueue.size) { asyncQueue.listenFo...
Use thunx to access delay state
Use thunx to access delay state
JavaScript
mit
ivtpz/brancher,ivtpz/brancher
--- +++ @@ -2,16 +2,16 @@ let asyncQueue = new AsyncQueue(); -const endAsync = () => { - return { type: 'ASYNC_INACTIVE' }; -}; +const endAsync = () => ({ type: 'ASYNC_INACTIVE' }); -const callAsync = (dispatchFn, delay = 500, dispatchEnd, newState) => { +const startAsync = () => ({ type: 'ASYNC_ACTIVE' }); +...
07f4d6e7ab4899cb1b85f12e9b0b05c0c0171341
src/community/community.js
src/community/community.js
import sqlite from 'sqlite' import winston from 'winston' export default class Community { static async init() { if (this.db) { return } this.db = await sqlite.open('/data/community.sqlite3').catch(winston.error) await this.db .run('CREATE TABLE IF NOT EXISTS villagers (guildId ...
import sqlite from 'sqlite' import winston from 'winston' export default class Community { static async init() { if (this.db) { return } this.db = await sqlite.open('/data/community.sqlite3').catch(winston.error) await this.db .run('CREATE TABLE IF NOT EXISTS villagers (guildId ...
Add automated, timed removal of quests
Add automated, timed removal of quests
JavaScript
mit
tinnvec/stonebot,tinnvec/stonebot
--- +++ @@ -8,5 +8,17 @@ await this.db .run('CREATE TABLE IF NOT EXISTS villagers (guildId INTEGER, userId INTEGER, bnetServer TEXT, bnetId TEXT, PRIMARY KEY(guildId, userId, bnetServer))') .catch(winston.error) + await this.db + .run('CREATE TABLE IF NOT EXISTS qu...
55c074a2c627187327dd98800d9524a9e725cb95
src/components/HomePage.js
src/components/HomePage.js
import React from 'react'; import {browserHistory} from 'react-router' import Login from './Login'; import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import * as actions from '../actions/LoginActions'; import {AUTHENTICATED, DEFAULT, ERROR, LOADING} from '../constants/loginStates' export ...
import React from 'react'; import {browserHistory} from 'react-router' import Login from './Login'; import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import * as actions from '../actions/LoginActions'; import {AUTHENTICATED, DEFAULT, ERROR, LOADING} from '../constants/loginStates' import Ci...
Add spinner when loggin in
Add spinner when loggin in
JavaScript
mit
nathejk/status-app,nathejk/status-app
--- +++ @@ -5,6 +5,7 @@ import {bindActionCreators} from 'redux'; import * as actions from '../actions/LoginActions'; import {AUTHENTICATED, DEFAULT, ERROR, LOADING} from '../constants/loginStates' +import CircularProgress from 'material-ui/CircularProgress'; export const HomePage = (props) => { @@ -19,6 +20,...
443c0f43039d6fd1fda9760d5fb2570f2a930ebd
packages/stockflux-watchlist/public/notificationHandler.js
packages/stockflux-watchlist/public/notificationHandler.js
/*eslint-disable-next-line no-unused-vars*/ function onNotificationMessage(message) { document.getElementById('symbol').innerHTML = message.symbol; document.getElementById('message').innerHTML = message.messageText; document.getElementById('watchlist-name').innerHTML = message.watchlistName ? ' ' + message.wa...
// eslint-disable-next-line no-unused-vars function onNotificationMessage(message) { document.getElementById('symbol').innerHTML = message.symbol; document.getElementById('message').innerHTML = message.messageText; document.getElementById('watchlist-name').innerHTML = message.watchlistName ? ' ' + message.wat...
Change multi-line comment to single-line
Change multi-line comment to single-line
JavaScript
mit
owennw/OpenFinD3FC,ScottLogic/bitflux-openfin,owennw/OpenFinD3FC,ScottLogic/StockFlux,ScottLogic/StockFlux,ScottLogic/bitflux-openfin
--- +++ @@ -1,4 +1,4 @@ -/*eslint-disable-next-line no-unused-vars*/ +// eslint-disable-next-line no-unused-vars function onNotificationMessage(message) { document.getElementById('symbol').innerHTML = message.symbol; document.getElementById('message').innerHTML = message.messageText;
aa94224f57fcd86704ff01ee1c7af299a75c95f8
lib/services/alter-items.js
lib/services/alter-items.js
const errors = require('@feathersjs/errors'); const getItems = require('./get-items'); const replaceItems = require('./replace-items'); module.exports = function (func) { if (!func) { func = () => {}; } if (typeof func !== 'function') { throw new errors.BadRequest('Function required. (alter)'); } ...
const errors = require('@feathersjs/errors'); const getItems = require('./get-items'); const replaceItems = require('./replace-items'); module.exports = function (func) { if (!func) { func = () => {}; } if (typeof func !== 'function') { throw new errors.BadRequest('Function required. (alter)'); } ...
Improve alterItems: better null-check for the returned value
Improve alterItems: better null-check for the returned value
JavaScript
mit
feathersjs/feathers-hooks-common
--- +++ @@ -18,7 +18,7 @@ (isArray ? items : [items]).forEach( (item, index) => { const result = func(item, context); - if (result != null) { + if (typeof result === 'object' && result !== null) { if (isArray) { items[index] = result; } else {
ffb497ac013b005aff799cb4523e9b772519636b
connectors/amazon-alexa.js
connectors/amazon-alexa.js
'use strict'; Connector.playerSelector = '#d-content'; Connector.getArtistTrack = () => { if (isPlayingLiveRadio()) { let songTitle = $('.d-queue-info .song-title').text(); return Util.splitArtistTrack(songTitle); } let artist = $('#d-info-text .d-sub-text-1').text(); let track = $('#d-info-text .d-main-text...
'use strict'; Connector.playerSelector = '#d-content'; Connector.remainingTimeSelector = '.d-np-time-display.remaining-time'; Connector.currentTimeSelector = '.d-np-time-display.elapsed-time'; Connector.getDuration = () => { let elapsed = Util.stringToSeconds($(Connector.currentTimeSelector).text()); let remaining...
Add duration parsing to Amazon Alexa connector
Add duration parsing to Amazon Alexa connector
JavaScript
mit
david-sabata/web-scrobbler,carpet-berlin/web-scrobbler,david-sabata/web-scrobbler,carpet-berlin/web-scrobbler,galeksandrp/web-scrobbler,galeksandrp/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,alexesprit/web-scrobbler,inverse/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,inverse/web-scrobbler,alexesprit/web-scrobb...
--- +++ @@ -1,6 +1,19 @@ 'use strict'; Connector.playerSelector = '#d-content'; +Connector.remainingTimeSelector = '.d-np-time-display.remaining-time'; +Connector.currentTimeSelector = '.d-np-time-display.elapsed-time'; + +Connector.getDuration = () => { + let elapsed = Util.stringToSeconds($(Connector.currentTi...
5fbfc2f76f3365c75ab2523d7807a4f3dc89a288
omod/src/main/webapp/resources/scripts/services/visitService.js
omod/src/main/webapp/resources/scripts/services/visitService.js
angular.module('visitService', ['ngResource', 'uicommons.common']) .factory('Visit', function($resource) { return $resource("/" + OPENMRS_CONTEXT_PATH + "/ws/rest/v1/visit/:uuid", { uuid: '@uuid' },{ query: { method:'GET', isArray:false } // OpenMRS RESTWS returns { "results...
angular.module('visitService', ['ngResource', 'uicommons.common']) .factory('Visit', function($resource) { return $resource("/" + OPENMRS_CONTEXT_PATH + "/ws/rest/v1/visit/:uuid", { uuid: '@uuid' },{ query: { method:'GET', isArray:false } // OpenMRS RESTWS returns { "results...
Support accessing visit/attribute sub-resource via REST
Support accessing visit/attribute sub-resource via REST
JavaScript
mpl-2.0
jdegraft/openmrs-module-uicommons,yadamz/first-module,yadamz/first-module,jdegraft/openmrs-module-uicommons,jdegraft/openmrs-module-uicommons,yadamz/first-module,yadamz/first-module,jdegraft/openmrs-module-uicommons
--- +++ @@ -6,7 +6,7 @@ query: { method:'GET', isArray:false } // OpenMRS RESTWS returns { "results": [] } }); }) - .factory('VisitService', function(Visit) { + .factory('VisitService', function(Visit, $resource) { return { @@ -25,6 +25,15 @@ // if visit has ...
4326d2baf1350e19c87db457a1e170e73bd0a11d
src/js/streams/stream-user.js
src/js/streams/stream-user.js
YUI.add("stream-user", function(Y) { "use strict"; var falco = Y.namespace("Falco"), streams = Y.namespace("Falco.Streams"), User; User = function() {}; User.prototype = { _create : function() { var stream; stream = falco.twitte...
YUI.add("stream-user", function(Y) { "use strict"; var falco = Y.namespace("Falco"), streams = Y.namespace("Falco.Streams"), User; User = function() {}; User.prototype = { _create : function() { var stream; stream = falco.twitte...
Remove unnecessary param, it's the default
Remove unnecessary param, it's the default
JavaScript
mit
tivac/falco,tivac/falco
--- +++ @@ -11,9 +11,7 @@ _create : function() { var stream; - stream = falco.twitter.stream("user", { - with : "followings" - }); + stream = falco.twitter.stream("user"); stream.on("tweet", this._tweet.bind...
c41ba3df26018ff84e6c5e73f06c7df36e508243
src/js/utils/ValidatorUtil.js
src/js/utils/ValidatorUtil.js
var ValidatorUtil = { isDefined: function (value) { return value != null && value !== '' || typeof value === 'number'; }, isEmail: function (email) { return email != null && email.length > 0 && !/\s/.test(email) && /.+@.+\..+/ .test(email); }, isEmpty: function (data) { i...
var ValidatorUtil = { isDefined: function (value) { return value != null && value !== '' || typeof value === 'number'; }, isEmail: function (email) { return email != null && email.length > 0 && !/\s/.test(email) && /.+@.+\..+/ .test(email); }, isEmpty: function (data) { i...
Use is number util to test input
Use is number util to test input
JavaScript
apache-2.0
dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui
--- +++ @@ -34,9 +34,8 @@ }, isInteger: function (value) { - const number = parseFloat(value); - - return Number.isInteger(number); + return ValidatorUtil.isNumber(value) && + Number.isInteger(parseFloat(value)); }, isNumber: function (value) { @@ -49,7 +48,7 @@ const {min = 0, max ...
b7f8dfb12f79012e5ded0b14684ad75ae7dc1821
lib/main.js
lib/main.js
// Define keyboard shortcuts for showing and hiding a custom panel. var { Cc, Ci } = require("chrome"); var { Hotkey } = require("hotkeys"); var panel = require("panel"); var timers = require("timers"); var data = require("self").data; var osString = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS; va...
// Define keyboard shortcuts for showing and hiding a custom panel. var { Cc, Ci } = require("chrome"); var { Hotkey } = require("hotkeys"); var panel = require("panel"); var timers = require("timers"); var data = require("self").data; var runtime = require("runtime"); var osString = runtime.OS; var osWarnFile; // Loa...
Use the interface from add-on sdk for OS
Use the interface from add-on sdk for OS
JavaScript
mit
rhelmer/warn-before-quit,rhelmer/warn-before-quit,nigelbabu/warn-before-quit,nigelbabu/warn-before-quit
--- +++ @@ -4,11 +4,12 @@ var panel = require("panel"); var timers = require("timers"); var data = require("self").data; -var osString = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS; +var runtime = require("runtime"); +var osString = runtime.OS; var osWarnFile; // Load the right warning -i...
a75fef48bfb440a22fdc9605d4e677b87ebf290f
local-cli/core/Constants.js
local-cli/core/Constants.js
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow * ...
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow * ...
Add code for generating remote assets
Add code for generating remote assets Reviewed By: davidaurelio Differential Revision: D6201839 fbshipit-source-id: 78c81eae03c6137ba9bbe33cd7aab8b87020f8d2
JavaScript
bsd-3-clause
jevakallio/react-native,Bhullnatik/react-native,exponentjs/react-native,facebook/react-native,ptmt/react-native-macos,ptmt/react-native-macos,pandiaraj44/react-native,hoastoolshop/react-native,pandiaraj44/react-native,kesha-antonov/react-native,facebook/react-native,hammerandchisel/react-native,hoangpham95/react-native...
--- +++ @@ -13,5 +13,10 @@ 'use strict'; const ASSET_REGISTRY_PATH = 'react-native/Libraries/Image/AssetRegistry'; +const ASSET_SOURCE_RESOLVER_PATH = + 'react-native/Libraries/Image/AssetSourceResolver'; -module.exports = {ASSET_REGISTRY_PATH}; +module.exports = { + ASSET_REGISTRY_PATH, + ASSET_SOURCE_RESOL...
12bfc2fdd9c1574eb37a68dc7b8fa9508b082118
lib/vector2d.js
lib/vector2d.js
class Vector2D { constructor(x, y) { this.x = x; this.y = y; } add(vec) { return new Vector2D(this.x + vec.x, this.y + vec.y); } multiply(factor) { return new Vector2D(this.x * factor, this.y * factor); } } Vector2D.fromPolar = function(deg, len) { let rad ...
class Vector2D { constructor(x, y) { this.x = x; this.y = y; } add(vec) { return new Vector2D(this.x + vec.x, this.y + vec.y); } multiply(factor) { return new Vector2D(this.x * factor, this.y * factor); } length() { return Math.sqrt(this.x * this.x,...
Add more functionality to vectors
Add more functionality to vectors
JavaScript
mit
190n/five.js
--- +++ @@ -11,10 +11,22 @@ multiply(factor) { return new Vector2D(this.x * factor, this.y * factor); } + + length() { + return Math.sqrt(this.x * this.x, this.y * this.y); + } + + angle() { + return Math.atan2(this.y, this.x) * (180 / Math.PI); + } + + toPolar() { + ...
29a464500056d1b0c80e4056139931cb77dacd53
public/fastboot-is-mobile.js
public/fastboot-is-mobile.js
/* globals define, FastBoot */ (function() { define('ismobilejs', ['exports'], function(exports) { 'use strict'; let isMobileClass = FastBoot.require('ismobilejs'); // Change the context so that when isMobile internally sets the results of // the user agent tests to the current scope, it doesn't use ...
/* globals define, FastBoot */ (function() { define('ismobilejs', ['exports'], function(exports) { 'use strict'; var isMobileClass = FastBoot.require('ismobilejs'); // Change the context so that when isMobile internally sets the results of // the user agent tests to the current scope, it doesn't use ...
Fix strict mode typo in fastboot module export
Fix strict mode typo in fastboot module export
JavaScript
mit
sandydoo/ember-is-mobile,sandydoo/ember-is-mobile
--- +++ @@ -3,7 +3,7 @@ define('ismobilejs', ['exports'], function(exports) { 'use strict'; - let isMobileClass = FastBoot.require('ismobilejs'); + var isMobileClass = FastBoot.require('ismobilejs'); // Change the context so that when isMobile internally sets the results of // the user agent...
fd5ee5b257ef44549c870abc620527dda9d4a358
src/mm-action/mm-action.js
src/mm-action/mm-action.js
/** * @license * Copyright (c) 2015 MediaMath Inc. All rights reserved. * This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt */ Polymer({ is: "mm-action", behaviors: [ StrandTraits.Stylable ], properties: { ver:{ type:String, value:"<<versio...
/** * @license * Copyright (c) 2015 MediaMath Inc. All rights reserved. * This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt */ (function (scope) { scope.Action = Polymer({ is: "mm-action", behaviors: [ StrandTraits.Stylable ], properties: { ...
Add correct IIF and scope
Add correct IIF and scope
JavaScript
bsd-3-clause
sassomedia/strand,anthonykoerber/strand,shuwen/strand,dlasky/strand,shuwen/strand,sassomedia/strand,anthonykoerber/strand,dlasky/strand
--- +++ @@ -4,55 +4,59 @@ * This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt */ -Polymer({ - is: "mm-action", +(function (scope) { - behaviors: [ - StrandTraits.Stylable - ], + scope.Action = Polymer({ + is: "mm-action", - properties: { - ver:{ ...
9b44e8f5367bf24b6d5c21d35f402bc0686c1383
src/modules/Application.js
src/modules/Application.js
class GelatoApplication extends Backbone.Model { constructor() { Backbone.$('body').prepend('<gelato-application></gelato-application>'); Backbone.$('gelato-application').append('<gelato-dialogs></gelato-dialogs>'); Backbone.$('gelato-application').append('<gelato-navbar></gelato-navbar>'); Backbone....
class GelatoApplication extends Backbone.View { constructor(options) { options = options || {}; options.tagName = 'gelato-application'; super(options); } render() { $(document.body).prepend(this.el); this.$el.append('<gelato-navbar></gelato-navbar>'); this.$el.append('<gelato-pages></ge...
Make application function more like a backbone view
Make application function more like a backbone view
JavaScript
mit
jernung/gelato,jernung/gelato,mcfarljw/gelato-framework,mcfarljw/backbone-gelato,mcfarljw/backbone-gelato,mcfarljw/gelato-framework
--- +++ @@ -1,13 +1,20 @@ -class GelatoApplication extends Backbone.Model { +class GelatoApplication extends Backbone.View { - constructor() { - Backbone.$('body').prepend('<gelato-application></gelato-application>'); - Backbone.$('gelato-application').append('<gelato-dialogs></gelato-dialogs>'); - Backbo...
cc4f209f011639d4f6888a39e71b1145e58cf5c5
src/route/changelogs.js
src/route/changelogs.js
const router = require('express').Router(); const scraper = require('../service/scraper'); router.get('/', (req, res, next) => { const packageName = req.query.package; if (!packageName) { const err = new Error('Undefined query'); err.satus = 404; next(err); } scraper ...
const router = require('express').Router(); const scraper = require('../service/scraper'); router.get('/:package/latest', (req, res, next) => { const packageName = req.params.package; if (!packageName) { const err = new Error('Undefined query'); err.satus = 404; next(err); } ...
Change package query from query param to path variable
Change package query from query param to path variable
JavaScript
mit
enric-sinh/android-changelog-api
--- +++ @@ -2,8 +2,8 @@ const scraper = require('../service/scraper'); -router.get('/', (req, res, next) => { - const packageName = req.query.package; +router.get('/:package/latest', (req, res, next) => { + const packageName = req.params.package; if (!packageName) { const err = new Error('U...
b32f0a37a944afeda9d59eb8169dbad0419c5e0e
controllers/locale.js
controllers/locale.js
/* * @author Martin Høgh <mh@mapcentia.com> * @copyright 2013-2018 MapCentia ApS * @license http://www.gnu.org/licenses/#AGPL GNU AFFERO GENERAL PUBLIC LICENSE 3 */ var express = require('express'); var router = express.Router(); router.get('/locale', function(request, response) { var lang = request....
/* * @author Martin Høgh <mh@mapcentia.com> * @copyright 2013-2018 MapCentia ApS * @license http://www.gnu.org/licenses/#AGPL GNU AFFERO GENERAL PUBLIC LICENSE 3 */ var express = require('express'); var router = express.Router(); var ipaddr = require('ipaddr.js'); router.get('/locale', function(request, ...
Return the clients IP address
Return the clients IP address
JavaScript
agpl-3.0
mapcentia/vidi,mapcentia/vidi,mapcentia/vidi,mapcentia/vidi
--- +++ @@ -6,8 +6,10 @@ var express = require('express'); var router = express.Router(); +var ipaddr = require('ipaddr.js'); router.get('/locale', function(request, response) { + var ip = ipaddr.process(request.ip).toString(); var lang = request.acceptsLanguages('en', 'en-US', 'da', 'da-DK'); if ...
943bc6d05065524b158ac7fc3be450126db3a558
website/app/application/core/projects/project/provenance/wizard/show-template-details.js
website/app/application/core/projects/project/provenance/wizard/show-template-details.js
Application.Directives.directive("showTemplateDetails", showTemplateDetailsDirective); function showTemplateDetailsDirective() { return { restrict: "E", replace: true, scope: { template: "=template", }, controller: "showTemplateDetailsDirectiveController", ...
Application.Directives.directive("showTemplateDetails", ["RecursionHelper", showTemplateDetailsDirective]); function showTemplateDetailsDirective(RecursionHelper) { return { restrict: "E", replace: true, scope: { template: "=template", }, ...
Allow directive to be called recursively.
Allow directive to be called recursively.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
--- +++ @@ -1,5 +1,6 @@ -Application.Directives.directive("showTemplateDetails", showTemplateDetailsDirective); -function showTemplateDetailsDirective() { +Application.Directives.directive("showTemplateDetails", + ["RecursionHelper", showTemplateDetailsDirective]); +function showTempla...
5ae8a55a75bef8a0af6d330842000152e2830c0e
lib/text.js
lib/text.js
exports._regExpRegExp = /^\/(.+)\/([im]?)$/; exports._lineRegExp = /\r\n|\r|\n/; exports.splitLines = function (text) { var lines = []; var match, line; while (match = exports._lineRegExp.exec(text)) { line = text.slice(0, match.index) + match[0]; text = text.slice(line.length); lines.push(line); }...
exports._regExpRegExp = /^\/(.+)\/([im]?)$/; exports._lineRegExp = /\r\n|\r|\n/; exports.splitLines = function (text) { var lines = []; var match, line; while (match = exports._lineRegExp.exec(text)) { line = text.slice(0, match.index) + match[0]; text = text.slice(line.length); lines.push(line); }...
Remove escapeRegExp in favor of lodash.escapeRegExp
Remove escapeRegExp in favor of lodash.escapeRegExp
JavaScript
mit
slap-editor/slap-util
--- +++ @@ -11,9 +11,6 @@ } lines.push(text); return lines; -}; -exports.escapeRegExp = function (text) { - return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); }; exports.regExpIndexOf = function(str, regex, index) { index = index || 0;
2edfecbcd8b891a839e3ee36ed18d8052900d134
src/dispatchResponse.js
src/dispatchResponse.js
/** * @flow */ type ResData = { newStates: {[key: string]: string} }; /** * Encode the updated states, to send to the client. * * @param updatedStates {StatesObject} The updated states * @param encodeState {(string, any) => string} A function that will encode the state, of a given store, to be * ...
/** * @flow */ type ResData = { newStates: {[key: string]: string} }; /** * Encode the updated states, to send to the client. * * @param updatedStates {StatesObject} The updated states * @param encodeState {(string, any) => string} A function that will encode the state, of a given store, to be * ...
Implement the Response's 'encode(...)' and 'decode(...)' Functions
Implement the Response's 'encode(...)' and 'decode(...)' Functions Implement 'encode(...)' and 'decode(...)' functions for the the response.
JavaScript
mit
nheyn/express-isomorphic-dispatcher
--- +++ @@ -16,8 +16,14 @@ * @return {ResData} The data to respond to the client with */ export function encode(updatedStates: StatesObject, encodeState: EncodeStateFunc): ResData { - //TODO - return {}; + const newStates = {}; + for(let storeName in updatedStates) { + const updatedState = updatedStates[...
0692f1a02b2dd231b40f06dce5941fdf15feecac
packages/react-cookie/src/withCookies.js
packages/react-cookie/src/withCookies.js
import React, { Component } from 'react'; import { instanceOf, func } from 'prop-types'; import Cookies from 'universal-cookie'; import hoistStatics from 'hoist-non-react-statics'; export default function withCookies(WrapperComponent) { class Wrapper extends Component { static displayName = `withCookies(${Compon...
import React, { Component } from 'react'; import { instanceOf, func } from 'prop-types'; import Cookies from 'universal-cookie'; import hoistStatics from 'hoist-non-react-statics'; export default function withCookies(WrapperComponent) { class Wrapper extends Component { static displayName = `withCookies(${Wrappe...
Fix undefined name of component
Fix undefined name of component Fix minor misspel, `Component` is `React.Component` now, should use name of `WrapperComponent` in `displayName`
JavaScript
mit
eXon/react-cookie,reactivestack/cookies,reactivestack/cookies,reactivestack/cookies
--- +++ @@ -5,8 +5,8 @@ export default function withCookies(WrapperComponent) { class Wrapper extends Component { - static displayName = `withCookies(${Component.displayName || - Component.name})`; + static displayName = `withCookies(${WrapperComponent.displayName || + WrapperComponent.name})`; ...
2800cd66ab65cc464c5ddeb1a619a2ed9e254e35
src/update.js
src/update.js
// @flow export default function (el: HTMLTextAreaElement, headToCursor: string, cursorToTail: ?string) { const curr = el.value, // strA + strB1 + strC next = headToCursor + (cursorToTail || ''), // strA + strB2 + strC activeElement = document.activeElement; // Calculat...
// @flow export default function (el: HTMLTextAreaElement, headToCursor: string, cursorToTail: ?string) { const curr = el.value, // strA + strB1 + strC next = headToCursor + (cursorToTail || ''), // strA + strB2 + strC activeElement = document.activeElement; // Calculat...
Fix a second infinite loop
Fix a second infinite loop
JavaScript
mit
yuku-t/undate,yuku-t/undate
--- +++ @@ -9,7 +9,7 @@ let aLength = 0, cLength = 0; while (aLength < curr.length && aLength < next.length && curr[aLength] === next[aLength]) { aLength++; } - while (curr[curr.length - cLength - 1] === next[next.length - cLength - 1]) { cLength++; } + while (curr.length - cLength - 1 >= 0 && next.len...
ea89c8e3f4068f775cca71dbfd6c2d8410addecb
lib/assets/javascripts/cartodb/new_common/url_shortener.js
lib/assets/javascripts/cartodb/new_common/url_shortener.js
var $ = require('jquery'); var LocalStorage = require('./local_storage'); var LOGIN = 'vizzuality'; var KEY = 'R_de188fd61320cb55d359b2fecd3dad4b'; var UrlShortener = function() { this.localStorage = new LocalStorage('cartodb_urls'); }; UrlShortener.prototype.fetch = function(originalUrl, callbacks) { var cached...
var $ = require('jquery'); var LocalStorage = require('./local_storage'); var LOGIN = 'vizzuality'; var KEY = 'R_de188fd61320cb55d359b2fecd3dad4b'; var UrlShortener = function() { this.localStorage = new LocalStorage('cartodb_urls2'); // to not clash with old local storage cache, they're incompatible }; UrlShorten...
Change key used for url shortener
Change key used for url shortener Incompatible with old keys, so do not use same key
JavaScript
bsd-3-clause
thorncp/cartodb,UCL-ShippingGroup/cartodb-1,thorncp/cartodb,DigitalCoder/cartodb,codeandtheory/cartodb,DigitalCoder/cartodb,nyimbi/cartodb,nuxcode/cartodb,UCL-ShippingGroup/cartodb-1,DigitalCoder/cartodb,codeandtheory/cartodb,nuxcode/cartodb,CartoDB/cartodb,bloomberg/cartodb,future-analytics/cartodb,nyimbi/cartodb,code...
--- +++ @@ -5,7 +5,7 @@ var KEY = 'R_de188fd61320cb55d359b2fecd3dad4b'; var UrlShortener = function() { - this.localStorage = new LocalStorage('cartodb_urls'); + this.localStorage = new LocalStorage('cartodb_urls2'); // to not clash with old local storage cache, they're incompatible }; UrlShortener.prototyp...
3b3de3a210fe69cd4e95f0c218801992cab0c88c
src/store/student-store.js
src/store/student-store.js
import { Store } from 'consus-core/flux'; import CartStore from './cart-store'; let student = null; class StudentStore extends Store{ hasOverdueItems(items){ return items.some(element => { return element.timestamp <= new Date().getTime(); }); } getStudent() { return st...
import { Store } from 'consus-core/flux'; import CartStore from './cart-store'; import { searchStudent } from '../lib/api-client'; let student = null; class StudentStore extends Store{ hasOverdueItems(items){ return items.some(element => { return element.timestamp <= new Date().getTime(); ...
Update student from server after checkout completes
Update student from server after checkout completes
JavaScript
unlicense
TheFourFifths/consus-client,TheFourFifths/consus-client
--- +++ @@ -1,5 +1,6 @@ import { Store } from 'consus-core/flux'; import CartStore from './cart-store'; +import { searchStudent } from '../lib/api-client'; let student = null; @@ -33,8 +34,10 @@ }); store.registerHandler('CHECKOUT_SUCCESS', () => { - student.items = student.items.concat(CartStore.getIte...
0be67d85e1d203b41d1dddded41f8d634e01a44f
packages/truffle-contract/statuserror.js
packages/truffle-contract/statuserror.js
var TruffleError = require("truffle-error"); var inherits = require("util").inherits; var defaultGas = 90000; var web3 = require("web3"); inherits(StatusError, TruffleError); function StatusError(args, tx, receipt) { var message; var gasLimit = parseInt(args.gas) || defaultGas; if(receipt.gasUsed === gasLimit)...
var TruffleError = require("truffle-error"); var inherits = require("util").inherits; var web3 = require("web3"); inherits(StatusError, TruffleError); var defaultGas = 90000; function StatusError(args, tx, receipt) { var message; var gasLimit = parseInt(args.gas) || defaultGas; if(receipt.gasUsed === gasLimit...
Move errant variable away from require block
Move errant variable away from require block
JavaScript
mit
ConsenSys/truffle
--- +++ @@ -1,9 +1,10 @@ var TruffleError = require("truffle-error"); var inherits = require("util").inherits; -var defaultGas = 90000; var web3 = require("web3"); inherits(StatusError, TruffleError); + +var defaultGas = 90000; function StatusError(args, tx, receipt) { var message;
88540362b4b676d68a2b5db474b9cb1bd7316aa3
packages/motion/src/cli/index.js
packages/motion/src/cli/index.js
#!/usr/bin/env node 'use strict' import commander from 'commander' const parameters = require('minimist')(process.argv.slice(2)) const command = parameters['_'][0] const validCommands = ['new', 'build', 'update', 'init'] // TODO: Check for updates // Note: This is a trick to make multiple commander commands work wi...
#!/usr/bin/env node 'use strict' const command = process.argv[2] || '' const validCommands = ['new', 'build', 'update', 'init'] // TODO: Check for updates // Note: This is a trick to make multiple commander commands work with single executables process.argv = process.argv.slice(0, 2).concat(process.argv.slice(3)) l...
Enhance the main cli entry file
:art: Enhance the main cli entry file
JavaScript
mpl-2.0
flintjs/flint,flintjs/flint,motion/motion,flintjs/flint,motion/motion
--- +++ @@ -1,10 +1,7 @@ #!/usr/bin/env node 'use strict' - -import commander from 'commander' -const parameters = require('minimist')(process.argv.slice(2)) -const command = parameters['_'][0] +const command = process.argv[2] || '' const validCommands = ['new', 'build', 'update', 'init'] // TODO: Check for u...
8486a37ca95cc2c211ec6a66b618e986e3d7dec6
server/server.js
server/server.js
const express = require('express'), bodyParser = require('body-parser'); const {mongoose} = require('./db/mongoose'), dbHandler = require('./db/dbHandler'); let app = express(); let port = porcess.env.PORT || 3000; app.use(bodyParser.json()); app.route('/todos') .get((req, res) => { dbHandler.findTodo...
const express = require('express'), bodyParser = require('body-parser'); const {mongoose} = require('./db/mongoose'), dbHandler = require('./db/dbHandler'); let app = express(); let port = process.env.PORT || 3000; app.use(bodyParser.json()); app.route('/todos') .get((req, res) => { dbHandler.findTodo...
Fix a typo setting the port
Fix a typo setting the port
JavaScript
mit
daniellara/smooky-todoes
--- +++ @@ -7,7 +7,7 @@ dbHandler = require('./db/dbHandler'); let app = express(); -let port = porcess.env.PORT || 3000; +let port = process.env.PORT || 3000; app.use(bodyParser.json());
75a7442f43aeaa63727ba09c892cb7b4f5e4f1c5
test/api/scenarios.spec.js
test/api/scenarios.spec.js
import { API } from 'api'; import Scenarios from 'api/scenarios'; describe('scenarios', () => { afterEach(() => { API.clearStorage(); }); it('should have currentScenario be set to "MockedRequests"', () => { expect(Scenarios.currentScenario).toBe('MockedRequests'); }); it('should get 0 scenarios', ...
import { API } from 'api'; import Scenarios from 'api/scenarios'; describe('scenarios', () => { afterEach(() => { API.clearStorage(); }); it('should have currentScenario be set to "MockedRequests"', () => { expect(Scenarios.currentScenario).toBe('MockedRequests'); }); it('should get 0 scenarios', ...
Add additional scenarios test cases
Add additional scenarios test cases
JavaScript
mit
500tech/bdsm,500tech/mimic,500tech/mimic,500tech/bdsm
--- +++ @@ -24,4 +24,53 @@ expect(Scenarios.scenarios[0].name).toBe('test scenario'); }); + it('should set the current scenario', () => { + Scenarios.addScenario('test scenario'); + + Scenarios.setCurrentScenario(Scenarios.scenarios[0].id); + expect(Scenarios.currentScenario).toBe(Scenarios.scenar...
17bc27925e2b02d4910cd6598af4bcbda7e4d8f0
src/tasks/watchBuild.js
src/tasks/watchBuild.js
/* * Copyright 2014 Workiva, LLC * * 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...
/* * Copyright 2014 Workiva, LLC * * 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...
Add styles to watched directories for watch:build/watch
Add styles to watched directories for watch:build/watch
JavaScript
apache-2.0
robertbaker/wGulp,Workiva/wGulp,Workiva/wGulp,jimhotchkin-wf/wGulp,jimhotchkin-wf/wGulp,robertbaker/wGulp,robertbaker/wGulp,jimhotchkin-wf/wGulp,Workiva/wGulp
--- +++ @@ -21,9 +21,10 @@ gulp.desc(taskname, 'Watch source files for changes and rebuild'); var fn = function(done) { - gulp.watch(options.glob.all, { - cwd: options.path.src - }, ['build']); + gulp.watch([ + options.path.src + options.glob.all, + op...
e5159760eea2faff47cc88518f5b4c3317b6b4ec
src/utils/gulp/gulp-tasks-linters.js
src/utils/gulp/gulp-tasks-linters.js
var path = require('path'); var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); function failLintBuild() { process.exit(1); } function scssLintExists() { return shelljs.which('scss-lint'); } module.exports = function(gulp, options) { var scssLintP...
var path = require('path'); var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); function scssLintExists() { return shelljs.which('scss-lint'); } module.exports = function(gulp, options) { var scssLintPath = path.resolve(__dirname, 'scss-lint.yml'); ...
Print all scsslint errors before existing.
Print all scsslint errors before existing.
JavaScript
apache-2.0
samogami/grommet,codeswan/grommet,phuson/grommet,HewlettPackard/grommet,davrodpin/grommet,HewlettPackard/grommet,samogami/grommet,Dinesh-Ramakrishnan/grommet,primozs/grommet,marlonpp/grommet-old,nanndoj/grommet,kylebyerly-hp/grommet,davrodpin/grommet,nickjvm/grommet,HewlettPackard/grommet,marlonpp/grommet-old,codeswan/...
--- +++ @@ -2,10 +2,6 @@ var eslint = require('gulp-eslint'); var merge = require('lodash/object/merge'); var shelljs = require('shelljs'); - -function failLintBuild() { - process.exit(1); -} function scssLintExists() { return shelljs.which('scss-lint'); @@ -24,7 +20,7 @@ var scsslint = require('gu...
b5af356f623429c5472f968ad2a84da9b599a7c4
test/setup.js
test/setup.js
import 'babel-polyfill' import fs from 'fs' import path from 'path' import jsdom from 'jsdom' import dotenv from 'dotenv' import chai, { expect } from 'chai' import chaiImmutable from 'chai-immutable' import sinon from 'sinon' import sinonChai from 'sinon-chai' import chaiSaga from './support/saga_helpers' chai.use(ch...
import 'babel-polyfill' import fs from 'fs' import path from 'path' import jsdom from 'jsdom' import dotenv from 'dotenv' import chai, { expect } from 'chai' import chaiImmutable from 'chai-immutable' import sinon from 'sinon' import sinonChai from 'sinon-chai' import chaiSaga from './support/saga_helpers' chai.use(ch...
Add a polyfill for matchMedia to get tests to run
Add a polyfill for matchMedia to get tests to run
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
--- +++ @@ -42,3 +42,13 @@ }) } +// this is a polyfill to get enquire.js to work in a headless +// environment. it is required by react-slick for carousels +window.matchMedia = window.matchMedia || function () { + return { + matches: false, + addListener: () => {}, + removeListener: () => {}, + } +} ...
9752da995a819fad7859f0bce13f1370bfda9f7b
server/routes/user-routes.js
server/routes/user-routes.js
var bcrypt = require('bcryptjs'); var router = require('express').Router(); var User = require('../models/user'); router.post('/', function(req, res) { var salt = bcrypt.genSaltSync(10); var user = new User({ username: req.body.user.username, name: req.body.user.name, password_digest: bcrypt.hashSync(...
var bcrypt = require('bcryptjs'); var jwt = require('jsonwebtoken'); var router = require('express').Router(); var User = require('../models/user'); router.post('/', function(req, res) { var salt = bcrypt.genSaltSync(10); var user = new User({ username: req.body.user.username, name: req.body.user.name, ...
Include auth token in sign up response.
Include auth token in sign up response.
JavaScript
mit
FretlessJS-2016-03/notely,FretlessJS-2016-03/notely
--- +++ @@ -1,4 +1,5 @@ var bcrypt = require('bcryptjs'); +var jwt = require('jsonwebtoken'); var router = require('express').Router(); var User = require('../models/user'); @@ -12,9 +13,14 @@ }); user.save().then(function(userData) { + var token = jwt.sign( + userData._id, + process.env.JWT...
a707369a96aa892764775146c0ca081c9b95c712
routes/front.js
routes/front.js
var express = require('express'); var router = express.Router(); router.get('/token', function (req, res) { res.redirect('/'); }); router.get('/*', function (req, res, next) { res.render('user/dashboard', { layout: 'user', title: 'Busy' }); }); module.exports = router;
var express = require('express'); var router = express.Router(); router.get('/*', function (req, res, next) { res.render('user/dashboard', { layout: 'user', title: 'Busy' }); }); module.exports = router;
Remove token endPoint; need to redeploy.
Remove token endPoint; need to redeploy.
JavaScript
mit
Sekhmet/busy,busyorg/busy,ryanbaer/busy,Sekhmet/busy,busyorg/busy,ryanbaer/busy
--- +++ @@ -1,9 +1,5 @@ var express = require('express'); var router = express.Router(); - -router.get('/token', function (req, res) { - res.redirect('/'); -}); router.get('/*', function (req, res, next) { res.render('user/dashboard', { layout: 'user', title: 'Busy' });
a115c44bcc17d6e6956d9d07030c2bb79c8a8f42
ssr-express/demo/app.js
ssr-express/demo/app.js
/** * Copyright 2018 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
/** * Copyright 2018 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
Remove amp-ssr component from demo
Remove amp-ssr component from demo Change-Id: I39067fd6e71f28a5365b447824280b7c4f71a01d
JavaScript
apache-2.0
ampproject/amp-toolbox,google/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,ampproject/amp-toolbox
--- +++ @@ -19,14 +19,10 @@ const path = require('path'); const app = express(); const AmpSsrMiddleware = require('../index.js'); -const ampSsr = require('amp-toolbox-ssr'); - -// Setup the middleware and pass the ampSsr instance that will perform the transformations. -const ampSsrMiddleware = AmpSsrMiddleware.cre...
99a416385af062898d0709b64493dcb8859e9e27
src/e2e-tests/basic.e2e.js
src/e2e-tests/basic.e2e.js
var assert = require('assert'); describe("Basic Test", function(){ it("Loads the basic demo page and sends values to server", function(){ browser.url('http://localhost:7888/src/e2e-tests/basic-demo-page?auto-activate-glasswing') browser.waitUntil(function () { var a = browser.execute(fu...
var assert = require('assert'); function assertContains(string, containedValue){ assert(string.indexOf(containedValue) !== -1) } describe("Basic Test", function(){ it("Loads the basic demo page and sends values to server", function(){ browser.url('http://localhost:7888/src/e2e-tests/basic-demo-page?au...
Check annotated source code renders.
Check annotated source code renders.
JavaScript
mit
mattzeunert/glasswing,mattzeunert/glasswing,mattzeunert/glasswing
--- +++ @@ -1,4 +1,8 @@ var assert = require('assert'); + +function assertContains(string, containedValue){ + assert(string.indexOf(containedValue) !== -1) +} describe("Basic Test", function(){ it("Loads the basic demo page and sends values to server", function(){ @@ -22,7 +26,12 @@ var fileLinks...
b4ab5d7ff3556f9a40c425afaa4dab5601b37027
models/paste.js
models/paste.js
const mongoose = require('mongoose'); const shortid = require('shortid'); const paste = new mongoose.Schema({ _id: { type: String, default: shortid.generate }, paste: { type: String }, expiresAt: { type: Date, expires: 0, default: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7) } }, { timestamps: true }); module.e...
const mongoose = require('mongoose'); const shortid = require('shortid'); const paste = new mongoose.Schema({ _id: { type: String, default: shortid.generate }, paste: { type: String }, expiresAt: { type: Date, expires: 0 } }, { timestamps: true }); module.exports = mongoose.model('Paste', paste);
Remove default expiry on model
Remove default expiry on model
JavaScript
mit
JoeBiellik/paste,JoeBiellik/paste
--- +++ @@ -4,7 +4,7 @@ const paste = new mongoose.Schema({ _id: { type: String, default: shortid.generate }, paste: { type: String }, - expiresAt: { type: Date, expires: 0, default: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7) } + expiresAt: { type: Date, expires: 0 } }, { timestamps: true });
0f3369a02a6386d8bfb895de09faa9b1c168715d
src/app/components/msp/common/consent-modal/i18n/data/en/index.js
src/app/components/msp/common/consent-modal/i18n/data/en/index.js
module.exports = { title: 'Information collection notice', body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and adminis...
module.exports = { title: 'Information collection notice', body: '<p>The data you enter on this form is saved locally to the computer or device you are using. The data will be deleted when you close the web browser you are using or after your submit your application.</p><p>The information in this application is col...
Add info re: data saving
Add info re: data saving
JavaScript
apache-2.0
bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP
--- +++ @@ -1,6 +1,6 @@ module.exports = { title: 'Information collection notice', - body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health ca...
e2bff214c4773626816d3f58d19a2a84451c333d
src/astring_plugin/index.js
src/astring_plugin/index.js
import astring from 'astring'; // Create a custom generator that inherits from Astring's default generator const customGenerator = Object.assign({}, astring.defaultGenerator, { Literal(node, state) { if (node.raw != null) { const first = node.raw.charAt(0); const last = node.raw.charAt(node.raw.lengt...
import astring from 'astring'; // Create a custom generator that inherits from Astring's default generator const customGenerator = Object.assign({}, astring.defaultGenerator, { Literal(node, state) { if (node.raw != null) { const first = node.raw.charAt(0).charCodeAt(); const last = node.raw.charAt(n...
Fix the bug hidden in astring plugin
Fix the bug hidden in astring plugin
JavaScript
mit
laosb/hatp
--- +++ @@ -4,17 +4,16 @@ const customGenerator = Object.assign({}, astring.defaultGenerator, { Literal(node, state) { if (node.raw != null) { - const first = node.raw.charAt(0); - const last = node.raw.charAt(node.raw.length - 1); + const first = node.raw.charAt(0).charCodeAt(); + const ...
8a5185e85c1f6206ed59256b2a6c2e996af96a6b
tools/bundle-deploy.js
tools/bundle-deploy.js
const { execSync } = require('child_process'); const path = require('path'); execSync(` git config user.email "andrey.a.gubanov@gmail.com" && git config user.name "Andrey Gubanov (his digital copy)" && git clone -b gh-pages https://$GH_TOKEN@github.com/matreshkajs/matreshka-router.git && npm run bundle...
const { execSync } = require('child_process'); const path = require('path'); execSync(` git config user.email "andrey.a.gubanov@gmail.com" && git config user.name "Andrey Gubanov (his digital copy)" && git clone -b gh-pages https://$GH_TOKEN@github.com/matreshkajs/matreshka-router.git bundle && npm run...
Clone bundle repo tu bundle folder
fix: Clone bundle repo tu bundle folder
JavaScript
mit
matreshkajs/matreshka-router,finom/matreshka_router
--- +++ @@ -4,7 +4,7 @@ execSync(` git config user.email "andrey.a.gubanov@gmail.com" && git config user.name "Andrey Gubanov (his digital copy)" && - git clone -b gh-pages https://$GH_TOKEN@github.com/matreshkajs/matreshka-router.git && + git clone -b gh-pages https://$GH_TOKEN@github.com/matreshkaj...
fc31a6711da30682e208cc257b567c136fe9a6b5
client/src/entrypoints/snippets/snippet-chooser-modal.js
client/src/entrypoints/snippets/snippet-chooser-modal.js
import $ from 'jquery'; window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = { choose: function (modal) { function ajaxifyLinks(context) { $('a.snippet-choice', modal.body).on('click', function () { modal.loadUrl(this.href); return false; }); $('.pagination a', context).on('click', f...
import $ from 'jquery'; import { SearchController } from '../../includes/chooserModal'; window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = { choose: function (modal) { function ajaxifyLinks(context) { $('a.snippet-choice', modal.body).on('click', function () { modal.loadUrl(this.href); return f...
Use SearchController on snippet chooser modal
Use SearchController on snippet chooser modal
JavaScript
bsd-3-clause
wagtail/wagtail,wagtail/wagtail,rsalmaso/wagtail,wagtail/wagtail,thenewguy/wagtail,thenewguy/wagtail,zerolab/wagtail,rsalmaso/wagtail,wagtail/wagtail,rsalmaso/wagtail,thenewguy/wagtail,zerolab/wagtail,thenewguy/wagtail,rsalmaso/wagtail,zerolab/wagtail,zerolab/wagtail,wagtail/wagtail,rsalmaso/wagtail,thenewguy/wagtail,z...
--- +++ @@ -1,4 +1,5 @@ import $ from 'jquery'; +import { SearchController } from '../../includes/chooserModal'; window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = { choose: function (modal) { @@ -9,49 +10,20 @@ }); $('.pagination a', context).on('click', function () { - loadResults(this.hre...
fc610c08cd26d108ee1e48da4b19bd8c90cf570f
app/assets/javascripts/spree/backend/solidus_paypal_braintree.js
app/assets/javascripts/spree/backend/solidus_paypal_braintree.js
//= require spree/braintree_hosted_form.js $(function() { var $paymentForm = $("#new_payment"), $hostedFields = $("[data-braintree-hosted-fields]"); function onError (err) { var msg = err.name + ": " + err.message; show_flash("error", msg); console.error(err); } // exit early if we're not l...
//= require spree/braintree_hosted_form.js $(function() { var $paymentForm = $("#new_payment"), $hostedFields = $("[data-braintree-hosted-fields]"); function onError (err) { var msg = err.name + ": " + err.message; show_flash("error", msg); console.error(err); } // exit early if we're not l...
Load the braintree client on demand libs in admin
Load the braintree client on demand libs in admin Like in frontend we load the braintree client libs on demand and then initialize the hosted fields.
JavaScript
bsd-3-clause
solidusio/solidus_paypal_braintree,solidusio/solidus_paypal_braintree,solidusio/solidus_paypal_braintree,solidusio/solidus_paypal_braintree
--- +++ @@ -14,29 +14,34 @@ // SolidusPaypalBraintree payment methods have been configured. if (!$paymentForm.length || !$hostedFields.length) { return; } - $hostedFields.each(function() { - var $this = $(this), - $new = $("[name=card]", $this); + $.when( + $.getScript("https://js.braintreegate...
5b30c625b6d59e087341259174e78b97db07eb4a
lib/nb-slug.js
lib/nb-slug.js
'use strict'; var diacritics = require('./diacritics'); function nbSlug(name) { var diacriticsMap = {}; for (var i = 0; i < diacritics.length; i++) { var letters = diacritics[i].letters; for (var j = 0; j < letters.length ; j++) { diacriticsMap[letters[j]] = diacritics[i].base; } } functi...
'use strict'; var diacritics = require('./diacritics'); function nbSlug(name) { var diacriticsMap = {}; for (var i = 0; i < diacritics.length; i++) { var letters = diacritics[i].letters; for (var j = 0; j < letters.length ; j++) { diacriticsMap[letters[j]] = diacritics[i].base; } } functi...
Remove -, !, + and ~ from the slug too
Remove -, !, + and ~ from the slug too
JavaScript
unlicense
nurimba/nb-slug,nurimba/nb-slug
--- +++ @@ -23,12 +23,9 @@ .replace(/^\s\s*/, '') // Trim start .replace(/\s\s*$/, '') // Trim end .toLowerCase() // Camel case is bad - .replace(/[^a-z0-9_\-~!\+\s]+/g, '') // Exchange invalid chars + .replace(/[^a-z0-9\-\s]+/g, '') // Exchange invalid chars .replace(/[\s]+/g, '-') // Swap ...
55ab768d9fd5adf4fbefa3db2d121fdbe6c840f4
resources/js/modules/accordion.js
resources/js/modules/accordion.js
import 'accordion/src/accordion.js'; (function() { "use strict"; document.querySelectorAll('.accordion').forEach(function(item) { new Accordion(item, { onToggle: function(target){ // Only allow one accordion item open at time target.accordion.folds.forEach(f...
import 'accordion/src/accordion.js'; (function() { "use strict"; document.querySelectorAll('.accordion').forEach(function(item) { new Accordion(item, { onToggle: function(target){ // Only allow one accordion item open at time target.accordion.folds.forEach(f...
Set the role to button instead of tab
Set the role to button instead of tab
JavaScript
mit
waynestate/base-site,waynestate/base-site
--- +++ @@ -26,6 +26,10 @@ // Remove the role="tablist" since it is not needed item.removeAttribute('role'); + + item.querySelectorAll('li a:first-child').forEach(function(item) { + item.setAttribute('role', 'button'); + }); }); document.querySelectorAll('ul.ac...
2a8170bd4f0ed6fad4dcd8441c2e8d162fbc4431
simple-todos.js
simple-todos.js
if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ tasks: [ { text: "This is task 1" }, { text: "This is task 2" }, { text: "This is task 3" } ] }); }
Tasks = new Mongo.Collection("tasks"); if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ tasks: function () { return Tasks.find({}); } }); }
Make tasks a MongoDB collection.
Make tasks a MongoDB collection.
JavaScript
mit
chooie/meteor-todo
--- +++ @@ -1,10 +1,10 @@ +Tasks = new Mongo.Collection("tasks"); + if (Meteor.isClient) { // This code only runs on the client Template.body.helpers({ - tasks: [ - { text: "This is task 1" }, - { text: "This is task 2" }, - { text: "This is task 3" } - ] + tasks: function () { + r...
c5ca7c86331bb349c4bd3ccd7d5c12cdce0fa924
utils/getOutputPath.js
utils/getOutputPath.js
const path = require('path'); const getOptions = require('./getOptions'); module.exports = (options, jestRootDir) => { // Override outputName and outputDirectory with outputFile if outputFile is defined let output = options.outputFile; if (!output) { // Set output to use new outputDirectory and fallback on ...
const path = require('path'); const getOptions = require('./getOptions'); module.exports = (options, jestRootDir) => { // Override outputName and outputDirectory with outputFile if outputFile is defined let output = options.outputFile; if (!output) { // Set output to use new outputDirectory and fallback on ...
Replace <rootDir> prior to path.join().
Replace <rootDir> prior to path.join(). This allows outputDirectory to be formatted like <rootDir>/../some/dir. In that case, path.join() assumes the .. cancels out the <rootDir>, which seems entirely reasonable. Unfortunately, it means the final value is some/dir, and that ends up rooted at process.cwd(), which doesn...
JavaScript
apache-2.0
palmerj3/jest-junit
--- +++ @@ -7,7 +7,9 @@ if (!output) { // Set output to use new outputDirectory and fallback on original output const outputName = (options.uniqueOutputName === 'true') ? getOptions.getUniqueOutputName() : options.outputName - output = path.join(options.outputDirectory, outputName); + output = ge...
39b2bb6cf1148bb0c63d19b52473c46e77c5c212
src/components/SSOLanding.js
src/components/SSOLanding.js
import React from 'react'; import PropTypes from 'prop-types'; import { withRouter } from 'react-router'; import Link from 'react-router-dom/Link'; import queryString from 'query-string'; const SSOLanding = (props) => { const search = props.location.search; if (!search) { return <div>No search string</div>; ...
import React from 'react'; import PropTypes from 'prop-types'; import { withRouter } from 'react-router'; import Link from 'react-router-dom/Link'; import queryString from 'query-string'; const SSOLanding = (props) => { const search = props.location.search; if (!search) { return <div>No search string</div>; ...
Change name of SSO token parameter from sso-token to ssoToken
Change name of SSO token parameter from sso-token to ssoToken This makes is consistent with the cookie-name that I am about to implement. The spec for cookies says hyphens are OK in the name, but not everyone's experience agrees: see https://stackoverflow.com/a/27235182 Modifies STCOR-20; relates to STCOR-38.
JavaScript
apache-2.0
folio-org/stripes-core,folio-org/stripes-core,folio-org/stripes-core
--- +++ @@ -10,9 +10,9 @@ return <div>No search string</div>; } const query = queryString.parse(search); - const token = query['sso-token']; + const token = query['ssoToken']; if (!token) { - return <div>No <tt>sso-token</tt> query parameter</div>; + return <div>No <tt>ssoToken</tt> query parame...
5193f5908f8929b7908649950161d9531c04f8b1
lib/assets/javascripts/new-dashboard/store/utils/getCARTOData.js
lib/assets/javascripts/new-dashboard/store/utils/getCARTOData.js
export default function getCARTOData () { if (window.CartoConfig) { return window.CartoConfig.data; } return { user_data: window.user_data, organization_notifications: window.organization_notifications }; }
export default function getCARTOData () { if (window.CartoConfig) { return window.CartoConfig.data; } return { user_data: window.user_data, organization_notifications: window.organization_notifications || [] }; }
Set organization_notifications to [] if no notificarions are available
Set organization_notifications to [] if no notificarions are available
JavaScript
bsd-3-clause
CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb
--- +++ @@ -5,6 +5,6 @@ return { user_data: window.user_data, - organization_notifications: window.organization_notifications + organization_notifications: window.organization_notifications || [] }; }
c21d52d96ec21d9a43da3467ee66364619e1e3f4
app/containers/FlagView.js
app/containers/FlagView.js
import React from 'react'; import { connect } from 'react-redux'; import admin from '../utils/admin'; import Concept from '../components/Concept'; const FlagView = React.createClass({ componentWillMount() { this.props.fetchFlags(); }, render() { const { flags } = this.props; return ( <div c...
import React from 'react'; import { connect } from 'react-redux'; import admin from '../utils/admin'; import Concept from '../components/Concept'; const FlagView = React.createClass({ componentWillMount() { this.props.fetchFlags(); }, render() { const { flags } = this.props; return ( <div c...
Add missing key to flags view to remove warning
Add missing key to flags view to remove warning
JavaScript
mit
transparantnederland/relationizer,transparantnederland/relationizer,waagsociety/tnl-relationizer,transparantnederland/browser,transparantnederland/browser,waagsociety/tnl-relationizer
--- +++ @@ -16,7 +16,7 @@ return ( <div className="FlagView"> {flags.map((flag) => - <div style={{ borderBottom: '1px solid #ccc' }}> + <div style={{ borderBottom: '1px solid #ccc' }} key={flag.id}> <Concept concept={flag.origin}/> {flag.type} ({flag.va...
9730bfb3db49d210d496e2289bf90154ab497612
scripts/components/Footer.js
scripts/components/Footer.js
import { format } from 'date-fns'; import React from 'react' import { Navigation } from './blocks/Navigation' import styles from './Main.css' const socialLinks = [ { to: 'https://stackoverflow.com/story/usehotkey', title: 'StackOverflow' }, // { // to: 'https://yadi.sk/d/QzyQ04br3HX...
import { format } from 'date-fns'; import React from 'react' import { Navigation } from './blocks/Navigation' import styles from './Main.css' const socialLinks = [ { to: 'https://stackoverflow.com/story/usehotkey', title: 'StackOverflow' }, // { // to: 'https://yadi.sk/d/QzyQ04br3HX...
Remove first year from footer
[change] Remove first year from footer
JavaScript
mit
usehotkey/my-personal-page,usehotkey/my-personal-page,usehotkey/my-personal-page,usehotkey/my-personal-page
--- +++ @@ -32,12 +32,10 @@ <div className={styles.socialNav}> <Navigation links={socialLinks} external /> </div> - <div> - <small> - {`Igor Golopolosov, 2016-${format(new Date(), 'YYYY')} ♥️`} - <b>igolopolosov...
ad207a87639cef156201b8e2a208f38c51e93c50
src/js/math.js
src/js/math.js
import THREE from 'three'; export function randomPointOnSphere( vector = new THREE.Vector3() ) { const theta = 2 * Math.PI * Math.random(); const u = 2 * Math.random() - 1; const v = Math.sqrt( 1 - u * u ); return vector.set( v * Math.cos( theta ), v * Math.sin( theta ), u ); }
import THREE from 'three'; export function randomPointOnSphere( vector = new THREE.Vector3() ) { const theta = 2 * Math.PI * Math.random(); const u = 2 * Math.random() - 1; const v = Math.sqrt( 1 - u * u ); return vector.set( v * Math.cos( theta ), v * Math.sin( theta ), u ); } export function ...
Add 1D lerp(), inverseLerp(), and map().
Add 1D lerp(), inverseLerp(), and map().
JavaScript
mit
razh/flying-machines,razh/flying-machines
--- +++ @@ -11,3 +11,15 @@ u ); } + +export function lerp( a, b, t ) { + return a + t * ( b - a ); +} + +export function inverseLerp( a, b, x ) { + return ( x - a ) / ( b - a ); +} + +export function map( x, a, b, c, d ) { + return lerp( c, d, inverseLerp( a, b, x ) ); +}
20c0f4d04aa9581a717741bb1be7f73167e358b0
optional.js
optional.js
module.exports = function(module, options){ try{ if(module[0] in {".":1}){ module = process.cwd() + module.substr(1); } return require(module); }catch(e){ if (err.code !== "MODULE_NOT_FOUND" && options && options.rethrow) { throw err; } } return null; };
module.exports = function(module, options){ try{ if(module[0] in {".":1}){ module = process.cwd() + module.substr(1); } return require(module); }catch(err){ if (err.code !== "MODULE_NOT_FOUND" && options && options.rethrow) { throw err; } } return null; };
Fix a typo (`e` -> `err`)
Fix a typo (`e` -> `err`)
JavaScript
mit
tony-o/node-optional,peerbelt/node-optional
--- +++ @@ -4,7 +4,7 @@ module = process.cwd() + module.substr(1); } return require(module); - }catch(e){ + }catch(err){ if (err.code !== "MODULE_NOT_FOUND" && options && options.rethrow) { throw err; }
e057cdfb71ccd2f7d70157ccac728736fbcad450
tests/plugins/front-matter.js
tests/plugins/front-matter.js
import test from 'ava'; import {fromString, fromNull, fromStream} from '../helpers/pipe'; import fm from '../../lib/plugins/front-matter'; test('No Compile - null', t => { return fromNull(fm) .then(output => { t.is(output, '', 'No output'); }); }); test('Error - is stream', t => { t.throws(fromStrea...
import test from 'ava'; import {fromString} from '../helpers/pipe'; import plugin from '../helpers/plugin'; import fm from '../../lib/plugins/front-matter'; test('Extracts Front Matter', t => { const input = `--- foo: bar baz: - qux - where - waldo more: good: stuff: - lives: here - and: here...
Add tests for actual FM
:white_check_mark: Add tests for actual FM
JavaScript
mit
Snugug/gulp-armadillo,kellychurchill/gulp-armadillo
--- +++ @@ -1,14 +1,64 @@ import test from 'ava'; -import {fromString, fromNull, fromStream} from '../helpers/pipe'; +import {fromString} from '../helpers/pipe'; +import plugin from '../helpers/plugin'; import fm from '../../lib/plugins/front-matter'; -test('No Compile - null', t => { - return fromNull(fm) +test...
2aec558cb2518426284b0a6bca79ab87178a5ccb
TrackedViews.js
TrackedViews.js
/** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * pr...
/** * @flow */ import React, { Component, Text, View, } from 'react-native'; import {registerView, unregisterView} from './ViewTracker' /** * Higher-order component that turns a built-in View component into a component * that is tracked with the key specified in the viewKey prop. If the viewKey * pr...
Fix crash when dragging definitions
Fix crash when dragging definitions I was accidentally updating the view key for a view, and the tracked view code couldn't handle prop changes.
JavaScript
mit
alangpierce/LambdaCalculusPlayground,alangpierce/LambdaCalculusPlayground,alangpierce/LambdaCalculusPlayground
--- +++ @@ -23,6 +23,20 @@ } } + componentWillUpdate(nextProps: any) { + const {viewKey} = this.props; + if (viewKey && !viewKey.equals(nextProps.viewKey)) { + unregisterView(viewKey, this.refs.viewRef); + } + } + + componentDidUpdate(prevProps: any) { + ...
11215560382e5c0b4484019dbf8541351337f7fb
src/mixins/size.js
src/mixins/size.js
draft.mixins.size = { // Get/set the element's width & height size(width, height) { return this.prop({ width: draft.types.length(width), height: draft.types.length(height) // depth: draft.types.length(depth) }); } };
draft.mixins.size = { // Get/set the element's width & height size(width, height) { return this.prop({ width: draft.types.length(width), height: draft.types.length(height) // depth: draft.types.length(depth) }); }, scale(width, height) { return this.prop({ width: this.prop('...
Add scale() function for relative sizing
Add scale() function for relative sizing
JavaScript
mit
D1SC0tech/draft.js,D1SC0tech/draft.js
--- +++ @@ -6,5 +6,13 @@ height: draft.types.length(height) // depth: draft.types.length(depth) }); + }, + + scale(width, height) { + return this.prop({ + width: this.prop('width') * width || undefined, + height: this.prop('height') * height || undefined + // depth: this.prop('d...
b24cd5018185dc2ef35598a7cae863322d89c8c7
app/scripts/fixBackground.js
app/scripts/fixBackground.js
'use strict'; var fixBackground = function(){ var backgroundImage = document.getElementById('page-background-img'); if(window.innerHeight >= backgroundImage.height) { backgroundImage.style.height = '100%'; backgroundImage.style.width = null; } if(window.innerWidth >= backgroundImage.wid...
'use strict'; var fixBackground = function(){ var backgroundImage = document.getElementById('page-background-img'); if(window.innerHeight >= backgroundImage.height) { backgroundImage.style.height = '100%'; backgroundImage.style.width = null; } if(window.innerWidth >= backgroundImage.wid...
Disable image grab event for background
Disable image grab event for background
JavaScript
mit
Pozo/elvira-redesign
--- +++ @@ -11,5 +11,6 @@ backgroundImage.style.height = null; } }; +document.getElementById('page-background-img').ondragstart = function() { return false; }; window.onresize = fixBackground; window.onload = fixBackground;
31fe75787678465efcfd10dafbb9c368f72d9758
hbs-builder.js
hbs-builder.js
define(["handlebars-compiler"], function (Handlebars) { var buildMap = {}, templateExtension = ".hbs"; return { // http://requirejs.org/docs/plugins.html#apiload load: function (name, parentRequire, onload, config) { // Get the template extension. var ext = (config.hbs && config.hbs.tem...
define(["handlebars-compiler"], function (Handlebars) { var buildMap = {}, templateExtension = ".hbs"; return { // http://requirejs.org/docs/plugins.html#apiload load: function (name, parentRequire, onload, config) { // Get the template extension. var ext = (config.hbs && config.hbs.tem...
Include handlebars module in build process
Include handlebars module in build process
JavaScript
mit
designeng/requirejs-hbs,designeng/requirejs-hbs,designeng/requirejs-hbs
--- +++ @@ -15,7 +15,9 @@ var fs = nodeRequire("fs"); var fsPath = config.dirBaseUrl + "/" + name + ext; buildMap[name] = fs.readFileSync(fsPath).toString(); - onload(); + parentRequire(["handlebars"], function () { + onload(); + }); }, // http://requirejs.org/do...
695f3c5607fae90b13fe6c85ffd6412afcaff0bf
packages/react-app-rewired/index.js
packages/react-app-rewired/index.js
const babelLoaderMatcher = function(rule) { return rule.loader && rule.loader.indexOf("/babel-loader/") != -1; } const getLoader = function(rules, matcher) { var loader; rules.some(rule => { return loader = matcher(rule) ? rule : getLoader(rule.use || rule.oneOf || [], matcher); }); return ...
const babelLoaderMatcher = function(rule) { return rule.loader && rule.loader.indexOf("babel-loader/") != -1; } const getLoader = function(rules, matcher) { var loader; rules.some(rule => { return loader = matcher(rule) ? rule : getLoader(rule.use || rule.oneOf || [], matcher); }); return l...
Fix babelLoaderMatcher for other npm install tool
Fix babelLoaderMatcher for other npm install tool like https://github.com/cnpm/npminstall
JavaScript
mit
timarney/react-app-rewired,timarney/react-app-rewired
--- +++ @@ -1,5 +1,5 @@ const babelLoaderMatcher = function(rule) { - return rule.loader && rule.loader.indexOf("/babel-loader/") != -1; + return rule.loader && rule.loader.indexOf("babel-loader/") != -1; } const getLoader = function(rules, matcher) {
38080adc1302b88af2c5d19d70720b53d4f464a7
jest.config.js
jest.config.js
/* @flow */ module.exports = { coverageDirectory: 'reports/coverage', coveragePathIgnorePatterns: [ '/node_modules/', '/packages/mineral-ui-icons', '/website/' ], moduleNameMapper: { '.*react-docgen-loader.*': '<rootDir>/utils/emptyObject.js', '.(md|svg)$': '<rootDir>/utils/emptyString.js' ...
/* @flow */ module.exports = { coverageDirectory: 'reports/coverage', coveragePathIgnorePatterns: [ '/node_modules/', '/packages/mineral-ui-icons', '/website/' ], moduleNameMapper: { '.*react-docgen-loader.*': '<rootDir>/utils/emptyObject.js', '.(md|svg)$': '<rootDir>/utils/emptyString.js' ...
Update testURL to accommodate JSDOM update
chore(jest): Update testURL to accommodate JSDOM update - See https://github.com/jsdom/jsdom/issues/2304
JavaScript
apache-2.0
mineral-ui/mineral-ui,mineral-ui/mineral-ui
--- +++ @@ -15,5 +15,6 @@ snapshotSerializers: [ 'enzyme-to-json/serializer', '<rootDir>/utils/snapshotSerializer' - ] + ], + testURL: 'http://localhost/' };
f9b3837c53bb0572c95f2f48b6855250870ea2f1
js/Landing.js
js/Landing.js
import React from 'react' const Landing = React.createClass({ render () { return ( <div className='landing'> <h1>svideo</h1> <input type='text' placeholder='Search' /> <a>or Browse All</a> </div> ) } }) export default Landing
import React from 'react' import { Link } from 'react-router' const Landing = React.createClass({ render () { return ( <div className='landing'> <h1>svideo</h1> <input type='text' placeholder='Search' /> <Link to='/search'>or Browse All</Link> </div> ) } }) export defau...
Make the "or Browse All" button a link that takes you to /search route
Make the "or Browse All" button a link that takes you to /search route
JavaScript
mit
galaxode/ubiquitous-eureka,galaxode/ubiquitous-eureka
--- +++ @@ -1,4 +1,5 @@ import React from 'react' +import { Link } from 'react-router' const Landing = React.createClass({ render () { @@ -6,7 +7,7 @@ <div className='landing'> <h1>svideo</h1> <input type='text' placeholder='Search' /> - <a>or Browse All</a> + <Link to='/...
680debc53973355b553155bdfae857907af0a259
app/assets/javascripts/edsn.js
app/assets/javascripts/edsn.js
var EDSN_THRESHOLD = 30; var EdsnSwitch = (function(){ var editing; var validBaseLoads = /^(base_load|base_load_edsn)$/; EdsnSwitch.prototype = { enable: function(){ if(editing){ swapEdsnBaseLoadSelectBoxes(); } }, isEdsn: function(){ return validBaseLoads.test($(this).val...
var EDSN_THRESHOLD = 30; var EdsnSwitch = (function(){ var editing; var validBaseLoads = /^(base_load|base_load_edsn)$/; EdsnSwitch.prototype = { enable: function(){ if(editing){ swapEdsnBaseLoadSelectBoxes(); } }, isEdsn: function(){ return validBaseLoads.test($(this).dat...
Use data attribute instead of val()
Use data attribute instead of val()
JavaScript
mit
quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses,quintel/etmoses
--- +++ @@ -12,7 +12,7 @@ }, isEdsn: function(){ - return validBaseLoads.test($(this).val()); + return validBaseLoads.test($(this).data('type')); }, cloneAndAppendProfileSelect: function(){
6321dc80f757cb1d83c4c06e277e0efcba5b853a
site/remark.js
site/remark.js
const visit = require('unist-util-visit'); const { kebabCase } = require('lodash'); const IGNORES = [ 'https://raw.githubusercontent.com/styleguidist/react-styleguidist/master/templates/DefaultExample.md', 'https://github.com/styleguidist/react-styleguidist/blob/master/.github/Contributing.md', ]; const REPLACEMENTS...
const visit = require('unist-util-visit'); const { kebabCase } = require('lodash'); const IGNORES = [ 'https://raw.githubusercontent.com/styleguidist/react-styleguidist/master/templates/DefaultExample.md', 'https://github.com/styleguidist/react-styleguidist/blob/master/.github/Contributing.md', ]; const REPLACEMENTS...
Fix links on the site, again 🦐
docs: Fix links on the site, again 🦐 Closes #1650
JavaScript
mit
styleguidist/react-styleguidist,sapegin/react-styleguidist,styleguidist/react-styleguidist,styleguidist/react-styleguidist,sapegin/react-styleguidist
--- +++ @@ -9,7 +9,7 @@ 'https://github.com/styleguidist/react-styleguidist': 'https://react-styleguidist.js.org/', }; -const getDocUrl = url => url.replace(/(\w+)(?:\.md)/, (_, $1) => `/${kebabCase($1)}`); +const getDocUrl = url => url.replace(/(\w+)(?:\.md)/, (_, $1) => `/docs/${kebabCase($1)}`); /* * Fix...
24d6b502081b81eff9ce1775002015f59ee3ccba
blueprints/component/index.js
blueprints/component/index.js
'use strict' module.exports = { description: "A basic React component", generateReplacements(args) { let propTypes = ""; let defaultProps = ""; if(args.length) { propTypes = "__name__.propTypes = {"; defaultProps = "\n getDefaultProps: function() {"; ...
'use strict' module.exports = { description: "A basic React component", generateReplacements(args) { let propTypes = ""; let defaultProps = ""; if(args.length) { propTypes = "__name__.propTypes = {"; defaultProps = "\n getDefaultProps: function() {"; ...
Check for badly formatted props
Check for badly formatted props
JavaScript
mit
reactcli/react-cli,reactcli/react-cli
--- +++ @@ -14,6 +14,9 @@ for(let index in args) { let prop = args[index]; let parts = prop.split(':'); + if(parts.length != 2) { + throw new Error(`Prop ${prop} is formatted incorrectly`); + } propTypes +...
3063e971479ca50e3e7d96d89db26688f5f74375
hobbes/vava.js
hobbes/vava.js
var vavaClass = require('./vava/class'); var vavaMethod = require('./vava/method'); var vavaType = require('./vava/type'); exports.scope = require('./vava/scope'); // TODO automate env assembly exports.env = { VavaClass : vavaClass.VavaClass, VavaMethod : vavaMethod.VavaMethod, TypedVariable : vavaType.TypedVa...
var utils = (typeof hobbes !== 'undefined' && hobbes.utils) || require('./utils'); var vavaClass = require('./vava/class'); var vavaMethod = require('./vava/method'); var vavaType = require('./vava/type'); exports.scope = require('./vava/scope'); exports.env = utils.merge( vavaClass, vavaMethod, vavaType );
Add automatic assembly of env
Add automatic assembly of env
JavaScript
mit
knuton/hobbes,knuton/hobbes,knuton/hobbes,knuton/hobbes
--- +++ @@ -1,17 +1,13 @@ +var utils = (typeof hobbes !== 'undefined' && hobbes.utils) || require('./utils'); + var vavaClass = require('./vava/class'); var vavaMethod = require('./vava/method'); var vavaType = require('./vava/type'); exports.scope = require('./vava/scope'); -// TODO automate env assembly -ex...
b1a4e4275743dd30a19eb7005af386596c752eb9
src/kb/widget/legacy/helpers.js
src/kb/widget/legacy/helpers.js
/*global define*/ /*jslint browser:true,white:true*/ define([ 'jquery', 'kb_common/html' ], function ($, html) { 'use strict'; // jQuery plugins that you can use to add and remove a // loading giff to a dom element. $.fn.rmLoading = function () { $(this).find('.loader').remove(); };...
define([ 'jquery', 'kb_common/html' ], function ( $, html ) { 'use strict'; // jQuery plugins that you can use to add and remove a // loading giff to a dom element. $.fn.rmLoading = function () { $(this).find('.loader').remove(); }; $.fn.loading = function (text, big) { ...
Remove commented out code that was upsetting uglify
Remove commented out code that was upsetting uglify
JavaScript
mit
eapearson/kbase-ui-widget
--- +++ @@ -1,9 +1,10 @@ -/*global define*/ -/*jslint browser:true,white:true*/ define([ 'jquery', 'kb_common/html' -], function ($, html) { +], function ( + $, + html +) { 'use strict'; // jQuery plugins that you can use to add and remove a // loading giff to a dom element. @@ -15,24...
2e99a372b401cdfb8ecaaccffd3f8546c83c7da5
api/question.js
api/question.js
var bodyParser = require('body-parser'); var express = require('express'); var database = require('../database'); var router = express.Router(); router.get('/', function(req, res) { database.Question.find({}, function(err, questions) { if (err) { res.sendStatus(500); } else { ...
var bodyParser = require('body-parser'); var express = require('express'); var database = require('../database'); var router = express.Router(); router.get('/', function(req, res) { database.Question.find({}, function(err, questions) { if (err) { res.status(500); } else { ...
Fix error with resending response.
Fix error with resending response.
JavaScript
apache-2.0
skalmadka/TierUp,skalmadka/TierUp
--- +++ @@ -7,10 +7,10 @@ router.get('/', function(req, res) { database.Question.find({}, function(err, questions) { if (err) { - res.sendStatus(500); + res.status(500); } else { - res.sendStatus(200).json(questions); + res.status(200).json(...
33e775c0e0e025847297c138261689dd5354a7d8
api/resolver.js
api/resolver.js
var key = require('../utils/key'); var sync = require('synchronize'); var request = require('request'); var _ = require('underscore'); // The API that returns the in-email representation. module.exports = function(req, res) { var url = req.query.url.trim(); // Giphy image urls are in the format: // http://giph...
var key = require('../utils/key'); var sync = require('synchronize'); var request = require('request'); var _ = require('underscore'); // The API that returns the in-email representation. module.exports = function(req, res) { var url = req.query.url.trim(); // Giphy image urls are in the format: // http://giph...
Remove paragraphs since they add unnecessary vertical padding.
Remove paragraphs since they add unnecessary vertical padding.
JavaScript
mit
kigster/wanelo-mixmax-link-resolver,kigster/wanelo-mixmax-link-resolver,mixmaxhq/giphy-example-link-resolver,germy/mixmax-metaweather
--- +++ @@ -36,7 +36,7 @@ var image = response.body.data.images.original; var width = image.width > 600 ? 600 : image.width; - var html = '<p><img style="max-width:100%;" src="' + image.url + '" width="' + width + '"/></p>'; + var html = '<img style="max-width:100%;" src="' + image.url + '" width="' + width...
8d27f66f4b4c61ddeb95e5107a616b937eb06dff
app/core/app.js
app/core/app.js
'use strict'; var bowlingApp = angular.module('bowling', ['ngRoute']); bowlingApp.config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({ redirectTo: '/main' }); }]); bowlingApp.factory("dataProvider", ['$q', function ($q) { var dataLoaded = false; ...
'use strict'; var bowlingApp = angular.module('bowling', ['ngRoute']); bowlingApp.config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({ redirectTo: '/main' }); }]); bowlingApp.factory("dataProvider", ['$q', function ($q) { var dataLoaded = false; ...
Change data directory back to test data.
Change data directory back to test data.
JavaScript
mit
MeerkatLabs/bowling-visualization
--- +++ @@ -18,7 +18,7 @@ if (currentPromise == null) { if (!dataLoaded) { - var result = bowling.initialize({"root": "polarbowler"}, $q); + var result = bowling.initialize({"root": "testdata"}, $q); currentPromise = result.the...
4f429972826a4a1892969f11bef49f4bae147ac3
webpack.config.base.js
webpack.config.base.js
'use strict' var webpack = require('webpack') var reactExternal = { root: 'React', commonjs2: 'react', commonjs: 'react', amd: 'react' } module.exports = { externals: { 'react': reactExternal }, module: { loaders: [ { test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ } ...
'use strict' var webpack = require('webpack') var reactExternal = { root: 'React', commonjs2: 'react', commonjs: 'react', amd: 'react' } var reduxExternal = { root: 'Redux', commonjs2: 'redux', commonjs: 'redux', amd: 'redux' } var reactReduxExternal = { root: 'ReactRedux', commonjs2: 'react-redu...
Add Redux and React Redux as external dependencies
Add Redux and React Redux as external dependencies
JavaScript
mit
erikras/redux-form,erikras/redux-form
--- +++ @@ -8,9 +8,25 @@ amd: 'react' } +var reduxExternal = { + root: 'Redux', + commonjs2: 'redux', + commonjs: 'redux', + amd: 'redux' +} + +var reactReduxExternal = { + root: 'ReactRedux', + commonjs2: 'react-redux', + commonjs: 'react-redux', + amd: 'react-redux' +} + module.exports = { externa...
849ae9172c21704c61ae6a84affdef0a309fcb4b
app/controllers/application.js
app/controllers/application.js
import Ember from 'ember'; export default Ember.Controller.extend({ sitemap: { nodes: [ { link: 'index', title: 'Home', children: null }, { link: null, title: 'Admin panel', children: [ { link: 'suggestionTypes', ...
import Ember from "ember"; export default Ember.Controller.extend({ sitemap: { nodes: [ { link: "index", title: "Home" }, { title: "Admin panel", children: [ { link: "suggestionTypes", title: "Suggestion Types" }, { link: "users", title: "Application Users" } ...
Add link to geolocation example into sitemap
Add link to geolocation example into sitemap
JavaScript
mit
Flexberry/flexberry-ember-demo,Flexberry/flexberry-ember-demo,Flexberry/flexberry-ember-demo
--- +++ @@ -1,35 +1,23 @@ -import Ember from 'ember'; +import Ember from "ember"; export default Ember.Controller.extend({ sitemap: { nodes: [ + { link: "index", title: "Home" }, { - link: 'index', - title: 'Home', - children: null - }, - { - link: null, - ...
421aba98815a8f3d99fa78daf1d6ec9315712966
zombie/proxy/server.js
zombie/proxy/server.js
var net = require('net'); var zombie = require('zombie'); // Defaults var ping = 'pong' var browser = null; var ELEMENTS = []; // // Store global client states indexed by ZombieProxyClient (memory address): // // { // 'CLIENTID': [X, Y] // } // // ...where X is some zombie.Browser instance... // // ...and Y is a pe...
var net = require('net'); var Browser = require('zombie'); // Defaults var ping = 'pong' var browser = null; var ELEMENTS = []; // // Store global client states indexed by ZombieProxyClient (memory address): // // { // 'CLIENTID': [X, Y] // } // // ...where X is some zombie.Browser instance... // // ...and Y is a p...
Make the sever.js work with zombie 2
Make the sever.js work with zombie 2
JavaScript
mit
ryanpetrello/python-zombie,ryanpetrello/python-zombie
--- +++ @@ -1,5 +1,5 @@ var net = require('net'); -var zombie = require('zombie'); +var Browser = require('zombie'); // Defaults var ping = 'pong' @@ -34,10 +34,9 @@ // function ctx_switch(id){ if(!CLIENTS[id]) - CLIENTS[id] = [new zombie.Browser(), []]; + CLIENTS[id] = [new Browser(), []]; ...
fe6247d1ade209f1ebb6ba537652569810c4d77a
lib/adapter.js
lib/adapter.js
/** * Request adapter. * * @package cork * @author Andrew Sliwinski <andrew@diy.org> */ /** * Dependencies */ var _ = require('lodash'), async = require('async'), request = require('request'); /** * Executes a task from the adapter queue. * * @param {Object} Task * * @return {Object} */ v...
/** * Request adapter. * * @package cork * @author Andrew Sliwinski <andrew@diy.org> */ /** * Dependencies */ var _ = require('lodash'), async = require('async'), request = require('request'); /** * Executes a task from the adapter queue. * * @param {Object} Task * * @return {Object} */ v...
Remove queue object from the task
Remove queue object from the task
JavaScript
mit
thisandagain/cork
--- +++ @@ -38,7 +38,7 @@ throttle: 0 }); - // Throttled request method + // Throttle the request execution method var limiter = _.throttle(execute, self.throttle); // Create queue @@ -49,6 +49,7 @@ if (self.base !== null) task.uri = self.base + task.uri; // Cle...
fcab433c54faeffbc59d0609a6f503e3a3237d6f
lib/bemhint.js
lib/bemhint.js
/** * The core of BEM hint * ==================== */ var vow = require('vow'), _ = require('lodash'), scan = require('./walk'), loadRules = require('./load-rules'), Configuration = require('./configuration'), utils = require('./utils'); /** * Loads the BEM entities and checks them * @param {Ob...
/** * The core of BEM hint * ==================== */ var vow = require('vow'), _ = require('lodash'), scan = require('./walk'), loadRules = require('./load-rules'), Configuration = require('./configuration'), utils = require('./utils'); /** * Loads the BEM entities and checks them * @param {Ob...
Add 'config' as argument to rules' constructors
Add 'config' as argument to rules' constructors
JavaScript
mit
bemhint/bemhint,bemhint/bemhint,bem/bemhint,bem/bemhint
--- +++ @@ -24,7 +24,7 @@ return vow.all([scan(targets, config), loadRules()]) .spread(function (entities, rules) { return vow.all(_.keys(rules).map(function (rule) { - var _rule = new rules[rule](); + var _rule = new rules[rule](config); ret...
7b6d8f66fd1c2130d10ba7013136ecc3f25d6c3b
src/main/webapp/scripts/main.js
src/main/webapp/scripts/main.js
$().ready(() => { loadContentSection().then(() =>{ $("#loader").addClass("hide"); $("#real-body").removeClass("hide"); $("#real-body").addClass("body"); $(".keyword").click(function() { $(this).addClass("active"); $(".base").hide(200); $("#real-body").addClass("focus"); }); ...
$().ready(() => { loadContentSection().then(() =>{ $("#loader").addClass("hide"); $("#real-body").removeClass("hide"); $("#real-body").addClass("body"); $(".keyword").click(function() { $(this).addClass("active"); $(".base").hide(200); $("#real-body").addClass("focus"); }); ...
Add js to perform url replacement
Add js to perform url replacement
JavaScript
apache-2.0
googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020
--- +++ @@ -16,5 +16,11 @@ $(".base").show(200); $("#real-body").removeClass("focus"); }); + + $(".active .item").click(function() { + $(".item").off("click"); + const url = $(this).attr("data-url"); + window.location.replace(url); + }); }); });
2de06af9887b6941f73a6610a5485d98cf7f353f
lib/mongoat.js
lib/mongoat.js
'use strict'; var Mongoat = require('mongodb'); var utilsHelper = require('../helpers/utils-helper'); var connect = Mongoat.MongoClient.connect; var hooks = { before: {}, after: {} }; Mongoat.Collection.prototype.before = function(opName, callback) { hooks = utilsHelper.beforeAfter('before', opName, hooks, call...
'use strict'; var Mongoat = require('mongodb'); var utilsHelper = require('../helpers/utils-helper'); var connect = Mongoat.MongoClient.connect; var hooks = { before: {}, after: {} }; (function(){ var opArray = ['insert', 'update', 'remove']; var colPrototype = Mongoat.Collection.prototype; for (var i = 0;...
Update save methods strategy - Use anonymous function to save collection methods before overwrite
Update save methods strategy - Use anonymous function to save collection methods before overwrite
JavaScript
mit
dial-once/node-mongoat
--- +++ @@ -8,6 +8,15 @@ after: {} }; +(function(){ + var opArray = ['insert', 'update', 'remove']; + var colPrototype = Mongoat.Collection.prototype; + + for (var i = 0; i < opArray.length; ++i) { + colPrototype[opArray[i] + 'Method'] = colPrototype[opArray[i]]; + } +})(); + Mongoat.Collection.prototyp...
7bb5536b35b5f1bb90fde60abeb2f6cd7e410139
lib/version.js
lib/version.js
var clone = require('clone'), mongoose = require('mongoose'), ObjectId = mongoose.Schema.Types.ObjectId; module.exports = function(schema, options) { options = options || {}; options.collection = options.collection || 'versions'; var versionedSchema = clone(schema); // Fix for callQueue argum...
var clone = require('clone'), mongoose = require('mongoose'), ObjectId = mongoose.Schema.Types.ObjectId; module.exports = function(schema, options) { options = options || {}; options.collection = options.collection || 'versions'; var versionedSchema = clone(schema); // Fix for callQueue argum...
Fix bug accessing wrong schema instance
Fix bug accessing wrong schema instance
JavaScript
bsd-2-clause
jeresig/mongoose-version,saintedlama/mongoose-version
--- +++ @@ -36,7 +36,7 @@ schema.pre('save', function(next) { this.increment(); // Increment origins version - var versionedModel = new versionedSchema.statics.VersionedModel(this); + var versionedModel = new schema.statics.VersionedModel(this); versionedModel.refVersion = this....
c31d392e1972d6eaca952c21ba9349d30b31b012
js/defaults.js
js/defaults.js
/* exported defaults */ /* Magic Mirror * Config Defauls * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ var defaults = { port: 8080, language: "en", timeFormat: 24, modules: [ { module: "helloworld", position: "upper_third", config: { text: "Magic Mirror V2", classes: "la...
/* exported defaults */ /* Magic Mirror * Config Defauls * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ var defaults = { port: 8080, language: "en", timeFormat: 24, modules: [ { module: "helloworld", position: "upper_third", config: { text: "Magic Mirror<sup>2</sup>", cla...
Change branding on default config.
Change branding on default config.
JavaScript
mit
kthorri/MagicMirror,enith2478/spegel,aschulz90/MagicMirror,morozgrafix/MagicMirror,morozgrafix/MagicMirror,marcroga/sMirror,aghth/MagicMirror,ShivamShrivastava/Smart-Mirror,ConnorChristie/MagicMirror,berlincount/MagicMirror,wszgxa/magic-mirror,heyheyhexi/MagicMirror,gndimitro/MagicMirror,vyazadji/MagicMirror,ryanlawler...
--- +++ @@ -18,7 +18,7 @@ module: "helloworld", position: "upper_third", config: { - text: "Magic Mirror V2", + text: "Magic Mirror<sup>2</sup>", classes: "large thin" } },
fce51a7f4c2991773fff8d8070130a726f73879a
nin/frontend/app/scripts/directives/demo.js
nin/frontend/app/scripts/directives/demo.js
function demo($interval, demo) { return { restrict: 'E', template: '<div class=demo-container></div>', link: function(scope, element) { demo.setContainer(element[0].children[0]); setTimeout(function() { demo.resize(); }); scope.$watch(() => scope.main.fullscreen, function ...
function demo($interval, demo) { return { restrict: 'E', template: '<div class=demo-container></div>', link: function(scope, element) { demo.setContainer(element[0].children[0]); setTimeout(function() { demo.resize(); }); scope.$watch(() => scope.main.fullscreen, function ...
Fix mute on initial load
Fix mute on initial load
JavaScript
apache-2.0
ninjadev/nin,ninjadev/nin,ninjadev/nin
--- +++ @@ -28,7 +28,7 @@ }); scope.$watch(() => scope.main.volume, volume => { - if (scope.mute) return; + if (scope.main.mute) return; demo.music.setVolume(volume); });
85afadbe75bce0fd7069224c8065d99d6a663a2f
src/adapter.js
src/adapter.js
/* * Copyright 2014 Workiva, LLC * * 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...
/* * Copyright 2014 Workiva, LLC * * 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...
Add error handler to System.import promises
Add error handler to System.import promises
JavaScript
apache-2.0
rich-nguyen/karma-jspm
--- +++ @@ -38,7 +38,13 @@ // Load everything specified in loadFiles karma.config.jspm.expandedFiles.map(function(modulePath){ - promises.push(System.import(extractModuleName(modulePath))); + var promise = System.import(extractModuleName(modulePath)) + .catch(function(e){ + ...
4aa3e40ae4a9b998025a010749be69da428cb9bb
src/jupyter_contrib_nbextensions/nbextensions/hide_input_all/main.js
src/jupyter_contrib_nbextensions/nbextensions/hide_input_all/main.js
// toggle display of all code cells' inputs define([ 'jquery', 'base/js/namespace' ], function( $, IPython ) { "use strict"; function set_input_visible(show) { IPython.notebook.metadata.hide_input = !show; if (show) $('div.input').show('slow'); else $('div.input').hide...
// toggle display of all code cells' inputs define([ 'jquery', 'base/js/namespace', 'base/js/events' ], function( $, Jupyter, events ) { "use strict"; function set_input_visible(show) { Jupyter.notebook.metadata.hide_input = !show; if (show) $('div.input').show('slow')...
Fix loading for either before or after notebook loads.
[hide_input_all] Fix loading for either before or after notebook loads.
JavaScript
bsd-3-clause
ipython-contrib/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,ipython-contrib/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,juhasch/IPython-notebook-extensions,jcb91/IPython-notebook-extensions,jcb91/IPytho...
--- +++ @@ -2,15 +2,17 @@ define([ 'jquery', - 'base/js/namespace' + 'base/js/namespace', + 'base/js/events' ], function( $, - IPython + Jupyter, + events ) { "use strict"; function set_input_visible(show) { - IPython.notebook.metadata.hide_input = !show; + J...
0c0878ac06febc05dd34f617c6a874e3a5d2ee49
lib/node_modules/@stdlib/utils/move-property/lib/index.js
lib/node_modules/@stdlib/utils/move-property/lib/index.js
'use strict'; /** * FUNCTION: moveProperty( source, prop, target ) * Moves a property from one object to another object. * * @param {Object} source - source object * @param {String} prop - property to move * @param {Object} target - target object * @returns {Boolean} boolean indicating whether operation was successful...
'use strict'; /** * FUNCTION: moveProperty( source, prop, target ) * Moves a property from one object to another object. * * @param {Object} source - source object * @param {String} prop - property to move * @param {Object} target - target object * @returns {Boolean} boolean indicating whether operation was successful...
Add TODO for handling getOwnPropertyDescriptor support
Add TODO for handling getOwnPropertyDescriptor support
JavaScript
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
--- +++ @@ -17,6 +17,7 @@ if ( typeof target !== 'object' || target === null ) { throw new TypeError( 'invalid input argument. Target argument must be an object. Value: `' + target + '`.' ); } + // TODO: handle case where gOPD is not supported desc = Object.getOwnPropertyDescriptor( source, prop ); if ( de...
65294019c1d29baaa548e483e93c8c55bf4bbabb
static/site.js
static/site.js
jQuery( document ).ready( function( $ ) { // Your JavaScript goes here jQuery('#content').fitVids(); });
jQuery( document ).ready( function( $ ) { // Your JavaScript goes here jQuery('#content').fitVids({customSelector: ".fitvids-responsive-iframe"}); });
Add .fitvids-responsive-iframe class for making iframes responsive
Add .fitvids-responsive-iframe class for making iframes responsive
JavaScript
mit
CoderDojo/cd-theme,CoderDojo/cd-theme,CoderDojo/cd-theme,CoderDojo/cd-theme
--- +++ @@ -1,5 +1,5 @@ jQuery( document ).ready( function( $ ) { // Your JavaScript goes here - jQuery('#content').fitVids(); + jQuery('#content').fitVids({customSelector: ".fitvids-responsive-iframe"}); });
9af98fed472b4dabeb7c713f44c0b5b80da8fe4a
website/src/app/project/experiments/experiment/experiment.model.js
website/src/app/project/experiments/experiment/experiment.model.js
export class ExperimentStep { constructor(title, _type) { this.id = ''; this.title = title; this._type = _type; this.steps = []; this.description = ''; this.flags = { important: false, review: false, error: false, done: ...
export class ExperimentStep { constructor(title, _type) { this.id = ''; this.title = title; this._type = _type; this.steps = []; this.description = ''; this.flags = { important: false, review: false, error: false, done: ...
Remove hard coded experiment description. Remove done field and add status field since that is what we get from the backend.
Remove hard coded experiment description. Remove done field and add status field since that is what we get from the backend.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
--- +++ @@ -37,9 +37,9 @@ constructor(name) { this.name = name; this.goal = ''; - this.description = 'Look at grain size as it relates to hardness'; + this.description = ''; this.aim = ''; - this.done = false; + this.status = 'in-progress'; this.ste...