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 |
|---|---|---|---|---|---|---|---|---|---|
cfc85a04c6de4e88e6757e0dec0c2df83bcbd085 | js/ui/options.js | js/ui/options.js | (function () {
// Add behaviour for option buttons
app(function (api) {
var resetbtn = document.querySelector("#resetbtn");
resetbtn.addEventListener("click", function () {
api.args.searchinput.value = "";
api.reset();
}, false);
});
})();
| (function () {
// Add behaviour for option buttons
app(function (api) {
var resetbtn = document.querySelector("#resetbtn");
resetbtn.addEventListener("click", function () {
api.reset();
api.args.searchinput.value = "";
api.args.searchinput.focus();
... | Put focus on search field on UI reset | Put focus on search field on UI reset
Signed-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>
| JavaScript | apache-2.0 | applait/finder,vasuki1996/finder,vasuki1996/finder,applait/finder |
a7161d1302743e47b62cd3dfec8e74af6a449ec9 | src/js/main.js | src/js/main.js | /* global Calendar, vis */
(function() {
"use strict";
var calendar = new Calendar();
calendar.init(document.getElementById('visualization'),
{
height: "100vh",
orientation: "top",
zoomKey: 'shiftKey',
zoomMax: 315360000000,
zoomMin: 600000,
editable: true
});
... | /* global Calendar, vis */
(function() {
"use strict";
var calendar = new Calendar();
calendar.init(document.getElementById('visualization'),
{
height: "100vh",
orientation: "top",
zoomKey: 'shiftKey',
zoomMax: 315360000000,
zoomMin: 600000,
editable: {
add... | Add editable option to the timeline | Add editable option to the timeline
| JavaScript | apache-2.0 | fidash/widget-calendar,fidash/widget-calendar |
2571649c74f00d10021743f5bf867a4e4dd8b440 | test/kss-parser.js | test/kss-parser.js | var gulp = require('gulp'),
chai = require('chai'),
expect = chai.expect,
fs = require('fs'),
styleguide = require('../lib/styleguide');
describe('KSS parser', function() {
var json = {};
before(function(done){
filesBuffer = {
'./test/data/wrapper.scss': fs.readFileSync('./test/data/wrapper.scs... | var gulp = require('gulp'),
chai = require('chai'),
expect = chai.expect,
fs = require('fs'),
styleguide = require('../lib/styleguide');
describe('KSS parser', function() {
var json = {};
before(function(done){
filesBuffer = {
'./test/data/wrapper.scss': fs.readFileSync('./test/data/wrapper.scs... | Test for wrappers of modifiers | Test for wrappers of modifiers
| JavaScript | mit | patriziosotgiu/sc5-styleguide,kraftner/sc5-styleguide,hannu/sc5-styleguide,lewiscowper/sc5-styleguide,kraftner/sc5-styleguide,jkarttunen/sc5-styleguide,soulfresh/sc5-styleguide,junaidrsd/sc5-styleguide,SC5/sc5-styleguide,jkarttunen/sc5-styleguide,soulfresh/sc5-styleguide,patriziosotgiu/sc5-styleguide,junaidrsd/sc5-styl... |
b746a6217ecd1eddaf19c1bd42ee8b76b90e01ed | test/config.js | test/config.js | (function() {
'use strict';
require.config({
baseUrl: "..",
paths: {
'jasmine': 'test/lib/jasmine-2.0.0/jasmine',
'jasmine-html': 'test/lib/jasmine-2.0.0/jasmine-html',
'boot': 'test/lib/jasmine-2.0.0/boot',
'jquery': 'lib/jquery-2.1.0.min',
'd3': 'lib/d3.v3.min',
'a... | (function() {
'use strict';
require.config({
baseUrl: "..",
paths: {
'jasmine': 'test/lib/jasmine-2.0.0/jasmine',
'jasmine-html': 'test/lib/jasmine-2.0.0/jasmine-html',
'boot': 'test/lib/jasmine-2.0.0/boot',
'jquery': 'lib/jquery-2.1.0.min',
'd3': 'lib/d3.v3.min',
'a... | Add jquery to global require | Add jquery to global require
| JavaScript | mit | ptmccarthy/wikimapper,ptmccarthy/wikimapper |
df6a66375deff259692b6611e533c49988c8001b | connectors/v2/googlemusic.js | connectors/v2/googlemusic.js | 'use strict';
/* global Connector */
Connector.playerSelector = '#player';
Connector.trackArtImageSelector = '#playerBarArt';
Connector.artistSelector = '#player-artist';
Connector.trackSelector = '#currently-playing-title';
Connector.albumSelector = '.player-album';
Connector.currentTimeSelector = '#time_contai... | 'use strict';
/* global Connector */
Connector.playerSelector = '#player';
Connector.trackArtImageSelector = '#playerBarArt';
Connector.artistSelector = '#player-artist';
Connector.getTrack = function() {
return $('#currently-playing-title').text() ||
$('#player-song-title').text() || null;
}
Connector.albumSe... | Replace trackSelector with getTrack function | Replace trackSelector with getTrack function
The IDs being used by Google seem to be in flux, this tries the new ID
first before falling back to the old one.
| JavaScript | mit | fakelbst/Chrome-Last.fm-Scrobbler,galeksandrp/web-scrobbler,galeksandrp/web-scrobbler,alexesprit/web-scrobbler,Paszt/web-scrobbler,Paszt/web-scrobbler,usdivad/web-scrobbler,inverse/web-scrobbler,alexsh/web-scrobbler,ex47/web-scrobbler,ex47/web-scrobbler,TheQwerty/web-scrobbler,carpet-berlin/web-scrobbler,alexsh/web-scr... |
3df69c147227987d37839c7f5a51c07a8cc31701 | test/runner.js | test/runner.js | var cp = require('child_process');
var join = require('path').join;
var walk = require('walk');
var mochaBin = join(__dirname, '..', 'node_modules', '.bin', 'mocha');
var _ = require('underscore');
var exitCodes = [];
var walker = walk.walk(__dirname + '/spec', {followLinks: false});
walker.on('file', function(root, s... | var cp = require('child_process');
var join = require('path').join;
var walk = require('walk');
var mochaBin = join(__dirname, '..', 'node_modules', '.bin', 'mocha');
var _ = require('underscore');
var exitCodes = [];
var walker = walk.walk(__dirname + '/spec', {followLinks: false});
walker.on('file', function(root, s... | Use some instead of filter | Use some instead of filter
| JavaScript | mit | vogdb/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,njam/pulsar-rest-api |
5da980eb31a033ce439500bf0293262a5145f4e4 | languages/php.js | languages/php.js | const external = require('../helpers').external
module.exports.composerurl = composerurl
function composerurl (moduleName) {
if (moduleName.split('/').length === 1) {
// composer packages are like `user-or-project/package`.
// but sometimes there seems to be a random `php` required on composer.json.
retu... | const external = require('../helpers').external
module.exports.composerurl = composerurl
function composerurl (moduleName) {
if (moduleName === 'php') {
// package requires specific PHP version
// ignore this when parsing
return Promise.reject()
}
if (moduleName.startsWith('ext-') && moduleName.spli... | Support for parsing PHP extensions | Support for parsing PHP extensions
| JavaScript | mit | fiatjaf/module-linker,fiatjaf/module-linker,fiatjaf/gh-browser |
1f1a6f97a2e2196f47d918e41e8194612bf489c9 | result-app/views/app.js | result-app/views/app.js | var app = angular.module('catsvsdogs', []);
var socket = io.connect({transports:['polling']});
var bg1 = document.getElementById('background-stats-1');
var bg2 = document.getElementById('background-stats-2');
app.controller('statsCtrl', function($scope){
var animateStats = function(a,b){
if(a+b>0){
var pe... | var app = angular.module('catsvsdogs', []);
var socket = io.connect({transports:['polling']});
var bg1 = document.getElementById('background-stats-1');
var bg2 = document.getElementById('background-stats-2');
app.controller('statsCtrl', function($scope){
$scope.aPercent = 50;
$scope.bPercent = 50;
var updateSc... | Fix percentage recalculation when both votes are zero | Fix percentage recalculation when both votes are zero
| JavaScript | apache-2.0 | chrisdias/example-voting-app,TeamHeqing/voting-app,sergey-korolev/demo-app,TeamHeqing/voting-app,reshma-k/example-voting-app,chrisdias/example-voting-app,chrisdias/example-voting-app,reshma-k/example-voting-app,TeamHeqing/voting-app,sergey-korolev/demo-app,reshma-k/example-voting-app,reshma-k/example-voting-app,TeamHeq... |
fd8c79b16088c10fc21ca8b1cfe066f3cdde698a | app/assets/javascripts/vehicle-licensing/controllers/vehicle-license-volumes-module.js | app/assets/javascripts/vehicle-licensing/controllers/vehicle-license-volumes-module.js | define([
'vehicle-licensing/collections/services',
'extensions/views/timeseries-graph/timeseries-graph',
'extensions/views/tabs',
'extensions/views/graph/headline',
],
function (ServicesCollection, TimeseriesGraph, Tabs, Headline) {
return function (selector, id, type) {
if ($('.lte-ie8').length) {
... | define([
'vehicle-licensing/collections/services',
'extensions/views/timeseries-graph/timeseries-graph',
'extensions/views/tabs',
'extensions/views/graph/headline',
],
function (ServicesCollection, TimeseriesGraph, Tabs, Headline) {
return function (selector, id, type) {
if ($('.lte-ie8').length) {
... | Set initial EVL applications query to month | Set initial EVL applications query to month
| JavaScript | mit | gds-attic/limelight,gds-attic/limelight,gds-attic/limelight |
3e1c25f4cb4e3c2a6f2e71c3943a70e7779b834c | test/client.js | test/client.js | var should = require('should');
var grex = require('../index.js');
var _ = require("lodash");
var RexsterClient = require('../src/rexsterclient.js');
var defaultOptions = {
'host': 'localhost',
'port': 8182,
'graph': 'tinkergraph'
};
describe('RexsterClient', function() {
describe('when passing no param... | var should = require('should');
var grex = require('../index.js');
var _ = require("lodash");
var RexsterClient = require('../src/rexsterclient.js');
var defaultOptions = {
'host': 'localhost',
'port': 8182,
'graph': 'tinkergraph'
};
describe.only('RexsterClient', function() {
describe('connect()', func... | Add connect() description in RexsterClient tests | Add connect() description in RexsterClient tests
| JavaScript | mit | jbmusso/grex |
178debdd35b213f8d833d9897e5db01bf5abb16a | test/delete.js | test/delete.js | require('should');
var utils = require(process.cwd()+'/test/utils/test-commons');
var GoatDB = require('../index.js');
var db = GoatDB(utils.testDirectory, utils.options);
describe('DELETE', function() {
before(function(){
return db.open();
});
after(function(done){
utils.clear(done);
... | require('should');
var utils = require(process.cwd()+'/test/utils/test-commons');
var GoatDB = require('../index.js');
var db = GoatDB(utils.testDirectory, utils.options);
describe('DELETE', function() {
before(function(){
return db.open();
});
after(function(done){
utils.clear(done);
... | Delete and search with error message | Delete and search with error message
| JavaScript | mit | gutobortolozzo/node-lsm |
680960d67879b1bcdc1cc99ea642a087d0422111 | ui/web/pre_wrap.js | ui/web/pre_wrap.js | (function(prefix, tenyr_state){
var ENVIRONMENT_IS_NODE = typeof process === 'object';
var ENVIRONMENT_IS_WEB = typeof window === 'object';
var ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
//if (typeof ten... | var tenyr_state; if (!tenyr_state) tenyr_state = {};
(function(prefix, tenyr_state){
var ENVIRONMENT_IS_NODE = typeof process === 'object';
var ENVIRONMENT_IS_WEB = typeof window === 'object';
var ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT... | Stop failing to compile under nodejs | Stop failing to compile under nodejs
| JavaScript | mit | kulp/tenyr,kulp/tenyr,kulp/tenyr |
7b6ea05ec3b1da6e59c34f0228482b9ba9d52782 | app/renderer/store/configureStore.js | app/renderer/store/configureStore.js | const { createStore, applyMiddleware } = require('redux')
const thunk = require('redux-thunk')
const rootReducer = require('../reducers')
module.exports = (preloadedState) => {
const middlewares = [thunk]
if (process.env.NODE_ENV === `development`) {
const createLogger = require(`redux-logger`)
const logg... | const { createStore, applyMiddleware } = require('redux')
const thunk = require('redux-thunk')
const rootReducer = require('../reducers')
module.exports = (preloadedState) => {
const middlewares = [thunk]
if (process.env.NODE_ENV !== 'production') {
const createLogger = require(`redux-logger`)
const logge... | Use redux-logger if not in production mode. | Use redux-logger if not in production mode.
| JavaScript | isc | niklasi/halland-proxy,niklasi/halland-proxy |
42df29b03742f6347c1b7fd53dff0207069c2c79 | client/reducers/activities.js | client/reducers/activities.js | const password = (state = [], action) => {
switch (action.type) {
case 'ADD_ACTIVITY':
// Apply password transformation
let activity = {
title: action.value,
date: action.date,
id: action.date.getTime(),
};
const newState = state.splice(0);
newState.push(... | const password = (state = [], action) => {
switch (action.type) {
case 'ADD_ACTIVITY':
// Apply password transformation
let activity = {
title: action.value,
date: action.date,
id: '' + action.date.getTime(),
};
const newState = state.splice(0);
newState.... | Use string for activity id | Use string for activity id
| JavaScript | mit | G100g/standuptodo,G100g/standuptodo |
b1a1c1e7e661343afd5899111ed6800af47910eb | scripts/tests/common.js | scripts/tests/common.js | /**
* Helper methods and variables for capser test suite.
*/
// Define the url for all tests.
var url = casper.cli.get('url');
// Set default viewport for all tests.
casper.options.viewportSize = { width: 1280, height: 1024 };
// Use to log in before performing a test.
casper.login = function() {
this.echo("Logg... | /**
* Helper methods and variables for capser test suite.
*/
// Define the url for all tests.
var url = casper.cli.get('url');
// Set default viewport for all tests.
casper.options.viewportSize = { width: 1280, height: 1024 };
// Use to log in before performing a test.
casper.login = function(username, password) {... | Add optional username & password parameters to login helper. | Add optional username & password parameters to login helper.
| JavaScript | mit | deadlybutter/phoenix,DoSomething/dosomething,sbsmith86/dosomething,deadlybutter/phoenix,mshmsh5000/dosomething,mshmsh5000/dosomething-1,angaither/dosomething,sbsmith86/dosomething,sbsmith86/dosomething,angaither/dosomething,mshmsh5000/dosomething-1,mshmsh5000/dosomething,sergii-tkachenko/phoenix,DoSomething/dosomething... |
4a1b5dc3cace66a8dbae0b7565ffa4296065811f | lib/tests/dashboard.js | lib/tests/dashboard.js | var Mocha = require('mocha');
module.exports = function (browser, dashboard, suite, config) {
suite.addTest(new Mocha.Test('exists', exists));
var modules = Mocha.Suite.create(suite, 'modules');
dashboard.modules.forEach(function (module) {
modules.addTest(new Mocha.Test(module.slug, require('./module-exis... | var Mocha = require('mocha');
module.exports = function (browser, dashboard, suite, config) {
suite.beforeAll(function () {
return browser.get(config.baseUrl + dashboard.slug);
});
suite.addTest(new Mocha.Test('exists', exists));
var modules = Mocha.Suite.create(suite, 'modules');
dashboard.modules.fo... | Move browser page load to a before step | Move browser page load to a before step
| JavaScript | mit | alphagov/cheapseats |
96ae7a9ceaa21d666fcec083429093759109cf58 | ghost/admin/components/gh-url-preview.js | ghost/admin/components/gh-url-preview.js | /*
Example usage:
{{gh-url-preview prefix="tag" slug=theSlugValue tagName="p" classNames="description"}}
*/
var urlPreview = Ember.Component.extend({
classNames: 'ghost-url-preview',
prefix: null,
slug: null,
theUrl: null,
generateUrl: function () {
// Get the blog URL and strip the scheme
... | /*
Example usage:
{{gh-url-preview prefix="tag" slug=theSlugValue tagName="p" classNames="description"}}
*/
var urlPreview = Ember.Component.extend({
classNames: 'ghost-url-preview',
prefix: null,
slug: null,
theUrl: null,
generateUrl: function () {
// Get the blog URL and strip the scheme
... | Make preview URLs include trailing slash when slug is given | Make preview URLs include trailing slash when slug is given
- the trailing slash isn't shown usually
- slash added when a slug is given to be more correct
| JavaScript | mit | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost |
41390b8f3426d6e0c31ca9ae78d19a23c50d8807 | webpack.mix.js | webpack.mix.js | const
{ mix } = require('laravel-mix'),
webpack = require('webpack');
mix
.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'Tether': 'tether',
'window.axios': 'axios'
})
],
resolve: {
symlinks: false
}
})
.copy(
... | const
{ mix } = require('laravel-mix'),
webpack = require('webpack');
mix
.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'Tether': 'tether',
'window.axios': 'axios'
})
],
resolve: {
symlinks: false
}
})
.copy(
... | Add sourcemaps because error messages are annoying atm. | Add sourcemaps because error messages are annoying atm.
| JavaScript | mit | unikent/astro,unikent/astro,unikent/astro,unikent/astro,unikent/astro |
a43216dd0a8c9c75178bab17154c15e1ceb432a5 | lib/git-wrapper.js | lib/git-wrapper.js | var Q = require('q');
var _ = require('lodash');
var spawn = require('child_process').spawn;
module.exports = function(args, options) {
var deferred = Q.defer();
options = options || {};
var defaults = {
cwd: process.cwd(),
verbose: false
};
options = _.extend({}, defaults, options)... | var Q = require('q');
var _ = require('lodash');
var spawn = require('child_process').spawn;
module.exports = function(args, options) {
var deferred = Q.defer();
options = options || {};
var defaults = {
cwd: process.cwd(),
verbose: false
};
options = _.extend({}, defaults, options)... | Add notify in git wrapper | Add notify in git wrapper [ci skip]
| JavaScript | mit | crowdtap/parachute |
70a789ebcafcc236dbc4abd45d9e91ea2875d338 | load-lazyload.js | load-lazyload.js | (function(){
var imgs = document.getElementsByTagName('img');
var imgs_size = imgs.length;
var url;
for (var i = 0; i < imgs_size; i++) {
var el = imgs[i];
if (url = el.getAttribute('data-original')) {
el.setAttribute('src', url);
} else if (url = el.getAttribute('d... | (function(){
var imgs = document.getElementsByTagName('img');
var imgs_size = imgs.length;
var url;
for (var i = 0; i < imgs_size; i++) {
var el = imgs[i];
if (url = el.getAttribute('data-original')) {
el.setAttribute('src', url);
} else if (url = el.getAttribute('d... | Support for "file" attribute. (ck101) | Support for "file" attribute. (ck101)
| JavaScript | bsd-3-clause | gslin/load-lazyload-images |
6c28c8ea35dd0c18e339ae7bc3ada60684124c97 | src/js/components/PageHeaderActionsMenu.js | src/js/components/PageHeaderActionsMenu.js | import {Dropdown} from 'reactjs-components';
import React from 'react';
import Icon from './Icon';
const getMenuItems = (children) => {
return [
{
className: 'hidden',
html: <Icon id="ellipsis-vertical" size="mini" />,
id: 'trigger'
},
...React.Children.map(children, getDropdownItemFro... | import {Dropdown} from 'reactjs-components';
import React from 'react';
import Icon from './Icon';
const getMenuItems = (children) => {
return [
{
className: 'hidden',
html: <Icon id="ellipsis-vertical" size="mini" />,
id: 'trigger'
},
...React.Children.map(children, getDropdownItemFro... | Update child fn name to onItemSelect from clickHandler | Update child fn name to onItemSelect from clickHandler
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
b90a3f4063352c2220aa12184bbb933799a9d601 | app/assets/config/manifest.js | app/assets/config/manifest.js | // Compatible with Sprockets 3.x defaults to avoid breaking existing apps
// https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs
//= link_tree ../images
//= link application.css
//= link application.js
// Orchid engine's manifest: orchid/app/assets/config/orchid/manifest.js
//= link orchid/manifest.... | // Compatible with Sprockets 3.x defaults to avoid breaking existing apps
// https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs
//= link application.css
//= link application.js
// Sprockets 4.x defaults
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets ... | Fix removed Sprockets 4.x defaults | Fix removed Sprockets 4.x defaults
Put link_tree ../images back with 4.x defaults as the two 3.x lines are
the only difference from the 4.x default manifest
| JavaScript | mit | CDRH/orchid,CDRH/orchid,CDRH/orchid |
7b1fcedb5b7915c849e260cd42a1e68d603d2276 | tests/index.js | tests/index.js |
'use strict';
const isPlainObj = require( 'is-plain-obj' );
test( 'index.js', () => {
const config = require( '../index.js' );
expect( isPlainObj( config ) ).toBe( true );
expect( Array.isArray( config.extends ) ).toBe( true );
expect( Array.isArray( config.plugins ) ).toBe( true );
expect( isPlainObj( c... |
'use strict';
const isPlainObj = require( 'is-plain-obj' );
test( 'index.js', () => {
const config = require( '../index.js' );
expect( isPlainObj( config ) ).toBe( true );
expect( Array.isArray( config.extends ) ).toBe( true );
expect( isPlainObj( config.rules ) ).toBe( true );
});
| Fix test to not expect plugins to be defined | Fix test to not expect plugins to be defined
| JavaScript | mit | ChromatixAU/stylelint-config-chromatix |
ff38ea953315cf99161e6c1575082f868aa11f81 | services/web/scripts/count_files_in_projects.js | services/web/scripts/count_files_in_projects.js | const readline = require('readline')
const ProjectEntityHandler = require('../app/src/Features/Project/ProjectEntityHandler')
const ProjectGetter = require('../app/src/Features/Project/ProjectGetter')
const Errors = require('../app/src/Features/Errors/Errors')
async function countFiles() {
const rl = readline.create... | const readline = require('readline')
const ProjectEntityHandler = require('../app/src/Features/Project/ProjectEntityHandler')
const ProjectGetter = require('../app/src/Features/Project/ProjectGetter')
const Errors = require('../app/src/Features/Errors/Errors')
async function countFiles() {
const rl = readline.create... | Handle missing projects properly in file-count script | Handle missing projects properly in file-count script
GitOrigin-RevId: 5968fc3c6646a6e75b2b84440d59d9c0cbcead5e
| JavaScript | agpl-3.0 | sharelatex/sharelatex |
eb4c63318589931b762fe7a75f34615cfe127214 | packages/vulcan-lib/lib/server/apollo-server/engine.js | packages/vulcan-lib/lib/server/apollo-server/engine.js | import { getSetting } from '../../modules/settings.js';
// see https://github.com/apollographql/apollo-cache-control
export const engineApiKey = process.env.ENGINE_API_KEY || getSetting('apolloEngine.apiKey');
// options now available:
// @see https://www.apollographql.com/docs/apollo-server/api/apollo-server.html#Engi... | import { getSetting } from '../../modules/settings.js';
// @see https://www.apollographql.com/docs/apollo-server/api/apollo-server.html#EngineReportingOptions
let engineConfigObject = getSetting('apolloEngine');
if (!engineConfigObject || !engineConfigObject.apiKey) {
engineConfigObject = {
apiKey: process.env.... | Add support for Apollo Engine schemaTag in addition to apiKey | Add support for Apollo Engine schemaTag in addition to apiKey
| JavaScript | mit | VulcanJS/Vulcan,VulcanJS/Vulcan |
bd3a68f298b305fb385893aae082e9c225f5e589 | src/mui/button/SaveButton.js | src/mui/button/SaveButton.js | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import RaisedButton from 'material-ui/RaisedButton';
import ContentSave from 'material-ui/svg-icons/content/save';
import CircularProgress from 'material-ui/CircularProgress';
import Translate from '../../i18n/Translate';
class... | import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import RaisedButton from 'material-ui/RaisedButton';
import ContentSave from 'material-ui/svg-icons/content/save';
import CircularProgress from 'material-ui/CircularProgress';
import Translate from '../../i18n/Translate';
class... | Fix Translate HOC imbrication for tests | Fix Translate HOC imbrication for tests
| JavaScript | mit | marmelab/admin-on-rest,marmelab/admin-on-rest,matteolc/admin-on-rest,matteolc/admin-on-rest |
2c6beb2aba3013a4f77a50a467f825f2f053a553 | build/config.js | build/config.js | import path from 'path'
import fs from 'fs'
const root = path.join(__dirname, '..')
const src = path.join(root, 'src')
const dist = path.join(root, 'dist')
const prod = process.env.NODE_ENV === 'production'
const dev = !prod
const hotLoader = process.env.HOT_RELOAD === 'react-hot-loader'
const nodeModulesDirectory ... | import path from 'path'
import fs from 'fs'
const root = path.join(__dirname, '..')
const src = path.join(root, 'src')
const dist = path.join(root, 'dist')
const prod = process.env.NODE_ENV === 'production'
const test = process.env.NODE_ENV === 'test'
const dev = !prod && !test
const hotLoader = !test && process.env... | Disable hot reloading in test environment | Disable hot reloading in test environment
| JavaScript | mit | bsr203/ripster,vslinko/ripster,bsr203/ripster,vslinko/ripster |
bfc43013b615e83b6c754f9fe7b83b2bf3afc811 | utils/build.js | utils/build.js | const fs = require('fs');
const path = require('path');
const pkg = require('../package.json');
const copyFileSync = (source, dest) => {
const content = fs.readFileSync(source, 'utf-8');
fs.writeFileSync(dest, content);
};
delete pkg.private;
pkg.main = 'cjs/index.js'
pkg.module = 'esm/index.js'
fs.writeFileSync(... | const fs = require('fs');
const path = require('path');
const pkg = require('../package.json');
const copyFileSync = (source, dest) => {
const content = fs.readFileSync(source, 'utf-8');
fs.writeFileSync(dest, content);
};
delete pkg.private;
delete pkg.scripts;
delete pkg.devDependencies;
pkg.main = 'cjs/index.j... | Remove devDependencies and scripts from distribution package.json | Remove devDependencies and scripts from distribution package.json
| JavaScript | mit | toji/gl-matrix,toji/gl-matrix |
5eb2c617b074482fb0dfd111390e78367deab338 | app/components/comments/CommentThreadsTag.js | app/components/comments/CommentThreadsTag.js | import React from 'react'
import { connect } from 'react-redux'
import { FormattedMessage } from 'react-intl'
import { openCommentThreads, acceptSelection } from 'redux/actions.js'
function mapStateToProps(state, ownProps) {
return {
count: state.cardsById[ownProps.cardId].commentThreads
.reduce( (all, th... | import React from 'react'
import { connect } from 'react-redux'
import { FormattedMessage } from 'react-intl'
import { openCommentThreads, acceptSelection } from 'redux/actions.js'
function mapStateToProps(state, ownProps) {
return {
count: state.cardsById[ownProps.cardId].commentThreads
.map( e => state.... | Update tags when new comments are left. | Update tags when new comments are left.
| JavaScript | mit | galahq/gala,michigan-sustainability-cases/gala,michigan-sustainability-cases/gala,galahq/gala,galahq/gala,michigan-sustainability-cases/gala |
1137ca1e25ffcf522312b897cd951283e200f15d | shelly/plotlyjs/static/plotlyjs/compress_attributes.js | shelly/plotlyjs/static/plotlyjs/compress_attributes.js | 'use strict';
/*
* Browserify transform that strips meta attributes out of the plotlyjs bundle
*
*/
var through = require('through2');
var attributeNamesToRemove = [
'description', 'requiredOpts', 'otherOpts', 'hrName', 'role'
];
var objectNamesToRemove = ['_deprecated'];
// ref: http://www.regexr.com/3bj6p... | 'use strict';
/*
* Browserify transform that strips meta attributes out of the plotlyjs bundle
*
*/
var through = require('through2');
var attributeNamesToRemove = ['description', 'requiredOpts', 'otherOpts', 'hrName', 'role'],
regexStr = '';
// ref: http://www.regexr.com/3bj6p
attributeNamesToRemove.forEach... | Revert "add regex generator for object to delete (e.g. '_deprecated': {})" | Revert "add regex generator for object to delete (e.g. '_deprecated': {})"
This reverts commit 2774e638e9ffc9ccbfc8db911767d0929910f04b.
| JavaScript | mit | asolagmbh/plotly.js,plotly/plotly.js,plotly/plotly.js,iongroup/plotly.js,iongroup/plotly.js,plotly/plotly.js,etpinard/plotly.js,aburato/plotly.js,etpinard/plotly.js,asolagmbh/plotly.js,iongroup/plotly.js,plotly/plotly.js,aburato/plotly.js,asolagmbh/plotly.js,etpinard/plotly.js |
f7206107854cd6362a68dc6a262e71eb0da08bae | src/public/login/LoggedOut.js | src/public/login/LoggedOut.js | import React from "react";
import Login from './Login';
const LoggedOut = ({auth}) => (
<div>
You have been logged out.
<Login auth={auth}/>
</div>
);
export default LoggedOut;
| import React from "react";
import Login from './Login';
import {Alert} from 'react-bootstrap';
const LoggedOut = ({auth}) => (
<div>
<Alert bsStyle="success">You have been logged out.</Alert>
<Login auth={auth}/>
</div>
);
export default LoggedOut;
| Use alert showing user is now logged out. | Use alert showing user is now logged out.
| JavaScript | mit | codefortulsa/courtbook,codefortulsa/courtbook |
a27c55c7cfcfc27e9b78d67df1566b42aa0a1a72 | openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/actions.module.spec.js | openstack_dashboard/dashboards/identity/static/dashboard/identity/domains/actions/actions.module.spec.js | /**
* 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
* distribut... | /**
* 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
* distribut... | Add the unit test for domains | Add the unit test for domains
Change-Id: I4f64bfa9d019544a2ae41b2be7fc23ab12c843bf
| JavaScript | apache-2.0 | openstack/horizon,ChameleonCloud/horizon,openstack/horizon,openstack/horizon,ChameleonCloud/horizon,ChameleonCloud/horizon,ChameleonCloud/horizon,openstack/horizon |
94561109a8d7c18bc289b9d2890f372d5229600d | webpack.dev.js | webpack.dev.js | const common = require('./webpack.common.js')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
module.exports = {
...common,
// plugins: [
// new BundleAnalyzerPlugin(),
// ],
mode: 'development',
}
| const common = require('./webpack.common.js')
const webpack = require('webpack')
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
module.exports = {
...common,
devtool: 'inline-source-map',
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: null,
exclude: [/node_modul... | Fix source maps for ts files | Fix source maps for ts files
| JavaScript | mit | jeremija/peer-calls,jeremija/peer-calls,jeremija/peer-calls |
990388080866f0292a3e11e1be836ae49942d9ee | src/utils/FocusManagement.js | src/utils/FocusManagement.js | const focusableSelectors = [
'input',
'select',
'a[href]',
'textarea',
'button',
'[tabindex]'
];
const getFocusableNodesInElement = el => {
const focusableNodes = el.querySelectorAll(focusableSelectors.join(','));
return focusableNodes && focusableNodeslength ? focusableNodes.filter(node => {
cons... | const focusableSelectors = [
'input',
'select',
'a[href]',
'textarea',
'button',
'[tabindex]'
];
const getFocusableNodesInElement = el => {
const focusableNodes = Array.prototype.slice.call(el.querySelectorAll(focusableSelectors.join(',')));
return focusableNodes && focusableNodeslength ? focusableNod... | Convert node list to array | Convert node list to array
| JavaScript | mit | mxenabled/mx-react-components |
e0bdef3240a6733e66699b3fa94237550210ae89 | src/db/clients/index.js | src/db/clients/index.js | import mysql from './mysql';
import postgresql from './postgresql';
import sqlserver from './sqlserver';
import cassandra from './cassandra';
/**
* List of supported database clients
*/
export const CLIENTS = [
{
key: 'mysql',
name: 'MySQL',
defaultPort: 3306,
disabledFeatures: [
'server:sch... | import mysql from './mysql';
import postgresql from './postgresql';
import sqlserver from './sqlserver';
import cassandra from './cassandra';
/**
* List of supported database clients
*/
export const CLIENTS = [
{
key: 'mysql',
name: 'MySQL',
defaultPort: 3306,
disabledFeatures: [
'server:sch... | Enable domain config only for sqlserver | Enable domain config only for sqlserver
| JavaScript | mit | falcon-client/falcon-core,sqlectron/sqlectron-core,falcon-client/falcon-core |
560b6a8a9e078a26f1138d2144938147fca398b3 | app/assets/javascripts/chapter_map.js | app/assets/javascripts/chapter_map.js |
$(document).ready(function(){
$(".us_map").mapael({
map : {
name : "usa_states",
cssClass : "map",
tooltip : {
cssClass : "mapTooltip" //class name of the tooltip container
},
defaultArea : {
attrs : {
fill : "#282828",
stroke: "#9a9a9a",
},
attrsHover : {
fill : "#d8a... |
$(document).ready(function(){
$(".us_map").mapael({
map : {
name : "usa_states",
cssClass : "map",
tooltip : {
cssClass : "mapTooltip" //class name of the tooltip container
},
defaultArea : {
attrs : {
fill : "#282828",
stroke: "#9a9a9a",
},
attrsHover : {
fill : "#d8a... | Put Raleigh-Durham on the map (literally) | Put Raleigh-Durham on the map (literally)
| JavaScript | mit | gdidayton/gdi-new-site,pooji02/gdi-new-site,amygori/gdi-website,kyroskoh/gdi-new-site,pooji02/gdi-new-site,tzmaleeff/gdi-new-site,johnmarinelli/gdi-new-site,kexline4710/gdi-new-site,kexline4710/gdi-new-site,girldevelopit/gdi-new-site,trishnaguha/gdi-new-site,carliecope/gdi-new-site,sdbeng/gdi-new-site,amygori/gdi-websi... |
3947f2a84cc2af009c5018157b8b84e0ddfcfd94 | app/components/Markdown/extra-keys.js | app/components/Markdown/extra-keys.js | import { saveAs } from 'file-saver';
export const Tags = {
STRONG: '**',
ITALIC: '_',
};
function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
}
export function addOrRemoveTag(tag, selection) {
const regex = new RegExp(`^${escapeRegExp(tag)}([^]+?)${escapeRegExp(tag)}... | import { saveAs } from 'file-saver';
import codemirror from 'codemirror';
import isEqual from 'lodash.isequal';
const mac = isEqual(codemirror.keyMap.default, codemirror.keyMap.macDefault);
const pre = mac ? 'Cmd-' : 'Ctrl-';
export const Tags = {
STRONG: '**',
ITALIC: '_',
};
function escapeRegExp(string) {
r... | Add dynamic prefix for windows/mac shortcuts | Add dynamic prefix for windows/mac shortcuts
| JavaScript | mit | PaulDebus/monod,TailorDev/monod,PaulDebus/monod,PaulDebus/monod,TailorDev/monod,TailorDev/monod |
8a23629d616c9cc93dbb4af3a1a6ddb323d82374 | src/formatters/index.js | src/formatters/index.js | var environment = require('../environment');
exports.html = require('./html');
exports.annotated = require('./annotated');
if (!environment.isBrowser) {
var consoleModuleName = './console';
exports.console = require(consoleModuleName);
}
| var environment = require('../environment');
exports.html = require('./html');
exports.annotated = require('./annotated');
if (!environment.isBrowser) {
exports.console = require('./console');
}
| Remove another non-literal string require in formatters. | Remove another non-literal string require in formatters.
| JavaScript | mit | cubehouse/jsondiffpatch,cubehouse/jsondiffpatch |
ca3652e54077f1d195e78810c924ab5c1a879935 | index.js | index.js | 'use strict';
var request = require('request')
, isUrl = require('is-url')
, articleTitle = require('article-title')
;
module.exports = function(url, callback){
if(!isUrl(url)){
throw new Error('Invalid url');
return;
}
request(url, function (error, response, body) {
if (!error && response.status... | 'use strict';
var request = require('request')
, isUrl = require('is-url')
, articleTitle = require('article-title')
;
module.exports = function(url, callback){
if(!isUrl(url)){
throw new Error('Invalid url');
return;
}
if(!callback){
throw new Error('Callback must be set to recieve the title for the... | Verify that callback is set. | Verify that callback is set.
| JavaScript | mit | m4bwav/get-title-at-url |
dcb4388277c7837165fa150829840eb7217c2faa | index.js | index.js | var reactTemplates = require('react-templates/src/reactTemplates');
var fs = require('fs');
var _ = require('lodash');
var ext = '.rt';
module.exports = function(options) {
var defaultOptions = {
modules: 'commonjs'
};
var options = _.extend({}, defaultOptions, options);
var loadRtFile = function(module, ... | var reactTemplates = require('react-templates/src/reactTemplates');
var fs = require('fs');
var _ = require('lodash');
var ext = '.rt';
module.exports = function(options) {
var defaultOptions = {
modules: 'commonjs',
reactImportPath: 'react'
};
var convertOptions = _.extend({}, defaultOptions, options);
... | Fix warning react 0.14 (react/addons is deprecated) | Fix warning react 0.14 (react/addons is deprecated)
| JavaScript | mit | artemkaint/react-template-require-hook |
70e0a7d74db713165899f9c1cdfc7a95481914a9 | index.js | index.js | var RSVP = require('rsvp'),
utils = require('./lib')
fs = require('fs'),
GoogleSpreadsheet = require("google-spreadsheet"),
config = require('./config.js'),
doc = new GoogleSpreadsheet(config['google_spreadsheet_key']);
RSVP.hash({
currentItems: utils.getWishlistFromAmazon(config['amazon_w... | var RSVP = require('rsvp'),
utils = require('./lib')
fs = require('fs'),
GoogleSpreadsheet = require("google-spreadsheet"),
config = require('./config.js'),
doc = new GoogleSpreadsheet(config['google_spreadsheet_key']);
RSVP.hash({
currentItems: utils.getWishlistFromAmazon(config['amazon_w... | Print stack traces on failure | Print stack traces on failure
| JavaScript | mit | mchateloin/amazon-wishlist-to-drive-sheet,mchateloin/amazon-wishlist-to-drive-sheet |
5aa7c3ed44ed8d42efaaf4b8e5b7eb013a6d8c3c | index.js | index.js | var read = require('fs').readFileSync;
var client = require('khoros-client');
module.exports = function (server) {
// Serve client js.
if (server) {
var clientSource = read(require.resolve('khoros-client/khoros.js'), 'utf-8');
server.on('request', function(req, res) {
if (req.url == "/khoros/khoros.js") {
... | var read = require('fs').readFileSync;
var client = require('khoros-client');
module.exports = function (io, server) {
// Serve client js.
if (server) {
var clientSource = read(require.resolve('khoros-client/khoros.js'), 'utf-8');
server.on('request', function(req, res) {
if (req.url == "/khoros/khoros.js"... | Include sender in message if echo is specified. Needs io object. | Include sender in message if echo is specified. Needs io object.
| JavaScript | isc | scottgarner/khoros-middleware |
e5edc591f66901c8c92f7a14c30ac96f6f7f5e14 | index.js | index.js | var _ = require('underscore');
var async = require('async');
var request = require('request');
var linters = require('./linters');
var repoURL = 'https://api.github.com/repos/nicolasmccurdy/repos';
var githubRequest = request.defaults({
headers: {
Accept: 'application/vnd.github.v3',
'User-Agent': 'ghlint'
... | var _ = require('underscore');
var async = require('async');
var request = require('request');
var linters = require('./linters');
var repoURL = 'https://api.github.com/repos/nicolasmccurdy/repos';
var githubRequest = request.defaults({
headers: {
Accept: 'application/vnd.github.v3',
'User-Agent': 'ghlint'
... | Fix requests to the GitHub API | Fix requests to the GitHub API
| JavaScript | mit | nicolasmccurdy/ghlint |
da599268baad50c898c108187e96303ce3c19f98 | index.js | index.js | var robotjs = require('./build/Release/robotjs.node');
module.exports = robotjs;
module.exports.screen = {};
function bitmap(width, height, byteWidth, bitsPerPixel, bytesPerPixel, image)
{
this.width = width;
this.height = height;
this.byteWidth = byteWidth;
this.bitsPerPixel = bitsPerPixel;
thi... | var robotjs = require('./build/Release/robotjs.node');
module.exports = robotjs;
module.exports.screen = {};
function bitmap(width, height, byteWidth, bitsPerPixel, bytesPerPixel, image)
{
this.width = width;
this.height = height;
this.byteWidth = byteWidth;
this.bitsPerPixel = bitsPerPixel;
thi... | Call captureScreen with arguments if passed. | Call captureScreen with arguments if passed.
| JavaScript | mit | BHamrick1/robotjs,BHamrick1/robotjs,octalmage/robotjs,BHamrick1/robotjs,hristoterezov/robotjs,hristoterezov/robotjs,octalmage/robotjs,hristoterezov/robotjs,BHamrick1/robotjs,hristoterezov/robotjs,octalmage/robotjs,octalmage/robotjs |
7b540efc9213e5400087670f0ad73c357343608e | index.js | index.js | 'use strict';
module.exports = function dent(array) {
if (array === undefined) {
return dent.tail.shift();
}
dent.array = array;
dent.tail = array.slice();
return dent();
};
| 'use strict';
module.exports = function dent(obj) {
if (obj === undefined) {
return dent.o[dent.idx++];
}
dent.o = obj;
dent.idx = 0;
return dent;
};
| Make it uniformly work with any objects and (pseudo)arrays | Make it uniformly work with any objects and (pseudo)arrays
| JavaScript | mit | eush77/dent |
7dd53e468682a318a3ceaf720439cd702086ac70 | index.js | index.js | 'use strict';
var redis = require('redis'),
coRedis = require('co-redis'),
koa = require('koa');
var app = koa(),
client = redis.createClient(
process.env.REDIS_PORT,
process.env.REDIS_HOST
),
dbCo = coRedis(client);
if (process.env.REDIS_SECRET) {
client.auth(process.env.REDIS_SEC... | 'use strict';
var redis = require('redis'),
coRedis = require('co-redis'),
koa = require('koa');
var app = koa(),
client = redis.createClient(
process.env.REDIS_PORT,
process.env.REDIS_HOST
),
dbCo = coRedis(client);
if (process.env.REDIS_SECRET) {
client.auth(process.env.REDIS_SEC... | Allow hosting of multiple ember applications | Allow hosting of multiple ember applications
Get the index key from the first component of the request path, if available.
This enables hosting of multiple ember applications in a flat prefix namespace.
| JavaScript | mit | dough-com/ember-storm |
f9976713c0f8cdf8131a595cfca29c18ef25306c | index.js | index.js | const PuppeteerDynamics365 = require('./puppeteerdynamics365');
require('dotenv').config();
(async () => {
const pup = new PuppeteerDynamics365(process.env.CRM_URL);
try{
let groups = await pup.start();
// let subgroups = await pup.navigateToGroup(groups, 'Settings');
// let commands = await pup.navig... | const PuppeteerDynamics365 = require('./puppeteerdynamics365');
require('dotenv').config();
(async () => {
let missingSettings = ['CRM_URL','TAB_HOME','USER_SELECTOR','USER_NAME','PASSWORD_SELECTOR','PASSWORD','LOGIN_SUBMIT_SELECTOR','RUN_SHEET_FILE']
.filter(s=>!process.env[s]);
if(missingSettings.length > 0){... | Check if the settings exist before kicking of headless chrome. | Check if the settings exist before kicking of headless chrome.
| JavaScript | mit | rajyraman/Puppeteer-Dynamics-365 |
62910c672b05b9e35fef8bd5f45151f030d1d5c8 | index.js | index.js | import matchbox from './lib/matcher';
import transactionFormatters from './lib/formatters/transactions';
import emailFormatters from './lib/formatters/emails';
import fs from 'fs';
import concat from 'concat-stream';
import os from 'os';
import emailSources from './lib/email-sources';
const match = function(msg, cb) {... | import matchbox from './lib/matcher';
import transactionFormatters from './lib/formatters/transactions';
import emailFormatters from './lib/formatters/emails';
import fs from 'fs';
import concat from 'concat-stream';
import os from 'os';
import emailSources from './lib/email-sources';
const match = function(msg, cb) {... | Add checks for invalid sources. | Add checks for invalid sources. | JavaScript | mit | FoundersAS/matchbox |
8de5a68a313d0df345b0c477bce73f1fa1ef3a7d | index.js | index.js | "use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = Object.keys || require('object-keys');
var isObject = function (obj) {
return typeof obj !== 'undefined' && obj !== null;
};
var assignShim = function assign(target, source) {
var s, i, props;
if (!isObject(target)) { throw new TypeErro... | "use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = require('object-keys');
var isObject = function (obj) {
return typeof obj !== 'undefined' && obj !== null;
};
var assignShim = function assign(target, source) {
var s, i, props;
if (!isObject(target)) { throw new TypeError('target must ... | Revert "Use the native Object.keys if it's available." | Revert "Use the native Object.keys if it's available."
This reverts commit 60689993d75db32701e99f7eb9110ce8eff54610.
| JavaScript | mit | es-shims/object.assign,reggi/object.assign,ljharb/object.assign |
74ce363c1f63be724d6f4c56b6595125d9a88f5c | index.js | index.js | "use strict";
module.exports = {
makeRandomAlphanumericalString: require("./source/make-random-alphanumerical-string"),
addOneTimeListener: require("./source/add-one-time-listener"),
noConcurrentCalls: require("./source/no-concurrent-calls"),
repeatAsyncUntil: req... | "use strict";
module.exports = {
makeRandomAlphanumericalString: require("./source/make-random-alphanumerical-string"),
addOneTimeListener: require("./source/add-one-time-listener"),
noConcurrentCalls: require("./source/no-concurrent-calls"),
repeatAsyncUntil: req... | Remove require() to obsolete resolveWhen() | Remove require() to obsolete resolveWhen()
| JavaScript | mit | tentwentyfour/helpbox |
397e7df00cb827af04476864d865a54588ae84ad | index.js | index.js | /**
* Takes a bounding box and returns a new bounding box with a size expanded or contracted
* by a factor of X.
*
* @module turf/size
* @category measurement
* @param {Array<number>} bbox a bounding box
* @param {number} factor the ratio of the new bbox to the input bbox
* @return {Array<number>} the resized b... | /**
* Takes a bounding box and returns a new bounding box with a size expanded or contracted
* by a factor of X.
*
* @module turf/size
* @category measurement
* @param {Array<number>} bbox a bounding box
* @param {number} factor the ratio of the new bbox to the input bbox
* @return {Array<number>} the resized b... | Switch example to geojson primitives | Switch example to geojson primitives
| JavaScript | mit | Turfjs/turf-size |
07699ec8307549a10398593d3767e6b49e94d10c | index.js | index.js | 'use strict';
var tape = require('tape');
var through = require('through2');
var PluginError = require('gulp-util').PluginError;
var requireUncached = require('require-uncached');
var PLUGIN_NAME = 'gulp-tape';
var gulpTape = function(opts) {
opts = opts || {};
var outputStream = opts.outputStream || process.st... | 'use strict';
var tape = require('tape');
var through = require('through2');
var PluginError = require('gulp-util').PluginError;
var requireUncached = require('require-uncached');
var PLUGIN_NAME = 'gulp-tape';
var gulpTape = function(opts) {
opts = opts || {};
var outputStream = opts.outputStream || process.st... | Allow consumers to provide options that are forwarded to tape | Allow consumers to provide options that are forwarded to tape | JavaScript | mit | yuanqing/gulp-tape |
8a6717fe3edd6bcf12a541f619e8c70c226d96e5 | index.js | index.js | const Gpio = require('onoff').Gpio;
const
ON = 1,
OFF = 0;
const led4 = new Gpio(4, 'out');
const button17 = new Gpio(17, 'in', 'both');
const blink = (led, value = 1) => {
led.write(value, () => {
console.log(`led ${value}`)
setTimeout(() => blink(led, value ? 0 : 1), 1000);
});
};
blink(led4, 1);... | const Gpio = require('onoff').Gpio;
const ON_INTERVAL = 4000;
const led4 = new Gpio(4, 'out');
const button17 = new Gpio(17, 'in', 'both');
const actionLed = (value) => (led) => {
led.write(value, () => {
console.log(`led ${value}`);
});
};
const
on = actionLed(1),
off = actionLed(0);
off(led4);
setIn... | Use button to switch the led off | Use button to switch the led off
| JavaScript | mit | guillaumewuip/du-workshop |
52b0967fd40bef5ac0cbbc5ec542cff4f375806e | index.js | index.js | /**
* Bootstrap our server
*/
const sourceMaps = require('source-map-support')
sourceMaps.install()
require('./src/shared/console')
// Compile files on PROD or launch DEV server
if (process.env.NODE_ENV === 'production') {
require('./configuration/webpack.prod.js')
} else {
require('./configuration/webpack.... | /**
* Bootstrap our server
*/
const sourceMaps = require('source-map-support')
sourceMaps.install()
require('./src/shared/console')
// Compile files on PROD or launch DEV server
if (process.env.NODE_ENV === 'production') {
require('./configuration/webpack.prod.js')
} else {
require('./configuration/webpack.... | Replace babel promise with bluebird promises | Replace babel promise with bluebird promises
| JavaScript | mit | nightwolfz/inferno-starter,nightwolfz/inferno-starter |
28e56aa92f86b77352a7625a6782d956a0d2950e | ui-v2/tests/acceptance/steps/index-forwarding-steps.js | ui-v2/tests/acceptance/steps/index-forwarding-steps.js | import steps from './steps';
// step definitions that are shared between features should be moved to the
// tests/acceptance/steps/steps.js file
export default function(assert) {
return steps(assert);
// .then('I should find a file', function() {
// assert.ok(true, this.step);
// });
}
| import steps from './steps';
// step definitions that are shared between features should be moved to the
// tests/acceptance/steps/steps.js file
export default function(assert) {
return steps(assert).then('I should find a file', function() {
assert.ok(true, this.step);
});
}
| Make this steps file the same as the others... | Make this steps file the same as the others...
WIP: Ideally all of these would go
| JavaScript | mpl-2.0 | vamage/consul,42wim/consul,kingland/consul,youhong316/consul,calgaryscientific/consul,scalp42/consul,hashicorp/consul,scalp42/consul,vamage/consul,42wim/consul,scalp42/consul,vamage/consul,kingland/consul,calgaryscientific/consul,youhong316/consul,scalp42/consul,hashicorp/consul,youhong316/consul,42wim/consul,calgarysc... |
75229ed266731f4b84c6bd198aaf5e2f16b803a5 | main.js | main.js | import { perform } from "./tasks";
import fs from 'fs';
import config from "./config"
function setupGoCDAuth(config) {
if (config.gocd && config.gocd.auth) {
const auth = config.gocd.auth;
if (auth.username === "ENV_GOCD_USERNAME") {
auth.username = process.env.GOCD_USERNAME;
}
if (auth.passwo... | import { perform } from "./tasks";
import fs from 'fs';
import config from "./config"
function setupGoCDAuth(config) {
if (config.gocd && config.gocd.auth) {
const auth = config.gocd.auth;
if (auth.username === "ENV_GOCD_USERNAME") {
auth.username = process.env.GOCD_USERNAME;
}
if (auth.passwo... | Revert "show failed pipelines on top" | Revert "show failed pipelines on top"
This reverts commit de863cf25b8dce7e3daa6e46d9f9a8ee2248d167.
| JavaScript | mit | zhangyuan/ci_dashboard,zhangyuan/ci_dashboard |
1762d021a493c9248a26854af22da1713f491fec | plugins/generic.js | plugins/generic.js | 'use strict'
const FS = require('fs')
const Base = require('./base')
class GenericPlugin extends Base {
constructor() {
super()
this.registerTag(['Compiler-Include'], function(name, value) {
return new Promise(function(resolve, reject) {
FS.readFile(value, function (err, data) {
if (... | 'use strict'
const FS = require('fs')
const Path = require('path')
const Base = require('./base')
class GenericPlugin extends Base {
constructor() {
super()
this.registerTag(['Compiler-Include'], function(name, value) {
return new Promise(function(resolve, reject) {
FS.readFile(value, function... | Make output path relative of file path | :bug: Make output path relative of file path
| JavaScript | mit | steelbrain/UCompiler |
13a29865c43246924f7d23a6a1f5ab37e217cc91 | app/js/controllers/wod-controller.js | app/js/controllers/wod-controller.js | angular.module('myApp')
.controller('WodController', function($scope, $routeParams, $sce, Wod, Video) {
var settings = $routeParams.id;
settings = settings.replace(/[\[\]']+/g,'');
settings = settings.split(",");
var parameters = "intensity="+settings[0]+"&focus="+settings[1]+"&format="+settings[2];
$scope.wod = Wod.... | angular.module('myApp')
.controller('WodController', function($scope, $routeParams, $sce, Wod, Video) {
// Extract workout configuration parameters passed in url.
var settings = $routeParams.id;
settings = settings.replace(/[\[\]']+/g,'');
settings = settings.split(",");
var parameters = "intensity="+settings[0]+"&foc... | Add comments for wod controller. | Add comments for wod controller.
| JavaScript | mit | lgabriel28/wodextv2,lgabriel28/wodextv2,lgabriel28/wodextv2 |
b9fad0ebace7cd363538eaa16bc97b05f2958fa7 | .eslintrc.js | .eslintrc.js | module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:flowtype/recommended'
],
parserOptions: {
ecmaFeatures: {
ex... | module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:flowtype/recommended'
],
parserOptions: {
ecmaFeatures: {
ex... | Add lint rules for SFC | Add lint rules for SFC
| JavaScript | mit | keik/gh,keik/gh,keik/gh |
ff0b8a1c14b8c0f20e4f2efee41b4e5234ba9a58 | .eslintrc.js | .eslintrc.js | (function() {
var error = 2;
module.exports = {
root: true,
extends: "ftgp",
parserOptions: {
ecmaVersion: 6,
sourceType: "module"
},
rules: {
"quotes": [error, "double"],
"ftgp/require-class-comment": 0
}
};
})();
| (function() {
var error = 2;
module.exports = {
root: true,
extends: "ftgp",
parserOptions: {
ecmaVersion: 6,
sourceType: "module"
},
rules: {
"no-console": [error],
"quotes": [error, "double"],
"ftgp/require-class-comment": 0
}
};
})();
| Add missing eslint's no-console rule | Add missing eslint's no-console rule
| JavaScript | mit | foretagsplatsen/widget-js,foretagsplatsen/widget-js |
51f8a378860504bf52a736a9be7ac5ea9443c6a1 | src/assets/scripts/modern/superslide.init.js | src/assets/scripts/modern/superslide.init.js | // JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
import focusTrap from "focus-trap";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
... | // JavaScript Document
// Scripts written by __gulp_init__author_name @ __gulp_init__author_company
import SuperSlide from "superslide.js";
// get the elements
const CONTENT = document.getElementById("page-container");
const SLIDER = document.getElementById("mobile-menu");
const TOGGLE = document.querySel... | Revert "Trap focus to the menu when open" | Revert "Trap focus to the menu when open"
This reverts commit ed195f52702a7eead162d9f10e6e898de0fe9029.
Trapping focus was preventing the menu from being closeable
| JavaScript | mit | revxx14/new-site,JacobDB/new-site,JacobDB/new-site,JacobDB/new-site,revxx14/new-site |
547c90b7ade6a3ac7ec57fe019c1b3ba441bfa9a | Item.js | Item.js | define(function() {
'use strict';
function Item() {
}
Item.prototype = {
eventTarget: window,
dispatchEvent: function() {
return this.eventTarget.dispatchEvent.apply(this.eventTarget, arguments);
},
};
function ItemCollection() {
}
ItemCollection.prototype = {
eventTar... | define(function() {
'use strict';
function Item() {
}
Item.prototype = {
eventTarget: window,
dispatchEvent: function() {
return this.eventTarget.dispatchEvent.apply(this.eventTarget, arguments);
},
};
function ItemCollection() {
}
ItemCollection.prototype = {
eventTar... | Add method to mark collection complete | Add method to mark collection complete | JavaScript | mit | radishengine/drowsy,radishengine/drowsy |
3c8e0f23553b52dd44bb9ae5056c898723be2cf8 | Facebook_LSP/tab_beatrix_potter_colecao/js/functions.js | Facebook_LSP/tab_beatrix_potter_colecao/js/functions.js | $(document).ready(function() {
$('#toggle-livros').click(function(){
activate('livros');
deactivate('bio');
return false;
});
$('#toggle-bio').click(function(){
deactivate('livros');
activate('bio');
return false;
});
});
function activate(sect... | $(document).ready(function() {
$('#toggle-livros').click(function(){
activate('livros');
deactivate('bio');
return false;
});
$('#toggle-bio').click(function(){
deactivate('livros');
activate('bio');
return false;
});
});
function activate(sect... | Fix toggle buttons not changing the focus highlight | Facebook: Fix toggle buttons not changing the focus highlight | JavaScript | mit | SmallBlackRoom/smallblackroom.com,SmallBlackRoom/smallblackroom.com |
820c0e9ba109c12d6eca2228b1ecd0c087dfb4b2 | packages/strapi-plugin-upload/admin/src/containers/InputModalStepper/Search.js | packages/strapi-plugin-upload/admin/src/containers/InputModalStepper/Search.js | import React, { useState, useEffect, memo } from 'react';
import { useDebounce } from '@buffetjs/hooks';
import { useGlobalContext } from 'strapi-helper-plugin';
import getTrad from '../../utils/getTrad';
import useModalContext from '../../hooks/useModalContext';
import HeaderSearch from './HeaderSearch';
const Searc... | import React, { useState, useEffect, memo } from 'react';
import { useDebounce } from '@buffetjs/hooks';
import { useGlobalContext } from 'strapi-helper-plugin';
import getTrad from '../../utils/getTrad';
import useModalContext from '../../hooks/useModalContext';
import HeaderSearch from './HeaderSearch';
const Searc... | Hide searchbar in upload modal ctm when not allowed to read | Hide searchbar in upload modal ctm when not allowed to read
Signed-off-by: soupette <0a59f0508aa203bc732745954131d022d9f538a9@gmail.com>
| JavaScript | mit | wistityhq/strapi,wistityhq/strapi |
a0faf168092d128279c2305df6c02c686c66e901 | webroot/js/messageHandlers/playerDiedHandler.js | webroot/js/messageHandlers/playerDiedHandler.js | import GameOverDialog from '../dialogs/gameOverDialog';
import { globalState } from '../globals';
const playerDiedHandler = (message) => {
const playerId = message.id;
const killedBy = message.killedBy
const killedByName = globalState.clientIdToName.get(killedBy)
let spaceship = globalState.spaceshipMap.get(p... | import GameOverDialog from '../dialogs/gameOverDialog';
import { globalState } from '../globals';
const playerDiedHandler = (message) => {
const killedPlayer = message.id;
const killedBy = message.killedBy;
const myId = globalState.clientId;
let spaceship = globalState.spaceshipMap.get(killedPlayer);
spaces... | Fix revenge target coloring bug | Fix revenge target coloring bug
| JavaScript | mit | u2i/superstellar,u2i/superstellar,u2i/superstellar,u2i/superstellar |
a141df366af9ab44e7bf51c895d7ac85ad761894 | index.js | index.js | var Twitter = require('twode'),
_ = require('underscore'),
CronJob = require('cron').CronJob;
config = require('./lib/config'),
fs = require("fs"),
readFile = fs.readFileSync("./data/FY2016Q1.json", "UTF-8"),
q1 = JSON.parse(readFile),
counter = 0,
twit = new Twitter({
consumer_k... | var Twitter = require('twode'),
_ = require('underscore'),
CronJob = require('cron').CronJob;
config = require('./lib/config'),
fs = require("fs"),
readFile = fs.readFileSync("./data/FY2016Q1.json", "UTF-8"),
q1 = JSON.parse(readFile),
counter = 0,
twit = new Twitter({
consumer_k... | Add hack to get it to run successfully on heroku | Add hack to get it to run successfully on heroku
| JavaScript | mit | PunkChameleon/FiscalPhilly |
387edeca25be9cd441463257a6ae4f871bfcc0f7 | index.js | index.js | 'use strict';
var isExtendable = require('is-extendable');
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
throw new TypeError('expected an object');
}
if (!isObject(obj)) {
obj = {};
}
for (var i = 1; i < arguments.length; i++) {
... | 'use strict';
var isExtendable = require('is-extendable');
module.exports = Object.assign || function(obj/*, objects*/) {
if (obj === null || typeof obj === 'undefined') {
throw new TypeError('Cannot convert undefined or null to object');
}
if (!isObject(obj)) {
obj = {};
}
for (var i = 1; i < argum... | Use the TypeError message from Chrome | Use the TypeError message from Chrome
| JavaScript | mit | jonschlinkert/extend-shallow |
8f86a748eb2bc233f9372ff2412faf91624cac27 | index.js | index.js | var crypto = require('crypto');
// User ARN: arn:aws:iam::561178107736:user/prx-upload
// Access Key ID: AKIAJZ5C7KQPL34SQ63Q
var key = '';
exports.handler = function (event, context) {
var base64encodedData, data, signature;
base64encodedData = event.to_sign_encoded;
data = new Buffer(base64encodedData,... | 'use strict';
const crypto = require('crypto');
// User ARN: arn:aws:iam::561178107736:user/prx-upload
// Access Key ID: AKIAJZ5C7KQPL34SQ63Q
const key = process.env.ACCESS_KEY;
exports.handler = function (event, context, callback) {
let base64encodedData, data, signature;
base64encodedData = event.to_s... | Use more modern JS code and Lambda features | Use more modern JS code and Lambda features | JavaScript | agpl-3.0 | PRX/upload.prx.org,PRX/upload.prx.org |
ed88919ffb2499ba1e0173c8cb243543c6ef004d | index.js | index.js | /**
* @file index
* @author Jim Bulkowski <jim.b@paperelectron.com>
* @project pomegranate-sequelize-core
* @license MIT {@link http://opensource.org/licenses/MIT}
*/
'use strict';
var Sequelize = require('sequelize')
/**
*
* @module index
*/
exports.metadata = {
name: 'Sequelize',
layer: 'core',
param:... | /**
* @file index
* @author Jim Bulkowski <jim.b@paperelectron.com>
* @project pomegranate-sequelize-core
* @license MIT {@link http://opensource.org/licenses/MIT}
*/
'use strict';
var Sequelize = require('sequelize')
/**
*
* @module index
*/
exports.metadata = {
name: 'Sequelize',
param: 'SQL',
type: '... | Update for Pomegranate > 4 | Update for Pomegranate > 4
| JavaScript | mit | Pomegranate/pomegranate-sequelize-core |
4d54ff51fef14cfaa65bd16810bf0720612ebabe | index.js | index.js | module.exports = function(value) {
var caps = 0;
var index = -1;
var length = value.length;
while (index++ < length) {
var chr = value[index];
if (chr >= 'A' && chr <= 'Z') {
caps++;
}
}
return caps / (length * 1.0);
}; | module.exports = function(value) {
var caps = 0;
var index = -1;
var length = value.length;
while (index++ < length) {
var chr = value[index];
if (chr.toLowerCase() !== chr && chr.toUpperCase() === chr) {
caps++;
}
}
return caps / (length * 1.0);
};
| Support accented characters like "É", "Ñ", and "ñ" | Support accented characters like "É", "Ñ", and "ñ"
Closes #1.
| JavaScript | mit | nwitch/caps-rate |
501da67c38534fa2d90f4b0c07cd5157cbab103e | index.js | index.js | var urlResolve = require('url').resolve;
// Resolves a url relative to the root git url
// this produces a full url (domain included)
// this works nicely with extra slashes in places
function urlJoin(rootUrl, url) {
// Normalize then resolve URLs
return urlResolve(
ensureSuffix(trimSuffix(rootUrl, '/'... | var urlResolve = require('url').resolve;
// Resolves a url relative to the root git url
// this produces a full url (domain included)
// this works nicely with extra slashes in places
function urlJoin(rootUrl, url) {
// Normalize then resolve URLs
return urlResolve(
// Ensure trailing slash
roo... | Simplify code by using regexes to normalize strings | Simplify code by using regexes to normalize strings
| JavaScript | apache-2.0 | GitbookIO/urljoin.js |
3a54b159bcc98a4d9b2da24ff2a1db62e83a63d2 | index.js | index.js | module.exports = function (number) {
'use strict';
var MIN = 0, MAX = 4999, crossingTransformation, transform = number;
crossingTransformation = [
{decimal: 1000, roman: 'M'},
{decimal: 900, roman: 'CM'},
{decimal: 500, roman: 'D'},
{decimal: 490, roman: 'XD'},
{decimal: 100, roman: 'C'},
... | module.exports = function (number) {
'use strict';
var MIN = 0, MAX = 4999, crossingTransformation, transform = number;
crossingTransformation = [
{decimal: 1000, roman: 'M'},
{decimal: 900, roman: 'CM'},
{decimal: 500, roman: 'D'},
{decimal: 490, roman: 'XD'},
{decimal: 100, roman: 'C'},
... | Convert to while loop to add clarity | Convert to while loop to add clarity
| JavaScript | mit | vcostin/roman-numbers |
79572e43b1f09ea8b4c7fdb952e7649727b0fef3 | index.js | index.js | 'use strict';
const request = require('request');
var getJSON = function(query, cb) {
if (typeof query != 'string') cb(TypeError('Expected a string as first argument.'));
const base = 'https://www.googleapis.com/scribe/v1/research';
const qs = {
key: 'AIzaSyDqVYORLCUXxSv7zneerIgC2UYMnxvPeqQ',
dataset: '... | 'use strict';
const request = require('request');
var getJSON = function(query, cb) {
if (typeof query != 'string') return cb(new TypeError('Expected a string as first argument.'), null);
const base = 'https://www.googleapis.com/scribe/v1/research';
const qs = {
key: 'AIzaSyDqVYORLCUXxSv7zneerIgC2UYMnxv... | Add return for callbacks, name for Errors. | Add return for callbacks, name for Errors.
| JavaScript | mit | kshvmdn/define-it |
81ec1c08249af2b4607db9934e48c1d590196504 | index.js | index.js | // Define server
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
const axios = require('axios');
// for parsing application/json
app.use(bodyParser.json());
// for parsing application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({
extended: true
})); | // Define server
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
const AXIOS = require('axios');
const SERVER_PORT = 3000;
// for parsing application/json
app.use(bodyParser.json());
// for parsing application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({
ex... | Add server starter script and define constants in uppercase | Add server starter script and define constants in uppercase
| JavaScript | apache-2.0 | bserh/giphify_bot |
e0218a081cd14e37c402a312f7ed490bcad42a1f | Gruntfile.js | Gruntfile.js | module.exports = function (grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'lib/**/*.js',
'test/**/*.js'
]
},
bgShell: {
dropDatabase: {
cmd: 'mongo mwc_logs_test --eval "db.dropDatabase()"',
bg: false
}
},
mochacli: {
o... | module.exports = function (grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'lib/**/*.js',
'test/**/*.js'
]
},
bgShell: {
dropDatabase: {
cmd: 'mongo mwc_logs_test --eval "db.dropDatabase()"',
bg: false
}
},
mochacli: {
o... | Drop test database after run the test | Drop test database after run the test
| JavaScript | mit | kabam-archived/logging |
ab1e199c0bd2720aefb30a15f7b642902aaf07ee | app/services/message.js | app/services/message.js | import Ember from 'ember';
// import i18n from 'ember-i18n';
const MESSAGE_DURATION = 7000;
export default Ember.Service.extend({
i18n: Ember.inject.service(),
messageKey: null,
isVisible: false,
display(messageKey) {
this.setProperties({
messageKey,
isVisible: true
});
},
clear() {... | import Ember from 'ember';
const MESSAGE_DURATION = 7000;
export default Ember.Service.extend({
i18n: Ember.inject.service(),
messageKey: null,
isVisible: false,
display(messageKey) {
this.setProperties({
messageKey,
isVisible: true
});
},
clear() {
this.setProperties({
me... | Clean up cruft that was accidentally committed. | Clean up cruft that was accidentally committed.
| JavaScript | mit | mchat/call-my-congress,mchat/call-my-congress |
4eefbbe47fe4e31288451002bfd3a71b93bc6a15 | scripts/buildexamples.js | scripts/buildexamples.js | // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var childProcess = require('child_process');
var fs = require('fs');
// Build all of the example folders.
dirs = fs.readdirSync('examples');
for (var i = 0; i < dirs.length; i++) {
console.log('\n********');
co... | // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var childProcess = require('child_process');
var fs = require('fs');
// Build all of the example folders.
dirs = fs.readdirSync('examples');
for (var i = 0; i < dirs.length; i++) {
console.log('\n********');
co... | Update the example build script | Update the example build script
| JavaScript | bsd-3-clause | charnpreetsingh185/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,charnpreetsingh185/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,jupyter/jupyterlab,eskirk/jupyterlab,charnpreetsingh185/jupyterlab,charnpreetsingh185/jupyterlab,eskirk/jupyterlab,eskirk/jupyterlab,esk... |
306c25e1648e129b5b415f811ea626bff40bd734 | Gruntfile.js | Gruntfile.js | "use strict";
module.exports = function (grunt) {
grunt.initConfig({
eslint: {
src: [
"Gruntfile.js",
"index.js",
"lib/**/*.js",
"test/**/*.js"
]
},
vows: {
all: {
... | "use strict";
module.exports = function (grunt) {
grunt.initConfig({
eslint: {
src: [
"Gruntfile.js",
"index.js",
"lib/**/*.js",
"test/**/*.js"
]
},
vows: {
all: {
... | Add third, fourth and fifth test to the benchmark. | Add third, fourth and fifth test to the benchmark. | JavaScript | mit | albertosantini/node-quadprog,albertosantini/node-quadprog |
6f7036acd3673c6564d8b8a9e7aab02dc8cd0ba7 | src/hooks/index.js | src/hooks/index.js | 'use strict';
// Add any common hooks you want to share across services in here.
//
// Below is an example of how a hook is written and exported. Please
// see http://docs.feathersjs.com/hooks/readme.html for more details
// on hooks.
exports.isAdmin = function(options) {
return function(hook) {
if (!hook.params.... | 'use strict';
// Add any common hooks you want to share across services in here.
//
// Below is an example of how a hook is written and exported. Please
// see http://docs.feathersjs.com/hooks/readme.html for more details
// on hooks.
exports.isAdmin = function(options) {
return function(hook) {
if (!hook.params.... | Fix undefined user issue in hook | Fix undefined user issue in hook
| JavaScript | mit | davejtoews/cfl-power-rankings,davejtoews/cfl-power-rankings |
e6a98df89826e9e9be747387f1a6990da3dc61b4 | 05/jjhampton-ch5-mother-child.js | 05/jjhampton-ch5-mother-child.js | import ANCESTRY_FILE from './ancestry-json';
const ancestry = JSON.parse(ANCESTRY_FILE);
// Using the example data set from this chapter, compute the average age difference between mothers and children (the age of the mother when the child is born). You can use the average function defined earlier in this chapter.
//... | import ANCESTRY_FILE from './ancestry-json';
const ancestry = JSON.parse(ANCESTRY_FILE);
// Using the example data set from this chapter, compute the average age difference between mothers and children (the age of the mother when the child is born). You can use the average function defined earlier in this chapter.
//... | Add solution for mother-child-age-difference exercise | Add solution for mother-child-age-difference exercise
| JavaScript | mit | OperationCode/eloquent-js |
57e32dc4423cd05411d58a42576e95ed67143623 | resources/assets/js/view/tag-select.js | resources/assets/js/view/tag-select.js | module.exports = Backbone.View.extend({
tagName: 'select',
className: 'tag-select form-control',
initialize: function (options) {
this.$el.selectize({
valueField: 'id',
labelField: 'name',
searchField: ['slug', 'name'],
create: false,
... | module.exports = Backbone.View.extend({
tagName: 'select',
className: 'tag-select form-control',
initialize: function (options) {
this.$el.selectize({
plugins: ['remove_button'],
valueField: 'id',
labelField: 'name',
searchField: ['slug', 'name'... | Remove button to tag select. | Remove button to tag select.
| JavaScript | agpl-3.0 | santakani/santakani.com,santakani/santakani,santakani/santakani,santakani/santakani,santakani/santakani.com,santakani/santakani.com,santakani/santakani |
cfce10e205a9b48c820f3f3a042d4fb999325305 | Server/api/users/handler/user/id/getUser.js | Server/api/users/handler/user/id/getUser.js | 'use strict';
const Boom = require('boom');
const User = require('../../../models/User');
const formatUser = require('../../../util/userFunctions').formatUser;
module.exports = (req, res) => {
User.findById(req.params.id, function (err, user) {
if (err) {
res(Boom.badRequest(err));
}
res(formatUse... | 'use strict';
const Boom = require('boom');
const User = require('../../../models/User');
const Code = require(`${PATH}/config/errorCodes`);
const formatUser = require('../../../util/userFunctions').formatUser;
module.exports = (req, res) => {
User.findById(req.params.id, function (err, user) {
if (err || !user... | Fix a bug where not valid id crashed the server | Fix a bug where not valid id crashed the server
| JavaScript | mit | ninja4826/angular2_weeklydev,ninja4826/angular2_weeklydev,ninja4826/angular2_weeklydev |
1ec713ccf3e003d18d7ae576fb2dd195d75ba5d8 | lib/connect/response.js | lib/connect/response.js |
/*!
* Ext JS Connect
* Copyright(c) 2010 Ext JS, Inc.
* MIT Licensed
*/
/**
* Module dependencies.
*/
var http = require('http'),
Buffer = require('buffer').Buffer;
var resProto = http.ServerResponse.prototype;
/**
* Respond with custom status code
* if the message is a non-buffer object, send it as JSO... |
/*!
* Ext JS Connect
* Copyright(c) 2010 Ext JS, Inc.
* MIT Licensed
*/
/**
* Module dependencies.
*/
var http = require('http'),
Buffer = require('buffer').Buffer;
var resProto = http.ServerResponse.prototype;
/**
* Respond with custom status code
* if the message is a non-buffer object, send it as JSO... | Send the charset with simpleBody. | Send the charset with simpleBody.
| JavaScript | mit | liuwei9413/connect,austincitylimits/connect,chinazhaghai/connect,lian774739140/connect,mi2oon/connect,wghust/connect,senchalabs/connect,gtomitsuka/connect,khirayama/connect,llwanghong/connect,keenwon/connect,redmantech/connect,tanveer12332/connect,redmantech/connect,RickyDan/connect,behind2/connect,RoseTHERESA/connect,... |
02f7318e9bf15db860e623c6194b4b4fd49118d2 | main/webapp/skins/common/scripts/getBlank.js | main/webapp/skins/common/scripts/getBlank.js | /*
* Copyright 2002-2004 The Apache Software Foundation or its licensors,
* as applicable.
*
* 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
*... | /*
* Copyright 2002-2004 The Apache Software Foundation or its licensors,
* as applicable.
*
* 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 of getPrompt function to redisplay the prompt when search field is empty. | Add of getPrompt function to redisplay the prompt when search field is empty.
git-svn-id: 36dcc065b18e9ace584b1c777eaeefb1d96b1ee8@290116 13f79535-47bb-0310-9956-ffa450edef68
| JavaScript | apache-2.0 | apache/forrest,apache/forrest,apache/forrest,apache/forrest,apache/forrest,apache/forrest |
8f3ad0f8e43ade3670ee3f815726f0baba2082e0 | src/index.js | src/index.js | import fs from 'fs'
import path from 'path'
import _ from 'lodash'
import postcss from 'postcss'
import stylefmt from 'stylefmt'
import defaultConfig from './defaultConfig'
import mergeConfig from './util/mergeConfig'
import substituteResetAtRule from './lib/substituteResetAtRule'
import evaluateTailwindFunctions fr... | import fs from 'fs'
import path from 'path'
import _ from 'lodash'
import postcss from 'postcss'
import stylefmt from 'stylefmt'
import defaultConfig from './defaultConfig'
import mergeConfig from './util/mergeConfig'
import substituteResetAtRule from './lib/substituteResetAtRule'
import evaluateTailwindFunctions fr... | Add default config to module.exports | Add default config to module.exports
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss |
301ae3dc8ba7425830b48835768d2cf2623af948 | src/index.js | src/index.js | #!/usr/bin/env node
'use strict';
const program = require('commander');
const animeDl = require('anime-dl');
const chalk = require('chalk');
const updateNotifier = require('update-notifier');
const pkg = require('../package.json');
const ora = require('ora');
updateNotifier({pkg}).notify();
program
.version(pkg.v... | #!/usr/bin/env node
'use strict';
const program = require('commander');
const animeDl = require('anime-dl');
const chalk = require('chalk');
const updateNotifier = require('update-notifier');
const pkg = require('../package.json');
const ora = require('ora');
const spawn = require('child_process').spawn;
updateNotif... | Add suport play chapter in mpv | feat(player): Add suport play chapter in mpv
| JavaScript | mit | lgaticaq/anime-dl-cli |
5fbe935b74e7deb955b320f6ac916d44c3abf4f9 | src/index.js | src/index.js | /* @flow */
import React from 'react'
import {
curry,
compose,
Either,
map,
merge,
prop,
sequence,
update
} from './utils/'
const { Right, Left } = Either
const makePredicate = ([predFn, e]) => a => predFn(a) ? Right(a) : Left(e)
const runPredicates = ([input, validations]) =>
map(predFn => predFn(i... | /* @flow */
import {
curry,
compose,
Either,
map,
merge,
prop,
sequence,
update
} from './utils/'
const { Right, Left } = Either
const makePredicate = ([predFn, e]) => a => predFn(a) ? Right(a) : Left(e)
const runPredicates = ([input, validations]) =>
map(predFn => predFn(input), map(makePredicate, ... | Remove React import, validation is React agnostic | Remove React import, validation is React agnostic
| JavaScript | mit | 25th-floor/revalidation,25th-floor/revalidation |
a53bfa6ce5d67aa6e087fd5063a6e1dc33202b56 | src/index.js | src/index.js | import QuizGenerator from './quiz-generator.js';
import Source from './source.js';
import preprocessors from './preprocessor/index';
import lemmatizers from './lemmatizer/index';
import utils from './utils.js';
export default QuizGenerator;
export {
Source,
preprocessors,
lemmatizers,
utils,
};
| import QuizGenerator from './quiz-generator.js';
import Source from './source.js';
export default QuizGenerator;
export { Source };
| Stop exposing preprocessors, lemmatizers and utils | Stop exposing preprocessors, lemmatizers and utils
| JavaScript | mit | nodaguti/word-quiz-generator |
420823757405f29d2c3e2912be4b456393488ee9 | src/Oro/Bundle/UIBundle/Resources/public/js/extend/bootstrap/bootstrap-popover.js | src/Oro/Bundle/UIBundle/Resources/public/js/extend/bootstrap/bootstrap-popover.js | define(function(require) {
'use strict';
var $ = require('jquery');
var _ = require('underscore');
require('bootstrap');
require('./bootstrap-tooltip');
var Tooltip = $.fn.tooltip.Constructor;
var Popover = $.fn.popover.Constructor;
_.extend(Popover.prototype, _.pick(Tooltip.prototype... | define(function(require) {
'use strict';
var $ = require('jquery');
var _ = require('underscore');
require('bootstrap');
require('./bootstrap-tooltip');
var Tooltip = $.fn.tooltip.Constructor;
var Popover = $.fn.popover.Constructor;
_.extend(Popover.prototype, _.pick(Tooltip.prototype... | Refactor all usages of price matching JS component - fixes after backmerge | BB-2453: Refactor all usages of price matching JS component
- fixes after backmerge
| JavaScript | mit | geoffroycochard/platform,orocrm/platform,Djamy/platform,geoffroycochard/platform,geoffroycochard/platform,Djamy/platform,orocrm/platform,orocrm/platform,Djamy/platform |
1a5dda702f1cbef923665c78f950af5b2e186e82 | website/app/application/core/projects/project/provenance/vis-network-directive.js | website/app/application/core/projects/project/provenance/vis-network-directive.js | Application.Directives.directive('visNetwork', visNetworkDirective);
function visNetworkDirective() {
return {
restrict: 'E',
require: '^ngModel',
scope: {
ngModel: '=',
onSelect: '&',
options: '='
},
link: function($scope, $element, $attr... | Application.Directives.directive('visNetwork', visNetworkDirective);
function visNetworkDirective() {
return {
restrict: 'E',
require: '^ngModel',
scope: {
ngModel: '=',
onSelect: '&',
options: '=',
onLoaded: '&'
},
link: funct... | Add on-loaded argument so applications can get ahold of the network. Fix up the watch so that it sets the data for the network rather than creating a new network. | Add on-loaded argument so applications can get ahold of the network. Fix
up the watch so that it sets the data for the network rather than
creating a new network.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
9fecc741ffca50fa3ffe72422b5f739417a04790 | cla_public/static-src/javascripts/modules/properties.js | cla_public/static-src/javascripts/modules/properties.js | (function () {
'use strict';
moj.Modules.Properties = {
init: function() {
this.cacheEls();
this.bindEvents();
},
bindEvents: function() {
var self = this;
$('#PropertiesForm').on('submit', function(e) {
var activeEl = document.activeElement;
if(activeEl.type ... | (function () {
'use strict';
moj.Modules.Properties = {
init: function() {
this.cacheEls();
this.bindEvents();
},
bindEvents: function() {
var self = this;
$('#PropertiesForm').on('submit', function(e) {
var activeEl = document.activeElement;
if(activeEl.type ... | Add events for property actions (add/remove) | FE: Add events for property actions (add/remove)
| JavaScript | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public |
dca436ecfd25d400ecd6760ba8aeeefc067b4687 | lib/emitters/custom-event-emitter.js | lib/emitters/custom-event-emitter.js | var util = require("util")
, EventEmitter = require("events").EventEmitter
module.exports = (function() {
var CustomEventEmitter = function(fct) {
this.fct = fct;
var self = this;
process.nextTick(function() {
if (self.fct) {
self.fct.call(self, self)
}
}.bind(this));
... | var util = require("util")
, EventEmitter = require("events").EventEmitter
module.exports = (function() {
var CustomEventEmitter = function(fct) {
this.fct = fct;
var self = this;
}
util.inherits(CustomEventEmitter, EventEmitter)
CustomEventEmitter.prototype.run = function() {
var self =... | Move process.nextTick() to run() method | Move process.nextTick() to run() method
Hope this fixes the tests. Thanks @janmeier | JavaScript | mit | grimurd/sequelize,toddbluhm/sequelize,gorangajic/sequelize,yjwong/sequelize,gintsgints/sequelize,alexbooker/sequelize,Kagaherk/sequelize,sorin/sequelize,overlookmotel/sequelize,johanneswuerbach/sequelize,phanect/sequelize,sequelize/sequelize,codyrigney92/sequelize,calvintwr/sequelize,MagicIndustries/sequelize,rpaterson... |
8ff0127aaefb280d310162d898212199ceb327dd | common.blocks/footer/footer.example_col_left.bemjson.js | common.blocks/footer/footer.example_col_left.bemjson.js | ({
block: 'footer',
content: [
{
elem: 'col',
elemMods: { position: 'left' },
content: [
{ block: 'logo' },
{
block: 'social',
providers: ['vk', 'facebook', 'twitter']
},
... | ({
/* ... */
content: [
{ block: 'logo' },
{
block: 'social',
providers: ['vk', 'facebook', 'twitter']
},
{ block: 'copyright' }
]
/* ... */
});
| Reduce footer example col left BEMJSON | Reduce footer example col left BEMJSON
| JavaScript | mit | alexbaumgertner/presentation-bem-stack,alexbaumgertner/presentation-bem-stack |
62e00d4f3ec84f7ca8e08fb7db475a62fe229423 | common/confirmDialog.js | common/confirmDialog.js | define(
[
"dojo/dom-construct",
"dijit/form/Button",
"dijit/Dialog"
],
function (domConstruct, Button, Dialog) {
"use strict";
var dialog = null;
var createButton = function (label, onClickFunc) {
return new Button({
label: label,
onClick: function () {
if (onClickFunc) {
/* run ca... | define(
[
"dojo/dom-construct",
"dijit/form/Button",
"dijit/Dialog"
],
function (domConstruct, Button, Dialog) {
"use strict";
var dialog = null;
var createButton = function (label, onClickFunc) {
return new Button({
label: label,
onClick: function () {
if (onClickFunc) {
/* run ca... | Add cancelFunc parameter for confirm dialog | Add cancelFunc parameter for confirm dialog | JavaScript | mit | dgerhardt/dgerhardt-dojo |
49c1b7114dd0e75cb4dbcfd4de9bd82ead24546e | index.js | index.js | var through = require('through2')
function ChromeRuntimeStream(port) {
var stream = through.obj(function (msg, enc, next) {
port.postMessage(msg)
next()
},
function (done) {
port.disconnect()
done()
})
port.onMessage.addListener(function (msg) {
stream.push(msg)
})
port.onDisconnect... | var through = require('through2')
function ChromeRuntimeStream(port) {
var connected = true
var stream = through.obj(function (msg, enc, next) {
if (connected) {
port.postMessage(msg)
}
next()
},
function flush(done) {
if (connected) {
removeListeners()
connected = false
... | Remove compatibility detection, and refactor listeners to avoid unnecessary calls | Remove compatibility detection, and refactor listeners to avoid unnecessary calls
| JavaScript | mit | programmarchy/node-chrome-runtime-stream |
fca5be64e15559826621207a0823d9f5029ad13f | index.js | index.js | 'use strict';
module.exports = function (arr) {
var arch = process.arch === 'x64' ? 'x64' : process.arch === 'arm' ? 'arm' : 'x86';
var platform = process.platform;
return arr.filter(function (obj) {
if (obj.os === platform && obj.arch === arch) {
delete obj.os;
delete obj.arch;
return obj;
} else if ... | 'use strict';
module.exports = function (arr) {
var arch = process.arch === 'x64' ? 'x64' : process.arch === 'arm' ? 'arm' : 'x86';
var platform = process.platform;
if (!arr.length) {
return null;
}
return arr.filter(function (obj) {
if (obj.os === platform && obj.arch === arch) {
delete obj.os;
delet... | Return `null` if array is empty | Return `null` if array is empty
| JavaScript | mit | kevva/os-filter-obj |
31128ce32e8e8605ae7047e4999a4c565f036a6a | index.js | index.js | module.exports = function (vnode) {
var result = {}
function parser (res, vnode) {
var attrs = vnode.attrs || {}
function append (name, value) {
(res[name] = res[name] || []).push(value)
}
if (!(attrs.name == null)) {
if (['checkbox', 'radio'].indexOf(attrs.type) > -1) {
if (a... | module.exports = function (vnode) {
var result = {}
function parser (res, vnode) {
var attrs = vnode.attrs || {}
function append (name, value) {
(res[name] = res[name] || []).push(value)
}
if (!(attrs.name == null)) {
if (['checkbox', 'radio'].indexOf(attrs.type) > -1) {
if (a... | Make sure we only travers arrays | Make sure we only travers arrays | JavaScript | mit | SamuelTilly/mithril-form-parser |
b94d7be278f42a5fba68bc115e1d69b5fcb33299 | Source/Core/GeocoderService.js | Source/Core/GeocoderService.js | /*global define*/
define([
'./defineProperties',
'./DeveloperError'
], function(
defineProperties,
DeveloperError) {
'use strict';
/**
* @typedef {Object} GeocoderResult
* @property {String} displayName The display name for a location
* @property {Rectangle} rectangle... | /*global define*/
define([
'./defineProperties',
'./DeveloperError'
], function(
defineProperties,
DeveloperError) {
'use strict';
/**
* @typedef {Object} GeocoderResult
* @property {String} displayName The display name for a location
* @property {Rectangle|Cartesian3... | Update geocoder interface to reflect that geocoders can send back results that destinations of type Rectangle or Cartesian3 | Update geocoder interface to reflect that geocoders can send back results that destinations of type Rectangle or Cartesian3
| JavaScript | apache-2.0 | geoscan/cesium,jasonbeverage/cesium,jason-crow/cesium,josh-bernstein/cesium,jason-crow/cesium,AnimatedRNG/cesium,oterral/cesium,CesiumGS/cesium,ggetz/cesium,likangning93/cesium,wallw-bits/cesium,likangning93/cesium,emackey/cesium,aelatgt/cesium,ggetz/cesium,denverpierce/cesium,aelatgt/cesium,soceur/cesium,geoscan/cesiu... |
cb7593abb812f2721a83ba103bf32e3aea0fb65c | index.js | index.js | 'use strict';
var throttle = require('throttleit');
function requestProgress(request, options) {
var reporter;
var delayTimer;
var delayCompleted;
var totalSize;
var previousReceivedSize;
var receivedSize = 0;
var state = {};
options = options || {};
options.throttle = options.thr... | 'use strict';
var throttle = require('throttleit');
function requestProgress(request, options) {
var reporter;
var delayTimer;
var delayCompleted;
var totalSize;
var previousReceivedSize;
var receivedSize = 0;
var state = {};
options = options || {};
options.throttle = options.thr... | Reset received size to 0 on the request event. | Reset received size to 0 on the request event.
| JavaScript | mit | IndigoUnited/node-request-progress |
730e1d711e4d55289cc4a6afa18c0dbd80525cb6 | index.js | index.js | var Promise = require('es6-promise').Promise;
var compose = require('static-compose');
module.exports = function (formulas) {
var promises = formulas.map(function(plugins) {
return compose(plugins)([]);
});
return Promise.all(promises);
};
| var Promise = require('es6-promise').Promise;
var compose = require('static-compose');
module.exports = function (formulas) {
if(!Array.isArray(formulas) || arguments.length > 1) {
formulas = [].slice.call(arguments);
}
var promises = formulas.map(function(plugins) {
return compose(plug... | Allow for a single array or multiple arguments | Allow for a single array or multiple arguments
| JavaScript | mit | erickmerchant/static-engine |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.