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
9c3f28abade0f393e2aba5f5960756fb24832a74
lib/cucumber/support_code/world_constructor.js
lib/cucumber/support_code/world_constructor.js
var WorldConstructor = function() { return function(callback) { callback(this) }; }; module.exports = WorldConstructor;
var WorldConstructor = function() { return function World(callback) { callback() }; }; module.exports = WorldConstructor;
Simplify default World constructor callback
Simplify default World constructor callback
JavaScript
mit
AbraaoAlves/cucumber-js,Telogical/CucumberJS,marnen/cucumber-js,MinMat/cucumber-js,richardmcsong/cucumber-js,bluenergy/cucumber-js,AbraaoAlves/cucumber-js,h2non/cucumber-js,MinMat/cucumber-js,Telogical/CucumberJS,h2non/cucumber-js,vilmysj/cucumber-js,mhoyer/cucumber-js,marnen/cucumber-js,richardmcsong/cucumber-js,vilmy...
9ad051a99797c70c2f806409d342d25aa91431a9
concrete/js/captcha/recaptchav3.js
concrete/js/captcha/recaptchav3.js
function RecaptchaV3() { $(".recaptcha-v3").each(function () { var el = $(this); var clientId = grecaptcha.render($(el).attr("id"), { 'sitekey': $(el).attr('data-sitekey'), 'badge': $(el).attr('data-badge'), 'theme': $(el).attr('data-theme'), 'size': '...
/* jshint unused:vars, undef:true, browser:true, jquery:true */ /* global grecaptcha */ ;(function(global, $) { 'use strict'; function render(element) { var $element = $(element), clientId = grecaptcha.render( $element.attr('id'), { sitekey: $element.data('sitekey')...
Configure jshint, simplify javascript structure
Configure jshint, simplify javascript structure
JavaScript
mit
concrete5/concrete5,jaromirdalecky/concrete5,deek87/concrete5,olsgreen/concrete5,olsgreen/concrete5,jaromirdalecky/concrete5,haeflimi/concrete5,mlocati/concrete5,mlocati/concrete5,rikzuiderlicht/concrete5,mlocati/concrete5,deek87/concrete5,deek87/concrete5,MrKarlDilkington/concrete5,MrKarlDilkington/concrete5,hissy/con...
bd84d284e22e663535a1d64060dacbea4eb10b30
js/locations.js
js/locations.js
$(function () { var locationList = $("#location-list"); function populateLocations(features) { locationList.empty(); $.each(features, function(i, v) { $("<li/>").appendTo(locationList) .toggleClass("lead", i == 0) .html(v.properties.details); }); } if (locationList.length > 0) ...
$(function () { var locationList = $("#location-list"); function populateLocations(data) { locationList.empty(); $.each(data.features, function(i, v) { $("<li/>").appendTo(locationList) .toggleClass("lead", i == 0 && data.locationKnown) .html(v.properties.details); }); } if (lo...
Sort by name if location not available
Sort by name if location not available
JavaScript
apache-2.0
resbaz/resbaz-2016-02-01,BillMills/resbaz-site,BillMills/resbaz-site,resbaz/resbaz-2016-02-01
9a5b708be7e705acfb87ddaa2117c196621cf616
src/pages/dataTableUtilities/reducer/getReducer.js
src/pages/dataTableUtilities/reducer/getReducer.js
/** * mSupply Mobile * Sustainable Solutions (NZ) Ltd. 2019 */ /** * Method using a factory pattern variant to get a reducer * for a particular page or page style. * * For a new page - create a constant object with the * methods from reducerMethods which are composed to create * a reducer. Add to PAGE_REDUCER...
/** * mSupply Mobile * Sustainable Solutions (NZ) Ltd. 2019 */ /** * Method using a factory pattern variant to get a reducer * for a particular page or page style. * * For a new page - create a constant object with the * methods from reducerMethods which are composed to create * a reducer. Add to PAGE_REDUCER...
Add openBasicModal reducer method to customer invoice
Add openBasicModal reducer method to customer invoice
JavaScript
mit
sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile
73c4dd83b679457a2d1ff6334fb0bd563e0030d5
src/i18n.js
src/i18n.js
import React, { Component } from 'react'; import Polyglot from 'node-polyglot'; // Provider root component export default class I18n extends Component { constructor(props) { super(props); this._polyglot = new Polyglot({ locale: props.locale, phrases: props.messages, }); } getChildContex...
import React, { Component } from 'react'; import Polyglot from 'node-polyglot'; // Provider root component export default class I18n extends Component { constructor(props) { super(props); this._polyglot = new Polyglot({ locale: props.locale, phrases: props.messages, }); } getChildContex...
Fix update behavior removing shouldComponentUpdate
Fix update behavior removing shouldComponentUpdate The should component update was not such a good idea as the component did not update when props of other components changed
JavaScript
mit
nayaabkhan/react-polyglot,nayaabkhan/react-polyglot
80d5eb3fa1d3d4653e5d67f62b8a5d8ed6c7a3ca
js/game.js
js/game.js
// Game Controller // A checkers board has 64 squares like a chess board but it only uses 32 squares all the same color // Each player has 12 pieces and pieces that make until the last squares on the enemy side is promoted // Promoted piece also moves on diagonals with no limit of squares if it is free // The moves are...
// Game Controller // A checkers board has 64 squares like a chess board but it only uses 32 squares all the same color // Each player has 12 pieces and pieces that make until the last squares on the enemy side is promoted // Promoted piece also moves on diagonals with no limit of squares if it is free // The moves are...
Create prototype to flatten board
Create prototype to flatten board
JavaScript
mit
RenanBa/checkers-v1,RenanBa/checkers-v1
4d909497a1c18d05b46cb6b4115dbd6ad5b0656a
src/components/Specimen/Span.js
src/components/Specimen/Span.js
import React, {Component, PropTypes} from 'react'; export default class Span extends Component { render() { const {children, span} = this.props; const style = { boxSizing: 'border-box', display: 'flex', flexBasis: span && window.innerWidth > 640 ? `calc(${span / 6 * 100}% - 10px)` ...
import React, {Component, PropTypes} from 'react'; export default class Span extends Component { render() { const {children, span} = this.props; const style = { boxSizing: 'border-box', display: 'flex', flexBasis: span && window.innerWidth > 640 ? `calc(${span / 6 * 100}% - 10px)` ...
Fix max width of overflowing specimens on Firefox
Fix max width of overflowing specimens on Firefox
JavaScript
bsd-3-clause
interactivethings/catalog,interactivethings/catalog,interactivethings/catalog,interactivethings/catalog
dd5b51fe036ffa661c847e70d03eb02d6926e21a
src/main.js
src/main.js
import Firebase from 'firebase' import Vue from 'vue' import VueRouter from 'vue-router' import App from './App.vue' Vue.use(VueRouter) let router = new VueRouter({ hashboang: false, history: true, }) let MEGAKanban = Vue.extend({}) let Redirect = Vue.extend({ ready() { let boardName = localStorage.getI...
import Firebase from 'firebase' import Vue from 'vue' import VueRouter from 'vue-router' import nonsense from './nonsense' import App from './App.vue' window.randomSet = nonsense.randomSet window.randomNumber = nonsense.randomNumber Vue.use(VueRouter) let router = new VueRouter({ hashboang: false, history: true...
Use nonsense board name, no localStorage
Use nonsense board name, no localStorage
JavaScript
mit
lunardog/MEGAKanban,lunardog/MEGAKanban
e580b1c8dc4e2a09feaa5b6be00a3e8d1ea31e01
src/mailgun-transport.js
src/mailgun-transport.js
'use strict'; var Mailgun = require('mailgun-js'); var packageData = require('../package.json'); module.exports = function(options) { return new MailgunTransport(options); }; function MailgunTransport(options) { this.options = options || {}; this.name = 'Mailgun'; this.version = packageData.version; } Mailg...
'use strict'; var Mailgun = require('mailgun-js'); var packageData = require('../package.json'); module.exports = function(options) { return new MailgunTransport(options); }; function MailgunTransport(options) { this.options = options || {}; this.name = 'Mailgun'; this.version = packageData.version; } Mailg...
Add in support for passing through the html param
Add in support for passing through the html param
JavaScript
mit
orliesaurus/nodemailer-mailgun-transport,wmcmurray/nodemailer-mailgun-transport,rasteiner/nodemailer-mailgun-transport
e28021852e496cbe943f5b2b3bee1fb6353a629d
src/js/factories/chat.js
src/js/factories/chat.js
(function() { 'use strict'; // This is my local Docker IRC server var defaultHost = '192.168.99.100:6667'; angular.module('app.factories.chat', []). factory('chat', Chat); Chat.$inject = ['$websocket', '$rootScope']; function Chat($websocket, $rootScope) { var ws = $websocket(...
(function() { 'use strict'; // This is my local Docker IRC server var defaultHost = '192.168.99.100:6667'; angular.module('app.factories.chat', []). factory('chat', Chat); Chat.$inject = ['$websocket', '$rootScope']; function Chat($websocket, $rootScope) { var ws = $websocket(...
Add _send function for hacky-ness
Add _send function for hacky-ness
JavaScript
mit
BigRoom/mystique,BigRoom/mystique
1e94858c1498a5cc429aeccdfdd8b2d92615decd
lib/toHTML.js
lib/toHTML.js
'use strict'; /*eslint no-underscore-dangle: 0*/ var ElementFactory = require('./ElementFactory.js'); var elem = new ElementFactory({}); var stream = require('stream'); var ToHTML = function(options) { this.options = options; this.elem = new ElementFactory(options); stream.Transform.call(this, { objectMode: ...
'use strict'; /*eslint no-underscore-dangle: 0*/ var ElementFactory = require('./ElementFactory.js'); var elem = new ElementFactory({}); var stream = require('stream'); var ToHTML = function(options) { this.options = options; this.elem = new ElementFactory(options); stream.Transform.call(this, { objectMode: ...
Allow strings to pass through the stream
Allow strings to pass through the stream
JavaScript
isc
ironikart/html-tokeniser,ironikart/html-tokeniser
65c2c4b7ee3833e8ea30deb701cfcbb337562d7e
lib/settings.js
lib/settings.js
var Settings = { setUrls: function(urls) { localStorage.setItem('urls', JSON.stringify(urls)); }, getUrls: function() { var urls = localStorage.getItem('urls') || ''; return JSON.parse(urls); } };
var Settings = { setUrls: function(urls) { localStorage.setItem('urls', JSON.stringify(urls)); }, getUrls: function() { var urls = localStorage.getItem('urls'); return urls ? JSON.parse(urls) : ''; } };
Fix bug when no urls have been set up yet
Fix bug when no urls have been set up yet
JavaScript
mit
craigerm/unstyled,craigerm/unstyled
973d38c62da08d6f19b49f1cbd097694080331aa
app/anol/modules/mouseposition/mouseposition-directive.js
app/anol/modules/mouseposition/mouseposition-directive.js
angular.module('anol.mouseposition', []) .directive('anolMousePosition', ['MapService', function(MapService) { return { restrict: 'A', require: '?^anolMap', scope: {}, link: { pre: function(scope, element, attrs, AnolMapController) { scope.map = MapServic...
angular.module('anol.mouseposition', []) .directive('anolMousePosition', ['MapService', function(MapService) { return { restrict: 'A', require: '?^anolMap', scope: {}, link: { pre: function(scope, element, attrs) { scope.map = MapService.getMap(); ...
Add coordinateFormat function to controlOptions if present
Add coordinateFormat function to controlOptions if present
JavaScript
mit
omniscale/orka-app,omniscale/orka-app,hgarnelo/orka-app,hgarnelo/orka-app
0cca0f1f63b05f4a61696e97a14b95add3538129
src/addable.js
src/addable.js
udefine(function() { return function(Factory, groupInstance) { return function() { var child = arguments[0]; var args = 2 <= arguments.length ? [].slice.call(arguments, 1) : []; if (!( child instanceof Factory)) { if ( typeof child === 'string') { if (Object.hasOwnProperty.ca...
udefine(function() { return function(Factory, groupInstance) { return function() { var child = arguments[0]; var args = 2 <= arguments.length ? [].slice.call(arguments, 1) : []; if (!( child instanceof Factory)) { if ( typeof child === 'string') { if (Object.hasOwnProperty.ca...
Call descriptor when a child is added
Call descriptor when a child is added
JavaScript
mit
freezedev/flockn,freezedev/flockn
98cd42daefdafef5d0125ca33b8fca73905cb621
app/core/directives/ext-href.js
app/core/directives/ext-href.js
/* global angular */ angular.module('app') .directive('extHref', function (platformInfo) { 'use strict'; return { restrict: 'A', link: link }; function link(scope, element, attributes) { const url = attributes.extHref; if (platformInfo.isCordova) { element[0].onclick = onclick; } else { element[0...
/* global angular, require */ angular.module('app') .directive('extHref', function (platformInfo) { 'use strict'; return { restrict: 'A', link: link }; function link(scope, element, attributes) { const url = attributes.extHref; element[0].onclick = () => { if (platformInfo.isCordova) { window.ope...
Clean up, and use electron functions to open urls
Clean up, and use electron functions to open urls
JavaScript
agpl-3.0
johansten/stargazer,johansten/stargazer,johansten/stargazer
3a111bbc81c4a424b002b0ec00f473c4451097f0
app/controllers/settings/theme/uploadtheme.js
app/controllers/settings/theme/uploadtheme.js
import Controller from '@ember/controller'; import {inject as service} from '@ember/service'; export default class UploadThemeController extends Controller { @service config; get isAllowed() { return !this.config.get('hostSettings')?.limits?.customThemes; } }
import Controller from '@ember/controller'; import {inject as service} from '@ember/service'; export default class UploadThemeController extends Controller { @service config; get isAllowed() { return (!this.config.get('hostSettings')?.limits?.customThemes) || this.config.get('hostSettings').limits.cus...
Fix UploadThemeController to support disable:true customThemes flag
Fix UploadThemeController to support disable:true customThemes flag no issue
JavaScript
mit
TryGhost/Ghost-Admin,TryGhost/Ghost-Admin
e5f1a0e1bd72d7f48a263532d18a4564bdf6d4b9
client/templates/register/registrant/registrant.js
client/templates/register/registrant/registrant.js
Template.registrantDetails.helpers({ 'registrationTypeOptions': function () { // registration types used on the registration form return [ {label: "Commuter", value: "commuter"}, {label: "Daily", value: "daily"}, {label: "Full Week", value: "weekly"} ]; ...
Template.registrantDetails.helpers({ 'registrationTypeOptions': function () { // registration types used on the registration form return [ {label: "Commuter", value: "commuter"}, {label: "Daily", value: "daily"}, {label: "Full Week", value: "weekly"} ]; ...
Add school age group template helper.
Add school age group template helper.
JavaScript
agpl-3.0
quaker-io/pym-online-registration,quaker-io/pym-online-registration,quaker-io/pym-2015,quaker-io/pym-2015
63d2a9cd58d424f13a38e8a078f37f64565a2771
components/dashboards-web-component/jest.config.js
components/dashboards-web-component/jest.config.js
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/...
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/...
Set test regex to select only *.test.js/jsx files in the test directory.
Set test regex to select only *.test.js/jsx files in the test directory. And add the root directory as a module directory so that file imports will be absolute.
JavaScript
apache-2.0
wso2/carbon-dashboards,ksdperera/carbon-dashboards,lasanthaS/carbon-dashboards,wso2/carbon-dashboards,ksdperera/carbon-dashboards,ksdperera/carbon-dashboards,lasanthaS/carbon-dashboards,lasanthaS/carbon-dashboards
1f7a5c9aa26d4752336fb5cd9e651f52c0d72253
module/javascript/module.js
module/javascript/module.js
forge['contact'] = { 'select': function (success, error) { forge.internal.call("contact.select", {}, success, error); }, 'selectById': function (id, success, error) { forge.internal.call("contact.selectById", {id: id}, success, error); }, 'selectAll': function (fields, success, error) { if (typeof fields ===...
/* global forge */ forge['contact'] = { 'select': function (success, error) { forge.internal.call("contact.select", {}, success, error); }, 'selectById': function (id, success, error) { forge.internal.call("contact.selectById", {id: id}, success, error); }, 'selectAll': function (fi...
Test failure on iOS13 when adding contacts with null property fields.
Fixed: Test failure on iOS13 when adding contacts with null property fields.
JavaScript
bsd-2-clause
trigger-corp/trigger.io-contact,trigger-corp/trigger.io-contact
fba75405f7c3e2f206a62e890a5a74e8ceaa153c
app/src/presenters/Flashcard.js
app/src/presenters/Flashcard.js
// import node packages import React from 'react'; function Flashcard(props) { return ( <li> Question: <span>{this.props.question}</span><br /> Answer: <span>{this.props.answer}</span> </li> ); } export default Flashcard;
// import node packages import React from 'react'; function Flashcard(props) { return ( <li> Question: <span>{props.question}</span><br /> Answer: <span>{props.answer}</span> </li> ); } export default Flashcard;
Fix props usage for function vs class
Fix props usage for function vs class
JavaScript
mit
subnotes/gemini,subnotes/gemini,subnotes/gemini
91a94b95e13b0a4187c0b86a95a770e64cbc3000
js/config.js
js/config.js
'use strict'; (function(exports) { exports.API_URL = '/'; }(window));
'use strict'; (function(exports) { exports.API_URL = 'http://api.sensorweb.io/'; }(window));
Switch to use real APIs on SensorWeb platform
Switch to use real APIs on SensorWeb platform
JavaScript
mit
sensor-web/sensorweb-frontend,sensor-web/sensorweb-frontend,evanxd/sensorweb-frontend,evanxd/sensorweb-frontend
931155cd03d8ce9581240f3a68fd39a52160f0f9
lib/networking/rest/channels/deleteMessages.js
lib/networking/rest/channels/deleteMessages.js
"use strict"; const Constants = require("../../../Constants"); const Events = Constants.Events; const Endpoints = Constants.Endpoints; const apiRequest = require("../../../core/ApiRequest"); module.exports = function(channelId, messages) { console.log("deletes", messages) return new Promise((rs, rj) => { apiR...
"use strict"; const Constants = require("../../../Constants"); const Events = Constants.Events; const Endpoints = Constants.Endpoints; const apiRequest = require("../../../core/ApiRequest"); module.exports = function(channelId, messages) { return new Promise((rs, rj) => { apiRequest .post(this, { url:...
Remove log message on bulk delete
Remove log message on bulk delete
JavaScript
bsd-2-clause
qeled/discordie
3971842dc0f01025ba280ff7c3900ea35f36ee6e
test/api.js
test/api.js
var chai = require('chai'); var expect = chai.expect; /* fake api server */ var server = require('./server'); var api = server.createServer(); var clubs = [ { id: '205', name: 'SURTEX', logo: 'http://121.199.38.39/hphoto/logoclub/NewClub.jpgw76_h76.jpg' } ]; var responses = { 'clubs/': server.crea...
var chai = require('chai'); var expect = chai.expect; /* fake api server */ var server = require('./server'); var api = server.createServer(); var clubs = [ { id: '205', name: 'SURTEX', logo: 'http://121.199.38.39/hphoto/logoclub/NewClub.jpgw76_h76.jpg' } ]; var responses = { 'clubs/': server.crea...
Fix test error (still failing)
Fix test error (still failing)
JavaScript
bsd-3-clause
rogerz/wechat-letsface-api
b91805c6d29d1afcd532666a9230c05ef2903bd1
internals/testing/test-bundler.js
internals/testing/test-bundler.js
import 'babel-polyfill'; import sinon from 'sinon'; import chai from 'chai'; import chaiEnzyme from 'chai-enzyme'; import factory from 'fixture-factory'; chai.use(chaiEnzyme()); global.chai = chai; global.sinon = sinon; global.expect = chai.expect; global.should = chai.should(); /** * Register the story as factory...
import 'babel-polyfill'; import sinon from 'sinon'; import chai from 'chai'; import chaiEnzyme from 'chai-enzyme'; import factory from 'fixture-factory'; chai.use(chaiEnzyme()); global.chai = chai; global.sinon = sinon; global.expect = chai.expect; global.should = chai.should(); /** * Register the story as factory...
Add excerpt to the story factor & add category factory
Add excerpt to the story factor & add category factory
JavaScript
mit
reauv/persgroep-app,reauv/persgroep-app
3ce1e166c2b114a3f87111e8e1b68e8c238990fe
src/utils/quote-style.js
src/utils/quote-style.js
/** * As Recast is not preserving original quoting, we try to detect it. * See https://github.com/benjamn/recast/issues/171 * and https://github.com/facebook/jscodeshift/issues/143 * @return 'double', 'single' or null */ export default function detectQuoteStyle(j, ast) { let detectedQuoting = null; ast ...
/** * As Recast is not preserving original quoting, we try to detect it. * See https://github.com/benjamn/recast/issues/171 * and https://github.com/facebook/jscodeshift/issues/143 * @return 'double', 'single' or null */ export default function detectQuoteStyle(j, ast) { let doubles = 0; let singles = 0; ...
Improve detectQuoteStyle (needed when adding imports and requires)
Improve detectQuoteStyle (needed when adding imports and requires)
JavaScript
mit
skovhus/jest-codemods,skovhus/jest-codemods,skovhus/jest-codemods
39be85fb0ff6be401a17c92f2d54befbe612115a
plugins/treeview/web_client/routes.js
plugins/treeview/web_client/routes.js
import router from 'girder/router'; import events from 'girder/events'; import { exposePluginConfig } from 'girder/utilities/PluginUtils'; exposePluginConfig('treeview', 'plugins/treeview/config'); import ConfigView from './views/ConfigView'; router.route('plugins/treeview/config', 'treeviewConfig', function () { ...
/* eslint-disable import/first */ import router from 'girder/router'; import events from 'girder/events'; import { exposePluginConfig } from 'girder/utilities/PluginUtils'; exposePluginConfig('treeview', 'plugins/treeview/config'); import ConfigView from './views/ConfigView'; router.route('plugins/treeview/config', '...
Fix style for compatibility with eslint rule changes
Fix style for compatibility with eslint rule changes
JavaScript
apache-2.0
Xarthisius/girder,kotfic/girder,RafaelPalomar/girder,jbeezley/girder,Xarthisius/girder,Kitware/girder,data-exp-lab/girder,Xarthisius/girder,RafaelPalomar/girder,manthey/girder,data-exp-lab/girder,kotfic/girder,kotfic/girder,data-exp-lab/girder,data-exp-lab/girder,girder/girder,Kitware/girder,manthey/girder,girder/girde...
01e2eab387d84a969b87c45f795a5df1335f3f30
src/ui/DynamicPreview.js
src/ui/DynamicPreview.js
import React, { PropTypes } from 'react' import styled from 'styled-components' import AceEditor from 'react-ace' const PreviewContainer = styled.div` align-self: center; padding: 28px; width: 100%; height: 400px; background-color: white; border: 1px solid rgba(0, 0, 0, 0.35); box-shadow: 0 2px 16px 2px ...
import React, { PropTypes } from 'react' import styled from 'styled-components' import AceEditor from 'react-ace' const PreviewContainer = styled.div` align-self: center; padding: 28px; width: 100%; height: 400px; background-color: white; border: 1px solid rgba(0, 0, 0, 0.35); box-shadow: 0 2px 16px 2px ...
Remove gutter to match the output
Remove gutter to match the output
JavaScript
mpl-2.0
okonet/codestage,okonet/codestage
7b9157180348613bd529e3ef21137d98f6c82c7f
lib/streams.js
lib/streams.js
/** * Created by austin on 9/24/14. */ var streams = function (client) { this.client = client; }; var _qsAllowedProps = [ 'resolution' , 'series_type' ]; //===== streams endpoint ===== streams.prototype.activity = function(args,done) { var endpoint = 'activities'; this._typeHelper(en...
/** * Created by austin on 9/24/14. */ var streams = function (client) { this.client = client; }; var _qsAllowedProps = [ 'resolution' , 'series_type' ]; //===== streams endpoint ===== streams.prototype.activity = function(args,done) { var endpoint = 'activities'; return this._typeHe...
Return value for client.stream.* calls
Return value for client.stream.* calls These endpoints didn’t return anything, making them unusable with the promises version of the API.
JavaScript
mit
UnbounDev/node-strava-v3
0469f03e2f8cd10e2fc0e158c48b2f11b2e30e24
src/loading.js
src/loading.js
'use strict'; var EventEmitter = require('events'), util = require('util'); /** * The emitter returned by methods that load data from an external source. * @constructor * @fires Loading#error * @fires Loading#loaded */ function Loading(config) { EventEmitter.call(this); } util.inherits(Loading, EventEmi...
'use strict'; var EventEmitter = require('events'), util = require('util'); /** * The emitter returned by methods that load data from an external source. * @constructor * @fires Loading#error * @fires Loading#loaded */ function Loading(config) { EventEmitter.call(this); } util.inherits(Loading, EventEmi...
Return Loading from Loading methods.
Return Loading from Loading methods.
JavaScript
mit
mattunderscorechampion/uk-petitions,mattunderscorechampion/uk-petitions
303d211596c8ed7f48297198477d2f6054854f88
test/spec/spec-helper.js
test/spec/spec-helper.js
"use strict"; // Angular is refusing to recognize the HawtioNav stuff // when testing even though its being loaded beforeEach(module(function ($provide) { $provide.provider("HawtioNavBuilder", function() { function Mocked() {} this.create = function() {return this;}; this.id = function() {return this;}; ...
"use strict"; beforeEach(module(function ($provide) { $provide.factory("HawtioExtension", function() { return { add: function() {} }; }); })); // Make sure a base location exists in the generated test html if (!$('head base').length) { $('head').append($('<base href="/">')); } angular.module...
Remove HawtioNav* mocks (no longer used)
Remove HawtioNav* mocks (no longer used) We're using Patternfly nav now.
JavaScript
apache-2.0
openshift/origin-web-console,openshift/origin-web-console,openshift/origin-web-console,openshift/origin-web-console
0edcb9fd044cc56799184b8d6740e1b5894d75bf
src/methods/avatars/get.js
src/methods/avatars/get.js
import connection from '../../config/database'; module.exports.register = (server, options, next) => { async function getAvatar(userid, next) { try { const employee = await connection .table('avatars') .filter({ userid: userid.toUpperCase() }) .nth(0) .run(); next(nul...
import connection from '../../config/database'; module.exports.register = (server, options, next) => { async function getAvatar(userid, next) { try { const employee = await connection .table('avatars') .filter({ userid: userid.toUpperCase() }) .orderBy(connection.desc('taken')) ...
Add sort by "taken" date to avatar query, so the most recent image is returned for the person.
Add sort by "taken" date to avatar query, so the most recent image is returned for the person.
JavaScript
mit
ocean/higgins,ocean/higgins
9c225d0f19b19657b86a153f93562881048510b4
lib/xpi.js
lib/xpi.js
var join = require("path").join; var console = require("./utils").console; var fs = require("fs-promise"); var zip = require("./zip"); var all = require("when").all; var tmp = require('./tmp'); var bootstrapSrc = join(__dirname, "../data/bootstrap.js"); /** * Takes a manifest object (from package.json) and build opti...
var join = require("path").join; var console = require("./utils").console; var fs = require("fs-promise"); var zip = require("./zip"); var all = require("when").all; var tmp = require('./tmp'); var bootstrapSrc = join(__dirname, "../data/bootstrap.js"); /** * Takes a manifest object (from package.json) and build opti...
Remove extra createBuildOptions for now
Remove extra createBuildOptions for now
JavaScript
mpl-2.0
Medeah/jpm,rpl/jpm,guyzmuch/jpm,wagnerand/jpm,guyzmuch/jpm,Medeah/jpm,matraska23/jpm,nikolas/jpm,freaktechnik/jpm,matraska23/jpm,alexduch/jpm,mozilla-jetpack/jpm,jsantell/jpm,Gozala/jpm,freaktechnik/jpm,rpl/jpm,nikolas/jpm,mozilla-jetpack/jpm,kkapsner/jpm,mozilla/jpm,mozilla-jetpack/jpm,jsantell/jpm,johannhof/jpm,alexd...
e9e5f9f971c2acec8046002308857512836cdb07
library.js
library.js
(function () { "use strict"; var Frame = function (elem) { if (typeof elem === 'string') { elem = document.getElementById(elem); } var height = elem.scrollHeight; var width = elem.scrollWidth; var viewAngle = 45; var aspect = width / (1.0 * height);...
(function () { "use strict"; var Frame = function (elem) { if (typeof elem === 'string') { elem = document.getElementById(elem); } var height = elem.scrollHeight; var width = elem.scrollWidth; var viewAngle = 45; var aspect = width / (1.0 * height);...
Add a shortcut method on node to add to frame
Add a shortcut method on node to add to frame
JavaScript
mpl-2.0
frewsxcv/graphosaurus
1693507cc26a2e273981edbd85c18d34019a170f
lib/cli.js
lib/cli.js
#! /usr/bin/env node var program = require('commander'), fs = require('fs'), path = require('path'), polish = require('./polish'); program .version('1.0.0') .option('-s, --stylesheet <path>', 'Path to a stylesheet (in CSS, SCSS, Sass, or Less).') .option('-P, --plugins-directory <pat...
#! /usr/bin/env node var program = require('commander'), fs = require('fs'), path = require('path'), polish = require('./polish'); program .version('1.0.0') .option('-s, --stylesheet <path>', 'Path to a stylesheet (in CSS, SCSS, Sass, or Less).') .option('-P, --plugins-directory <pat...
Print results when using the CLI. Can be turned off with `-q` or `--quiet`.
Print results when using the CLI. Can be turned off with `-q` or `--quiet`.
JavaScript
mit
brendanlacroix/polish-css
3b9971fa4a272c3aaac06cc1541c5ff5b9b9c409
lib/jwt.js
lib/jwt.js
const fs = require('fs'); const process = require('process'); const jwt = require('jsonwebtoken'); // sign with RSA SHA256 // FIXME: move to env var const cert = fs.readFileSync('private-key.pem'); // get private key module.exports = generate; function generate() { const payload = { // issued at time iat:...
const fs = require('fs'); const process = require('process'); const jwt = require('jsonwebtoken'); const cert = process.env.PRIVATE_KEY || fs.readFileSync('private-key.pem'); module.exports = generate; function generate() { const payload = { // issued at time iat: Math.floor(new Date() / 1000), // JWT ...
Load private key from env if possible
Load private key from env if possible
JavaScript
isc
bkeepers/PRobot,probot/probot,pholleran-org/probot,pholleran-org/probot,pholleran-org/probot,probot/probot,probot/probot,bkeepers/PRobot
50ff490252eaa57c7858758cd8dbdc67a5dfe09c
app/js/root.js
app/js/root.js
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { Router, Route, Redirect } from 'react-router'; import { syncReduxAndRouter } from 'redux-simple-router'; import createBrowserHistory from 'history/lib/createBrowserHistory'; import createStore from './store'; i...
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { Router, Route, Redirect } from 'react-router'; import { syncReduxAndRouter } from 'redux-simple-router'; import createHashHistory from 'history/lib/createHashHistory'; import createStore from './store'; import ...
Switch to hash-based history, fix redirect to /build on boot
Switch to hash-based history, fix redirect to /build on boot
JavaScript
mit
maxmechanic/resumaker,maxmechanic/resumaker
5d4acafb8b9ec0814c147a10c1a2bafc653a4afa
static/chat.js
static/chat.js
$(function() { // When we're using HTTPS, use WSS too. var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws"; var chatsock = new ReconnectingWebSocket(ws_scheme + '://' + window.location.host + "/chat" + window.location.pathname); chatsock.onmessage = function(message) { var d...
$(function() { // When we're using HTTPS, use WSS too. var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws"; var chatsock = new ReconnectingWebSocket(ws_scheme + '://' + window.location.host + "/chat" + window.location.pathname); chatsock.onmessage = function(message) { var d...
Fix XSS issue in demo
Fix XSS issue in demo
JavaScript
bsd-3-clause
TranDinhKhang/funkychat,jacobian/channels-example,jacobian/channels-example,ZipoZ/chatapp,cloud-fire/signalnews,cloud-fire/signalnews,cloud-fire/signalnews,ZipoZ/chatapp,davidkjtoh/GlorgoChat,TranDinhKhang/funkychat,TranDinhKhang/funkychat,jacobian/channels-example,ZipoZ/chatapp,davidkjtoh/GlorgoChat,davidkjtoh/GlorgoC...
72c2a692ac1a6c123328413bb35ddb7dd648691e
client/views/rooms/room_view.js
client/views/rooms/room_view.js
Template.roomView.helpers({ room: function () { return Rooms.findOne({_id: Session.get('currentRoom')}); }, roomUsers: function () { var room = Rooms.findOne({_id: Session.get('currentRoom')}); return Meteor.users.find({_id: {$in: room.users}}); }, currentRooms: function () {...
Template.roomView.helpers({ room: function () { return Rooms.findOne({_id: Session.get('currentRoom')}); }, roomUsers: function () { var room = Rooms.findOne({_id: Session.get('currentRoom')}); if(room) { return Meteor.users.find({_id: {$in: room.users}}); } ...
Handle room users case when not in room
Handle room users case when not in room
JavaScript
mit
mattfeldman/nullchat,mattfeldman/nullchat,coreyaus/nullchat,praneybehl/nullchat,katopz/nullchat,katopz/nullchat,coreyaus/nullchat,praneybehl/nullchat
a9d315cb1305ba4d5941767a03c452edfb3ed2ea
app.js
app.js
var express = require('express'); var http = require('http'); var socketIO = require('socket.io'); var path = require('path'); var game = require('./game.js'); var app = express(); var server = http.Server(app); var io = socketIO(server); app.set('views', path.join(__dirname, 'templates')); app.set('view engine', 'ja...
var express = require('express'); var http = require('http'); var socketIO = require('socket.io'); var path = require('path'); var game = require('./game.js'); var app = express(); var server = http.Server(app); var io = socketIO(server); app.set('views', path.join(__dirname, 'templates')); app.set('view engine', 'ja...
Handle incoming card click event with simple logger
Handle incoming card click event with simple logger
JavaScript
mit
vakila/net-set,vakila/net-set
f10a56b256cf34a8932c93b62af12d0e70babd19
lib/cli.js
lib/cli.js
"use strict"; const generate = require("./generate"); const log = require("./log"); const init = require("./init"); const program = require("commander"); module.exports = function() { program.version("0.0.1"); program.command("generate") .description("Generate site.") .option("-v, --verbose",...
"use strict"; const generate = require("./generate"); const log = require("./log"); const init = require("./init"); const program = require("commander"); const version = require("../package.json").version; module.exports = function() { program.version(version); program.command("generate") .descriptio...
Make lerret -V return the actual version number.
Make lerret -V return the actual version number.
JavaScript
apache-2.0
jgrh/lerret
bbddd52a58e0762324f281c22f9f4c876285b21b
app.js
app.js
var express = require('express'); var http = require('http'); var path = require('path'); var app = express(); var server = require('http').createServer(app); var io = require('socket.io').listen(server); var spotify = r...
var express = require('express'); var http = require('http'); var path = require('path'); var app = express(); var server = require('http').createServer(app); var io = require('socket.io').listen(server); var spotify = r...
Remove dev logging, don't need it. Console.log like in the old days!
Remove dev logging, don't need it. Console.log like in the old days!
JavaScript
mit
david-crowell/spotify-remote,rmehner/spotify-remote
fe9e1a025037fabbc2f4db1473537e42bfb5ecd9
app.js
app.js
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World from iojs ' + process.version + '!\n'); }).listen(process.env.port);
const http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end(`Hello World from iojs ${process.version}!\n`); }).listen(process.env.port);
Use const and string template
Use const and string template
JavaScript
mit
felixrieseberg/iojs-azure,felixrieseberg/iojs-azure,thewazir/iojs-azure
865a1835651ee0c9223013b7b56ce07d4c9d25ae
module/index.js
module/index.js
const ifElse = require('1-liners/ifElse'); const isFunction = require('1-liners/isFunction'); const filter = require('1-liners/filter'); const compose = require('1-liners/compose'); const castBool = (val) => val === true; const throwError = (msg) => () => { throw new Error(msg); }; const filterCurried = (filterFn) =>...
const ifElse = require('1-liners/ifElse'); const isFunction = require('1-liners/isFunction'); const filter = require('1-liners/filter'); const throwError = (msg) => () => { throw new Error(msg); }; const filterCurried = (filterFn) => ifElse( Array.isArray, (arr) => filter(filterFn, arr), throwError('Filter expe...
Update logic to fixed test
Update logic to fixed test
JavaScript
mit
studio-b12/doxie.filter
c0bc950791feae6b5b81b5e08f5fb125ec0616bb
src/vs/editor/buildfile.js
src/vs/editor/buildfile.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
Exclude `simpleWorker` from `editorSimpleWorker` in bundling
Exclude `simpleWorker` from `editorSimpleWorker` in bundling
JavaScript
mit
williamcspace/vscode,0xmohit/vscode,hoovercj/vscode,0xmohit/vscode,DustinCampbell/vscode,KattMingMing/vscode,stringham/vscode,radshit/vscode,stringham/vscode,edumunoz/vscode,Zalastax/vscode,mjbvz/vscode,cleidigh/vscode,Zalastax/vscode,bsmr-x-script/vscode,edumunoz/vscode,SofianHn/vscode,microlv/vscode,hashhar/vscode,si...
e227cf88360aab1c5a617df46aada1cd34a4aba0
client/modules/core/components/.stories/poll_buttons.js
client/modules/core/components/.stories/poll_buttons.js
import React from 'react'; import { storiesOf, action } from '@kadira/storybook'; import { withKnobs, text, boolean, number, object } from '@kadira/storybook-addon-knobs'; import { setComposerStub } from 'react-komposer'; import PollButtons from '../poll_buttons.jsx'; import palette from '../../libs/palette'; storiesO...
import React from 'react'; import { storiesOf, action } from '@kadira/storybook'; import { withKnobs, text, boolean, number, object } from '@kadira/storybook-addon-knobs'; import { setComposerStub } from 'react-komposer'; import PollButtons from '../poll_buttons.jsx'; import palette from '../../libs/palette'; storiesO...
Add isLoggedIn knob to story for pollButtons
Add isLoggedIn knob to story for pollButtons
JavaScript
mit
thancock20/voting-app,thancock20/voting-app
d927838b6cfaa68c198a27eb23bc2447db9db819
client/.storybook/main.js
client/.storybook/main.js
module.exports = { "stories": [ "../src/**/*.stories.@(js|jsx|ts|tsx)" ], "addons": [ "@storybook/addon-links", "@storybook/addon-essentials" ], "core": { "builder": "webpack5" } }
module.exports = { "stories": [ "../src/**/*.stories.@(js|jsx|ts|tsx)" ], "addons": [ "@storybook/addon-links", "@storybook/addon-essentials" ], "core": { "builder": "webpack5" }, "webpackFinal": (config) => { config.resolve.fallback.crypto = false; return config; }, }
Add crypto to storybook fallbacks
Add crypto to storybook fallbacks
JavaScript
bsd-3-clause
gasman/wagtail,jnns/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,jnns/wagtail,wagtail/wagtail,torchbox/wagtail,mixxorz/wagtail,gasman/wagtail,rsalmaso/wagtail,wagtail/wagtail,wagtail/wagtail,thenewguy/wagtail,gasman/wagtail,thenewguy/wagtail,zerolab/wagtail,mixxorz/wagtail,zerolab/wagtail,thenewguy/wagtail,thenewguy/wagta...
d937ed31d5e106b0216a6007a095a92356474b3d
lib/cartodb/models/aggregation/aggregation-proxy.js
lib/cartodb/models/aggregation/aggregation-proxy.js
const RasterAggregation = require('./raster-aggregation'); const VectorAggregation = require('./vector-aggregation'); const RASTER_AGGREGATION = 'RasterAggregation'; const VECTOR_AGGREGATION = 'VectorAggregation'; module.exports = class AggregationProxy { constructor (mapconfig, resolution = 256, threshold = 10e5,...
const RasterAggregation = require('./raster-aggregation'); const VectorAggregation = require('./vector-aggregation'); const RASTER_AGGREGATION = 'RasterAggregation'; const VECTOR_AGGREGATION = 'VectorAggregation'; module.exports = class AggregationProxy { constructor (mapconfig, { resolution = 256, threshold = 10e...
Add params to instantiate aggregation
Add params to instantiate aggregation
JavaScript
bsd-3-clause
CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb,CartoDB/Windshaft-cartodb
163482c08cb10b39decc90759a9c75a3d20677ea
test/common.js
test/common.js
/*global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, setImmediate:true, weknowhow*/ /* eslint no-unused-vars: "off" */ unexpected = typeof weknowhow === 'undefined' ? require('../lib/').clone() : weknowhow.expect.clone(); unexpected.output.preferredWidth = 80; unexpected.addAssertion('<an...
/*global unexpected:true, expect:true, expectWithUnexpectedMagicPen:true, setImmediate:true, weknowhow, jasmine*/ /* eslint no-unused-vars: "off" */ unexpected = typeof weknowhow === 'undefined' ? require('../lib/').clone() : weknowhow.expect.clone(); unexpected.output.preferredWidth = 80; unexpected.addAsser...
Set the Jest timeout to one minute
Set the Jest timeout to one minute
JavaScript
mit
unexpectedjs/unexpected,alexjeffburke/unexpected,alexjeffburke/unexpected
6d0ecec3d5e6d233dd50bd69554e1943256e6ed6
tests/utils.js
tests/utils.js
const each = require('lodash/each'); function captureError(fn) { try { fn(); } catch (e) { return e; } return null; } function restore(obj) { each(obj, v => { if (v && v.toString() === 'stub') v.restore(); }); } module.exports = { captureError, restore };
const each = require('lodash/each'); function captureError(fn) { try { fn(); } catch (e) { return e; } return null; } module.exports = { captureError };
Remove unused restore() test util
Remove unused restore() test util
JavaScript
bsd-3-clause
praekelt/numi-api
94e033902bac9c948ff0cfb72576a8e6c7c3cdce
root/scripts/gebo/perform.js
root/scripts/gebo/perform.js
// For testing if (typeof module !== 'undefined') { $ = require('jquery'); gebo = require('../config').gebo; FormData = require('./__mocks__/FormData'); } /** * Send a request to the gebo. The message can be sent * as FormData or JSON. * * @param object * @param FormData - optional ...
// For testing if (typeof module !== 'undefined') { $ = require('jquery'); gebo = require('../config').gebo; FormData = require('./__mocks__/FormData'); } /** * Send a request to the gebo. The message can be sent * as FormData or JSON. * * @param object * @param FormData - optional ...
Add processData and contentType properties to ajax call
Add processData and contentType properties to ajax call
JavaScript
mit
RaphaelDeLaGhetto/grunt-init-gebo-react-hai,RaphaelDeLaGhetto/grunt-init-gebo-react-hai
6988301e982506f361933b25149b89f2ceb3e54c
react/components/UI/Modal/Modal.js
react/components/UI/Modal/Modal.js
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; import ModalDialog from 'react/components/UI/ModalDialog'; const ModalBackdrop = styled.div` display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0;...
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; import ModalDialog from 'react/components/UI/ModalDialog'; const ModalBackdrop = styled.div` display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0;...
Make sure modal dialog appears over topbar header
Make sure modal dialog appears over topbar header
JavaScript
mit
aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell,aredotna/ervell
57835d31ab5419fcadfad2a06a63be11ae2796bb
list-sources.js
list-sources.js
const {readdirSync} = require('fs'); function listDir(dir) { readdirSync(dir) .filter(f => f.endsWith('.cc')) .forEach(f => console.log(dir + '/' + f)); } listDir('src'); listDir('src/UiArea'); listDir('src/arch/win32');
const readdirSync = require('fs').readdirSync; function listDir(dir) { readdirSync(dir) .filter(f => f.endsWith('.cc')) .forEach(f => console.log(dir + '/' + f)); } listDir('src'); listDir('src/UiArea'); listDir('src/arch/win32');
Fix unsupported syntax in node 4
Fix unsupported syntax in node 4
JavaScript
mit
parro-it/libui-node,parro-it/libui-node,parro-it/libui-node,parro-it/libui-node
39e652b50a44fdea520d5b97a3cc305d008c409e
src/actions/index.js
src/actions/index.js
import { ReadingRecord, ChapterCache } from 'actions/ConfigActions'; export const markNotificationSent = async ({comicID, chapterID}) => { try { const readingRecord = await ReadingRecord.get(comicID); ReadingRecord.put({ ...readingRecord, [chapterID]: 'notification_sent' }); } catch(err) { ReadingRecor...
import { ReadingRecord, ChapterCache } from 'actions/ConfigActions'; export const markNotificationSent = async ({comicID, chapterID}) => { try { const readingRecord = await ReadingRecord.get(comicID); ReadingRecord.put({ ...readingRecord, [chapterID]: 'notification_sent' }); } catch(err) { ReadingRecor...
Fix wrong model for replaceChapterCache
Fix wrong model for replaceChapterCache
JavaScript
mit
ComicsReader/reader,ComicsReader/reader,ComicsReader/app,ComicsReader/app
168ad7c6ee4e2e92db03e2061f4f5c1fb86a89a8
src/reducers.js
src/reducers.js
import { combineReducers } from 'redux'; // import constellations from './constellations/reducers'; import core from './core/reducers'; // import galaxies from './galaxies/reducers'; // import universe from './universe/reducers'; const appReducer = combineReducers({ // constellations, core, // galaxies, // un...
import { combineReducers } from 'redux'; // import constellations from './constellations/reducers'; import core from './core/reducers'; // import galaxies from './galaxies/reducers'; // import universe from './universe/reducers'; // import metaverse from './metaverse/reducers'; // import userprofiles from './userprofi...
Add user profiles and metaverse
Add user profiles and metaverse
JavaScript
mit
GetGee/G,GetGee/G
4499e00b0d4f12afa60be3cf57baf1362385cf2d
src/Plugins/Client/PrettyBrowserConsoleErrors.js
src/Plugins/Client/PrettyBrowserConsoleErrors.js
const JSONRPC = {}; JSONRPC.ClientPluginBase = require("../../ClientPluginBase"); /** * PrettyBrowserConsoleErrors plugin. * @class * @extends JSONRPC.ClientPluginBase */ module.exports = class PrettyBrowserConsoleErrors extends JSONRPC.ClientPluginBase { /** * Catches the exception and prints it. ...
const JSONRPC = {}; JSONRPC.ClientPluginBase = require("../../ClientPluginBase"); JSONRPC.Exception = require("../../Exception"); /** * PrettyBrowserConsoleErrors plugin. * @class * @extends JSONRPC.ClientPluginBase */ module.exports = class PrettyBrowserConsoleErrors extends JSONRPC.ClientPluginBase { ...
Add missing require in client plugin
Add missing require in client plugin
JavaScript
mit
oxygen/jsonrpc-bidirectional,bigstepinc/jsonrpc-bidirectional,oxygen/jsonrpc-bidirectional,bigstepinc/jsonrpc-bidirectional
5f823f52edc5ad4e9652e75f9474ba327a8e346d
src/api.js
src/api.js
import fetch from 'unfetch' const apiBase = 'https://api.hackclub.com/' const methods = ['get', 'put', 'post', 'patch'] const generateMethod = method => (path, options) => { // authToken is shorthand for Authorization: Bearer `authtoken` let filteredOptions = {} for (let [key, value] of Object.entries(options))...
import fetch from 'unfetch' const apiBase = 'https://api.hackclub.com/' const methods = ['get', 'put', 'post', 'patch'] const generateMethod = method => (path, options) => { // authToken is shorthand for Authorization: Bearer `authtoken` let filteredOptions = {} for (let [key, value] of Object.entries(options))...
Fix missing request body in API client
Fix missing request body in API client
JavaScript
mit
hackclub/website,hackclub/website,hackclub/website
890aaddbf06a41a7daa2cec0b1f6a6f1a4a1cc78
test/flora-cluster.spec.js
test/flora-cluster.spec.js
'use strict'; var expect = require('chai').expect; var floraCluster = require('../'); describe('flora-cluster', function () { it('should be an object', function () { expect(floraCluster).to.be.an('object'); }); });
'use strict'; var expect = require('chai').expect; var floraCluster = require('../'); describe('flora-cluster', function () { it('should be an object', function () { expect(floraCluster).to.be.an('object'); }); it('should expose master and worker objects', function () { expect(floraClust...
Add some interface tests for flora-cluster
Add some interface tests for flora-cluster
JavaScript
mit
godmodelabs/flora-cluster
b1eddfe37d30a653ebb23a2807eba407cea847de
src/javascripts/frigging_bootstrap/components/select.js
src/javascripts/frigging_bootstrap/components/select.js
var React = require("react/addons") var {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") var {div, select, option} = React.DOM var cx = require("classnames") export default class extends React.Component { displayName = "Frig.friggingBootstrap.Select" static default...
let React = require("react/addons") let cx = require("classnames") let {errorList, sizeClassNames, formGroupCx, label} = require("../util.js") let {div, select, option} = React.DOM export default class ext...
Change _inputHtml Into Function Call In Select
Change _inputHtml Into Function Call In Select Change _inputHtml from just passing the function to calling it in the Select Component when the select is rendered out. This allows the merge props to be the default props of the select.
JavaScript
mit
TouchBistro/frig,TouchBistro/frig,frig-js/frig,frig-js/frig
e111d680ac821e2f61bc405872caa4d29566b1c4
src/components/logo.js
src/components/logo.js
export default class Logo { render() { return ( <div id="branding"> <a href="index.php" title="CosmoWiki.de" rel="home"> <img src="http://cosmowiki.de/img/cw_header.jpg" width="500" height="75" alt="CosmoWiki.de"/> </a> </div> ); } }
export default class Logo { render() { return ( <div id="branding"> <a href="/" title="CosmoWiki.de" rel="home"> <img src="/img/cw_header.jpg" width="500" height="75" alt="CosmoWiki.de"/> </a> </div> ); } }
Replace hard coded refs by relative.
Replace hard coded refs by relative.
JavaScript
mit
cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki,cosmowiki/cosmowiki
d99736f34d2001921c487fd987ae55e3b6c05a29
lib/parse/block-element.js
lib/parse/block-element.js
import Set from 'es6-set'; import blockElements from 'block-elements'; const BLOCK_ELEMENTS = new Set(blockElements); const TEXT_ELEMENTS = { h1: 'header1', h2: 'header2', h3: 'header3', h4: 'header4', h5: 'header5', h6: 'header6', p: 'paragraph', blockquote: 'blockquote' }; const isPullQuote = (elm) ...
import Set from 'es6-set'; import blockElements from 'block-elements'; const BLOCK_ELEMENTS = new Set(blockElements); const TEXT_ELEMENTS = { h1: 'header1', h2: 'header2', h3: 'header3', h4: 'header4', h5: 'header5', h6: 'header6', p: 'paragraph', blockquote: 'blockquote' }; const isPullQuote = (elm) ...
Create new object instead of modifying, to make sure they are optimized by V8
Create new object instead of modifying, to make sure they are optimized by V8
JavaScript
mit
micnews/html-to-article-json,micnews/html-to-article-json
2127952f1775686e8da53a55e23b236e0d6e67d0
src/modules/Assetic.js
src/modules/Assetic.js
import layout from '../../config/layout' const fixLocalAsset = assets => ( (Array.isArray(assets) ? assets : [assets]).map(asset => `/${asset}`) ) export const getAssets = (localAssets = []) => ( Array.concat( layout.script.map(item => item.src), layout.link.map(item => item.href), localAssets.map(ass...
import layout from '../../config/layout' const fixLocalAsset = assets => ( (Array.isArray(assets) ? assets : [assets]).map(asset => `/${asset}`) ) const normalizeAssets = assets => { let normalized = [] assets.forEach(item => { if (Array.isArray(item)) { item.forEach(asset => { normalized.pus...
Fix issue with multi dimensional arrays
Fix issue with multi dimensional arrays
JavaScript
mit
janoist1/universal-react-redux-starter-kit
2dd837ca80ea7ff8f357de0408c41f9f1cd627be
tests/functional/routes.js
tests/functional/routes.js
'use strict'; /*global describe, it*/ var path = require('path'); var request = require('supertest'); var utils = require('../../lib/utils'); var app = require('../../app'); var routes = utils.requireDir(path.join(__dirname, '../../routes/')); var host = process.env.manhattan_context__instance_hostname || ...
'use strict'; /*global describe, it*/ var path = require('path'); var request = require('supertest'); var utils = require('../../lib/utils'); var app = require('../../app'); var routes = utils.requireDir(path.join(__dirname, '../../routes/')); var host = process.env.manhattan_context__instance_hostname || '...
Revert "Log which host is being functionally tested"
Revert "Log which host is being functionally tested" This reverts commit 824ec144553499911160779833d978d282e88be6.
JavaScript
bsd-3-clause
ericf/formatjs-site,ericf/formatjs-site
e55ba7f94a1e71c372881c423c7256b4acf0eba6
web/webpack/plugins/recipes.js
web/webpack/plugins/recipes.js
const config = require('./config'); const pwaOptions = require('./pwaConfig'); const PUBLIC_PATH = config.PUBLIC_PATH; /** * optional plugins enabled by enabling their recipe. * once enabled they succeed being required and get added to plugin list. * order them in the order they should be added to the plugin lists...
const config = require('./config'); const pwaOptions = require('./pwaConfig'); const PUBLIC_PATH = config.PUBLIC_PATH; /** * optional plugins enabled by enabling their recipe. * once enabled they succeed being required and get added to plugin list. * order them in the order they should be added to the plugin lists...
Fix using preload-webpack-plugin, not resource-hints-plugin
Fix using preload-webpack-plugin, not resource-hints-plugin
JavaScript
mit
c-h-/universal-native-boilerplate,c-h-/universal-native-boilerplate,c-h-/universal-native-boilerplate,c-h-/universal-native-boilerplate,c-h-/universal-native-boilerplate
55a1f8d049c622edd4f68a6d9189c92e4adfe674
lib/normalize-condition.js
lib/normalize-condition.js
var buildMoldsSelector = require('./build-molds-selector'); module.exports = function normalizeCondition(condition, alias) { var moldsSelector = buildMoldsSelector(alias); var moldSelected; var normalized; while(moldSelected = moldsSelector.exec(condition)) { normalized = condition.replace( moldSelected[0],...
var buildMoldsSelector = require('./build-molds-selector'); module.exports = function normalizeCondition(condition, alias) { var moldsSelector = buildMoldsSelector(alias); var moldSelected; while(moldSelected = moldsSelector.exec(condition)) { condition = condition.replace( new RegExp(moldSelected[0], 'g'), ...
Add support of multiple molds per condition
Add support of multiple molds per condition
JavaScript
mit
qron/ongine
662b688b40b49f0d2300f935502891dc55289541
public/docs.js
public/docs.js
var showing = null function hashChange() { var hash = document.location.hash.slice(1) var found = document.getElementById(hash), prefix, sect if (found && (prefix = /^([^\.]+)/.exec(hash)) && (sect = document.getElementById("part_" + prefix[1]))) { if (!sect.style.display) { sect.style.display = "block...
var showing = null function hashChange() { var hash = decodeURIComponent(document.location.hash.slice(1)) var found = document.getElementById(hash), prefix, sect if (found && (prefix = /^([^\.]+)/.exec(hash)) && (sect = document.getElementById("part_" + prefix[1]))) { if (!sect.style.display) { sect.st...
Fix problem with navigating to static methods in the reference guide
Fix problem with navigating to static methods in the reference guide
JavaScript
mit
ProseMirror/website,ProseMirror/website
b08a4b1fe56352ad9dc30ef1a8dbc1498db46261
core/client/components/gh-notification.js
core/client/components/gh-notification.js
var NotificationComponent = Ember.Component.extend({ classNames: ['js-bb-notification'], typeClass: function () { var classes = '', message = this.get('message'), type, dismissible; // Check to see if we're working with a DS.Model or a plain JS object ...
var NotificationComponent = Ember.Component.extend({ classNames: ['js-bb-notification'], typeClass: function () { var classes = '', message = this.get('message'), type, dismissible; // Check to see if we're working with a DS.Model or a plain JS object ...
Check the end of notification fade-out animation
Check the end of notification fade-out animation
JavaScript
mit
javorszky/Ghost,allanjsx/Ghost,francisco-filho/Ghost,mlabieniec/ghost-env,Sebastian1011/Ghost,metadevfoundation/Ghost,lanffy/Ghost,Kikobeats/Ghost,zeropaper/Ghost,v3rt1go/Ghost,epicmiller/pages,smaty1/Ghost,panezhang/Ghost,gabfssilva/Ghost,bsansouci/Ghost,thinq4yourself/Unmistakable-Blog,arvidsvensson/Ghost,Jai-Chaudha...
e5c1148583b076e9bdfb1c35e02c579ade240e3c
index.js
index.js
var doc = require('doc-js'); module.exports = function(hoverClass, selector){ var down = [], selector = selector || 'button, a', hoverClass = hoverClass || 'hover'; doc(document).on('touchstart mousedown', selector, function(event){ var target = doc(event.target).closest(selector); ...
var doc = require('doc-js'); module.exports = function(hoverClass, selector){ var down = [], selector = selector || 'button, a', hoverClass = hoverClass || 'hover'; function setClasses(){ for(var i = 0; i < down.length; i++){ doc(down[i]).addClass(hoverClass); } ...
Allow hover to be canceled by a scroll
Allow hover to be canceled by a scroll
JavaScript
mit
KoryNunn/hoverclass
acb81229c6f704e0962bf102eb17f8cc479b9862
src/mmw/js/src/data_catalog/controllers.js
src/mmw/js/src/data_catalog/controllers.js
"use strict"; var App = require('../app'), router = require('../router').router, coreUtils = require('../core/utils'), models = require('./models'), views = require('./views'); var DataCatalogController = { dataCatalogPrepare: function() { if (!App.map.get('areaOfInterest')) { ...
"use strict"; var App = require('../app'), router = require('../router').router, coreUtils = require('../core/utils'), models = require('./models'), views = require('./views'); var DataCatalogController = { dataCatalogPrepare: function() { if (!App.map.get('areaOfInterest')) { ...
Clear results from map on datacatalog cleanup
BiGCZ: Clear results from map on datacatalog cleanup
JavaScript
apache-2.0
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
a15fd27717ca924eac15cda65148b691d2dc5ed7
index.js
index.js
exports.transform = require('./lib/transform') exports.estimate = require('./lib/estimate') exports.version = require('./lib/version') exports.createFromArray = function (arr) { // Create a nudged.Transform instance from an array that was // previously created with nudged.Transform#toArray(). // // Together wi...
exports.transform = require('./lib/transform') exports.estimate = require('./lib/estimate') exports.version = require('./lib/version') exports.estimate = function (type, domain, range, pivot) { // Parameter // type // string. One of the following: // 'I', 'L', 'X', 'Y', 'T', 'S', 'R', 'TS', 'TR', '...
Remove nudged.createFromArray in favor of transform.createFromArray
Remove nudged.createFromArray in favor of transform.createFromArray
JavaScript
mit
axelpale/nudged
eab61d3f8fc076b2672cb31cce5e11fc9e5f3381
web_external/Datasets/selectDatasetView.js
web_external/Datasets/selectDatasetView.js
import View from '../view'; import SelectDatasetPageTemplate from './selectDatasetPage.pug'; // View for a collection of datasets in a select tag. When user selects a // dataset, a 'changed' event is triggered with the selected dataset as a // parameter. const SelectDatasetView = View.extend({ events: { '...
import View from '../view'; import SelectDatasetPageTemplate from './selectDatasetPage.pug'; // View for a collection of datasets in a select tag. When user selects a // dataset, a 'changed' event is triggered with the selected dataset as a // parameter. const SelectDatasetView = View.extend({ events: { '...
Use a more specific event selector in SelectDatasetView
Use a more specific event selector in SelectDatasetView
JavaScript
apache-2.0
ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive
07efe8f7cdec6b9213668a0a9bd010beae6d689f
index.js
index.js
var bodyParser = require('body-parser') var dataUriToBuffer = require('data-uri-to-buffer') var express = require('express') var app = express() var transform = require("./transformer") // Set up some Express settings app.use(bodyParser.json({ limit: '2mb' })) app.use(express.static(__dirname + '/public')) /** * Ho...
var bodyParser = require('body-parser') var dataUriToBuffer = require('data-uri-to-buffer') var express = require('express') var app = express() /** * This is your custom transform function * move it wherever, call it whatever */ var transform = require("./transformer") // Set up some Express settings app.use(body...
Change image size limit down to 1mb per @ednapiranha
Change image size limit down to 1mb per @ednapiranha
JavaScript
mit
jasonrhodes/revisit-gifplay,revisitors/revisit.link-quickstart,florida/put-a-bird-on-it-revisit-service,jasonrhodes/H4UNT3D-H4U5
c78023ffd19f78cc9b753bcda96623323008ca08
index.js
index.js
'use strict'; var rework = require('broccoli-rework'); module.exports = { name: 'ember-cli-rework', included: function(app) { this.app = app; this.plugins = this.app.options.reworkPlugins; }, postprocessTree: function(type, tree) { if (type === 'all' || type === 'styles') { tree = autopref...
'use strict'; var rework = require('broccoli-rework'); module.exports = { name: 'ember-cli-rework', included: function(app) { this.app = app; this.plugins = this.app.options.reworkPlugins; }, postprocessTree: function(type, tree) { if (type === 'all' || type === 'styles') { tree = rework(t...
Return the tree after postprocess
Return the tree after postprocess
JavaScript
mit
johnotander/ember-cli-rework,johnotander/ember-cli-rework
e6b264d0e331489d7f713bc2e821ccc3c624158f
index.js
index.js
/*jslint node: true*/ function getCookie(req, cookieName) { var cookies = {}, output; if (req.headers.cookie) { req.headers.cookie.split(';').forEach(function (cookie) { var parts = cookie.split('='); cookies[parts[0].trim()] = parts[1].trim(); }); output ...
/*jslint node: true*/ function getCookie(req, cookieName) { var cookies = {}, cn, output; if (req.headers.cookie) { req.headers.cookie.split(';').forEach(function (cookie) { var parts = cookie.split('='); if (parts.length > 1) { cn = parts[0].trim(...
Handle domain, secure and httpOnly flags
Handle domain, secure and httpOnly flags
JavaScript
mit
Ajnasz/ajncookie
8c181f8385742ead72b4ebce3bdfd14786756162
index.js
index.js
'use strict'; const crypto = require('crypto'); // User ARN: arn:aws:iam::561178107736:user/prx-upload // Access Key ID: AKIAJZ5C7KQPL34SQ63Q const key = process.env.ACCESS_KEY; exports.handler = (event, context, callback) => { try { if (!event.queryStringParameters || !event.queryStringParameters.to_sign) { ...
'use strict'; const crypto = require('crypto'); // User ARN: arn:aws:iam::561178107736:user/prx-upload // Access Key ID: AKIAJZ5C7KQPL34SQ63Q const key = process.env.ACCESS_KEY; exports.handler = (event, context, callback) => { try { if (!event.queryStringParameters || !event.queryStringParameters.to_sign) { ...
Add CORS headers to GET response
Add CORS headers to GET response
JavaScript
agpl-3.0
PRX/upload.prx.org,PRX/upload.prx.org
dc5cf611c89c6bb4f9466f1afe0b0f81bd65ddf9
src/resolve.js
src/resolve.js
function resolve({ columns, method = () => rowData => rowData, indexKey = '_index' }) { if (!columns) { throw new Error('resolve - Missing columns!'); } return (rows = []) => { const methodsByColumnIndex = columns.map(column => method({ column })); return rows.map((rowData, rowIndex) => { ...
function resolve({ columns, method = () => rowData => rowData, indexKey = '_index' }) { if (!columns) { throw new Error('resolve - Missing columns!'); } return (rows = []) => { const methodsByColumnIndex = columns.map(column => method({ column })); return rows.map((rowData, rowIndex) => { ...
Set indexKey once per row, not per column.
Set indexKey once per row, not per column. The performance improvement depends on the number of columns, but on a real data set of 5000 rows and 11 resolved columns this improves performance by 8.7%. This does not change the result since the order of keys in the spread is unchanged.
JavaScript
mit
reactabular/table-resolver
90fc4c61301c9fd6270821e3b4af6150e8006bec
src/middleware/auth/processJWTIfExists.js
src/middleware/auth/processJWTIfExists.js
const nJwt = require('njwt'), config = require('config.js'), errors = require('feathers-errors'); function processJWTIfExists (req, res, next) { req.feathers = req.feathers || {}; let token = req.headers['authorization']; if (token == null) { let cookies = req.cookies; token = cookies.id...
const nJwt = require('njwt'), config = require('config.js'), errors = require('feathers-errors'); function processJWTIfExists (req, res, next) { req.feathers = req.feathers || {}; let token = req.headers['authorization']; console.log('line-1 ', token); if (token == null) { let cookies = r...
Add temporary console logs to help track down an auth bug sometimes found in mobile iOS Safari
Add temporary console logs to help track down an auth bug sometimes found in mobile iOS Safari
JavaScript
agpl-3.0
podverse/podverse-web,podverse/podverse-web,podverse/podverse-web,podverse/podverse-web
5970b784543cfedc8aa09dd405ab79d50e327bdb
index.js
index.js
'use strict'; var commentMarker = require('mdast-comment-marker'); module.exports = commentconfig; /* Modify `processor` to read configuration from comments. */ function commentconfig() { var Parser = this.Parser; var Compiler = this.Compiler; var block = Parser && Parser.prototype.blockTokenizers; var inlin...
'use strict'; var commentMarker = require('mdast-comment-marker'); module.exports = commentconfig; /* Modify `processor` to read configuration from comments. */ function commentconfig() { var proto = this.Parser && this.Parser.prototype; var Compiler = this.Compiler; var block = proto && proto.blockTokenizers;...
Fix for non-remark parsers or compilers
Fix for non-remark parsers or compilers
JavaScript
mit
wooorm/mdast-comment-config,wooorm/remark-comment-config
4ae6c11508a002c4adcf23f20af5e7c8f1eb7dc3
index.js
index.js
// Constructor var RegExpParser = module.exports = {}; /** * parse * Parses a string input * * @name parse * @function * @param {String} input the string input that should be parsed as regular * expression * @return {RegExp} The parsed regular expression */ RegExpParser.parse = function (input) { // Vali...
// Constructor var RegExpParser = module.exports = {}; /** * parse * Parses a string input * * @name parse * @function * @param {String} input the string input that should be parsed as regular * expression * @return {RegExp} The parsed regular expression */ RegExpParser.parse = function(input) { // Valid...
Use a regular expression to parse regular expressions :smile:
Use a regular expression to parse regular expressions :smile:
JavaScript
mit
IonicaBizau/regex-parser.js
fee5fbe024705c8b2409b1c207f40d7bb3bc1fbe
src/js/graph/modules/focuser.js
src/js/graph/modules/focuser.js
webvowl.modules.focuser = function () { var focuser = {}, focusedElement; focuser.handle = function (clickedElement) { if (focusedElement !== undefined) { focusedElement.toggleFocus(); } if (focusedElement !== clickedElement) { clickedElement.toggleFocus(); focusedElement = clickedElement; } else...
webvowl.modules.focuser = function () { var focuser = {}, focusedElement; focuser.handle = function (clickedElement) { if (d3.event.defaultPrevented) { return; } if (focusedElement !== undefined) { focusedElement.toggleFocus(); } if (focusedElement !== clickedElement) { clickedElement.toggleFo...
Disable focusing on after dragging a node
Disable focusing on after dragging a node
JavaScript
mit
leshek-pawlak/WebVOWL,leshek-pawlak/WebVOWL,MissLoveWu/webvowl,VisualDataWeb/WebVOWL,VisualDataWeb/WebVOWL,MissLoveWu/webvowl
8d60c1b35b9b946915b67e9fa88107bdb22e13da
karma.conf.js
karma.conf.js
module.exports = function(config) { config.set({ basePath: '', frameworks: ['mocha', 'chai-jquery', 'jquery-2.1.0', 'chai', 'sinon-chai', 'fixture'], files: [ 'public/javascripts/vendor/d3.v3.min.js', 'public/javascripts/vendor/raphael-min.js', 'public/javascripts/vendor/morris.min.js', ...
module.exports = function(config) { config.set({ basePath: '', frameworks: ['mocha', 'chai-jquery', 'jquery-2.1.0', 'chai', 'sinon-chai', 'fixture'], files: [ 'public/javascripts/vendor/d3.v3.min.js', 'public/javascripts/vendor/raphael-min.js', 'public/javascripts/vendor/morris.min.js', ...
Remove sparkline from spec (not needed anymore)
Remove sparkline from spec (not needed anymore)
JavaScript
mit
codeforamerica/city-analytics-dashboard,codeforamerica/city-analytics-dashboard,codeforamerica/city-analytics-dashboard
53d55efbe820f9e4e8469992e2b2f193bd4de345
src/write-to-server.js
src/write-to-server.js
'use strict'; var env = require('./env.json'); function httpPost(req, cb) { var https = req.deps.https; console.log('env:', env); var postData = JSON.stringify({ metadata: req.data.s3Object.Metadata, sizes: req.data.sizes }); var options = { hostname: 'plaaant.com', port: 443, path: '/...
'use strict'; var env = require('./env.json'); function httpPost(req, cb) { var https = req.deps.https; console.log('env:', env); var postData = JSON.stringify({ metadata: req.data.s3Object.Metadata, sizes: req.data.sizes }); var options = { hostname: 'plaaant.com', port: 443, path: '/...
Add some logging to https.request
Add some logging to https.request
JavaScript
mit
guyellis/plant-image-lambda,guyellis/plant-image-lambda
831714e2bf0c396c0adcb0fe069f4d998e340889
index.js
index.js
/** * index.js * Client entry point. * * @author Francis Brito <fr.br94@gmail.com> * @license MIT */ 'use strict'; /** * Client * Provides methods to access PrintHouse's API. * * @param {String} apiKey API key identifying account owner. * @param {Object} opts Contains options to be passed to the clien...
/** * index.js * Client entry point. * * @author Francis Brito <fr.br94@gmail.com> * @license MIT */ 'use strict'; /** * Client * Provides methods to access PrintHouse's API. * * @param {String} apiKey API key identifying account owner. * @param {Object} opts Contains options to be passed to the clien...
Add default API URL for client.
Add default API URL for client.
JavaScript
mit
francisbrito/ph-node
8924f0f00493b836e81c09db2e161bf70a5fda48
index.js
index.js
var VOWELS = /[aeiou]/gi; var VOWELS_AND_SPACE = /[aeiou\s]/g; exports.parse = function parse(string, join){ if(typeof string !== 'string'){ throw new TypeError('Expected a string as the first option'); } var replacer = VOWELS; if (join) { replacer = VOWELS_AND_SPACE; } return string.replace(...
var VOWELS = /[aeiou]/gi; var VOWELS_AND_SPACE = /[aeiou\s]/g; exports.parse = function parse(string, join){ if(typeof string !== 'string'){ throw new TypeError('Expected a string as the first option'); } return string.replace(join ? VOWELS_AND_SPACE : VOWELS, ''); };
Move to more functional, expression-based conditionals
Move to more functional, expression-based conditionals
JavaScript
mit
lestoni/unvowel
3ca40e5d48afa58abeb523ebf9e35b7c0e7c27a2
index.js
index.js
var express = require('express'); var app = express(); var image_utils = require('./image_utils.js'); app.set('port', (process.env.PORT || 5001)); /* Search latest images search */ app.get("/api/latest/imagesearch", function(req, res) { res.end("api/latest/imagesearch/"); }); app.get("/api/imagesearch/:searchQ...
var express = require('express'); var app = express(); var image_utils = require('./image_utils.js'); app.set('port', (process.env.PORT || 5001)); /* Search latest images search */ app.get("/api/latest/imagesearch", function(req, res) { res.end("api/latest/imagesearch/"); }); app.get("/api/imagesearch/:searchQ...
Test google api on server
Test google api on server
JavaScript
mit
diegoingaramo/img-search-al
63a5bc853e2073ee7fecb3699d69ab6e6d19e5ad
index.js
index.js
'use strict'; // Global init global.Promise = require('babel-runtime/core-js/promise').default = require('bluebird'); // Exports module.exports = require('./dist/index').default;
'use strict'; // Global init global.Promise = require('babel-runtime/core-js/promise').default = require('bluebird'); // Exports module.exports = require('./dist/index').default; // eslint-disable-line import/no-unresolved
Fix failed linting during npm test on a clean directory
Fix failed linting during npm test on a clean directory
JavaScript
mit
komapijs/komapi,komapijs/komapi
e8decae34ae5d07fdeecfd55f60f3d010c97cc10
index.js
index.js
'use strict' module.exports = trimTrailingLines var line = '\n' // Remove final newline characters from `value`. function trimTrailingLines(value) { var string = String(value) var index = string.length while (string.charAt(--index) === line) { // Empty } return string.slice(0, index + 1) }
'use strict' module.exports = trimTrailingLines // Remove final newline characters from `value`. function trimTrailingLines(value) { return String(value).replace(/\n+$/, '') }
Refactor code to improve bundle size
Refactor code to improve bundle size
JavaScript
mit
wooorm/trim-trailing-lines
a6edc68779d82e7193360d321ebdc97307e5c59f
index.js
index.js
'use strict' const _ = require('lodash') const Promise = require('bluebird') const arr = [] module.exports = function loadAllPages (callFx, opts) { opts['page'] = opts.page || 1 return Promise .resolve(callFx(opts)) .then((result) => { arr.push(result) if (_.isFunction(result.nextPage)) { ...
'use strict' const _ = require('lodash') const Promise = require('bluebird') var arr = [] module.exports = function loadAllPages (callFx, opts) { opts['page'] = opts.page || 1 return Promise .resolve(callFx(opts)) .then((result) => { arr.push(result) if (_.isFunction(result.nextPage)) { ...
Reset array after each use
Reset array after each use
JavaScript
mit
RichardLitt/depaginate
a76d316430fd9f95d9eaee90915a25a7b2ec582a
index.js
index.js
'use strict'; var yargs = require('yargs'); var uploader = require('./lib/uploader'); var version = require('./package.json').version; var argv = yargs .usage('$0 [options] <directory>') .demand(1, 1) .option('api-key', { demand: true, describe: 'Cloudinary API key', type: 'string', nargs: 1 ...
'use strict'; var yargs = require('yargs'); var uploader = require('./lib/uploader'); var version = require('./package.json').version; var argv = yargs .usage('$0 [options] <directory>') .demand(1, 1) .option('api-key', { demand: true, describe: 'Cloudinary API key', type: 'string', nargs: 1 ...
Add option to print version
Add option to print version
JavaScript
mit
kemskems/cloudinary-cli-upload
43364f8b042a3bc6b1b03f55a65fc670ae7efd2e
index.js
index.js
var postcss = require('postcss'); module.exports = postcss.plugin('postcss-property-lookup', propertyLookup); function propertyLookup() { return function(css, result) { css.eachRule(function(rule) { rule.replaceValues(/@([a-z-]+)(\s?)/g, { fast: '@' }, function(orig, prop, space) { var replacement...
var postcss = require('postcss'); module.exports = postcss.plugin('postcss-property-lookup', propertyLookup); function propertyLookup() { return function(css, result) { css.eachRule(function(rule) { rule.replaceValues(/@([a-z-]+)(\s?)/g, { fast: '@' }, function(orig, prop, space) { var replacement...
Add rule selector to console warning
Add rule selector to console warning
JavaScript
mit
jedmao/postcss-property-lookup,simonsmith/postcss-property-lookup
40e92a2240c7d764dd430ccd64cb6eaff3b5879b
lib/define.js
lib/define.js
/*jslint browser:true, node:true*/ 'use strict'; /** * Module Dependencies */ var View = require('./view'); var store = require('./store'); /** * Creates and registers a * FruitMachine view constructor. * * @param {Object|View} * @return {View} */ module.exports = function(props) { var module = props.m...
/*jslint browser:true, node:true*/ 'use strict'; /** * Module Dependencies */ var View = require('./view'); var store = require('./store'); /** * Creates and registers a * FruitMachine view constructor. * * @param {Object|View} * @return {View} */ module.exports = function(props) { var module = props.mo...
Remove API to clear stored modules
Remove API to clear stored modules
JavaScript
mit
quarterto/fruitmachine,quarterto/fruitmachine,ftlabs/fruitmachine
9a7ce192e5e13c34c6bdf97b5ac4123071978fdb
desktop/src/Settings/SettingsContainer.js
desktop/src/Settings/SettingsContainer.js
import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import * as actionCreators from './actionCreators'; import Settings from './Settings'; const mapStateToProps = state => ({ fullscreen: state.appProperties.fullscreen, showNotYetTasks: state.appProperties.showNotYetTasks, calendar...
import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import * as actionCreators from './actionCreators'; import Settings from './Settings'; const mapStateToProps = state => ({ fullscreen: state.appProperties.fullscreen, showNotYetTasks: state.appProperties.showNotYetTasks, calendar...
Add firstDayOfWeek to Settings mapped props
Add firstDayOfWeek to Settings mapped props
JavaScript
mit
mkermani144/wanna,mkermani144/wanna
164bcc02f7ebf73fe99e7ecb1d6d0b158cd5965c
test/logger.js
test/logger.js
'use strict'; // logger.js tests const chai = require('chai'); const expect = chai.expect; const chalk = require('chalk'); const Logger = require('../lib/logger'); // Init logger const logger = new Logger(); // Tests describe('logger.js tests', () => { it('should check if logger._getdate() works', (done) => { /...
'use strict'; // logger.js tests const chai = require('chai'); const expect = chai.expect; const chalk = require('chalk'); const Logger = require('../lib/logger'); // Init logger const logger = new Logger(); // Tests describe('logger.js tests', () => { it('should check if logger._getdate() works', (done) => { /...
Fix issue in tests where old was not defined
:bug: Fix issue in tests where old was not defined
JavaScript
mit
Gum-Joe/bedel,Gum-Joe/bedel,Gum-Joe/bedel,Gum-Joe/bedel
59a6fcf57baedffd5d88042f4f3b0caa7b54ee82
static/scripts/views/event/creation.js
static/scripts/views/event/creation.js
define(['backbone', 'marionette'], function(Backbone, Marionette) { return Backbone.View.extend({ template: '#event-creation', events: { 'click button.create-event': 'create_event' }, initialize: function() {}, render: function() { var rendered_temp...
define(['backbone', 'marionette'], function(Backbone, Marionette) { return Backbone.View.extend({ template: '#event-creation', events: { 'click button.create-event': 'create_event' }, initialize: function() {}, render: function() { var rendered_temp...
Set date when creating event, not when it's require'd
Set date when creating event, not when it's require'd
JavaScript
mit
amackera/stratus
52b58f48625f7a54f4e342e263b865747137dcfa
src/Middleware/MiddlewareStack.js
src/Middleware/MiddlewareStack.js
export default class MiddlewareStack { constructor(handler, stack = []) { this._handler = handler; this._stack = stack.map(element => (typeof element === 'function' ? new element() : element)); this._regenerateMiddlewareProcess(); } push(middleware) { this._stack.push(middleware); this._regen...
export default class MiddlewareStack { constructor(handler, stack = []) { this._handler = handler; this._stack = stack.map(element => (typeof element === 'function' ? new element() : element)); this._regenerateMiddlewareProcess(); } push(middleware) { this._stack.push(middleware); this._regen...
Make the middleware regen after pops.
Make the middleware regen after pops.
JavaScript
mit
hkwu/ghastly
20542df46f1a5274c2292c9c05cf8024ab4679ad
test/react/router.spec.js
test/react/router.spec.js
var makeSignatureFromRoutes = require('../../src/react/router').makeSignatureFromRoutes describe("react: makeSignatureFromRoutes", function() { it("should correctly join paths", function() { var routes = [ {path: "/"}, {path: "/something"}, ] expect(makeSignatureFromRoutes(routes)).toBe("/someth...
var makeSignatureFromRoutes = require('../../src/react/router').makeSignatureFromRoutes var pushLocation = {action: 'PUSH'}, replaceLocation = {action: 'REPLACE'} describe("react: makeSignatureFromRoutes", function() { it("should correctly join paths", function() { var routes = [ {path: "/"}, {path: "/som...
Add test for REPLACE route
Add test for REPLACE route
JavaScript
mit
opbeat/opbeat-react,opbeat/opbeat-react,opbeat/opbeat-react
76d385139e36b3b685d73ba209e2f52ad89ebd01
client/apps/user_tool/actions/application.js
client/apps/user_tool/actions/application.js
import wrapper from 'atomic-fuel/libs/constants/wrapper'; import Network from 'atomic-fuel/libs/constants/network'; // Local actions const actions = []; // Actions that make an api request const requests = ['SEARCH_FOR_ACCOUNT_USERS', 'GET_ACCOUNT_USER', 'UPDATE_ACCOUNT_USER']; export const Constants = wrapper(actio...
import wrapper from 'atomic-fuel/libs/constants/wrapper'; import Network from 'atomic-fuel/libs/constants/network'; // Increasing timeout to accomodate slow environments. Default is 20_000. Network.TIMEOUT = 60_000; // Local actions const actions = []; // Actions that make an api request const requests = ['SEARCH_FO...
Increase client-side network timeout from 20 seconds to 60
fix: Increase client-side network timeout from 20 seconds to 60 We're having problems in the staging environment where requests are taking longer than 20 seconds and are timing out so the user can't perform certain actions. Increasing the timeout to 60 seconds won't improve the slow performance obviously, but it will ...
JavaScript
mit
atomicjolt/adhesion,atomicjolt/adhesion,atomicjolt/adhesion,atomicjolt/adhesion
fcda3bb2aa828f7f34a0fa667b43089b10786bd5
public/app/service-api.js
public/app/service-api.js
var svcMod = angular.module( "linksWeb.service-api", [] ); svcMod.factory( 'API', [ "$http", "$window", function ( $http, $window ) { var apiRequest = function ( method, path, requestData, callback ) { var headers = { "Content-Type": "application/json", "Authorization": "Token " ...
var svcMod = angular.module( "linksWeb.service-api", [] ); svcMod.factory( 'API', [ "$http", "$window", function ( $http, $window ) { var apiRequest = function ( method, path, requestData, callback ) { var headers = { "Content-Type": "application/json" }; if ( $window.sessio...
Set the Authorization header if a token exists
Set the Authorization header if a token exists
JavaScript
mit
projectweekend/Links-Web,projectweekend/Links-Web
4a31e8979533dfccd99157832def834f134f340a
test/fixtures/index.js
test/fixtures/index.js
var sample_xform = require('./sample_xform'); module.exports = function() { return [ { request: { method: "GET", url: "http://www.example.org/xform00", params: {}, }, response: { code: "200", ...
module.exports = function() { return []; };
Revert "Add fixture for getting an xform from an external server"
Revert "Add fixture for getting an xform from an external server" This reverts commit 8ef11ed11f09b9f4ce7d53234fdb6100c7fe8451.
JavaScript
bsd-3-clause
praekelt/go-jsbox-xform,praekelt/go-jsbox-xform
28929cc0260ea14c2de5ec19874c6dbba00f9100
matchMedia.js
matchMedia.js
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ window.matchMedia = window.matchMedia || (function( doc, undefined ) { "use strict"; var bool, docElem = doc.documentElement, refNode = docElem....
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ window.matchMedia || (window.matchMedia = function() { "use strict"; var styleMedia = (window.styleMedia || window.media); // For those that doen't...
Complete rewrite in an effort to gain performance
Complete rewrite in an effort to gain performance
JavaScript
mit
therealedsheenan/matchMedia.js,amitabhaghosh197/matchMedia.js,AndBicScadMedia/matchMedia.js,ababic/matchMedia.js,therealedsheenan/matchMedia.js,paulirish/matchMedia.js,zxfjessica/match-media-polyfill,CondeNast/matchMedia.js,CondeNast/matchMedia.js,ababic/matchMedia.js,dirajkumar/matchMedia.js,zxfjessica/match-media-pol...
6e648cc1f0abfd8df74f11a48682c8c177ad309d
pa11y.js
pa11y.js
// This is our options configuration for Pa11y // https://github.com/pa11y/pa11y#configuration const options = { timeout: 60000, hideElements: '.skip-to, .is-visuallyhidden' }; module.exports = options;
// This is our options configuration for Pa11y // https://github.com/pa11y/pa11y#configuration const options = { timeout: 60000, hideElements: '.skip-to, .is-visuallyhidden, .visuallyhidden' }; module.exports = options;
Add .visuallyhidden class to Pa11y test excludes
Add .visuallyhidden class to Pa11y test excludes
JavaScript
mit
AusDTO/gov-au-ui-kit,AusDTO/gov-au-ui-kit,AusDTO/gov-au-ui-kit