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 |
|---|---|---|---|---|---|---|---|---|---|
94fe2e82ebae76a7a7066b973cfc40ba473b82dc | test/mock.js | test/mock.js | import path from 'path';
import dotenv from 'dotenv';
import popura from '../src';
import generateAuthToken from '../src/utils/generate-auth-token';
dotenv.config({
silent: false,
path: path.join(__dirname, '../.env'),
});
export const instance = popura(
process.env.MAL_USER,
process.env.MAL_PASS
);
export con... | import path from 'path';
import dotenv from 'dotenv';
import popura from '../src';
import generateAuthToken from '../src/utils/generate-auth-token';
dotenv.config({
silent: true,
path: path.join(__dirname, '../.env'),
});
export const instance = popura(
process.env.MAL_USER,
process.env.MAL_PASS
);
export cons... | Add `silent` flag so dotenv doesn't fail CI tests | Add `silent` flag so dotenv doesn't fail CI tests
| JavaScript | mit | lubien/popura |
c00c0347e6e795ecddc439eee4b3f20b8508d18b | client/app/components/App.js | client/app/components/App.js | import React from 'react';
import { Link } from 'react-router';
class App extends React.Component {
render() {
return (
<div className="app">
<h1>Welcome to KIM!</h1>
<ul className="navbar">
<li><Link to={'/jewelry'}>Jewelry Products</Link></li>
<li><Link to={'/materials... | import React from 'react';
import { Link, IndexLink } from 'react-router';
class App extends React.Component {
render() {
return (
<div className="app">
<div className="logo-wrapper">
<img className="logo" src="../../assets/WebsiteHeader.png" alt="Kristin Miller Jewelry"/>
</div>
... | Add header logo, index route, and navbar classes | Add header logo, index route, and navbar classes
| JavaScript | mit | jfanderson/KIM,jfanderson/KIM |
3fd62d301884be561d47019ca8841af86093aedc | background.js | background.js | // Copyright (c) 2015 Narwhal Software s.r.l.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
// Global accessor that the popup uses.
var pattern = /^(https?:\/\/)((doc-snapshots.qt.io)|(doc.qt.io))\/([^\/]+)\/(.*)/
chrome.runtime.onInstalled.addListener(functi... | // Copyright (c) 2015 Narwhal Software s.r.l.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
// Global accessor that the popup uses.
var pattern = /^(https?:\/\/)((doc-snapshots.qt.io)|(doc.qt.io))\/([^\/]+)\/(.*)/
chrome.runtime.onInstalled.addListener(functi... | Make sure the new url filename is lower case | Make sure the new url filename is lower case
Apparently doc.qt.io does case insensitive file matching,
doc-snapshot.qt.io doesn't.
| JavaScript | mit | narwhal/QtLatestDocs-chrome |
766034fec7d671d4901b1258269e97ae3358d265 | test/lib/prepare-spec.js | test/lib/prepare-spec.js | var expect = require('chai').expect;
var sinon = require('sinon');
var prepare = require('../../lib/prepare');
var fs = require('fs');
describe('lib/prepare', function () {
it('removes data.textPath and place the content of its file to data.text', function () {
sinon.stub(fs, 'readFileSync');
prepare({textP... | var expect = require('chai').expect;
var sinon = require('sinon');
var prepare = require('../../lib/prepare');
var fs = require('fs');
describe('lib/prepare', function () {
it('removes data.textPath and place the content of its file to data.text', function () {
var data = {
textPath: 'textPath'
};
... | Update test: check lib/prepare's file reading | Update test: check lib/prepare's file reading
| JavaScript | mit | arrowrowe/mailgun-util |
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 |
6ef08643c91f18dc92bed0b1d8c99b410c730add | src/lift.js | src/lift.js | import React from 'react'
class Observable extends React.Component {
constructor (props) {
super(props)
this.state = {value: null}
}
componentWillMount () {
this.unsubscribe = this.props.stream(value => this.setState({value}))
}
componentWillUnMount () {
this.unsubscribe()
}
render ()... | import React from 'react'
class Observable extends React.Component {
constructor (props) {
super(props)
this.state = {value: null}
}
componentWillMount () {
this.unsubscribe = this.props.stream(value => this.setState({value}))
}
componentWillUnmount () {
this.unsubscribe()
}
render ()... | Fix typo that caused streams not to unsub | Fix typo that caused streams not to unsub
| JavaScript | mit | juhohei/slope |
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 |
ee72d9510414cef2decd3f0db5e36ec4eab70127 | test/issues/0123.js | test/issues/0123.js | 'use strict';
var assert = require('assert');
var yaml = require('../../');
test('RegExps should be properly closed', function () {
assert.throws(function () { yaml.load('!!js/regexp /fo'); });
assert.throws(function () { yaml.load('!!js/regexp /fo/q'); });
assert.throws(function () { yaml.load('!!js/regexp... | 'use strict';
var assert = require('assert');
var yaml = require('../../');
test('RegExps should be properly closed', function () {
assert.throws(function () { yaml.load('!!js/regexp /fo'); });
assert.throws(function () { yaml.load('!!js/regexp /fo/q'); });
assert.throws(function () { yaml.load('!!js/regexp... | Support new (correct) RegExp.toString behavior | Support new (correct) RegExp.toString behavior
Just a fix to the test to remove spurious failure.
Fix #172
| JavaScript | mit | denji/js-yaml,isaacs/js-yaml,bjlxj2008/js-yaml,jonnor/js-yaml,joshball/js-yaml,isaacs/js-yaml,isaacs/js-yaml,minj/js-yaml,doowb/js-yaml,jonnor/js-yaml,crissdev/js-yaml,vogelsgesang/js-yaml,deltreey/js-yaml,deltreey/js-yaml,pombredanne/js-yaml,vogelsgesang/js-yaml,bjlxj2008/js-yaml,joshball/js-yaml,pombredanne/js-yaml,j... |
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 |
435462ea2d0f0545ddd930a73d0168fff0fa6c1c | tests/karma.conf.js | tests/karma.conf.js | // This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../build/webpack.test.conf')
module.exports = function (config) {
config.s... | // This is a karma config file. For more details see
// http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
// https://github.com/webpack/karma-webpack
var webpackConfig = require('../build/webpack.test.conf')
var path = require('path');
module.exports = fu... | Fix coverage output directory so it works with `karma-coveralls` | Fix coverage output directory so it works with `karma-coveralls`
| JavaScript | mit | AlbinoDrought/cachios,AlbinoDrought/cachios |
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 |
226ad96842c45597f33dc0f9c4d341caa3ffa90b | app/controller.js | app/controller.js | 'use strict';
const matchPublic = /^\s*public\s*(\S*)$/;
class Controller {
constructor() {
this.commands = [];
}
addCommand( name ) {
const Command = require( './command/' + name );
const instance = new Command( this );
this.commands.push( instance );
}
handleRequest( request ) {
const values = mat... | 'use strict';
const matchPublic = /^\s*public\s*(.*)$/;
class Controller {
constructor() {
this.commands = [];
}
addCommand( name ) {
const Command = require( './command/' + name );
const instance = new Command( this );
this.commands.push( instance );
}
handleRequest( request ) {
const values = matc... | Update public keyword regular expression. | Update public keyword regular expression.
| JavaScript | mit | pjasiun/fuma,pjasiun/fuma |
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 |
d7e63e83c3c8f9979d72358d445ae661e6e006f5 | jquery.ziptastic.js | jquery.ziptastic.js | (function( $ ) {
var requests = {};
var zipValid = {
us: /[0-9]{5}(-[0-9]{4})?/
};
$.ziptastic = function(zip, callback){
// Only make unique requests
if(!requests[zip]) {
requests[zip] = $.getJSON('http://zip.elevenbasetwo.com?zip=' + zip);
}
// Bind to the finished request
requests[zip].done(func... | (function( $ ) {
var requests = {};
var zipValid = {
us: /[0-9]{5}(-[0-9]{4})?/
};
$.ziptastic = function(zip, callback){
// Only make unique requests
if(!requests[zip]) {
requests[zip] = $.getJSON('http://zip.elevenbasetwo.com/v2/US/' + zip);
}
// Bind to the finished request
requests[zip].done(fu... | Update to use v2 of API | Update to use v2 of API | JavaScript | mit | daspecster/ziptastic-jquery-plugin,daspecster/ziptastic-jquery-plugin,Ziptastic/ziptastic-jquery-plugin,Ziptastic/ziptastic-jquery-plugin |
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... |
a62d7ba04262f803afc281e77b938a370fc3964a | src/util/request.js | src/util/request.js | 'use strict';
const http = require('http');
let request = {};
request.get = function(url) {
return new Promise((resolve, reject) => {
let req = http.get(url, (res) => {
if ([400, 401, 03, 404].includes(res.statusCode)) {
reject(new Error(`GET request to ${url} failed, status: ${res.statusCode}`))... | 'use strict';
const http = require('http');
let request = {};
request.get = function(url) {
return new Promise((resolve, reject) => {
let req = http.get(url, (res) => {
if ([400, 401, 403, 404].includes(res.statusCode)) {
reject(new Error(`GET request to ${url} failed, status: ${res.statusCode}`)... | Fix type in client error codes | Fix type in client error codes
| JavaScript | mit | FTLam11/Audio-Station-Scrobbler,FTLam11/Audio-Station-Scrobbler |
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 |
8c7e9ea3b0871989f9b7592cabf7b57b9e9f5bf6 | test/mpayrollAPI.js | test/mpayrollAPI.js | var chakram = require('chakram'),
expect = chakram.expect;
describe("mPayroll API", function() {
const empRec = {
"name": 'Harry Hourly',
"type": 'H',
"rate": '10.00'
};
it("should have POST employees endpoint", function () {
this.timeout(4000);
expect(chakram.p... | var chakram = require('chakram'),
expect = chakram.expect;
describe("mPayroll API", function() {
const empRec = {
"name": 'Harry Hourly',
"type": 'H',
"rate": '10.00'
};
it("should have POST employees endpoint", function () {
this.timeout(4000);
expect(chakram.p... | ADD - TDD for POST employees endpoint without employee data | ADD - TDD for POST employees endpoint without employee data
| JavaScript | mit | Bill-A/Correctness-DrivenDevelopment |
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 |
882b86ecb23c206d2d772a4249a767b962be4be6 | Gruntfile.js | Gruntfile.js | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
... | 'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc',
}
},
... | Increase coverage base to 100% | Increase coverage base to 100%
| JavaScript | apache-2.0 | xmpp-ftw/xmpp-ftw-http |
909b301ab3ba677210ed6cc0dfc030abad4ecda7 | rootaccountfwd.js | rootaccountfwd.js | // Replace the normal jQuery getScript function with one that supports
// debugging and which references the script files as external resources
// rather than inline.
jQuery.extend({
getScript: function(url, callback) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('... | // Replace the normal jQuery getScript function with one that supports
// debugging and which references the script files as external resources
// rather than inline.
jQuery.extend({
getScript: function(url, callback) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('... | Fix root account forward to correct js file name. | Fix root account forward to correct js file name.
| JavaScript | mit | matematikk-mooc/frontend,matematikk-mooc/frontend |
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 |
a252c7d19a9149b8c1d9bc0ec4788ae1bb3c6b22 | downloads/updates/version.js | downloads/updates/version.js | {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"de... | {
"stable": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"desc": "v1.2.1 - (1.2.0) Feature release: Custom themes, code folding and more.",
"target": "https://choicescriptide.github.io/downloads/updates/targets/121.zip"
},
"latest": {
"CSIDE_version": "1.2.1",
"nw_version": "0.21.4",
"de... | Enable v1.3.0 on the development channel | Enable v1.3.0 on the development channel | JavaScript | mit | ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io,ChoicescriptIDE/choicescriptide.github.io |
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 |
e04b74c6201a02b09ee2cfc86fe3cbb2bad500bb | examples/react/stories/index.js | examples/react/stories/index.js | import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button, Welcome } from '@storybook/react/demo';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button... | import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import { Button, Welcome } from '@storybook/react/demo';
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button... | Revert react button story to English | Revert react button story to English
| JavaScript | mit | oblador/loki,oblador/loki,oblador/loki |
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 |
a51ddfe38c359c4127c19d1096966f5090ca73e4 | config/express.js | config/express.js | // Create the application and define middleware.
'use strict';
var express = require('express');
var bodyParser = require('body-parser');
var router = require('./../app/routes')();
module.exports = function () {
var app = express();
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyPars... | // Create the application and define middleware.
'use strict';
var express = require('express');
var bodyParser = require('body-parser');
var router = require('./../app/files/routes')();
module.exports = function () {
var app = express();
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bo... | Fix reference to the routes folder of the files module. | Fix reference to the routes folder of the files module.
| JavaScript | mit | andela-ioraelosi/hackshub-file-service |
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 |
e53bbb5735497395d1ea4cb5a6c13db69792bd19 | scripts/nvim.js | scripts/nvim.js | /* eslint no-console:0 */
/**
* Spawns an embedded neovim instance and returns Neovim API
*/
const cp = require('child_process');
const attach = require('../attach');
// const inspect = require('util').inspect;
module.exports = (async function() {
let proc;
let socket;
if (process.env.NVIM_LISTEN_ADDRESS) {... | /* eslint no-console:0 */
/**
* Spawns an embedded neovim instance and returns Neovim API
*/
const cp = require('child_process');
const attach = require('../').attach;
// const inspect = require('util').inspect;
module.exports = (async function() {
let proc;
let socket;
if (process.env.NVIM_LISTEN_ADDRESS) ... | Fix import for api script | Fix import for api script
| JavaScript | mit | rhysd/node-client,neovim/node-client,neovim/node-client |
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 |
9c9365a8dbefe86a2275311b6c54a552c9640816 | lib/rules/echidna/editor-ids.js | lib/rules/echidna/editor-ids.js | 'use strict';
exports.name = "echidna.editor-ids";
exports.check = function (sr, done) {
var editorIDs = sr.$('dd[data-editor-id]').map(function(index, element) {
var strId = sr.$(element).attr('data-editor-id');
// If the ID is not a digit-only string, it gets filtered out
if (/\d+/.test... | 'use strict';
exports.name = "echidna.editor-ids";
exports.check = function (sr, done) {
var editorIDs = sr.$('dd[data-editor-id]').map(function(index, element) {
var strId = sr.$(element).attr('data-editor-id');
// If the ID is not a digit-only string, it gets filtered out
if (/\d+/.test... | Replace cheerio's deprecated toArray() with get() | Replace cheerio's deprecated toArray() with get()
| JavaScript | mit | w3c/specberus,dontcallmedom/specberus,w3c/specberus,w3c/specberus,dontcallmedom/specberus |
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 |
54aa153de51b8dffe6fa3c609b5727d843c81219 | app/ShoppingListController.js | app/ShoppingListController.js | angular.module('shoppingList').controller(
'ShoppingListController', ['$scope', '$window', function($scope, $window) {
'use strict';
var blankItem = {
name: '',
category: '',
quantity: '',
unit: '',
notes: ''
};
$scope.categories = [
'Baking',
'Beverages',
... | angular.module('shoppingList').controller(
'ShoppingListController', ['$scope', '$window', function($scope, $window) {
'use strict';
var blankItem = {
name: '',
category: '',
quantity: '',
unit: '',
notes: ''
};
$scope.categories = [
'Baking',
'Beverages',
... | Fix month in list name. | Fix month in list name.
| JavaScript | apache-2.0 | eheikes/shopping-list,eheikes/shopping-list |
2984c139a235a206c25b5c959edca77d2a10fe97 | ui/spec/utils/formattingSpec.js | ui/spec/utils/formattingSpec.js | import {formatBytes, formatRPDuration} from 'utils/formatting';
describe('Formatting helpers', () => {
describe('formatBytes', () => {
it('returns null when passed a falsey value', () => {
const actual = formatBytes(null);
expect(actual).to.equal(null);
});
it('returns the correct value whe... | import {formatBytes, formatRPDuration} from 'utils/formatting';
describe('Formatting helpers', () => {
describe('formatBytes', () => {
it('returns null when passed a falsey value', () => {
const actual = formatBytes(null);
expect(actual).to.equal(null);
});
it('returns the correct value whe... | Fix test to use ∞ | Fix test to use ∞
| JavaScript | agpl-3.0 | brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf,brianbaker/chronograf |
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 |
4aabc4665ec47172415ea66e2593840a50b08ceb | scripts/test-e2e.js | scripts/test-e2e.js | const _ = require('lodash');
const exec = require('shell-utils').exec;
const android = _.includes(process.argv, '--android');
const release = _.includes(process.argv, '--release');
const skipBuild = _.includes(process.argv, '--skipBuild');
run();
function run() {
const platform = android ? `android` : `ios`;
con... | const _ = require('lodash');
const exec = require('shell-utils').exec;
const android = _.includes(process.argv, '--android');
const release = _.includes(process.argv, '--release');
const skipBuild = _.includes(process.argv, '--skipBuild');
const headless = _.includes(process.argv, '--headless');
run();
function run(... | Add headless option to e2e android | Add headless option to e2e android
| JavaScript | mit | ceyhuno/react-native-navigation,wix/react-native-navigation,guyca/react-native-navigation,ceyhuno/react-native-navigation,chicojasl/react-native-navigation,wix/react-native-navigation,wix/react-native-navigation,thanhzusu/react-native-navigation,guyca/react-native-navigation,ceyhuno/react-native-navigation,ceyhuno/reac... |
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 |
1b3b3c836cf46b5dcf108560d116d9555860c835 | src/input.js | src/input.js | // Kind of like a singleton
const Keyboard = {
"KEY_UP": 38,
"KEY_DOWN": 40,
"KEY_LEFT": 37,
"KEY_RIGHT": 39,
"KEY_W": 87,
"KEY_A": 65,
"KEY_D": 68,
"KEY_SPACE": 32,
"keys": [],
"keydown_handler": function(evt) {
Keyboard.keys[evt.keyCode] = true;
if (evt.keyCod... | // Kind of like a singleton
const Keyboard = {
"KEY_ESC": 27,
"KEY_UP": 38,
"KEY_DOWN": 40,
"KEY_LEFT": 37,
"KEY_RIGHT": 39,
"KEY_W": 87,
"KEY_A": 65,
"KEY_D": 68,
"KEY_SPACE": 32,
"keys": [],
"nKeysDown": 0,
"keydown_handler": function(evt) {
Keyboard.nKeysDown ... | Add any key test and ESC constant | Add any key test and ESC constant
| JavaScript | mpl-2.0 | nikosandronikos/spacebattle,nikosandronikos/spacebattle |
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 |
338d11b74b6ebcbc841688d21e17a296288dba1d | src/encoding/markdownToHTML.js | src/encoding/markdownToHTML.js | import marked from 'marked';
import htmlclean from 'htmlclean';
import he from 'he';
const renderer = new marked.Renderer();
renderer.listitem = (text) => {
if (/<input[^>]+type="checkbox"/.test(text)) {
return `<li class="task-list-item">${text}</li>\n`;
}
return `<li>${text}</li>\n`;
};
renderer.code = (... | import marked from 'marked';
import htmlclean from 'htmlclean';
import he from 'he';
const renderer = new marked.Renderer();
renderer.listitem = (text) => {
if (/<input[^>]+type="checkbox"/.test(text)) {
return `<li class="task-list-item">${text}</li>\n`;
}
return `<li>${text}</li>\n`;
};
renderer.code = (... | Add line break code at end of marked custom parser result | Add line break code at end of marked custom parser result
| JavaScript | mit | oneteam-dev/draft-js-oneteam-rte-plugin,oneteam-dev/draft-js-oneteam-rte-plugin |
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 |
7cb07d2328863847644887eff660978e0699e22b | lib/post-manager.js | lib/post-manager.js | var _ = require('lodash-node/modern')
// TODO: consider passing the taxonomy types to the constructor
function PostManager() {
this.posts = []
}
PostManager.prototype.all = function() {
return posts
}
PostManager.prototype.each = function(cb) {
_.each(this.posts, cb)
}
PostManager.prototype.reset = function()... | var _ = require('lodash-node/modern')
var natural = require('natural')
var inflector = new natural.NounInflector()
// TODO: consider passing the taxonomy types to the constructor
function PostManager(taxonomyTypes) {
this.posts = []
this.taxonomyTypes = taxonomyTypes
this.taxonomies = {}
_.each(this.taxonomyTy... | Add a method to add posts to the post manager that also categorizes them by taxonomy. | Add a method to add posts to the post manager that also categorizes them by taxonomy.
| JavaScript | mit | philipwalton/ingen |
c59d6500c9bad9d0c2b3745c71010797c4a107fc | lib/query-parser.js | lib/query-parser.js | 'use strict'
/**
* @license
* node-scrapy <https://github.com/eeshi/node-scrapy>
* Copyright Stefan Maric, Adrian Obelmejias, and other contributors <https://github.com/eeshi/node-scrapy/graphs/contributors>
* Released under MIT license <https://github.com/eeshi/node-scrapy/blob/master/LICENSE>
*/
module.exports... | 'use strict'
/**
* @license
* node-scrapy <https://github.com/eeshi/node-scrapy>
* Copyright Stefan Maric, Adrian Obelmejias, and other contributors <https://github.com/eeshi/node-scrapy/graphs/contributors>
* Released under MIT license <https://github.com/eeshi/node-scrapy/blob/master/LICENSE>
*/
module.exports... | Exclude filter expression from selector | Exclude filter expression from selector
| JavaScript | mit | eeshi/node-scrapy |
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... |
19ba468f68bab037a04277edae68fc94e89378e5 | lib/ui/dashboard.js | lib/ui/dashboard.js | var express = require('express');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var serveStatic = require('serve-static');
var errorhandler = require('errorhandler');
var less = require('less-middleware');
var path = require('path');
exports.register = function(application, ... | var express = require('express');
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var serveStatic = require('serve-static');
var errorhandler = require('errorhandler');
var less = require('less-middleware');
var path = require('path');
exports.register = function(application, ... | Use bodyParser.json() instead of bodyParser itself. | Use bodyParser.json() instead of bodyParser itself.
See: http://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4
| JavaScript | mit | KitaitiMakoto/express-droonga,droonga/express-droonga,droonga/express-droonga,KitaitiMakoto/express-droonga |
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 |
811816ad35cda5c1baa16d00ed20276faa052401 | webpack.config.js | webpack.config.js | var webpack = require("webpack");
/* eslint-disable no-undef */
var environment = process.env["NODE_ENV"] || "development";
module.exports = {
entry: "./src/game",
output: {
path: __dirname + "/build",
filename: "index.js"
},
module: {
preLoaders: [
// { test: /\.js$/, exclude: /node_modules/, loader: "e... | var webpack = require("webpack");
/* eslint-disable no-undef */
var environment = process.env["NODE_ENV"] || "development";
module.exports = {
entry: "./src/game",
output: {
path: __dirname + "/build",
filename: "index.js"
},
module: {
preLoaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: "esli... | Use eslint inside of webpack | Use eslint inside of webpack
| JavaScript | mit | RiseAndShineGames/BugCatcher,RiseAndShineGames/LudumDare35,RiseAndShineGames/Polymorphic,RiseAndShineGames/Polymorphic,RiseAndShineGames/BugCatcher,CaldwellYSR/Bug_Catcher,RiseAndShineGames/LudumDare35,SplatJS/splat-ecs-starter-project,SplatJS/splat-ecs-starter-project,CaldwellYSR/Bug_Catcher |
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 |
d151aed6079c78314f2192a551c49d3fbd2e44d5 | webpack.config.js | webpack.config.js | 'use strict';
const webpack = require('webpack');
const env = process.env.NODE_ENV || 'development';
const isDev = env === 'development';
const devtool = isDev ? '#inline-source-map' : null;
const uglify = isDev ? null : new webpack.optimize.UglifyJsPlugin({
output: {
comments: false
},
compress: {
dead_code: ... | 'use strict';
const webpack = require('webpack');
const env = process.env.NODE_ENV || 'development';
const isDev = env === 'development';
const devtool = isDev ? '#inline-source-map' : null;
const uglify = isDev ? null : new webpack.optimize.UglifyJsPlugin({
output: {
comments: false
},
compress: {
dead_code: ... | Add renderer setting for electron | Add renderer setting for electron
| JavaScript | mit | akameco/PixivDeck,akameco/PixivDeck |
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 |
17455c2529c6dcbbee0fc21c8a89546be9472790 | src/ol/colorlike.js | src/ol/colorlike.js | /**
* @module ol/colorlike
*/
import {asString} from './color.js';
/**
* @param {ol.Color|ol.ColorLike} color Color.
* @return {ol.ColorLike} The color as an ol.ColorLike
* @api
*/
export function asColorLike(color) {
if (isColorLike(color)) {
return /** @type {string|CanvasPattern|CanvasGradient} */ (col... | /**
* @module ol/colorlike
*/
import {toString} from './color.js';
/**
* @param {ol.Color|ol.ColorLike} color Color.
* @return {ol.ColorLike} The color as an ol.ColorLike
* @api
*/
export function asColorLike(color) {
if (isColorLike(color)) {
return /** @type {string|CanvasPattern|CanvasGradient} */ (col... | Use toString instead of asString in asColorLike | Use toString instead of asString in asColorLike
To avoid the double `typeof color === 'string'` check
| JavaScript | bsd-2-clause | ahocevar/ol3,stweil/openlayers,fredj/ol3,gingerik/ol3,mzur/ol3,openlayers/openlayers,stweil/ol3,oterral/ol3,stweil/openlayers,adube/ol3,ahocevar/ol3,stweil/ol3,geekdenz/ol3,mzur/ol3,fredj/ol3,tschaub/ol3,bjornharrtell/ol3,geekdenz/openlayers,fredj/ol3,geekdenz/openlayers,geekdenz/ol3,stweil/openlayers,tschaub/ol3,oterr... |
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.