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 |
|---|---|---|---|---|---|---|---|---|---|
38793f2f444d22a40bd844ac59d42b7634b3ada0 | init-dev-account.js | init-dev-account.js | 'use strict'
const cozy = require('./cozyclient')
const fs = require('fs')
const path = require('path')
// account id path is mandatory in the cli
let accountIdPath = process.argv[2]
if (accountIdPath) {
accountIdPath = path.resolve(accountIdPath)
} else {
console.log(`Account id file not found : ${accountIdPath}... | 'use strict'
const cozy = require('./cozyclient')
const fs = require('fs')
const path = require('path')
// account id path is mandatory in the cli
let accountIdPath = process.argv[2]
if (accountIdPath) {
accountIdPath = path.resolve(accountIdPath)
} else {
console.log(`Account id file not found : ${accountIdPath}... | Check the existence of env_fields.json file | Check the existence of env_fields.json file
| JavaScript | mit | doubleface/cozy-konnector-libs |
4dbb3dc59e525598972bab51c6b44ab61cb673cc | src/main.js | src/main.js | const { ipcRenderer, remote } = require("electron");
const { app, BrowserWindow } = require("electron");
const fs = require("fs");
window.onload = () => {
}
| const { ipcRenderer } = require("electron");
const remote = require("electron").remote;
const { app, BrowserWindow } = require("electron");
const fs = require("fs");
window.onload = () => {
var win = remote.getCurrentWindow();
win.setResizable(true);
}
| Allow window to be resized | Allow window to be resized
| JavaScript | apache-2.0 | EpticMC/Commander-IDE,EpticMC/Commander-IDE |
9b31abb8533ccf889a8a2356808375a794938af3 | src/main.js | src/main.js | var classes = require("./classes");
var gRex = require("./grex");
var grex = function(options, callback){
try {
if(typeof options === 'function'){
callback = options;
options = undefined;
}
var db = new gRex(options);
connect = db.connect().then().nodeify(cal... | var classes = require("./classes");
var gRex = require("./grex");
var grex = function(options, callback){
try {
if(typeof options === 'function'){
callback = options;
options = undefined;
}
var db = new gRex(options);
connect = db.connect().then().nodeify(cal... | Fix warnings in build task | Fix warnings in build task
| JavaScript | mit | jbmusso/grex |
f9066c99c2a52c5807c0f3f1491c69ce1afc21b5 | src/methods/statistics/index.js | src/methods/statistics/index.js | import connection from '../../config/database';
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
const divisions = await connection
.table('employees')
.filter(doc => doc('div').ne(''))('div')
.distinct()
.count();
const dir... | import connection from '../../config/database';
module.exports.register = (server, options, next) => {
async function getStats(next) {
try {
const groups = await connection
.table('employees')
.filter(doc => doc('grp').ne(''))('grp')
.distinct()
.count();
const divisi... | Update Census statistics method to get groups, sections and teams | Update Census statistics method to get groups, sections and teams
| JavaScript | mit | ocean/higgins,ocean/higgins |
c326be92e077ae1d5f94227e4039b1590c012d91 | test/setup/setup.js | test/setup/setup.js | module.exports = function() {
global.expect = global.chai.expect;
global.THREE = require('three');
// Mock 'document.createElement()' to return a fake canvas.
// This is a bit more convenient rather than requiring both the canvas
// and jsdom node modules to be installed as well.
const context = {
cle... | module.exports = function() {
global.expect = global.chai.expect;
global.THREE = require('three');
// Mock 'document.createElement()' to return a fake canvas.
// This is a bit more convenient rather than requiring both the canvas
// and jsdom node modules to be installed as well.
const context = {
cle... | Add missing canvas context methods | Add missing canvas context methods
| JavaScript | mit | Leeft/three-sprite-texture-atlas-manager,Leeft/three-sprite-texture-atlas-manager |
ea92f597db06879e471e9d76cae85b822d3cf976 | tests/integration/components/provider-carousel-test.js | tests/integration/components/provider-carousel-test.js | import {moduleForComponent, skip} from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
moduleForComponent('provider-carousel', 'Integration | Component | provider carousel', {
integration: true
});
skip('it renders', function (assert) {
// Set any properties with this.s... | import {moduleForComponent, test} from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
moduleForComponent('provider-carousel', 'Integration | Component | provider carousel', {
integration: true
});
test('it renders', function (assert) {
// Set any properties with this.s... | Make provider-carousel test account for whitespace | Make provider-carousel test account for whitespace
| JavaScript | apache-2.0 | CenterForOpenScience/ember-preprints,baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,baylee-d/ember-preprints |
5825573d2d6f907df67ca44698cb5eecc689d4f6 | src/emoji/emojiSelectors.js | src/emoji/emojiSelectors.js | /* @flow */
import { createSelector } from 'reselect';
import { getRawRealmEmoji } from '../directSelectors';
import { getAuth } from '../account/accountSelectors';
import { getFullUrl } from '../utils/url';
export const getAllRealmEmojiById = createSelector(getAuth, getRawRealmEmoji, (auth, emojis) =>
Object.keys(e... | /* @flow */
import { createSelector } from 'reselect';
import type { Selector, RealmEmojiState } from '../types';
import { getRawRealmEmoji } from '../directSelectors';
import { getAuth } from '../account/accountSelectors';
import { getFullUrl } from '../utils/url';
export const getAllRealmEmojiById: Selector<RealmEmo... | Add type annotations to selectors. | emoji: Add type annotations to selectors.
This fully covers this (small) file with types.
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
a28122842e4c7c454813c81bbca1c3645dfc70e9 | jest.config.base.js | jest.config.base.js | const { defaults } = require("jest-config");
module.exports = {
testEnvironment: "node",
setupFiles: [
"<rootDir>/../apollo-server-env/dist/index.js"
],
preset: "ts-jest",
testMatch: null,
testRegex: "/__tests__/.*\\.test\\.(js|ts)$",
testPathIgnorePatterns: [
"/node_modules/",
... | const { defaults } = require("jest-config");
module.exports = {
testEnvironment: "node",
setupFiles: [
"<rootDir>/../apollo-server-env/dist/index.js"
],
preset: "ts-jest",
testMatch: null,
testRegex: "/__tests__/.*\\.test\\.(js|ts)$",
testPathIgnorePatterns: [
"/node_modules/",
... | Add comments to `moduleNameMapper` option in Jest config | Add comments to `moduleNameMapper` option in Jest config
| JavaScript | mit | apollostack/apollo-server |
351d0c628b12356f741db48de27d3e9a5909c638 | test/ec2_elasticache_test.js | test/ec2_elasticache_test.js | 'use strict';
/**
* Attempt to create a template containing an ec2 and elasticache instance.
**/
var Template = require('../lib/Template.js');
var Validator = require('../lib/Validator.js');
exports.testJustEC2 = function(test){
// Set up the template
var t = new Template();
var filePath = '/tmp/minimum... | 'use strict';
/**
* Attempt to create a template containing an elasticache instance.
**/
var Template = require('../lib/Template.js');
var Validator = require('../lib/Validator.js');
exports.testJustEC2 = function(test){
// Create the template
var t = new Template();
var filePath = '/tmp/elasticache_tes... | Remove EC2 instance from the elasticache test | Remove EC2 instance from the elasticache test
| JavaScript | apache-2.0 | owap/scenery,OpenWhere/scenery,OpenWhere/scenery |
c0237299ffd8ffc3e2b9f7291bf5a490c8bbdf13 | plugins/flipkart.js | plugins/flipkart.js | var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'Flipkart',
prepareImgLinks:function (callback) {
var res = [];
hoverZoom.urlReplace(res,
'img[src*="rukminim1.flixcart.com"]',
/image\/\d+\/\d+/,
'image/500/500'
);
ca... | var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'Flipkart',
version:'2.0',
prepareImgLinks:function (callback) {
var res = [];
/*hoverZoom.urlReplace(res,
'img[src*="rukminim1.flixcart.com"]',
/image\/\d+\/\d+/,
'image/500/500'... | Fix for plug-in : Flipkart | Fix for plug-in : Flipkart
| JavaScript | mit | extesy/hoverzoom,extesy/hoverzoom |
e8621452fbd78722b480d59fd840fa9f6cd58d7e | test/wwwdude-contentdelivery.js | test/wwwdude-contentdelivery.js | /*!
* unit asserts to ensure delivery of payload within
* HTTP POST/PUT requests works
*
* @author pfleidi
*/
var assert = require('assert');
var Helper = require('./test_helper');
var HttpClient = require('../index');
var client = HttpClient.createClient();
function _assertWithPayload(beforeExit, verb, payload... | /*!
* unit asserts to ensure delivery of payload within
* HTTP POST/PUT requests works
*
* @author pfleidi
*/
var assert = require('assert');
var Helper = require('./test_helper');
var HttpClient = require('../index');
var client = HttpClient.createClient({
parseContent: JSON.parse
});
function _assertWi... | Add test for content parser | Add test for content parser
| JavaScript | mit | pfleidi/node-wwwdude |
ede3d9243edf048a887d0a26472c6b0584fdb45c | src/js/directives/widget-header.js | src/js/directives/widget-header.js | /**
* Widget Header Directive
*/
angular
.module('RDash')
.directive('rdWidgetHeader', rdWidgetTitle);
function rdWidgetTitle() {
var directive = {
requires: '^rdWidget',
scope: {
title: '@',
icon: '@'
},
transclude: true,
template: '<div c... | /**
* Widget Header Directive
*/
angular
.module('RDash')
.directive('rdWidgetHeader', rdWidgetTitle);
function rdWidgetTitle() {
var directive = {
requires: '^rdWidget',
scope: {
title: '@',
icon: '@'
},
transclude: true,
template: '<div c... | Fix Search Box CSS is not Responsive | Fix Search Box CSS is not Responsive
| JavaScript | mit | jasonmelgoza/Responsive-Dashboard,RickyDan/rdash-angular,Shim2k/rdash-angular,saulosaires/fitcook-site,armand1m/wizard-finder-client,jkarpilo/Responsive-Dashboard,zidom/rdash-angular,PsyGik/rdash-angular,cesarmarinhorj/rdash-angular,jvkops/rdash-angular,tbaker0815/upwork_project,boyofgreen/BankOfContoso,ctuwuzida/rdash... |
01ea92a0f0bfc53c3fd840ef74e3936442f115be | web/src/reducers/UserReducer.js | web/src/reducers/UserReducer.js | import * as ActionTypes from '../actions/ActionTypes'
function UserReducer(state = [], action) {
switch (action.type) {
case ActionTypes.CREATE_USER_SUCCESS:
return [
...state,
Object.assign({}, action.user),
]
default:
return state
}
}
export default UserReducer
| import * as ActionTypes from '../actions/ActionTypes'
function UserReducer(state = {}, action) {
switch (action.type) {
case ActionTypes.CREATE_USER_SUCCESS:
return {
...state,
...action.user,
}
default:
return state
}
}
export default UserReducer
| Store single user instead of array | Store single user instead of array
| JavaScript | mit | RailsRoading/wissle,RailsRoading/wissle,RailsRoading/wissle |
758b309a525dbe6952ed7966bd7f8b1af0ba29e0 | app/assets/javascripts/core.js | app/assets/javascripts/core.js | $(document).ready(function() {
$('.print-link a').attr('target', '_blank');
var $searchFocus = $('.js-search-focus');
$searchFocus.each(function(i, el){
if($(el).val() !== ''){
$(el).addClass('focus');
}
});
$searchFocus.on('focus', function(e){
$(e.target).addClass('focus');
});
$searc... | $(document).ready(function() {
$('.print-link a').attr('target', '_blank');
var $searchFocus = $('.js-search-focus');
$searchFocus.each(function(i, el){
if($(el).val() !== ''){
$(el).addClass('focus');
}
});
$searchFocus.on('focus', function(e){
$(e.target).addClass('focus');
});
$searc... | Use SelectionButtons live selector, for JS/AJAX content | Use SelectionButtons live selector, for JS/AJAX content
Some GOV.UK pages, like Smart Answers, load content via JS, including
radio buttons or checkboxes. These will be added to the DOM after the
selector is run and the resulting elements are passed to SelectionButtons
SelectionButtons can also take a string selector... | JavaScript | mit | tadast/static,robinwhittleton/static,robinwhittleton/static,kalleth/static,alphagov/static,tadast/static,robinwhittleton/static,kalleth/static,kalleth/static,tadast/static,tadast/static,alphagov/static,alphagov/static,kalleth/static,robinwhittleton/static |
0e86b9ddde0847b61c9d308eb2eff767954ba646 | app/utils/messageMiddleware.js | app/utils/messageMiddleware.js | import { get } from 'lodash';
import Raven from 'raven-js';
export default function createMessageMiddleware(actionToDispatch) {
return store => next => action => {
const success = action.success && get(action, ['meta', 'successMessage']);
const error = action.error && get(action, ['meta', 'errorMessage']);
... | import { get } from 'lodash';
import Raven from 'raven-js';
const reportToSentry = action =>
__CLIENT__ && Raven.captureException(action.payload);
export default function createMessageMiddleware(actionToDispatch) {
return store => next => action => {
const success = action.success && get(action, ['meta', 'suc... | Fix sentry reporting in SSR | Fix sentry reporting in SSR
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
85ba445f607735859b4d229ddd4894fe0493d84b | lib/modules/view.js | lib/modules/view.js | export default (shower) => {
const { container } = shower;
const { fullModeClass, listModeClass } = shower.options;
if (container.classList.contains(fullModeClass)) {
shower.enterFullMode();
} else {
container.classList.add(listModeClass);
}
const getScale = () => {
con... | export default (shower) => {
const { container } = shower;
const { fullModeClass, listModeClass } = shower.options;
if (container.classList.contains(fullModeClass)) {
shower.enterFullMode();
} else {
container.classList.add(listModeClass);
}
const getScale = () => {
con... | Remove now unnecessary "load" event listener | Remove now unnecessary "load" event listener
| JavaScript | mit | shower/core |
a6aa91b0c13bc1c08d0d25224cccddc149dcb677 | routes/ratings.js | routes/ratings.js | var express = require('express');
var router = express.Router();
var ratings = [
{text: 'Good UI! Many alert choices.', stars: 5},
{text: 'Running Great! No crashes', stars: 5}
];
/* GET ratings listing. */
router.get('/', function(req, res, next) {
res.json({
ratings: ratings
});
});
router.post('/', fu... | var express = require('express');
var router = express.Router();
var ratings = [
{text: 'Good UI! Many alert choices.', stars: 5},
{text: 'Running Great! No crashes', stars: 5}
];
/* GET ratings listing. */
router.get('/', function(req, res, next) {
res.json({
ratings: ratings
});
});
router.post('/', fu... | Fix rating route to return proper result and save stars as ints | Fix rating route to return proper result and save stars as ints
| JavaScript | mit | mbuechmann/brownbag-reactjs,mbuechmann/brownbag-reactjs |
5967a6e22ec524e477fb8c47463fab64e3a67f0c | lib/smoochApiBot.js | lib/smoochApiBot.js | 'use strict';
const Bot = require('./bot');
class SmoochApiBot extends Bot {
constructor(options) {
super(options);
this.name = options.name;
this.avatarUrl = options.avatarUrl;
}
say(text) {
const api = this.store.getApi();
let message = Object.assign({
... | 'use strict';
const Bot = require('./bot');
class SmoochApiBot extends Bot {
constructor(options) {
super(options);
this.name = options.name;
this.avatarUrl = options.avatarUrl;
}
say(text, actions) {
const api = this.store.getApi();
let message = Object.assign({
... | Add actions argument to say function | Add actions argument to say function
| JavaScript | mit | alavers/smooch-bot |
721b8290dec1c57c64eed67a9bc7b7a59121fbd3 | JavaScript/object-literals.js | JavaScript/object-literals.js | var Pet = {
init: function (options) {
this.name = options.name
this.born = options.born
this.died = options.died
}
}
var Dog = {
init: function (breed, options) {
Pet.init.call(this, options)
this.breed = breed
},
age: function () {
return (this.died || new Date().getFullYear()) - th... | var Pet = {
init: function (options) {
this.name = options.name
this.born = options.born
this.died = options.died
},
age: function () {
return (this.died || new Date().getFullYear()) - this.born
}
}
var Dog = Object.create(Pet, {
init: {
value: function (breed, options) {
Pet.init.c... | Add object literals in JavaScript | Add object literals in JavaScript
| JavaScript | mit | jsstrn/kata,jsstrn/HackerRank,jsstrn/HackerRank,jsstrn/kata,jsstrn/kata,jsstrn/kata |
999027f424c8ad4c51b5f648fa3f1128f41220dd | static/script/user/view.js | static/script/user/view.js | $( document ).ready( function() {
function showUploadedImage( source ) {
$( "#userImage" ).attr( "src", source );
}
$( "#image-form" ).submit( function() {
var image = document.getElementById( "image" ).files[ 0 ];
var token = $( "input[type=hidden]" ).val();
var formdata = n... | $( document ).ready( function() {
function showUploadedImage( source ) {
$( "#userImage" ).attr( "src", source );
}
$( "#image-form" ).submit( function() {
var image = document.getElementById( "image" ).files[ 0 ];
if ( !image ) {
$( '#image-form' ).prepend( "<div class='... | Check if it is not an image | Check if it is not an image
| JavaScript | mit | VitSalis/endofcodes,dionyziz/endofcodes,dionyziz/endofcodes,VitSalis/endofcodes,VitSalis/endofcodes,dionyziz/endofcodes,VitSalis/endofcodes |
7294b89a6bb296bf35f338c12fe5b8cc82504cb6 | scrapper/index.js | scrapper/index.js | // Imports the Google Cloud client library
const Datastore = require('@google-cloud/datastore')
// Your Google Cloud Platform project ID
const projectId = 'pirula-time'
// Instantiates a client
const datastore = Datastore({
projectId: projectId
})
// The kind for the new entity
const kind = 'time'
// The name/ID f... | const Datastore = require('@google-cloud/datastore')
const projectId = 'pirula-time'
const datastore = Datastore({
projectId: projectId
})
const kind = 'time'
const averageKey = datastore.key([kind, 'average'])
function scrape() {
const data = {
average: 1800,
}
return data
}
exports.doIt = function doIt... | Change scrapper trigger to http request | Change scrapper trigger to http request
| JavaScript | mit | firefueled/pirula-time,firefueled/pirula-time,firefueled/pirula-time,firefueled/pirula-time,firefueled/pirula-time |
43dddfa13f3738d4436b25972b8c22ee8a0ae165 | js/models/article.js | js/models/article.js | Kpcc.Article = DS.Model.extend({
title : DS.attr(),
short_title : DS.attr(),
published_at : DS.attr(),
byline : DS.attr(),
teaser : DS.attr(),
body : DS.attr(),
public_url : DS.attr(),
assets : DS.hasMany('asset'),
audio ... | Kpcc.Article = DS.Model.extend({
title : DS.attr(),
short_title : DS.attr(),
published_at : DS.attr(),
byline : DS.attr(),
teaser : DS.attr(),
body : DS.attr(),
public_url : DS.attr(),
assets : DS.hasMany('asset'),
audio ... | Fix Reader to support non-model audio (no ID) | Fix Reader to support non-model audio (no ID)
| JavaScript | mit | SCPR/kpcc-reader,SCPR/kpcc-reader,SCPR/kpcc-reader |
acb8969398c27fd29dd849e9b5072ac5df1997fc | app/assets/javascripts/frontend/text-character-count.js | app/assets/javascripts/frontend/text-character-count.js | // Gets character limit and allows no more
$(function() {
// Creates the character count elements
$(".js-char-count").wrap("<div class='char-count'></div>")
$(".js-char-count").after("<div class='char-text'>Character count: <span class='current-count'>0</span></div>");
// Includes charact limit if there is one... | // Gets character limit and allows no more
$(function() {
// Creates the character count elements
$(".js-char-count").wrap("<div class='char-count'></div>")
$(".js-char-count").after("<div class='char-text'>Character count: <span class='current-count'>0</span></div>");
// Includes charact limit if there is one... | Fix char count for Firefox | Fix char count for Firefox
| JavaScript | mit | bitzesty/qae,bitzesty/qae,bitzesty/qae,bitzesty/qae |
768db2ae414700b751dafd2e159ec40251d4beed | lib/graceful-exit.js | lib/graceful-exit.js | var utils = require("radiodan-client").utils,
logger = utils.logger(__filename);
module.exports = function(radiodan){
return function() {
clearPlayers(radiodan.cache.players).then(
function() {
process.exit(0);
},
function() {
process.exit(1);
}
);
function cl... | var utils = require("radiodan-client").utils,
logger = utils.logger(__filename);
module.exports = function(radiodan){
return function() { return gracefulExit(radiodan); }
};
function gracefulExit(radiodan) {
// if promise does not resolve quickly enough, exit anyway
setTimeout(exitWithCode(2), 3000);
ret... | Exit process if clearing process does not finish within 3 seconds | Exit process if clearing process does not finish within 3 seconds
App would previously refuse to exit if it could not send a successful
clear message to each player.
| JavaScript | apache-2.0 | radiodan/magic-button,radiodan/magic-button |
1750b24540c65f4a0a29c2f5905aa885039db602 | lib/platform.js | lib/platform.js | var isNode = require('is-node');
module.exports = (function () {
if (typeof Deno !== 'undefined') {
var env = Deno.permissions().env ? Deno.env() : {};
return {
argv: Deno.args,
color: !Deno.noColor ? 1 : 0,
env: env,
runtime: 'deno'
};
}... | /*globals Deno*/
var isNode = require('is-node');
module.exports = (function () {
if (typeof Deno !== 'undefined') {
var env = Deno.permissions().env ? Deno.env() : {};
return {
argv: Deno.args,
color: !Deno.noColor ? 1 : 0,
env: env,
runtime: 'deno'... | Add a int exception for the check for Deno. | Add a int exception for the check for Deno.
| JavaScript | mit | sunesimonsen/magicpen |
fc51b12766d2be8fef8889bca13a2459f8f63d24 | api/index.js | api/index.js | module.exports = function (config, next) {
require('../db')(config, function (err, client) {
if (err) { return next(err); }
var messaging = require('../db/messaging')(config);
var keyspace = config.keyspace || 'seguir';
// TODO: Refactor out into iteration over array of modules
var auth = requ... | var path = require('path');
module.exports = function (config, next) {
require('../db')(config, function (err, client) {
if (err) { return next(err); }
var messaging = require('../db/messaging')(config);
var api = {};
api.client = client;
api.config = config;
api.messaging = messaging;
... | Make api initialisation more modular | Make api initialisation more modular
| JavaScript | mit | gajjargaurav/seguir,cliftonc/seguir,tes/seguir |
5c31bef28451412a09bcc100fb08c2b41709d0ce | client/src/store/rootReducer.js | client/src/store/rootReducer.js | import { reducer as formReducer } from 'redux-form';
import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import {
organization,
starredBoard,
notification,
modals,
board,
home
} from '../app/routes/home/modules/index';
import { signUp } from '../app/routes/signUp/module... | import { reducer as formReducer } from 'redux-form';
import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import {
organization,
starredBoard,
notification,
modals,
board,
home
} from '../app/routes/home/modules/index';
import { signUp } from '../app/routes/signUp/module... | Add boardsMenu reducer to the store | Add boardsMenu reducer to the store
| JavaScript | mit | Madmous/madClones,Madmous/Trello-Clone,Madmous/Trello-Clone,Madmous/madClones,Madmous/Trello-Clone,Madmous/madClones,Madmous/madClones |
5bdf8dd75843b06b72c3bee3dbe4dbefc7def43c | apps/main.js | apps/main.js | import React from 'react';
import { registerComponent } from 'react-native-playground';
import {
StyleSheet,
Text,
View,
} from 'react-native';
class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.instructions}>
Edit and save wi... | import React from 'react';
import { registerComponent } from 'react-native-playground';
import {
StatusBar,
StyleSheet,
Text,
View,
} from 'react-native';
class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.instructions}>
Edi... | Use default barStyle in starter app | Use default barStyle in starter app
| JavaScript | mit | rnplay/rnplay-web,rnplay/rnplay-web,rnplay/rnplay-web,rnplay/rnplay-web |
9975351407a528dad840fda8309acfa132b9b431 | service/security.js | service/security.js | /*
* Copyright 2015 Mark Eschbach
*
* 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 agree... | /*
* Copyright 2015 Mark Eschbach
*
* 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 t... | Allow for no user states | Allow for no user states
| JavaScript | apache-2.0 | meschbach/onomate,meschbach/onomate,meschbach/onomate |
654d58e164240d3ef35f5b2b3e3903f9eb554fa8 | internals/testing/karma.conf.js | internals/testing/karma.conf.js | const webpackConfig = require('../webpack/webpack.test.config');
const path = require('path');
module.exports = (config) => {
config.set({
frameworks: ['mocha', 'sinon-chai'],
reporters: ['coverage', 'mocha'],
browsers: ['Chrome'],
autoWatch: false,
singleRun: true,
/**
* Define the karma file.
*
... | const webpackConfig = require('../webpack/webpack.test.config');
const path = require('path');
module.exports = (config) => {
config.set({
frameworks: ['mocha', 'sinon-chai'],
reporters: ['coverage', 'mocha'],
browsers: process.env.TRAVIS
? ['ChromeTravis']
: ['Chrome'],
autoWatch: false,
singl... | Set up test support for travis. | Set up test support for travis.
| JavaScript | mit | reauv/persgroep-app,reauv/persgroep-app |
bb7eb52313831da6a8c12324d220875fd25f68bf | routes/index.js | routes/index.js | var express = require('express');
var router = express.Router();
router.get('/checkouts/new', function(req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;
| var express = require('express');
var router = express.Router();
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get('/checkouts/new', function(req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;
| Update root route to point to new checkouts page | Update root route to point to new checkouts page
| JavaScript | mit | braintree/braintree_express_example,braintree/braintree_express_example,ashutosh37/nodejs-braintree-firebase,ashutosh37/nodejs-braintree-firebase |
a970aad03a6e0730e08caf98982caf4fe5eb5e29 | test/unit/game_of_life.support.spec.js | test/unit/game_of_life.support.spec.js | describe('Support module', function () {
var S = GameOfLife.Support;
describe('For parsing canvas', function () {
it('throws InvalidArgument if given other than canvas element', function () {
expect(function () {
S.parseCanvas($('<p>foo</p>'));
}).toThrow(new S.InvalidArgument('Not a canvas... | describe('Support module', function () {
var S = GameOfLife.Support;
describe('For validating canvas', function () {
it('throws InvalidArgument if given other than a canvas element', function () {
expect(function () {
S.validateCanvas($('<p>foo</p>')[0]);
}).toThrow(new S.InvalidArgument('N... | Add unit tests for canvas validation | Add unit tests for canvas validation
| JavaScript | mit | tkareine/game_of_life,tkareine/game_of_life,tkareine/game_of_life |
89da8456cb272201d66ba059b8d6e63af6c13a97 | spec/util/config.js | spec/util/config.js | window.respokeTestConfig = {
baseURL: 'http://testing.digiumlabs.com:3001'
};
respoke.log.setLevel('silent');
window.doneOnceBuilder = function (done) {
var called = false;
return function (err) {
if (!called) {
called = true;
done(err);
}
};
};
window.doneCountB... | window.respokeTestConfig = {
baseURL: 'http://testing.digiumlabs.com:3001'
};
respoke.log.setLevel('silent');
window.doneOnceBuilder = function (done) {
var called = false;
return function (err) {
if (!called) {
called = true;
done(err);
}
};
};
// build a functi... | Add an explanation detailing behavior of doneCountBuilder. | Add an explanation detailing behavior of doneCountBuilder.
| JavaScript | mit | respoke/respoke,respoke/respoke,respoke/respoke |
4f0f14323f546e72e1d58c86710fc80b8c6129a3 | drops/strider/index.js | drops/strider/index.js | module.exports = function(scope, argv) {
return {
install: function (done) {
scope.applyConfig({
create: {
Image: "niallo/strider:latest",
},
start: {
PublishAllPorts: !!argv.publish
}
}, function (err) {
if (err) throw err;
scope.ins... | module.exports = function(scope, argv) {
return {
install: function (done) {
scope.applyConfig({
create: {
Image: "niallo/strider:latest",
Env: {
/* https://github.com/Strider-CD/strider#configuring */
}
},
start: {
PublishAllPorts:... | Add a note on env configuration | Add a note on env configuration
| JavaScript | isc | keyvanfatehi/ydm,kfatehi/ydm |
0b273ace2c3681814c9ca799f12482d99c27c015 | src/schema/rpc.js | src/schema/rpc.js | 'use strict';
const { reduceAsync, identity } = require('../utilities');
const { rpcHandlers } = require('../rpc');
// Returns a reducer function that takes the schema as input and output,
// and iterate over rpc-specific reduce functions
const getRpcReducer = function (name, postProcess) {
const processors = getPr... | 'use strict';
const { reduceAsync, identity } = require('../utilities');
const { rpcHandlers } = require('../rpc');
// Reducer function that takes the schema as input and output,
// and iterate over rpc-specific reduce functions
const rpcReducer = function ({ schema, processors, postProcess = identity }) {
return r... | Fix function names being lost in binding | Fix function names being lost in binding
| JavaScript | apache-2.0 | autoserver-org/autoserver,autoserver-org/autoserver |
ec886703ac80b1a5fef912123dd3a64411aab320 | bin/index.js | bin/index.js | #!/usr/bin/env node
'use strict';
// foreign modules
const meow = require('meow');
// local modules
const error = require('../lib/error.js');
const logger = require('../lib/utils/logger.js');
const main = require('../index.js');
// this module
const cli = meow({
help: main.help,
version: true
}, {
boolean: ... | #!/usr/bin/env node
'use strict';
// foreign modules
const meow = require('meow');
// local modules
const error = require('../lib/error.js');
const logger = require('../lib/utils/logger.js');
const main = require('../index.js');
// this module
const cli = meow({
help: main.help,
version: true
}, {
flags: {
... | Update meow options to be in line with v4.0.0 | Update meow options to be in line with v4.0.0
| JavaScript | bsd-3-clause | blinkmobile/bmp-cli |
0a302a6a1f5bc93c999d25a3b9fdda9aa09b61ba | source/merge.js | source/merge.js | function merge(...args) {
let output = null,
items = [...args];
while (items.length > 0) {
const nextItem = items.shift();
if (!output) {
output = Object.assign({}, nextItem);
} else {
output = mergeObjects(output, nextItem);
}
}
return out... | function clone(obj) {
return Object.setPrototypeOf(Object.assign({}, obj), Object.getPrototypeOf(obj));
}
function merge(...args) {
let output = null,
items = [...args];
while (items.length > 0) {
const nextItem = items.shift();
if (!output) {
output = clone(nextItem);
... | Fix merging objects with prototypes | Fix merging objects with prototypes
| JavaScript | mit | perry-mitchell/webdav-client,perry-mitchell/webdav-client |
ecdd9c40790cfde9aa3e723d9cb206f61f8fa9f4 | ui/src/common/services/index.js | ui/src/common/services/index.js | import alertsSvc from './Alerts.js';
import auditLogsSvc from './AuditLogs.js';
import authSvc from './Authorization.js';
import exportSvc from './ExportService.js';
import exprUtil from './ExpressionUtil.js';
import fieldFactory from './FieldFactory.js';
import formUtil from './FormUti... | import alertsSvc from './Alerts.js';
import auditLogsSvc from './AuditLogs.js';
import authSvc from './Authorization.js';
import exportSvc from './ExportService.js';
import exprUtil from './ExpressionUtil.js';
import fieldFactory from './FieldFactory.js';
import formUtil from './FormUti... | Build fixes. Removed the unused utility class. | Build fixes.
Removed the unused utility class.
| JavaScript | bsd-3-clause | krishagni/openspecimen,krishagni/openspecimen,krishagni/openspecimen |
5e4c0f322cfa7a776e6c12807e7c1b67e3846234 | geogoose/util.js | geogoose/util.js | var mongoose = require('mongoose'),
_ = require('cloneextend'),
adHocModels = {};
var adHocModel = function(collectionName, Schema, options) {
if (!adHocModels[collectionName]) {
var options = options || {};
if (options.strict == undefined) {
options.strict = false;
}
... | var mongoose = require('mongoose'),
_ = require('cloneextend'),
adHocModels = {};
var adHocModel = function(collectionName, Schema, options) {
if (!adHocModels[collectionName]) {
var options = options || {};
if (options.strict == undefined) {
options.strict = false;
}
... | Send bbox for Point features | Send bbox for Point features
| JavaScript | mit | nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense,nickbenes/GeoSense |
30f4b78c463b42973eef5779dfabea760232f22d | lib/util/createTransition.js | lib/util/createTransition.js | /* @flow */
import matchRoutePattern from 'match-route-pattern'
import type {
Screen,
Transition,
TransitionHandler,
Location,
QueryParameters
} from '../types'
export default function createTransition(pattern: string, handler: TransitionHandler): Transition {
return function transition(location: Locatio... | /* @flow */
import matchRoutePattern from 'match-route-pattern'
import type {
Screen,
Transition,
TransitionHandler,
Location,
QueryParameters
} from '../types'
export default function createTransition(pattern: string, handler: TransitionHandler): Transition {
return function transition(location: Locatio... | Allow to return raw data from transition handler | Allow to return raw data from transition handler
| JavaScript | mit | vslinko/vstack-router |
2439e002bf97aa5dd2086bc9d6cccc500b35a07f | load/mediator/tcp-handler.js | load/mediator/tcp-handler.js | 'use strict'
const BodyStream = require('./body-stream')
exports.handleBodyRequest = (conn) => {
new BodyStream(1024).pipe(conn)
}
| 'use strict'
const BodyStream = require('./body-stream')
exports.handleBodyRequest = (conn) => {
const length = 1024 * 1024
conn.write('HTTP/1.1 200 OK\n')
conn.write('Content-Type: text/plain\n')
conn.write('\n')
new BodyStream(length).pipe(conn)
}
| Send HTTP response on TCP channel | Send HTTP response on TCP channel
The load testing tools don't support plain TCP.
OHM-556
| JavaScript | mpl-2.0 | jembi/openhim-core-js,jembi/openhim-core-js |
0b527145181bc9f8aecf6a3f49eac23bccfba7eb | src/index.js | src/index.js | /* eslint-env browser */
import {findSingleNode, getFindDOMNode} from './helpers';
let findDOMNode = findDOMNode || (global && global.findDOMNode);
function haveComponentWithXpath(component, expression) {
findDOMNode = findDOMNode || getFindDOMNode();
const domNode = findDOMNode(component);
document.body.appen... | /* eslint-env browser */
import {findSingleNode, getFindDOMNode} from './helpers';
let findDOMNode = findDOMNode || (global && global.findDOMNode);
function haveDomNodeWithXpath(domNode, expression) {
document.body.appendChild(domNode);
const xpathNode = findSingleNode(expression, domNode.parentNode);
document.... | Remove unnecessary call to findDOMNode | fix: Remove unnecessary call to findDOMNode
| JavaScript | mit | relekang/chai-have-xpath,davija/chai-have-xpath |
a0651499089a9cb5648b08713dc6f298ea667f94 | src/index.js | src/index.js | import Client from './client'
import PullRequests from './pulls'
import Repositories from './repos'
import PageLinks from './paging'
export default function (config) {
return new Client(config, {
PullRequests,
Repositories,
PageLinks
})
}
| import Client from './client'
import Branches from './branches'
import Issues from './issues'
import PullRequests from './pulls'
import Repositories from './repos'
import PageLinks from './paging'
export default function (config) {
return new Client(config, {
Branches,
Issues,
PullRequests,
Repositor... | Add branches and issues to the api | Add branches and issues to the api
| JavaScript | mit | jamsinclair/github-lite |
6b8328476ac25514dba5204ee3e3fbe423539fd0 | src/index.js | src/index.js | import React, { Component } from 'react';
import ReactDom from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/search_bar';
import VideoList from './components/video_list';
import VideoDetail from './components/video_detail';
// const API_KEY = 'PLACE_YOUR_API_KEY_HERE';
cla... | import React, { Component } from 'react';
import ReactDom from 'react-dom';
import YTSearch from 'youtube-api-search';
import SearchBar from './components/search_bar';
import VideoList from './components/video_list';
import VideoDetail from './components/video_detail';
import file from './variables.js';
// const API_KE... | Add import for variables file, set a const API_KEY as the data from variables file. | Add import for variables file, set a const API_KEY as the data from variables file.
| JavaScript | mit | JosephLeon/redux-simple-starter-tutorial,JosephLeon/redux-simple-starter-tutorial |
9d90cb8c5f2b2b38c85bb80fe96cab2b6037d35c | lib/kill-ring.js | lib/kill-ring.js | /* global atom:true */
const _ = require('underscore-plus');
const clipboard = atom.clipboard;
module.exports =
class KillRing {
constructor(limit=16) {
this.buffer = [];
this.sealed = true;
this.limit = limit;
}
put(texts, forward=true) {
if(this.sealed)
this.push(texts);
else
t... | /* global atom:true */
const clipboard = atom.clipboard;
module.exports =
class KillRing {
constructor(limit=16) {
this.buffer = [];
this.sealed = true;
this.limit = limit;
}
put(texts, forward=true) {
if(this.sealed)
this.push(texts);
else
this.update(texts, forward);
}
sea... | Remove the requirement no longer being used | Remove the requirement no longer being used
| JavaScript | mit | yasuyuky/transient-emacs,yasuyuky/transient-emacs |
535f14e8f463ce81d360204fde459c3ca3e49f97 | src/elemental.js | src/elemental.js | (function(ns) {
var namespaces = [this];
var attachBehavior = function($element, behavior) {
var fn = namespaces;
behavior.replace(/([^.]+)/g, function(object) {
if(fn === namespaces) {
for(var nextFn, index = 0; index < fn.length; ++index) {
ne... | (function(ns) {
var namespaces = [this];
var attachBehavior = function($element, behavior) {
var fn = namespaces;
behavior.replace(/([^.]+)/g, function(object) {
if(fn === namespaces) {
for(var nextFn, index = 0; index < fn.length; ++index) {
ne... | Improve perfomance on large DOMs when container is not whole document. | Improve perfomance on large DOMs when container is not whole document.
| JavaScript | mit | elementaljs/elementaljs,elementaljs/elementaljs |
822a4132d2bb0e85372e8f7790b9bd4db9c5f17e | test/pnut.js | test/pnut.js | const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const nock = require('nock');
chai.use(chaiAsPromised);
chai.should();
const expect = chai.expect;
const pnut = require('../lib/pnut');
describe('The pnut API wrapper', function () {
before(function() {
let root = 'https://api.p... | const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const nock = require('nock');
chai.use(chaiAsPromised);
chai.should();
const expect = chai.expect;
const pnut = require('../lib/pnut');
describe('The pnut API wrapper', function () {
before(function() {
let base = 'https://api.p... | Rename variable for more consitency | Rename variable for more consitency
| JavaScript | mit | kaiwood/pnut-butter |
ee239ef4415590d899a71d8e42038a8bcd831f18 | test/test.js | test/test.js | var assert = require('assert');
var configMergeLoader = require('../index.js');
describe('configMergeLoader', function() {
it('should return an function', function() {
assert.equal(typeof configMergeLoader, 'function');
});
});
| var assert = require('assert');
var configMergeLoader = require('../index.js');
describe('configMergeLoader', function() {
it('should return an function', function() {
assert.equal(typeof configMergeLoader, 'function');
});
describe('the function', function() {
var mergedObj = configMergeLoader();
... | Test that function returns and object | Test that function returns and object
| JavaScript | mit | bitfyre/config-merge-loader |
7b13df50ef46ddad708f0fd38c5d7f2891a1c56b | src/application/application.js | src/application/application.js | import $ from 'jquery';
import Radio from 'backbone.radio';
import nprogress from 'nprogress';
import Application from '../common/application';
import LayoutView from './layout-view';
let routerChannel = Radio.channel('router');
nprogress.configure({
showSpinner: false
});
export default Application.extend({
ini... | import $ from 'jquery';
import _ from 'lodash';
import Radio from 'backbone.radio';
import nprogress from 'nprogress';
import Application from '../common/application';
import LayoutView from './layout-view';
let routerChannel = Radio.channel('router');
nprogress.configure({
showSpinner: false
});
export default Ap... | Use _.defer instead of setTimeout | Use _.defer instead of setTimeout
| JavaScript | isc | paulfalgout/marionette-strings,onelovelyname/marionette-wires,paulfalgout/marionette-strings,batpad/marionette-wires-tada,yuya-takeyama/marionette-wires,thejameskyle/marionette-wires,onelovelyname/marionette-wires,jkappers/marionette-wires,yuya-takeyama/marionette-wires,thejameskyle/marionette-wires,batpad/marionette-w... |
0e1a7d0eccd55f3a45f39794e17c4cfea6912b3b | examples/hierarchical/index.js | examples/hierarchical/index.js | import Finity from '../../src';
const submachineConfig = Finity
.configure()
.initialState('substate1')
.getConfig();
const stateMachine = Finity
.configure()
.initialState('state1')
.on('event1').transitionTo('state2')
.state('state2')
.submachine(submachineConfig)
.global()
.... | import Finity from '../../src';
const handleStateEnter = (state) => console.log(`Entering state '${state}'`);
const handleStateExit = (state) => console.log(`Exiting state '${state}'`);
const submachineConfig = Finity
.configure()
.initialState('substate2A')
.on('event2').transitionTo('substate2B')
.g... | Update hierarchical state machine example | Update hierarchical state machine example
| JavaScript | mit | nickuraltsev/fluent-state-machine,nickuraltsev/finity,nickuraltsev/finity |
b9cd5acaaf55baaac93f859699dc1fcbdb244dc5 | test/testIndex.js | test/testIndex.js | "use strict";
var request = require("supertest");
var app = require("../js/server/app.js");
describe("App backend server", function () {
it("should serve the index page", function (done) {
request(app)
.get("/index.html")
.expect(200, done);
});
});
| "use strict";
var request = require("supertest");
var mongodb = require("mongodb");
var mongoUrl = "mongodb://mongodb:27017/myproject";
var app = require("../js/server/app.js");
describe("App backend server", function () {
it("should serve the index page", function (done) {
request(app)
.get... | Test for simple save/reload of a List | Test for simple save/reload of a List
Gotcha: there is no test DB separation yet, running the tests will drop
the entire collection before each test.
| JavaScript | mit | pixelistik/alreadydone,pixelistik/alreadydone,pixelistik/alreadydone |
5d7794078d159157860b76c93f1550be9418731d | src/title/TitleStream.js | src/title/TitleStream.js | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import type { Narrow, Stream } from '../types';
import StreamIcon from '../streams/StreamIcon';
import { isTopicNarrow } from '../utils/narrow';
const styles = StyleSheet.create({
wrapper: {
alignIte... | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import type { Narrow, Stream } from '../types';
import StreamIcon from '../streams/StreamIcon';
import { isTopicNarrow } from '../utils/narrow';
const styles = StyleSheet.create({
wrapper: {
alignIte... | Fix Stream title alignment issue on Android | Fix Stream title alignment issue on Android
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
e91fac319f8c5254569163f83908a676c6141f94 | spec/AddressBookSpec.js | spec/AddressBookSpec.js | describe('Address Book', function() {
var addressB,
thisContact;
beforeEach(function() {
addressB = new addressBook();
thisContact = new Contact();
});
it('should be able to add a contact', function() {
addressB.addContact(thisContact);
expect(addressB.getContact(0)).toBe(thisContact);
});
it('should... | describe('Address Book', function() {
var addressB,
thisContact;
beforeEach(function() {
addressB = new addressBook();
thisContact = new Contact();
});
it('should be able to add a contact', function() {
addressB.addContact(thisContact);
expect(addressB.getContact(0)).toBe(thisContact);
});
it('should... | Add test for async address book | Add test for async address book
| JavaScript | mit | AthinaB/js-testing-jasmine,AthinaB/js-testing-jasmine |
1a12cf0c190e077d623f9a1fcad3f91cde5915c8 | src/js/app/data_utils/store.js | src/js/app/data_utils/store.js | App.Store = DS.Store.extend({
findQuery: function(type, id){
id = id || {};
id.api_key = App.API_KEY;
return this._super(type, id);
},
allRecords: function(){
var typeMaps = this.get('typeMaps'),
records = [];
for (var key in typeMaps){
records = records.concat(typeMaps[key].re... | App.Store = DS.Store.extend({
findQuery: function(type, query){
query = query || {};
if (!this.container.lookup('router:main').namespace.AuthManager.isAuthenticated()){
query.api_key = 'a3yqP8KA1ztkIbq4hpokxEOwnUkleu2AMv0XsBWC0qLBKVL7pA';
}
return this._super(type, query);
},
allRecords: ... | Add the api_key to the query only if we're not authenticated some other way | Add the api_key to the query only if we're not authenticated some other way
| JavaScript | mit | Mause/tumblr-ember |
75d150dcbe15649754248f8628e136a7c40f7eab | scripts/ci-clean.js | scripts/ci-clean.js | /**
* `npm run ci:clean`
*
* Cross-platform script to remove report directory for CI.
*/
const process = require('process');
const script = require('./script');
const reportDirPath = process.env.npm_package_config_report_dir_path;
script.run(`rimraf ${reportDirPath}`);
| /**
* `npm run ci:clean`
*
* Cross-platform script to remove report directory for CI.
*/
const process = require('process');
const script = require('./script');
const reportDirPath = process.env.npm_package_config_report_dir_path;
script.run(`rimraf ${reportDirPath}`);
// Remove generated `.nyc_output/` because ... | Remove .nyc_output to prevent this dir from getting too large. | Remove .nyc_output to prevent this dir from getting too large.
| JavaScript | mit | choonchernlim/front-end-stack,choonchernlim/front-end-stack |
27e7db50ae93d77c8578a4b104efe3f56fce064e | src/childrensize.js | src/childrensize.js | var computedStyle = require('computed-style');
module.exports = function(container) {
if (!container) { return; }
var children = [].slice.call(container.children, 0).filter(function (el) {
var pos = computedStyle(el, 'position');
el.rect = el.getBoundingClientRect(); // store rect for later
... | var computedStyle = require('computed-style');
function toArray (nodeList) {
var arr = [];
for (var i=0, l=nodeList.length; i<l; i++) { arr.push(nodeList[i]); }
return arr;
}
module.exports = function(container) {
if (!container) { return; }
var children = toArray(container.children).filter(funct... | Fix IE8 error when converting NodeList to Array | Fix IE8 error when converting NodeList to Array
| JavaScript | mit | gardr/ext,gardr/ext |
02e71c3c22b5563f05910a92bc1c7efa9cc7a3a9 | src/background.js | src/background.js | var RESET_TIME = 3000;
var timeout;
var lastPress = Date.now();
var average = 0;
var iterations = 1;
chrome.browserAction.onClicked.addListener(function() {
var elapsedTime = Date.now() - lastPress;
lastPress = Date.now();
if (elapsedTime > RESET_TIME) {
average = 0;
iterations = 1;
} else {
avera... | var RESET_TIME = 3000;
var timeout;
var lastPress = performance.now();
var average = 0;
var iterations = 1;
chrome.browserAction.onClicked.addListener(function() {
var elapsedTime = performance.now() - lastPress;
lastPress = performance.now();
if (elapsedTime > RESET_TIME) {
average = 0;
iterations = 1;... | Use performance.now for better accuracy | Use performance.now for better accuracy
| JavaScript | mit | chrisblazek/bpm-tapper,chrisblazek/bpm-tapper,chrisblazek/bpm-tapper |
968fae71469a3bb8a010f74c2c8244a4d26f429d | protractor.conf.js | protractor.conf.js | // @AngularClass
exports.config = {
baseUrl: 'http://localhost:8080/',
allScriptsTimeout: 11000,
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 60000,
showTiming: true
},
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true'... | // @AngularClass
exports.config = {
baseUrl: 'http://localhost:3000/',
allScriptsTimeout: 11000,
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 60000,
showTiming: true
},
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true'... | Change baseUrl to listen to port 3000; remove seleniumAddress and define seleniumServerJar instead to get selenium running | Change baseUrl to listen to port 3000; remove seleniumAddress and define seleniumServerJar instead to get selenium running
| JavaScript | mit | burgerga/angular2-webpack-starter,benjaminleetmaa/hsoemRepo,psamit/angular-starter,Yaroslav-Andryushchenkov/epam-angular2,JerrolKrause/angular-ultimate-starter,vamurov/lazyImageLoad,bryant-pham/easyjudge,shattar/test-ng2-submodule-routing,stepkraft/factory-queue,DigitalGeek/angular2-webpack-starter,davidstellini/bvl-pa... |
b3b75a6855b143e1e5fb208419eea2b8819b618d | src/utils/__tests__/isExportsOrModuleAssignment-test.js | src/utils/__tests__/isExportsOrModuleAssignment-test.js | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { statement } from '../../../tests/utils';
import isExportsOrModuleAssignment from '../isExportsOrModuleAssignment';
de... | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { statement, noopImporter } from '../../../tests/utils';
import isExportsOrModuleAssignment from '../isExportsOrModuleAs... | Add noop importer to isExportsOrModuleAssignment tests | Add noop importer to isExportsOrModuleAssignment tests
| JavaScript | mit | reactjs/react-docgen,reactjs/react-docgen,reactjs/react-docgen |
ee81febc89910ea3bd5954e3ebf2b41bd400c604 | src/decorators.js | src/decorators.js | // Debounce decorator for methods.
//
// See: https://github.com/wycats/javascript-decorators
export const debounce = (duration) => (target, name, descriptor) => {
const {value: fn} = descriptor
let wrapper
let lastCall = 0
function debounced () {
const now = Date.now()
if (now > lastCall + duration) {... | // Debounce decorator for methods.
//
// See: https://github.com/wycats/javascript-decorators
export const debounce = (duration) => (target, name, descriptor) => {
const {value: fn} = descriptor
// This symbol is used to store the related data directly on the
// current object.
const s = Symbol()
function d... | Fix @debounce to work correctly with multiple instances. | Fix @debounce to work correctly with multiple instances.
| JavaScript | agpl-3.0 | lmcro/xo-web,lmcro/xo-web,lmcro/xo-web,vatesfr/xo-web,vatesfr/xo-web |
3adfb577f9b4a5d7f28ccac40f17c867a6f7913c | lib/is-js-module.js | lib/is-js-module.js | 'use strict';
var deferred = require('deferred')
, fs = require('fs')
, extname = require('path').extname
, hasNodeSheBang = RegExp.prototype.test.bind(/^#![\u0021-\uffff]+(?:\/node|\/env node)\s/)
, promisify = deferred.promisify
, read = promisify(fs.read)
, open = promisify(fs.open), close = pro... | 'use strict';
var deferred = require('deferred')
, fs = require('fs')
, extname = require('path').extname
, hasNodeSheBang = RegExp.prototype.test.bind(/^#![\u0021-\uffff]+(?:\/node|\/env node)\s/)
, promisify = deferred.promisify
, read = promisify(fs.read)
, open = promisify(fs.open), close = pro... | Support JSOM as js module | Support JSOM as js module
| JavaScript | isc | medikoo/movejs,medikoo/rename-module |
daf3d146f9049a2ecc6cd732742fbc6d1b5ca2fc | lib/storeQuery/when.js | lib/storeQuery/when.js | var Statuses = require('../internalConstants').Statuses;
function when(handlers) {
handlers || (handlers = {});
var status = this.status;
var handler = handlers[status.toLowerCase()];
if (!handler) {
throw new Error('Could not find a ' + status + ' handler');
}
switch (status) {
case Statuses.PE... | var Statuses = require('../internalConstants').Statuses;
function when(handlers) {
handlers || (handlers = {});
var status = this.status;
var handler = handlers[status.toLowerCase()];
if (!handler) {
throw new Error('Could not find a ' + status + ' handler');
}
switch (status) {
case Statuses.PE... | Allow you to call other handler from a handler | Allow you to call other handler from a handler
| JavaScript | mit | kwangkim/marty,oliverwoodings/marty,bigardone/marty,martyjs/marty,kwangkim/marty,Driftt/marty,martyjs/marty,CumpsD/marty-lib,thredup/marty-lib,thredup/marty,bigardone/marty,kwangkim/marty,goldensunliu/marty-lib,martyjs/marty-lib,bigardone/marty,oliverwoodings/marty,Driftt/marty,gmccrackin/marty-lib,thredup/marty,KeKs0r... |
c8c85828f4a82f45484d868efed645041b698536 | app/js/lib/graph_sketcher/bezier.js | app/js/lib/graph_sketcher/bezier.js | define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) {
return {
numOfPts: 100,
lineStyle: function(pts) {
let n = pts.length - 1;
let comb = [];
let r;
for (let r = 0; r <= n; r += 1) {
/... | define(['../math.js', '../../app/directives/graph_sketcher/GraphUtils.js'], function(m, graphUtils) {
return {
numOfPts: 100,
lineStyle: function(pts) {
let n = pts.length - 1;
let comb = [];
for (let r = 0; r <= n; r += 1) {
// from the other ma... | Add additional 'let' decleration for inner loop and clean up | Add additional 'let' decleration for inner loop and clean up
| JavaScript | mit | ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app,ucam-cl-dtg/isaac-app |
135011f4551a81e7f57ad373ca8c25cdfde49032 | vue-typescript.js | vue-typescript.js | /* eslint-env node */
module.exports = {
extends: [ "@vue/typescript", "./typescript.js" ],
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
parser: "@typescript-eslint/parser",
sourceType: "module",
ecmaFeatures: { jsx: true },
warnOnUnsupportedTypeScriptVersio... | /* eslint-env node */
module.exports = {
extends: [ "./typescript.js" ],
parser: require.resolve("vue-eslint-parser"),
parserOptions: {
parser: "@typescript-eslint/parser",
sourceType: "module",
ecmaFeatures: { jsx: true },
warnOnUnsupportedTypeScriptVersion: false,
p... | Fix for recent changes to typescript plugin | Fix for recent changes to typescript plugin
| JavaScript | mit | launchbadge/eslint-config-launchbadge |
84cddaa35ebcd2a80313f715598e6fd07e964ec5 | js/src/forum/addLockControl.js | js/src/forum/addLockControl.js | import { extend } from 'flarum/extend';
import DiscussionControls from 'flarum/utils/DiscussionControls';
import DiscussionPage from 'flarum/components/DiscussionPage';
import Button from 'flarum/components/Button';
export default function addLockControl() {
extend(DiscussionControls, 'moderationControls', function(... | import { extend } from 'flarum/extend';
import DiscussionControls from 'flarum/utils/DiscussionControls';
import DiscussionPage from 'flarum/components/DiscussionPage';
import Button from 'flarum/components/Button';
export default function addLockControl() {
extend(DiscussionControls, 'moderationControls', function(... | Fix extension to work with latest state changes | Fix extension to work with latest state changes
Refs flarum/core#2156.
| JavaScript | mit | flarum/flarum-ext-lock,flarum/flarum-ext-lock |
02310d90f950e0e4a5fdd493f57978fae681a429 | webpack.config.js | webpack.config.js | 'use strict';
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: ['babel-polyfill', './src/js/reactTest.jsx'],
output: {
path: './public/js',
filename: 'reactTest.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: path.resolve(__dirn... | 'use strict';
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: ['babel-polyfill', './src/js/reactTest.jsx'],
output: {
path: path.resolve(__dirname, 'public/js'),
filename: 'reactTest.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
inclu... | Use absolute path for output folder of webpack | Use absolute path for output folder of webpack
| JavaScript | agpl-3.0 | BreakOutEvent/breakout-frontend |
1a9912ec8f7579ddc1f440015933f905070b3974 | webpack.config.js | webpack.config.js | const path = require('path');
const webpack = require('webpack')
module.exports = {
module: {
rules: [
{
test: /\.html$/,
use: 'raw-loader'
}
]
},
resolve: {
modules: ['public/js', 'views/current', 'node_modules']
},
plugins: [
new webpac... | const path = require('path');
const webpack = require('webpack');
module.exports = {
module: {
rules: [
{
test: /\.html$/,
use: 'raw-loader'
}
]
},
resolve: {
modules: ['public/js', 'views/current', 'node_modules']
},
plugins: [
new webpa... | Add source maps and uglifyjs | Webpack: Add source maps and uglifyjs
| JavaScript | mit | iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher,iFixit/pulldasher |
7f52d1670b86f9e750ada848b39a5e94417ed7ff | webpack.config.js | webpack.config.js | var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: [
'./js/index.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'app.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
l... | var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: [
'./js/index.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'app.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
l... | Use source maps in developer mode. | Use source maps in developer mode.
| JavaScript | mit | concord-consortium/portal-report,concord-consortium/portal-report,concord-consortium/portal-report,concord-consortium/portal-report |
964f13a57f83d8418e8a9b82a0a93b5886862ff8 | webpack.config.js | webpack.config.js | module.exports = {
entry: {
javascript: "./app/app.jsx"
},
output: {
path: __dirname,
filename: "bundle.js"
},
resolve: {
extensions: ["", ".json", ".js", ".jsx"]
},
module: {
noParse: [/autoit.js/],
loaders: [
{
... | module.exports = {
entry: {
javascript: "./app/app.jsx"
},
output: {
path: __dirname,
filename: "bundle.js"
},
resolve: {
extensions: ["", ".json", ".js", ".jsx"]
},
module: {
noParse: [/autoit.js/],
loaders: [
{
... | Fix sourcemap for dev mode | Fix sourcemap for dev mode
| JavaScript | apache-2.0 | anildigital/ruby-operators,anildigital/ruby-operators |
9697b8d10a8312fb9e07009ce62a8e380e68bc76 | test/js/organismDetailsSpec.js | test/js/organismDetailsSpec.js | describe("Test the organismDetails file", function() {
it("Test for getBestName", function() {
expect(getBestName({})).toBe('');
});
}); | describe("Test the organismDetails file", function() {
it("Test for getBestName on empty set", function() {
expect(getBestName({})).toBe('');
});
it("Test for getBestName with only sciname", function() {
expect(getBestName({'scientificName': 'Mus musculus'})).toBe('Mus musculus');
expect(getBestName(... | Expand test case for getBestName | Expand test case for getBestName
| JavaScript | mit | molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec |
83cb7f4c548d02de3d0ef1157e9a412e9a92f1f9 | npm/test-lint.js | npm/test-lint.js | #!/usr/bin/env node
require('shelljs/global');
require('colors');
var async = require('async'),
ESLintCLIEngine = require('eslint').CLIEngine,
LINT_SOURCE_DIRS = [
'./lib/runner',
'./lib/authorizer',
'./lib/uvm/*.js',
'./lib/backpack',
'./test/system',
'./test/u... | #!/usr/bin/env node
require('shelljs/global');
require('colors');
var async = require('async'),
ESLintCLIEngine = require('eslint').CLIEngine,
LINT_SOURCE_DIRS = [
'./lib',
'./test/system',
'./test/unit',
'./test/integration',
'./npm/*.js',
'./index.js'
];
... | Add all directories under lib to eslint config | Add all directories under lib to eslint config
| JavaScript | apache-2.0 | postmanlabs/postman-runtime,postmanlabs/postman-runtime |
743f896c562cd8cc9089937fc69c2d89e62f2466 | src/bin/scry-css.js | src/bin/scry-css.js | #! /usr/bin/env node
const program = require('commander')
const PipelineRunner = require('../pipeline/runner')
program
.version('scry-css 0.2.0')
.usage('[options] <type> <dir> <file...>')
.option('-r --reporter [reporter]', 'Reporter', /^(console|json)$/i)
.parse(process.argv)
if (!program.args.length) {
... | #! /usr/bin/env node
const program = require('commander')
const PipelineRunner = require('../pipeline/runner')
program
.version('scry-css 0.2.1')
.usage('[options] <type> <dir> <file...>')
.option(
'-r --reporter [reporter]',
'reporter (json/console), defaults to console', /^(console|json)$/i
)
.par... | Fix version and improve help message. | Fix version and improve help message.
| JavaScript | mit | ovidiubute/scry-css |
6a654de28eee0b37505e7623ddffcd3d1164a07d | middleware/index.js | middleware/index.js | var fs = require('fs'),
path = require('path')
files = fs.readdirSync(__dirname);
// load in each file within this directory and attach it to exports
files.forEach(function(file) {
var name = path.basename(file, '.js');
if (name === 'index') return;
module.exports[name] = require('./' + name);
}); | var fs = require('fs'),
path = require('path')
files = fs.readdirSync(__dirname);
// load in each file within this directory and attach it to exports
files.forEach(function(file) {
var name = path.basename(file, '.js'),
regex = new RegExp(/^_/);
if (name === 'index' || name.match(regex) !== null) {
... | Update middleware loader to ignore any files with a leading '_'. | Update middleware loader to ignore any files with a leading '_'.
| JavaScript | mit | linzjs/linz,linzjs/linz,linzjs/linz |
763798205711ef7b14876f47cda4dd63aaf21427 | devmgmtV2/index.js | devmgmtV2/index.js | "use strict"
let express = require("express");
let bodyParser = require('body-parser');
let cors = require('cors');
let app = express();
let { exec } = require('child_process')
app.use(cors())
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: true }));
// parse application/json
app... | "use strict"
let express = require("express");
let bodyParser = require('body-parser');
let cors = require('cors');
let app = express();
let { exec } = require('child_process')
app.use(cors())
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: true }));
// parse application/json
app... | Fix init scripts and add NODE_PATH | Fix init scripts and add NODE_PATH
| JavaScript | mit | projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP,projectOpenRAP/OpenRAP |
f1e796076afa93d9f8a4e0b44434cd20695f3e29 | template/_footer.js | template/_footer.js | // Expose Raven to the world
window.Raven = Raven;
})(window);
|
// Expose Raven to the world
if (typeof define === 'function' && define.amd) {
define(function() { return Raven; });
} else {
window.Raven = Raven;
}
})(this);
| Make Raven compatible with CommonJS | Make Raven compatible with CommonJS
| JavaScript | bsd-3-clause | samgiles/raven-js,clara-labs/raven-js,PureBilling/raven-js,grelas/raven-js,danse/raven-js,getsentry/raven-js,danse/raven-js,getsentry/raven-js,samgiles/raven-js,benoitg/raven-js,eaglesjava/raven-js,housinghq/main-raven-js,getsentry/raven-js,vladikoff/raven-js,clara-labs/raven-js,Mappy/raven-js,hussfelt/raven-js,iodine/... |
61506b4ba4eb6ed3aadb5a02d802a92dfd520d36 | client/src/components/main/index.js | client/src/components/main/index.js | import React, { Component } from 'react';
import { connect } from 'react-redux'
import SearchBar from 'material-ui-search-bar'
import _ from 'lodash'
import './index.css'
import SearchResults from '../searchresults'
import { searchTomos } from '../../redux/ducks/tomos'
class Main extends Component {
onChange = (se... | import React, { Component } from 'react';
import { connect } from 'react-redux'
import SearchBar from 'material-ui-search-bar'
import _ from 'lodash'
import './index.css'
import SearchResults from '../searchresults'
import { searchTomos } from '../../redux/ducks/tomos'
class Main extends Component {
constructor(pr... | Load all datasets by default | Load all datasets by default
| JavaScript | bsd-3-clause | OpenChemistry/materialsdatabank,OpenChemistry/materialsdatabank,OpenChemistry/materialsdatabank,OpenChemistry/materialsdatabank |
4ae5004078a0e79ce44b61f8f63d88cb87c6fab2 | toc_view.js | toc_view.js | "use strict";
var View = require("substance-application").View;
var $$ = require("substance-application").$$;
var Data = require("substance-data");
var Index = Data.Graph.Index;
var _ = require("underscore");
// Substance.TOC.View
// ==========================================================================
var TOCV... | "use strict";
var View = require("substance-application").View;
var $$ = require("substance-application").$$;
var Data = require("substance-data");
var Index = Data.Graph.Index;
var _ = require("underscore");
// Substance.TOC.View
// ==========================================================================
var TOCV... | Read document structure dynamically to be able to react on structural changes. | Read document structure dynamically to be able to react on structural changes.
| JavaScript | mit | substance/toc |
bf6d7c1082b2a9c7e80fdce81f2b3c159f4bc61a | custom/loggers/winston/index.js | custom/loggers/winston/index.js | //Winston Logger Module
const winston = require('winston');
let logLevel = "info"; //default
if (process.env.NODE_ENV === "production") {
logLevel = "error"; //logs error
}
else if (process.env.NODE_ENV === "staging") {
logLevel = "info"; //logs info and error
}
const logger = new winston.Logger({
transpo... | //Winston Logger Module
const winston = require('winston');
let logLevel = "info"; //default
if (process.env.NODE_ENV === "production") {
logLevel = "error"; //logs error
}
else if (process.env.NODE_ENV === "staging") {
logLevel = "info"; //logs info and error
}
const logger = new winston.Logger({
transpo... | Disable file logging by default | Disable file logging by default
| JavaScript | bsd-3-clause | renonick87/sdl_server,smartdevicelink/sdl_server,smartdevicelink/sdl_server,smartdevicelink/sdl_server,renonick87/sdl_server |
a27f39fbdb3a23d2d4a8264bfa4f3ee4f7b2c701 | lib/commands/ember-cli-yuidoc.js | lib/commands/ember-cli-yuidoc.js | 'use strict';
var Y = require('yuidocjs');
var rsvp = require('rsvp');
var optsGenerator = require('../options');
module.exports = {
name: 'ember-cli-yuidoc',
description: 'Generates html documentation using YUIDoc',
run: function(opts, rawArgs) {
var options = optsGenerator.generate(... | 'use strict';
module.exports = {
name: 'ember-cli-yuidoc',
description: 'Generates html documentation using YUIDoc',
run: function(opts, rawArgs) {
var Y = require('yuidocjs');
var rsvp = require('rsvp');
var optsGenerator = require('../options');
var options = optsG... | Move require statements to the run command | Move require statements to the run command
Yuidoc now requires an internet connection to work, and since this addon
is required even if you're not using it at the moment, it was preventing
users to work offline.
TODO: Fix yuidoc itself. Having local assets would also fix #14
| JavaScript | mit | cibernox/ember-cli-yuidoc,cibernox/ember-cli-yuidoc,mixonic/ember-cli-yuidoc,mixonic/ember-cli-yuidoc,greyhwndz/ember-cli-yuidoc,greyhwndz/ember-cli-yuidoc,VladimirTyrin/ember-cli-yuidoc,VladimirTyrin/ember-cli-yuidoc |
6adaa4847545b2ba7564bfc952a542d1ac9d5629 | web/static/codesearch.js | web/static/codesearch.js | "use strict";
var Codesearch = function() {
return {
socket: null,
delegate: null,
connect: function(delegate) {
if (Codesearch.socket !== null)
return;
console.log("Connecting...");
Codesearch.remote = null;
Codesearch.delegate = delegate;
var socket = io.connect(doc... | "use strict";
var Codesearch = function() {
return {
socket: null,
delegate: null,
connect: function(delegate) {
if (Codesearch.socket !== null)
return;
console.log("Connecting...");
Codesearch.remote = null;
Codesearch.delegate = delegate;
var socket = io.connect("ht... | Use a full URL for socket.io. | Use a full URL for socket.io.
| JavaScript | bsd-2-clause | lekkas/livegrep,paulproteus/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,paulproteus/livegrep,wfxiang08/livegrep,lekkas/livegrep,lekkas/livegrep,lekkas/livegrep,lekkas/livegrep,paulproteus/livegrep,paulproteus/livegrep,lekkas/livegrep,paulproteus/livegrep,paulproteus/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,wfx... |
6a04d1e2fee23066f9647a4caa38bea3395a4bf2 | tools/pre-commit.js | tools/pre-commit.js | 'use strict';
var exec = require('child_process').exec;
function fail() {
process.stdout.write(
'Style check failed (see the above output).\n' +
'If you still wish to commit your code, run git commit -n to skip this check.\n'
);
process.exit(1);
}
exec('git diff --staged --name-status', function (error, stdou... | 'use strict';
var exec = require('child_process').exec;
var path = require('path');
function fail() {
process.stdout.write(
'Style check failed (see the above output).\n' +
'If you still wish to commit your code, run git commit -n to skip this check.\n'
);
process.exit(1);
}
exec('git diff --staged --name-sta... | Convert Unix path to Windows path in jshint command (in node_modules) | Convert Unix path to Windows path in jshint command (in node_modules)
Story #103
| JavaScript | mit | GooTechnologies/goojs,GooTechnologies/goojs,GooTechnologies/goojs |
70dbfc53eecaa00ffc91c1b4c7dc63ae9a4ac653 | test/unit/layout.js | test/unit/layout.js |
describe('layout tests', function () {
it('Should have MaterialLayout globally available', function () {
expect(MaterialLayout).to.be.a('function');
});
it('Should be upgraded to a MaterialLayout successfully', function () {
var el = document.createElement('div');
el.innerHTML = '<div... |
describe('layout tests', function () {
it('Should have MaterialLayout globally available', function () {
expect(MaterialLayout).to.be.a('function');
});
it('Should be upgraded to a MaterialLayout successfully', function () {
var el = document.createElement('div');
el.innerHTML = '<div... | Update MaterialLayout unit test with chai-jquery | Update MaterialLayout unit test with chai-jquery
| JavaScript | apache-2.0 | Ubynano/material-design-lite,NaveenNs123/material-design-lite,wonder-coders/material-design-lite,Mannaio/javascript-course,manohartn/material-design-lite,francisco-filho/material-design-lite,Creepypastas/material-design-lite,Ninir/material-design-lite,suman28/material-design-lite,rvanmarkus/material-design-lite,samthor... |
0cf9aa8f61ccfc3720de7a2d9d017c97c1b79205 | filter-truncate.js | filter-truncate.js | /**
* Return a truncated version of a string
* @param {string} input
* @param {integer} length
* @param {boolean} killwords
* @param {string} end
* @return {string}
*/
PolymerExpressions.prototype.truncate = function (input, length, killwords, end) {
var orig = input;
lengt... | /**
* Return a truncated version of a string
* @param {string} input
* @param {integer} length
* @param {boolean} killwords
* @param {string} end
* @return {string}
*/
PolymerExpressions.prototype.truncate = function (input, length, killwords, end) {
var orig = input;
length = length || 255;
if(!... | Add check to ensure truncate does not error | Add check to ensure truncate does not error
- check if input exists before acting on it
- silences thrown error
- spirit of template filter, do nothing rather than fail if input is incorrect
| JavaScript | apache-2.0 | addyosmani/polymer-filters,eumendoza/polymer-filters,addyosmani/polymer-filters,eumendoza/polymer-filters |
94e178e8e3cea8c4f0ebd32b7b47ffea9da6ee78 | src/RowSizeControls/index.js | src/RowSizeControls/index.js | import React, { Component } from 'react';
class RowSizeControls extends Component {
render() {
return (
<div style={{textAlign: 'center'}}>
<label>Images per row</label>
<input
style={{
display: 'block',
margin: '0 auto',
}}
type="range"... | import React, { Component } from 'react';
class RowSizeControls extends Component {
render() {
return (
<div style={{textAlign: 'center'}}>
<label>{this.props.value} images per row</label>
<input
style={{
display: 'block',
margin: '0 auto',
}}
... | Add rowLength to slider label | Add rowLength to slider label
| JavaScript | mit | stevula/gallery,stevula/gallery |
6053b42bcf2d2cfe9604f9923b06b9a0151f3b15 | lib/index.js | lib/index.js | 'use strict';
module.exports = function(html, attachments) {
attachments.forEach(function(attachment) {
attachment.applied = false;
var regexps = [
(attachment.fileName) ? new RegExp('<img[^>]*cid:' + attachment.fileName + '[@"\'][^>]*>', 'ig') : undefined,
(attachment.contentId) ? new RegExp('<... | 'use strict';
module.exports = function(html, attachments) {
attachments.forEach(function(attachment) {
attachment.applied = false;
var regexps = [
(attachment.fileName) ? new RegExp('<img[^>]*cid:' + attachment.fileName.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&") + '[@"\'][^>]*>', 'ig') : undefine... | Fix a bug in removing cid img without attachments | Fix a bug in removing cid img without attachments
| JavaScript | mit | AnyFetch/npm-cid |
f114a28c3c2d724712d992f7a81efa3604bcc224 | lib/index.js | lib/index.js | 'use strict'
const _ = require('lodash')
const hasLoop = (flow) => {
if (Array.isArray(flow)) {
return _validate(flow)
} else if (flow.states) {
return _validate(flow.states)
}
return {
status: "error",
message: "Flow not found!"
}
}
const _validate = (states) => {
const paths = states.r... | 'use strict'
const _ = require('lodash')
const hasLoop = (flow) => {
if (Array.isArray(flow)) {
return _validate(flow)
} else if (flow.states) {
return _validate(flow.states)
}
return {
status: "error",
message: "Flow not found!"
}
}
const _validate = (states) => {
const paths = states.r... | Fix return acc when not push a state | [UPDATE] Fix return acc when not push a state
| JavaScript | mit | josemanu/flowx-loop-validator |
ffcf2e2ff94d8abc2e2b047ccd975be7449ee198 | lib/index.js | lib/index.js | var easymongo = require('easymongo');
module.exports = function(options) {
var mongo = new easymongo(options);
return {
find: function(collection, params, options) {
return function(fn) {
mongo.find(collection, params, options, fn);
};
},
save: function(collection, params) {
... | var EasyMongo = require('easymongo');
module.exports = function(server, options) {
var mongo = new EasyMongo(server, options);
return {
find: function(table, params, options) {
return function(fn) {
mongo.find(table, params, options, fn);
};
},
findById: function(table, id) {
... | Add constructor arguments. Fix deprecated API. Add findById, removeById and count methods. | Add constructor arguments. Fix deprecated API. Add findById, removeById and count methods.
| JavaScript | mit | meritt/co-easymongo |
6c527183631acd6398ed279cb2f054a8672600c1 | tests/specs/extensible/auto-transport/main.js | tests/specs/extensible/auto-transport/main.js |
seajs.on('compiled', function(mod) {
if (mod.uri.indexOf('jquery.js') > -1) {
window.jQuery = window.$ = mod.exports
}
})
seajs.on('compile', function(mod) {
if (mod.uri.indexOf('cookie.js') > -1) {
mod.exports = $.cookie
}
})
seajs.config({
preload: ['./auto-transport/jquery']
}).use('./auto-trans... |
seajs.on('compiled', function(mod) {
if (mod.uri.indexOf('jquery.js') > -1) {
global.jQuery = global.$ = mod.exports
}
})
seajs.on('compile', function(mod) {
if (mod.uri.indexOf('cookie.js') > -1) {
mod.exports = $.cookie
}
})
seajs.config({
preload: ['./auto-transport/jquery']
}).use('./auto-trans... | Change window to global for Node.js | Change window to global for Node.js
| JavaScript | mit | coolyhx/seajs,yern/seajs,longze/seajs,MrZhengliang/seajs,lee-my/seajs,baiduoduo/seajs,liupeng110112/seajs,ysxlinux/seajs,yern/seajs,angelLYK/seajs,wenber/seajs,evilemon/seajs,wenber/seajs,miusuncle/seajs,lee-my/seajs,yuhualingfeng/seajs,LzhElite/seajs,121595113/seajs,judastree/seajs,wenber/seajs,twoubt/seajs,eleanors/S... |
f581907321b60c1bfc0db9dff09b9028a8b7f0f6 | src/styles/theme.js | src/styles/theme.js | const theme = {
color: {
grey: '#DDDDDD',
black: '#111111',
},
font: {
sans: `'Lora', sans-serif`,
serif: `'Raleway', serif`,
},
};
export default theme;
| const theme = {
color: {
grey: '#DDDDDD',
black: '#111111',
},
font: {
sans: `'Lora', sans-serif`,
serif: `'Raleway', serif`,
},
sizes: {
mobileS: '320px',
mobileM: '375px',
mobileL: '425px',
tablet: '768px',
laptop: '1024px',
laptopL: '1440px',
desktop: '2560px',
... | Add sizes to make it easier @medias | Add sizes to make it easier @medias
| JavaScript | mit | raulfdm/cv |
25a08afe9810fdd9299e5f8a51445344de560e11 | src/lib/expand-department.js | src/lib/expand-department.js | const departments = new Map(Object.entries({
AR: 'ART',
AS: 'ASIAN',
BI: 'BIO',
CH: 'CHEM',
CS: 'CSCI',
EC: 'ECON',
ES: 'ENVST',
HI: 'HIST',
MU: 'MUSIC',
PH: 'PHIL',
PS: 'PSCI',
RE: 'REL',
SA: 'SOAN',
}))
export default function expandDepartment(dept) {
if (departments.has(dept)) {
return departments.g... | const departments = new Map(Object.entries({
AR: 'ART',
AS: 'ASIAN',
BI: 'BIO',
CH: 'CHEM',
CS: 'CSCI',
EC: 'ECON',
EN: 'ENGL',
ES: 'ENVST',
HI: 'HIST',
MU: 'MUSIC',
PH: 'PHIL',
PS: 'PSCI',
RE: 'REL',
SA: 'SOAN',
}))
export default function expandDepartment(dept) {
if (departments.has(dept)) {
return ... | Add "EN" as a valid department shorthand | Add "EN" as a valid department shorthand
for the EN/LI 250 course. | JavaScript | agpl-3.0 | hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook |
2fd60c6d2599d991c8d05ad101844ea840bc1528 | js/style-select.js | js/style-select.js | /*
* style-select.js
* https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js
*
* Changes the stylesheet chooser links to a <select>
*
* Released under the MIT license
* Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org>
*
* Usage:
* $config['additional_javascript'][] = 'js... | /*
* style-select.js
* https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js
*
* Changes the stylesheet chooser links to a <select>
*
* Released under the MIT license
* Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org>
*
* Usage:
* $config['additional_javascript'][] = 'js... | Select chosen stylesheet on load | Select chosen stylesheet on load
| JavaScript | mit | kimoi/Tinyboard,savetheinternet/Tinyboard,kimoi/Tinyboard,kimoi/Tinyboard,savetheinternet/Tinyboard,savetheinternet/Tinyboard,kimoi/Tinyboard |
e661eea9ec561302f48d24dd6b8ed05d262240ad | add-jira-links-to-description.js | add-jira-links-to-description.js | (() => {
const $input = document.querySelector('#pull_request_body');
if (!$input || $input.textLength > 0) {
return;
}
jiraLinks = [];
document.querySelectorAll('.commit-message').forEach((commitMessage) => {
commitMessage.textContent.match(/BSD-\d+/g).forEach((jiraId) => {
jiraLinks.push(`[${... | (() => {
const $title = document.querySelector('#pull_request_title');
const $description = document.querySelector('#pull_request_body');
if (!$title || !$description) {
return;
}
const idSet = new Set()
document.querySelectorAll('.commit-message').forEach((commitMessage) => {
match = commitMessage... | Fix title handling for multiple tags | Fix title handling for multiple tags
| JavaScript | mit | marionm/pivotal-github-chrome,marionm/pivotal-github-chrome |
e67bf05ecc75244b5b54020939f177b715168f70 | src/components/Checkbox.js | src/components/Checkbox.js | import React from 'react'
export const Checkbox = ({ id, nodes, onToggle }) => {
const node = nodes[id]
const { key, childIds, checked } = node
const handleChange = () => {
onToggle(id)
}
return (
<React.Fragment key={id}>
{key &&
<li>
<input type='checkbox' checked={checked... | import React from 'react'
export const Checkbox = ({ id, nodes, onToggle }) => {
const node = nodes[id]
const { key, childIds, checked } = node
const handleChange = () => onToggle(id)
return (
<React.Fragment key={id}>
{key &&
<li>
<input type='checkbox' checked={checked} classNam... | Remove braces for one line functions | Remove braces for one line functions
| JavaScript | mit | joelgeorgev/react-checkbox-tree,joelgeorgev/react-checkbox-tree |
73464c8f531da3aa082f681fc263c1debcc7ad3f | app/reducers/modal/index.test.js | app/reducers/modal/index.test.js | import reducer from './';
describe('Modal reducer', () => {
let initialState;
let state;
let actionType;
let payload;
const callReducer = () => reducer(state, { type: actionType, payload });
beforeEach(() => {
initialState = {
isOpen: false,
modalName: '',
modalOptions: {}
};
... | import reducer from './';
describe('Modal reducer', () => {
let initialState;
let state;
let actionType;
let payload;
const callReducer = () => reducer(state, { type: actionType, payload });
beforeEach(() => {
initialState = {
isOpen: false,
modalName: '',
modalOptions: {}
};
... | Use initialState in Modal reducer spec | Use initialState in Modal reducer spec
| JavaScript | mit | fs/react-base,fs/react-base,fs/react-base |
9de35c415a1cb7d976e674cffe46d9e5fac7f149 | web/assets/scripts/index.js | web/assets/scripts/index.js | /**
* Created by ogiba on 20.08.2017.
*/
window.addEventListener("DOMContentLoaded", function () {
setupScrollListener();
setupAlertListener();
});
function setupScrollListener() {
var navBar = $('#nav-bar');
var titleBar = $('.app-title');
var distance = navBar.offset().top;
var titleBarDis... | /**
* Created by ogiba on 20.08.2017.
*/
window.addEventListener("DOMContentLoaded", function () {
setupScrollListener();
setupAlertListener();
});
function setupScrollListener() {
var navBar = $('#nav-bar');
var titleBar = $('.app-title');
var distance = navBar.offset().top;
var titleBarDis... | Fix setting close event error that ocurred when alert was not placed in view | [CookiesInfo] Fix setting close event error that ocurred when alert was not placed in view
| JavaScript | bsd-2-clause | ogiba/FamilyTree,ogiba/FamilyTree,ogiba/FamilyTree |
1eb106bba3da496ff732ccf02a69e72c43d55e58 | client/app/match/match.js | client/app/match/match.js | angular.module( 'moviematch.match', [] )
.controller( 'MatchController', function( $scope, Match ) {
$scope.movie = {};
$scope.session = {};
$scope.user = {};
$scope.user.name = "Julie";
$scope.session.name = "Girls Night Out";
$scope.movie = {
name: "Gone With The Wind",
year: "1939",
ratin... | angular.module( 'moviematch.match', [] )
.controller( 'MatchController', function( $scope, Match ) {
$scope.movie = {};
$scope.session = {};
$scope.user = {};
$scope.user.name = "Julie";
$scope.session.name = "Girls Night Out";
$scope.movie = {
name: "Gone With The Wind",
year: "1939",
ratin... | Make yes/no function definitions rather than function executions | Make yes/no function definitions rather than function executions
| JavaScript | mpl-2.0 | RubiginousChanticleer/rubiginouschanticleer,CantillatingZygote/rubiginouschanticleer,RubiginousChanticleer/rubiginouschanticleer,CantillatingZygote/rubiginouschanticleer |
ce4d683bf0d7a47782646fcd140db12a10583c8f | .storybook/styles.js | .storybook/styles.js | export const baseStyles = {};
export const centerStyles = {
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
};
| export const baseStyles = {
};
export const centerStyles = {
margin: '24px auto',
maxWidth: '90%',
};
| Modify baseStyles & centerStyles for a better centering of the content without flexbox | Modify baseStyles & centerStyles for a better centering of the content without flexbox
| JavaScript | mit | teamleadercrm/teamleader-ui |
0bc1c4e2a0802a90b35a438c79eee23830ee9878 | lib/worker/app-worker-info.js | lib/worker/app-worker-info.js | var AppWorkerInfo = function(appSpec, listenPort, logFilePath, exitPromise) {
this.appSpec = appSpec;
this.listenPort = listenPort;
this.logFilePath = logFilePath;
this.exitPromise = exitPromise;
};
module.exports = AppWorkerInfo;
(function() {
}).call(AppWorkerInfo.prototype); | var events = require('events');
var util = require('util');
var AppWorkerInfo = function(appSpec, listenPort, logFilePath, exitPromise) {
events.EventEmitter.call(this);
this.appSpec = appSpec;
this.listenPort = listenPort;
this.logFilePath = logFilePath;
this.exitPromise = exitPromise;
this.$refCount = 0... | Add acquire/release to worker info | Add acquire/release to worker info
| JavaScript | agpl-3.0 | githubfun/shiny-server,nvoron23/shiny-server,joequant/shiny-server,ekergy/shiny-ekergy,dpryan79/shiny-server,ekergy/shiny-ekergy,sneumann/shiny-server,nvoron23/shiny-server,sneumann/shiny-server,dpryan79/shiny-server,sneumann/shiny-server,trestletech/shiny-server,dpryan79/shiny-server,dpryan79/shiny-server,githubfun/sh... |
6e60972f8c2fc04cfe34e5afcf793e9170fe0356 | scripts/pugbomb.js | scripts/pugbomb.js | module.exports = function(robot){
var pugBombReplies = [
'There will be no more of that. Take your {{number}} pugs elsewhere.',
'Nope. Nobody needs to see that many pugs.',
'Why do you think we all need to see {{number}} pugs?',
'No pugs for you!',
'{{number}} pugs... {{number}} PUGS?? Absolutely not.'
... | module.exports = function(robot){
var pugBombReplies = [
'There will be no more of that. Take your {{number}} pugs elsewhere.',
'Nope. Nobody needs to see that many pugs.',
'Why do you think we all need to see {{number}} pugs?',
'No pugs for you!',
'{{number}} pugs... {{number}} PUGS?? Absolutely not.',
... | Add lumberg meme to pug bomb replies | Add lumberg meme to pug bomb replies
| JavaScript | mit | BallinOuttaControl/bocbot,BallinOuttaControl/bocbot |
030839d136309e814d9da289c88662c025da833f | src/extendables/SendAliases.js | src/extendables/SendAliases.js | const { APIMessage } = require('discord.js');
const { Extendable } = require('klasa');
const { TextChannel, DMChannel, GroupDMChannel, User } = require('discord.js');
module.exports = class extends Extendable {
constructor(...args) {
super(...args, { appliesTo: [TextChannel, DMChannel, GroupDMChannel, User] });
}... | const { APIMessage } = require('discord.js');
const { Extendable } = require('klasa');
const { TextChannel, DMChannel, GroupDMChannel, User } = require('discord.js');
module.exports = class extends Extendable {
constructor(...args) {
super(...args, { appliesTo: [TextChannel, DMChannel, GroupDMChannel, User] });
}... | Fix [object Object] in sendLocale extendable | Fix [object Object] in sendLocale extendable
#494 | JavaScript | mit | dirigeants/klasa |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.