commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
e8e00d643a4c124e87887dfdeb2596ac88285a07
src/helpers/buildProps.js
src/helpers/buildProps.js
import {Map} from 'immutable'; export default function buildProps(propsDefinition, allProps = false) { const props = {} Map(propsDefinition).map((data, prop) => { if (data.defaultValue) props[prop] = data.defaultValue.computed ? data.defaultValue.value : eval(`(${data.defaultValue.value}...
import {Map} from 'immutable'; export default function buildProps(propsDefinition, allProps = false) { const props = {} Map(propsDefinition).map((data, prop) => { if (data.defaultValue) props[prop] = data.defaultValue.computed ? data.defaultValue.value : eval(`(${data.defaultValue.value}...
Add some defaults for prop types
Add some defaults for prop types
JavaScript
mit
blueberryapps/react-bluekit,blueberryapps/react-bluekit,blueberryapps/react-bluekit,kjg531/react-bluekit,kjg531/react-bluekit
2c7c6eb77676ce869d788cba91147ba40af45745
WebApp/controllers/index.js
WebApp/controllers/index.js
'use strict'; var passport = require('passport'); module.exports = function (router) { router.get('/', function (req, res) { res.render('index'); }); router.post('/signup', passport.authenticate('local', { successRedirect : '/home', // redirect to the secure profile se...
'use strict'; var passport = require('passport'); module.exports = function (router) { router.get('/', function (req, res) { res.render('index'); }); router.post('/signup', passport.authenticate('local', { successRedirect : '/home', // redirect to the secure home section ...
Add logout rout logic and 404 catch route.
Add logout rout logic and 404 catch route.
JavaScript
mit
uahengojr/NCA-Web-App,uahengojr/NCA-Web-App
4eff36df241f9de8abca1bf5bc5871625b204d48
src/forwarded.js
src/forwarded.js
import { Namespace as NS } from 'xmpp-constants'; export default function (JXT) { let Forwarded = JXT.define({ name: 'forwarded', namespace: NS.FORWARD_0, element: 'forwarded' }); JXT.extendIQ(Forwarded); JXT.extendPresence(Forwarded); JXT.withMessage(function (Message)...
import { Namespace as NS } from 'xmpp-constants'; export default function (JXT) { let Forwarded = JXT.define({ name: 'forwarded', namespace: NS.FORWARD_0, element: 'forwarded' }); JXT.withMessage(function (Message) { JXT.extend(Message, Forwarded); JXT.extend(Fo...
Allow presence and iq stanzas in forwards
Allow presence and iq stanzas in forwards
JavaScript
mit
otalk/jxt-xmpp
ed4aee982efbe639586bb894a7a2a0b06f221c20
routes/login.js
routes/login.js
var express = require('express'); var router = express.Router(); const passport = require('passport') const FacebookStrategy = require('passport-facebook').Strategy passport.use(new FacebookStrategy({ clientID: 'fsddf', clientSecret: 'FACEBOOK_APP_SECRET', callbackURL: "https://age-guess-api.herokuapp.co...
var express = require('express'); var router = express.Router(); require('dotenv').config() const passport = require('passport') const FacebookStrategy = require('passport-facebook').Strategy passport.use(new FacebookStrategy({ clientID: process.env.APP_ID, clientSecret: process.env.APP_SECRET, callbackU...
Add routing for facebook auth
Add routing for facebook auth
JavaScript
mit
michael-lowe-nz/ageGuessAPI,michael-lowe-nz/ageGuessAPI
8523b2a9d123b77d5003434e42fa877b718a9b3c
api/policies/isGuacamole.js
api/policies/isGuacamole.js
/** * Nanocloud turns any traditional software into a cloud solution, without * changing or redeveloping existing source code. * * Copyright (C) 2016 Nanocloud Software * * This file is part of Nanocloud. * * Nanocloud is free software; you can redistribute it and/or modify * it under the terms of the GNU Affe...
/** * Nanocloud turns any traditional software into a cloud solution, without * changing or redeveloping existing source code. * * Copyright (C) 2016 Nanocloud Software * * This file is part of Nanocloud. * * Nanocloud is free software; you can redistribute it and/or modify * it under the terms of the GNU Affe...
Fix history and scale down not working in production mode
Fix history and scale down not working in production mode In dev mode guacamole-client targets localhost:1337 for the backend In production mode guacamole-client targets backend:1337 for the backend Update isGuacamole policy to take the production setup into account
JavaScript
agpl-3.0
romain-ortega/nanocloud,Gentux/nanocloud,corentindrouet/nanocloud,corentindrouet/nanocloud,dynamiccast/nanocloud,Leblantoine/nanocloud,dynamiccast/nanocloud,romain-ortega/nanocloud,Nanocloud/nanocloud,Nanocloud/nanocloud,romain-ortega/nanocloud,Leblantoine/nanocloud,Nanocloud/nanocloud,Leblantoine/nanocloud,Gentux/nano...
8a9ea980ca9e18c2b7760f7927836dd265a3a07f
lib/collections/checkID.js
lib/collections/checkID.js
Meteor.methods({ checkHKID: function (hkid) { var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/; // HKID format = 1 or 2 letters followed by 6 numbers and 1 checksum digit. var matchArray = hkid.match(hkidPat); if(matchArray == null){idError()} var checkSum = 0; var charPart =...
Meteor.methods({ checkHKID: function (hkid) { var hkidPat = /^([A-Z]{1,2})([0-9]{6})([A0-9])$/; // HKID format = 1 or 2 letters followed by 6 numbers and 1 checksum digit. var matchArray = hkid.match(hkidPat); if(matchArray == null){idError()} var checkSum = 0; var charPart =...
Fix minor error with HKID verification
Fix minor error with HKID verification
JavaScript
agpl-3.0
gazhayes/Popvote-HK,gazhayes/Popvote-HK
959840f4da79f68cc67b4a994c1b0fed5e5fc217
spec/gateway-spec.js
spec/gateway-spec.js
"use babel"; import gateway from "../lib/gateway"; describe("Gateway", () => { describe("packagePath", () => { it("returns path of package installation", () => { expect(gateway.packagePath()).toContain("exfmt-atom"); }); }); describe("shouldUseLocalExfmt", () => { it("returns true when exfmtD...
"use babel"; import gateway from "../lib/gateway"; import path from "path"; import process from "child_process"; describe("Gateway", () => { describe("packagePath", () => { it("returns path of package installation", () => { expect(gateway.packagePath()).toContain("exfmt-atom"); }); }); describe("...
Add spec tests for gateway run functions
Add spec tests for gateway run functions
JavaScript
mit
rgreenjr/exfmt-atom
32dd109b7df05ee3b687baed65381fe1c64da1c2
js/home-nav.js
js/home-nav.js
var navOffset = function () { $('#content.container').css('margin-top', $('#nav').height() * 0.25); }; var collapsedMenus = function() { $('#nav button.navbar-toggle').on('click', function() { if ($(this).hasClass('collapsed')) { var collapsedMenuHeight = 323.5; collapseOffset('#nav', collapsedMenuHei...
var navOffset = function () { $('#content.container').css('margin-top', $('#nav').height() * 0.25); }; var collapsedMenus = function() { $('#nav button.navbar-toggle').on('click', function() { if ($(this).hasClass('collapsed') && !$($(this).data('target')).hasClass('collapsing')) { var collapsedMenuHe...
Fix wrong auto-scrolling when opening the menu.
Fix wrong auto-scrolling when opening the menu. Fixed page scrolling down when main menu is closing. Fixed incorrect logic for scrolling on submenu ("More") scrolling. JQuery.not() is a filter/selector, not a class detector.
JavaScript
mit
HackNC/fall2015,newmane/PearlHacks17,HackNC/fall2015,newmane/PearlHacks17,madipfaff/PearlHacks16,madipfaff/PearlHacks16
2dc52dbbc4f0e01c6f6cd898b2f57f09430675c8
js/sideshow.js
js/sideshow.js
var sideshow = function () { function hasClass (elem, cls) { var names = elem.className.split(" "); for (var i = 0; i < names; i++) { if (cls == names[i]) return true; } return false; } function addClass (elem, cls) { if (!hasClass(elem, c...
var sideshow = function () { function hasClass (elem, cls) { var names = elem.className.split(" "); for (var i = 0; i < names; i++) { if (cls == names[i]) return true; } return false; } function addClass (elem, cls) { var names = elem.clas...
Make addClass implementation symmetric with removeClass.
Make addClass implementation symmetric with removeClass.
JavaScript
isc
whilp/sideshow
057829f108dc1fe04369feeb95deb794adbf154a
Cloudy/cloudy.js
Cloudy/cloudy.js
var Cloudy = { isPlayerPage: function() { return $("#audioplayer").length == 1; }, sendEpisodeToCloudy: function() { var episodeTitle = $(".titlestack .title").text(); var showTitle = $(".titlestack .caption2").text(); var details = { "show_title": showTitle, ...
var Cloudy = { isPlayerPage: function() { return $("#audioplayer").length == 1; }, sendEpisodeToCloudy: function() { var episodeTitle = $(".titlestack .title").text(); var showTitle = $(".titlestack .caption2").text(); var details = { "show_title": showTitle, ...
Use JavaScript to intercept space bar event.
Use JavaScript to intercept space bar event.
JavaScript
mit
calebd/cloudy,calebd/cloudy
e009e13d0175d933542f2230c220067e2f29f093
lib/handlers/tar-stream.js
lib/handlers/tar-stream.js
/* * tar-stream.js: Checkout adapter for a tar stream. * * (C) 2012 Bradley Meck. * MIT LICENSE * */ var tar = require('tar'); // // ### function download (source, callback) // #### @source {Object} Source checkout options // #### @callback {function} Continuation to respond to. // Downloads the tar stream to t...
/* * tar-stream.js: Checkout adapter for a tar stream. * * (C) 2012 Bradley Meck. * MIT LICENSE * */ var zlib = require('zlib'), tar = require('tar'); // // ### function download (source, callback) // #### @source {Object} Source checkout options // #### @callback {function} Continuation to respond to. // D...
Allow for optional gzip encoding.
[api] Allow for optional gzip encoding.
JavaScript
mit
indexzero/node-checkout
fbbf41efcba79d61feadb9307f1a4a35c65c405b
ecplurkbot.js
ecplurkbot.js
var log4js = require('log4js'); var PlurkClient = require('plurk').PlurkClient; var nconf = require('nconf'); nconf.file('config', __dirname + '/config/config.json') .file('keywords', __dirname + '/config/keywords.json'); var logging = nconf.get('log').logging; var log_path = nconf.get('log').log_path; if (logging)...
var log4js = require('log4js'); var PlurkClient = require('plurk').PlurkClient; var nconf = require('nconf'); nconf.file('config', __dirname + '/config/config.json') .file('keywords', __dirname + '/config/keywords.json'); var logging = nconf.get('log').logging; var log_path = nconf.get('log').log_path; if (logging) ...
Rewrite with using startComet function of plurk modules
Rewrite with using startComet function of plurk modules
JavaScript
apache-2.0
dollars0427/ecplurkbot
021d3d985bb6a9965bd69a81897b0bc712578f36
src/app/api/utils.js
src/app/api/utils.js
import notp from 'notp' import b32 from 'thirty-two' export function cleanKey (key) { return key.replace(/[^a-z2-7]+/g, '').slice(0, 32) } export function isValidKey (key) { return /^[a-z2-7]{32}$/.test(cleanKey(key)) } export function getCode (key) { return notp.totp.gen(b32.decode(cleanKey(key)), {}) }
import notp from 'notp' import b32 from 'thirty-two' export function cleanKey (key) { return key.replace(/[^a-z2-7]+/ig, '').toLowerCase() } export function isValidKey (key) { return /^[a-z2-7]+$/.test(cleanKey(key)) } export function getCode (key) { return notp.totp.gen(b32.decode(cleanKey(key)), {}) }
Support for larger kind of key
fix: Support for larger kind of key
JavaScript
mit
nodys/basicotp,nodys/basicotp,nodys/basicotp
ae4e515cffdb87ca856a50f15c7a01b5605b93e4
migrations/20200422122956_multi_homefeeds.js
migrations/20200422122956_multi_homefeeds.js
export async function up(knex) { await knex.schema .raw('alter table feeds add column title text') .raw('alter table feeds add column ord integer') .raw(`alter table feeds drop constraint feeds_unique_feed_names`) // Only RiverOfNews feeds can have non-NULL ord or title .raw(`alter table feeds add...
export const up = (knex) => knex.schema.raw(`do $$begin -- FEEDS TABLE alter table feeds add column title text; alter table feeds add column ord integer; alter table feeds drop constraint feeds_unique_feed_names; -- Only RiverOfNews feeds can have non-NULL ord or title alter table feeds add constraint feed...
Add a homefeed_subscriptions database table
Add a homefeed_subscriptions database table
JavaScript
mit
FreeFeed/freefeed-server,FreeFeed/freefeed-server
895a59456addea4b43cf283ab9668747a615e392
test/data-structures/testDoublyLinkedList.js
test/data-structures/testDoublyLinkedList.js
/* eslint-env mocha */ const DoublyLinkedList = require('../../src').DataStructures.DoublyLinkedList; const assert = require('assert'); describe('DoublyLinkedList', () => { it('should be empty when initialized', () => { const inst = new DoublyLinkedList(); assert(inst.isEmpty()); assert.equal(inst.length...
/* eslint-env mocha */ const DoublyLinkedList = require('../../src').DataStructures.DoublyLinkedList; const assert = require('assert'); describe('DoublyLinkedList', () => { it('should be empty when initialized', () => { const inst = new DoublyLinkedList(); assert(inst.isEmpty()); assert.equal(inst.length...
Test push to the front of the list
DoublyLinkedList: Test push to the front of the list
JavaScript
mit
ManrajGrover/algorithms-js
7aa46cae7e352fb1bfb6b2453a66e2f58c4f93aa
assets/page/___page___/js/script.___page___.js
assets/page/___page___/js/script.___page___.js
'use strict'; /* * Use for Async operations before displaying page * module.exports.prepare = function() { this.done({}); }; */ /* * Compute Vue parameters * module.exports.vue = function() { return {}; }; */ /* * Use as page starting point * module.exports.start = function() { }; */
'use strict'; /* * Use for Async operations before displaying page * module.exports.prepare = function() { this.done({}); }; */ /* * Compute Vue parameters * module.exports.vue = function() { return {}; }; * or module.exports.vue = { }; */ /* * Use as page starting point * module.exports.start = function...
Update Layout assets to latest specifications
feat: Update Layout assets to latest specifications
JavaScript
mit
quasarframework/quasar-cli,rstoenescu/quasar-cli
7a13ef409b8251619771bd1f61a941da522d8830
assets/js/components/SpinnerButton.stories.js
assets/js/components/SpinnerButton.stories.js
/** * Site Kit by Google, Copyright 2022 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
/** * Site Kit by Google, Copyright 2022 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
Fix vrt scenario script issue.
Fix vrt scenario script issue.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
86ce4f25d552c9b3538339c53b61abaf1faf860f
test/specs/elements/Segment/Segments-test.js
test/specs/elements/Segment/Segments-test.js
import React from 'react'; import {Segment, Segments} from 'stardust'; describe('Segments', () => { it('should render children', () => { const [segmentOne, segmentTwo] = render( <Segments> <Segment>Top</Segment> <Segment>Bottom</Segment> </Segments> ).scryClass('sd-segment'); ...
import React from 'react'; import {Segment, Segments} from 'stardust'; describe('Segments', () => { it('should render children', () => { const [segmentOne, segmentTwo] = render( <Segments> <Segment>Top</Segment> <Segment>Bottom</Segment> </Segments> ).scryClass('sd-segment'); ...
Make use of chai's lengthOf assertion and simplify test
Make use of chai's lengthOf assertion and simplify test
JavaScript
mit
Semantic-Org/Semantic-UI-React,jamiehill/stardust,vageeshb/Semantic-UI-React,Semantic-Org/Semantic-UI-React,jcarbo/stardust,ben174/Semantic-UI-React,mohammed88/Semantic-UI-React,clemensw/stardust,koenvg/Semantic-UI-React,aabustamante/Semantic-UI-React,ben174/Semantic-UI-React,Rohanhacker/Semantic-UI-React,koenvg/Semant...
3fcff5769179d8b784f10206d8de1c7184843a11
background.js
background.js
(function() { 'use strict'; chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { innerBounds: { width: 960, height: 600 }, state: 'maximized' }); }); }());
(function() { 'use strict'; chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { innerBounds: { width: 960, height: 600, minWidth: 960, minHeight: 600 }, state: 'maximized' }); }); }());
Add minWidth/Height to Chrome app
Add minWidth/Height to Chrome app
JavaScript
mit
nathan/pixie,nathan/pixie,videophonegeek/pixie,videophonegeek/pixie
113b5c54802d572ed6d72d7380f5c28dc58760b3
background.js
background.js
(function(window){ window.ITCheck = window.ITCheck || {}; // Get things rolling chrome.alarms.onAlarm.addListener(ITCheck.getUnreadThreadCount); chrome.runtime.onStartup.addListener(function () { chrome.alarms.create("updater", { "periodInMinutes": 1 }); }); chrome.runtime.onInstalled.addListener(function(deta...
(function(window){ window.ITCheck = window.ITCheck || {}; // Get things rolling chrome.alarms.onAlarm.addListener(ITCheck.getUnreadThreadCount); chrome.runtime.onStartup.addListener(function () { chrome.alarms.create("updater", { "periodInMinutes": 1 }); }); chrome.runtime.onInstalled.addListener(function(deta...
Fix error with navigating to new page
Fix error with navigating to new page
JavaScript
mit
CodyJung/itcheck,CodyJung/itcheck
36313a2f3350a8af341ca8b427b851b7697d1657
models/core/AbuseReport.js
models/core/AbuseReport.js
// Abuse reports // 'use strict'; const Mongoose = require('mongoose'); const Schema = Mongoose.Schema; module.exports = function (N, collectionName) { let AbuseReport = new Schema({ // _id of reported content src_id: Schema.ObjectId, // Content type (FORUM_POST, BLOG_ENTRY, ...) type...
// Abuse reports // 'use strict'; const Mongoose = require('mongoose'); const Schema = Mongoose.Schema; module.exports = function (N, collectionName) { let AbuseReport = new Schema({ // _id of reported content src_id: Schema.ObjectId, // Content type (FORUM_POST, BLOG_ENTRY, ...) type...
Add parser options to abuse reports
Add parser options to abuse reports
JavaScript
mit
nodeca/nodeca.core,nodeca/nodeca.core
b14b5c49a76a81fc92c36ba3e2ca0c7c59274cb3
modules/components/View.js
modules/components/View.js
import { createComponent } from 'react-fela' const View = props => ({ display: props.hidden && 'none', zIndex: props.zIndex, position: 'fixed', top: 0, left: 0, bottom: 0, right: 0 }) export default createComponent(View)
import { createComponent } from 'react-fela' const View = props => ({ display: props.hidden ? 'none' : 'flex', zIndex: props.zIndex, position: 'fixed', top: 0, left: 0, bottom: 0, right: 0 }) export default createComponent(View)
Add flex display to view by default
Add flex display to view by default
JavaScript
mit
rofrischmann/kilvin
55d795f8fbb1d51c9b91c9d56a352fd56becf529
index.js
index.js
module.exports = function stringReplaceAsync( string, searchValue, replaceValue ) { try { if (typeof replaceValue === "function") { // Step 1: Call native `replace` one time to acquire arguments for // `replaceValue` function // Step 2: Collect all return values in an array // Step 3...
module.exports = function stringReplaceAsync( string, searchValue, replaceValue ) { try { if (typeof replaceValue === "function") { // 1. Run fake pass of `replace`, collect values from `replaceValue` calls // 2. Resolve them with `Promise.all` // 3. Run `replace` with resolved values ...
Clarify the code a bit
Clarify the code a bit
JavaScript
mit
dsblv/string-replace-async
b634cda9d411859bcce4d15b9c9a55143ecc7265
src/Reporter.js
src/Reporter.js
// cavy-cli reporter class. export default class CavyReporter { // Internal: Creates a websocket connection to the cavy-cli server. onStart() { const url = 'ws://127.0.0.1:8082/'; this.ws = new WebSocket(url); } // Internal: Send report to cavy-cli over the websocket connection. onFinish(report) { ...
// Internal: CavyReporter is responsible for sending the test results to // the CLI. export default class CavyReporter { // Internal: Creates a websocket connection to the cavy-cli server. onStart() { const url = 'ws://127.0.0.1:8082/'; this.ws = new WebSocket(url); } // Internal: Send report to cavy-c...
Improve top level class description
Improve top level class description
JavaScript
mit
pixielabs/cavy
71083a50a6cc900edb272dded2c3578ee5065d2d
index.js
index.js
require('./lib/metro-transit') // Create the handler that responds to the Alexa Request. exports.handler = function (event, context) { // Create an instance of the MetroTransit skill. var dcMetro = new MetroTransit(); dcMetro.execute(event, context); };
var MetroTransit = require('./lib/metro-transit'); // Create the handler that responds to the Alexa Request. exports.handler = function (event, context) { MetroTransit.execute(event, context); };
Update driver file for new module interfaces
Update driver file for new module interfaces
JavaScript
mit
pmyers88/dc-metro-echo
27e8daf7bf9ab4363314a5af41d9eb5ea4de9fdb
src/atoms/TextComponent/index.js
src/atoms/TextComponent/index.js
import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import styles from './text_component.module.scss'; function setWeight( { semibold, light } ) { if ( semibold ) return styles.semibold; if ( light ) return styles.light; return styles.regular; } function TextComp...
import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import styles from './text_component.module.scss'; function setWeight( { semibold, light } ) { if ( semibold ) return styles.semibold; if ( light ) return styles.light; return styles.regular; } function TextComp...
Update Text Component to allow React components to render as child
Update Text Component to allow React components to render as child
JavaScript
mit
policygenius/athenaeum,policygenius/athenaeum,policygenius/athenaeum
4077314ce800a011121a04828df4da2163604a81
index.js
index.js
'use strict'; var R = require('ramda'); var isEmptyObj = R.pipe(R.keys, R.isEmpty); function ModelRenderer(model) { this.modelName = model.modelName; this.attrs = model.attrs; } function attrToString(key, value) { var output = '- ' + key; if (R.has('primaryKey', value)) { output += ' (primaryKey)'; } ...
'use strict'; var R = require('ramda'); var isEmptyObj = R.pipe(R.keys, R.isEmpty); function ModelRenderer(model) { this.modelName = model.modelName; this.attrs = model.attrs; } function attrToString(key, value) { var output = '- ' + key; if (R.has('primaryKey', value)) { output += ' (primaryKey)'; } ...
Create plain object in toJSON method
Create plain object in toJSON method Standard deep equality doesn't seem to fail because it doesn't check for types (i.e. constructor). However, the deep equality that chai uses takes that into account and seems like a good idea to remove the prototype in the object to be used for JSON output.
JavaScript
mit
jcollado/modella-render-docs
c1a83e68a97eb797d81e900271262840631b5467
index.js
index.js
var app = require('./server/routes'); var server = app.listen(3000, function() { console.log('Listening on port %d', server.address().port); });
process.title = 'Feedback-App'; var app = require('./server/routes'); var server = app.listen(3000, function() { console.log('Listening on port %d', server.address().port); }); /** * Shutdown the server process * * @param {String} signal Signal to send, such as 'SIGINT' or 'SIGHUP' */ var close = function(...
Add shutdown notification and process title
Add shutdown notification and process title
JavaScript
mit
maskedcoder/feedback-app,maskedcoder/feedback-app
eeb6e25ba97d0dae3fb1c8ab6a8aec892da25ad3
js/util.js
js/util.js
/** * Searches the first loaded style sheet for an @keyframes animation by name. * FYI: If you use "to" or "from" they'll get converted to percentage values, so use them for manipulating rules. * Source (Optimized for flapper): http://jsfiddle.net/russelluresti/RHhBz/3/. **/ function findKeyframesRule(name) { var...
/** * Searches the first loaded style sheet for an @keyframes animation by name. * FYI: If you use "to" or "from" they'll get converted to percentage values, so use them for manipulating rules. * Source (Optimized for flapper): http://jsfiddle.net/russelluresti/RHhBz/3/. **/ function findKeyframesRule(name) { for...
Fix uBlock Origin breaking flapper by injecting CSS stylesheet
Fix uBlock Origin breaking flapper by injecting CSS stylesheet
JavaScript
mpl-2.0
ryanwarsaw/flapper,ryanwarsaw/flapper
b91384ff9e6adb7d00afb166bb18e1a55e4d7286
index.js
index.js
'use strict'; const semver = require('semver'); const fetch = require('node-fetch'); const url = require('url'); module.exports = pkg => { if (typeof pkg === 'string') { pkg = { name: pkg } } if (!pkg || !pkg.name) { throw new Error('You must provide a package name'); } pkg.version = p...
'use strict'; const semver = require('semver'); const fetch = require('node-fetch'); const url = require('url'); module.exports = pkg => { if (typeof pkg === 'string') { pkg = { name: pkg } } if (!pkg || !pkg.name) { throw new Error('You must provide a package name'); } pkg.version = pkg...
Add 'full' option to get all package details not just version number.
Add 'full' option to get all package details not just version number.
JavaScript
mit
sillero/registry-resolve
9fe321c8a3f4da36196ac115987c4e7db6642f75
index.js
index.js
var _ = require('underscore'); var utils = require('./lib/utils'); var middleware = require('./lib/middleware'); var fixture = require('./lib/fixture'); var service = require('./lib/service'); var transform = require('./lib/transform'); var view = require('./lib/view'); /** * Reads in route and service definitions fro...
require('es6-promise').polyfill(); var _ = require('lodash'); var utils = require('./lib/utils'); /** * Reads in route and service definitions from JSON and configures * express routes with the appropriate middleware for each. * @module router * @param {object} app - an Express instance * @param {object} routes ...
Update reducto module to work with new config schema.
Update reducto module to work with new config schema.
JavaScript
mit
michaelleeallen/reducto
f0c62f3c90f96a29736d5715dc4fdb8f15549ed6
lib/react/loading-progress.js
lib/react/loading-progress.js
'use babel' import {React} from 'react-for-atom' export default React.createClass({ propTypes: { readyCount: React.PropTypes.number, totalCount: React.PropTypes.number }, render () { if (isNaN(this.props.readyCount) || isNaN(this.props.totalCount)) { return <span /> } else { return...
'use babel' import {React} from 'react-for-atom' export default React.createClass({ propTypes: { readyCount: React.PropTypes.number, totalCount: React.PropTypes.number }, render () { if (isNaN(this.props.readyCount) || isNaN(this.props.totalCount)) { return <span /> } else { return...
Move tooltip to only show on hovering info-icon
:art: Move tooltip to only show on hovering info-icon
JavaScript
mit
viddo/atom-textual-velocity,viddo/atom-textual-velocity,onezoomin/atom-textual-velocity
69a4e2ba1022b3215255d13b15d5b35063f46386
index.js
index.js
const request = require('request'); const fs = require('fs'); const thenify = require('thenify').withCallback; const download = (url, file, callback) => { const stream = fs.createWriteStream(file); stream.on('finish', () => { callback(null, file); }); stream.on('error', error => { callback(error); })...
const request = require('request'); const fs = require('fs'); const thenify = require('thenify').withCallback; const download = (url, file, callback) => { const stream = fs.createWriteStream(file); stream.on('finish', () => { callback(null, file); }); stream.on('error', error => { callback(error); })...
Handle errors that occure during request
Handle errors that occure during request
JavaScript
mit
demohi/co-download
1e55d5399e6c6a34f49fa992982fb3b79ad3f9e7
index.js
index.js
module.exports = function (protocol) { protocol = protocol || 'http'; var url = 'http://vicopo.selfbuild.fr/search/'; switch (protocol) { case 'https': url = 'https://www.selfbuild.fr/vicopo/search/'; break; case 'http': break; default: throw new Error(protocol + ' protocol not supported'); } var...
module.exports = function (protocol) { protocol = protocol || 'http'; var url = 'http://vicopo.selfbuild.fr/search/'; switch (protocol) { case 'https': url = 'https://www.selfbuild.fr/vicopo/search/'; break; case 'http': break; default: throw new Error(protocol + ' protocol not supported'); } var...
Make it compatible with older node.js
Make it compatible with older node.js
JavaScript
mit
kylekatarnls/vicopo,kylekatarnls/vicopo,kylekatarnls/vicopo,kylekatarnls/vicopo,kylekatarnls/vicopo
60689993d75db32701e99f7eb9110ce8eff54610
index.js
index.js
"use strict"; // modified from https://github.com/es-shims/es6-shim var keys = require('object-keys'); var isObject = function (obj) { return typeof obj !== 'undefined' && obj !== null; }; var assignShim = function assign(target, source) { var s, i, props; if (!isObject(target)) { throw new TypeError('target must ...
"use strict"; // modified from https://github.com/es-shims/es6-shim var keys = Object.keys || require('object-keys'); var isObject = function (obj) { return typeof obj !== 'undefined' && obj !== null; }; var assignShim = function assign(target, source) { var s, i, props; if (!isObject(target)) { throw new TypeErro...
Use the native Object.keys if it's available.
Use the native Object.keys if it's available.
JavaScript
mit
ljharb/object.assign,es-shims/object.assign,reggi/object.assign
45bd22346dbd3cfeaedea1a3061ff5cc50b3e9a0
index.js
index.js
"use strict"; module.exports = { rules: { "sort-object-props": function(context) { var ignoreCase = context.options[0].ignoreCase; var ignoreMethods = context.options[0].ignoreMethods; var MSG = "Property names in object literals should be sorted"; return { ...
"use strict"; module.exports = { rules: { "sort-object-props": function(context) { var caseSensitive = context.options[0].caseSensitive; var ignoreMethods = context.options[0].ignoreMethods; var MSG = "Property names in object literals should be sorted"; retu...
Rename option to caseSensitive to avoid double negation
Rename option to caseSensitive to avoid double negation
JavaScript
mit
shane-tomlinson/eslint-plugin-sorting,jacobrask/eslint-plugin-sorting
b2414317832618de90a46fa0115e0903a749b4de
index.js
index.js
// Enable promise error logging require('promise/lib/rejection-tracking').enable(); var express = require('express'); var app = express(); var certificate = require('./src/certificate') app.set('port', (process.env.PORT || 5000)); app.use(express.static(__dirname + '/public')); app.set('views', __dirname + '/views'...
// Enable promise error logging require('promise/lib/rejection-tracking').enable(); var express = require('express'); var app = express(); var certificate = require('./src/certificate') app.set('port', (process.env.PORT || 5000)); app.use(express.static(__dirname + '/public')); app.set('views', __dirname + '/views'...
Remove redundant call to getCertificationData()
Remove redundant call to getCertificationData() This was fetching certificate info from every site twice.
JavaScript
mit
JensDebergh/certificate-dashboard,JensDebergh/certificate-dashboard,JensDebergh/certificate-dashboard
9260ae76dba730555f71ea839d4c42cfe9d5393e
index.js
index.js
var express = require("express"), mongoose = require("mongoose"), app = express(); mongoose.connect("mongodb://localhost/test", function (err) { if (!err) { console.log("Connected to MongoDB"); } else { console.error(err); } }); app.get("/", function (req, res) { res.send("Hey buddy!"); }); v...
var express = require("express"), mongoose = require("mongoose"), app = express(); mongoose.connect("mongodb://localhost/test", function (err) { if (!err) { console.log("Connected to MongoDB"); } else { console.error(err); } }); app.get("/", function (req, res) { res.send("Hey buddy!"); }); v...
Use callbacks to ensure save is completed before returning a result
Use callbacks to ensure save is completed before returning a result
JavaScript
mit
shippableSamples/sample_node_mongo,pranaypareek/sample_node_mongo,samples-org-read/sample_node_mongo,a-murphy/sample_node_mongo,navneetjo/sample_node_mongo,buildsample/sample_node_mongo,a-murphy/sample_node_mongo,vidyar/sample_node_mongo
5203a7c14acab3253aff2494f4bbacaa945ff3c3
src/controllers/post-controller.js
src/controllers/post-controller.js
import BlogPost from '../database/models/blog-post'; import log from '../log'; const PUBLIC_API_ATTRIBUTES = [ 'id', 'title', 'link', 'description', 'date_updated', 'date_published' ]; const DEFAULT_ORDER = [ ['date_published', 'DESC'] ]; export function getAll() { return new Promise((resolve, reject...
import BlogPost from '../database/models/blog-post'; import log from '../log'; const PUBLIC_API_ATTRIBUTES = [ 'id', 'title', 'link', 'description', 'date_updated', 'date_published', 'author_id' ]; const DEFAULT_ORDER = [ ['date_published', 'DESC'] ]; export function getAll() { return new Promise((...
Allow author_id on public API
Allow author_id on public API
JavaScript
mit
csblogs/api-server,csblogs/api-server
24792e355734a207bd1c51a43b557867da459cce
src/js/directives/participate.js
src/js/directives/participate.js
'use strict'; angular.module('Teem') .directive('participate', function() { return { controller: [ '$scope', '$element', '$attrs', 'SessionSvc', '$timeout', 'CommunitiesSvc', function($scope, $element, $attrs, SessionSvc, $timeout, CommunitiesSvc) { $scope.participateCopyOn = $attrs.pa...
'use strict'; angular.module('Teem') .directive('participate', function() { return { controller: [ '$scope', '$element', '$attrs', 'SessionSvc', '$timeout', 'CommunitiesSvc', function($scope, $element, $attrs, SessionSvc, $timeout, CommunitiesSvc) { $scope.participateCopyOn = $attrs.pa...
Copy only the participants list instead of using .extend()
Copy only the participants list instead of using .extend()
JavaScript
agpl-3.0
P2Pvalue/teem,P2Pvalue/teem,Grasia/teem,Grasia/teem,Grasia/teem,P2Pvalue/pear2pear,P2Pvalue/pear2pear,P2Pvalue/teem
ad7a8ebb6994ad425c8429a052ef0abc91365ada
index.js
index.js
var path = require('path'); var fs = require('fs'); var mime = require('mime'); var pattern = function (file, included) { return {pattern: file, included: included, served: true, watched: false}; }; var framework = function (files) { files.push(pattern(path.join(__dirname, 'framework.js'), false)); files....
var path = require('path'); var fs = require('fs'); var mime = require('mime'); var pattern = function (file, included) { return {pattern: file, included: included, served: true, watched: false}; }; var framework = function (files) { files.push(pattern(path.join(__dirname, 'framework.js'), false)); files....
Fix proxy incorrectly proxying requests for files a level deeper than intended
Fix proxy incorrectly proxying requests for files a level deeper than intended
JavaScript
mit
jimsimon/karma-web-components,jimsimon/karma-web-components
e5ffafb53bdce4fdfca12680175adb6858dacd75
index.js
index.js
var Xray = require('x-ray'), fs = require('fs') var x = Xray() var baseURLPrefix = "http://www.thaischool.in.th/sitemap.php?school_area=&province_id=", baseURLSuffix = "&schooltype_id=&txtsearch=", provinces = require('./provinces.json') function appendObject(obj){ var resultFile = fs.readFileSync('./r...
var Xray = require('x-ray'), fs = require('fs') var x = Xray() var baseURLPrefix = "http://www.thaischool.in.th/sitemap.php?school_area=&province_id=", baseURLSuffix = "&schooltype_id=&txtsearch=", provinces = require('./provinces.json') function appendObject(obj){ var resultFile = fs.readFileSync('./r...
Save result as array of school name only
Save result as array of school name only
JavaScript
isc
lukyth/thailand-school-collector
b4f454f3701fd304e9775affc51234847d376918
src/Plugin.js
src/Plugin.js
/** * Initialize Pattern builder plugin. */ ;(function ($) { var pluginName = 'patternMaker', pluginDefaults = { palette: [] }; /** * Constructor. * * @param {dom} element Drawing board * @param {object} options Plugin options */ function...
/** * Initialize Pattern builder plugin. */ ;(function () { var pluginName = 'patternMaker', pluginDefaults = { palette: [] }; /** * Constructor. * * @param {dom} element Drawing board * @param {object} options Plugin options */ function ...
Use jQuery directly instead of $ in plugin
Use jQuery directly instead of $ in plugin
JavaScript
mit
ivannpaz/PatternMaker
f9bb15454fe3d0ec86893fbda7f08d0860cffe6b
gulp/watch.js
gulp/watch.js
'use strict'; var gulp = require('gulp'); var browserSync = require('browser-sync'); gulp.task('browser-sync', function () { browserSync({ server: { baseDir: './dist' } }); }); gulp.task('watch', ['build', 'browser-sync'], function () { gulp.watch('./app/**/*.html', ['html']); gulp.watch('./app...
'use strict'; var gulp = require('gulp'); var browserSync = require('browser-sync'); gulp.task('watch', ['build', 'serve'], function () { gulp.watch('./app/**/*.html', ['html']); gulp.watch('./app/**/*.js', ['js']); gulp.watch('./dist/**/*').on('change', function () { browserSync.reload(); }); }); gulp....
Rename browser-sync task to serve.
Rename browser-sync task to serve.
JavaScript
mpl-2.0
learnfwd/learnfwd.com,learnfwd/learnfwd.com,learnfwd/learnfwd.com
bc6673cefccf4db6b83742eaafe338d22b2d7310
cla_frontend/assets-src/javascripts/modules/moj.Conditional.js
cla_frontend/assets-src/javascripts/modules/moj.Conditional.js
(function () { 'use strict'; moj.Modules.Conditional = { el: '.js-Conditional', init: function () { var _this = this; this.cacheEls(); this.bindEvents(); this.$conditionals.each(function () { _this.toggleEl($(this)); }); }, bindEvents: function () { v...
/* globals _ */ (function () { 'use strict'; moj.Modules.Conditional = { el: '.js-Conditional', init: function () { _.bindAll(this, 'render'); this.cacheEls(); this.bindEvents(); }, bindEvents: function () { this.$conditionals.on('change deselect', this.toggle); moj...
Add module for conditional content
Add module for conditional content
JavaScript
mit
ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend,ministryofjustice/cla_frontend
3c357c4c8043c7867e1abc0a2397735e6a8e6089
src/reducers/general.js
src/reducers/general.js
import * as types from "../actions/types"; import { chooseDisplayComponentFromURL } from "../actions/navigation"; import { hasExtension, getExtension } from "../util/extensions"; /* the store for cross-cutting state -- that is, state not limited to <App> */ const getFirstPageToDisplay = () => { if (hasExtension("en...
import * as types from "../actions/types"; import { chooseDisplayComponentFromURL } from "../actions/navigation"; import { hasExtension, getExtension } from "../util/extensions"; /* the store for cross-cutting state -- that is, state not limited to <App> */ const getFirstPageToDisplay = () => { if (hasExtension("en...
Fix bugs in redux state of pathname
Fix bugs in redux state of pathname We were getting bugs due to the redux state of `general.pathname` set to `undefined` when it shouldn't be as a result of `PAGE_CHANGE` actions with no `action.path` data. This resulted in incorrect API requests and the display of results which didn't match the URL.
JavaScript
agpl-3.0
nextstrain/auspice,nextstrain/auspice,nextstrain/auspice
80cfc47a1c60e66836fdd7660c944f64c5d4c0c4
src/time-segments.js
src/time-segments.js
var TimeSegments = { // Segment an array of events by scale segment(events, scale, options) { scale = scale || 'weeks'; options = options || {}; _.defaults(options, { startAttribute: 'start', endAttribute: 'end' }); events = _.chain(events).clone().sortBy(options.startAttribute).val...
var TimeSegments = { // Segment an array of events by scale segment(events, scale, options) { scale = scale || 'weeks'; options = options || {}; _.defaults(options, { startAttribute: 'start', endAttribute: 'end' }); events = _.chain(events).clone().sortBy(options.startAttribute).val...
Refactor source to use more ES6 syntax.
Refactor source to use more ES6 syntax.
JavaScript
mit
jmeas/time-segments.js
6ee08bdbccec11791f9946d692174739176ffa8e
src/common.js
src/common.js
export const formatURL = (url) => ( url.length ? url.replace(/^https?:\/\//, '') : '' ) export const getTitle = (data) => ( data.about && data.about.name ? data.about.name : data.totalItems + " Entries" ) export default { getTitle, formatURL }
export const formatURL = (url) => ( url.length ? url.replace(/^https?:\/\//, '') : '' ) export const getTitle = (data) => ( data.about && (data.about.name || data.about['@id']) ? data.about.name || data.about['@id'] : data.totalItems + " Entries" ) export default { getTitle, formatURL }
Fix title of resources without name
Fix title of resources without name
JavaScript
apache-2.0
literarymachine/crg-ui
089247c62a36e4a2e0c149001bd06ccf562ebc4e
src/config.js
src/config.js
export let baseUrl = 'http://rosettastack.com'; export let sites = [{ name: 'Programmers', slug: 'programmers', seUrl: 'http://programmers.stackexchange.com/', langs: ['en', 'fr'], db: 'localhost/programmers', }, { name: 'Coffee', slug: 'coffee', seUrl: 'http://coffee.stackexchange.com/', langs: ['en'...
export let baseUrl = 'http://rosettastack.com'; export let sites = [{ name: 'Programmers', slug: 'programmers', seUrl: 'http://programmers.stackexchange.com/', langs: ['en', 'fr'], db: 'localhost/programmers', }, { name: 'Coffee', slug: 'coffee', seUrl: 'http://coffee.stackexchange.com/', langs: ['en'...
Fix db ref for SO
Fix db ref for SO
JavaScript
mpl-2.0
bbondy/stack-view,bbondy/stack-view,bbondy/stack-view
34f2f7d42346f564e4846435fb35ba19d3b5f8f8
src/Native/Spruce.js
src/Native/Spruce.js
// make is a function that takes an instance of the // elm runtime // returns an object where: // keys are names to be accessed in pure Elm // values are either functions or values function make(elm) { // If Native isn't already bound on elm, bind it! elm.Native = elm.Native || {} // then ...
var _binary_koan$elm_spruce$Native_Spruce = function() { function listen(address, program) { console.log(address) return program } return { toHtml: F2(listen) } }()
Update native module to 0.18 style
Update native module to 0.18 style
JavaScript
mit
binary-koan/elm-spruce
3769ce9f09658a3748209193b6dc29e68c9160dd
src/getter.js
src/getter.js
"use strict"; var // redis = require("redis"), // client = redis.createClient(), _ = require("underscore"), Fetcher = require("l2b-price-fetchers"); module.exports.getBookDetails = function (isbn, cb) { var f = new Fetcher(); f.fetch( {vendor: "foyles", isbn: isbn }, function (e...
"use strict"; var // redis = require("redis"), // client = redis.createClient(), _ = require("underscore"), Fetcher = require("l2b-price-fetchers"); function getBookDetails (isbn, cb) { fetchFromScrapers( {vendor: "foyles", isbn: isbn }, function (err, results) { if (err) { r...
Split up the book detail fetching into smaller chunks
Split up the book detail fetching into smaller chunks
JavaScript
agpl-3.0
OpenBookPrices/openbookprices-api
1daccbf90de27ae2b3a6ac29d448cd78664a0f87
src/server.js
src/server.js
'use strict' let fs = require('fs') let dotenv = require('dotenv') let express = require('express') let session = require('express-session') let cookieParser = require('cookie-parser') let bodyParser = require('body-parser') let morgan = require('morgan') let routes = require('./api/routes') dotenv.config({silent: tr...
'use strict' let fs = require('fs') let dotenv = require('dotenv') let express = require('express') let session = require('express-session') let cookieParser = require('cookie-parser') let bodyParser = require('body-parser') let morgan = require('morgan') let routes = require('./api/routes') let extensions = require('...
Load extensions into express app
Load extensions into express app
JavaScript
mit
shrunyan/mc-core,shrunyan/mc-core,andyfleming/mc-core,andyfleming/mc-core
a0f35993688c09fdb7fa49ec67070384e4a79ee2
test/brushModes-test.js
test/brushModes-test.js
var vows = require('vows'), assert = require('assert'), events = require('events'), load = require('./load'), suite = vows.describe('brushModes'); function d3Parcoords() { var promise = new(events.EventEmitter); load(function(d3) { promise.emit('success', d3.parcoords()); }); return promise...
var vows = require('vows'), assert = require('assert'), events = require('events'), load = require('./load'), suite = vows.describe('brushModes'); function d3Parcoords() { var promise = new(events.EventEmitter); load(function(d3) { promise.emit('success', d3.parcoords()); }); return promise...
Add angular brush mode to test
Add angular brush mode to test
JavaScript
bsd-3-clause
bbroeksema/parallel-coordinates,julianheinrich/parallel-coordinates,julianheinrich/parallel-coordinates,bbroeksema/parallel-coordinates
4ec97ddac5fcc131705e5047f4e6057c2abc5cdc
package.js
package.js
Package.describe({ summary: "Login service for VKontakte accounts (https://vk.com)", version: "0.1.4", git: "https://github.com/alexpods/meteor-accounts-vk", name: "mrt:accounts-vk" }); Package.on_use(function(api) { api.versionsFrom('METEOR@0.9.0'); api.use('accounts-base', ['client', 'server'...
Package.describe({ summary: "Login service for VKontakte accounts (https://vk.com)", version: "0.2.0", git: "https://github.com/alexpods/meteor-accounts-vk", name: "mrt:accounts-vk" }); Package.on_use(function(api) { api.versionsFrom('METEOR@0.9.0'); api.use('accounts-base', ['client', 'server'...
Add 'imply' service-configuration. Increment version number to 0.2.0
UPD: Add 'imply' service-configuration. Increment version number to 0.2.0
JavaScript
mit
newsiberian/meteor-accounts-vk,newsiberian/meteor-accounts-vk,alexpods/meteor-accounts-vk,alexpods/meteor-accounts-vk
b64a51e136a4bcce3d0c2d5292c53d85c2d0e7de
test/data/testrunner.js
test/data/testrunner.js
jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. // load testswarm agent (function() { var url = window.location.search; url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); if ( !url || url.indexOf("http") !== 0 ) { return; } document.write("<scr" + "ipt src='http://...
Handle auto-running of the TestSwarm injection script in the test suite.
Handle auto-running of the TestSwarm injection script in the test suite.
JavaScript
mit
hoorayimhelping/jquery,eburgos/jquery,isaacs/jquery,gnarf/jquery,mislav/jquery,diracdeltas/jquery,sancao2/jquery,RubyLouvre/jquery,kpozin/jquery-nodom,chitranshi/jquery,hoorayimhelping/jquery,Karyotyper/jquery,demetr84/Jquery,demetr84/Jquery,dtjm/jquery,Karyotyper/jquery,jquery/jquery,npmcomponent/component-jquery,sanc...
2cded40e931866ecf95915ba49719609d1c591e9
test/middleware.spec.js
test/middleware.spec.js
import { createAuthMiddleware } from '../src' describe('auth middleware', () => { const middleware = createAuthMiddleware() const nextHandler = middleware({}) const actionHandler = nextHandler() test('it returns a function that handles store', () => { expect(middleware).toBeInstanceOf(Function) expect...
import { createAuthMiddleware } from '../src' describe('auth middleware', () => { const middleware = createAuthMiddleware() it('returns a function that handles {getState, dispatch}', () => { expect(middleware).toBeInstanceOf(Function) expect(middleware.length).toBe(1) }) describe('store handler', () ...
Use it instead of test. Small structure change
Use it instead of test. Small structure change
JavaScript
mit
jerelmiller/redux-simple-auth
ea146316b0f0d854a750ecb913b95df2705d1257
autoformat.js
autoformat.js
#!/usr/bin/env nodejs // Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); console.log(argv) /** * Main p...
#!/usr/bin/env nodejs // Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); /** * Main procedure */ files....
Change default output behaviour to output to STDIO
Change default output behaviour to output to STDIO
JavaScript
mit
tyxchen/turing-autoformat,tyxchen/turing-autoformat
d8d45721bd463e59645470604f18e82d5e98e636
src/Portal/Portal.js
src/Portal/Portal.js
import React, {PropTypes} from 'react'; import ReactDOM from 'react-dom'; class Portal extends React.Component { componentDidMount() { this.nodeEl = document.createElement('div'); document.body.appendChild(this.nodeEl); this.renderChildren(this.props); } componentWillUnmount() { ReactDOM.unmount...
import React, {PropTypes} from 'react'; import ReactDOM from 'react-dom'; class Portal extends React.Component { componentDidMount() { this.nodeEl = document.createElement('div'); document.body.appendChild(this.nodeEl); this.renderChildren(this.props); } componentWillUnmount() { ReactDOM.unmount...
Remove default rendered child element
Remove default rendered child element
JavaScript
apache-2.0
mesosphere/reactjs-components,mesosphere/reactjs-components
1039b0472ae8427539f1b1034b59596415e981fb
src/views/picker-views/base-picker-view.js
src/views/picker-views/base-picker-view.js
'use strict'; var BaseView = require('../base-view'); function BasePickerView() { BaseView.apply(this, arguments); this._initialize(); } BasePickerView.prototype = Object.create(BaseView.prototype); BasePickerView.prototype.constructor = BasePickerView; BasePickerView.prototype._initialize = function () { th...
'use strict'; var BaseView = require('../base-view'); function BasePickerView() { BaseView.apply(this, arguments); this._initialize(); } BasePickerView.prototype = Object.create(BaseView.prototype); BasePickerView.prototype.constructor = BasePickerView; BasePickerView.prototype._initialize = function () { th...
Remove _onSelect noop from BasePickerView
Remove _onSelect noop from BasePickerView
JavaScript
mit
braintree/braintree-web-drop-in,braintree/braintree-web-drop-in,braintree/braintree-web-drop-in
7c9ec3264fcc0f6815028d793b8156d8af216ad0
test/helpers/file_helper_test.js
test/helpers/file_helper_test.js
import { expect } from '../spec_helper' import jsdom from 'jsdom' import { getRestrictedSize, // orientImage, } from '../../src/helpers/file_helper' function getDOMString() { // 1x1 transparent gif const src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' const landsca...
import { expect } from '../spec_helper' import { getRestrictedSize } from '../../src/helpers/file_helper' describe('file helpers', () => { context('#getRestrictedSize', () => { it('does not restrict the width and height', () => { const { width, height } = getRestrictedSize(800, 600, 2560, 1440) expec...
Remove tests around canvas objects
Remove tests around canvas objects [jsdom doesn’t really handle the canvas element very well](https://github.com/tmpvar/jsdom#canvas). It just treats it just like a div. We can add the canvas package, but that requires a whole slew of other things to do deal with (namely Cairo) which seems like a maintenance nightmare...
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
142b39b54eb529386ff917c2a6e80ec74abece11
js/plugins.js
js/plugins.js
// http://unheap.com $(function() { $('.browsehappy').on('click', function() { $(this).slideUp('fast'); }); });
// http://unheap.com $(function() { $('.browsehappy').click(function() { $(this).slideUp(); }); });
Make browse happy slide up cleaner
Make browse happy slide up cleaner
JavaScript
mit
kennethwang14/VerticalRhythmDemo,kennethwang14/LostGridExample,kennethwang14/LostGridExample,kennethwang14/TypographyHandbook,kennethwang14/TypographyHandbook,corysimmons/boy,kennethwang14/VerticalRhythmDemo
da6b3fc1a9a3ba60dc02310f68d6e58fc109d1b9
generators/app/templates/app/scripts/main.js
generators/app/templates/app/scripts/main.js
import App from './app'; import 'babel-polyfill'; common.app = new App(common); common.app.start();
import App from './app'; common.app = new App(common); common.app.start();
Remove babel-polyfill import in man.js
Remove babel-polyfill import in man.js
JavaScript
mit
snphq/generator-sp,snphq/generator-sp,i-suhar/generator-sp,i-suhar/generator-sp,snphq/generator-sp,i-suhar/generator-sp
112b74dcbde73c4f35426c24ab51bb10287b9c63
karma.conf.js
karma.conf.js
// Karma configuration module.exports = function (config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: './', // testing frameworks to use frameworks: ['mocha', 'chai', 'sinon'], // list of files / patterns to load in the browser. order ma...
// Karma configuration module.exports = function (config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: './', // testing frameworks to use frameworks: ['mocha', 'chai', 'sinon'], // list of files / patterns to load in the browser. order ma...
Remove untested files from karma
Remove untested files from karma
JavaScript
mit
gm758/Bolt,gm758/Bolt,elliotaplant/Bolt,thomasRhoffmann/Bolt,boisterousSplash/Bolt,thomasRhoffmann/Bolt,boisterousSplash/Bolt,elliotaplant/Bolt
466e870fc742981be4b178015042285717cdee12
test/index.js
test/index.js
var ACME = require( '..' ) var assert = require( 'assert' ) var nock = require( 'nock' ) suite( 'ACME', function() { var client = new ACME({ baseUrl: 'https://api.example.com', }) test( 'throws an error if baseUrl is not a string', function() { assert.throws( function() { new ACME.Client({ baseUrl: 42 ...
var ACME = require( '..' ) var assert = require( 'assert' ) var nock = require( 'nock' ) var ACME_API_BASE_URL = 'https://api.example.com' suite( 'ACME', function() { var client = new ACME.Client({ baseUrl: ACME_API_BASE_URL, }) test( 'throws an error if baseUrl is not a string', function() { assert.t...
Update test: Add `ACME_API_BASE_URL` constant
Update test: Add `ACME_API_BASE_URL` constant
JavaScript
mit
jhermsmeier/node-acme-protocol
a544b1ae597692ebb60175cf0572376f7d609d90
test/index.js
test/index.js
var chai = require('chai'); var expect = chai.expect; // var sinon = require('sinon'); var requestToContext = require('../src/requestToContext'); describe('requestToContext', function () { it('Convert the req to the correct contect', function (done) { console.log(requestToContext) done(); }); });
'use strict'; var chai = require('chai'); var expect = chai.expect; var requestToContext = require('../src/requestToContext'); describe('requestToContext', function () { describe('Converts the request to the correct context', function () { it('For get requests', function (done) { var result = requestToCon...
Add tests around requestToContext for get and post requests
Add tests around requestToContext for get and post requests
JavaScript
apache-2.0
krolow/falcor-express,jmnarloch/falcor-express,jontewks/falcor-express,Netflix/falcor-express
b5169369bea5ccdde34b214641f0c8eec09f64dd
lib/events.js
lib/events.js
/** * Setup the user (DOM) event flow. * * @private * @param {object} The moule instnace. */ module.exports = function (instance, template, options, dom, data) { for (var event in template.events) { for (var i = 0, l = template.events[event].length; i < l; ++i) { handleEvent(instance, templa...
/** * Setup the user (DOM) event flow. * * @private * @param {object} The moule instnace. */ module.exports = function (instance, template, options, dom, data) { for (var event in template.events) { for (var i = 0, l = template.events[event].length; i < l; ++i) { handleEvent(instance, templa...
Append domItem to event data.
Append domItem to event data.
JavaScript
mit
adioo/view
50714f6b030bddce42d1e3f69be83cb4c9da4188
src/notebook/components/transforms/index.js
src/notebook/components/transforms/index.js
import { displayOrder, transforms } from 'transformime-react'; /** * Thus begins our path for custom mimetypes and future extensions */ import PlotlyTransform from './plotly'; import GeoJSONTransform from './geojson'; const defaultDisplayOrder = displayOrder .insert(0, PlotlyTransform.MIMETYPE) .insert(0, Geo...
import { displayOrder, transforms } from 'transformime-react'; /** * Thus begins our path for custom mimetypes and future extensions */ import PlotlyTransform from './plotly'; import GeoJSONTransform from './geojson'; // Register custom transforms const defaultTransforms = transforms .set(PlotlyTransform.MIMETYP...
Comment on custom transform registration
Comment on custom transform registration
JavaScript
bsd-3-clause
jdetle/nteract,0u812/nteract,jdetle/nteract,nteract/composition,captainsafia/nteract,rgbkrk/nteract,0u812/nteract,jdfreder/nteract,captainsafia/nteract,nteract/nteract,rgbkrk/nteract,nteract/nteract,temogen/nteract,temogen/nteract,temogen/nteract,jdfreder/nteract,jdetle/nteract,nteract/composition,nteract/nteract,rgbkr...
245e9614db9218ddd4f982ba4b007665ba3627b3
applications/desktop/src/main/auto-updater.js
applications/desktop/src/main/auto-updater.js
/* @flow strict */ import { autoUpdater } from "electron-updater"; export function initAutoUpdater() { const log = require("electron-log"); log.transports.file.level = "info"; autoUpdater.logger = log; autoUpdater.checkForUpdatesAndNotify(); }
/* @flow strict */ import { autoUpdater } from "electron-updater"; export function initAutoUpdater() { if (process.env.NTERACT_DESKTOP_DISABLE_AUTO_UPDATE !== "1") { const log = require("electron-log"); log.transports.file.level = "info"; autoUpdater.logger = log; autoUpdater.checkForUpdatesAndNotify...
Allow environment variable NTERACT_DESKTOP_DISABLE_AUTO_UPDATE to disable auto-update.
Allow environment variable NTERACT_DESKTOP_DISABLE_AUTO_UPDATE to disable auto-update. Fixes #3517
JavaScript
bsd-3-clause
rgbkrk/nteract,nteract/nteract,nteract/nteract,rgbkrk/nteract,nteract/nteract,rgbkrk/nteract,nteract/composition,nteract/nteract,rgbkrk/nteract,nteract/composition,nteract/composition,rgbkrk/nteract,nteract/nteract
3096c29162a5acbf3b98ae1f699e6039976caf19
c2cgeoportal/scaffolds/update/+package+/static/mobile/app/model/Query.js
c2cgeoportal/scaffolds/update/+package+/static/mobile/app/model/Query.js
Ext.define('App.model.Query', { extend: 'Ext.data.Model', config: { fields: [ { name: 'detail', mapping: 'properties', convert: function(value, record) { var detail = [], attributes = record.raw.attr...
Ext.define('App.model.Query', { extend: 'Ext.data.Model', config: { fields: [ { name: 'detail', mapping: 'properties', convert: function(value, record) { var detail = [], attributes = record.raw.attr...
Allow using subst variables in layer attributes
Allow using subst variables in layer attributes
JavaScript
bsd-2-clause
tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal,tsauerwein/c2cgeoportal
d2e1ba9dbe878690d33c82025bb12e4e9efd8f65
js/scripts.js
js/scripts.js
var pingPong = function(i) { if ((i % 3 === 0) || (i % 5 === 0)) { return true; } else { return false; } }; $(function() { $("#game").submit(function(event) { $('#outputList').empty(); var number = parseInt($("#userNumber").val()); for (var i = 1; i <= number; i += 1) { if (i % 15 =...
var pingPong = function(i) { if ((i % 3 === 0) && (i % 5 != 0)) { return "ping"; } else if ((i % 5 === 0) && (i % 6 != 0)) { return "pong"; } else if ((i % 3 === 0) && (i % 5 === 0)) { return "ping pong"; } else { return false; } }; $(function() { $("#game").submit(function(event) { $('...
Change spec test code away from true/false; provides ping, pong, and ping pong returns instead
Change spec test code away from true/false; provides ping, pong, and ping pong returns instead
JavaScript
mit
kcmdouglas/pingpong,kcmdouglas/pingpong
06595b1ea4a93825e22a1221e6c44846e7bde1f8
test/e2e/e2e.spec.js
test/e2e/e2e.spec.js
import { Application } from 'spectron' import electronPath from 'electron' import path from 'path' jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000 const delay = time => new Promise(resolve => setTimeout(resolve, time)) describe('main window', function spec() { beforeAll(async () => { this.app = new Application({ ...
import { Application } from 'spectron' import electronPath from 'electron' import path from 'path' jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000 const delay = time => new Promise(resolve => setTimeout(resolve, time)) describe('main window', function spec() { beforeAll(async () => { this.app = new Application({ ...
Drop pessimistic printing of logs that shouldn't be there
enhance(test): Drop pessimistic printing of logs that shouldn't be there This test code is unnecessary in the common case and can be revived if the test fails.
JavaScript
mit
LN-Zap/zap-desktop,LN-Zap/zap-desktop,LN-Zap/zap-desktop
e03b40541d8e0843c4585489a2a711ee4183e222
cities_light/static/cities_light/autocomplete_light.js
cities_light/static/cities_light/autocomplete_light.js
$(document).ready(function() { // autocomplete widget javascript initialization for bootstrap=countrycity $('.autocomplete_light_widget[data-bootstrap=countrycity]').each(function() { var country_wrapper = $(this).prev(); var city_wrapper = $(this); function setup() { // get...
$(document).ready(function() { // autocomplete widget javascript initialization for bootstrap=countrycity $('.autocomplete_light_widget[data-bootstrap=countrycity]').each(function() { var country_wrapper = $(this).prev(); var city_wrapper = $(this); function setup() { // get...
Clear the city autocomplete when unselecting the country in countrycity widget
Clear the city autocomplete when unselecting the country in countrycity widget
JavaScript
mit
max-arnold/django-cities-light,yourlabs/django-cities-light,affan2/django-cities-light,eevol/django-cities-light,gpichot/django-cities-light,eevol/django-cities-light,KevinGrahamFoster/django-cities-light,affan2/django-cities-light,greenday2/django-cities-light,max-arnold/django-cities-light,gpichot/django-cities-light
1030f20315b0f661993c7aca33bb3f6fb9753503
src/components/InputArea.js
src/components/InputArea.js
import React, { Component } from 'react'; import TextField from 'material-ui/TextField'; import Card, { CardActions, CardContent } from 'material-ui/Card'; import Button from 'material-ui/Button'; import TaxCalculator from '../libs/TaxCalculator'; class TextFields extends Component { state = { income: 0, ex...
import React, { Component } from 'react'; import TextField from 'material-ui/TextField'; import Card, { CardActions, CardContent } from 'material-ui/Card'; import Button from 'material-ui/Button'; import TaxCalculator from '../libs/TaxCalculator'; class TextFields extends Component { handleSubmit(event) { event...
Delete state and add form.
Delete state and add form.
JavaScript
apache-2.0
migutw42/jp-tax-calculator,migutw42/jp-tax-calculator
f0c712adc291219c08ea9c1b680e258f6636cddc
lib/controllers/catalogs.js
lib/controllers/catalogs.js
const mongoose = require('mongoose'); const { omit } = require('lodash'); const Catalog = mongoose.model('Catalog'); function formatCatalog(catalog) { return omit(catalog.toObject({ virtuals: true }), '_metrics'); } function fetch(req, res, next, id) { Catalog .findById(id) .populate('service', 'location...
const mongoose = require('mongoose'); const { omit } = require('lodash'); const Catalog = mongoose.model('Catalog'); function formatCatalog(catalog) { return omit(catalog.toObject({ virtuals: true, minimize: false }), '_metrics'); } function fetch(req, res, next, id) { Catalog .findById(id) .populate('se...
Disable minimize for Catalog serialization
Disable minimize for Catalog serialization
JavaScript
agpl-3.0
inspireteam/geogw,jdesboeufs/geogw
69aa8d49b5a2082d2870d453521194a39a215001
lib/append.js
lib/append.js
/** * Insert content, specified by the parameter, to the end of each * element in the set of matched elements. */ function append(el) { var l = this.length, clone = false; // wrap content el = this.air(el); // matched parent elements (targets) this.each(function(node, index) { //console.log(index); ...
/** * Insert content, specified by the parameter, to the end of each * element in the set of matched elements. */ function append() { var i, l = this.length, el, args = Array.prototype.slice.call(arguments); for(i = 0;i < args.length;i++) { el = args[i]; // wrap content el = this.air(el); // ma...
Append supports multiple content args.
Append supports multiple content args.
JavaScript
mit
socialally/air,tmpfs/air,tmpfs/air,socialally/air
04bbd69917a604457ce3a3df860f3f5cb1d21c65
app/transmute.js
app/transmute.js
#!/usr/bin/env node 'use strict'; // Load base requirements const program = require('commander'), dotenv = require('dotenv').config(), path = require('path'); // Load our libraries const utils = require('./libs/utils'), logger = require('./libs/log'), i18n = require('./libs/locale'), que...
#!/usr/bin/env node 'use strict'; // Load base requirements const program = require('commander'), dotenv = require('dotenv').config(), path = require('path'); // Load our libraries const utils = require('./libs/utils'), logger = require('./libs/log'), i18n = require('./libs/locale'), que...
Update entry point to use queue
Update entry point to use queue
JavaScript
apache-2.0
transmutejs/core
7f0176380ad5ade420384d1ae4ea14a5180f05e8
tasks/doxdox.js
tasks/doxdox.js
var doxdox = require('doxdox'), utils = require('doxdox/lib/utils'), fs = require('fs'), path = require('path'), extend = require('extend'); module.exports = function (grunt) { grunt.registerMultiTask('doxdox', 'Generate documentation with doxdox.', function () { var done = this.async(), ...
var doxdox = require('doxdox'), utils = require('doxdox/lib/utils'), fs = require('fs'), path = require('path'), extend = require('extend'); module.exports = function (grunt) { grunt.registerMultiTask('doxdox', 'Generate documentation with doxdox.', function () { var done = this.async(), ...
Use Grunt API to write file
Use Grunt API to write file This way it guarantees that all the intermediate directories are created.
JavaScript
mit
mmarcon/grunt-doxdox,neogeek/grunt-doxdox
b54ae8bc91ae77569048be8af229be058e81d0f8
lib/plugins/tag/jsfiddle.js
lib/plugins/tag/jsfiddle.js
'use strict'; /** * jsFiddle tag * * Syntax: * {% jsfiddle shorttag [tabs] [skin] [height] [width] %} */ function jsfiddleTag(args, content){ var id = args[0]; var tabs = args[1] && args[1] !== 'default' ? args[1] : 'js,resources,html,css,result'; var skin = args[2] && args[2] !== 'default' ? args[2] : 'light...
'use strict'; /** * jsFiddle tag * * Syntax: * {% jsfiddle shorttag [tabs] [skin] [height] [width] %} */ function jsfiddleTag(args, content){ var id = args[0]; var tabs = args[1] && args[1] !== 'default' ? args[1] : 'js,resources,html,css,result'; var skin = args[2] && args[2] !== 'default' ? args[2] : 'light...
Set scrolling="no" to make iframe responsive
Set scrolling="no" to make iframe responsive the fiddle iframe is not responsive in iOS safari and Chrome. By setting `scrolling="no"` makes it possible to fix this issue, by setting `width=1px; min-width=100%` in CSS. [See StackOverflow](http://stackoverflow.com/questions/23083462/how-to-get-an-iframe-to-be-responsiv...
JavaScript
mit
amobiz/hexo,hexojs/hexo,zhipengyan/hexo,wangjordy/wangjordy.github.io,wangjordy/wangjordy.github.io,leelynd/tapohuck,noikiy/hexo,kywk/hexi,DevinLow/DevinLow.github.io,hexojs/hexo,DevinLow/DevinLow.github.io,zhipengyan/hexo,ppker/hexo,ppker/hexo,aulphar/hexo,kywk/hexi
2a774a58d510bc23eb7216543f0b4f83a5b8b481
src/js/components/services-by-gsbpm-phase.js
src/js/components/services-by-gsbpm-phase.js
import React from 'react' import { sparqlConnect } from '../sparql/configure-sparql' import { LOADED } from 'sparql-connect' import ServiceList from './service-list' function ServicesByGSBPMPhase({ loaded, services }) { if(loaded !== LOADED) return <span>loading......</span> return <ServiceList services={servi...
import React from 'react' import { sparqlConnect } from '../sparql/configure-sparql' import { LOADED } from 'sparql-connect' import ServiceList from './service-list' function ServicesByGSBPMPhase({ loaded, services }) { return <ServiceList services={services} msg="No service implements this GSBPM phase" ...
Remove useless check on `loaded`
Remove useless check on `loaded`
JavaScript
mit
UNECE/Model-Explorer,UNECE/Model-Explorer
91cd5e4293ad2f85c19de4ffe69127b6936fd8ab
lib/router.js
lib/router.js
Router.configure({ layoutTemplate: 'layout' }); Router.route('/', { name: 'home', waitOn: function () { return Meteor.subscribe('verifiedUsersCount'); }, onBeforeAction: function () { if (Meteor.user()) { Router.go('ridesList'); } else { this.next(); } } }); Router.route('/caro...
Router.configure({ layoutTemplate: 'layout' }); Router.route('/', { name: 'home', waitOn: function () { return Meteor.subscribe('verifiedUsersCount'); }, onBeforeAction: function () { if (Meteor.user()) { Router.go('ridesList'); } else { this.next(); } } }); Router.route('/caro...
Make findOne reactive for ride owners subscription.
Make findOne reactive for ride owners subscription. fix #9
JavaScript
mit
obvio171/rideboard,obvio171/rideboard
270c333096dbeb495571baed81c5f9debdf7d967
lib/server.js
lib/server.js
'use strict'; const fs = require('fs'); const express = require('express'); const send = require('send'); const morgan = require('morgan'); const errorHandler = require('errorhandler'); const compression = require('compression'); const expressLogStream = fs.createWriteStream('./logs/express.log', { flags: 'a' }); e...
'use strict'; const fs = require('fs'); const path = require('path'); const express = require('express'); const send = require('send'); const morgan = require('morgan'); const errorHandler = require('errorhandler'); const compression = require('compression'); exports.start = function start(config) { var statsDB =...
Create logs for each environment
Create logs for each environment
JavaScript
mit
pfleidi/podslurp
cbcd01ba33d3d8b4408d97ddbe3aa80eb22984dc
src/inject/inject.js
src/inject/inject.js
chrome.extension.sendMessage({}, function(response) { var readyStateCheckInterval = setInterval(function() { if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); var labels = document.getElementsByClassName('label'); Array.prototype.filter.call(labels, function(label) { ret...
chrome.extension.sendMessage({}, function(response) { var readyStateCheckInterval = setInterval(function() { if (document.readyState === "complete") { clearInterval(readyStateCheckInterval); var colorMapping = { 'blocked': 'rgb(199, 37, 67)', 'needs ': 'rgb(199, 37, 67)' }; ...
Set color on all newly-added labels
Set color on all newly-added labels
JavaScript
isc
oliverswitzer/wwltw-for-pivotal-tracker,mkenyon/red-labels-for-pivotal-tracker,oliverswitzer/wwltw-for-pivotal-tracker
46962ed201abf4e701fb069c02ab1a1751464857
information.js
information.js
'use strict'; var hosts = { 'bbc.co.uk': 'bbc', 'm.bbc.co.uk': 'bbc', 'reddit.com': 'reddit', 'www.reddit.com': 'reddit', 'condenast.co.uk': 'condenast' }; var organisations = { 'bbc': { 'owner': null, 'info': 'British Broadcasting Corporation' }, 'reddit': { 'owner': 'condenast', 'inf...
'use strict'; var hosts = { 'bbc.co.uk': 'bbc', 'm.bbc.co.uk': 'bbc', 'reddit.com': 'reddit', 'www.reddit.com': 'reddit', 'condenast.co.uk': 'condenast' 'tumblr.com' : 'tumblr' }; var organisations = { 'bbc': { 'owner': null, 'info': 'British Broadcasting Corporation' }, 'reddit': { 'own...
Add tumblr->yahoo info for server
Add tumblr->yahoo info for server
JavaScript
mit
magicmark/Transparification-Server
144eba59227a600aec09ab549c0be840698d191a
src/js/utils/_base-view.js
src/js/utils/_base-view.js
import * as _ from 'underscore'; import * as Backbone from 'backbone'; class BaseView extends Backbone.View { constructor(options = {}) { super(options); this._subviews = null; } registerSubView(view) { this._subviews = this._subviews || []; this._subviews.push(view); } remove() { _.in...
import * as _ from 'underscore'; import * as Backbone from 'backbone'; class BaseView extends Backbone.View { constructor(options = {}) { super(options); this._subviews = null; } assign(view, selector) { view.setElement(this.$(selector)).render(); } registerSubView(view) { this._subviews =...
Update base view w/convenience function for rendering subviews
Update base view w/convenience function for rendering subviews See: http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt-always-simp le/
JavaScript
mit
trevormunoz/katherine-anne,trevormunoz/katherine-anne,trevormunoz/katherine-anne
6dd03089f29ae7cd357f45a929bed8f7e7d6440b
src/input/storageHandler.js
src/input/storageHandler.js
'use strict' // Code thanks to MDN export function storageAvailable (type) { try { let storage = window[type] let x = '__storage_test__' storage.setItem(x, x) storage.removeItem(x) return true } catch (e) { let storage = window[type] return e instanceof DOMException && ( // everyt...
'use strict' // Code thanks to MDN export function storageAvailable (type) { try { let storage = window[type] let x = '__storage_test__' storage.setItem(x, x) storage.removeItem(x) return true } catch (e) { let storage = window[type] return e instanceof DOMException && ( // everyt...
Add all settings to populateStorage
Add all settings to populateStorage
JavaScript
mit
CrowsVeldt/FreeCodeCamp-Pomodoro-Timer
ccce0d08bd0a43ba10a5b18470095b0c19bfe18c
webpack.client.babel.js
webpack.client.babel.js
import base from './webpack.base.babel.js'; import path from 'path'; import webpack from 'webpack'; const {WDS_PORT, PORT, APP_WEB_BASE_PATH} = process.env; export default { ...base, entry: "./src/app/_client.js", output: { path: path.join(__dirname, 'dist', 'static'), filename: "app.js",...
import base from './webpack.base.babel.js'; import path from 'path'; import webpack from 'webpack'; const {WDS_PORT, PORT, APP_WEB_BASE_PATH} = process.env; export default { ...base, entry: "./src/app/_client.js", output: { path: path.join(__dirname, 'dist', 'static'), filename: "app.js",...
Fix dev server redirection bug
Fix dev server redirection bug When running `npm run dev` and opening the browser, newer version of WDS would redirect to the proxied server instead of proxying. Changed proxy syntax to match `**` instead of `*`
JavaScript
mit
mdjasper/React-Reading-List,tuxsudo/react-starter
ba816550e509def9d0d4f3f6d500b80402b0a5c2
routes/index.js
routes/index.js
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res) { res.render('index', { title: 'VoteAnon' }); }); router.route('/create') .get(function(req, res) { res.render('create', { title: 'VoteAnon: create poll' }); }) .post(function(req, res) { res...
var express = require('express'); var redis = require('redis'); var router = express.Router(); var client = redis.createClient(); /* GET home page. */ router.get('/', function(req, res) { res.render('index', { title: 'VoteAnon' }); }); router.route('/create') .get(function(req, res) { res.render('create', { titl...
Connect to redis on route
Connect to redis on route
JavaScript
mit
Pringley/voteanon
8a12e4a209c262d5ad446d99a81cd8936a353ab4
make-event.js
make-event.js
'use strict'; let fs = require('fs'); let moment = require('moment'); let parseDate = require('./parse-date'); function maybeParse(value) { if(value[0] === '@') { return moment(parseDate(value.slice(1))).format('YYYY-MM-DD HH-mm-ss'); } try { return JSON.parse(value); } catch(erro...
'use strict'; let fs = require('fs'); let moment = require('moment'); let parseDate = require('./parse-date'); function maybeParse(value) { if(value[0] === '@') { return moment(parseDate(value.slice(1))).format('YYYY-MM-DD HH-mm-ss'); } try { return JSON.parse(value); } catch(erro...
Allow event date to be overridden.
Allow event date to be overridden.
JavaScript
agpl-3.0
n2liquid/ev
baa2562e6410e491b9e094ff6b0900fe5ea23d7d
ember/tests/acceptance/page-not-found-test.js
ember/tests/acceptance/page-not-found-test.js
import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { visit, currentURL } from '@ember/test-helpers'; import { setupPretender } from 'skylines/tests/helpers/setup-pretender'; module('Acceptance | page-not-found', function(hooks) { setupApplicationTest(hooks); setupPret...
import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { visit, currentURL } from '@ember/test-helpers'; import { setupPolly } from 'skylines/tests/helpers/setup-polly'; module('Acceptance | page-not-found', function(hooks) { setupApplicationTest(hooks); setupPolly(hooks,...
Use Polly.js instead of Pretender
tests/page-not-found: Use Polly.js instead of Pretender
JavaScript
agpl-3.0
RBE-Avionik/skylines,Turbo87/skylines,RBE-Avionik/skylines,Harry-R/skylines,RBE-Avionik/skylines,skylines-project/skylines,Harry-R/skylines,Harry-R/skylines,RBE-Avionik/skylines,Turbo87/skylines,Turbo87/skylines,skylines-project/skylines,skylines-project/skylines,skylines-project/skylines,Harry-R/skylines,Turbo87/skyli...
430d0dd3530c83907f9867454fdd3781b05835c9
webpack_config/server/webpack.prod.babel.js
webpack_config/server/webpack.prod.babel.js
import webpack from 'webpack' import baseWebpackConfig from './webpack.base' import UglifyJSPlugin from 'uglifyjs-webpack-plugin' import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer' import {Plugin as ShakePlugin} from 'webpack-common-shake' import OptimizeJsPlugin from 'optimize-js-plugin' const plugins = [ ...
import webpack from 'webpack' import baseWebpackConfig from './webpack.base' import UglifyJSPlugin from 'uglifyjs-webpack-plugin' import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer' import {Plugin as ShakePlugin} from 'webpack-common-shake' import OptimizeJsPlugin from 'optimize-js-plugin' const analyzePlugin...
Revert "Revert "style(webpack_config/server): rewrite prod conf in functional style""
Revert "Revert "style(webpack_config/server): rewrite prod conf in functional style"" This reverts commit e9de3d6da5e3cfc03b6d5e39fe92ede9c110d712.
JavaScript
apache-2.0
Metnew/react-semantic.ui-starter
003259602f03821ff6049914d66ecb77692badc2
tests/mocks/streams/mock-hot-collections.js
tests/mocks/streams/mock-hot-collections.js
define([ 'inherits', 'streamhub-hot-collections/streams/hot-collections', 'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client'], function (inherits, HotCollections, MockHotCollectionsClient) { var MockHotCollections = function (opts) { opts = opts || {}; opts.clie...
define([ 'inherits', 'streamhub-hot-collections/streams/hot-collections', 'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client', 'streamhub-sdk-tests/mocks/mock-stream'], function (inherits, HotCollections, MockHotCollectionsClient, MockStream) { var MockHotCollections = funct...
Add mockstream to mock hot collection
Add mockstream to mock hot collection
JavaScript
mit
gobengo/streamhub-hot-collections
1829b94752a3cf01773d7d360adb2c18e528fcc8
src/renderer/mixins/global/readMagnet.js
src/renderer/mixins/global/readMagnet.js
export default { mounted () { document.addEventListener('paste', this.handlePaste) }, beforeDestroy () { document.removeEventListener('paste', this.handlePaste) }, computed: { isClientPage () { return this.$route.path === '/torrenting' } }, methods: { handlePaste (e) { c...
export default { mounted () { document.addEventListener('paste', this.handlePaste) }, beforeDestroy () { document.removeEventListener('paste', this.handlePaste) }, computed: { isClientPage () { return this.$route.path === '/torrenting' } }, methods: { /** * @param {Clipbo...
Fix wrong handling of paste event that would result in streaming from a magnet if pasting into input for download for eg
Fix wrong handling of paste event that would result in streaming from a magnet if pasting into input for download for eg
JavaScript
mit
Kylart/KawAnime,Kylart/KawAnime,Kylart/KawAnime
e268600106b19b02a8bcfd72f3aa9c59396f8d3d
js/src/core.js
js/src/core.js
// Export a global module. window.tangelo = {}; (function (tangelo) { "use strict"; // Tangelo version number. tangelo.version = function () { var version = "0.9.0-dev"; return version; }; // A namespace for plugins. tangelo.plugin = {}; // Standard way to access a plugin...
// Export a global module. window.tangelo = {}; (function (tangelo) { "use strict"; // Tangelo version number. tangelo.version = function () { var version = "0.9.0-dev"; return version; }; // A namespace for plugins. tangelo.plugin = {}; // Create a plugin namespace if it...
Add tangelo.ensurePlugin() function, to replace tangelo.getPlugin() (which is deprecated)
Add tangelo.ensurePlugin() function, to replace tangelo.getPlugin() (which is deprecated)
JavaScript
apache-2.0
Kitware/tangelo,Kitware/tangelo,Kitware/tangelo
2f9e7e2af6539395656c7a1ae0b375f178b1c156
packages/vega-view/src/initialize-handler.js
packages/vega-view/src/initialize-handler.js
import {offset} from './render-size'; export default function(view, prevHandler, el, constructor) { var handler = new constructor(view.loader(), view.tooltip()) .scene(view.scenegraph().root) .initialize(el, offset(view), view); if (prevHandler) { prevHandler.handlers().forEach(function(h) { han...
import {offset} from './render-size'; export default function(view, prevHandler, el, constructor) { var handler = new constructor(view.loader(), tooltip(view)) .scene(view.scenegraph().root) .initialize(el, offset(view), view); if (prevHandler) { prevHandler.handlers().forEach(function(h) { hand...
Add error trap for tooltip handler.
Add error trap for tooltip handler.
JavaScript
bsd-3-clause
vega/vega,vega/vega,lgrammel/vega,vega/vega,vega/vega
346fa351b6c0c17c486dad3dbd85f974f48fb4aa
src/services/file.js
src/services/file.js
const { FileService } = require('./file/file.service') const { BadScriptPermission } = require('./file/bad-script-permission.error') const { ScriptNotExist } = require('./file/script-not-exist.error') module.exports = exports = { FileService, BadScriptPermission, ScriptNotExist }
const { FileService } = require('./file/file.service') const { BadScriptPermission } = require('./file/bad-script-permission.error') const { ScriptNotExist } = require('./file/script-not-exist.error') const { TargetFileAlreadyExist } = require('./file/target-file-already-exist.error') module.exports = exports = { Fi...
Declare TargetFileAlreadyExist in service index
Declare TargetFileAlreadyExist in service index
JavaScript
apache-2.0
Mindsers/configfile
030c68973913fcf45f259a2f0cdd334955d33dac
src/util/weak-map.js
src/util/weak-map.js
export default window.WeakMap || (function () { let index = 0; function Wm () { this.key = `____weak_map_${index++}`; } Wm.prototype = { delete (obj) { if (obj) { delete obj[this.key]; } }, get (obj) { return obj ? obj[this.key] : null; }, has (obj) { retu...
export default window.WeakMap || (function () { let index = 0; function Wm () { this.key = `____weak_map_${index++}`; } Wm.prototype = { delete (obj) { if (obj) { delete obj[this.key]; } }, get (obj) { return obj ? obj[this.key] : null; }, has (obj) { retu...
Make weak map props non-enumerable preventing circular references when traversing props.
Make weak map props non-enumerable preventing circular references when traversing props.
JavaScript
mit
skatejs/named-slots
40c5111ee6fe0b7c670dc28d66d475be2ff030fc
null-prune.js
null-prune.js
(function (name, definition) { // AMD if (typeof define === 'function') { define(definition); } // Node.js else if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); } // Browser else { window[name] = definition(); } })('null...
(function (name, definition) { if (typeof define === 'function') { // AMD define(definition); } else if (typeof module !== 'undefined' && module.exports) { // Node.js module.exports = definition(); } else { // Browser window[name] = definition(); } })('nullPrune', function () { functio...
Tidy up indentation of UMD loader
Tidy up indentation of UMD loader
JavaScript
apache-2.0
cskeppstedt/null-prune
940163051b33e111370fbb292666e4668c519a27
test/integration/test-bad-credentials.js
test/integration/test-bad-credentials.js
var common = require('../common'); var connection = common.createConnection({password: 'INVALID PASSWORD'}); var assert = require('assert'); var err; connection.connect(function(_err) { assert.equal(err, undefined); err = _err; }); process.on('exit', function() { assert.ok(/access denied/i.test(err.mess...
var common = require('../common'); var connection = common.createConnection({password: 'INVALID PASSWORD'}); var assert = require('assert'); var err; connection.connect(function(_err) { assert.equal(err, undefined); err = _err; }); process.on('exit', function() { assert.equal(err.code, 'ER_ACCESS_DENIED...
Make test error more useful
Make test error more useful
JavaScript
mit
saisai/node-mysql,wxkdesky/node-mysql,1602/node-mysql,bbito/node-mysql,l371559739/node-mysql,yanninho/node-mysql,linalu1/node-mysql,felixge/node-mysql,tempbottle/node-mysql,shipci/node-mysql,apathyjade/node-mysql,yulongge/node-mysql,XiaoLongW/node-mysql,grooverdan/node-mysql,zhhb/node-mysql,chinazhaghai/node-mysql,Jimb...
520f37fad8789c5e43e59918b84848b1dea3bf06
test/when-adapter.js
test/when-adapter.js
(function() { 'use strict'; if(typeof exports === 'object') { var when = require('../when'); exports.fulfilled = when.resolve; exports.rejected = when.reject; exports.pending = function () { var deferred = when.defer(); return { promise: deferred.promise, fulfill: deferred.resolve, reje...
(function() { 'use strict'; if(typeof exports === 'object') { var when = require('../when'); exports.fulfilled = when.resolve; exports.rejected = when.reject; exports.pending = function () { var pending = {}; pending.promise = when.promise(function(resolve, reject) { pending.fulfill = resolve; ...
Update aplus test adapter to use when.promise
Update aplus test adapter to use when.promise
JavaScript
mit
caporta/when,caporta/when,ning-github/when,SourcePointUSA/when,stevage/when,frank-weindel/when,tkirda/when,ning-github/when,mlennon3/when,stevage/when,anthonyvia/when,tkirda/when,petkaantonov/when,SourcePointUSA/when,frank-weindel/when,anthonyvia/when,mlennon3/when,DJDNS/when.js
5b15efa2a01ccdb6ed4c92128df362e585bbd868
string/startswith.js
string/startswith.js
module.exports = function (str, query, position) { return str.substr(position, query.length) === query; };
/** Does a string start with another string? @module string/startsWith @param {string} str The string to search through. @param {string} query The string to find in `str`. @param {number} [position=0] The index to start the search. Defaults to the beginning of the string. @returns {bool} Does the string start with ano...
Add JSDoc documentation to string/startsWith
Add JSDoc documentation to string/startsWith
JavaScript
mit
EvanHahn/lildash