commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 624 | message stringlengths 15 4.7k | lang stringclasses 3
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
dd8feba17c070cd99729d86d00ca1b6a2bd2248a | js/the-blue-alliance.js | js/the-blue-alliance.js | (function($) {
var API_V2_URI = "http://www.thebluealliance.com/api/v2/",
tba = {};
var tbaAjax = function(url, callback) {
$.ajax({
url: API_V2_URI + url,
dataType: "json",
type: "GET",
data: {
"X-TBA-App-Id": "firstwa:video-stream:1"
}
}).done(function(data) {
// Hide the textStatus and... | Create wrapper for The Blue Alliance's API | Create wrapper for The Blue Alliance's API
| JavaScript | mit | mc10/first-look | |
954df610468b17fcc34ad0601a190d6be7a37c6d | src/index.js | src/index.js | import * as actionCreators from './actionCreators'
import * as actionTypes from './actionTypes'
import * as utils from './utils'
import middleware from './middleware'
export {
actionCreators,
actionTypes,
middleware,
utils,
}
| Add exports to entry file | Add exports to entry file
| JavaScript | mit | fredrikolovsson/redux-module-local-storage | |
eb87b5c6ab51d7fa662136dfd3de9c2fcec2ea46 | hooks/after_prepare/015_copy_icon_to_drawable.js | hooks/after_prepare/015_copy_icon_to_drawable.js | #!/usr/bin/env node
var fs = require('fs-extra');
var path = require('path');
var klawSync = require('klaw-sync')
var androidPlatformsDir = path.resolve(__dirname, '../../platforms/android/res');
var copyAllIcons = function(iconDir) {
var densityDirs = klawSync(iconDir, {nofile: true})
// console.log("densi... | Move the standard launcher icon from `mipmap` to `drawable` | Move the standard launcher icon from `mipmap` to `drawable`
The most recent android versions store their icon under
`mipmap..." (e.g. mipmap-hdpi, mipmap-xhdpi, mipmap-xxxhdpi)
https://android-developers.googleblog.com/2014/10/getting-your-apps-ready-for-nexus-6-and.html
But that means that if we want to have our app... | JavaScript | bsd-3-clause | e-mission/e-mission-phone,shankari/e-mission-phone,shankari/e-mission-phone,shankari/e-mission-phone,e-mission/e-mission-phone,shankari/e-mission-phone,e-mission/e-mission-phone,e-mission/e-mission-phone | |
cd9a4e7efb55c8742b496bc6beb78765d280c54d | tests/components/Sidebar-cy.js | tests/components/Sidebar-cy.js | describe('Sidebar', function () {
beforeEach(function () {
cy.configureCluster({
mesos: '1-task-healthy',
componentHealth: false
})
.visitUrl({url: '/dashboard', identify: true, fakeAnalytics: true});
});
context('Sidebar Wrapper', function () {
it('is exactly the same width as the ... | Add integration tests for sidebar width | Add integration tests for sidebar width
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui | |
b5387595eb66d7d0063119a17c8ccd1588b59c57 | migrations/20160316063014_geotags.js | migrations/20160316063014_geotags.js | export async function up(knex, Promise) {
await knex.schema.createTable('geonames_admin1', function (table) {
table.increments();
table.string('name');
table.string('asciiname');
table.string('code');
table.string('country_code');
table.index('code');
});
await knex.schema.table('geotags'... | Add migrations for administrative divisions | Add migrations for administrative divisions
| JavaScript | agpl-3.0 | Lokiedu/libertysoil-site,Lokiedu/libertysoil-site | |
85abd94bc0ee46b4367da1617be0cc3a3b2d7b59 | migrations/20160415120919_geotags.js | migrations/20160415120919_geotags.js | export async function up(knex, Promise) {
await knex.schema.table('geotags', function (table) {
table.float('lat');
table.float('lon');
table.float('land_mass');
});
}
export async function down(knex, Promise) {
await knex.schema.table('geotags', function (table) {
table.dropColumns(['lat', 'lon'... | Add migration which adds lat, lon, land_mass to geotags | Add migration which adds lat, lon, land_mass to geotags
| JavaScript | agpl-3.0 | Lokiedu/libertysoil-site,Lokiedu/libertysoil-site | |
a9e3a386c922d55de16f27cd742b5398677d6101 | variables-objects.js | variables-objects.js | // JavaScript Variables and Objects
// I paired [by myself, with:] on this challenge.
// __________________________________________
// Write your code below.
var secretNumber = 7
var password = "just open the door"
var allowedIn = false
var members = ['John',"","","Mary"]
// _____________________________________... | Add JS variables and objects | Add JS variables and objects
| JavaScript | mit | ray-curran/phase-0,ray-curran/phase-0,ray-curran/phase-0 | |
b3aded016e178167628f0827a568a56bff06fb3d | node-tests/blueprints/service-test.js | node-tests/blueprints/service-test.js | 'use strict';
var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
var setupTestHooks = blueprintHelpers.setupTestHooks;
var emberNew = blueprintHelpers.emberNew;
var emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
var expect = require('ember-cli-blueprint-test-helpers/chai').expe... | Add inital test for service blueprint | Add inital test for service blueprint
| JavaScript | mit | kimroen/ember-cli-coffeescript,kimroen/ember-cli-coffeescript,kimroen/ember-cli-coffeescript | |
68a7cb66089e7e03a9be163ce588aa75f9a7e191 | test/status_codes.js | test/status_codes.js | "use strict";
var assert = require('assert');
var request = require('request');
var server = require('./server');
describe('homepage', function() {
it('is OK', function(done) {
var baseURL = server.getBaseURL();
request(baseURL, function(error, response, body) {
assert.ifError(error);
assert.eq... | Add basic tests for all routes, check status codes | Add basic tests for all routes, check status codes
| JavaScript | cc0-1.0 | konklone/oversight.io,konklone/oversight.io,konklone/oversight.io,konklone/oversight.io | |
6e1b97da4fa84a0c81c8adceb56cf8bafadf7c10 | src/app/utilities/api-clients/collections.js | src/app/utilities/api-clients/collections.js | import http from '../http';
export default class collections {
static create(body) {
return http.post(`/zebedee/collection`, body)
.then(response => {
return response;
})
}
} | Add collection api class with create method | Add collection api class with create method
| JavaScript | mit | ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence | |
bbd96ab09308b1d05636edd1dcd674abfbf2b4d0 | server/db/controllers/getSelfBasicInfoGivenFBId.js | server/db/controllers/getSelfBasicInfoGivenFBId.js | const db = require('../db.js');
module.exports = (facebookId) => {
const query = `SELECT * FROM users WHERE facebook_id = '${facebookId}'`;
return db.query(query)
.spread((results, metadata) => results);
};
| Rename query function to specify input fbId not fbProfile | Rename query function to specify input fbId not fbProfile
| JavaScript | mit | VictoriousResistance/iDioma,VictoriousResistance/iDioma | |
2ffcffcf583d60fb5897a6b06e18ea0c6b120c9a | migrations/20160421203657_hashtags_geotags_more.js | migrations/20160421203657_hashtags_geotags_more.js | export async function up(knex, Promise) {
await knex.schema.table('hashtags', function (table) {
table.jsonb('more');
});
await knex.schema.table('geotags', function (table) {
table.jsonb('more');
});
}
export async function down(knex, Promise) {
await knex.schema.table('hashtags', function (table) ... | Add migration which adds `more` to hashtags and geotags | Add migration which adds `more` to hashtags and geotags
| JavaScript | agpl-3.0 | Lokiedu/libertysoil-site,Lokiedu/libertysoil-site | |
f3e661870e831cd3016d11749481cf37b77f15bc | js/components/common/single-row-list-item/singleRowListItem.js | js/components/common/single-row-list-item/singleRowListItem.js | import React, { Component } from 'react';
import { Text } from 'react-native';
import { CardItem, Left, Right, Icon } from 'native-base';
export default class SingleRowListItem extends Component {
static propTypes = {
text: React.PropTypes.string.isRequired,
icon: React.PropTypes.string,
};
static defa... | Create common single row list item component | Create common single row list item component
| JavaScript | mit | justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client | |
2301aadf02a5573bafb76a7b63ef19a7926f5e9c | test/api/lambdas/:organizationName/get.js | test/api/lambdas/:organizationName/get.js | import {all, map} from "bluebird";
import {expect} from "chai";
import express from "express";
import request from "supertest-as-promised";
import {sign} from "jsonwebtoken";
import api from "api";
import * as config from "config";
import dynamodb from "services/dynamodb";
describe("GET /lambdas/:organizationName", (... | Add tests for GET /lambdas/:organizationName | Add tests for GET /lambdas/:organizationName
| JavaScript | mit | lk-architecture/lh-api | |
607f3dfaf814022d79458d3fcf6cbef45df2cbbc | test/feature/persist/InsertOrUpdate.spec.js | test/feature/persist/InsertOrUpdate.spec.js | import { createStore, createState } from 'test/support/Helpers'
import Model from 'app/model/Model'
describe('Features – Persist – Insert Or Update', () => {
class User extends Model {
static entity = 'users'
static fields () {
return {
id: this.attr(null),
name: this.attr(''),
... | Add insert or update feature test | Add insert or update feature test
| JavaScript | mit | revolver-app/vuex-orm,revolver-app/vuex-orm | |
46b5f29d2fcfa706ac288298bf25d1db28785b12 | src/components/RepoLinks.js | src/components/RepoLinks.js | import React from 'react'
import { Link } from 'react-router'
import { REPOS } from '../config'
const makeIssueLinks = () => {
return Object.keys(REPOS).map((repoName, i) => {
const repo = REPOS[repoName]
return (
<li key={`repo$-${repo.name}-${i}`}>
<Link
to={`/issues/${repoName}`}
... | Add repolinks in as a global component to use on homepage as well as when a route isnt hit | Add repolinks in as a global component to use on homepage as well as when a route isnt hit
| JavaScript | mit | aburd/issues-tracker,aburd/issues-tracker | |
6ff0dfe41e2303a991a93f67fb98fdfc8e476529 | src/blueprints/options/index.js | src/blueprints/options/index.js | /**
* Exports object that contains names of options as a key and their configuration objects as a value
*
* @example
* export default {
* optionName: {
* desc: 'Description for the option',
* alias: 'Short name for the option',
* type: Boolean || String || Number,
* defaults: 'Default value',... | /**
* Exports object that contains names of options as a key and their configuration objects as a value
*
* @example
* export default {
* optionName: {
* desc: 'Description for the option',
* alias: 'Short name for the option',
* type: Boolean || String || Number,
* defaults: 'Default value',... | Update description for --use-default option | Update description for --use-default option
| JavaScript | mit | ghaiklor/generator-sails-rest-api,italoag/generator-sails-rest-api,IncoCode/generator-sails-rest-api,jaumard/generator-trails,tnunes/generator-trails,italoag/generator-sails-rest-api,konstantinzolotarev/generator-trails,ghaiklor/generator-sails-rest-api |
8b9e7302ea5ab24c718d788d5d5ae13c2871c8ff | addons/actions/src/containers/ActionLogger/index.js | addons/actions/src/containers/ActionLogger/index.js | import React from 'react';
import deepEqual from 'deep-equal';
import ActionLoggerComponent from '../../components/ActionLogger/';
import { EVENT_ID } from '../../';
export default class ActionLogger extends React.Component {
constructor(props, ...args) {
super(props, ...args);
this.state = { actions: [] };
... | import React from 'react';
import deepEqual from 'deep-equal';
import ActionLoggerComponent from '../../components/ActionLogger/';
import { EVENT_ID } from '../../';
export default class ActionLogger extends React.Component {
constructor(props, ...args) {
super(props, ...args);
this.state = { actions: [] };
... | Use strict equality to distinguish 0 from an empty string | Use strict equality to distinguish 0 from an empty string
| JavaScript | mit | rhalff/storybook,storybooks/storybook,kadirahq/react-storybook,enjoylife/storybook,rhalff/storybook,nfl/react-storybook,enjoylife/storybook,jribeiro/storybook,storybooks/react-storybook,storybooks/storybook,nfl/react-storybook,rhalff/storybook,kadirahq/react-storybook,jribeiro/storybook,storybooks/storybook,storybooks/... |
fb65038c97a8ded28d34f7ea2bc32387395293d7 | test/mocha/stop_word_filter_test.js | test/mocha/stop_word_filter_test.js | suite('lunr.stopWordFilter', function () {
test('filters stop words', function () {
var stopWords = ['the', 'and', 'but', 'than', 'when']
stopWords.forEach(function (word) {
assert.isUndefined(lunr.stopWordFilter(word))
})
})
test('ignores non stop words', function () {
var nonStopWords = ... | Convert stopword filter test to mocha/chai. | Convert stopword filter test to mocha/chai.
| JavaScript | mit | olivernn/lunr.js,olivernn/lunr.js,olivernn/lunr.js | |
13023ccb5275e50a6553bf60d8da51f5b745ca4f | tools/scripts/api-docs/pkg_order.js | tools/scripts/api-docs/pkg_order.js | #!/usr/bin/env node
/**
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*... | Add script to generate a package order hash | Add script to generate a package order hash
| JavaScript | apache-2.0 | stdlib-js/www,stdlib-js/www,stdlib-js/www | |
644fcd3cf81db274a4464c0e0a9220a553977d1b | app/pages/prescription/prescriptionFormStyles.js | app/pages/prescription/prescriptionFormStyles.js | import { default as baseTheme } from '../../themes/baseTheme';
export const formWrapperStyles = {
width: [1, 0.75, 0.5, 0.33],
mt: 5,
mb: 6,
mx: 'auto',
};
export const inputStyles = {
width: '100%',
themeProps: {
mb: 3,
},
};
export const checkboxStyles = {
width: '100%',
themeProps: {
fon... | Move common prescription form styles to own file | [WEB-819] Move common prescription form styles to own file
| JavaScript | bsd-2-clause | tidepool-org/blip,tidepool-org/blip,tidepool-org/blip | |
cb3d5a46e23f1946334007f29bc31a2c65d211ae | src/adapters/jasmine-2.x-blanket.js | src/adapters/jasmine-2.x-blanket.js | (function() {
if (! jasmine) {
throw new Exception("jasmine library does not exist in global namespace!");
}
function elapsed(startTime, endTime) {
return (endTime - startTime)/1000;
}
function ISODateString(d) {
function pad(n) { return n < 10 ? '0'+n : n; }
retu... | Add adapter for Jasmine 2.x | Add adapter for Jasmine 2.x
| JavaScript | mit | ssnau/blanket,reggi/blanket,agray/blanket,listepo/blanket,kidaa/blanket,listepo/blanket,kidaa/blanket,Jeff-Lewis/blanket,jlturner/blanket,ssnau/blanket,ahamid/blanket,Jeff-Lewis/blanket,Jbarget/blanket,Jbarget/blanket,agray/blanket,ahamid/blanket,reggi/blanket,agray/blanket,jlturner/blanket | |
9a469783f03ec07166e4dd9715d13a763d9af37e | test-support/ember-cli-i18n-test.js | test-support/ember-cli-i18n-test.js | /* globals requirejs, require */
import Ember from 'ember';
import config from '../config/environment';
var keys = Ember.keys;
var locales, defaultLocale;
module('ember-cli-i18n', {
setup: function() {
var localRegExp = new RegExp(config.modulePrefix + '/locales/(.+)');
var match, moduleName;
locales ... | Add test confirming all locales have all keys. | Add test confirming all locales have all keys.
Something that has bit our team a few times: we add a new key to the
default locale file, but forget to add it to the others.
This adds an test that runs in the consuming app, that confirms all
locale files contain the keys from the `defaultLocale`.
| JavaScript | mit | ember-furnace/ember-cli-furnace-i18n,DavyJonesLocker/ember-cli-i18n,ember-furnace/ember-cli-furnace-i18n,dockyard/ember-cli-i18n,dockyard/ember-cli-i18n,DavyJonesLocker/ember-cli-i18n | |
b240a49434236c708eacf9be7a60a99052ed2bb0 | server/src/scripts/add-leave-thread-permissions.js | server/src/scripts/add-leave-thread-permissions.js | // @flow
import { threadPermissions, threadTypes } from 'lib/types/thread-types';
import { dbQuery, SQL } from '../database/database';
import { endScript } from './utils';
import { recalculateAllThreadPermissions } from '../updaters/thread-permission-updaters';
async function main() {
try {
await addLeaveThrea... | Create script to add LEAVE_THREAD permission | [server] Create script to add LEAVE_THREAD permission
Test Plan:
Tested on a single row to check if results are matching expectacions.
Inspected `membership` table to check if `leave_thread` permission is added. Inspected `roles` table to check if permission is added.
Ran a query after the script, and made sure only p... | JavaScript | bsd-3-clause | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal | |
19d06d29b6f909334f0ef8860f3f8e96b37d7917 | test/refraction-test.js | test/refraction-test.js | var expect = require('./spec-helper').expect;
var minim = require('../lib/minim');
var refract = require('../lib/refraction').refract;
describe('refract', function() {
it('returns any given element without refracting', function() {
var element = new minim.StringElement('hello');
var refracted = refract(eleme... | Add unit tests for refraction | fix: Add unit tests for refraction
| JavaScript | mit | refractproject/minim | |
36c06d58bd84e4909fe11f2da7ca20b9968a1aa9 | test/unit_test/compiler/notfoundindcacheerror.spec.js | test/unit_test/compiler/notfoundindcacheerror.spec.js | 'use strict';
/**
* @ignore
* @suppress {dupicate}
*/
var NotFoundInCacheError = /** @type {function(new:NotFoundInCacheError, string, string, string): undefined} */
(require('../../../src/compiler/NotFoundInCacheError.js'));
fdescribe('Class NotFoundInCacheError', function () {
describe('can be instantiat... | Add unit tests for NotFoundInCacheError | tests: Add unit tests for NotFoundInCacheError
| JavaScript | mit | lgeorgieff/nbuild,lgeorgieff/ccbuild | |
83832098b8db0e17cec5cf5fc555ecfa3f5cbc81 | lib/repositories/httpAPI.js | lib/repositories/httpAPI.js | require('isomorphic-fetch');
require('es6-promise').polyfill();
var fetch = window.fetch;
var _ = require('underscore');
var CONTENT_TYPE = 'Content-Type';
var JSON_CONTENT_TYPE = 'application/json';
function HttpAPIRepository(mixinOptions) {
var defaultBaseUrl = '';
var methods = ['get', 'put', 'post', 'delete'... | Refactor HTTP API into repository structure | Refactor HTTP API into repository structure
| JavaScript | mit | martyjs/marty,martyjs/marty-lib,kwangkim/marty,oliverwoodings/marty,goldensunliu/marty-lib,oliverwoodings/marty,thredup/marty-lib,martyjs/marty,bigardone/marty,Driftt/marty,KeKs0r/marty-lib,kwangkim/marty,CumpsD/marty-lib,thredup/marty,thredup/marty,bigardone/marty,kwangkim/marty,Driftt/marty,bigardone/marty,gmccrackin... | |
61f1331004e1604e3856e89504e4e469cbd4904a | webpack.config.js | webpack.config.js | var path = require('path');
var process = require('process');
var fs = require('fs');
module.exports = {
context: path.join(process.env.PWD, 'frontend'),
entry: "./index.js",
target: 'node',
output: {
path: path.join(__dirname, 'dist'),
filename: 'webpack.bundle.js'
},
module: {
loaders: [
... | var path = require('path');
var process = require('process');
var fs = require('fs');
var webpack = require('webpack');
module.exports = {
context: path.join(process.env.PWD, 'frontend'),
entry: "./index.js",
target: 'node',
output: {
path: path.join(__dirname, 'dist'),
filename: 'webpack.bundle.js'
... | Fix ` ReferenceError: process is not defined` on ReactPref | Fix ` ReferenceError: process is not defined` on ReactPref
* ReactPref call `process`, but does not defined.
so webpack.DefinePlugin give process object.
| JavaScript | mit | mgi166/usi-front,mgi166/usi-front |
1a2b1508b4ab94f5e550550ebe9748288bf43f89 | webpack.config.js | webpack.config.js | const path = require('path')
const webpack = require('webpack')
const ENV = process.env.NODE_ENV || 'development'
const appendIf = (cond, ...items) => cond ? items : []
const plugins = [
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify(ENV) }
}),
...appendIf(ENV === 'production', new webp... | const path = require('path')
const webpack = require('webpack')
const ENV = process.env.NODE_ENV || 'development'
const appendIf = (cond, ...items) => cond ? items : []
const plugins = [
...appendIf(ENV !== 'production', new webpack.HotModuleReplacementPlugin())
]
module.exports = {
entry: [
'react-hot-loader... | Remove manual env injection and uglify plugin. webpacks `-p` argument handles this. | Remove manual env injection and uglify plugin. webpacks `-p` argument handles this.
| JavaScript | mit | dan-lee/react-minimal-starter-kit,dan-lee/react-minimal-starter-kit |
04de99947d1ace467850b9ce26999042e199f8c8 | src/components/search_bar.js | src/components/search_bar.js | import React, { Component } from 'react';
class SearchBar extends Component {
render() {
return <input onChange={this.onInputChange} />;
}
onInputChange(event) {
console.log(event.target.value);
}
}
export default SearchBar; | import React, { Component } from 'react';
class SearchBar extends Component {
render() {
return <input onChange={event => console.log(event.target.value)} />;
}
// onInputChange(event) {
// console.log(event.target.value);
// }
}
export default SearchBar; | Comment out other function and place function inline to reduce code. | Comment out other function and place function inline to reduce code.
| JavaScript | mit | JosephLeon/redux-simple-starter-tutorial,JosephLeon/redux-simple-starter-tutorial |
3610be5301f01c0110d704a6c681c0b6c42d3ce8 | src/configure/karma/index.js | src/configure/karma/index.js | export default function configureKarma (config) {
const { projectPath, watch, webpackConfig, karmaConfig: userKarmaConfig } = config
const defaultKarmaConfig = {
basePath: projectPath,
frameworks: ['jasmine', 'phantomjs-shim', 'sinon'],
browsers: ['PhantomJS'],
files: [
'src/**/*.spec.*',
... | export default function configureKarma (config) {
const { projectPath, watch, webpackConfig, karmaConfig: userKarmaConfig } = config
const defaultKarmaConfig = {
basePath: projectPath,
frameworks: ['jasmine', 'phantomjs-shim', 'sinon'],
browsers: ['PhantomJS'],
reporters: ['mocha'],
files: [
... | Add mocha reporter to karma configuration | Add mocha reporter to karma configuration
| JavaScript | mit | saguijs/sagui,saguijs/sagui |
f57b1660ee8fb3196bcc61ef059c51b56bb73aa0 | karma.conf.js | karma.conf.js | module.exports = function(config) {
config.set({
frameworks: ['jquery-3.2.1', 'jasmine-jquery', 'jasmine'],
browsers: ['ChromeHeadless'],
files: [
'spec/helpers/tampermonkeyStubs.js',
'public/fateOfAllFools.js',
'spec/helpers/!(tampermonkeyStubs).js',
{pattern: 'spec/javascripts/fi... | module.exports = function(config) {
config.set({
frameworks: ['jquery-3.2.1', 'jasmine-jquery', 'jasmine'],
browsers: ['ChromeHeadless'],
files: [
'spec/helpers/tampermonkeyStubs.js',
'docs/fateOfAllFools.js',
'spec/helpers/!(tampermonkeyStubs).js',
{pattern: 'spec/javascripts/fixt... | Update path for script source | Update path for script source
| JavaScript | mit | rslifka/fate_of_all_fools,rslifka/fate_of_all_fools |
eb9d6eccaac33ec59d0a2fc92e96af5f7eb3956f | lib/editor.js | lib/editor.js | 'use babel'
/* @flow */
import {CompositeDisposable} from 'atom'
import type {Disposable, TextEditor, TextBuffer, TextEditorGutter} from 'atom'
export class Editor {
gutter: ?TextEditorGutter;
textEditor: TextEditor;
subscriptions: CompositeDisposable;
constructor(textEditor: TextEditor) {
this.textEdit... | 'use babel'
/* @flow */
import { CompositeDisposable, Emitter } from 'atom'
import type { Disposable, TextEditor, TextBuffer, TextEditorGutter } from 'atom'
export class Editor {
gutter: ?TextEditorGutter;
emitter: Emitter;
textEditor: TextEditor;
subscriptions: CompositeDisposable;
constructor(textEditor... | Add an emitter to Editor class | :new: Add an emitter to Editor class
| JavaScript | mit | AtomLinter/linter-ui-default,steelbrain/linter-ui-default,steelbrain/linter-ui-default |
2d60bf6de2b5f455e5688e0dbfd48239d7342226 | test8/testLambda.js | test8/testLambda.js | var java = require("../testHelpers").java;
var nodeunit = require("nodeunit");
var util = require("util");
exports['Java8'] = nodeunit.testCase({
"call methods of a class that uses lambda expressions": function(test) {
try {
var TestLambda = java.import('TestLambda');
var lambda = new TestLambda();
... | var java = require("../testHelpers").java;
var nodeunit = require("nodeunit");
var util = require("util");
exports['Java8'] = nodeunit.testCase({
"call methods of a class that uses lambda expressions": function(test) {
try {
var TestLambda = java.import('TestLambda');
var lambda = new TestLambda();
... | Use better test for UnsupportedClassVersionError. | Use better test for UnsupportedClassVersionError.
The previous test worked correctly with the Oracle JVM but
failed with other JVMs. This new test should work correctly
on all JVMs.
| JavaScript | mit | lantanagroup/node-java,lantanagroup/node-java,sebgod/node-java,sebgod/node-java,RedSeal-co/node-java,joeferner/node-java,joeferner/node-java,lantanagroup/node-java,RedSeal-co/node-java,RedSeal-co/node-java,RedSeal-co/node-java,sebgod/node-java,joeferner/node-java,sebgod/node-java,RedSeal-co/node-java,sebgod/node-java,l... |
f9e17fda75a2c1e2d3f74d9f93b1f40d1fb4c6e6 | src/App.js | src/App.js | import React, { Component } from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import ContentContainer from './patterns/containers/Content';
import ExperimentsHome from './experiments/Index';
import Home from './home/Index';
import HomeHeader from './home/Header';
import Top... | import React, { Component } from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import ContentContainer from './patterns/containers/Content';
import ExperimentsHome from './experiments/Index';
import Home from './home/Index';
import HomeHeader from './home/Header';
import Not... | Add organization + 404 pages | Add organization + 404 pages
| JavaScript | mit | drainpip/shaneis.me,drainpip/shaneis.me |
718b82fb3e43b2dc1f40effa365cad90a40f8476 | src/editor/selection-rect.js | src/editor/selection-rect.js | var Rect = require('./rect');
exports.get = function() {
var selection = window.getSelection();
if (!selection.rangeCount) {
return;
} else if (selection.isCollapsed) {
var range = selection.getRangeAt(0);
var rects = range.getClientRects();
var rect = rects[rects.length - 1];
if (!rect) {
... | var Rect = require('./rect');
exports.get = function() {
var selection = window.getSelection();
if (!selection.rangeCount) {
return;
} else if (selection.isCollapsed) {
var range = selection.getRangeAt(0);
var rects = range.getClientRects();
var rect = rects[rects.length - 1];
if (!rect && ra... | Fix selection rect to be less obtrusive | Fix selection rect to be less obtrusive
| JavaScript | mit | jacwright/typewriter,jacwright/typewriter |
33251e65666c4619c8551c515d85ca28d161a112 | src/SdkConfig.js | src/SdkConfig.js | /*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | /*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | Remove default options that shouldn't be part of this PR | Remove default options that shouldn't be part of this PR
| JavaScript | apache-2.0 | matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk |
4699d58fb0fa8a93db109a9ba3da550c5daac0e3 | src/cli-apply.js | src/cli-apply.js | import execute from './core';
import adminApi from './adminApi';
import colors from 'colors';
import configLoader from './configLoader';
import program from 'commander';
program
.version(require("../package.json").version)
.option('--path <value>', 'Path to the configuration file')
.option('--host <value>'... | import execute from './core';
import adminApi from './adminApi';
import colors from 'colors';
import configLoader from './configLoader';
import program from 'commander';
program
.version(require("../package.json").version)
.option('--path <value>', 'Path to the configuration file')
.option('--host <value>'... | Fix reading the host from the config file | Fix reading the host from the config file
| JavaScript | mit | JnMik/kongfig,mybuilder/kongfig,JnMik/kongfig |
280934c9c513cba3be83fb7478a0d2c349281d26 | srv/api.js | srv/api.js | /**
* API endpoints for backend
*/
const api = require('express').Router();
api.use((req, res, next) => {
// redirect requests like ?t=foo/bar to foo/bar
if (req.query.t) {
return res.redirect(req.query.t);
}
next();
});
api.use((req, res) => {
res.status(400).send('Unknown API endpoint');
});
modu... | /**
* API endpoints for backend
*/
const api = require('express').Router();
api.use((req, res, next) => {
// redirect requests like ?t=foo/bar to foo/bar
if (req.query.t) {
return res.redirect(`${req.query.t}?old=true`);
}
next();
});
api.use((req, res) => {
res.status(400).send('Unknown API endpoin... | Add old flag to old-style requests (ready for new database system) | Add old flag to old-style requests (ready for new database system)
| JavaScript | mit | felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget,felamaslen/budget |
1f11d411a5b6c915e7b35dae4d847a3ccb98e830 | src/reducers/initialState.js | src/reducers/initialState.js | export default {
restaurantReviews: {
filter: '',
searchType: 'name',
restaurants: [],
pagerNum: 1,
loading: true,
loadingError: null,
activeItem: null,
initialLoad: true,
ratingFilter: 1234
}
};
| export default {
restaurantReviews: {
filter: '',
searchType: 'name',
restaurants: [],
pagerNum: 1,
loading: true,
loadingError: null,
activeItem: null,
initialLoad: true,
ratingFilter: 0
}
};
| Set rating filter to zero | Set rating filter to zero
| JavaScript | mit | aragonwa/kc-restaurant-reviews,aragonwa/kc-restaurant-reviews |
ee776c085d9c4f064f87a1e5a093a7482ded4b57 | public/js/controllers/SignIn.js | public/js/controllers/SignIn.js | define(['jquery', 'app', 'services/User'], function ($, app) {
var services = [
{ name: 'Facebook' },
{ name: 'Github' },
{ name: 'Google' }
];
return app.controller('SignInController', ['$scope', '$window', 'userService', function (scope, win, User) {
scope.services = services;
scope.userAva... | define(['jquery', 'app', 'services/User'], function ($, app) {
var services = [
{ name: 'Facebook' },
{ name: 'Github' },
{ name: 'Google' }
];
return app.controller('SignInController', ['$scope', '$window', 'userService', 'historyService', 'settingsService',
function (scope, win, User, historySe... | Clear local storage on log out | Clear local storage on log out
| JavaScript | mit | BrettBukowski/tomatar |
6f66d99cb9bf120919991600dd96cbe066dcbe5f | phantomas.js | phantomas.js | /**
* PhantomJS-based web performance metrics collector
*
* Usage:
* node phantomas.js
* --url=<page to check>
* --debug
* --verbose
*
* @version 0.2
*/
// parse script arguments
var params = require('./lib/args').parse(phantom.args),
phantomas = require('./core/phantomas').phantomas;
// run phan... | /**
* PhantomJS-based web performance metrics collector
*
* Usage:
* node phantomas.js
* --url=<page to check>
* --debug
* --verbose
*
* @version 0.2
*/
// parse script arguments
var args = require("system").args,
params = require('./lib/args').parse(args),
phantomas = require('./core/phantomas')... | Use system module to get command line arguments | Use system module to get command line arguments
| JavaScript | bsd-2-clause | ingoclaro/phantomas,william-p/phantomas,william-p/phantomas,gmetais/phantomas,ingoclaro/phantomas,gmetais/phantomas,macbre/phantomas,macbre/phantomas,macbre/phantomas,ingoclaro/phantomas,william-p/phantomas,gmetais/phantomas |
e3e3cb7b768a6d0f2e4e64cd265f088d1713c90b | src/shared/components/idme/idme.js | src/shared/components/idme/idme.js | import React, { Component } from 'react';
import config from 'config/environment';
import troopImage from 'images/Troop.png';
import styles from './idme.css';
class Idme extends Component {
onKeyUp = (event) => {
if (event.key === 'Enter') {
this.idMe();
}
};
onClick = () => {
window.open(`${c... | import React, { Component } from 'react';
import config from 'config/environment';
import troopImage from 'images/Troop.png';
import styles from './idme.css';
class Idme extends Component {
openIDME = () => {
window.open(`${config.idmeOAuthUrl}?client_id=${config.idmeClientId}&redirect_uri=${
config.host
... | Revert refactor to keep PR scoped well | Revert refactor to keep PR scoped well
| JavaScript | mit | NestorSegura/operationcode_frontend,sethbergman/operationcode_frontend,hollomancer/operationcode_frontend,NestorSegura/operationcode_frontend,OperationCode/operationcode_frontend,sethbergman/operationcode_frontend,OperationCode/operationcode_frontend,hollomancer/operationcode_frontend,sethbergman/operationcode_frontend... |
8bcf3a1c8a8aa3d1a95f6731a277f4c27b292e37 | test/can_test.js | test/can_test.js | steal('can/util/mvc.js')
.then('funcunit/qunit',
'can/test/fixture.js')
.then(function() {
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
})
.then('./mvc_test.js',
'can/construct/construct_test.js',
'can/observe/observe_test.js',
'can/view/view_test.js',
'can/control/contro... | steal('can/util/mvc.js')
.then('funcunit/qunit',
'can/test/fixture.js')
.then(function() {
var oldmodule = window.module,
library = 'jQuery';
// Set the test timeout to five minutes
QUnit.config.testTimeout = 300000;
if (window.STEALDOJO){
library = 'Dojo';
} else if( window.STEALMOO) {
library = 'Mooto... | Add library name to QUnit modules | Add library name to QUnit modules
| JavaScript | mit | yusufsafak/canjs,Psykoral/canjs,rasjani/canjs,whitecolor/canjs,tracer99/canjs,bitovi/canjs,bitovi/canjs,airhadoken/canjs,schmod/canjs,asavoy/canjs,jebaird/canjs,thecountofzero/canjs,beno/canjs,WearyMonkey/canjs,Psykoral/canjs,UXsree/canjs,gsmeets/canjs,juristr/canjs,cohuman/canjs,cohuman/canjs,bitovi/canjs,patrick-stee... |
c454f86695e6360e31d7539967979185e4732655 | src/Sprite.js | src/Sprite.js | /**
* Creates an utility to manage sprites.
*
* @param Image The image data of the sprite
*/
var Sprite = function(img) {
this.img = img;
this.descriptors = [];
};
Sprite.prototype = {
registerId: function(id, position, width, height) {
this.descriptors.push({
id: id,
po... | /**
* Creates an utility to manage sprites.
*
* @param Image The image data of the sprite
*/
var Sprite = function(img) {
this.img = img;
this.descriptors = [];
};
Sprite.prototype = {
registerIds: function(array) {
for(var i = array.length - 1; i >= 0; i--) {
this.registerId(
... | Add ability to register multiple sprite ids at once | Add ability to register multiple sprite ids at once
| JavaScript | mit | bendem/JsGameLib |
49f7f0e3a2c4f00d38c5ad807c38f94a447e1376 | lib/exec/source-map.js | lib/exec/source-map.js | var fs = require('fs'),
sourceMap = require('source-map');
module.exports.create = function() {
var cache = {};
function loadSourceMap(file) {
try {
var body = fs.readFileSync(file + '.map');
return new sourceMap.SourceMapConsumer(body.toString());
} catch (err) {
/* NOP */
}
}... | var fs = require('fs'),
sourceMap = require('source-map');
module.exports.create = function() {
var cache = {};
function loadSourceMap(file) {
try {
var body = fs.readFileSync(file + '.map');
return new sourceMap.SourceMapConsumer(body.toString());
} catch (err) {
/* NOP */
}
}... | Drop unused sourcemap reset API | Drop unused sourcemap reset API | JavaScript | mit | walmartlabs/fruit-loops,walmartlabs/fruit-loops |
8fd27f37f55e3c8105fc15698d10575839cbe213 | catson/static/catson.js | catson/static/catson.js | function handleFileSelect(evt) {
evt.stopPropagation();
evt.preventDefault();
$('#drop_zone').remove();
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var img = new Image;
img.src = URL.createObjectURL(evt.dataTransfer.files[0]);
img.onload = function() {
canvas... | function handleFileSelect(evt) {
evt.stopPropagation();
evt.preventDefault();
$('#drop_zone').remove();
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var img = new Image;
img.src = URL.createObjectURL(evt.dataTransfer.files[0]);
img.onload = function() {
canvas... | Work out how many cats to draw | Work out how many cats to draw
| JavaScript | mit | richo/catson.me,richo/catson.me |
8eb18fbf907a7612c3928eeb598edf7830b8094b | lib/model/arrayList.js | lib/model/arrayList.js | var createClass = require('../utilities/createClass');
var Lang = require('../utilities/lang');
var ArrayList = createClass({
instance: {
constructor: function() {
debugger;
},
_backing: [],
add: function(el, index) {
if (!Lang.isNumber(index)) {
index = this._backing.length;
... | var createClass = require('../utilities/createClass');
var Lang = require('../utilities/lang');
var ArrayList = createClass({
constructor: function() {
this._backing = [];
},
instance: {
add: function(el, index) {
if (!Lang.isNumber(index)) {
index = this._backing.length;
}
if... | Fix bug: all arraylists were the same | Fix bug: all arraylists were the same
| JavaScript | apache-2.0 | twosigma/goll-e,RobertWarrenGilmore/goll-e,RobertWarrenGilmore/goll-e,twosigma/goll-e |
83ba65a17c8af9782681cb99a1fa1fdcd99c296c | src/server.js | src/server.js | var http = require('http');
var handler = require('./handler.js');
var dictionaryFile = require('./readDictionary.js');
var server = http.createServer(handler);
function startServer() {
dictionaryFile.readDictionary(null,null, function() {
server.listen(3000, function(){
console.log("Dictionary loaded, server... | var http = require('http');
var handler = require('./handler.js');
var dictionaryFile = require('./readDictionary.js');
var server = http.createServer(handler);
var port = process.env.PORT || 3000;
function startServer() {
dictionaryFile.readDictionary(null,null, function() {
server.listen(port, function(){
c... | Change port variable to process.env.PORT for heroku deployment | Change port variable to process.env.PORT for heroku deployment
| JavaScript | mit | NodeGroup2/autocomplete-project,NodeGroup2/autocomplete-project |
19de825c36cb0b53fbfb92500507b9eb13d63f68 | backend/servers/mcapid/initializers/apikey.js | backend/servers/mcapid/initializers/apikey.js | const {Initializer, api} = require('actionhero');
const apikeyCache = require('../lib/apikey-cache');
module.exports = class APIKeyInitializer extends Initializer {
constructor() {
super();
this.name = 'apikey';
this.startPriority = 1000;
}
initialize() {
// ***************... | const {Initializer, api} = require('actionhero');
const apikeyCache = require('../lib/apikey-cache');
module.exports = class APIKeyInitializer extends Initializer {
constructor() {
super();
this.name = 'apikey';
this.startPriority = 1000;
}
initialize() {
const middleware =... | Reformat and remove commented out code | Reformat and remove commented out code
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
ac6962630953b3387f95422049b0b1c01b981966 | server/commands/redux/reduxDispatchPrompt.js | server/commands/redux/reduxDispatchPrompt.js | import RS from 'ramdasauce'
const COMMAND = 'redux.dispatch.prompt'
/**
Prompts for a path to grab some redux keys from.
*/
const process = (context, action) => {
context.prompt('Action to dispatch', (value) => {
let action = null
// try not to blow up the frame
try {
eval('action = ' + value) //... | import RS from 'ramdasauce'
const COMMAND = 'redux.dispatch.prompt'
/**
Prompts for a path to grab some redux keys from.
*/
const process = (context, action) => {
context.prompt('Action to dispatch (e.g. {type: \'MY_ACTION\'})', (value) => {
let action = null
// try not to blow up the frame
try {
... | Add a more detailed prompt for dispatching an action | Add a more detailed prompt for dispatching an action
| JavaScript | mit | infinitered/reactotron,reactotron/reactotron,rmevans9/reactotron,reactotron/reactotron,rmevans9/reactotron,infinitered/reactotron,reactotron/reactotron,rmevans9/reactotron,rmevans9/reactotron,infinitered/reactotron,reactotron/reactotron,infinitered/reactotron,reactotron/reactotron,rmevans9/reactotron |
d9b11cd20e08cd9b71052c9141f3f9f9bcca57fb | client/utils/fetcher.js | client/utils/fetcher.js | import fetch from 'isomorphic-fetch';
import _ from 'lodash';
import { push } from 'react-router-redux';
async function request(url, userOptions, dispatch) {
const defaultOptions = {
credentials: 'same-origin',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Co... | import fetch from 'isomorphic-fetch';
import _ from 'lodash';
import { push } from 'react-router-redux';
// grab the CSRF token from the cookie
const csrfToken = document.cookie.replace(/(?:(?:^|.*;\s*)csrftoken\s*=s*([^;]*).*$)|^.*$/, '$1');
async function request(url, userOptions, dispatch) {
const defaultOptions... | Add CSRF token to all requests | Add CSRF token to all requests
| JavaScript | apache-2.0 | ctcusc/django-react-boilerplate,ctcusc/django-react-boilerplate,ctcusc/django-react-boilerplate,ctcusc/django-react-boilerplate |
47da0f80a936649d64c53c522e30ea2386276455 | themes/default/config.js | themes/default/config.js | (function(c) {
/*
* !!! CHANGE THIS !!!
*/
c["general"].rootUrl = '//localhost/resto2/';
/*
* !! DO NOT EDIT UNDER THIS LINE !!
*/
c["general"].serverRootUrl = null;
c["general"].proxyUrl = null;
c["general"].confirmDeletion = false;
c["general"].themePath = "/js/li... | (function(c) {
/*
* !!! CHANGE THIS !!!
*/
c["general"].rootUrl = '//localhost/resto2/';
/*
* !! DO NOT EDIT UNDER THIS LINE !!
*/
c["general"].serverRootUrl = null;
c["general"].proxyUrl = null;
c["general"].confirmDeletion = false;
c["general"].themePath = "/js/li... | Replace Bing maps by OpenStreetMap to avoid licensing issue | [THEIA] Replace Bing maps by OpenStreetMap to avoid licensing issue | JavaScript | apache-2.0 | atospeps/resto,Baresse/resto2,RailwayMan/resto,RailwayMan/resto,Baresse/resto2,atospeps/resto,jjrom/resto,jjrom/resto |
ed307dc8e1e7c83433d1589fc977e724efbcda77 | config.js | config.js | var path = require('path'),
config;
config = {
production: {
url: process.env.BASE_URL || 'http://blog.ertrzyiks.pl/',
mail: {},
database: {
client: 'postgres',
connection: process.env.DATABASE_URL
},
server: {
host: '0.0.0.0',
... | var path = require('path'),
config;
config = {
production: {
url: process.env.BASE_URL || 'http://blog.ertrzyiks.pl/',
mail: {},
database: {
client: 'postgres',
connection: process.env.DATABASE_URL,
pool: { min: 0, max: 2 }
},
serve... | Set max connection pool limit | Set max connection pool limit
| JavaScript | mit | ertrzyiks/blog.ertrzyiks.pl,ertrzyiks/blog.ertrzyiks.pl,ertrzyiks/blog.ertrzyiks.pl |
b607a3c6157948aab36b056c02d0d126450f56a8 | amaranth-chrome-ext/src/background.js | amaranth-chrome-ext/src/background.js | chrome.webNavigation.onHistoryStateUpdated.addListener(function({url}) {
// Code should only be injected if on a restaurant's page
if (url.includes('restaurant')) {
const scriptsToInject = [
'lib/tf.min.js',
'src/CalorieLabel.js',
'src/AmaranthUtil.js',
's... | chrome.webNavigation.onHistoryStateUpdated.addListener(function({url}) {
// Code should only be injected if on grubhub.com/restaurant/...
if (url.includes('restaurant')) {
const scriptsToInject = [
'lib/tf.min.js',
'src/CalorieLabel.js',
'src/AmaranthUtil.js',
... | Insert CSS along with JS on statePush | Insert CSS along with JS on statePush
| JavaScript | apache-2.0 | googleinterns/amaranth,googleinterns/amaranth |
ae0cdf06604abb68774e8e36f873df3b65de0cf3 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | Add missing menu collapse functionality | Add missing menu collapse functionality
| JavaScript | mit | user890104/fauna,user890104/fauna,user890104/fauna,initLab/fauna,initLab/fauna,initLab/fauna |
fc6040a58f26f1a0b54700fc90ddd633f1326ff5 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | Remove finishedLoading() call, change timeout to 500 from 5000 | Remove finishedLoading() call, change timeout to 500 from 5000
| JavaScript | mit | fma2/nyc-high-school-programs,fma2/nyc-high-school-programs |
47d86fff8bc283772af80dc241169ee32972085b | src/parsers/guides/legend-title.js | src/parsers/guides/legend-title.js | import {GuideTitleStyle} from './constants';
import guideMark from './guide-mark';
import {lookup} from './guide-util';
import {TextMark} from '../marks/marktypes';
import {LegendTitleRole} from '../marks/roles';
import {addEncode, encoder} from '../encode/encode-util';
export default function(spec, config, userEncode... | import {GuideTitleStyle} from './constants';
import guideMark from './guide-mark';
import {lookup} from './guide-util';
import {TextMark} from '../marks/marktypes';
import {LegendTitleRole} from '../marks/roles';
import {addEncode, encoder} from '../encode/encode-util';
export default function(spec, config, userEncode... | Fix legend title to respond to legend padding changes. | Fix legend title to respond to legend padding changes.
| JavaScript | bsd-3-clause | vega/vega-parser |
7b090d0d9144546c583702d04b41b74f6f408861 | cli/index.js | cli/index.js | #!/usr/bin/env node
const cli = require('commander');
const path = require('path');
const glob = require('glob');
const options = {
realpath: true,
cwd: path.resolve(__dirname, './lib'),
};
glob
.sync('*/index.js', options)
.map(require)
.forEach(fn => fn(cli));
cli.version('0.0.6-alpha');
cli.parse(proce... | #!/usr/bin/env node
const cli = require('commander');
const path = require('path');
const glob = require('glob');
const options = {
realpath: true,
cwd: path.resolve(__dirname, './lib'),
};
glob
.sync('*/index.js', options)
.map(require)
.forEach(fn => fn(cli));
cli.version('0.0.7-alpha');
cli.parse(proce... | Update CLI version to 0.0.7-alpha | Update CLI version to 0.0.7-alpha
| JavaScript | mit | ArturAralin/express-object-router |
8ba6b443ea4d5a3ad49ae6121130dc987d9a375e | utils.js | utils.js | 'use strict';
const assert = require('assert');
const url = require('url');
/**
* @param engine {string}
* @param id {string}
* @returns {string}
*/
function getPlatformStatusId(engine, id) {
return engine + '-' + encodeURIComponent(id);
}
const PLATFORM_STATUS_URL_MAP = new Map([
['chromium', 'https://... | 'use strict';
const assert = require('assert');
const url = require('url');
/**
* @param engine {string}
* @param id {string}
* @returns {string}
*/
function getPlatformStatusId(engine, id) {
return engine + '-' + encodeURIComponent(id);
}
const PLATFORM_STATUS_URL_MAP = new Map([
['chromium', 'https://... | Fix platform status url of webkit | Fix platform status url of webkit
| JavaScript | mit | takenspc/ps-viewer,takenspc/ps-viewer |
1dab7f5cd24b0995a28ab4bab3884e313dbda0cb | server/models/borrowrequests.js | server/models/borrowrequests.js | import * as Sequelize from 'sequelize';
import { v4 as uuidv4 } from 'uuid';
const borrowRequestSchema = (sequelize) => {
const BorrowRequests = sequelize.define('BorrowRequests', {
id: {
type: Sequelize.UUID,
allowNull: false,
primaryKey: true,
defaultValue: uuidv4(),
},
reason: ... | import * as Sequelize from 'sequelize';
import { v4 as uuidv4 } from 'uuid';
const borrowRequestSchema = (sequelize) => {
const BorrowRequests = sequelize.define('BorrowRequests', {
id: {
type: Sequelize.UUID,
allowNull: false,
primaryKey: true,
defaultValue: uuidv4(),
},
reason: ... | Add model for borrow requests | Add model for borrow requests
| JavaScript | mit | amarachukwu-agbo/hello-books,amarachukwu-agbo/hello-books |
a42809d946e00e5542531f06ad52c11d7481c95d | server/votes/votesController.js | server/votes/votesController.js | var Vote = require( './votes' );
module.exports = {
getAllVotes: function() {},
addVote: function() {}
};
| var Vote = require( './votes' );
module.exports = {
getAllVotes: function() {},
addVote: function( req, res, next ) {
console.log( 'TESTING: addVote', req.body );
res.send( 'TESTING: vote added' );
}
};
| Add placeholder functionality to votes controller on server side | Add placeholder functionality to votes controller on server side
| JavaScript | mpl-2.0 | RubiginousChanticleer/rubiginouschanticleer,CantillatingZygote/rubiginouschanticleer,CantillatingZygote/rubiginouschanticleer,RubiginousChanticleer/rubiginouschanticleer |
b2c5d65ef0ad3d86f76616805eff5f548a1168a4 | test/index.js | test/index.js | import 'es5-shim';
beforeEach(() => {
sinon.stub(console, 'error');
});
afterEach(() => {
if (typeof console.error.restore === 'function') {
assert(!console.error.called, () => {
return `${console.error.getCall(0).args[0]} \nIn '${this.currentTest.fullTitle()}'`;
});
console.error.restore();
}... | import 'es5-shim';
beforeEach(() => {
sinon.stub(console, 'error');
});
afterEach(function checkNoUnexpectedWarnings() {
if (typeof console.error.restore === 'function') {
assert(!console.error.called, () => {
return `${console.error.getCall(0).args[0]} \nIn '${this.currentTest.fullTitle()}'`;
});
... | Fix logging from afterEach hook in tests | Fix logging from afterEach hook in tests
| JavaScript | mit | react-bootstrap/react-bootstrap,apkiernan/react-bootstrap,dozoisch/react-bootstrap,react-bootstrap/react-bootstrap,egauci/react-bootstrap,jesenko/react-bootstrap,mmarcant/react-bootstrap,Lucifier129/react-bootstrap,Sipree/react-bootstrap,Lucifier129/react-bootstrap,glenjamin/react-bootstrap,HPate-Riptide/react-bootstra... |
d613bc2e1c500df22978b9ca8f70058f00ac3d4b | src/system-extension-contextual.js | src/system-extension-contextual.js | addStealExtension(function (loader) {
loader._contextualModules = {};
loader.setContextual = function(moduleName, definer){
this._contextualModules[moduleName] = definer;
};
var normalize = loader.normalize;
loader.normalize = function(name, parentName){
var loader = this;
if (parentName) {
... | addStealExtension(function (loader) {
loader._contextualModules = {};
loader.setContextual = function(moduleName, definer){
this._contextualModules[moduleName] = definer;
};
var normalize = loader.normalize;
loader.normalize = function(name, parentName){
var loader = this;
var pluginLoader = loader... | Use pluginLoader in contextual extension | Use pluginLoader in contextual extension
If a contextual module is defined passing a string as the `definer`
parameter, the `pluginLoader` needs to be used to dynamically load the
`definer` function; otherwise steal-tools won't build the app.
Closes #952
| JavaScript | mit | stealjs/steal,stealjs/steal |
c4e09637aa700ad08cea7948b6156acaaaf17157 | 404/main.js | 404/main.js | // 404 page using mapbox to show cities around the world.
// Helper to generate the kind of coordinate pairs I'm using to store cities
function bounds() {
var center = map.getCenter();
return {lat: center.lat, lng: center.lng, zoom: map.getZoom()};
}
L.mapbox.accessToken = "pk.eyJ1IjoiY29udHJvdmVyc2lhbCIsImEiOiJ... | // 404 page using mapbox to show cities around the world.
// Helper to generate the kind of coordinate pairs I'm using to store cities
function bounds() {
var center = map.getCenter();
return {lat: center.lat, lng: center.lng, zoom: map.getZoom()};
}
L.mapbox.accessToken = "pk.eyJ1IjoiY29udHJvdmVyc2lhbCIsImEiOiJ... | Simplify 'go' for string identifiers | Simplify 'go' for string identifiers
| JavaScript | mit | controversial/controversial.io,controversial/controversial.io,controversial/controversial.io |
2c604630deb0c5f5a4befd08735c7795ad2480b3 | examples/ice-configuration.js | examples/ice-configuration.js | var quickconnect = require('../');
var opts = {
ns: 'dctest',
iceServers: [
{ url: 'stun:stun.l.google.com:19302' }
]
};
quickconnect('http://rtc.io/switchboard/', opts)
// tell quickconnect we want a datachannel called test
.createDataChannel('test')
// when the test channel is open, let us know
.on... | var quickconnect = require('../');
var opts = {
ns: 'dctest',
iceServers: [
{ url: 'stun:stun.l.google.com:19302' }
]
};
quickconnect('http://rtc.io/switchboard/', opts)
// tell quickconnect we want a datachannel called test
.createDataChannel('iceconfig')
// when the test channel is open, let us know
... | Tweak example to use a configured channel name | Tweak example to use a configured channel name
| JavaScript | apache-2.0 | rtc-io/rtc-quickconnect,rtc-io/rtc-quickconnect |
d1078188378529d084c059b06fe2e1157adc034c | webclient/app/common/ec-as-date.js | webclient/app/common/ec-as-date.js |
(function(){
'use strict';
angular
.module('everycent.common')
.directive('ecAsDate', ecAsDate);
ecAsDate.$inject = [];
function ecAsDate(){
var directive = {
restrict:'A',
require:'ngModel',
link: link
};
return directive;
function link(scope, element, attrs, ngMod... |
(function(){
'use strict';
angular
.module('everycent.common')
.directive('ecAsDate', ecAsDate);
ecAsDate.$inject = [];
function ecAsDate(){
var directive = {
restrict:'A',
require:'ngModel',
link: link
};
return directive;
function link(scope, element, attrs, ngMod... | Fix the issue with dates not being in the correct timezone | Fix the issue with dates not being in the correct timezone
| JavaScript | mit | snorkpete/everycent,snorkpete/everycent,snorkpete/everycent,snorkpete/everycent,snorkpete/everycent |
fe48398d485afe58415688a50479c6fe0ace33c0 | examples/minimal-formatter.js | examples/minimal-formatter.js | var example = require("washington")
var assert = require("assert")
var color = require("cli-color")
example.use({
success: function (success, report) {
process.stdout.write(color.green("."))
},
pending: function (pending, report) {
process.stdout.write(color.yellow("-"))
},
failure: function (fa... | var example = require("washington")
var assert = require("assert")
var RED = "\u001b[31m"
var GREEN = "\u001b[32m"
var YELLOW = "\u001b[33m"
var CLEAR = "\u001b[0m"
example.use({
success: function (success, report) {
process.stdout.write(GREEN + "." + CLEAR)
},
pending: function (pend... | Drop dependency on cli-color in example | Drop dependency on cli-color in example
[skip ci]
| JavaScript | bsd-2-clause | xaviervia/washington,xaviervia/washington |
ce63223ec6191228eecc05108b4af4569becf059 | src/front/js/components/__tests__/Header.spec.js | src/front/js/components/__tests__/Header.spec.js | jest.unmock('../Header');
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import { Header } from '../Header';
xdescribe('Header', () => {
it('should have title', () => {
const container = <Header name="test title" />;
const DOM = TestUtils.renderIntoDocument(container)... | import React from "react";
import Header from "../Header";
import { shallow } from "enzyme";
describe('Header', () => {
let wrapper;
it('should have only title', () => {
const props = {
name: 'name'
};
wrapper = shallow(<Header {...props} />);
expect(wrapper.find('.... | Fix unit tests for Header component | Fix unit tests for Header component
| JavaScript | mit | raccoon-app/ui-kit,raccoon-app/ui-kit |
10c444078b93f8ac179235584fb43a02b314f3f0 | desktop/app/dockIcon.js | desktop/app/dockIcon.js | import app from 'app'
var visibleCount = 0
export default function () {
if (++visibleCount === 1) {
app.dock.show()
}
let alreadyHidden = false
return () => {
if (alreadyHidden) {
throw new Error('Tried to hide the dock icon twice')
}
alreadyHidden = true
if (--visibleCount === 0) {
... | import app from 'app'
var visibleCount = 0
export default (() => {
if (!app.dock) {
return () => () => {}
}
return function () {
if (++visibleCount === 1) {
app.dock.show()
}
let alreadyHidden = false
return () => {
if (alreadyHidden) {
throw new Error('Tried to hide the ... | Make dock management a noop when dock doesn't exist | Make dock management a noop when dock doesn't exist
| JavaScript | bsd-3-clause | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client |
c933f9b91599f56d8ad5a946083b4a402c2133cc | src/logger.js | src/logger.js | const _ = require('lodash');
const { Logger, transports: { Console } } = require('winston');
module.exports = function wrappedDebug(module) {
const logger = new Logger({
level: 'info',
transports: [
new (Console)({
json: true,
stringify: true,
}),
],
});
[
'error',
... | const _ = require('lodash');
const { Logger, transports: { Console } } = require('winston');
module.exports = function wrappedDebug(module) {
const logger = new Logger({
level: 'info',
transports: [
new (Console)({
json: true,
stringify: true,
handleExceptions: true,
}),
... | Update winston to handle uncaught exceptions | Update winston to handle uncaught exceptions
| JavaScript | mit | cbaclig/amion-scraper |
cf5178d1f603a4c029f5cb70250f002543195eea | test/document_update_spec.js | test/document_update_spec.js | var assert = require("assert");
var helpers = require("./helpers");
describe('Document updates,', function(){
var db;
before(function(done){
helpers.resetDb(function(err, res){
db = res;
done();
});
});
// update objects set body=jsonb_set(body, '{name,last}', '', true) where id=3;
desc... | var assert = require("assert");
var helpers = require("./helpers");
describe('Document updates,', function(){
var db;
before(function(done){
helpers.resetDb(function(err, res){
db = res;
done();
});
});
// update objects set body=jsonb_set(body, '{name,last}', '', true) where id=3;
desc... | Add example error check to tests | Add example error check to tests
| JavaScript | bsd-3-clause | ludvigsen/massive-js,robconery/massive-js |
0c89717bfca88ae7a345450da3d922bddb59507e | test/html/js/minify/index.js | test/html/js/minify/index.js | import sinon from 'sinon';
import chai from 'chai';
const expect = chai.expect;
import * as fetch from '../../../../src/functions/fetch.js';
import checkMinifiedJs from '../../../../src/html/js/minify';
describe('html', function() {
describe('test minify promise', function() {
let sandbox;
beforeEach(functi... | import sinon from 'sinon';
import chai from 'chai';
const expect = chai.expect;
import * as fetch from '../../../../src/functions/fetch.js';
import checkMinifiedJs from '../../../../src/html/js/minify';
describe('html', function() {
describe('test minify promise', function() {
let sandbox;
beforeEach(functi... | Fix js minify promise test | Fix js minify promise test
| JavaScript | mit | juffalow/pentest-tool-lite,juffalow/pentest-tool-lite |
6ff0d1e0517379a432f84bade6817285058ffaf1 | src/index.js | src/index.js | import 'index.scss';
import 'script-loader!TimelineJS3/compiled/js/timeline.js';
import generateTimeline from './timeline';
generateTimeline().then(timeline => {
window.timeline = timeline; // eslint-disable-line no-undef
});
| import 'index.scss';
import 'script-loader!TimelineJS3/compiled/js/timeline-min.js';
import generateTimeline from './timeline';
generateTimeline().then(timeline => {
window.timeline = timeline; // eslint-disable-line no-undef
});
| Load minified version of TimelineJS3 | Load minified version of TimelineJS3
Shaves another ~200kB off of the javascript we ship in production. If we're debugging issues inside of TimelineJS3, we aren't really working on our timeline anymore!
| JavaScript | mit | L4GG/timeline,L4GG/timeline,L4GG/timeline |
5c149bc0399bd39675ee02dd3c2f03fed9b7d850 | src/index.js | src/index.js | 'use strict';
const React = require('react');
const icon = require('./GitHub-Mark-64px.png');
const Preview = require('./preview');
const githubPlugin = ({term, display, actions}) => {
display({
id: 'github',
icon,
title: `Search github for ${term}`,
subtitle: `You entered ${term}`,
getPreview: (... | 'use strict';
const React = require('react');
const icon = require('./GitHub-Mark-64px.png');
const Preview = require('./preview');
const githubPlugin = ({term, display, actions}) => {
display({
id: 'github',
icon,
order: 11,
title: `Search github for ${term}`,
subtitle: `You entered ${term}`,
... | Update to ensure plugin searches on full user input | Update to ensure plugin searches on full user input
| JavaScript | mit | tenorz007/cerebro-github,tenorz007/cerebro-github |
bd9bd8137c46112a83209a6890c37bd0bdf45fd8 | src/index.js | src/index.js | var Alexa = require('alexa-sdk');
var APP_ID = 'amzn1.ask.skill.85ae7ea2-b727-4d2a-9765-5c563a5ec379';
var SKILL_NAME = 'Snack Overflow';
var POSSIBLE_RECIPIES = [ 'Chicken Parmesan', 'Spaghetti', 'Turkey Sandwich' ];
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context,... | var Alexa = require('alexa-sdk');
var APP_ID = 'amzn1.ask.skill.85ae7ea2-b727-4d2a-9765-5c563a5ec379';
var SKILL_NAME = 'Snack Overflow';
var POSSIBLE_RECIPES = ['Chicken Parmesan', 'Spaghetti', 'Turkey Sandwich'];
var WORKFLOW_STATES = {
START : 1,
RECIPE_GIVEN : 2
};
var currentWorkflowState = WORKFLOW_ST... | Add in state-based logic for switching between Alexa commands. | Add in state-based logic for switching between Alexa commands.
| JavaScript | mit | cwboden/amazon-hackathon-alexa |
db68227c3a02dcc059839592de9076abe52d3bfe | js/server.js | js/server.js | var http = require('http');
var util = require('./util');
var counter = 0;
var port = 1337;
http.createServer(function (req, res) {
var answer = util.helloWorld();
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(answer + '\nYou are user number ' + counter + '.');
counter = counter + 1;
... | var http = require('http');
var util = require('./util');
var counter = 0;
var port = 1337;
http.createServer(function (req, res) {
var answer = util.helloWorld();
counter = counter + 1;
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(answer + '\nYou are user number ' + counter + '.');
... | FIX Increase counter before printing it | FIX Increase counter before printing it
| JavaScript | mit | fhinkel/SimpleChatServer,fhinkel/SimpleChatServer |
d130e6373de4b79cd414d6b02e37eecce1aee97d | public/javascripts/app/views/gameController.js | public/javascripts/app/views/gameController.js | define([
'Backbone',
//Templates
'text!templates/project-page/closeGameTemplate.html'
], function(
Backbone,
//Template
closeGameTemplate
){
var GameController = Backbone.View.extend({
template: _.template(closeGameTemplate),
close: function(event){
var task = this.selectedTask.get('id... | define([
'Backbone',
//Templates
'text!templates/project-page/closeGameTemplate.html'
], function(
Backbone,
//Template
closeGameTemplate
){
var GameController = Backbone.View.extend({
template: _.template(closeGameTemplate),
close: function(event){
var task = this.selectedTask.get('id... | Remove the task only once | Remove the task only once
| JavaScript | mit | tangosource/pokerestimate,tangosource/pokerestimate |
2daacc00b849da8a3e86c089fe1768938486bd2b | draft-js-dnd-plugin/src/modifiers/onDropFile.js | draft-js-dnd-plugin/src/modifiers/onDropFile.js | import AddBlock from './addBlock';
export default function(config) {
return function(e){
const {props, selection, files, editorState, onChange} = e;
// Get upload function from config or editor props
const upload = config.upload || props.upload;
if (upload) {
//this.setS... | import AddBlock from './addBlock';
export default function(config) {
return function(e){
const {props, selection, files, editorState, onChange} = e;
// Get upload function from config or editor props
const upload = config.upload || props.upload;
if (upload) {
//this.setS... | Allow the upload function to acces not only formData, but also the raw files | Allow the upload function to acces not only formData, but also the raw files
| JavaScript | mit | dagopert/draft-js-plugins,nikgraf/draft-js-plugin-editor,nikgraf/draft-js-plugin-editor,draft-js-plugins/draft-js-plugins-v1,draft-js-plugins/draft-js-plugins,draft-js-plugins/draft-js-plugins,koaninc/draft-js-plugins,dagopert/draft-js-plugins,dagopert/draft-js-plugins,koaninc/draft-js-plugins,draft-js-plugins/draft-js... |
1853e1519030caaeeb7f31017d98823aa5696daf | flow-github/metro.js | flow-github/metro.js | /**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
declare module 'metro' {
declare module.exports: any;
}
declare module 'metro/src/lib/TerminalReporter' {
de... | /**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
declare module 'metro' {
declare module.exports: any;
}
declare module 'metro/src/HmrServer' {
declare modul... | Add open source Flow declaration for Metro module | Add open source Flow declaration for Metro module
Summary:
Fix Flow failure by adding a declaration to the Flow config used in open source. This did not get caught internally because we use a different Flow config.
Release Notes
-------------
[INTERNAL] [MINOR] [Flow] - Fix Flow config.
Reviewed By: rafeca
Differen... | JavaScript | bsd-3-clause | hammerandchisel/react-native,hoangpham95/react-native,javache/react-native,exponent/react-native,facebook/react-native,hammerandchisel/react-native,javache/react-native,arthuralee/react-native,hammerandchisel/react-native,javache/react-native,exponentjs/react-native,exponent/react-native,pandiaraj44/react-native,pandia... |
2ca2a8144d19b46da40a24932471f8ea5f6c9c72 | signature.js | signature.js | // source:
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
thr... | var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
throw new TypeE... | Remove noisy & pointless comment | Remove noisy & pointless comment
| JavaScript | mit | grncdr/js-pockets |
196e3fded155835c52ac56a1847a1dfb21fbdd1c | api/models/index.js | api/models/index.js | const Sequelize = require('sequelize');
const env = process.env.NODE_ENV || 'development';
const config = require('../config/config.json')[env];
const sequelize = new Sequelize(config.database, config.username, config.password, config);
module.exports = sequelize;
| const Sequelize = require('sequelize');
const env = process.env.NODE_ENV || 'development';
const config = require('../config/config.json')[env];
const sequelize = (() => {
if (config.use_env_variable) {
return new Sequelize(process.env[config.use_env_variable], config);
}
return new Sequelize(config.database, co... | Implement use_env_variable in main app logic | Implement use_env_variable in main app logic
| JavaScript | mit | tsg-ut/mnemo,tsg-ut/mnemo |
5f848210657e1a10260e277c49d584ea5a10fc2d | client/app/scripts/services/action.js | client/app/scripts/services/action.js | angular
.module('app')
.factory('actionService', [
'$http',
'$resource',
function($http, $resource) {
var Action = $resource('/api/actions/:id',
{ id: '@id' }
);
Action.hasUserActed = function(project_id, user_id) {
return $http.get('/api/actions/hasUserActe... | angular
.module('app')
.factory('actionService', [
'$http',
'$resource',
function($http, $resource) {
var Action = $resource('/api/actions/:id',
{ id: '@id' }
);
Action.hasUserActed = function(project_id, user_id) {
return $http.get('/api/actions/hasUserActe... | Add service function to get all activity | Add service function to get all activity
| JavaScript | mit | brettshollenberger/rootstrikers,brettshollenberger/rootstrikers |
3a765c088255b7c2b5485d6566efc736519b2372 | devServer.js | devServer.js | var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var config = require('./webpack.config');
var po... | var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var config = require('./webpack.config');
var po... | Update to use env port | Update to use env port
| JavaScript | mit | Irraquated/gryph,Irraquated/gryph,FakeSloth/gryph,FakeSloth/gryph |
71f21303b3aff0e7cf4e3f52fb5c1e95984b9970 | generators/needle/needle-base.js | generators/needle/needle-base.js | const chalk = require('chalk');
const jhipsterUtils = require('../utils');
module.exports = class {
addBlockContentToFile(fullPath, content, needleTag) {
try {
jhipsterUtils.rewriteFile(
{
file: fullPath,
needle: needleTag,
... | const chalk = require('chalk');
const jhipsterUtils = require('../utils');
module.exports = class {
constructor(generator) {
this.generator = generator;
}
addBlockContentToFile(rewriteFileModel, errorMessage) {
try {
jhipsterUtils.rewriteFile(
{
... | Define constructor and add generateFileModel | Define constructor and add generateFileModel
| JavaScript | apache-2.0 | dynamicguy/generator-jhipster,ruddell/generator-jhipster,jhipster/generator-jhipster,sendilkumarn/generator-jhipster,mosoft521/generator-jhipster,cbornet/generator-jhipster,mosoft521/generator-jhipster,pascalgrimaud/generator-jhipster,PierreBesson/generator-jhipster,vivekmore/generator-jhipster,wmarques/generator-jhips... |
4b0dfc61b9d837724df287b7a9d86eedb35f4060 | website/src/app/global.services/store/mcstore.js | website/src/app/global.services/store/mcstore.js | import MCStoreBus from './mcstorebus';
export const EVTYPE = {
EVUPDATE: 'EVUPDATE',
EVREMOVE: 'EVREMOVE',
EVADD: 'EVADD'
};
const _KNOWN_EVENTS = _.values(EVTYPE);
function isKnownEvent(event) {
return _.findIndex(_KNOWN_EVENTS, event) !== -1;
}
export class MCStore {
constructor(initialState) ... | import MCStoreBus from './mcstorebus';
export const EVTYPE = {
EVUPDATE: 'EVUPDATE',
EVREMOVE: 'EVREMOVE',
EVADD: 'EVADD'
};
const _KNOWN_EVENTS = _.values(EVTYPE);
function isKnownEvent(event) {
return _KNOWN_EVENTS.indexOf(event) !== -1;
}
export class MCStore {
constructor(initialState) {
... | Switch Array.indexOf to determine if event string exists | Switch Array.indexOf to determine if event string exists
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
197e6eeeed36e81b5b87375ea7e2446455ca112c | jquery.initialize.js | jquery.initialize.js | // Complete rewrite of adampietrasiak/jquery.initialize
// @link https://github.com/adampietrasiak/jquery.initialize
// @link https://github.com/dbezborodovrp/jquery.initialize
;(function($) {
var MutationSelectorObserver = function(selector, callback) {
this.selector = selector;
this.callback = callback;
}
var ... | // Complete rewrite of adampietrasiak/jquery.initialize
// @link https://github.com/adampietrasiak/jquery.initialize
// @link https://github.com/dbezborodovrp/jquery.initialize
;(function($) {
var MutationSelectorObserver = function(selector, callback) {
this.selector = selector;
this.callback = callback;
}
var ... | Add support for observing attributes. | Add support for observing attributes.
| JavaScript | mit | AdamPietrasiak/jquery.initialize,timpler/jquery.initialize,AdamPietrasiak/jquery.initialize,timpler/jquery.initialize |
f0827ef606c7f11edb1767853d8ed9b052faa7de | gui/dev/fix-dist-artifacts.js | gui/dev/fix-dist-artifacts.js | #!/usr/bin/env node
const fs = require('fs')
function fixFile (file, bad, good) {
if (fs.existsSync(file)) {
console.log('Fixing ' + file + ' ...')
fs.writeFileSync(file, fs.readFileSync(file, 'utf8').replace(bad, good))
}
}
// electron-builder uses the app/package.name instead of .productName to
// gene... | #!/usr/bin/env node
const fs = require('fs')
function fixFile (file, bad, good) {
if (fs.existsSync(file)) {
console.log('Fixing ' + file + ' ...')
fs.writeFileSync(file, fs.readFileSync(file, 'utf8').replace(bad, good))
}
}
// electron-builder uses the app/package.name instead of .productName to
// gene... | Fix GitHub artifact name on Windows | Fix GitHub artifact name on Windows
| JavaScript | agpl-3.0 | cozy-labs/cozy-desktop,nono/cozy-desktop,nono/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop,cozy-labs/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop |
22524569d06a330922e74b2552b471a42da1d3ab | js/command-parser.js | js/command-parser.js | define([], function() {
var CommandParser = (function() {
var parse = function(str, lookForQuotes) {
var args = [];
var readingPart = false;
var part = '';
for(var i=0; i < str.length; i++) {
if(str.charAt(i) === ' ' && !readingPart) {
args.push(part);
... | define([], function() {
var CommandParser = (function() {
var parse = function(str, lookForQuotes) {
var args = [];
var readingPart = false;
var part = '';
for(var i=0; i < str.length; i++) {
if(str.charAt(i) === ' ' && !readingPart) {
args.push(part);
... | Fix bug in command parser | Fix bug in command parser
| JavaScript | mit | git-school/visualizing-git,git-school/visualizing-git |
321b5b9b916d5afd386de72da882873e7e67e70c | src/admin/dumb_components/preview_custom_email.js | src/admin/dumb_components/preview_custom_email.js | import React from 'react'
export default ({members, preview, props: { submit_custom_email, edit_custom }}) =>
<div className='custom-email-preview'>
<div className='email-recipients'>
<h2>Email Recipients</h2>
<ul>
{members.map((member, i) =>
<li
key={member.... | import React from 'react'
export default ({members, preview, props: { submit_custom_email, edit_custom }}) =>
<div className='custom-email-preview'>
<div className='email-recipients'>
<h2>Email Recipients</h2>
<ul>
{members.map((member, i) =>
<li
key={member.... | Add 'Friends of Chichester Harbour' to preview custom email | Add 'Friends of Chichester Harbour' to preview custom email
| JavaScript | mit | foundersandcoders/sail-back,foundersandcoders/sail-back |
61c34e2ca7eeea7bf7393ea1a227a16e4355a921 | tasks/copy.js | tasks/copy.js | 'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
return {
target: {
files: [
{
expand: true,
cwd: 'src/',
src: [
'**/*.html',
... | 'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
return {
target: {
files: [
{
expand: true,
cwd: 'src/',
src: [
'**/*.html',
... | Add .dmg and .sig to copied file extensions | Add .dmg and .sig to copied file extensions
| JavaScript | mit | sinahab/BitcoinUnlimitedWeb,gandrewstone/BitcoinUnlimitedWeb,BitcoinUnlimited/BitcoinUnlimitedWeb,thofmann/BitcoinUnlimitedWeb,BitcoinUnlimited/BitcoinUnlimitedWeb,sinahab/BitcoinUnlimitedWeb,gandrewstone/BitcoinUnlimitedWeb,BitcoinUnlimited/BitcoinUnlimitedWeb,thofmann/BitcoinUnlimitedWeb |
64fa9848ca66290a1e84bc50069a83705753f248 | gruntfile.js | gruntfile.js | var Path = require('path');
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt);
grunt.initConfig({
exec: {
update_nimble_submodules: {
command: 'git submodule update --init --recursive',
stdout: true,
stderr: true
}
},
js... | var Path = require('path');
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt);
grunt.initConfig({
exec: {
update_nimble_submodules: {
command: 'git submodule update --init --recursive && npm install',
stdout: true,
stderr: true
... | Add npm install to grunt init | Add npm install to grunt init
| JavaScript | mpl-2.0 | mozilla/nimble.webmaker.org |
161b09e250f0e5f822907994488a39ec6a16e607 | src/Disposable.js | src/Disposable.js | class Disposable{
constructor(callback){
this.disposed = false
this.callback = callback
}
dispose(){
if(this.disposed) return
this.callback()
this.callback = null
}
}
module.exports = Disposable
| class Disposable{
constructor(callback){
this.disposed = false
this.callback = callback
}
dispose(){
if(this.disposed) return
if(this.callback){
this.callback()
this.callback = null
}
}
}
module.exports = Disposable
| Allow null callback in DIsposable | :bug: Allow null callback in DIsposable
| JavaScript | mit | ZoomPK/event-kit,steelbrain/event-kit |
8dcc55af2eb7c286565351909134bded508b3d98 | test/rank.js | test/rank.js | var should = require("should");
var rank = require("../index.js").rank;
describe("Rank calculation", function() {
var points = 72;
var hours = 36;
var gravity = 1.8;
describe("Calulate the rank for an element", function() {
var score;
before(function(done) {
score = r... | var should = require("should");
var rank = require("../index.js").rank;
describe("Rank calculation", function() {
var points = 72;
var hours = 36;
var gravity = 1.8;
describe("Calulate the rank for an element", function() {
var score;
before(function(done) {
score = r... | Fix tests according to the defaults | Fix tests according to the defaults
| JavaScript | mit | tlksio/librank |
b3ca504604f8fd25ef428042909a4bad75736967 | app/js/arethusa.core/directives/root_token.js | app/js/arethusa.core/directives/root_token.js | "use strict";
angular.module('arethusa.core').directive('rootToken', [
'state',
'depTree',
function(state, depTree) {
return {
restrict: 'A',
scope: {},
link: function(scope, element, attrs) {
function apply(fn) {
scope.$apply(fn());
}
var changeHeads = de... | "use strict";
angular.module('arethusa.core').directive('rootToken', [
'state',
'depTree',
function(state, depTree) {
return {
restrict: 'A',
scope: {},
link: function(scope, element, attrs) {
function apply(fn) {
scope.$apply(fn());
}
var changeHeads = de... | Change cursor on rootToken as well | Change cursor on rootToken as well
| JavaScript | mit | PonteIneptique/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,Masoumeh/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa |
e87f9a09f2199d239cfc662f8580010fa3caa8e4 | test/index.js | test/index.js | import test from 'tape'
import { connection } from '../config/rethinkdb'
import './server/helpers/config'
import './server/helpers/createStore'
import './server/helpers/renderApp'
import './server/config/rethinkdb'
import './server/routes/errors'
import './server/routes/main'
import './server/routes/search'
import './... | import test from 'tape'
import { connection } from '../config/rethinkdb'
import './server/helpers/config'
import './server/helpers/createStore'
import './server/helpers/renderApp'
import './server/config/rethinkdb'
import './server/routes/errors'
import './server/routes/main'
import './server/routes/search'
import './... | Increase timeout for changes to properly close | Increase timeout for changes to properly close
| JavaScript | mit | mike-engel/bkmrkd,mike-engel/bkmrkd,mike-engel/bkmrkd |
c7f38e0b6f91a920c6d9e38ee7cceaced50cdf49 | app/models/trip.js | app/models/trip.js | import mongoose from 'mongoose';
import { Promise } from 'es6-promise';
mongoose.Promise = Promise;
import findOrCreate from 'mongoose-findorcreate';
const Schema = mongoose.Schema;
const TripSchema = new Schema( {
userId: { type: String, required: true },
lastUpdated: { type: Date, default: Date.now, required: t... | import mongoose from 'mongoose';
import { Promise } from 'es6-promise';
mongoose.Promise = Promise;
import findOrCreate from 'mongoose-findorcreate';
const Schema = mongoose.Schema;
const getDefaultDate = () => new Date( ( new Date() ).valueOf() - 1000 * 60 * 60 ).getTime();
const TripSchema = new Schema( {
userId:... | Make default date older to allow pretty much any updates | Make default date older to allow pretty much any updates
| JavaScript | mit | sirbrillig/voyageur-js-server |
a40324a5b03ab497822a4e2287b9d6ef37d5848b | src/World.js | src/World.js | /**
World functions
*/
import _ from 'underscore';
export const create = () => {
return {
tripods: [],
food: []
};
};
export const addTripod = (world, tripod) => {
world.tripods.push(tripod);
};
export const addFood = (world, food) => {
world.food.push(food);
};
export const eatFood = (world, f... | /**
World functions
*/
import _ from 'underscore';
export const create = () => {
return {
tripods: [],
food: []
};
};
export const addTripod = (world, tripod) => {
world.tripods.push(tripod);
};
export const addFood = (world, food) => {
world.food.push(food);
};
export const eatFood = (world, f... | Add getClosestFood function to world | Add getClosestFood function to world
| JavaScript | bsd-2-clause | rumblesan/tripods,rumblesan/tripods |
638a38a53544f1ed1854b2215125ef224ef085b2 | app/src/js/bolt.js | app/src/js/bolt.js | /**
* Instance of the Bolt module.
*
* @namespace Bolt
*
* @mixes Bolt.actions
* @mixes Bolt.activity
* @mixes Bolt.app
* @mixes Bolt.ckeditor
* @mixes Bolt.conf
* @mixes Bolt.data
* @mixes Bolt.datetime
* @mixes Bolt.files
* @mixes Bolt.stack
* @mixes Bolt.secmenu
* @mixes Bolt.video
*
* @mixes Bolt.f... | /**
* Instance of the Bolt module.
*
* @namespace Bolt
*
* @mixes Bolt.actions
* @mixes Bolt.activity
* @mixes Bolt.app
* @mixes Bolt.ckeditor
* @mixes Bolt.conf
* @mixes Bolt.data
* @mixes Bolt.datetime
* @mixes Bolt.files
* @mixes Bolt.stack
* @mixes Bolt.secmenu
* @mixes Bolt.video
*
* @mixes Bolt.f... | Add doc block for templateselect mixin | Add doc block for templateselect mixin | JavaScript | mit | Eiskis/bolt-base,tekjava/bolt,HonzaMikula/masivnipostele,pygillier/bolt,Intendit/bolt,pygillier/bolt,richardhinkamp/bolt,hugin2005/bolt,cdowdy/bolt,HonzaMikula/masivnipostele,nantunes/bolt,romulo1984/bolt,GawainLynch/bolt,codesman/bolt,GawainLynch/bolt,CarsonF/bolt,richardhinkamp/bolt,bolt/bolt,Intendit/bolt,nikgo/bolt... |
ba2bfd1d5711ad48da8f16faa59948e91a88318e | modules/mds/src/main/resources/webapp/js/app.js | modules/mds/src/main/resources/webapp/js/app.js | (function () {
'use strict';
var mds = angular.module('mds', [
'motech-dashboard', 'entityService','instanceService', 'mdsSettingsService', 'ngCookies', 'ui.directives',
'ngRoute', 'ui.directives'
]);
$.get('../mds/available/mdsTabs').done(function(data) {
mds.constant('AVAILA... | (function () {
'use strict';
var mds = angular.module('mds', [
'motech-dashboard', 'entityService','instanceService', 'mdsSettingsService', 'ngCookies', 'ui.directives',
'ngRoute', 'ui.directives'
]);
$.ajax({
url: '../mds/available/mdsTabs',
success: function(dat... | Fix ajax error while checking available tabs | MDS: Fix ajax error while checking available tabs
Change-Id: I4f8a4d538e59dcdb03659c7f5405c40abcdafed8
| JavaScript | bsd-3-clause | koshalt/motech,kmadej/motech,shubhambeehyv/motech,smalecki/motech,justin-hayes/motech,ngraczewski/motech,kmadej/motech,adamkalmus/motech,koshalt/motech,frankhuster/motech,smalecki/motech,wstrzelczyk/motech,justin-hayes/motech,justin-hayes/motech,ngraczewski/motech,frankhuster/motech,tectronics/motech,adamkalmus/motech,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.