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 |
|---|---|---|---|---|---|---|---|---|---|
9310026c8cbc4af5f4326a27cfc27121e5636323 | index.js | index.js | var es = require('event-stream'),
clone = require('clone'),
path = require('path');
module.exports = function(opt){
// clone options
opt = opt ? clone(opt) : {};
if (!opt.splitter && opt.splitter !== "") opt.splitter = '\r\n';
if (!opt.fileName) throw new Error("Missing fileName option for gulp-concat");
... | var es = require('event-stream'),
clone = require('clone'),
path = require('path');
module.exports = function(opt){
// clone options
opt = opt ? clone(opt) : {};
if (typeof opt.splitter === 'undefined') opt.splitter = '\r\n';
if (!opt.fileName) throw new Error("Missing fileName option for gulp-concat");
... | Adjust opt.splitter to compare against undefined for the default value. | Adjust opt.splitter to compare against undefined for the default value.
| JavaScript | mit | wearefractal/gulp-concat,queckezz/gulp-concat,KenanY/gulp-concat,BinaryMuse/gulp-concat,contra/gulp-concat,colynb/gulp-concat,stevelacy/gulp-concat,callumacrae/gulp-concat,abdurrachman-habibi/gulp-concat |
4021d99786f51646633cf9d15fead8c3a58bef7c | index.js | index.js | var rimraf = require('rimraf')
var path = require('path');
var join = path.join;
function Plugin(paths) {
// determine webpack root
this.context = path.dirname(module.parent.filename);
// allows for a single string entry
if (typeof paths == 'string' || paths instanceof String){
paths = [paths];
}
// ... | var rimraf = require('rimraf')
var path = require('path');
var join = path.join;
function Plugin(paths, context) {
// determine webpack root
this.context = context || path.dirname(module.parent.filename);
// allows for a single string entry
if (typeof paths == 'string' || paths instanceof String){
paths =... | Add opportunity pass webpack root (context) | Add opportunity pass webpack root (context)
| JavaScript | mit | chrisblossom/clean-webpack-plugin,mhuggins/clean-webpack-plugin,johnagan/clean-webpack-plugin,chrisblossom/clean-webpack-plugin,johnagan/clean-webpack-plugin |
f4d7e0d0917f7af388c75b4b4816591c4f7410b5 | src/utils/config.js | src/utils/config.js | import _ from 'lodash'
import defaultConfig from '../config/defaults'
let globalConfig = _.assign({}, _.cloneDeep(defaultConfig))
export default class Config {
static load(cfg) {
globalConfig = _.cloneDeep(cfg)
}
static get(item, defaultValue) {
if(item === '*') {
return _.cloneDeep(globalConfig)... | import _ from 'lodash'
import defaultConfig from '../config/defaults'
let globalConfig = _.assign({}, _.cloneDeep(defaultConfig))
export default class Config {
static load(cfg) {
globalConfig = _.merge(globalConfig, _.cloneDeep(cfg))
}
static overwrite(cfg) {
globalConfig = _.cloneDeep(cfg)
}
stat... | Add loading/merging methods to Config utility | Add loading/merging methods to Config utility
| JavaScript | mit | thinktopography/reframe,thinktopography/reframe |
73707d6455b0f4758c61a5c573aec6ad987259de | index.js | index.js | 'use strict';
module.exports = {
name: 'ember-cli-uglify',
included(app) {
this._super.included.apply(this, arguments);
const defaults = require('lodash.defaultsdeep');
let defaultOptions = {
enabled: app.env === 'production',
uglify: {
compress: {
// this is adversely... | 'use strict';
module.exports = {
name: 'ember-cli-uglify',
included(app) {
this._super.included.apply(this, arguments);
const defaults = require('lodash.defaultsdeep');
let defaultOptions = {
enabled: app.env === 'production',
uglify: {
compress: {
// this is adversely... | Add a fix for Safari to the default config | Add a fix for Safari to the default config
Uglifying ES6 doesn't work currently with Safari due to a webkit bug.
Adding this mangle option fixes that.
| JavaScript | mit | ember-cli/ember-cli-uglify,ember-cli/ember-cli-uglify |
628a1e56241fd82104d69ac7e8e4b751ff85e34b | index.js | index.js | var addElevation = require('geojson-elevation').addElevation,
TileSet = require('node-hgt').TileSet,
express = require('express'),
bodyParser = require('body-parser'),
app = express(),
tiles = new TileSet('./data');
app.use(bodyParser.json());
app.use(function(req, res, next) {
res.header('Acce... | var addElevation = require('geojson-elevation').addElevation,
TileSet = require('node-hgt').TileSet,
ImagicoElevationDownloader = require('node-hgt').ImagicoElevationDownloader,
express = require('express'),
bodyParser = require('body-parser'),
app = express(),
tiles,
tileDownloader,
til... | Read environment variables for data directory and tile downloader | Read environment variables for data directory and tile downloader
| JavaScript | isc | perliedman/elevation-service,JesseCrocker/elevation-service |
4bf4680c186dd7e21292e7efc2431547f51ac11b | index.js | index.js | function Alternate() {
this.values = arguments;
this.index = 0;
}
Alternate.prototype.next = function() {
var returnValue = this.values[this.index];
if (this.index < this.values.length) {
this.index++;
} else {
this.index = 0;
}
return returnValue;
};
Alternate.prototype.peek = function() {
... | function Alternate() {
this.values = arguments;
this.index = 0;
}
Alternate.prototype.next = function() {
var returnValue = this.values[this.index];
if (this.index < this.values.length - 1) {
this.index++;
} else {
this.index = 0;
}
return returnValue;
};
Alternate.prototype.peek = function() ... | Fix off by one bug | Fix off by one bug
| JavaScript | mit | sgnh/alternate |
43204c269a394d1805d9ddc208ea6a524729c7cf | index.js | index.js | /*!
* tweensy - Copyright (c) 2017 Jacob Buck
* https://github.com/jacobbuck/tweensy
* Licensed under the terms of the MIT license.
*/
'use strict';
var assign = require('lodash/assign');
var now = require('performance-now');
var rafq = require('rafq')();
var defaultOptions = {
duration: 0,
easing: function l... | /*!
* tweensy - Copyright (c) 2017 Jacob Buck
* https://github.com/jacobbuck/tweensy
* Licensed under the terms of the MIT license.
*/
'use strict';
var assign = require('lodash/assign');
var now = require('performance-now');
var rafq = require('rafq')();
var defaultOptions = {
duration: 0,
easing: function l... | Remove loop to keep scope small. Simplify some code, and pre calculate some things for perf | Remove loop to keep scope small. Simplify some code, and pre calculate some things for perf
| JavaScript | mit | jacobbuck/tweensy,jacobbuck/tweenie |
7c953aa414ea16fd831a11b3be4d74f5c52b5653 | src/database/utilities/constants.js | src/database/utilities/constants.js | /* eslint-disable import/prefer-default-export */
/**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
const HOURS_PER_DAY = 24;
const MINUTES_PER_HOUR = 60;
const SECONDS_PER_MINUTE = 60;
const MILLISECONDS_PER_SECOND = 1000;
export const MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_M... | /* eslint-disable import/prefer-default-export */
/**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
const HOURS_PER_DAY = 24;
const MINUTES_PER_HOUR = 60;
const SECONDS_PER_MINUTE = 60;
const MILLISECONDS_PER_SECOND = 1000;
export const MILLISECONDS_PER_MINUTE = MILLISECONDS_PER_SECOND * SECONDS_PER_M... | Add patient code number sequence | Add patient code number sequence
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
a4acc1c3dbd3d77104f39c957051f2f38884224c | server/app.js | server/app.js | var bodyParser = require('body-parser');
var express = require('express');
var app = express();
var router = express.Router();
var Sequelize = require('sequelize');
var sequelize = new Sequelize(process.env.DATABASE_URL);
var matchmaker = require('./controllers/Matchmaker');
var playController = require('./controllers... | var bodyParser = require('body-parser');
var express = require('express');
var app = express();
var router = express.Router();
var Sequelize = require('sequelize');
var sequelize = new Sequelize(process.env.DATABASE_URL);
var matchmaker = require('./controllers/Matchmaker');
var playController = require('./controllers... | Edit server route url to match client request | Edit server route url to match client request
| JavaScript | mit | andereld/progark,andereld/progark |
7af80538c9232f5bf0d929d4164076a44cb2b704 | render-mustache.js | render-mustache.js | /**
* render-mustache
*
* This module implements support for rendering [Mustache](http://mustache.github.com/)
* templates using [mustache.js](https://github.com/janl/mustache.js).
*/
define(['mustache'],
function(Mustache) {
/**
* Setup Mustache template engine.
*
* When rendering, this engine retur... | /**
* render-mustache
*
* This module implements support for rendering [Mustache](http://mustache.github.com/)
* templates using [mustache.js](https://github.com/janl/mustache.js).
*/
define(['mustache'],
function(Mustache) {
/**
* Setup Mustache template engine.
*
* When rendering, this engine retur... | Add documentation regarding MIME types. | Add documentation regarding MIME types.
| JavaScript | mit | sailjs/render-mustache |
91e5e219929c894cb48391261cc38780c728b0d9 | src/cmd/main/music/handlers/YouTubeHandler.js | src/cmd/main/music/handlers/YouTubeHandler.js | /**
* @file Music handler for YouTube videos. Does not support livestreams.
* @author Ovyerus
*/
const ytdl = require('ytdl-core');
const got = require('got');
const ITAG = '251'; // Preferred iTag quality to get. Default: 251.
class YouTubeHandler {
constructor() {}
async getInfo(url) {
if (type... | /**
* @file Music handler for YouTube videos. Does not support livestreams.
* @author Ovyerus
*/
const ytdl = require('ytdl-core');
const got = require('got');
// List of all itag qualities can be found here: https://en.wikipedia.org/w/index.php?title=YouTube&oldid=800910021#Quality_and_formats.
const ITAG = '140'... | Change requested itag for YouTube music to a M4A+AAC stream, instead of a WebM+Opus stream in an attempt to fix issues | Change requested itag for YouTube music to a M4A+AAC stream, instead of a WebM+Opus stream in an attempt to fix issues
| JavaScript | unknown | awau/owo-whats-this,sr229/owo-whats-this,ClarityMoe/Clara,awau/Clara,owo-dev-team/owo-whats-this |
3f96581aa2df3892d673a3ef175bf8e76f321075 | renderer/middleware/index.js | renderer/middleware/index.js | // @flow
import type {Store, Dispatch, Action} from 'redux';
export const save = (store: Store) => (next: Dispatch) => (action: Action) => {
setImmediate(() => {
localStorage.setItem('store', JSON.stringify(store.getState()));
});
next(action);
};
| // @flow
import type {Store, Dispatch, Action} from 'redux';
export const save = (store: Store) => (next: Dispatch) => (action: Action) => {
if (action.id) {
setImmediate(() => {
localStorage.setItem('store', JSON.stringify(store.getState()));
});
}
next(action);
};
| Update store at Only import change | Update store at Only import change
| JavaScript | mit | akameco/PixivDeck,akameco/PixivDeck |
546e2733e51106975f7b167f3b690771ebd6dcfb | lib/gcli/test/testFail.js | lib/gcli/test/testFail.js | /*
* Copyright 2012, Mozilla Foundation and contributors
*
* 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 applica... | /*
* Copyright 2012, Mozilla Foundation and contributors
*
* 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 applica... | Allow wider set of messages in exception tests | spawn-1007006: Allow wider set of messages in exception tests
If Task.spawn catches an exception message then it adds "Error: " onto
the front, so allow a slightly wider set of error messages when testing.
Signed-off-by: Joe Walker <7a17872fbb32c7d760c9a16ee3076daead11efcf@mozilla.com>
| JavaScript | apache-2.0 | mozilla/gcli,mozilla/gcli,joewalker/gcli,joewalker/gcli,mozilla/gcli |
6288e418a248e997f1e6830d8bfa4e09d33a3717 | src/modules/getPrice/index.js | src/modules/getPrice/index.js | import module from '../../module'
import command from '../../components/command'
import axios from 'axios'
import humanize from '../../utils/humanize'
export default module(
command('getprice', 'Gets the Jita price of a given item.', async (state, message, args) => {
try {
const esiURL = 'https... | import module from '../../module'
import command from '../../components/command'
import axios from 'axios'
import humanize from '../../utils/humanize'
export default module(
command('getprice', 'Gets the Jita price of a given item.', async (state, message, args) => {
try {
const esiURL = 'https... | Modify getPrice to report name of item actually queried | Modify getPrice to report name of item actually queried
| JavaScript | mit | emensch/thonk9k |
56e76553bb5a4f6e44a4739fb4f9eb46dfbfa463 | src/plugins/FileVersioningPlugin.js | src/plugins/FileVersioningPlugin.js | let chokidar = require('chokidar');
let glob = require('glob');
/**
* Create a new plugin instance.
*
* @param {Array} files
*/
function FileVersioningPlugin(files = []) {
this.files = files;
}
/**
* Apply the plugin.
*/
FileVersioningPlugin.prototype.apply = function () {
if (this.files && Mix.isWatch... | let chokidar = require('chokidar');
let glob = require('glob');
/**
* Create a new plugin instance.
*
* @param {Array} files
*/
function FileVersioningPlugin(files = []) {
this.files = files;
}
/**
* Apply the plugin.
*/
FileVersioningPlugin.prototype.apply = function () {
if (this.files && Mix.isWatch... | Clean up file versioning handler | Clean up file versioning handler
| JavaScript | mit | JeffreyWay/laravel-mix |
ad1554d353a332c2eed047b86c3ddbe5f4e3a6c4 | src/components/CenteredMap.js | src/components/CenteredMap.js | import React from 'react'
import PropTypes from 'prop-types'
import { Map, TileLayer, GeoJSON } from 'react-leaflet'
class CenteredMap extends React.PureComponent {
static propTypes = {
vectors: PropTypes.object.isRequired,
className: PropTypes.string,
frozen: PropTypes.bool,
lat: PropTypes.number,
... | import React from 'react'
import PropTypes from 'prop-types'
import { Map, TileLayer, GeoJSON } from 'react-leaflet'
class CenteredMap extends React.PureComponent {
static propTypes = {
vectors: PropTypes.object.isRequired,
className: PropTypes.string,
frozen: PropTypes.bool,
lat: PropTypes.number,
... | Allow double click zoom when map is not frozen | Allow double click zoom when map is not frozen
| JavaScript | mit | sgmap/inspire,sgmap/inspire |
6e95c2af465fc296984e86b73192eca1c32c8f9d | lib/rules/load-average.js | lib/rules/load-average.js | var util = require('util');
var Duplex = require('stream').Duplex;
var LoadAverage = module.exports = function LoadAverage(options) {
this.warn = options.warn;
this.critical = options.critical;
Duplex.call(this, { objectMode: true });
};
util.inherits(LoadAverage, Duplex);
LoadAverage.prototype._write = functi... | var util = require('util');
var Duplex = require('stream').Duplex;
var LoadAverage = module.exports = function LoadAverage(options) {
this.warn = options.warn;
this.critical = options.critical;
Duplex.call(this, { objectMode: true });
};
util.inherits(LoadAverage, Duplex);
LoadAverage.prototype._write = functi... | Use event name for incident name | Use event name for incident name
| JavaScript | isc | numbat-metrics/numbat-analyzer,ceejbot/numbat-analyzer |
fff63aaf393903aa0830f1cf521b3edc775a152e | sdk/src/Constants.js | sdk/src/Constants.js | export default class Constants {
static get USER_ACCOUNT_KEY() { return btoa('blipSdkUAccount'); }
static get IFRAMEURL_LOCAL() { return 'http://localhost:3000/'; }
static get IFRAMEURL_HMG() { return 'https://hmg-sdkcommon.blip.ai/'; }
static get IFRAMEURL_PRD() { return 'https://sdkcommon.blip.ai/'; }... | export default class Constants {
static get USER_ACCOUNT_KEY() { return btoa('blipSdkUAccount'); }
static get IFRAMEURL_LOCAL() { return 'http://localhost:3000/'; }
static get IFRAMEURL_HMG() { return 'https://hmg-sdkcommon.blip.ai/'; }
static get IFRAMEURL_PRD() { return 'https://sdkcommon.blip.ai/'; }... | Change constant value for backward compatibility | Change constant value for backward compatibility
| JavaScript | apache-2.0 | takenet/blip-chat-web,takenet/blip-chat-web,takenet/blip-sdk-web,takenet/blip-sdk-web |
8a970c6b9bf037c10cdc55dc7fa27bcf20d393dc | test/config.spec.js | test/config.spec.js | 'use strict';
/*
config
->read from file, holds values and supplies as needed
*/
require('chai').should()
var config = require('../lib/config')()
describe('Config', () => {
describe('#getLayers', () => {
it('should return layers config array', () => {
//Given
//When
var layers = config.getL... | 'use strict';
/*
config
->read from file, holds values and supplies as needed
*/
require('chai').should()
var config = require('../lib/config')()
describe('Config', () => {
describe('#getLayers', () => {
it('should return layers config array', () => {
//Given
//When
var layers = config.getL... | Update test to reflect config file change | Update test to reflect config file change
| JavaScript | mit | mediasuitenz/mappy,mediasuitenz/mappy |
60fbc2e4405a2168223266f950488dfacb8b2f0a | Player.js | Player.js | /* global Entity */
(function() {
'use strict';
function Player(x, y, speed) {
this.base = Entity;
this.base(
x,
y,
Player.width,
Player.height,
'public/images/sprites/heroes.png',
56,
12,
speed || 150
);
}
Player.width = 32;
Player.height = 52;
... | /* global Entity */
(function() {
'use strict';
function Player(x, y, speed) {
this.base = Entity;
this.base(
x,
y,
Player.width,
Player.height,
'public/images/sprites/heroes.png',
105,
142,
speed || 150
);
}
Player.width = 32;
Player.height = 48;
... | Change player sprite to show hero facing the zombies | Change player sprite to show hero facing the zombies
| JavaScript | mit | handrus/zombies-game,brunops/zombies-game,brunops/zombies-game |
dc9a45d38a5857472b7d9a72f7c2363276cc4efc | tdd/server/palindrome/test/palindrome-test.js | tdd/server/palindrome/test/palindrome-test.js | var expect = require('chai').expect;
var isPalindrome = require('../src/palindrome');
describe('palindrome-test', function() {
it('should pass the canary test', function() {
expect(true).to.be.true;
});
it('should return true when passed "mom"', function() {
expect(isPalindrome('mom')).to.be.true;
});
});
| /*
* Test ideas
*
* 'dad' is a palindrome
* 'dude' is not a palindrome
* 'mom mom' is a palindrome
* 'dad dae' is a palindrome'
*/
var expect = require('chai').expect;
var isPalindrome = require('../src/palindrome');
describe('palindrome-test', function() {
it('should pass the canary test', function() {
exp... | Add test: 'dad' is a palindrome | Add test: 'dad' is a palindrome
| JavaScript | apache-2.0 | mrwizard82d1/tdjsa |
aa9717b62f1a0c0e41f06e9f54393d8cd55769f9 | templates/demo/config/namesystem.js | templates/demo/config/namesystem.js | module.exports = {
default: {
available_providers: ["ens", "ipns"],
provider: "ens",
register: {
rootDomain: "embark.eth",
subdomains: {
'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'
}
}
}
};
| module.exports = {
default: {
available_providers: ["ens", "ipns"],
provider: "ens"
},
development: {
register: {
rootDomain: "embark.eth",
subdomains: {
'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'
}
}
}
};
| Move name config to development | [CHORES] Move name config to development
| JavaScript | mit | iurimatias/embark-framework,iurimatias/embark-framework |
2d14e852c9c833eeec7b63a76102ce4dc29bd2cb | angular/app-foundation.module.js | angular/app-foundation.module.js | /**
* Created by anonymous on 13/12/15 11:09.
*/
(function() {
'use strict';
angular
.module('appFoundation', [
/* Angularjs */
'ngMaterial',
'ngMessages',
'ngResource',
/* 3rd-party */
'ui.router',
'satellizer',
... | /**
* Created by anonymous on 13/12/15 11:09.
*/
(function() {
'use strict';
angular
.module('appFoundation', [
/* Angularjs */
'ngMaterial',
'ngMessages',
'ngResource',
/* 3rd-party */
'ui.router',
'satellizer',
... | Update bower @ Uninstall angular-material-data-table | Update bower @ Uninstall angular-material-data-table
| JavaScript | mit | onderdelen/app-foundation,componeint/app-foundation,onderdelen/app-foundation,onderdelen/app-foundation,componeint/app-foundation,componeint/app-foundation,consigliere/app-foundation,consigliere/app-foundation,consigliere/app-foundation |
fa449ed86a6bfde93654bba283a8c7cc4788bc61 | test/journals-getDokumenter-test.js | test/journals-getDokumenter-test.js | 'use strict'
const tap = require('tap')
const getDokumenter = require('../lib/journals/getDokumenter')
tap.test('Requires options to be specified', function (test) {
const options = false
const expectedErrorMessage = 'Missing required input: options object'
getDokumenter(options, function (error, data) {
ta... | 'use strict'
const tap = require('tap')
const getDokumenter = require('../lib/journals/getDokumenter')
tap.test('Requires options to be specified', function (test) {
const options = false
const expectedErrorMessage = 'Missing required input: options object'
getDokumenter(options, function (error, data) {
ta... | Replace test.done with test.end (patch) | Replace test.done with test.end (patch)
| JavaScript | mit | zrrrzzt/edemokrati |
0492af81a8140b89347ea721f46fcc71088466d8 | test/lib/api-util/api-util-test.js | test/lib/api-util/api-util-test.js | 'use strict';
const preq = require('preq');
const assert = require('../../utils/assert');
const mwapi = require('../../../lib/mwapi');
const logger = require('bunyan').createLogger({
name: 'test-logger',
level: 'warn'
});
logger.log = function(a, b) {};
describe('lib:apiUtil', function() {
this.timeo... | 'use strict';
const assert = require('../../utils/assert');
const mwapi = require('../../../lib/mwapi');
const logger = require('bunyan').createLogger({
name: 'test-logger',
level: 'warn'
});
logger.log = function(a, b) {};
describe('lib:apiUtil', () => {
it('checkForQueryPagesInResponse should return ... | Remove unnecessary API call in unit test | Remove unnecessary API call in unit test
We do not need to hit the API in this test. It's unnecessary and makes
the test harder to comprehend.
Instead of testing this way, simulate a promise that resolves without
pages.
(npm run test:unit should work without an internet connection)
Change-Id: Iee834114890a64c96ccf2... | JavaScript | apache-2.0 | wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps,wikimedia/mediawiki-services-mobileapps |
9eaa53c31ddb5170a9cd3d81e4fc4846a370b6ba | addon/change-gate.js | addon/change-gate.js | import Em from 'ember';
var get = Em.get;
var defaultFilter = function(value) { return value; };
export default function(dependentKey, filter) {
filter = filter || defaultFilter;
var computed = Em.computed(function handler(key) {
var meta = computed.meta();
meta.hasObserver = false;
meta.lastValue =... | import Em from 'ember';
var get = Em.get,
getMeta = Em.getMeta,
setMeta = Em.setMeta;
var defaultFilter = function(value) { return value; };
export default function(dependentKey, filter) {
filter = filter || defaultFilter;
return Em.computed(function(key) {
var hasObserverKey = '_changeGate:%@:hasOb... | Revert "Refactored macro to use ComputedProperty meta instead of object's meta" | Revert "Refactored macro to use ComputedProperty meta instead of object's meta"
| JavaScript | mit | givanse/ember-computed-change-gate,GavinJoyce/ember-computed-change-gate,givanse/ember-computed-change-gate,GavinJoyce/ember-computed-change-gate |
daf08f7840abf24d076c604fb58ca0771c79a25c | snippets/device.js | snippets/device.js | const {TextView, device, ui} = require('tabris');
// Display available device information
['platform', 'version', 'model', 'language', 'orientation'].forEach((property) => {
new TextView({
id: property,
left: 10, right: 10, top: 'prev() 10',
text: property + ': ' + device[property]
}).appendTo(ui.cont... | const {TextView, device, ui} = require('tabris');
// Display available device information
['platform', 'version', 'model', 'vendor', 'language', 'orientation'].forEach((property) => {
new TextView({
id: property,
left: 10, right: 10, top: 'prev() 10',
text: property + ': ' + device[property]
}).append... | Add "vendor" to list of printed properties | Add "vendor" to list of printed properties
| JavaScript | bsd-3-clause | eclipsesource/tabris-js,eclipsesource/tabris-js,eclipsesource/tabris-js |
ced91cef769326b288b6741f3e1474ee9cb89a29 | core/providers/totalwind/extractor.js | core/providers/totalwind/extractor.js | 'use strict'
var extract = require('../../extract')
var lodash = require('lodash')
var CONST = {
SOURCE_NAME: 'totalwind',
IGNORE_LOG_PROPS: ['updatedAt', 'createdAt', 'link', 'title', 'provider']
}
function createExtractor (type, category) {
function extractor (data) {
data.type = type
data.provider =... | 'use strict'
var isBlacklisted = require('../../schema/is-blacklisted')
var extract = require('../../extract')
var lodash = require('lodash')
var CONST = {
SOURCE_NAME: 'totalwind',
IGNORE_LOG_PROPS: ['updatedAt', 'createdAt', 'link', 'title', 'provider']
}
function createExtractor (type, category) {
function ... | Check first censure words before analyze | Check first censure words before analyze
| JavaScript | mit | windtoday/windtoday-core,windtoday/windtoday-core |
ea7bb1e48593306441da54337b82ba9b10452703 | bin/siteshooter.js | bin/siteshooter.js | #! /usr/bin/env node
'use strict';
var chalk = require('chalk'),
pkg = require('../package.json');
var nodeVersion = process.version.replace('v',''),
nodeVersionRequired = pkg.engines.node.replace('>=','');
// check node version compatibility
if(nodeVersion <= nodeVersionRequired){
console.log();
co... | #! /usr/bin/env node
'use strict';
var chalk = require('chalk'),
pkg = require('../package.json');
var nodeVersion = process.version.replace('v',''),
nodeVersionRequired = pkg.engines.node.replace('>=','');
// check node version compatibility
if(nodeVersion <= nodeVersionRequired){
console.log();
co... | Move update notifier to bin | Move update notifier to bin
| JavaScript | mpl-2.0 | devopsgroup-io/siteshooter |
8506adb0cd6e8dc13a2deefcd349a1826be6f567 | src/aspects/equality.js | src/aspects/equality.js | // @flow
import { Record } from 'immutable';
import { Type } from './tm';
import EvaluationResult from './evaluation';
const EqualityShape = Record({
of: null, // Tm
type: Type.singleton,
}, 'equality');
// Propositional Equality type
export class Equality extends EqualityShape {
static arity = [0];
map()... | // @flow
import { Record } from 'immutable';
import { Type } from '../theory/tm';
import { EvaluationResult } from '../theory/evaluation';
const EqualityShape = Record({
of: null, // Tm
type: Type.singleton,
}, 'equality');
// Propositional Equality type
export class Equality extends EqualityShape {
static a... | Fix import errors flow found. | Fix import errors flow found.
| JavaScript | mit | joelburget/pigment |
9ad30d7fb666403f0a74e5905ef928be13547a7b | gulpfile.js | gulpfile.js | 'use strict';
const path = require('path');
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const spawn = require('cross-spawn');
const excludeGitignore = require('gulp-exclude-gitignore');
const nsp = require('gulp-nsp');
gulp.task('nsp', nodeSecurityProtocol);
gulp.task('watch', watch);
gulp.ta... | 'use strict';
const path = require('path');
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const spawn = require('cross-spawn');
const excludeGitignore = require('gulp-exclude-gitignore');
const nsp = require('gulp-nsp');
gulp.task('nsp', nodeSecurityProtocol);
gulp.task('watch', watch);
gulp.ta... | Disable lint for test assets | Disable lint for test assets
| JavaScript | mit | FountainJS/generator-fountain-systemjs,FountainJS/generator-fountain-systemjs |
c62191bfcb066f9f544f3df019db32da48dbbeee | test/examples/Counter-test.js | test/examples/Counter-test.js | /** @jsx createElement */
const {createElement, createEventHandler, render} = Yolk
function Counter () {
const handlePlus = createEventHandler(1, 0)
const handleMinus = createEventHandler(-1, 0)
const count = handlePlus.merge(handleMinus).scan((x, y) => x+y, 0)
return (
<div>
<button id="plus" onCl... | /** @jsx createElement */
const {createElement, createEventHandler, render} = Yolk
function Counter () {
const handlePlus = createEventHandler(1)
const handleMinus = createEventHandler(-1)
const count = handlePlus.merge(handleMinus).scan((x, y) => x+y, 0).startWith(0)
return (
<div>
<button id="plu... | Update Counter test to no relying on initial values for event handlers | Update Counter test to no relying on initial values for event handlers
| JavaScript | mit | StateFarmIns/yolk,garbles/yolk,KenPowers/yolk,yolkjs/yolk,jadbox/yolk,brandonpayton/yolk,kamilogorek/yolk,BrewhouseTeam/yolk,knpwrs/yolk |
1ed8856f1a4861213c73b857582a18e6c836a7ef | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
jsdoc = require('gulp-jsdoc'),
docsSrcDir = './assets/js/**/*.js',
docsDestDir = './docs/js',
jsDocTask;
jsDocTask = function() {
return gulp.src(docsSrcDir)
.pipe(
jsdoc(docsDestDir,
{
path: './node_modules/jaguarjs-jsdoc',
applicatio... | var gulp = require('gulp'),
jsdoc = require('gulp-jsdoc'),
ghPages = require('gulp-gh-pages'),
docsSrcDir = './assets/js/**/*.js',
docsDestDir = './docs/js',
jsDocTask;
jsDocTask = function() {
return gulp.src(docsSrcDir)
.pipe(
jsdoc(docsDestDir,
{
path: './node_modul... | Add gulp task to deploy jsDocs | Add gulp task to deploy jsDocs
| JavaScript | mit | moneyadviceservice/dough,moneyadviceservice/dough,moneyadviceservice/dough,moneyadviceservice/dough |
af37455fed835172c2e533a60f2e65f3833058a9 | gulpfile.js | gulpfile.js | var gulp = require("gulp");
var sass = require("gulp-sass");
var postcss = require("gulp-postcss");
var autoprefixer = require("autoprefixer");
var cssnano = require("cssnano");
var uglify = require("gulp-uglify");
var rename = require("gulp-rename");
var browserSync = require("browser-sync");
gulp.task("serve", ["css... | const gulp = require('gulp');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const browserSync = require('browser-sync');
gulp.tas... | Update Gulp file to use es6 syntax. | Update Gulp file to use es6 syntax. | JavaScript | mit | mohouyizme/minimado,mohouyizme/minimado |
ac04ecd69e559d018f7d9e24d7f6de617aac3a26 | src/apis/Dimensions/index.js | src/apis/Dimensions/index.js | /**
* Copyright (c) 2015-present, Nicolas Gallagher.
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* @flow
*/
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment'
import invariant from 'fbjs/lib/invariant'
const win = ExecutionEnvironment.canUseDOM ? window : { screen: {} }
... | /**
* Copyright (c) 2015-present, Nicolas Gallagher.
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* @flow
*/
import debounce from 'lodash.debounce'
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment'
import invariant from 'fbjs/lib/invariant'
const win = ExecutionEnvironmen... | Update Dimensions when window resizes | Update Dimensions when window resizes
| JavaScript | mit | necolas/react-native-web,necolas/react-native-web,necolas/react-native-web |
e5fb18d4a59e707f075d76310af2ec919ca5716c | src/modules/getPrice/index.js | src/modules/getPrice/index.js | import module from '../../module'
import command from '../../components/command'
import loader from '../../components/loader'
import axios from 'axios'
import humanize from '../../utils/humanize'
export default module(
loader(() => {
console.log('test')
}),
command('getprice', 'Gets the Jita price ... | import module from '../../module'
import command from '../../components/command'
import loader from '../../components/loader'
import axios from 'axios'
import humanize from '../../utils/humanize'
export default module(
loader(() => {
console.log('test')
}),
command('getprice', 'Gets the Jita price ... | Move ESI url prefix to variable | Move ESI url prefix to variable
| JavaScript | mit | emensch/thonk9k |
6801d288ec728671330a6881306753abd30e0a8f | app/student.front.js | app/student.front.js | const $answer = $('.answer')
const {makeRichText} = require('./rich-text-editor')
const save = ($elem, async = true) => $.post({
url: '/save',
data: {text: $elem.html(), answerId: $elem.attr('id')},
async
})
function saveScreenshot(questionId) {
return ({data, type}) => {
return $.post({
... | const $answer = $('.answer')
const {makeRichText} = require('./rich-text-editor')
const save = ($elem, async = true) => $.post({
url: '/save',
data: {text: $elem.html(), answerId: $elem.attr('id')},
async
})
function saveScreenshot(questionId) {
return ({data, type}) => {
return $.post({
... | Update answer content before initializing rich text | Update answer content before initializing rich text
| JavaScript | mit | digabi/math-editor,digabi/rich-text-editor,digabi/rich-text-editor,digabi/rich-text-editor,digabi/math-editor |
d02ef235fb382ff749a41561518c18c7ebd81f2f | src/JokeMeUpBoy.js | src/JokeMeUpBoy.js | /**
* Prints a random programmer joke.
* @author Vitor Cortez <vitoracortez+github@gmail.com>
*/
var jokeMeUpBoy = function() {
const jokes = getListOfJokes();
let rand = Math.floor(Math.random() * jokes.length);
console.log(jokes[rand]);
};
/**
* Holds a list of classic programmer jokes.
* Feel free ... | /**
* Prints a random programmer joke.
* @author Vitor Cortez <vitoracortez+github@gmail.com>
*/
var jokeMeUpBoy = function() {
const jokes = getListOfJokes();
let rand = Math.floor(Math.random() * jokes.length);
console.log(jokes[rand]);
};
/**
* Holds a list of classic programmer jokes.
* Feel free ... | Add a new dank joke | Add a new dank joke
Dem jokes | JavaScript | mit | Rabrennie/anything.js,Sha-Grisha/anything.js,Rabrennie/anything.js,Rabrennie/anything.js,Rabrennie/anything.js,Sha-Grisha/anything.js,Sha-Grisha/anything.js,Sha-Grisha/anything.js |
86cef9310543200502e822cbfbc39066e3f91967 | public/app/user-account/user-login/user-login-controller.js | public/app/user-account/user-login/user-login-controller.js | define(function() {
var LoginController = function($location, AuthenticationService) {
// reset login status
AuthenticationService.clearCredentials();
this.login = function() {
this.dataLoading = true;
var self = this
Authentica... | define(function() {
var LoginController = function($location, $mdDialog, AuthenticationService) {
// reset login status
AuthenticationService.clearCredentials()
this.login = function() {
this.dataLoading = true
var self = this
AuthenticationService.log... | Update login controller to display dialog on error | Update login controller to display dialog on error
| JavaScript | mit | tenevdev/idiot,tenevdev/idiot |
297c942ffefae923501d5988c36ef6930b5888b7 | examples/http-random-user/src/main.js | examples/http-random-user/src/main.js | import Cycle from '@cycle/core';
import {div, button, h1, h4, a, makeDOMDriver} from '@cycle/dom';
import {makeHTTPDriver} from '@cycle/http';
function main(sources) {
const getRandomUser$ = sources.DOM.select('.get-random').events('click')
.map(() => {
const randomNum = Math.round(Math.random() * 9) + 1;
... | import Cycle from '@cycle/core';
import {div, button, h1, h4, a, makeDOMDriver} from '@cycle/dom';
import {makeHTTPDriver} from '@cycle/http';
function main(sources) {
const getRandomUser$ = sources.DOM.select('.get-random').events('click')
.map(() => {
const randomNum = Math.round(Math.random() * 9) + 1;
... | Rename http-random-user key to category | Rename http-random-user key to category
| JavaScript | mit | cyclejs/cyclejs,cyclejs/cyclejs,feliciousx-open-source/cyclejs,cyclejs/cyclejs,usm4n/cyclejs,maskinoshita/cyclejs,cyclejs/cycle-core,staltz/cycle,ntilwalli/cyclejs,ntilwalli/cyclejs,feliciousx-open-source/cyclejs,usm4n/cyclejs,usm4n/cyclejs,maskinoshita/cyclejs,maskinoshita/cyclejs,ntilwalli/cyclejs,feliciousx-open-sou... |
73e99f993882ddd754fefd112f2c95ce62e5dad2 | app/components/OverFlowMenu.js | app/components/OverFlowMenu.js | import React, { Component, PropTypes, cloneElement } from 'react';
import styles from './OverFlowMenu.module.scss';
export class OverflowItem extends Component {
onClick(e) {
this.props.onClick(e);
this.props.onClicked();
}
render() {
return (
<div className={styles.item} {...this.props} onCli... | import React, { Component, PropTypes, cloneElement } from 'react';
import styles from './OverFlowMenu.module.scss';
export class OverflowItem extends Component {
onClick(e) {
this.props.onClick(e);
this.props.onClicked();
}
render() {
return (
<div className={styles.item} {...this.props} onCli... | Fix overflow menu reopening immediately after selecting an item | Fix overflow menu reopening immediately after selecting an item
Was caused by mouseout toggling, instead of closing
| JavaScript | mpl-2.0 | pascalw/gettable,pascalw/gettable |
5e850fc85216fed6848878eaf66841c8dc25fc1b | src/selectors/cashRegister.js | src/selectors/cashRegister.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { createSelector } from 'reselect';
import { pageStateSelector } from './pageSelectors';
import currency from '../localization/currency';
/**
* Derives current balance from cash register transactions.
* @return {Number}
*/
export const selec... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { createSelector } from 'reselect';
import { pageStateSelector } from './pageSelectors';
import currency from '../localization/currency';
/**
* Derives current balance from cash register transactions.
* @return {Number}
*/
export const selec... | Add currency to cash register selectors | Add currency to cash register selectors | JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
39c4271933e1392d20483aa3e1c6e7287fb3d820 | src/api/githubAPI.js | src/api/githubAPI.js | let Octokat = require('octokat');
let octo = new Octokat({});
class GithubApi {
constructor(){
this.octo = new Octokat({});
}
static newOctokatNoToken(){
this.octo = new Octokat({});
}
static newOctokatWithToken(token){
this.octo = new Octokat({
token: token
});
}
static testOcto... | let Octokat = require('octokat');
let octo = new Octokat({});
class GithubApi {
static testOctokat(){
return new Promise((resolve) => {
resolve(octo.repos('compumike08', 'GitHub_Status_API_GUI').fetch());
});
}
}
export default GithubApi;
| Revert "Modify GithubApi to be able to set an OAuth token when instantiating" | Revert "Modify GithubApi to be able to set an OAuth token when instantiating"
This reverts commit 2197aa8a6246348070b9c26693ec08fc44f02031.
| JavaScript | mit | compumike08/GitHub_Status_API_GUI,compumike08/GitHub_Status_API_GUI |
60f02a26c5857e28e268cbfdd242644089c6626c | react.js | react.js | module.exports = {
extends: ["./index.js", "plugin:react/recommended"],
env: {
browser: true
},
plugins: [
"react"
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
"jsx": true
}
}
};
| module.exports = {
extends: ["./index.js", "plugin:react/recommended"],
env: {
browser: true
},
plugins: [
"react"
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
"jsx": true
}
},
rules: {
"reac... | Add common React rules to preset | Add common React rules to preset
| JavaScript | mit | netconomy/eslint-config-netconomy |
30d5c4942db0ccdb2f5ee4de0d4405d456ff3ed9 | webpack.conf.js | webpack.conf.js | import webpack from "webpack";
import path from "path";
export default {
module: {
rules: [
{
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
loader: "file-loader?name=/[hash].[ext]"
},
{test: /\.json$/, loader: "json-loader"},
{
load... | import webpack from "webpack";
import path from "path";
export default {
module: {
rules: [
{
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
loader: "file-loader?name=/[hash].[ext]"
},
{test: /\.json$/, loader: "json-loader"},
{
load... | Update exports loader to Webpack 3 syntax | Update exports loader to Webpack 3 syntax
Closes #67. | JavaScript | mit | doudigit/doudigit.github.io,BeitouSafeHome/btsh,netlify-templates/one-click-hugo-cms,netlify-templates/one-click-hugo-cms,emiaj/blog,chromicant/blog,doudigit/doudigit.github.io,jcrincon/jcrincon.github.io,chromicant/blog,BeitouSafeHome/btsh,emiaj/blog,jcrincon/jcrincon.github.io,emiaj/blog |
55e44ff76a4baae8214cd89c498868b661d99049 | spawnAsync.js | spawnAsync.js | 'use strict';
let spawn = require('cross-spawn');
module.exports = function spawnAsync() {
let args = Array.prototype.slice.call(arguments, 0);
let child;
let promise = new Promise((fulfill, reject) => {
child = spawn.apply(spawn, args);
let stdout = '';
let stderr = '';
if (child.stdout) {
... | 'use strict';
let spawn = require('cross-spawn');
module.exports = function spawnAsync(...args) {
let child;
let promise = new Promise((fulfill, reject) => {
child = spawn.apply(spawn, args);
let stdout = '';
let stderr = '';
if (child.stdout) {
child.stdout.on('data', data => {
std... | Use rest param instead of slice | Use rest param instead of slice
| JavaScript | mit | exponentjs/spawn-async,650Industries/spawn-async |
9017acd8ec8e0aaf9cf95d0b64385fb18fff0dcc | lib/config.js | lib/config.js | // Load configurations file
var config = require('../configs/config.json');
// Validate settings
if (!config.mpd || !config.mpd.host || !config.mpd.port) {
throw new Error("You must specify MPD host and port");
}
if (!config.radioStations || (typeof config.radioStations !== 'object')) {
throw new Error('"radi... | // Load configurations file
var config = require('../configs/config.json');
// Validate settings
if (!config.mpd || !config.mpd.host || !config.mpd.port) {
throw new Error("You must specify MPD host and port");
}
if (!config.radioStations || (typeof config.radioStations !== 'object')) {
throw new Error('"radi... | Make use server port is set | Make use server port is set
| JavaScript | apache-2.0 | JustBlackBird/bluethroat,JustBlackBird/bluethroat,JustBlackBird/bluethroat |
ee5a87db22b7e527d7d0102072bba5de91ac38fb | lib/errors.js | lib/errors.js | /**
AuthGW Custom Errors
@author tylerFowler
**/
/**
@name InvalidRoleError
@desc Thrown when a role is given that is not in the list of roles
@param { String } invalidRole
**/
function InvalidRoleError(invalidRole) {
this.name = 'InvalidRoleError';
this.message = `${invalidRole} is not a valid role`;
... | /**
AuthGW Custom Errors
@author tylerFowler
**/
/**
@class InvalidRoleError @extends Error
@desc Thrown when a role is given that is not in the list of roles
@param { String } invalidRole
**/
class InvalidRoleError extends Error {
constructor(invalidRole) {
this.name = 'InvalidRoleError';
this.mes... | Use class syntax for creating error | Use class syntax for creating error
| JavaScript | mit | tylerFowler/authgw |
48ef57b90e8567574199dddb5b6cee78b6b039b0 | src/config.js | src/config.js | export const TZ = 'Europe/Prague'
export const SIRIUS_PROXY_PATH = process.env.SIRIUS_PROXY_PATH
| export const TZ = 'Europe/Prague'
export const SIRIUS_PROXY_PATH = global.SIRIUS_PROXY_PATH || process.env.SIRIUS_PROXY_PATH
| Allow SIRIUS_PROXY_PATH override by global var | Allow SIRIUS_PROXY_PATH override by global var
| JavaScript | mit | cvut/fittable-widget,cvut/fittable,cvut/fittable-widget,cvut/fittable-widget,cvut/fittable,cvut/fittable |
57789e5d40c448ab1138dad987f7d8f9595966ee | .storybook/config.js | .storybook/config.js | import { configure } from '@storybook/vue';
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
| import { configure, addParameters } from '@storybook/vue';
// Option defaults:
addParameters({
options: {
name: 'Vue Visual',
panelPosition: 'right',
}
})
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
... | Put package name in the storybook | Put package name in the storybook
| JavaScript | mit | BKWLD/vue-visual |
2de18a5628f1acf45a5884c93bd985d4f6f367a3 | lib/server.js | lib/server.js | var acquires = {};
var Responder = require('cote').Responder;
var autoReleaseTimeout = 30000;
var counts = {
acquires: 0,
releases: 0
};
function acquire(req, cb) {
console.log('acquire', req.id);
counts.acquires++;
cb.autoRelease = setTimeout(function() {
console.log('auto release', req.... | var acquires = {};
var Responder = require('cote').Responder;
var autoReleaseTimeout = 30000;
var counts = {
acquires: 0,
releases: 0
};
function acquire(req, cb) {
console.log('acquire', req.id);
counts.acquires++;
if (acquires[req.id]) {
cb.autoRelease = setTimeout(function() {
... | Move auto release timeout to if check in acquire. | Move auto release timeout to if check in acquire. | JavaScript | apache-2.0 | tart/semaver |
f5774e3fb24ca403de481e446c3bf68fa78b2c47 | spec/fixtures/api/quit-app/main.js | spec/fixtures/api/quit-app/main.js | var app = require('electron').app
app.on('ready', function () {
app.exit(123)
})
process.on('exit', function (code) {
console.log('Exit event with code: ' + code)
})
| var app = require('electron').app
app.on('ready', function () {
// This setImmediate call gets the spec passing on Linux
setImmediate(function () {
app.exit(123)
})
})
process.on('exit', function (code) {
console.log('Exit event with code: ' + code)
})
| Exit from a setImmediate callback | Exit from a setImmediate callback
| JavaScript | mit | seanchas116/electron,felixrieseberg/electron,pombredanne/electron,bpasero/electron,wan-qy/electron,leftstick/electron,the-ress/electron,jaanus/electron,deed02392/electron,thomsonreuters/electron,brave/muon,tonyganch/electron,tinydew4/electron,thomsonreuters/electron,gerhardberger/electron,roadev/electron,simongregory/e... |
ad16587294c3186a89e84105fb2e390b36f26ca0 | lib/switch.js | lib/switch.js | const gpio = require('raspi-gpio')
module.exports = class Switch {
constructor (pinId) {
this.nInput = new gpio.DigitalInput(pinId, gpio.PULL_UP)
}
on (changeListener) {
this.nInput.on('change', (value) => {
changeListener(value)
})
}
}
| const gpio = require('raspi-gpio')
module.exports = class Switch {
constructor (pinId) {
this.nInput = new gpio.DigitalInput({
pin: pinId,
pullResistor: gpio.PULL_UP})
}
on (changeListener) {
this.nInput.on('change', (value) => {
changeListener(value)
})
}
}
| Fix pin pull resistor config | Fix pin pull resistor config
| JavaScript | mit | DanStough/josl |
b9e214312ec055e7e6d64fcc6a75b108c6176657 | js/index.js | js/index.js | // Pullquotes
document.addEventListener("DOMContentLoaded", function(event) {
function pullQuote(el){
var parentParagraph = el.parentNode;
parentParagraph.style.position = 'relative';
var clone = el.cloneNode(true);
clone.setAttribute('class','semantic-pull-quote--pulled');
// Hey y’all, watch thi... | // Semantic Pullquotes
document.addEventListener("DOMContentLoaded", function(event) {
function pullQuote(el){
var parentParagraph = el.parentNode;
parentParagraph.style.position = 'relative';
var clone = el.cloneNode(true);
clone.setAttribute('class','semantic-pull-quote--pulled');
// Hey y’all, ... | Rename Pullquotes --> Semantic Pullquotes | Rename Pullquotes --> Semantic Pullquotes
| JavaScript | mit | curiositry/sassisfy,curiositry/sassisfy |
234138b3a81e6db0439851c131448eb3f030f146 | app/send-native.js | app/send-native.js | 'use strict';
const application = 'io.github.deathcap.nodeachrome';
function decodeResponse(response, cb) {
console.log('decodeResponse',response);
if (typeof cb !== 'function') { console.error('??? decodeResponse non-string callback',cb); cb = () => {}; }
if (!response) return cb(chrome.runtime.lastError);
i... | 'use strict';
const application = 'io.github.deathcap.nodeachrome';
let callbacks = new Map();
let nextID = 1;
let port = null;
function decodeResponse(response, cb) {
console.log('decodeResponse',response);
if (typeof cb !== 'function') { console.error('??? decodeResponse non-string callback',cb); cb = () => {}... | Change native messaging to keep the host running persistently, maintaining an open port | Change native messaging to keep the host running persistently, maintaining an open port
| JavaScript | mit | deathcap/nodeachrome,deathcap/nodeachrome,deathcap/nodeachrome |
a6a42353b20a9282bdb83cf45c0111954b9d6888 | ember-cli-build.js | ember-cli-build.js | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
// Add options here
});
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This... | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
},
});
/*
This build file specifies the options for the dummy test app of this
addon... | Include ember-cli-babel polyfil to fix tests | Include ember-cli-babel polyfil to fix tests
| JavaScript | mit | amiel/ember-data-url-templates,amiel/ember-data-url-templates |
1db74f03479538911f1c9336df233aea3c7cc622 | karma.conf.js | karma.conf.js | var webpackConfig = require('./webpack.config');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'test/**/*.ts'
],
exclude: [
],
preprocessors: {
'src/**/!(defaults)/*.js': ['coverage'],
'test/**/*.ts': ['webpack']
... | var webpackConfig = require('./webpack.config');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'test/**/*.ts'
],
mime: {
'text/x-typescript': ['ts', 'tsx']
},
exclude: [
],
preprocessors: {
'src/**/!... | Add mime type option in karma file! | Add mime type option in karma file!
| JavaScript | apache-2.0 | proteus-h2020/proteic,proteus-h2020/proteic,proteus-h2020/proteus-charts,proteus-h2020/proteic |
a551c502c03f0e324aa0765d36799f3c8305b2f2 | app/utils/index.js | app/utils/index.js | const moment = require('moment');
export const dateFormat = (utcDate) => {
return moment(utcDate, 'YYYY-MM-DD hh:mm:ss z').format('LLL');
};
| const moment = require('moment');
export const dateFormat = (utcDate) => {
return moment.utc(new Date(utcDate)).format('LLL');
};
| Use Date function to help parse timezone. | Use Date function to help parse timezone.
| JavaScript | mit | FuBoTeam/fubo-flea-market,FuBoTeam/fubo-flea-market |
ec5401d64467628fa318a96363dcd4ae85ff1d98 | get_languages.js | get_languages.js | var request = require('request');
var yaml = require('js-yaml');
module.exports = function (callback) {
var languagesURL = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml';
request(languagesURL, function (error, response, body) {
var languages = yaml.safeLoad(body);
O... | var request = require('request');
var yaml = require('js-yaml');
module.exports = function (callback) {
var languagesURL = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml';
request(languagesURL, function (error, response, body) {
var languages = yaml.safeLoad(body);
O... | Remove languages that don't have colors | Remove languages that don't have colors
| JavaScript | mit | nicolasmccurdy/language-colors,nicolasmccurdy/language-colors |
e24f9da2e1b107767453a8693be90cfb97ebe76c | lib/index.js | lib/index.js | /**
* isUndefined
* Checks if a value is undefined or not.
*
* @name isUndefined
* @function
* @param {Anything} input The input value.
* @returns {Boolean} `true`, if the input is `undefined`, `false` otherwise.
*/
module.exports = function isUndefined(input) {
return typeof input === 'undefined';
};
| "use strict";
/**
* isUndefined
* Checks if a value is undefined or not.
*
* @name isUndefined
* @function
* @param {Anything} input The input value.
* @returns {Boolean} `true`, if the input is `undefined`, `false` otherwise.
*/
let u = void 0;
module.exports = input => input === u;
| Use void 0 to get the undefined value. | Use void 0 to get the undefined value.
| JavaScript | mit | IonicaBizau/is-undefined |
5aff66da9b38b94fe0e6b453ecb2678e0f743d8a | example/i18n/fr.js | example/i18n/fr.js | export const messages = {
post: {
name: 'Article',
all: 'Articles',
list: {
search: 'Recherche',
title: 'Titre',
published_at: 'Publié le',
commentable: 'Commentable',
views: 'Vues',
},
form: {
title: 'Ti... | export const messages = {
post: {
name: 'Article',
all: 'Articles',
list: {
search: 'Recherche',
title: 'Titre',
published_at: 'Publié le',
commentable: 'Commentable',
views: 'Vues',
},
form: {
title: 'Ti... | Fix typos in French translation of the example | Fix typos in French translation of the example
| JavaScript | mit | matteolc/admin-on-rest,matteolc/admin-on-rest,marmelab/admin-on-rest,marmelab/admin-on-rest |
cbfb5044b5d16a826f98104f52c8588fffbfb6c0 | src/deploy.spec.js | src/deploy.spec.js | import {describe, it} from 'mocha';
import {
assertThat, equalTo,
} from 'hamjest';
const toSrcDestPairs = (files, {sourcePath, destinationPath}) =>
files.map(file => ({
sourceFileName: file,
destinationFilename: file.replace(sourcePath, destinationPath)
}))
;
describe('Build src-dest pairs from file na... | import {describe, it} from 'mocha';
import {
assertThat, equalTo,
} from 'hamjest';
const toSrcDestPairs = (files, {sourcePath, destinationPath}) =>
files.map(file => ({
sourceFileName: file,
destinationFilename: file.replace(sourcePath, destinationPath)
}))
;
describe('Build src-dest pairs from file na... | Write a (documenting) test that describes the "lots-case". | Write a (documenting) test that describes the "lots-case".
| JavaScript | mit | tddbin/katas,tddbin/katas,tddbin/katas |
e082e386adc50466d4c30a24dea8ce6a93b265b4 | routes/admin/authenticated/sidebar/templates-list/page.connected.js | routes/admin/authenticated/sidebar/templates-list/page.connected.js | import { provideHooks } from 'redial'
import { connect } from 'react-redux'
import * as MobilizationActions from '~mobilizations/action-creators'
import * as MobilizationSelectors from '~mobilizations/selectors'
import * as TemplateActions from '~mobilizations/templates/action-creators'
import * as TemplateSelectors f... | import { provideHooks } from 'redial'
import { connect } from 'react-redux'
import MobSelectors from '~client/mobrender/redux/selectors'
import { toggleMobilizationMenu } from '~client/mobrender/redux/action-creators'
import * as TemplateActions from '~mobilizations/templates/action-creators'
import * as TemplateSelec... | Fix menu in template list | Fix menu in template list
| JavaScript | agpl-3.0 | nossas/bonde-client,nossas/bonde-client,nossas/bonde-client |
26325efdf4836d0eb44a4f987830c38562222cda | public/javascripts/app.js | public/javascripts/app.js | var app = angular.module("blogApp", []);
var posts = [];
app.config(function($routeProvider)
{
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'BlogCtrl'
})
.when('/post/:postId', {
templateUrl: 'views/post.html',
controller: 'PostCtrl'
})
.otherwise({
redirectTo: '/'
... | var app = angular.module("blogApp", []);
var posts = [];
app.config(function($routeProvider)
{
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'BlogCtrl'
})
.when('/post/:postId', {
templateUrl: 'views/post.html',
controller: 'PostCtrl'
})
.otherwise({
redirectTo: '/'
... | Change for socket connection on Heroku | Change for socket connection on Heroku
| JavaScript | mit | Somojojojo/blog |
6621c6e7cc5fb3d62d8a5fabb08cf870b72ed5fe | lib/dropbox/index.js | lib/dropbox/index.js | 'use strict';
var cp = require('child_process');
var child = cp.fork(__dirname + '/child.js');
var passport = require('passport');
var DropboxOAuth2Strategy = require('passport-dropbox-oauth2').Strategy;
var active = false;
module.exports = function (options) {
child.send({
options: options.dropbox
});
retur... | 'use strict';
var cp = require('child_process');
var child = cp.fork(__dirname + '/child.js');
var passport = require('passport');
var DropboxOAuth2Strategy = require('passport-dropbox-oauth2').Strategy;
var active = false;
module.exports = function (options) {
child.send({
options: options.dropbox
});
retur... | Add accessToken to profile before done | Add accessToken to profile before done
| JavaScript | mit | svacha/jsbin,filamentgroup/jsbin,eggheadio/jsbin,late-warrior/jsbin,thsunmy/jsbin,pandoraui/jsbin,ilyes14/jsbin,digideskio/jsbin,saikota/jsbin,AverageMarcus/jsbin,fgrillo21/NPA-Exam,late-warrior/jsbin,peterblazejewicz/jsbin,juliankrispel/jsbin,francoisp/jsbin,ctide/jsbin,juliankrispel/jsbin,KenPowers/jsbin,mdo/jsbin,mi... |
bb9858b1edbc7f8fe7a2abd70110adb50055ff8c | lib/main.js | lib/main.js | import "es6-symbol";
import "weakmap";
import svgLoader from "./loader.js";
import Icon from "./components/Icon.js";
import Sprite from "./components/Sprite.js";
import Theme from "./components/Theme.js";
var callback = function callback() { };
const icons = Icon;
const initLoader = svgLoader;
// loads an external... | import "es6-symbol";
import "weakmap";
import svgLoader from "./loader.js";
import Icon from "./components/Icon.js";
import Sprite from "./components/Sprite.js";
import Theme from "./components/Theme.js";
var callback = function callback() { };
const icons = Icon;
const initLoader = svgLoader;
// loads an external... | Update name of callback functions | Update name of callback functions
| JavaScript | mit | vuzonp/uxon |
19e3dc49302a635f51bcd552fb70b434c0968520 | tests/cross-context-instance.js | tests/cross-context-instance.js | let ivm = require('isolated-vm');
let isolate = new ivm.Isolate;
function makeContext() {
let context = isolate.createContextSync();
let global = context.globalReference();
global.setSync('ivm', ivm);
isolate.compileScriptSync(`
function makeReference(ref) {
return new ivm.Reference(ref);
}
function isRef... | let ivm = require('isolated-vm');
let isolate = new ivm.Isolate;
function makeContext() {
let context = isolate.createContextSync();
let global = context.globalReference();
global.setSync('ivm', ivm);
isolate.compileScriptSync(`
function makeReference(ref) {
return new ivm.Reference(ref);
}
function isRef... | Fix test wasn't actually testing | Fix test wasn't actually testing
| JavaScript | isc | laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm |
0c44942fa439737c8adf26a2e196bbd700e18e66 | R7.University.Employee/js/module.js | R7.University.Employee/js/module.js | $(function () {
// paint tables with dnnGrid classes
var table = ".employeeDetails #employeeDisciplines table";
$(table).addClass ("dnnGrid").css ("border-collapse", "collapse");
// use parent () to get rows with matched cell types
$(table + " tr:nth-child(even) td").parent ().addClass ("dnnGr... | $(function () {
// paint tables with dnnGrid classes
var table = ".employeeDetails #employeeDisciplines table";
$(table).addClass ("dnnGrid").css ("border-collapse", "collapse");
// use parent () to get rows with matched cell types
$(table + " tr:nth-child(even) td").parent ().addClass ("dnnGr... | Optimize & fix table painting script | Optimize & fix table painting script | JavaScript | agpl-3.0 | roman-yagodin/R7.University,roman-yagodin/R7.University,roman-yagodin/R7.University |
ef259591d22d303c351b419f130b13061e28771a | app/native/src/types/Navigation.js | app/native/src/types/Navigation.js | // @flow
export type Navigation = {
navigate: (screen: string, parameters?: Object) => void,
state: {
params: Object,
},
};
| // @flow
type NavigationStateParameters = Object;
/**
* @see https://reactnavigation.org/docs/navigators/navigation-prop
*/
export type Navigation = {
navigate: (routeName: string, parameters?: NavigationStateParameters) => void,
state: {
params: NavigationStateParameters,
},
setParams: (newParameters: ... | Improve Flow type of the navigation | Improve Flow type of the navigation
| JavaScript | mit | mrtnzlml/native,mrtnzlml/native |
1b6904a33c0f83eddf6c759ebe4243d54eb1f54f | app/services/resizeable-columns.js | app/services/resizeable-columns.js | import Ember from "ember";
const { $, inject, run } = Ember;
export default Ember.Service.extend({
fastboot: inject.service(),
init() {
this._super(...arguments);
if (!this.get('fastboot.isFastBoot')) {
this.setupMouseEventsFromIframe();
}
},
setupMouseEventsFromIframe() {
window.addEv... | import Ember from "ember";
const { $, inject, run } = Ember;
export default Ember.Service.extend({
fastboot: inject.service(),
init() {
this._super(...arguments);
if (!this.get('fastboot.isFastBoot')) {
this.setupMouseEventsFromIframe();
}
},
handleMouseEvents(m, mouseEvent) {
const ev... | Refactor mouse events in resizeable columns | Refactor mouse events in resizeable columns
| JavaScript | mit | ember-cli/ember-twiddle,ember-cli/ember-twiddle,Gaurav0/ember-twiddle,Gaurav0/ember-twiddle,knownasilya/ember-twiddle,knownasilya/ember-twiddle,knownasilya/ember-twiddle,ember-cli/ember-twiddle,Gaurav0/ember-twiddle |
78874dcdad510e76c2ee6d47c6b0ac72073b3e7c | lib/loaders/index.js | lib/loaders/index.js | import loadersWithAuthentication from "./loaders_with_authentication"
import loadersWithoutAuthentication from "./loaders_without_authentication"
export default (accessToken, userID) => {
const loaders = loadersWithoutAuthentication()
if (accessToken) {
return Object.assign({}, loaders, loadersWithAuthenticati... | import loadersWithAuthentication from "./loaders_with_authentication"
import loadersWithoutAuthentication from "./loaders_without_authentication"
/**
* Creates a new set of data loaders for all routes. These should be created for each GraphQL query and passed to the
* `graphql` query execution function.
*
* Only i... | Add documentation for a bunch of functions. | [loaders] Add documentation for a bunch of functions.
| JavaScript | mit | craigspaeth/metaphysics,mzikherman/metaphysics-1,artsy/metaphysics,artsy/metaphysics,craigspaeth/metaphysics,mzikherman/metaphysics-1,artsy/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1 |
da8027163e556a84e60d0c41bd61ea4b8a42ef05 | src/renderer/scr.dom.js | src/renderer/scr.dom.js | var DOM = (function(){
var entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": ''',
"/": '/'
};
var entityRegex = /[&<>"'\/]/g;
return {
/*
* Returns a child element by its ID. Parent defaults to the entire document.
*/
id: function(... | var DOM = (function(){
var entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": ''',
"/": '/'
};
var entityRegex = /[&<>"'\/]/g;
return {
/*
* Returns a child element by its ID. Parent defaults to the entire document.
*/
id: function(... | Fix HTML escaping in renderer crashing on non-string values | Fix HTML escaping in renderer crashing on non-string values
| JavaScript | mit | chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker |
9520ab1f9e7020879c8e3c2e8f6faad31fd572ef | Kwc/Shop/Box/Cart/Component.defer.js | Kwc/Shop/Box/Cart/Component.defer.js | var onReady = require('kwf/on-ready');
var $ = require('jQuery');
var getKwcRenderUrl = require('kwf/get-kwc-render-url');
onReady.onRender('.kwcClass',function(el) {
var url = getKwcRenderUrl();
$.each($('.kwfUp-addToCardForm .kwfUp-formContainer'), $.proxy(function(index, form) {
$(form).on('kwfUp-f... | var onReady = require('kwf/on-ready');
var $ = require('jQuery');
var getKwcRenderUrl = require('kwf/get-kwc-render-url');
onReady.onRender('.kwcClass',function(el) {
var url = getKwcRenderUrl();
$.each($('.kwfUp-addToCardForm .kwfUp-formContainer'), $.proxy(function(index, form) {
$(form).on('kwfUp-f... | Fix wrong exchange of cartbox-domelement | Fix wrong exchange of cartbox-domelement
| JavaScript | bsd-2-clause | koala-framework/koala-framework,koala-framework/koala-framework |
b4dfceadd3a541cb13d5a69a4ef799dce1dc2037 | web/src/js/components/Dashboard/DashboardContainer.js | web/src/js/components/Dashboard/DashboardContainer.js | import graphql from 'babel-plugin-relay/macro'
import { createFragmentContainer } from 'react-relay'
import Dashboard from 'js/components/Dashboard/DashboardComponent'
export default createFragmentContainer(Dashboard, {
app: graphql`
fragment DashboardContainer_app on App {
campaign {
isLive
... | import graphql from 'babel-plugin-relay/macro'
import { createFragmentContainer } from 'react-relay'
import Dashboard from 'js/components/Dashboard/DashboardComponent'
export default createFragmentContainer(Dashboard, {
app: graphql`
fragment DashboardContainer_app on App {
campaign {
isLive
... | Add data fetching for testing out Redis | Add data fetching for testing out Redis
| JavaScript | mpl-2.0 | gladly-team/tab,gladly-team/tab,gladly-team/tab |
25376ac4975c5d5021b40438f8954a6faa24e21d | lib/config.js | lib/config.js | var Fs = require('fs');
var config = module.exports = {};
// Configuring TLS
config.tls = {
key: Fs.readFileSync('./lib/certs/key.key'),
cert: Fs.readFileSync('./lib/certs/cert.crt'),
// Only necessary if using the client certificate authentication.
requestCert: true,
// Only necessary only if c... | var Fs = require('fs');
var config = module.exports = {};
// Configuring TLS
config.tls = {
key: Fs.readFileSync('./lib/certs/key.key'),
cert: Fs.readFileSync('./lib/certs/cert.crt'),
// Only necessary if using the client certificate authentication.
requestCert: true,
// Only necessary only if c... | Refactor good stop sending logs to remote server | Refactor good stop sending logs to remote server
Comments in lib/config.js still show how to send
logs to remote server. But, it is not used.
| JavaScript | bsd-3-clause | jd73/university,jd73/university |
fa1c80fabddcf07bc6a81f581b36a3a26578fc02 | src/js/app/main.js | src/js/app/main.js | /**
* Load all the Views.
*/
require([
'models/user',
'controllers/home',
'outer'
], function (User, Home, Router) {
var users = [new User('Barney'),
new User('Cartman'),
new User('Sheldon')];
localStorage.users = JSON.stringify(users);
Home.start();
Router.startRouting();
});
| /**
* Load all the Views.
*/
require([
'models/user',
'controllers/home',
'router'
], function (User, Home, Router) {
var users = [new User('Barney'),
new User('Cartman'),
new User('Sheldon')];
localStorage.users = JSON.stringify(users);
Home.start();
Router.startRouting();
});
| Rename router file part iii. | Rename router file part iii.
| JavaScript | mit | quantumtom/rainbow-dash,quantumtom/rainbow-dash,quantumtom/ash,quantumtom/ash |
2b261f89e9820a4697e0a812defaec05385fad51 | test/spec/controllers/main.js | test/spec/controllers/main.js | 'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('quakeStatsApp'));
var MainCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
MainCtrl = $con... | 'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('quakeStatsApp'));
var MainCtrl,
scope,
mockStats = {
gamesStats: []
};
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
... | Make the first dummy test pass | Tests: Make the first dummy test pass
| JavaScript | mit | mbarzeev/quake-stats,mbarzeev/quake-stats |
d111e99ba98e357e1f13eb8b8e83da5e188b9d0a | lib/readTemplate.js | lib/readTemplate.js | 'use strict';
const fs = require('fs');
const Promise = require('bluebird');
const readFile = Promise.promisify(fs.readFile, { context: fs });
const cache = require('./cache');
module.exports = readTemplate;
function readTemplate(path, callback) {
const cacheKey = `template.${path}`;
if (process.env.NODE_ENV... | 'use strict';
const fs = require('fs');
const Promise = require('bluebird');
const readFile = Promise.promisify(fs.readFile, { context: fs });
const cache = require('./cache');
module.exports = readTemplate;
function readTemplate(path, callback) {
const cacheKey = `template.${path}`;
return cache.get(cacheKey... | Revert "only cache templates in production" | Revert "only cache templates in production"
This reverts commit 4e2bf7d48d60bba8b4d4497786e4db0ab8f81bef.
| JavaScript | apache-2.0 | carsdotcom/windshieldjs,carsdotcom/windshieldjs |
62624f36608eb495e18050fdff395b39bd69fd22 | app/assets/javascripts/spree/checkout/payment/adyen_encrypted_credit_card.js | app/assets/javascripts/spree/checkout/payment/adyen_encrypted_credit_card.js | Spree.createEncryptedAdyenForm = function(paymentMethodId) {
document.addEventListener("DOMContentLoaded", function() {
var checkout_form = document.getElementById("checkout_form_payment")
// See adyen.encrypt.simple.html for details on the options to use
var options = {
name: "payment_source[" +... | Spree.createEncryptedAdyenForm = function(paymentMethodId) {
document.addEventListener("DOMContentLoaded", function() {
var checkout_form = document.getElementById("checkout_form_payment")
// See adyen.encrypt.simple.html for details on the options to use
var options = {
name: "payment_source[" +... | Enable validations on CC form | Enable validations on CC form
| JavaScript | mit | freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen |
25ecb5e4f4bfeac33198913ec49bdb8b2412f462 | MovieFinder/src/main/webapp/public/src/controllers/nav-controller.js | MovieFinder/src/main/webapp/public/src/controllers/nav-controller.js | //
// nav-controller.js
// Contains the controller for the nav-bar.
//
(function () {
'use strict';
angular.module('movieFinder.controllers')
.controller('NavCtrl', function ($scope, $modal, user) {
var _this = this;
var signInModal;
this.error = {... | //
// nav-controller.js
// Contains the controller for the nav-bar.
//
(function () {
'use strict';
angular.module('movieFinder.controllers')
.controller('NavCtrl', function ($scope, $modal, user) {
var _this = this;
var signInModal;
this.error = {... | Reset error message when dialog re-opened. | Reset error message when dialog re-opened.
| JavaScript | mit | we4sz/DAT076,we4sz/DAT076 |
633dd358d078e50503406f15f8b46b8ba9fce951 | src/modules/sound.js | src/modules/sound.js | let lastPachiIndex = -1
let lastCaptureIndex = -1
let captureSounds = Object.keys(new Int8Array(5)).map(x => new Audio(`./data/capture${x}.mp3`))
let pachiSounds = Object.keys(new Int8Array(5)).map(x => new Audio(`./data/${x}.mp3`))
let newGameSound = new Audio('./data/newgame.mp3')
let passSound = new Audio('./data/... | const helper = require('./helper')
let lastPachiIndex = -1
let lastCaptureIndex = -1
let captureSounds = [...Array(5)].map((_, i) => new Audio(`./data/capture${i}.mp3`))
let pachiSounds = [...Array(5)].map((_, i) => new Audio(`./data/${i}.mp3`))
let newGameSound = new Audio('./data/newgame.mp3')
let passSound = new ... | Fix weird error messages about play() and pause() | Fix weird error messages about play() and pause()
| JavaScript | mit | yishn/Sabaki,yishn/Goban,yishn/Goban,yishn/Sabaki |
c1a1f8f3ddf1485016c3d70c2ceca66be42608f3 | src/server.js | src/server.js | var express = require('express');
var app = express();
app.use('/game', express.static(__dirname + '/public'));
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Node app is up and running to serve static HTML content.');
}); | var express = require('express');
var app = express();
app.use('/app', express.static(__dirname + '/public'));
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Node app is up and running to serve static HTML content.');
}); | Fix that URL--we just have to update Kibana. | Fix that URL--we just have to update Kibana. | JavaScript | apache-2.0 | gameontext/gameon-webapp,gameontext/gameon-webapp,gameontext/gameon-webapp |
87407f3dbd25b823d05f2f5b03475a7ecc391438 | lib/geoloc.js | lib/geoloc.js | var geoip = require('geoip');
function Point(latitude, longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
module.exports = {
/*
* Returns geoloc Point from the requester's ip adress
* @throws Exception
*/
getPointfromIp: function(ip, geoliteConfig) {
var latitu... | var geoip = require('geoip');
function Point(latitude, longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
module.exports = {
/*
* Returns geoloc Point from the requester's ip adress
* @throws Exception
*/
getPointfromIp: function(ip, geolitePath) {
var latitude... | Change getPointFromIp & getCityFromIp methods signature | Change getPointFromIp & getCityFromIp methods signature | JavaScript | mit | Jumplead/GeonamesServer,Jumplead/GeonamesServer,xjewer/GeonamesServer,xjewer/GeonamesServer,xjewer/GeonamesServer,Jumplead/GeonamesServer,Jumplead/GeonamesServer |
152c0faec45c4b754b3496a37de0884df11eb5bb | isProduction.js | isProduction.js | if (process && process.env && process.env.NODE_ENV === 'production') {
console.warn([
'You are running Mimic in production mode,',
'in most cases you only want to run Mimic in development environments.\r\n',
'For more information on how to load Mimic in development environments only please see:',
'https://git... | if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'production') {
console.warn([
'You are running Mimic in production mode,',
'in most cases you only want to run Mimic in development environments.\r\n',
'For more information on how to load Mimic in development environments only pleas... | Fix a bug where checking process.env.NODE_ENV was not safe enough | fix(bootstrapping): Fix a bug where checking process.env.NODE_ENV was not safe enough
the check for process variable existence threw an error in some build systems which do not take care
of the process global variable such as angular cli.
| JavaScript | mit | 500tech/bdsm,500tech/mimic,500tech/mimic,500tech/bdsm |
7a2e50e7634ead72e8301fb99da246f20e92c961 | libs/connections.js | libs/connections.js | //Get required modules
var Connection = require( 'ssh2' );
var domain = require( 'domain' );
//Add my libs
var handlers = require( './handlers.js' );
//Auxiliary function to initialize/re-initialize ssh connection
function initializeConnection() {
//Initialize the ssh connection
connection = new Connect... | //Get required modules
var Connection = require( 'ssh2' );
var domain = require( 'domain' );
//Auxiliary function to initialize/re-initialize ssh connection
function initializeConnection() {
//Add my libs
var handlers = require( './handlers.js' );
//Initialize the ssh connection
connection = new... | Fix module require chicken-egg problem | Fix module require chicken-egg problem
| JavaScript | mit | ctimoteo/syncmaster |
9bbcea12f0db82cf583d9fcc42998b2b79ef4372 | lib/parser.js | lib/parser.js | 'use babel';
export default class Parser {
source: null
editor: null
parse(source, editor) {
this.source = source;
this.editor = editor;
return this.scan();
}
scan() {
let result = [], count = 0;
// Find 'describes', set indexs, find 'it'
this.findInstanceOf('describe(\'', result,... | 'use babel';
export default class Parser {
source: null
editor: null
parse(source, editor) {
this.source = source;
this.editor = editor;
return this.scan();
}
scan() {
let result = [], count = 0;
// Find 'describes', set indexs, find 'it'
this.findInstanceOf('describe(\'', result,... | Expand the tree view by defualt | Expand the tree view by defualt
| JavaScript | mit | chiragchoudhary66/test-list-maker |
9413f0cb3b4bd6545d29e79e9b656469b209a417 | jquery.linkem.js | jquery.linkem.js | // jquery.linkem.js
// Copyright Michael Hanson
// https://github.com/mybuddymichael/jquery-linkem
(function( $ ) {
$.fn.linkem = function() {
var linked = this;
this.on( "keydown keyup mousedown mouseup", function() {
linked.text( $(this).val() );
});
};
return this;
})( jQuery );
| // jquery.linkem.js
// Copyright Michael Hanson
// https://github.com/mybuddymichael/jquery-linkem
(function( $ ) {
$.fn.linkem = function() {
var linked = this;
this.on( "input change", function() {
linked.text( $(this).val() );
});
};
return this;
})( jQuery );
| Change events to "input" and "change" | Change events to "input" and "change"
| JavaScript | mit | mybuddymichael/jquery-linkem |
47b311db68aa5343f66e3f5a5fd77602bd3e2e9e | server/models/products.js | server/models/products.js | // npm dependencies
const mongoose = require('mongoose');
// defines Product model
// contains 3 fields (title, description, and price)
let Product = mongoose.model('Product', {
title: {
type: String,
required: true,
minlength: 5,
trim: true
},
description: {
type: String,
required: true,... | // npm dependencies
const mongoose = require('mongoose');
// defines Product model
// contains 3 fields (title, description, and price)
let Product = mongoose.model('Product', {
title: {
type: String,
required: true,
minlength: 5,
trim: true
},
description: {
type: String,
minlength: 10,
... | Remove 'required' validation from 'description' field | Remove 'required' validation from 'description' field
| JavaScript | mit | dshaps10/full-stack-demo-site,dshaps10/full-stack-demo-site |
8e54f1bd3f215ada478b6fb41644bcb777b29ab2 | js/app/viewer.js | js/app/viewer.js | /*jslint browser: true, white: true, plusplus: true */
/*global angular, console, alert*/
(function () {
'use strict';
var app = angular.module('status', ['ui.bootstrap', 'chieffancypants.loadingBar', 'tableSort']);
app.controller("StatusController", function($scope, $http) {
$scope.serverName = app.server... | /*jslint browser: true, white: true, plusplus: true */
/*global angular, console, alert*/
(function () {
'use strict';
var app = angular.module('status', ['ui.bootstrap', 'chieffancypants.loadingBar', 'tableSort']);
app.controller("StatusController", function($scope, $http) {
$scope.serverName = app.server... | Update console log error text | Update console log error text
| JavaScript | agpl-3.0 | ShinDarth/TC-Ticket-Web-Viewer,ShinDarth/TC-Ticket-Web-Viewer |
e8b81efc0799f24d099ac7073da35a4ece27d615 | desktop/webpack.main.config.js | desktop/webpack.main.config.js | const plugins = require('./webpack.plugins')
const webpack = require('webpack')
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
plugins: [
...plugins,
new webpack.DefinePlugin({
'pr... | const plugins = require('./webpack.plugins')
const webpack = require('webpack')
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
plugins: [
...plugins,
new webpack.DefinePlugin({
'pr... | Fix resolution of native Node modules | chore(Desktop): Fix resolution of native Node modules
See https://github.com/electron-userland/electron-forge/pull/2449
| JavaScript | apache-2.0 | stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila |
a966513e6677626454f550bd81cd50efce79c86f | src/unix_stream.js | src/unix_stream.js | var util = require('util');
var Socket = require('net').Socket;
/* Make sure we choose the correct build directory */
var directory = process.config.default_configuration === 'Debug' ? 'Debug' : 'Release';
var bindings = require(__dirname + '/../build/' + directory + '/unix_stream.node');
var SOCK_STREAM = bindings.... | var util = require('util');
var Socket = require('net').Socket;
/* Make sure we choose the correct build directory */
var directory = process.config.target_defaults.default_configuration === 'Debug' ? 'Debug' : 'Release';
var bindings = require(__dirname + '/../build/' + directory + '/unix_stream.node');
var SOCK_STR... | Use the correct process.config variable | Use the correct process.config variable
| JavaScript | isc | santigimeno/node-unix-stream,santigimeno/node-unix-stream,santigimeno/node-unix-stream |
74386ac41257a7ea865aefd09631ff87815c23a5 | src/components/App/index.js | src/components/App/index.js | import React, { Component } from 'react';
/* global styles for app */
import './styles/app.scss';
/* application components */
import { Header } from '../../components/Header';
import { Footer } from '../../components/Footer';
export class App extends Component {
static propTypes = {
children: React.PropTypes.... | import React, { Component } from 'react';
/* global styles for app */
import './styles/app.scss';
/* application components */
import { Header } from '../../components/Header';
import { Footer } from '../../components/Footer';
export class App extends Component {
static propTypes = {
children: React.PropTypes.... | Change markup so that main el is outside of container, can take a full width bg color | Change markup so that main el is outside of container, can take a full width bg color
| JavaScript | mit | dramich/Chatson,badT/twitchBot,badT/Chatson,badT/twitchBot,dramich/Chatson,dramich/twitchBot,TerryCapan/twitchBot,TerryCapan/twitchBot,dramich/twitchBot,badT/Chatson |
ada006bbcee7e855f9ee44acbd777928a0c58d1b | addon/initializers/mutation-observer.js | addon/initializers/mutation-observer.js | /**
* Simple initializer that implements the mutationObserverMixin
* in all the Components. It uses a flag defined in the app
* environment for it.
*/
import Ember from 'ember';
import mutationObserver from '../mixins/mutation-observer';
export function initialize(app) {
const config = app.lookupFactory ?
... | /**
* Simple initializer that implements the mutationObserverMixin
* in all the Components. It uses a flag defined in the app
* environment for it.
*/
import Ember from 'ember';
import mutationObserver from '../mixins/mutation-observer';
export function initialize(app) {
let config;
try {
// Ember 2.15+... | Fix initializer for Ember 2.15+ | Fix initializer for Ember 2.15+
| JavaScript | mit | zzarcon/ember-cli-Mutation-Observer,zzarcon/ember-cli-Mutation-Observer |
1f13a1254fbf5303a58bf75b14b160e11d7dd30e | src/components/Lotteries.js | src/components/Lotteries.js | /**
* Created by mgab on 14/05/2017.
*/
import React,{ Component } from 'react'
import Title from './common/styled-components/Title'
import Lottery from './Lottery'
export default class Lotteries extends Component {
render() {
const lotteries = []
this.props.lotteriesData.forEach((entry) => {
lo... | /**
* Created by mgab on 14/05/2017.
*/
import React,{ Component } from 'react'
import Title from './common/styled-components/Title'
import Lottery from './Lottery'
export default class Lotteries extends Component {
render() {
const lotteries = []
if (this.props.lotteriesData) {
this.props.lotte... | Check for lotteries data before trying to process them. | Check for lotteries data before trying to process them.
| JavaScript | mit | mihailgaberov/lottoland-react-demo,mihailgaberov/lottoland-react-demo |
28c89588650841686f1c0c515360686a5ac0afd8 | src/middleware/authenticate.js | src/middleware/authenticate.js | import handleAdapter from '../handleAdapter'
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var verifyHeader = ( !! config.header)
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${toke... | import handleAdapter from '../handleAdapter'
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLength}})$`)
return (req, res, next) ... | Fix header not being validated if 'auth.header' option is not given. | Fix header not being validated if 'auth.header' option is not given.
In authenticate middleware.
| JavaScript | mit | kukua/concava |
fc9bdc4a183ea90c596603bdc5cdc62e2902c1ce | lib/Subheader.js | lib/Subheader.js | import { getColor } from './helpers';
import { StyleSheet, View, Text } from 'react-native';
import { TYPO, THEME_NAME } from './config';
import React, { Component, PropTypes } from 'react';
const styles = StyleSheet.create({
container: {
padding: 16
},
text: TYPO.paperFontBody1
});
export default... | import { getColor } from './helpers';
import { StyleSheet, View, Text } from 'react-native';
import { TYPO, THEME_NAME } from './config';
import React, { Component, PropTypes } from 'react';
const styles = StyleSheet.create({
container: {
padding: 16
},
text: TYPO.paperFontBody1
});
export default... | Add ability to set state of subheader | Add ability to set state of subheader
| JavaScript | mit | xotahal/react-native-material-ui,mobileDevNativeCross/react-native-material-ui,xvonabur/react-native-material-ui,blovato/sca-mobile-components,ajaxangular/react-native-material-ui,kenma9123/react-native-material-ui |
edbcdb75813fdd8149c147f0c7dc5138e06307e6 | test/unit/history/setLimit.test.js | test/unit/history/setLimit.test.js | import History from '../../../src/history'
describe('History::setLimit', function() {
const action = n => n
it('sets the correct size given Infinity', function() {
const history = new History()
history.setLimit(Infinity)
expect(history.limit).toEqual(Infinity)
})
it('sets the correct size given ... | import History from '../../../src/history'
describe('History::setLimit', function() {
it('sets the correct size given Infinity', function() {
const history = new History()
history.setLimit(Infinity)
expect(history.limit).toEqual(Infinity)
})
it('sets the correct size given an integer', function() {... | Remove unused variable that caused linter warning | Remove unused variable that caused linter warning
| JavaScript | mit | vigetlabs/microcosm,vigetlabs/microcosm,vigetlabs/microcosm |
2990ed3071a0969145e0a76beae6ad057e6e14f9 | subsystem/click.js | subsystem/click.js | phoxy._ClickHook =
{
_: {},
};
phoxy._ClickHook._.click =
{
InitClickHook: function()
{
document.querySelector('body').addEventListener('click', function(event)
{
var target = event.target;
while (true)
{
if (target === null)
return;
if (targe... | phoxy._ClickHook =
{
_: {},
};
phoxy._ClickHook._.click =
{
InitClickHook: function()
{
document.querySelector('body').addEventListener('click', function(event)
{
var target = event.target;
while (true)
{
if (target === null)
return;
if (targe... | Fix empty history issue, when we never could go back | Fix empty history issue, when we never could go back
| JavaScript | apache-2.0 | phoxy/phoxy,phoxy/phoxy |
675134d0bb49567fade2501538dc088b21cdab64 | StructureMaintainer.js | StructureMaintainer.js | module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
var newCandidates = [],
links = [],
spawns = [];
Object.keys(Game.structures).forEach(function(structureId) {
structure = Game.structures[structureId];
if(structure.hits < (structure.... | module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
var structures = Object.keys(Game.rooms).forEach(function (roomName) {
Game.rooms[roomName].find(FIND_STRUCTURES, {
filter: function (structure) {
return (structure.my === true || st... | Make it so that the Structure Maintainer includes roads as well. | Make it so that the Structure Maintainer includes roads as well.
| JavaScript | mit | pmaidens/screeps,pmaidens/screeps |
e29974b1adcb91af1a65ac474fcb36d7a0e24098 | test/17_image/definitions.js | test/17_image/definitions.js | define(function () {
return [
{
"default": {
name: "TestForm",
label: "TestForm",
_elements: [
{
"default": {
name: "Name",
type: "text",
label: "Name"
}
},
{
"default": {
... | define(function () {
return [
{
"default": {
name: "TestForm",
label: "TestForm",
_elements: [
{
"default": {
name: "Name",
type: "text",
label: "Name"
}
},
{
"default": {
... | Update form definition in tests to demonstrate functionality | Update form definition in tests to demonstrate functionality
| JavaScript | bsd-3-clause | blinkmobile/forms,blinkmobile/forms |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.