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
ed7c46dd2759a6c44eb359350263caf1d8d18085
koans/AboutMaps.js
koans/AboutMaps.js
describe("About Maps", function () { describe("Basic Usage", function () { it("should understand they are key, value stores", function () { var trooper = new Map(); trooper.set('name', 'Stormtrooper'); trooper.set('Droid you are looking for?', false); trooper.set('hits target', function...
describe("About Maps", function () { describe("Basic Usage", function () { it("should understand they are key, value stores", function () { var trooper = new Map(); trooper.set('name', 'Stormtrooper'); trooper.set('Droid you are looking for?', false); trooper.set('hits target', function...
Add mutable koan for Maps
feat: Add mutable koan for Maps
JavaScript
mit
tawashley/es6-javascript-koans,tawashley/es6-javascript-koans,tawashley/es6-javascript-koans
b62b47ece19b8038ce7abe21bdab16aa552919ab
lib/ui/baseUI.js
lib/ui/baseUI.js
'use strict'; var _ = require('lodash'); var readlineFacade = require('readline2'); /** * Base interface class other can inherits from */ var UI = module.exports = function (opt) { // Instantiate the Readline interface // @Note: Don't reassign if already present (allow test to override the Stream) if (!this....
'use strict'; var _ = require('lodash'); var readlineFacade = require('readline2'); /** * Base interface class other can inherits from */ var UI = module.exports = function (opt) { // Instantiate the Readline interface // @Note: Don't reassign if already present (allow test to override the Stream) if (!this....
Remove showing cursor at end of prompt. cli-cursor handles it
Remove showing cursor at end of prompt. cli-cursor handles it
JavaScript
mit
dkoleary88/Inquirer.js,mokkabonna/Inquirer.js,SBoudrias/Inquirer.js,nk1tz/Inquirer.js,DouglasHennrich/Inquirer.js,jonschlinkert/inquirer2,jviotti/Inquirer.js,SBoudrias/Inquirer.js,senshuu/Inquirer.js
111ff5bd1f24e17ef6710127b6aed17d93a2b06b
modules/govuk.js
modules/govuk.js
const request = require('request-promise') module.exports = { commands: { govuk: { help: 'Returns a random GOV.UK page', fireMessageEvent: true, command: async function () { let res = await request({ followRedirect: false, resolveWithFullResponse: true, simp...
const request = require('request-promise') const colors = require('irc').colors module.exports = { commands: { govuk: { help: 'Returns a random GOV.UK page', fireMessageEvent: true, command: async function () { const res = await request({ followRedirect: false, resolv...
Add random GOV.UK organisation lookup
Add random GOV.UK organisation lookup I needed to practice GOV.UK registers anyway
JavaScript
isc
zuzakistan/civilservant,zuzakistan/civilservant
0ccef3851151a00667457e0fe2fb1f0548709e2f
public/app/scripts/services/services.js
public/app/scripts/services/services.js
/** * Created by aldo on 5/5/14. */ 'use strict'; var services = angular.module('fortuneAdmin.Services', []);
/** * Created by aldo on 5/5/14. */ 'use strict'; var services = angular.module('fortuneAdmin.Services', [ 'fortuneAdmin.Services.inflectPort' ]);
Include Inflect port to app
Include Inflect port to app
JavaScript
mit
flyvictor/fortune-admin,flyvictor/fortune-admin
4568bd284ad2c57be403ab1c304acec5b03f9325
public/script.js
public/script.js
$(function(){ $(".blame").hover(function() { if (!$(this).hasClass("load")) return; var classList = $(this).prop('classList'); var blameSha1 = null; var sha1 = null; $.each(classList, function(i, v) { if (v.startsWith("blame-")) blameSha1 = v; sha1 = v.substring(6); ...
$(function(){ $(".blame").hover(function() { if (!$(this).hasClass("load")) return; var classList = $(this).prop('classList'); var blameSha1 = null; var sha1 = null; $.each(classList, function(i, v) { if (v.startsWith("blame-")) { blameSha1 = v; sha1 = v.substring(6); ...
Fix broken search for blame- class
Fix broken search for blame- class
JavaScript
mit
apoluektov/playground-git-browser,apoluektov/playground-git-browser,apoluektov/playground-git-browser
4fd0c02e05ea65f2d8ccd708f0cb842ed5f27e35
core/cb.rpc.search/service.js
core/cb.rpc.search/service.js
// Requires var Q = require('q'); var _ = require('lodash'); function SearchRPCService(search) { this.search = search; _.bindAll(this); } SearchRPCService.prototype.files = function(args) { _.defaults(args, { path: '/' }); return this.search.files(args); }; // Exports exports.SearchRPCSe...
// Requires var Q = require('q'); var _ = require('lodash'); function SearchRPCService(search) { this.search = search; _.bindAll(this); } SearchRPCService.prototype.files = function(args) { _.defaults(args, { path: '/' }); return this.search.files(args); }; SearchRPCService.prototype.cod...
Add rpc method to search for code search
Add rpc method to search for code search
JavaScript
apache-2.0
lcamilo15/codebox,quietdog/codebox,ronoaldo/codebox,rajthilakmca/codebox,kustomzone/codebox,quietdog/codebox,nobutakaoshiro/codebox,code-box/codebox,Ckai1991/codebox,ahmadassaf/Codebox,ronoaldo/codebox,CodeboxIDE/codebox,LogeshEswar/codebox,rodrigues-daniel/codebox,etopian/codebox,indykish/codebox,etopian/codebox,small...
9f364b3e36404ec94ea6f0e6c477e79451fe20fc
stories/user-input.stories.js
stories/user-input.stories.js
/** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * Internal dependencies */ import UserInputApp from '../assets/js/components/user-input/UserInputApp'; storiesOf( 'User Input', module ) .add( 'User Input Page', () => { return <UserInputApp />; } );
/** * External dependencies */ import { storiesOf } from '@storybook/react'; import { set } from 'lodash'; /** * Internal dependencies */ import UserInputApp from '../assets/js/components/user-input/UserInputApp'; import { WithTestRegistry, createTestRegistry } from '../tests/js/utils'; storiesOf( 'User Input', m...
Add UserInput story for both boolen states for enabled.
Add UserInput story for both boolen states for enabled.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
75f9ab91f8a170e509e8e3338607861b7006cdd9
lib/koa-base.js
lib/koa-base.js
require('./dotenv')(); exports.config = null; exports.run = null; exports.start = function start(options){ options = options || {}; options.port = options.port || process.env.PORT || 80; options.serve = options.serve || 'public'; options.bodyParser = options.bodyParser || true; console.log('Node ...
require('./dotenv')(); exports.config = null; exports.run = null; exports.start = function start(options){ options = options || {}; options.port = options.port || process.env.PORT || 80; options.serve = options.serve || 'public'; options.bodyParser = options.bodyParser || true; options.staticCache...
Use staticCache if option is set
Use staticCache if option is set
JavaScript
mit
marc1404/koa-base,marc1404/koala
e5a3f5fefa938513787c58d2ea770834d1da202c
lib/podio-js.js
lib/podio-js.js
var VERSION = '1.0.0'; var _ = require('lodash'); var DEFAULT_API_URL = 'https://api.podio.com:443'; var utils = require('./utils'); var GeneralLib = require('./general'); var AuthLib = require('./auth'); var TransportLib = require('./transport'); var PodioJS = function(authOptions, options) { this.VERSION = VERS...
var VERSION = require('../package.json').version; var _ = require('lodash'); var DEFAULT_API_URL = 'https://api.podio.com:443'; var utils = require('./utils'); var GeneralLib = require('./general'); var AuthLib = require('./auth'); var TransportLib = require('./transport'); var PodioJS = function(authOptions, optio...
Read current version from `package.json`
Read current version from `package.json`
JavaScript
mit
shelsonjava/podio-js,podio/podio-js
82e5d932240bb63231a919ef904989d7316c53f0
packages/specular-dmx/src/render.js
packages/specular-dmx/src/render.js
import {Fixture} from './fixture' let universeData export default function (universeRenderers) { return { before () { universeData = {} Object.keys(universeRenderers).forEach(key => universeData[key] = {}) }, render (component) { if (component instanceof Fixture && component._channels...
import {Fixture} from './fixture' let universeData export default function (universeRenderers) { return { before () { universeData = {} Object.keys(universeRenderers).forEach(key => universeData[key] = {}) }, render (component) { if (component instanceof Fixture && component._channels...
Allow passing multiple outputs for a single universe
Allow passing multiple outputs for a single universe
JavaScript
mit
madjam002/specular,madjam002/specular
f4d58854ca2ace649bf644d80cad19d4b3b857bc
src/nih_wayfinding/app/scripts/views/locations/locations-controller.js
src/nih_wayfinding/app/scripts/views/locations/locations-controller.js
(function () { 'use strict'; /* ngInject */ function LocationsController($scope, $state, Geocoder, NavbarConfig, Notifications, ProfileService) { var ctl = this; initialize(); function initialize() { ctl.findAddressExpanded = false; ctl.user = ProfileService...
(function () { 'use strict'; /* ngInject */ function LocationsController($scope, $state, Geocoder, NavbarConfig, Notifications, ProfileService) { var ctl = this; initialize(); function initialize() { ctl.findAddressExpanded = false; ctl.user = ProfileService...
Use geocoder reject message in non-profile address search
Use geocoder reject message in non-profile address search
JavaScript
apache-2.0
azavea/nih-wayfinding,azavea/nih-wayfinding
18341ba027a42e11ee90b3eb5cde21a72f790ad9
spec/column-shifter-spec.js
spec/column-shifter-spec.js
var expect = require('chai').expect; var sinon = require('sinon'); var ColumnShifter = require('component/grid/projection/column-shifter'); var Base = require('component/grid/projection/base'); var Response = require( 'component/grid/model/response'); describe('projection ColumnShifter', function () { it('update sh...
var expect = require('chai').expect; var sinon = require('sinon'); var ColumnShifter = require('component/grid/projection/column-shifter'); var Base = require('component/grid/projection/base'); var Response = require( 'component/grid/model/response'); describe('projection ColumnShifter', function () { it('update sh...
Add the test case for thClick
Add the test case for thClick
JavaScript
mit
steins024/projection-grid,steins024/projection-grid
047f2703f4d8c1cd4d4852ff48e7e5d9ef0007d7
chat-tools.meta.js
chat-tools.meta.js
// ==UserScript== // @id iitc-plugin-chat-tools@hansolo669 // @name IITC plugin: chat tools // @category Tweaks // @version 0.1.0 // @namespace https://github.com/hansolo669/iitc-tweaks // @updateURL https://iitc.reallyawesomedomain.com/chat-tools.meta.js // @downloadURL ...
// ==UserScript== // @id iitc-plugin-chat-tools@hansolo669 // @name IITC plugin: chat tools // @category Tweaks // @version 0.1.1 // @namespace https://github.com/hansolo669/iitc-tweaks // @updateURL https://iitc.reallyawesomedomain.com/chat-tools.meta.js // @downloadURL ...
Fix for intel routing changes
Fix for intel routing changes
JavaScript
mit
hansolo669/iitc-tweaks,hansolo669/iitc-tweaks
3ea41072ad831bf2a9efb4d861ad29c0e626d76e
src/Editor/DropHandler.js
src/Editor/DropHandler.js
import React from "react"; import Dropzone from "react-dropzone"; import "./DropHandler.css"; export default class DropHandler extends React.Component { handleDrop = (files) => { this.props.importSequenceFromFile(files[0]); }; render() { const { children, style, className, disabled } = this.props; re...
import React from "react"; import Dropzone from "react-dropzone"; import "./DropHandler.css"; export default class DropHandler extends React.Component { handleDrop = (files) => { this.props.importSequenceFromFile(files[0]); }; render() { const { children, style, className, disabled } = this.props; re...
Fix deprecated disableClick prop on Dropzone
Fix deprecated disableClick prop on Dropzone Ref: https://github.com/react-dropzone/react-dropzone/commit/1402362dd16a349761187a29cca356628b23b798
JavaScript
mit
TeselaGen/openVectorEditor,TeselaGen/openVectorEditor
aa7b8f693269cd68cbe7c7424bec750485fc9eb3
app/assets/javascripts/init.js
app/assets/javascripts/init.js
var init = function() { countChars(500, $('#submission_description')); countChars(500, $('#submission_goals')); countChars(255, $('#submission_problems')); menuCollapse($('#btn-menu')); } $(document).ready(init);
var init = function() { countChars(500, $('#submission_description')); countChars(500, $('#submission_goals')); countChars(255, $('#submission_problems')); menuCollapse($('#btn-menu')); } $(document).on('ready page:load', init);
Fix loading js after turbolinks load
Fix loading js after turbolinks load
JavaScript
mit
LunarLogic/rails-girls-submissions,LunarLogic/rails-girls-submissions,LunarLogic/rails-girls-submissions
951486d912dfff2eabe2f95cbbe6b3ee4950d423
src/chrome/lib/tab-store.js
src/chrome/lib/tab-store.js
(function (h) { 'use strict'; /* The tab store ensures that the current state of the browser action * is persisted between browser sessions. To do this it uses an external * storage object that conforms to the localStorage API. * * Examples * * var store = new TabStore(window.localStorage); ...
(function (h) { 'use strict'; /* The tab store ensures that the current state of the browser action * is persisted between browser sessions. To do this it uses an external * storage object that conforms to the localStorage API. * * Examples * * var store = new TabStore(window.localStorage); ...
Fix TabStore to ensure that an object is always loaded
Fix TabStore to ensure that an object is always loaded
JavaScript
bsd-2-clause
project-star/browser-extension,hypothesis/browser-extension,project-star/browser-extension,hypothesis/browser-extension,hypothesis/browser-extension,project-star/browser-extension,hypothesis/browser-extension
c657e6a53d872fa47e41be1134cde605def66e73
steps_client_1/src/main.js
steps_client_1/src/main.js
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. /* eslint-disable */ import Vue from 'vue' import axios from 'axios' import VueAxios from 'vue-axios' import VJstree from 'vue-jstree' import App from './App' import router from '...
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. /* eslint-disable */ import Vue from 'vue' import axios from 'axios' import VueAxios from 'vue-axios' import VJstree from 'vue-jstree' import App from './App' import router from '...
Add global userFullName to0 capture logged in user's name
Add global userFullName to0 capture logged in user's name
JavaScript
apache-2.0
james-cantrill/funda_components,james-cantrill/funda_components
0d9dfdb8dfe2ddf3600cbf30ee277366c5e930e3
src/containers/HomeContainer.js
src/containers/HomeContainer.js
import React, { Component, PropTypes } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as experimentsActions from '../actions/experimentsActions'; import ExperimentContainer from '../containers/ExperimentContainer'; class HomeContainer extends Component { com...
import React, { Component, PropTypes } from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import * as experimentsActions from '../actions/experimentsActions'; import ExperimentContainer from '../containers/ExperimentContainer'; const statusSort = ['Running', 'Paused', 'Not...
Add status sort for experiments
Add status sort for experiments
JavaScript
mit
zebogen/kapow-optimizely-dashboard,zebogen/kapow-optimizely-dashboard
6758c63669d9c62ee578beeab8ef09f7d3d7b31c
js/StaticAsteroids.js
js/StaticAsteroids.js
function StaticAsteroids(num, ctx) { var x; var y; var nextPt = function(pt) { var sign = Math.random() < 0.5 ? -1 : 1; return pt + (sign * Math.random() * 15); }; for(i = 0; i < num; i++){ x = Math.random() * window.innerWidth; y = Math.random() * window.innerHeight;...
function StaticAsteroids(num, ctx) { var x; var y; var nextPt = function(pt) { var sign = Math.random() < 0.5 ? -1 : 1; return pt + (sign * Math.random() * 15); }; ctx.clearRect(0,0,window.innerWidth,window.innerHeight); for(i = 0; i < num; i++){ x = Math.random() * windo...
Clear the screen between frames in asteroids
Clear the screen between frames in asteroids
JavaScript
bsd-3-clause
ku-fpg/blank-canvas-mark,ku-fpg/blank-canvas-mark
f9285f4f87d194074b02b159b0c263e7e7a20366
tests/acceptance/root-test.js
tests/acceptance/root-test.js
import { module, test, skip } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { visit } from '@ember/test-helpers'; import { run } from '@ember/runloop'; import RSVP from 'rsvp'; import DocsController from 'dummy/docs/controller'; module('Acceptance | root', function(hooks) { setupApplicati...
import { module, test, skip } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { visit } from '@ember/test-helpers'; import { run } from '@ember/runloop'; import { gte } from 'ember-compatibility-helpers'; import RSVP from 'rsvp'; import DocsController from 'dummy/docs/controller'; let Promise ...
Fix acceptance timeouts on newer Ember versions
Fix acceptance timeouts on newer Ember versions
JavaScript
mit
machty/ember-concurrency,machty/ember-concurrency,machty/ember-concurrency,machty/ember-concurrency
badc1e6bba296703a81b1601f4487403a652982a
lib/fxpay/init_module.js
lib/fxpay/init_module.js
// This is a minimal bootstrapping script that defines the fxpay // namespace and allows all other modules to require fxpay attributes. (function() { 'use strict'; if (typeof window.fxpay !== 'undefined') { throw new Error('fxpay/init_module.js must be loaded before other scripts'); } var exports = window...
// This is a minimal bootstrapping script that defines the fxpay // namespace and allows all other modules to require fxpay attributes. (function() { 'use strict'; if (typeof window.fxpay === 'undefined') { window.fxpay = {}; } var exports = window.fxpay; exports.getattr = function getattr(attr) { ...
Allow fxpay scripts to be re-entrant
Allow fxpay scripts to be re-entrant When running require JS tests the scripts seem to get reloaded. I guess that's OK.
JavaScript
bsd-3-clause
kumar303/fxpay,mozilla/fxpay,kumar303/fxpay,mozilla/fxpay
df93f4159da402969e8a18d6d525e7b0c22ca795
tasks/release.js
tasks/release.js
'use strict'; const gulp = require('gulp'); const { build } = require('electron-builder'); const config = require('../electron-builder.json'); const { getEnvName } = require('./utils'); const publish = getEnvName() !== 'production' ? 'never' : 'onTagOrDraft'; gulp.task('release:darwin', () => build({ publish, x64: tr...
'use strict'; const gulp = require('gulp'); const { build } = require('electron-builder'); const config = require('../electron-builder.json'); const { getEnvName } = require('./utils'); const publish = getEnvName() !== 'production' ? 'never' : 'onTagOrDraft'; gulp.task('release:darwin', () => build({ publish, x64: tr...
Revert "Remove Windows build for ia32 arch"
Revert "Remove Windows build for ia32 arch" This reverts commit ec504d074f02783b8e90ec149437e08f7d647bed.
JavaScript
mit
RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron,RocketChat/Rocket.Chat.Electron
cf5046403db6a0161c1bd128f0e43ae4bb13b9ec
test/test-app.js
test/test-app.js
'use strict'; var path = require('path'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); describe('pc simple ruby app', function(){ describe('default', function(){ before(function(done){ // on smaller dev machines this setup takes longer than the default 2s. this.timeou...
'use strict'; var path = require('path'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); describe('pc simple ruby app', function(){ it('will barf without arguments'); describe('default', function(){ before(function(done){ // on smaller dev machines this setup takes lo...
Add new test pending dependencies.
Add new test pending dependencies.
JavaScript
isc
PurityControl/generator-pc-simple-ruby-app,PurityControl/generator-pc-simple-ruby-app
114d1033414b99a27df24242927c9677cfc9dabd
Gruntfile.js
Gruntfile.js
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), cedict: { 'cedict.js': 'cedict_ts.u8' }, compass: { dist: { options: { require: ['animation'], sassDir: 'assets/sass', cssDir: 'assets/css' } } }...
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), cedict: { 'cedict.js': 'cedict_ts.u8' }, compass: { dist: { options: { require: ['animation'], sassDir: 'assets/sass', cssDir: 'assets/css' } } }...
Make default grunt task build entire app
Make default grunt task build entire app Change-Id: I0f3ccabd86f69c6f402b69c34addceb653398038
JavaScript
mit
odsod/lightcards,odsod/lightcards
f260f349a4f37aa52442916b3d7ac6a46f9c7c1f
background.js
background.js
var auth = new OAuth2('viame', { client_id: '3slsfzrsluzze7qs74n442wpy', client_secret: 'cjmym83dwlewqqk06bvg6x06g' }); auth.authorize(function() { // Ready for action console.log('Authorized!'); }); function displayForm(info, tab) { console.log("Clicked!"); } // Add item to context menu chrome.context...
var auth = new OAuth2('viame', { client_id: '3slsfzrsluzze7qs74n442wpy', client_secret: 'cjmym83dwlewqqk06bvg6x06g' }); setTimeout(function() { auth.authorize(function() { // Ready for action console.log('Authorized!'); }); }, 500); function displayForm(info, tab) { console.log("Clicked!"); } /...
Add delay to authorize so that client_id is not undefined
Add delay to authorize so that client_id is not undefined
JavaScript
mit
dskang/instavia.me
6aea4c82764b377471a6a79962ae540116b86a96
plugin-golang-const.js
plugin-golang-const.js
writeln('package main'); writeln('') writeln('const (') for(var k in data) { writeln('\t'+k+' = "'+data[k]+'"') } writeln(')')
// check if a const name contains a dash/dashes and replace it with an underline/underlines function createConstName(d) { return d.replace(/-/g, '_'); } // check the value type and put double quotes around if it is a string function createConstValue(d) { var value = ''; var theType = typeof d; if(theType === '...
Check type, set package name, splitted into different functions
Check type, set package name, splitted into different functions
JavaScript
mit
writescript/plugin-golang-const
47fa5253cbe0db3c37f294f573ca5346518add3e
static/js/flash-messages.js
static/js/flash-messages.js
function pybossaNotify(msg, category, fadeOut=false){ if (category === undefined) { category = "info"; } var html = $(`<div class="alert alert-${category} fade">` + `<a class="close" data-dismiss="alert" href="#">&times;</a>${msg}` + `</div>`); $('#alert-messa...
function pybossaNotify(msg, category, fadeOut=false){ if (category === undefined) { category = "info"; } msg = msg.replace(/"/g, "'"); let html = $(`<div class="alert alert-${category} fade">` + `<a class="close" data-dismiss="alert" href="#">&times;</a>${msg}` ...
Replace double with single quotes
Replace double with single quotes
JavaScript
bsd-3-clause
LibCrowds/libcrowds-pybossa-theme,LibCrowds/libcrowds-pybossa-theme,jacksongs/libcrowds-pybossa-theme,alexandermendes/BL-pybossa-theme,alexandermendes/libcrowds-pybossa-theme,jacksongs/libcrowds-pybossa-theme,alexandermendes/libcrowds-pybossa-theme,alexandermendes/BL-pybossa-theme
e1ae0d8dce58708f2c3be907a9346f545c19fbbb
externs/forge/core.ext.js
externs/forge/core.ext.js
/** * @typedef {{boot:function(), update:function()}} * @name ViewerCallbacks * @property {function} boot * @property {function} update * @property {function} beforeRender * @property {function} afterRender */ var ViewerCallbacks;
/** * @typedef {{boot:function(), update:function(), beforeRender:function(), afterRender:function()}} * @name ViewerCallbacks * @property {function} boot * @property {function} update * @property {function} beforeRender * @property {function} afterRender */ var ViewerCallbacks;
Fix bug: viewer callbacks minification not fully described
Fix bug: viewer callbacks minification not fully described
JavaScript
apache-2.0
gopro/forgejs
872cb067a7ed027ce034f3ce938d7cec253abb39
mobile-config.js
mobile-config.js
App.setPreference('BackgroundColor', '#fff'); App.setPreference('DisallowOverscroll', 'true'); App.setPreference('webviewbounce', 'false'); App.setPreference('StatusBarOverlaysWebView', 'false'); App.setPreference('StatusBarBackgroundColor', '#fff'); // App.setPreference('StatusBarStyle', 'lightcontent'); App.setPre...
App.setPreference('BackgroundColor', '#313131'); App.setPreference('DisallowOverscroll', 'true'); App.setPreference('webviewbounce', 'false'); App.setPreference('StatusBarOverlaysWebView', 'false'); App.setPreference('StatusBarBackgroundColor', '#313131'); App.setPreference('StatusBarStyle', 'lightcontent'); App.set...
Update mobile config to be dark theme
Update mobile config to be dark theme
JavaScript
apache-2.0
evancorl/portfolio,evancorl/portfolio,evancorl/skate-scenes,evancorl/skate-scenes,evancorl/portfolio,evancorl/skate-scenes
1dfe3e2288d31c6f9c326ed3fce80c8a27d60eb6
server/settings/defaultSettings.js
server/settings/defaultSettings.js
const defaults = [ { name: 'general-app-extension-worona', namespace: 'generalApp', }, { name: 'starter-app-theme-worona', namespace: 'starterTheme', }, { name: 'publish-native-app-extension-worona', namespace: 'publishNative', }, { name: 'extensions-manager-app-extension-woron...
const defaults = [ { name: 'general-app-extension-worona', namespace: 'generalApp', }, { name: 'starter-app-theme-worona', namespace: 'starterTheme', }, { name: 'publish-native-app-extension-worona', namespace: 'publishNative', }, { name: 'extensions-manager-app-extension-woron...
Add wp-org-connection as a default extension.
Add wp-org-connection as a default extension.
JavaScript
mit
worona/worona,worona/worona,worona/worona-dashboard,worona/worona-core,worona/worona-dashboard,worona/worona-core,worona/worona
471251117e29b201d0fac9c15c3ae5f76e354697
app/libs/conversion/index.js
app/libs/conversion/index.js
'use strict'; // Load requirements const engine = require('../engine'); // Configures and runs the conversion task module.exports = { run: function(job) { return new Promise((resolve, reject) => { // Check we got a file at all if ( ! job ) { return reject('No job data provided'); } ...
'use strict'; // Load requirements const engine = require('../engine'); // Configures and runs the conversion task module.exports = { run: function(job) { return new Promise((resolve, reject) => { // Check we got a file at all if ( ! job ) { return reject('No job data provided'); } ...
Correct the details being given to conversion events
Correct the details being given to conversion events
JavaScript
apache-2.0
transmutejs/core
b6d36dd1caadead4a50b5a88c416e029c9274f3b
script.js
script.js
function Pair(m, n) { this.m = m; this.n = n; } function step(m, n) { return step(new Pair(m, n)); } function step(pair) { } var first = new Pair(1,2); console.log(first);
function Pair(m, n) { this.m = m; this.n = n; } function ackermann(pair) { while (typeof pair.n != 'number') { pair = pair.n; } var m = pair.m; var n = pair.n; if (m === 0) { return n + 1; } else if (m > 0 && n === 0) { return new Pair(m - 1, 1); } else if (m > 0 && n > 0) { return...
Add code to do iterative Ackermann function
Add code to do iterative Ackermann function
JavaScript
mit
marvinkassabian/wilhelm,marvinkassabian/ackermann,marvinkassabian/ackermann,marvinkassabian/wilhelm
c9e547c94e81d515bb68262f91cc94d5537a5342
script.js
script.js
(function() { 'use strict'; var scaleFactor, canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), CANVAS_DEFAULT_WIDTH = 640, CANVAS_DEFAULT_HEIGHT = 480; (function initCanvasResizing() { var debounceTmt = null; function setCanvasSize() { var wWidth = window.innerW...
(function() { 'use strict'; var canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), canvasMetrics = { DEFAULT_WIDTH: 640, DEFAULT_HEIGHT: 480, width: null, height: null, scaleFactor: null, offsetX: null, offsetY: null, }; (function ini...
Add better canvas metrics calculation
Add better canvas metrics calculation
JavaScript
mit
zeird/canvas-basic-drag-n-drop,zeird/canvas-basic-drag-n-drop
2c76f0ac7d568bea57fc9ade9cf47581182cd8d7
test/cases/parsing/issue-11353/index.js
test/cases/parsing/issue-11353/index.js
import generator from "./generator_function.js"; import asyncGenerator from "./async_generator_function"; it('should correctly import generator function', () => { expect(typeof generator).toBe("function"); }); it('should correctly build the correct function string', () => { expect(generator.toString().indexOf('func...
"use strict"; import generator from "./generator_function.js"; import asyncGenerator from "./async_generator_function"; it('should correctly import generator function', () => { expect(typeof generator).toBe("function"); }); it('should correctly build the correct function string', () => { expect(generator.toString(...
Replace `var` with `let` to increase code consistency
Replace `var` with `let` to increase code consistency
JavaScript
mit
webpack/webpack,SimenB/webpack,SimenB/webpack,SimenB/webpack,webpack/webpack,webpack/webpack,webpack/webpack,SimenB/webpack
03aadd440d6b4d750b6076a2e240270861403765
src/config/subscriptions.js
src/config/subscriptions.js
import jwt from 'jsonwebtoken'; import { PubSub } from 'graphql-subscriptions'; import User from '../components/users/models'; export const pubsub = new PubSub(); const { JWT_SECRET } = process.env; export async function subscriptionServerOnConnect(connectionParams) { if (!connectionParams.authToken) { return...
import jwt from 'jsonwebtoken'; import { PubSub } from 'graphql-subscriptions'; import User from '../components/users/models'; export const pubsub = new PubSub(); const { JWT_SECRET } = process.env; export async function subscriptionServerOnConnect(connectionParams) { if (!connectionParams.authToken) { return...
Fix bug when JWT was expired
Fix bug when JWT was expired
JavaScript
mit
lovvedit/lovvedit,lovvedit/lovvedit,lovvedit/lovvedit
0abf40565b8a49b58c7bcee36d6a19d7799d888e
public/js/poem/edit.js
public/js/poem/edit.js
$(function() { var socket = io.connect('/'); var poemContainer = $('#poem-edit-header'); var poemId = poemContainer.data('poem-id'); var linesContainer = $('#lines'); socket.on('line-created-for-poem-' + poemId, function(poemLine) { $('<div/>', { 'class': 'line', 'text': poemLine.text })....
$(function() { var socket = io.connect('/'); var poemContainer = $('#poem-edit-header'); var poemId = poemContainer.data('poem-id'); var linesContainer = $('#lines'); var lineTextInput = poemContainer.find('.line-text'); socket.on('line-created-for-poem-' + poemId, function(poemLine) { $('<div/>', { ...
Fix browser-compability issues with scrolling and submitting
Fix browser-compability issues with scrolling and submitting
JavaScript
mit
jimguys/poemlab,jimguys/poemlab
2a11830eee806eeb8ce2a6646d0b2ec9e92f8e2c
test/virtual-output-test.js
test/virtual-output-test.js
var midi = require("../build/default/midi.node"); var output = new midi.output(); output.openVirtualPort("node-midi Virtual Output"); output.sendMessage([176,22,1]); output.sendMessage([176,22,99]); setTimeout(function() { output.closePort(); }, 10000);
var midi = require("../build/default/midi.node"); var output = new midi.output(); output.openVirtualPort("node-midi Virtual Output"); setTimeout(function() { output.sendMessage([144,64,90]); }, 10000); setTimeout(function() { output.sendMessage([128,64,40]); }, 15000); setTimeout(function() { output.closePort();...
Update the virtual output test file to take some time between messages so the results are visible.
Update the virtual output test file to take some time between messages so the results are visible.
JavaScript
mit
justinlatimer/node-midi,Cycling74/node-midi,brandly/node-midi,brandly/node-midi,Cycling74/node-midi,julianduque/node-midi,justinlatimer/node-midi,Cycling74/node-midi,brandly/node-midi,Cycling74/node-midi,julianduque/node-midi,Cycling74/node-midi,szymonkaliski/node-midi,justinlatimer/node-midi,drewish/node-midi,szymonka...
93082d3fd655ae9560caa050bedabdc5975f5703
tests/unit/helpers/index.js
tests/unit/helpers/index.js
/* * @fileoverview Test helpers. * * The modules imported here may have side effects and the import order is * important. */ import { unmount } from './rendering.js'; import './expect.js'; import './react-warnings.js'; // Unmount the currently mounted component after each test. afterEach(function() { unmount()...
/* * @fileoverview Test helpers. * * The modules imported here may have side effects and the import order is * important. */ import './react-warnings.js'; import { unmount } from './rendering.js'; import './expect.js'; // Unmount the currently mounted component after each test. afterEach(function() { unmount()...
Make sure we catch React warnings even before it's used
Make sure we catch React warnings even before it's used React 16 is now throwing a warning when requestAnimationFrame is not present when requiring the module.
JavaScript
mit
NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet,NiGhTTraX/react-test-buffet
3b0fb7fa7d2275fded891ee42ca1d8deeeaa1647
src/views/PosterVideos.js
src/views/PosterVideos.js
import React, { Component } from 'react'; import { Helmet } from 'react-helmet'; class PosterVideos extends Component { render() { return ( <div> <Helmet> <title>PosterVideos | Resource Center</title> </Helmet> <h1>PosterVideos View</h1> </div> ); } } export d...
import React, { Component } from 'react'; import { Helmet } from 'react-helmet'; import '../styles/video.scss' class PosterVideos extends Component { render() { return ( <div className='container'> <div className="row"> <div className="col s12 flow-text"> <Helmet> ...
Add page for poster videos
Add page for poster videos
JavaScript
mit
user1990/react-resource-center,user1990/react-resource-center
083552fcd365660430a3bf74177b948cff983f0c
src/promise-array.js
src/promise-array.js
import {Observable} from 'rx'; export function asyncMap(array, selector) { return Observable.from(array) .map((k) => Observable.defer(() => Observable.fromPromise(selector(k)) .map((v) => ({ k, v })))) .merge(4) .reduce((acc, kvp) => { acc[kvp.k] = kvp.v; return acc;...
import {Observable} from 'rx'; export function asyncMap(array, selector, maxConcurrency=4) { return Observable.from(array) .map((k) => Observable.defer(() => Observable.fromPromise(selector(k)) .map((v) => ({ k, v })))) .merge(maxConcurrency) .reduce((acc, kvp) => { acc[kvp....
Add an optional way to limit concurrency
Add an optional way to limit concurrency
JavaScript
mit
surf-build/surf,surf-build/surf,surf-build/surf,surf-build/surf
2364d568cde0b70f8982b89f900df69dbcea083a
routes/cosimg.js
routes/cosimg.js
var Cosimg = require('../models/cosimg'); var express = require('express'); var router = express.Router(); //retrieve all router.route('/cosimg').get(function (req, res) { Cosimg.find({}).exec(function (err, data) { if(err) { return res.send(err); } res.json(data); }); }); //add new router.route('/cosimg')...
var Cosimg = require('../models/cosimg'); var express = require('express'); var router = express.Router(); //retrieve all router.route('/cosimgs').get(function (req, res) { Cosimg.find({}).exec(function (err, data) { if(err) { return res.send(err); } res.json(data); }); }); //add new router.route('/cosimgs...
Fix routes, add new ones
Fix routes, add new ones
JavaScript
mit
harunurhan/open-cosmics-mean,harunurhan/open-cosmics-mean
1819fa5341e6fba04fcddcff0acf0b242fc7bc09
ww/unpackbits.js
ww/unpackbits.js
onmessage = function(e) { var command = e.command; var packed = command.compressedBytes; var buf_length = packed.length; var buf_pos = 0; var buf = new Uint8Array(buf); function checkOutputSpace(n) { if (buf_pos + n > buf_length) { buf_length *= 2; var new_buf = new Uint8Array(buf_length); ...
onmessage = function(e) { var command = e.command; var packed = command.compressedBytes; var buf_length = packed.length; var buf_pos = 0; var buf = new Uint8Array(buf); function checkOutputSpace(n) { if (buf_pos + n > buf_length) { buf_length *= 2; var new_buf = new Uint8Array(buf_length); ...
Simplify signed byte calc to a unsigned one
Simplify signed byte calc to a unsigned one
JavaScript
mit
radishengine/drowsy,radishengine/drowsy
1c0131cffce6df412e5aaa274bce7fea26e4ffcd
server/routes.js
server/routes.js
WebApp.connectHandlers.use("/package", function (request, response) { var pkgName = request.url.split('/')[1]; Meteor.call('getPackageParams', pkgName, {graph: true}, function (err, params) { if (err) { console.log('Error occurred while getting package params', err); return response.end(err.message...
// Check that a string is truthy and not equal to 'false' function toBoolean(str) { return str && str !== 'false'; } WebApp.connectHandlers.use("/package", function (req, res) { var pkgName = req._parsedUrl.pathname.split('/')[2]; var options = { graph: toBoolean(req.query.graph) }; Meteor.call('getPack...
Make graph and score optional
Make graph and score optional
JavaScript
mit
sungwoncho/meteor-icon,sungwoncho/meteor-icon
41ac80358789cf4daa88949cbaf1de03d83f8117
server/schema.js
server/schema.js
var mongoose = require('mongoose') var classification = { author: String, buyer: {_id: mongoose.Schema.Types.ObjectId, name: String}, billing: {_id: mongoose.Schema.Types.ObjectId, name: String}, format: String, duration: String, // for now matches a regexp in the client safe: Boolean, criteria: [Number]...
var mongoose = require('mongoose') var classification = { author: String, buyer: {_id: mongoose.Schema.Types.ObjectId, name: String}, billing: {_id: mongoose.Schema.Types.ObjectId, name: String}, format: String, duration: String, // for now matches a regexp in the client safe: Boolean, criteria: [Number]...
Index on production_companies and account
Index on production_companies and account
JavaScript
mit
kavi-fi/meku,kavi-fi/meku,kavi-fi/meku
9382882122ecfae6b525b5279de4042f330e9015
routes/routes.js
routes/routes.js
var artistController = require('../controllers/artist-controller'); var genreController = require('../controllers/genre-controller'); module.exports = function(app, passport) { app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' })); app.get('/auth/facebook/callback', passport.authenti...
var artistController = require('../controllers/artist-controller'); var genreController = require('../controllers/genre-controller'); var queue = require('../workers/queue'); module.exports = function(app, passport) { app.get('/auth/facebook', passport.authenticate('facebook', { scope : ['email', 'user_likes'] })); ...
Change permissions and add ability to make jobs
Change permissions and add ability to make jobs
JavaScript
mit
kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender,kurtbradd/facebook-music-recommender
34baa145a63d7b998787248abbc835d005986188
client/helpers/getCourses.js
client/helpers/getCourses.js
var _ = require('lodash') var Promise = require("bluebird") var time = require('../helpers/time') window.courseCache = {} function getCourse(clbid) { return new Promise(function(resolve, reject) { if (_.contains(courseCache, clbid)) { console.log('course cached:', clbid) resolve(window.courseCache[clbid]) ...
var _ = require('lodash') var Promise = require("bluebird") var time = require('../helpers/time') window.courseCache = {} function getCourse(clbid) { return new Promise(function(resolve, reject) { if (_.contains(_.keys(window.courseCache), String(clbid))) { console.log('course cached:', clbid) resolve(windo...
Check the course cache against the keys of the course cache
Check the course cache against the keys of the course cache
JavaScript
agpl-3.0
hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook
355603d31c5407e038572c2efe2d6052eb276061
_source/scripts/tabs/index.js
_source/scripts/tabs/index.js
export default function normalizeTabControllerClick() { const hashLinks = document.querySelectorAll(".js-tabs-control a[href^='#']"); const firstLink = document.querySelector('.js-tabs-control > a'); Array.prototype.forEach.call(hashLinks, (link) => { link.addEventListener('click', (event) => { event.preventDe...
export default function normalizeTabControllerClick() { const hashLinks = document.querySelectorAll(".js-tabs-control a[href^='#']"); const firstLink = document.querySelector('.js-tabs-control > a'); function setActiveLink(event) { Array.prototype.forEach.call(hashLinks, (link) => { link.classList.remove('acti...
Implement an array class for clicked tabs
Implement an array class for clicked tabs
JavaScript
mit
AppCivico/DOnM-2017-www,AppCivico/DOnM-2017-www
45eaa7a5b0d68d7d7da656f289530dba8de4a77c
addon/adapters/application.js
addon/adapters/application.js
import { inject as service } from '@ember/service'; import DS from 'ember-data'; import config from 'dummy/config/environment'; export default DS.Adapter.extend({ namespace: `${config.rootURL.replace(/\/$/, '')}/docs`, projectVersion: service(), project: null, shouldBackgroundReloadAll() { return false...
import { inject as service } from '@ember/service'; import DS from 'ember-data'; import config from 'dummy/config/environment'; export default DS.Adapter.extend({ namespace: `${config.rootURL.replace(/\/$/, '')}/docs`, ajax: service(), shouldBackgroundReloadAll() { return false; }, shouldBackgroundRe...
Replace fetch with ajax service
[bugfix] Replace fetch with ajax service
JavaScript
mit
ember-learn/ember-cli-addon-docs,ember-learn/ember-cli-addon-docs,ember-learn/ember-cli-addon-docs
7848ac18034487d429300e3c2c1a2bfcca1b715c
src/scenes/artist-wizard.js
src/scenes/artist-wizard.js
const { Markup } = require('telegraf'); const { WizardScene } = require('telegraf-flow'); const artistWizard = new WizardScene('artistWizard', (ctx) => { ctx.reply( 'Send me the artist name please', Markup.removeKeyboard().extra() ); ctx.flow.wizard.next(); }, (ctx) => { ctx.session.a...
const { Markup } = require('telegraf'); const { WizardScene } = require('telegraf-flow'); const artistWizard = new WizardScene('artistWizard', (ctx) => { ctx.reply( 'Send me the artist name please', Markup.removeKeyboard().extra() ); ctx.flow.wizard.next(); }, (ctx, next) => { if (ctx...
Fix query handling in wizard scene
Fix query handling in wizard scene
JavaScript
mit
TheBeastOfCaerbannog/last-fm-bot
c79f02fe4867f2fb477abfaf7ac2448189444495
book.js
book.js
var pkg = require('./package.json'); module.exports = { // Documentation for GitBook is stored under "docs" root: './docs', title: 'GitBook Documentation', // Enforce use of GitBook v3 gitbook: pkg.version, // Use the "official" theme plugins: ['theme-official'], theme: 'official', ...
var pkg = require('./package.json'); module.exports = { // Documentation for GitBook is stored under "docs" root: './docs', title: 'GitBook Documentation', // Enforce use of GitBook v3 gitbook: pkg.version, // Use the "official" theme plugins: ['theme-official', 'sitemap'], theme: 'of...
Add sitemap plugin for docs
Add sitemap plugin for docs
JavaScript
apache-2.0
gencer/gitbook,gencer/gitbook,tshoper/gitbook,ryanswanson/gitbook,strawluffy/gitbook,tshoper/gitbook,GitbookIO/gitbook
bb57f869067cfde9335ae5eb020d664e2e29d3e4
elements/Shape.js
elements/Shape.js
import { Component } from "react"; import SvgTouchableMixin from "../lib/SvgTouchableMixin"; import _ from "lodash"; class Shape extends Component { constructor() { super(...arguments); _.forEach(SvgTouchableMixin, (method, key) => { this[key] = method.bind(this); }); //...
import { Component } from "react"; import SvgTouchableMixin from "../lib/SvgTouchableMixin"; import _ from "lodash"; class Shape extends Component { constructor() { super(...arguments); _.forEach(SvgTouchableMixin, (method, key) => { if (typeof method === 'function') { t...
Fix compat with latest RN master
Fix compat with latest RN master The code in the Shape constructor assumes that `SvgTouchableMixin` contains only functions but [this](https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/Touchable.js#L904) was added which breaks this assumption. This simply makes sure whatever we ass...
JavaScript
mit
react-native-community/react-native-svg,magicismight/react-native-svg,magicismight/react-native-art-svg,msand/react-native-svg,react-native-community/react-native-svg,magicismight/react-native-svg,magicismight/react-native-art-svg,magicismight/react-native-svg,msand/react-native-svg,magicismight/react-native-svg,magici...
f5c366756443512e42d5839c75f305d1904f6933
src/js/components/form/FormGroup.js
src/js/components/form/FormGroup.js
import classNames from 'classnames/dedupe'; import React from 'react'; import FieldError from './FieldError'; import Util from '../../utils/Util'; const FormGroup = (props) => { let {children, className, errorClassName, showError, required} = props; let clonedChildren = React.Children.map(children, (child) => { ...
import classNames from 'classnames/dedupe'; import React from 'react'; import FieldError from './FieldError'; import Util from '../../utils/Util'; const FormGroup = (props) => { let {children, className, errorClassName, showError, required} = props; let clonedChildren = React.Children.map(children, (child) => { ...
Add exit condition to map if child is not defined
Add exit condition to map if child is not defined
JavaScript
apache-2.0
dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui
818a5c88d692d6c133e89babf3d5877a3f266752
modules/fileCollector.js
modules/fileCollector.js
/* * Files Module */ var path = require("path"), fs = require("fs"); function file (path) { // Get information about the file // Name // Size // Created // Modified // mime-type return { }; } exports.fileCollector = function fileCollector (directory) { path.exists(directory...
/* * Files Module */ var path = require("path"), fs = require("fs"), Emitter = require("events").eventEmitter, util = require("util"); function File (path) { Emitter.call(this); // Get information about the file // Name // Size // Created // Modified // mime-type return { ...
Add EventEmitter to file collector
Add EventEmitter to file collector
JavaScript
mit
btleffler/node-file-list,btleffler/node-file-list
ebf8d2dfda7e919dbe6beabc70a11e0ba243b7a2
routes/posts.js
routes/posts.js
import styleBody from 'ghost/mixins/style-body'; import AuthenticatedRoute from 'ghost/routes/authenticated'; var paginationSettings = { status: 'all', staticPages: 'all', page: 1, limit: 15 }; var PostsRoute = AuthenticatedRoute.extend(styleBody, { classNames: ['manage'], model: function () ...
import styleBody from 'ghost/mixins/style-body'; import AuthenticatedRoute from 'ghost/routes/authenticated'; var paginationSettings = { status: 'all', staticPages: 'all', page: 1 }; var PostsRoute = AuthenticatedRoute.extend(styleBody, { classNames: ['manage'], model: function () { // us...
Remove limit from ember post API calls
Remove limit from ember post API calls ref #3004 - this is unnecessary and causing bugs
JavaScript
mit
dbalders/Ghost-Admin,TryGhost/Ghost-Admin,acburdine/Ghost-Admin,acburdine/Ghost-Admin,airycanon/Ghost-Admin,JohnONolan/Ghost-Admin,TryGhost/Ghost-Admin,JohnONolan/Ghost-Admin,kevinansfield/Ghost-Admin,airycanon/Ghost-Admin,kevinansfield/Ghost-Admin,dbalders/Ghost-Admin
a8ea532493d359ef9d24ce97e9b061999e8af6d0
app/index.js
app/index.js
const _ = require('lodash') const glob = require('glob') const bodyParser = require('body-parser') const cookieParser = require('cookie-parser') const config = require(`${process.cwd()}/config/application`) // Set default environment to 'development' global.__ENV__ = process.env.NODE_ENV || 'development' global.__DEV...
const _ = require('lodash') const glob = require('glob') const bodyParser = require('body-parser') const cookieParser = require('cookie-parser') const config = require(`${process.cwd()}/config/application`) // Set default environment to 'development' global.__ENV__ = process.env.NODE_ENV || 'development' global.__DEV...
Enable `trust proxy` setting in ExpressJS.
Enable `trust proxy` setting in ExpressJS.
JavaScript
mit
passabilities/backrest
274c9cb366eee7f1b1cb2ddf7497a590f5afe29d
src/utils/deprecationWarning.js
src/utils/deprecationWarning.js
function warn(message) { if (window.console && (typeof console.warn === 'function')) { console.warn(message); } } export default function deprecationWarning(oldname, newname, link) { if (process.env.NODE_ENV !== 'production') { let message = `${oldname} is deprecated. Use ${newname} instead.`; warn(m...
export default function deprecationWarning(oldname, newname, link) { if (process.env.NODE_ENV !== 'production') { if (!window.console && (typeof console.warn !== 'function')) { return; } let message = `${oldname} is deprecated. Use ${newname} instead.`; console.warn(message); if (link) { ...
Refactor check for IE9 console.
Refactor check for IE9 console. That way the additional IE9 checking code will be stripped out in production.
JavaScript
mit
dozoisch/react-bootstrap,deerawan/react-bootstrap,victorzhang17/react-bootstrap,jesenko/react-bootstrap,roderickwang/react-bootstrap,Sipree/react-bootstrap,collinwu/react-bootstrap,erictherobot/react-bootstrap,AlexKVal/react-bootstrap,wjb12/react-bootstrap,insionng/react-bootstrap,yickli/react-bootstrap,brentertz/react...
a8be9585661bded5666c76399e5841bea21fcf20
config/ember-try.js
config/ember-try.js
module.exports = { scenarios: [ { name: 'Ember 1.11.3', dependencies: { 'ember': '1.11.3' } }, { name: 'Ember 1.12.0', dependencies: { 'ember': '1.12.0' } }, { name: 'Ember Canary', dependencies: { 'ember': 'canary' }, ...
module.exports = { scenarios: [ // Ember 1.11.1 appears to work, but there is a testing // issue where previous elements are not cleaned up. // { // name: 'Ember 1.11.1', // dependencies: { // 'ember': '1.11.1' // } // }, { name: 'Ember 1.12.0', dependencies: ...
Add caveat for Ember 1.11 testing
Add caveat for Ember 1.11 testing
JavaScript
mit
mitchlloyd/ember-islands,praxxis/ember-islands,praxxis/ember-islands,mitchlloyd/ember-islands
6b12beac43af2e951a0775eaf07848c1cd2211bf
config/express.js
config/express.js
var express = require('express'), bodyParser = require('body-parser'), session = require('express-session'), passport = require('passport'), jwt = require('jwt-simple'); var User = require('../app/models/user.server.model'); module.exports = function() { var app = express(); // Use middleware a...
var express = require('express'), bodyParser = require('body-parser'), session = require('express-session'), passport = require('passport'), jwt = require('jwt-simple'); var User = require('../app/models/user.server.model'); module.exports = function() { var app = express(); // Use middleware a...
Use process.cwd() to serve static files
Use process.cwd() to serve static files
JavaScript
mit
andela-tsolarin/disgui.se,andela-tsolarin/disgui.se
b7a1f73f0162eb707d1437baf5a05ec1047dc0c4
validators/credit-card.js
validators/credit-card.js
'use strict'; var stringValidator = require('validator'); exports = module.exports = { validator: function (val) { if (val) { return stringValidator.isCreditCard(val); } return true; }, message: '<%= propertyName %> is not a valid credit card number.' };
'use strict'; /** * Validate credit card number. * This is a modified version of github.com/chriso/validator.js `isCreditCard`, * the difference is this version does not run the creditcard regex test, some * valid credit card numbers in Indonesia does not pass the regex test. * https://github.com/chriso/validator...
Use modified version of chriso/validator isCreditCard function
Use modified version of chriso/validator isCreditCard function
JavaScript
mit
cermati/satpam,sendyhalim/satpam
00e8b4876c9d59e21706ebf6686d3202bc6d6af1
image_occlusion_enhanced/svg-edit/svg-edit-2.6/extensions/ext-panning.js
image_occlusion_enhanced/svg-edit/svg-edit-2.6/extensions/ext-panning.js
/*globals svgEditor, svgCanvas*/ /*jslint eqeq: true*/ /* * ext-panning.js * * Licensed under the MIT License * * Copyright(c) 2013 Luis Aguirre * */ /* This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem */ svgEditor.addExtension('ext-panning', function() {'use stri...
/*globals svgEditor, svgCanvas*/ /*jslint eqeq: true*/ /* * ext-panning.js * * Licensed under the MIT License * * Copyright(c) 2013 Luis Aguirre * */ /* This is a very basic SVG-Edit extension to let tablet/mobile devices panning without problem */ svgEditor.addExtension('ext-panning', function() {'use stri...
Add 'Q' as a hotkey for panning
Add 'Q' as a hotkey for panning
JavaScript
bsd-2-clause
Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-2-enhanced,Glutanimate/image-occlusion-enhanced,Glutanimate/image-occlusion-2-enhanced
f976b970bcd4d89777e130d5d89f8ef3dae9813e
app/markup.js
app/markup.js
export default ({children, links, typekitKey, title, gaKey, appContent, styletronSheets, meta}) => { return ( <html lang="en"> <head> <title>{title}</title> {meta ? meta.map(attrs => <meta {...attrs}/>) : ''} {styletronSheets.map(sheet => <style className="styletron" media={sheet.media} dangerouslySetIn...
export default ({children, links, typekitKey, title, gaKey, appContent, styletronSheets, meta}) => { return ( <html lang="en"> <head> <title>{title}</title> {meta ? meta.map(attrs => <meta {...attrs}/>) : ''} {styletronSheets.map(sheet => <style className="styletron" media={sheet.media} dangerouslySetIn...
Replace typekit script with css
Replace typekit script with css
JavaScript
mit
rtsao/hokusai
8fd84160fa6bb7ebf8d37fe22083e9a1ef42fedb
src/cameraman.js
src/cameraman.js
var cameraman = null; function CameraMan(id) { var _self = this; this.id = id; this.getApp = function () { var name = _self.id; return (navigator.appName.indexOf ("Microsoft") != -1 ? window : document)[name]; }; this.takePhoto = function () { _self.getApp().takePhoto(); ...
var cameraman = null; function CameraMan(opts) { var _self = this; this.options = opts; this.id = opts.id; this.getApp = function () { var name = _self.id; return (navigator.appName.indexOf ("Microsoft") != -1 ? window : document)[name]; }; this.takePhoto = function () { ...
Create a camera using options with callbacks, not just an id
Create a camera using options with callbacks, not just an id
JavaScript
mit
markpasc/cameraman
cd19ed73098900c1d9da77563f484eae00405041
api/server.js
api/server.js
import jsonServer from 'json-server'; import db from './db'; const port = 3004; const server = jsonServer.create(); const router = jsonServer.router(db()); // default middlewares server.use(jsonServer.defaults()); // router middleware server.use(router); server.listen(port); console.log(`Api server listening on po...
import jsonServer from 'json-server'; import db from './db'; const port = 3004; const server = jsonServer.create(); const router = jsonServer.router(db()); // default middlewares server.use(jsonServer.defaults()); // Add a delay for 1 second to /articles requests only server.use('/articles', function(req, res, next...
Add a delay for 1 second to /articles requests
Add a delay for 1 second to /articles requests
JavaScript
mit
suranartnc/react-tutorial,suranartnc/react-redux-universal-starter-kit
d7028d11382db9b6b2552a5f85936acd0d5471e9
app/controllers/transcript.js
app/controllers/transcript.js
// // Transcript Controller // 'use strict'; var _ = require('lodash'); module.exports = function() { var app = this.app, core = this.core, middlewares = this.middlewares, models = this.models, Room = models.room, User = models.user; // // Routes ...
// // Transcript Controller // 'use strict'; var _ = require('lodash'); module.exports = function() { var app = this.app, core = this.core, middlewares = this.middlewares, models = this.models, Room = models.room, User = models.user; // // Routes ...
Return 404 if room is not found or errs out
Return 404 if room is not found or errs out
JavaScript
mit
cesarmarinhorj/lets-chat,stonegithubs/lets-chat,aaryn101/lets-chat,ga-wdi-boston/lets-chat,alexisaperez/lets-chat,ibuildthecloud/lets-chat,glomb226/lets-chat,fabric8io/lets-chat,jparyani/lets-chat,lihuanghai/lets-chat,webkaz/lets-chat,fallacy321/lets-chat,galal-hussein/lets-chat,evdevgit/lets-chat,neynah/lets-chat,ibui...
139f213bdd084703a90fc67a9953a629a82e11e9
src/fix-title.js
src/fix-title.js
(function (document, window, undefined) { // First, check if we have to do anything if (window.location.href.match(/\/compare\//i)) { // Get the title and comment field: var title_field = document.querySelector('[name="pull_request[title]"]'), comment_field = document.querySelector...
(function (document, window, undefined) { function initFixTitle() { // First, check if we have to do anything if (window.location.href.match(/\/compare\//i)) { // Get the title and comment field: var title_field = document.querySelector('[name="pull_request[title]"]'), ...
Fix for title bug, only happens at pageload, not before.
Fix for title bug, only happens at pageload, not before.
JavaScript
mit
jeroenvisser101/git-flow-on-github,jeroenvisser101/git-flow-on-github
e5198fea40ab93f1f1ba02e0d0b41efeffd9f9e6
src/text/TextItem.js
src/text/TextItem.js
/* * Paper.js * * This file is part of Paper.js, a JavaScript Vector Graphics Library, * based on Scriptographer.org and designed to be largely API compatible. * http://paperjs.org/ * http://scriptographer.org/ * * Distributed under the MIT license. See LICENSE file for details. * * Copyright (c) 2011, Juerg ...
/* * Paper.js * * This file is part of Paper.js, a JavaScript Vector Graphics Library, * based on Scriptographer.org and designed to be largely API compatible. * http://paperjs.org/ * http://scriptographer.org/ * * Distributed under the MIT license. See LICENSE file for details. * * Copyright (c) 2011, Juerg ...
Remove unused code that seems to stem from PointText.
Remove unused code that seems to stem from PointText.
JavaScript
mit
chad-autry/paper.js,ClaireRutkoske/paper.js,li0t/paper.js,rgordeev/paper.js,EskenderDev/paper.js,proofme/paper.js,Olegas/paper.js,rgordeev/paper.js,Olegas/paper.js,luisbrito/paper.js,li0t/paper.js,fredoche/paper.js,fredoche/paper.js,legendvijay/paper.js,proofme/paper.js,iconexperience/paper.js,luisbrito/paper.js,Olegas...
7bf9d4e68487843ce8848323fed31a72554238ba
array/basic-use/app-finish.js
array/basic-use/app-finish.js
'use strict' let productInCart = ['ของเล่น','ข้าวสาร','กระทะเกาหลี']; console.log(productInCart); console.log(productInCart[0]); console.log(productInCart[1]); console.log(productInCart[2]); // console.log(productInCart[3]); productInCart[2] = "กระทะทองแดง"; console.log(productInCart[2]); console.log(productInCart);...
'use strict' let productInCart = ['ของเล่น','ข้าวสาร','กระทะเกาหลี']; console.log(productInCart); console.log(productInCart[0]); console.log(productInCart[1]); console.log(productInCart[2]); // console.log(productInCart[3]); console.log("After update value..."); productInCart[2] = "กระทะทองแดง"; console.log(productI...
Add more detail to output
Add more detail to output
JavaScript
apache-2.0
teerasej/training-javascript-es6-beginner-thai
5f2cad61aeb53edbb0e182f9a28f5887fec4141b
config/webpack.dev.js
config/webpack.dev.js
const _ = require('lodash'); const path = require('path'); const WebpackConfig = require('./webpack.config'); module.exports = (entry, output) => { return _.merge({}, WebpackConfig, { mode: 'development', entry: `./lib/${entry}`, output: { path: path.resolve(__dirname, '../dist'), filename: o...
const _ = require('lodash'); const path = require('path'); const WebpackConfig = require('./webpack.config'); module.exports = (entry, output) => { return _.merge({}, WebpackConfig, { mode: 'development', entry: `./lib/${entry}`, output: { library: 'Formio', libraryTarget: 'umd', librar...
Make Webpack builds export correctly and use umd.
Make Webpack builds export correctly and use umd.
JavaScript
mit
formio/formio.js,formio/formio.js,formio/formio.js
7244994bea5568dafdcb663d0239e6729ac3a003
src/main/webapp/scripts/counter.js
src/main/webapp/scripts/counter.js
let counter = (function(value = 0) { const getValue = function() { return value; } const changeBy = function (n) { if (isNaN(n)) { throw `${n} is not a number`; } value += n; return value; } const add = function(n) { return changeBy(n); } const subtract = function(n) { ...
let counter = (function(value = 0) { const getValue = function() { return value; } const changeBy = function (n) { if (isNaN(n)) { throw `${n} is not a number`; } value += n; return value; } const add = function(n) { return changeBy(n); } const subtract = function(n) { ...
Add timeout and fix logic
Add timeout and fix logic
JavaScript
apache-2.0
googleinterns/step36-2020,googleinterns/step36-2020,googleinterns/step36-2020
7f3a3d80724f8e88bca92b7a2954ee5f19b7c5a4
2020/day3/day3.js
2020/day3/day3.js
const fs = require('fs') const input = fs.readFileSync('2020/day3/day3.txt', 'utf8') const lines = input.split(/\r?\n/) let width = lines[0].length, result = 0, index = 0 for (let line of lines) { if (line.charAt(index) == '#') result++ index = (index + 3) % width; } console.log(result);
const fs = require('fs') const input = fs.readFileSync('2020/day3/day3.txt', 'utf8') const lines = input.split(/\r?\n/) let width = lines[0].length, results = [0, 0, 0, 0, 0], indices = [0, 0, 0, 0, 0], i for (let i = 0; i < lines.length; i++) { if (lines[i].charAt(indices[0]) == '#') results[0]++ indices[0] = ...
ADD solution for day 3_2
ADD solution for day 3_2
JavaScript
bsd-3-clause
grubFX/AdventOfCode,grubFX/AdventOfCode
4480306084a6521bd49486632779a10207655af7
lib/ResponseMiddleware.js
lib/ResponseMiddleware.js
var mkdirp = require('mkdirp'); var fs = require('fs'); var getDirName = require('path').dirname; function serialize(response) { return { status: response.status, statusText: response.statusText, headers: response.headers, data: response.data } } function store(path, payload) { mkdirp.sync(getDi...
var mkdirp = require('mkdirp'); var fs = require('fs'); var getDirName = require('path').dirname; function serialize(response) { return { status: response.status, statusText: response.statusText, headers: response.headers, data: response.data } } function store(path, payload) { mkdirp.sync(getDi...
Store pretty printed version of cassete
Store pretty printed version of cassete
JavaScript
mit
nettofarah/axios-vcr
921b07de15deeb9b392aed9c0fe3aa92d4a592ac
src/redirects.js
src/redirects.js
export function setupRedirects(server) { server.route({ method: 'GET', path: '/blog/modified/{year}', handler: function (request, reply) { reply.redirect(`/blog/posted/${request.params.year}`).permanent(); } }); // Note that I'm intentionally not using the stripTrailingSlash: true option b...
export function setupRedirects(server) { server.route({ method: 'GET', path: '/blog/modified/{year}', handler: function (request, reply) { reply.redirect(`/blog/posted/${request.params.year}`).permanent(); } }); server.route({ method: 'GET', path: '/blog/id/{id}', handler: func...
Support /blog/id/{id} redirect to /blog/{id}
Support /blog/id/{id} redirect to /blog/{id}
JavaScript
mit
bbondy/brianbondy.node,bbondy/brianbondy.node,bbondy/brianbondy.node
ec730c930c5776cc528e6c26cfd9287f14b458df
lib/post-json-receiver.js
lib/post-json-receiver.js
module.exports = function (req, res, next, callback) { let ctype = req.get('Content-Type') let done = false if (ctype !== 'application/json') { res.status(415) res.send('Content type incorrect.') done = true return } let body = '' req.setEncoding('utf8') req.on('data', chunk => { if (d...
const express = require('express') let jsonMiddlew = express.json({ limit: 15000000, strict: true }) module.exports = function (req, res, next, callback) { jsonMiddlew(req, res, function (err) { if (err) { next(err) return } let parsed = req.body if (typeof parsed !== 'object') { ...
Use express built-in json body middleware instead of doing the parsing work ourselves.
Use express built-in json body middleware instead of doing the parsing work ourselves.
JavaScript
mit
micromaomao/schsrch,micromaomao/schsrch,micromaomao/schsrch,micromaomao/schsrch
932d8ceec542d631ba5f8f89589ffe6072da2042
app/assets/javascripts/time.js
app/assets/javascripts/time.js
$(function () { $('.time').each(function (i, el) { if ($.trim(el.innerHTML) === '0') { el.innerHTML = '-'; } else { el.innerHTML = numeral(el.innerHTML).format('00:00:00'); } }); });
$(function () { $('.time').each(function (i, el) { if ($.trim(el.innerHTML) === '0') { el.innerHTML = '-'; } else { el.innerHTML = numeral(Math.floor(el.innerHTML)).format('00:00:00'); } }); });
Fix seconds rounding up instead of truncating
Fix seconds rounding up instead of truncating
JavaScript
agpl-3.0
BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,glacials/splits-io,glacials/splits-io
13e69500a0a908dbe0f3a3e262000908ae610707
src/validator.js
src/validator.js
import { parse } from 'graphql'; import { validate } from 'graphql/validation'; import { buildASTSchema } from 'graphql/utilities/buildASTSchema'; import { GraphQLError } from 'graphql/error'; export function validateSchemaDefinition( schemaDefinition, rules, configuration ) { let ast; try { ast = parse(...
import { parse } from 'graphql'; import { validate } from 'graphql/validation'; import { buildASTSchema } from 'graphql/utilities/buildASTSchema'; import { GraphQLError } from 'graphql/error'; export function validateSchemaDefinition( schemaDefinition, rules, configuration ) { let ast; try { ast = parse(...
Build schema by passing commentDescriptions
Build schema by passing commentDescriptions
JavaScript
mit
cjoudrey/graphql-schema-linter
f2b85731f229856ad6f062d843021fd9676a3045
src/shortlink.js
src/shortlink.js
"use strict"; const valid_uri = require("valid-url").isUri; const mongoose = require("mongoose"); mongoose.Promise = global.Promise; const Schema = mongoose.Schema; module.exports = mongoose.model("Shortlink", new Schema({ path: { type: String, required: true, minlength: 1, index: true, uniqu...
"use strict"; const valid_uri = require("valid-url").isUri; const mongoose = require("mongoose"); mongoose.Promise = global.Promise; const Schema = mongoose.Schema; module.exports = mongoose.model("Shortlink", new Schema({ path: { type: String, required: true, minlength: 1, index: true, uniqu...
Add validation rule for status_code
Add validation rule for status_code
JavaScript
mit
jotaen/j4n.io,jotaen/j4n.io
d7cf3a4552570d0e44517768be80d43083e2e20e
main.js
main.js
(function () { document.querySelectorAll('img').forEach(function (img) { chrome.storage.sync.get(null, function (items) { if (items.data) { items.data.forEach(function (switcher) { if (img.src.startsWith(switcher.from)) { img.src = swit...
(function () { function switchImages() { document.querySelectorAll('img').forEach(function (img) { chrome.storage.sync.get(null, function (items) { if (items.data) { items.data.forEach(function (switcher) { if (img.src.startsWith(switch...
Switch the image if there is a change in the DOM.
Switch the image if there is a change in the DOM.
JavaScript
mit
starhoshi/ImageSwitcher,novogrammer/ImageSwitcher,novogrammer/ImageSwitcher,starhoshi/ImageSwitcher
8648336c74af90f9fabd9530f28243506fec8258
app/elements/semesterDetail.js
app/elements/semesterDetail.js
import * as React from 'react' import {State} from 'react-router' let SemesterDetail = React.createClass({ mixins: [State], render() { return React.createElement('div', null, JSON.stringify(this.getPath())) }, }) export default SemesterDetail
import * as React from 'react' import * as Immutable from 'immutable' import {State} from 'react-router' import {isCurrentSemester} from 'app/helpers/isCurrent' let SemesterDetail = React.createClass({ mixins: [State], propTypes: { student: React.PropTypes.object.isRequired, }, getInitialState: function() { ...
Implement phase 1 of semester detail
Implement phase 1 of semester detail
JavaScript
agpl-3.0
hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook
7c78e329596f50553d5b3f92959b08a97dd56ecd
etc/browser/avsc.js
etc/browser/avsc.js
/* jshint browserify: true */ 'use strict'; /** * Shim entry point for browserify. * * It only exposes the part of the API which can run in the browser. * */ var types = require('../../lib/types'); function parse(schema, opts) { var obj; if (typeof schema == 'string') { try { obj = JSON.parse(sc...
/* jshint browserify: true */ 'use strict'; /** * Shim entry point for browserify. * * It only exposes the part of the API which can run in the browser. * */ var types = require('../../lib/types'), Tap = require('../../lib/tap'); // No filesystem access in the browser. function parse(schema, opts) { va...
Work around missing buffer functions in the browser.
Work around missing buffer functions in the browser.
JavaScript
mit
mtth/avsc,N3da/avsc,N3da/avsc,cdapio/ui-schema-parser,cdapio/ui-schema-parser,cdapio/ui-schema-parser,cdapio/ui-schema-parser,mtth/avsc,cdapio/ui-schema-parser,mtth/avsc,N3da/avsc,mtth/avsc,N3da/avsc,mtth/avsc,N3da/avsc
fe6f71c6bb40253eeb355d1df735c9032fecb221
test/markdown.js
test/markdown.js
var assert = require('assert'); var test = require('mocha').test; var markdown = require('..'); test('.toHtml', function(done) { var testCases = [ { args: { markdown: '# Hello', output: 'markdown' }, output: '<h1 id="hello">Hello</h1>\n' } ]; testCases.forEach(function(testCase) { markdo...
var assert = require('assert'); var test = require('mocha').test; var markdown = require('..'); var testCases = [ { name: 'toHtml', args: { markdown: '# Hello', output: 'markdown' }, output: '<h1 id="hello">Hello</h1>\n' }, { name: 'toHtml#noargs', args: {}, output: 'error' } ]; testCa...
Add test for the required arg.
Add test for the required arg.
JavaScript
mpl-2.0
inappcloud/stack-markdown
5190a0cd6d3a0c28b549e1c885168b8eed45775a
dangerfile.js
dangerfile.js
// eslint-disable-next-line import/no-unresolved, import/extensions import { danger, warn } from 'danger'; const packageChanged = danger.git.modified_files.includes('package.json'); const lockfileChanged = danger.git.modified_files.includes('package-lock.json'); if (packageChanged && !lockfileChanged) { warn(`Change...
// eslint-disable-next-line import/no-unresolved, import/extensions import { danger, warn } from 'danger'; const packageChanged = danger.git.modified_files.includes('package.json'); const lockfileChanged = danger.git.modified_files.includes('package-lock.json'); if (packageChanged && !lockfileChanged) { warn(`Change...
Make warning about package-lock.json more clear
Chore: Make warning about package-lock.json more clear
JavaScript
mit
styleguidist/react-styleguidist,bluetidepro/react-styleguidist,sapegin/react-styleguidist,styleguidist/react-styleguidist,sapegin/react-styleguidist,styleguidist/react-styleguidist
f9fb76ceb1232becf5a3a20b55d2b15b7b45c8b3
mods/tiershift/scripts.js
mods/tiershift/scripts.js
exports.BattleScripts = { init: function () { for (var i in this.data.Pokedex) { var tier = ''; var adjustment = 0; // mega evolutions get the same stat boost as their base forme if (this.data.FormatsData[i]) tier = this.data.FormatsData[i].tier || this.data.FormatsData[toId(this.getTemplate(i).baseSpeci...
exports.BattleScripts = { init: function () { for (var i in this.data.Pokedex) { var tier = ''; var adjustment = 0; // mega evolutions get the same stat boost as their base forme if (this.data.FormatsData[i]) tier = this.data.FormatsData[i].tier || this.data.FormatsData[toId(this.getTemplate(i).baseSpeci...
Add BL4 to Tier Shift mod
Add BL4 to Tier Shift mod
JavaScript
mit
johtooo/PS,Tesarand/Pokemon-Showdown,sama2/Universe-Pokemon-Showdown,xfix/Pokemon-Showdown,TheManwithskills/DS,AustinXII/Pokemon-Showdown,KaitoV4X/Showdown,Vacate/Pokemon-Showdown,ShowdownHelper/Saffron,Zarel/Pokemon-Showdown,megaslowbro1/Pokemon-Showdown,Bryan-0/Pokemon-Showdown,DesoGit/Tsunami_PS,Extradeath/advanced,...
3002c7baa5916880f8bc0ff1658d80e2b47bad8e
test/templates/test/test_helper.js
test/templates/test/test_helper.js
(function() { 'use strict'; function FakeKeyEvent(key) { this.keyCode = key; this.preventDefault = function() {}; this.stopPropagation = function() {}; } var TestHelper = { triggerEvent: function(el, eventName) { var event = document.createEvent("MouseEvents"); event.initEvent(even...
(function() { 'use strict'; function FakeKeyEvent(key) { this.keyCode = key; this.preventDefault = function() {}; this.stopPropagation = function() {}; } var TestHelper = { triggerEvent: function(el, eventName) { var event = document.createEvent("MouseEvents"); event.initEvent(even...
Remove unused test helpers for templates testing
Remove unused test helpers for templates testing
JavaScript
mit
gsamokovarov/web-console,rails/web-console,gsamokovarov/web-console,rails/web-console,sh19910711/web-console,sh19910711/web-console,gsamokovarov/web-console,rails/web-console,gsamokovarov/web-console,rails/web-console,sh19910711/web-console,sh19910711/web-console
dd70dfbe74f12cb95e7f332891a934dcacbf3e80
app/javascripts/FormInput.js
app/javascripts/FormInput.js
import React from 'react'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import TextField from 'material-ui/TextField'; import RaisedButton from 'material-ui/RaisedButton'; class FormInput extends React.Component { constructor(props) { super(props); this.state = { address:'' ...
import React from 'react'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import TextField from 'material-ui/TextField'; import RaisedButton from 'material-ui/RaisedButton'; class FormInput extends React.Component { constructor(props) { super(props); this.state = { address:'' ...
Refactor to send argument to second variable
Refactor to send argument to second variable
JavaScript
mit
makoto/blockparty,makoto/blockparty
5a55dab7634d92740ec8a4edb7a82891600bdc27
lib/githubMock.js
lib/githubMock.js
// githubMock // Used to mock requests to GitHub with FS // for testing environment var fs = require( 'fs' ); module.exports = { getRepo : function ( pkg, callback ) { // Hit the wapm.json instead, mock the repo response fs.readFile( __dirname + '/../test/repos/' + pkg.repo + '/wapm.json', function ( err, d...
// githubMock // Used to mock requests to GitHub with FS // for testing environment var fs = require( 'fs' ); var repoCache = {}; var contentCache = {}; module.exports = { getRepo : function ( pkg, callback ) { // Store the file contents in a cache so it can be accessed, // modified in tests to simulate rep...
Add caching to github mocks
Add caching to github mocks
JavaScript
mit
web-audio-components/web-audio-components-service
78dcbe8ac81b1f15add131fdbddf22acfeb75d8a
domain/project.js
domain/project.js
/** * A project is a collection of handlers **/ var Project = exports.Project = function(name, author) { this.name = name; this.author = author; this.handlers = {}; this.handlers.length = 0; }; Project.prototype.addHandler(handler) { this.handlers[handler.id] = handler; this.handlers.length++;...
/** * A project is a collection of handlers **/ var Project = exports.Project = function(name, author) { this.name = name; this.author = author; this.handlers = {}; this.handlers.length = 0; }; Project.prototype.addHandler = function(handler) { this.handlers[handler.id] = handler; this.handler...
Fix typos in Project definition.
Fix typos in Project definition.
JavaScript
mit
past/nodify
5e2ef58ca8b13f51c721ccb281f98a020e805e56
src/routes/discover/index.js
src/routes/discover/index.js
const TYPES = [ 'communities', 'featured-users', 'recent', 'recommended', 'trending', ] const getComponents = (location, cb) => { cb(null, require('../../containers/discover/Discover').default) } const bindOnEnter = path => (nextState, replace) => { const type = nextState.params.type // redirect back...
const TYPES = [ 'communities', 'featured-users', 'recent', 'recommended', 'trending', ] const getComponents = (location, cb) => { cb(null, require('../../containers/discover/Discover').default) } const bindOnEnter = path => (nextState, replace) => { const type = nextState.params.type // redirect back...
Add some extra redirect logic for root path
Add some extra redirect logic for root path
JavaScript
mit
ello/webapp,ello/webapp,ello/webapp
512feca6d02ede73d9b17caf8eed3f64e105824a
mac/fixedPoint.js
mac/fixedPoint.js
define(function() { 'use strict'; return { fromInt32: function(i32) { var frac = 0; for (var i = 0; i < 16; i++) { if (i32 & (0x8000 >> i)) { frac += 1 / (2 << i); } } return (i32 >>> 16) + frac; }, fromInt32_2_30: function(i32) { var frac = 0;...
define(function() { 'use strict'; return { fromInt32: function(i32) { var frac = 0; for (var i = 0; i < 16; i++) { if (i32 & (0x8000 >> i)) { frac += 1 / (2 << i); } } return (i32 >>> 16) + frac; }, fromInt32_2_30: function(i32) { var frac = 0;...
Add support for 16-bit fixed point
Add support for 16-bit fixed point
JavaScript
mit
radishengine/drowsy,radishengine/drowsy
ae1bb2fb541ba4137668417e46e4337a3c3595f1
test/helpers.js
test/helpers.js
function generateData(rows) { var data = []; for (var i = 0; i < rows; ++i) { data.push({ "id": "#" + (i + 1), "created_at": new Date().toDateString(), "status": "In progress", "title": "Test " + i + Math.round(Math.random() * 1000), "count": M...
function generateData(rows) { var data = []; for (var i = 0; i < rows; ++i) { data.push({ "id": "#" + (i + 1), "created_at": new Date().toDateString(), "status": "In progress", "title": "Test unicode €∑ĒŽŌ•ōļķņ© " + i + Math.round(Math.random() * 1000), ...
Add unicode to test data generator.
Add unicode to test data generator.
JavaScript
mit
datazenit/sensei-grid,datazenit/sensei-grid,datazenit/sensei-grid,avinashjoshi/sensei-grid,avinashjoshi/sensei-grid,cgvarela/sensei-grid,cgvarela/sensei-grid
71bb353ebc2d986e263a54a5d2e0b865c03c2cc8
lib/okta/error-transformer.js
lib/okta/error-transformer.js
'use strict'; /** * Translates user creation errors into an end-user friendly userMessage * @param {*} err */ function oktaErrorTransformer(err) { if (err && err.errorCauses) { err.errorCauses.forEach(function (cause) { if (cause.errorSummary === 'login: An object with this field already exists in the c...
'use strict'; /** * Translates user creation errors into an end-user friendly userMessage * @param {*} err */ function oktaErrorTransformer(err) { if (err && err.errorCauses) { err.errorCauses.forEach(function (cause) { if (cause.errorSummary === 'login: An object with this field already exists in the c...
Transform OAuth errors so they can be used by HTML templates
Transform OAuth errors so they can be used by HTML templates
JavaScript
apache-2.0
stormpath/express-stormpath,stormpath/express-stormpath,stormpath/express-stormpath
293c28f7c537444e8524137fb1b453518539d680
lib/rules/table-req-header.js
lib/rules/table-req-header.js
var Issue = require('../issue'); module.exports = { name: 'table-req-header', on: ['tag'], filter: ['table'], desc: [ 'If set, each `table` tag must contain a header: a `thead` tag', 'or a `tr` tag with a `th` child.' ].join('\n') }; module.exports.lint = function (ele, opts) { var children = ele....
var Issue = require('../issue'); module.exports = { name: 'table-req-header', on: ['tag'], filter: ['table'], desc: [ 'If set, each `table` tag must contain a header: a `thead` tag', 'or a `tr` tag with a `th` child.' ].join('\n') }; module.exports.lint = function (ele, opts) { var children = ele....
Check whether element has tag type instead of whether name exists
Check whether element has tag type instead of whether name exists
JavaScript
isc
htmllint/htmllint,htmllint/htmllint
308ec16a4d38df47da0efbe9441d10031ba4e5f8
backend/servers/mcapid/initializers/files-watcher-initializer.js
backend/servers/mcapid/initializers/files-watcher-initializer.js
const {Initializer, api} = require('actionhero'); module.exports = class FileWatcherInitializer extends Initializer { constructor() { super(); this.name = 'file-watcher-initializer'; this.loadPriority = 1100; } initialize() { // const r = api.mc.r; // // r.t...
const {Initializer, api} = require('actionhero'); module.exports = class FileWatcherInitializer extends Initializer { constructor() { super(); this.name = 'file-watcher-initializer'; this.loadPriority = 1100; } initialize() { const r = api.mc.r; r.table('datafiles'...
Make everything async for processing files
Make everything async for processing files
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
6b0cc37d876a68b6903bf62ba53f578f71e14917
gulp/tasks/copy.js
gulp/tasks/copy.js
var gulp = require('gulp'); var config = require('../config').copy gulp.task('copy', function() { var copyFile = function(paths) { var sourcePath = paths[0]; var destPath = paths[1]; return gulp.src(sourcePath) .pipe(gulp.dest(destPath)) } config.forEach(copyFile); });
var gulp = require('gulp'); var size = require('gulp-size'); var config = require('../config').copy; gulp.task('copy', function() { var copyFile = function(paths) { var sourcePath = paths[0]; var destPath = paths[1]; var title = paths[2] || ''; return gulp.src(sourcePath) .pipe(gulp.dest(destPath)) .pi...
Print out the size of the copied files
Print out the size of the copied files
JavaScript
agpl-3.0
hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook
a773cdcedb896088b3bf36a1821d95d6b463ad71
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-1.11.0', 'sinon-chai', 'chai', 'fixture'], files: [ 'public/javascripts/vendor/d3.v3.min.js', 'public/javascripts/vendor/raphael-min.js', 'public/javascripts/vendor/morris.min.js',...
Update order of sinin chai and jquery for Phanton test as well
Update order of sinin chai and jquery for Phanton test as well
JavaScript
mit
codeforamerica/city-analytics-dashboard,codeforamerica/city-analytics-dashboard,codeforamerica/city-analytics-dashboard
290d9eb3b238fdf18c947416d46968bfc6c25228
karma.conf.js
karma.conf.js
// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html module.exports = function karmaConfig (config) { config.set({ frameworks: [ // Reference: https://github.com/karma-runner/karma-mocha // Set framework to mocha 'mocha' ], reporters: [ // Reference: htt...
// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html module.exports = function karmaConfig (config) { config.set({ frameworks: [ // Reference: https://github.com/karma-runner/karma-mocha // Set framework to mocha 'mocha' ], reporters: [ // Reference: htt...
Hide webpack build information when running karma
Hide webpack build information when running karma
JavaScript
mit
cesarandreu/web-app,Climb-social/climb-social-resources,Climb-social/climb-social-resources,100Shapes/react-webapp-starter,100Shapes/react-webapp-starter,awolf/react-by-example
fdc9f5f46bffe2b98a9cce80aaa2176f5bcb5d65
flowTrack.js
flowTrack.js
/*jslint node: true */ 'use strict'; var cluster = require('cluster'); var netflow = require('node-netflowv9'); var numCPUs = require('os').cpus().length; var NetFlowStorage = require('./lib/NetFlowStorage.js'); main(); function main() { var nfStore = new NetFlowStorage(); if (cluster.isMaster) { ...
#!/usr/bin/env node /*jslint node: true */ 'use strict'; var cluster = require('cluster'); var netflow = require('node-netflowv9'); var numCPUs = require('os').cpus().length; var NetFlowStorage = require('./lib/NetFlowStorage.js'); main(); function main() { var nfStore = new NetFlowStorage(); if (cluste...
Make the script self starting
Make the script self starting
JavaScript
mit
skarfacegc/FlowTrack2,skarfacegc/FlowTrack2
f04a8741e8c9b41af5d9754ce9e29f7d3a3af5a9
lib/routes.js
lib/routes.js
var Router = require('routes'); var router = new Router(); router.addRoute('/boot/:macaddr', function boot(macaddr) { }); router.addRoute('/boot/:macaddr/preeseed.cfg', function preseed(macaddr) { }); module.exports = router;
var Router = require('routes'); var router = new Router(); router.addRoute('/chain', function(req, res, params, splats) { console.log("Got a CHAIN request"); res.writeHead(200, {'Content-Type': 'text/plain'}); res.end("#!ipxe\n\necho Attempting to boot into the chain... \nchain http://${next-server}/boot/${mac}...
Add initial http boot chain support
Add initial http boot chain support
JavaScript
mit
konobi/forge,theredcat/forge
f7b449ffb1a39e81c3fa7dea3366d46e86bba18e
test/issues/load-css/main.js
test/issues/load-css/main.js
var MODULES_PATH = 'http://modules.seajs.org/'; if (location.href.indexOf('/~lifesinger/') > 0) { MODULES_PATH = 'http://' + location.host + '/~lifesinger/seajs/spm/modules/'; } seajs.config({ base: MODULES_PATH, alias: { 'jquery': '1.7.2' } }); define(function(require) { var test = require('../../t...
define(function(require) { var test = require('../../test'); var $ = require('../../third-party').jQuery; require('./red.css'); test.assert($('#red').width() === 200, '#red width should be 200'); test.assert($('#blue').width() !== 200, '#blue width should not be 200. The actual value is ' + $('#blue').widt...
Remove hard code jquery path
Remove hard code jquery path
JavaScript
mit
MrZhengliang/seajs,chinakids/seajs,MrZhengliang/seajs,mosoft521/seajs,baiduoduo/seajs,coolyhx/seajs,lianggaolin/seajs,Gatsbyy/seajs,lovelykobe/seajs,miusuncle/seajs,tonny-zhang/seajs,judastree/seajs,13693100472/seajs,imcys/seajs,mosoft521/seajs,imcys/seajs,AlvinWei1024/seajs,tonny-zhang/seajs,kuier/seajs,lovelykobe/sea...
69e02bc857a039dcf3dc79e11925aeb0d8462335
app/javascript/background.js
app/javascript/background.js
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if (/netflix\.com/.test(changeInfo.url)) { console.log("tab updated, reloading script"); chrome.tabs.executeScript(null, { file: "javascript/contentscript.js" }); } }); chrome.runtime.onMessage.addListener(function(message, sender, response) { ...
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if (/netflix\.com/.test(changeInfo.url)) { console.log("tab updated, reloading script"); chrome.tabs.executeScript(null, { file: "javascript/contentscript.js" }); } }); chrome.runtime.onMessage.addListener(function(message, sender, response) { ...
Add new patreon post on update
Add new patreon post on update
JavaScript
apache-2.0
tanner-rutgers/RateFlix,tanner-rutgers/RateFlix
b2c49482237b8ddb593f13bab4931b7ebbb629b8
gulpfile.babel.js
gulpfile.babel.js
import del from 'del'; import gulp from 'gulp'; import babel from 'gulp-babel'; import gls from 'gulp-live-server'; const port = 12345; const dirs = { src: 'src', dist: 'dist', // Not being used for now. To be used in prodution dev: 'dev' }; const files = { indexJS: 'bootstrap.js', indexSASS: 'index.sass' }...
import del from 'del'; import gulp from 'gulp'; import babel from 'gulp-babel'; import gls from 'gulp-live-server'; const port = 12345; const dirs = { src: 'src', dist: 'dist', // Not being used for now. To be used in prodution dev: 'dev' }; const files = { indexJS: 'bootstrap.js', indexSASS: 'index.sass' }...
Replace function for arrow function
Replace function for arrow function
JavaScript
mit
tbragaf/ng2-seed-babel,tbragaf/ng2-seed-babel