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 |
|---|---|---|---|---|---|---|---|---|---|
a185960250cf95592867d23c402f033eafbba88a | src/js/viewmodels/message-dialog.js | src/js/viewmodels/message-dialog.js | /*
* Copyright 2015 Vivliostyle Inc.
*
* This file is part of Vivliostyle UI.
*
* Vivliostyle UI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) a... | /*
* Copyright 2015 Vivliostyle Inc.
*
* This file is part of Vivliostyle UI.
*
* Vivliostyle UI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) a... | Use `Error.toString` for a displayed message whenever possible | Use `Error.toString` for a displayed message whenever possible
| JavaScript | agpl-3.0 | vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle-ui,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle-ui,vivliostyle/vivliostyle-ui,vivliostyle/vivliostyle-ui |
acda2674e43657112a621ad9b78527828ed3a60d | data/componentData.js | data/componentData.js | /**
* Transfer component data from .mxt to json
*/
var fs = require('fs');
var path = require('path');
var componentDataPath = './componentdata.tmp';
fs.readFile(componentDataPath, { encoding : 'utf-8' }, function (err, data) {
if(err) return console.log(err);
var lines = data.split('\n');
var categories =... | /**
* Transfer component data from .mxt to json
*/
var fs = require('fs');
var path = require('path');
var componentDataPath = './componentdata.tmp';
fs.readFile(componentDataPath, { encoding : 'utf-8' }, function (err, data) {
if(err) return console.log(err);
var lines = data.split('\n');
var categories =... | Use a better structure for components | Use a better structure for components
| JavaScript | mit | lukkari/sync,lukkari/sync |
cf183c2065926aeb8011e5bf6b1e472e53290dcf | example/build.js | example/build.js | var path = require("path");
var Interlock = require("..");
var ilk = new Interlock({
srcRoot: __dirname,
destRoot: path.join(__dirname, "dist"),
entry: {
"./app/entry-a.js": "entry-a.bundle.js",
"./app/entry-b.js": { dest: "entry-b.bundle.js" }
},
split: {
"./app/shared/lib-a.js": "[setHash].js... | var path = require("path");
var Interlock = require("..");
var ilk = new Interlock({
srcRoot: __dirname,
destRoot: path.join(__dirname, "dist"),
entry: {
"./app/entry-a.js": "entry-a.bundle.js",
"./app/entry-b.js": { dest: "entry-b.bundle.js" }
},
split: {
"./app/shared/lib-a.js": "[setHash].js... | Remove `cacheMode` top-level property - this will be accomplished through plugin. | Remove `cacheMode` top-level property - this will be accomplished through plugin.
| JavaScript | mit | interlockjs/interlock,interlockjs/interlock |
22342e24bbdf38a287dc91bf5dcd1778bc364a01 | src/containers/Invite/services/inviteAction.js | src/containers/Invite/services/inviteAction.js | import { callController } from '../../../util/apiConnection'
export const acceptThesis = token => callController(`/invite/thesis/${token}`, 'INVITE_ACCEPT_THESIS_')
export const acceptRole = token => callController(`/invite/role/${token}`, 'INVITE_ACCEPT_ROLE_')
| import { callController } from '../../../util/apiConnection'
const prefix = process.env.NODE_ENV === 'development' ? '' : '../..'
export const acceptThesis = token => callController(`${prefix}/invite/thesis/${token}`, 'INVITE_ACCEPT_THESIS_')
export const acceptRole = token => callController(`${prefix}/invite/role/${... | Fix thesis invite on staging. | Fix thesis invite on staging.
| JavaScript | mit | OhtuGrappa2/front-grappa2,OhtuGrappa2/front-grappa2 |
13f5e45e847231f1597a2e751b87c1f98d9f17e7 | Resources/Public/Javascripts/Main.js | Resources/Public/Javascripts/Main.js | /**
* RequireJS configuration
* @description Pass in options for RequireJS like paths, shims or the baseUrl
*/
require.config({
paths: { }
});
/**
* RequireJS calls
* @description Call the needed AMD modules.
*/
require(['Modules/Main'], function(MainFn) {
new MainFn;
});
| /**
* RequireJS configuration
* @description Pass in options for RequireJS like paths, shims or the baseUrl
*/
require.config({
paths: { },
// Append a date on each requested script to prevent caching issues.
urlArgs: 'bust=' + (new Date()).getDate()
});
/**
* RequireJS calls
* @description Call the needed A... | Append a date on each requested requireJS module to prevent caching issues | [TASK] Append a date on each requested requireJS module to prevent caching issues
| JavaScript | mit | t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template |
c12248d8dc4962ed56de67eed74d4a2fcc43338a | lib/compile/bundles/bootstrap.js | lib/compile/bundles/bootstrap.js | import most from "most";
import * as Pluggable from "../../pluggable";
import resolveAsset from "../modules/resolve";
import loadAst from "../modules/load-ast";
import { entries } from "../../util";
const bootstrapBundle = Pluggable.sync(function bootstrapBundle (srcPath, definition, isEntryPt) {
const asset = thi... | import most from "most";
import * as Pluggable from "../../pluggable";
import resolveAsset from "../modules/resolve";
import loadAst from "../modules/load-ast";
import { entries } from "../../util";
const bootstrapBundle = Pluggable.sync(function bootstrapBundle (srcPath, definition, isEntryPt) {
const asset = thi... | Fix runtime inclusion after API changes. | Fix runtime inclusion after API changes.
| JavaScript | mit | interlockjs/interlock,interlockjs/interlock |
0323861f7315467b7fd143e1d2e831b62034d479 | src/react-chayns-personfinder/utils/getList.js | src/react-chayns-personfinder/utils/getList.js | export default function getList(data, orm, inputValue) {
let retVal = [];
if (Array.isArray(orm.groups)) {
orm.groups.forEach(({ key, show }) => {
if (!(typeof show === 'function' && !show(inputValue))) {
const list = data[key];
retVal = retVal.concat(list);
... | import { isFunction } from '../../utils/is';
export default function getList(data, orm, inputValue) {
let retVal = [];
if (Array.isArray(orm.groups)) {
orm.groups.forEach(({ key, show }) => {
if (!(isFunction(show) && !show(inputValue) && (!isFunction(orm.filter) || orm.filter(inputValue)))... | Fix bug that personFinder used unfiltered list | :bug: Fix bug that personFinder used unfiltered list
| JavaScript | mit | TobitSoftware/chayns-components,TobitSoftware/chayns-components,TobitSoftware/chayns-components |
f891afa4f3c6bc12b5c39b10241801e4935f7eca | index.js | index.js | 'use strict';
var ect = require('ect');
exports.name = 'ect';
exports.outputFormat = 'html';
exports.compile = function(str, options) {
if (!options) {
options = {};
}
if (!options.root) {
options.root = {
'page': str
};
}
var engine = ect(options);
return function(locals) {
return e... | 'use strict';
var ect = require('ect');
exports.name = 'ect';
exports.outputFormat = 'html';
exports.compile = function(str, options) {
options = options || {};
options.root = options.root || {};
options.root.page = str;
var engine = ect(options);
return function(locals) {
return engine.render('page', ... | Fix the if statement syntax | Fix the if statement syntax | JavaScript | mit | jstransformers/jstransformer-ect,jstransformers/jstransformer-ect |
f5ee0cd3d94bf8a51b752d40d0d67dccf7e3524b | sandcats/sandcats.js | sandcats/sandcats.js | if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client pi... | if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client pi... | Make front page redirect to wiki | Make front page redirect to wiki
| JavaScript | apache-2.0 | sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats |
c666013ca38766fc1d1fb2e3d149a820c406df63 | backend/server/resources/projects-routes.js | backend/server/resources/projects-routes.js | module.exports = function(model) {
'use strict';
let validateProjectAccess = require('./project-access')(model.access);
let schema = require('.././schema')(model);
let router = require('koa-router')();
let projects = require('./projects')(model.projects);
let samples = require('./samples')(mode... | module.exports = function(model) {
'use strict';
let validateProjectAccess = require('./project-access')(model.access);
let schema = require('.././schema')(model);
let router = require('koa-router')();
let projects = require('./projects')(model.projects);
let samples = require('./samples')(mode... | Add REST call for files. | Add REST call for files.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
845478266066fe205560ae442bb7a38388884d9e | backend/helpers/groupByDuplicatesInArray.js | backend/helpers/groupByDuplicatesInArray.js | // Count duplicate keys within an array
// ------------------------------------------------------------
module.exports = function(array) {
if(array.length === 0) {
return null;
}
var counts = {};
array.forEach(function(x) {
counts[x] = (counts[x] || 0) + 1;
});
return counts;
};
| import sortObjByOnlyKey from "./sortObjByOnlyKey";
// Count duplicate keys within an array
// ------------------------------------------------------------
const groupByDuplicatesInArray = array => {
if(array.length === 0) {
return null;
}
var counts = {};
array.forEach(function(x) {
counts[x] = (counts... | Sort object by keys to avoid problems with 'addEmptyDays' util | :bug: Sort object by keys to avoid problems with 'addEmptyDays' util
| JavaScript | mit | dreamyguy/gitinsight,dreamyguy/gitinsight,dreamyguy/gitinsight |
00642cb34569c9ca324b11637b83ea53f5c34216 | binary-search-tree.js | binary-search-tree.js | // Program that creates a binary search tree: each node has up to two children, and all left descendants of a node is less than or equal to the node and all right descendants are greater than the node
| // Program that creates a binary search tree: each node has up to two children, and all left descendants of a node is less than or equal to the node and all right descendants are greater than the node
// create node
function Node(val) {
this.value = val;
this.left = null;
this.right = null;
}
| Create node in binary search tree program | Create node in binary search tree program
| JavaScript | mit | derekmpham/interview-prep,derekmpham/interview-prep |
397836570354391affaaee1dd222dd3e5caaa14f | index.js | index.js | 'use strict';
const buble = require('buble');
class BrunchBuble {
constructor({ plugins: { buble } }) {
this.config = buble || {};
}
compile({ data }) {
try {
const { code } = buble.transform(data, this.config);
return Promise.resolve(code);
} catch (error) {
return Promise.reject... | 'use strict';
const buble = require('buble');
class BrunchBuble {
constructor(config) {
this.config = config && config.plugins && config.plugins.buble || {};
}
compile(file) {
try {
const transform = buble.transform(file.data, this.config);
return Promise.resolve(transform.code);
} catc... | Improve the compatibility with older versions of node | Improve the compatibility with older versions of node
| JavaScript | mit | aMarCruz/buble-brunch |
c94b93e87e1364fab1f232995d3d8b2ebb64b241 | index.js | index.js | var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.pro... | var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.pro... | Use ES5 functions instead of arrow functions | Use ES5 functions instead of arrow functions | JavaScript | mit | smirzaei/currency-formatter,enVolt/currency-formatter |
6eb15445636e3dcb1901edf9b32aab3216651365 | index.js | index.js | var chalk = require('chalk');
var gutil = require('gulp-util');
var spawn = require('gulp-spawn');
var through = require('through2');
var ts2dart = require('ts2dart');
var which = require('which');
exports.transpile = function() {
var hadErrors = false;
return through.obj(
function(file, enc, done) {
... | var chalk = require('chalk');
var gutil = require('gulp-util');
var spawn = require('gulp-spawn');
var through = require('through2');
var ts2dart = require('ts2dart');
var which = require('which');
exports.transpile = function() {
var hadErrors = false;
return through.obj(
function(file, enc, done) {
... | Adjust to ts2dart change of filename handling. | Adjust to ts2dart change of filename handling.
| JavaScript | apache-2.0 | dart-archive/gulp-ts2dart,dart-archive/gulp-ts2dart |
4bca760f4b165dc66de6057f9ea9f4ae40773927 | index.js | index.js |
console.log('loading electron-updater-sample-plugin...')
function plugin(context) {
console.log('loaded electron-updater-sample-plugin!')
}
module.exports = plugin |
console.log('loading electron-updater-sample-plugin...')
function plugin(context) {
var d = context.document
var ul = d.getElementById('plugins')
var li = d.createElement('li')
li.innerHTML = 'electron-updater-sample-plugin'
ul.appendChild(li)
}
module.exports = plugin | Add to the sample apps ul | Add to the sample apps ul
| JavaScript | mit | EvolveLabs/electron-updater-sample-plugin |
d4af65ae7a3c7228ab96396522fe8c21f2f67331 | src/server/services/redditParser.js | src/server/services/redditParser.js | import fs from 'fs'
export function parseBoardList(boardList) {
// console.log(JSON.stringify(boardList))
try {
boardList.data.children
} catch (e) {
log.error(`Bad reddit data returned => ${e}`)
}
const boards = boardList.data.children.map(board => board.data) // thanks, reddit!
... | import fs from 'fs'
export function parseBoardList(boardList) {
// console.log(JSON.stringify(boardList))
try {
boardList.data.children
} catch (e) {
log.error(`Bad reddit data returned => ${e}`)
}
const boards = boardList.data.children.map(board => board.data) // thanks, reddit!
... | Remove '/r/' from reddit board list | Remove '/r/' from reddit board list
| JavaScript | mit | AdamSalma/Lurka,AdamSalma/Lurka |
d1fe3fe748b9ca8c640f785c6f3779451cdbde68 | index.js | index.js | var config = require('./config'),
rest = require('./rest'),
projects = require('./projects');
module.exports.init = function () {
/**
* Load config variables as environment variables
*/
for (envVar in config) {
if (config.hasOwnProperty(envVar)) {
process.env[envVar] = co... | var config = require('./config'),
rest = require('./rest'),
apiUrl = require('./apiUrl'),
projects = require('./projects');
module.exports.init = function () {
/**
* Load config variables as environment variables
*/
for (envVar in config) {
if (config.hasOwnProperty(envVar)) {
... | Load new apiUrl module in ac module base | Load new apiUrl module in ac module base
| JavaScript | mit | mediasuitenz/node-activecollab |
406218069f7083816acee50367f7ca88fb4355c5 | server/db/graphDb.js | server/db/graphDb.js | if (process.env.NODE_ENV !== 'production') require('../../secrets');
const neo4j = require('neo4j-driver').v1;
if (process.env.NODE_ENV === 'production') {
const graphDb = neo4j.driver(
process.env.GRAPHENEDB_BOLT_URL,
neo4j.auth.basic(process.env.GRAPHENEDB_BOLT_USER, process.env.GRAPHENEDB_BOLT_PASSWORD)
... | if (process.env.NODE_ENV !== 'production') require('../../secrets');
const neo4j = require('neo4j-driver').v1;
if (process.env.NODE_ENV === 'production') {
const graphDb = neo4j.driver(
process.env.GRAPHENEDB_BOLT_URL,
neo4j.auth.basic(process.env.GRAPHENEDB_BOLT_USER, process.env.GRAPHENEDB_BOLT_PASSWORD)
... | Debug deployment and setting of node env variables | Debug deployment and setting of node env variables
| JavaScript | mit | wordupapp/wordup,wordupapp/wordup |
d92b18cddf1a23fbbf2edf6e6cf0ca57d374d3e5 | index.js | index.js | (function (root, factory) {
'use strict';
/* global define, module, require */
if (typeof define === 'function' && define.amd) { // AMD
define(['./lib/Dice', './lib/inventory', './lib/modifiers', './lib/ProtoTree', './lib/random', './lib/requirements'], factory);
} else if (typeof exports === '... | (function (root, factory) {
'use strict';
/* global define, module, require */
if (typeof define === 'function' && define.amd) { // AMD
define(['./lib/Dice', './lib/inventory', './lib/modifiers', './lib/ProtoTree', './lib/random', './lib/requirements'], factory);
} else if (typeof exports === '... | Fix incorrect import of modules n commonjs env | Fix incorrect import of modules n commonjs env
| JavaScript | mit | hogart/rpg-tools |
485849e4d89287c4a0ac21f23e82bd9c22cfe3e5 | querylang/index.js | querylang/index.js | import query from './query.pegjs';
export function parseToAst (string) {
return query.parse(string);
}
const opfunc = {
'<=': function (x, y) {
return x <= y;
},
'<': function (x, y) {
return x < y;
},
'>=': function (x, y) {
return x >= y;
},
'>': function (x, y) {
return x > y;
... | import query from './query.pegjs';
export function parseToAst (string) {
return query.parse(string);
}
| Remove astToFunction from JavaScript code | Remove astToFunction from JavaScript code
| JavaScript | apache-2.0 | ronichoudhury-work/resonantlab,ronichoudhury-work/resonantlab,ronichoudhury-work/resonantlab,ronichoudhury-work/resonantlab |
4bddfa56144fd2302ef80c3d41d86d329140ea8c | index.js | index.js | let Scanner = require('./lib/scanner.js');
let Parser = require('./lib/parser.js');
let Packer = require('./lib/packer.js');
module.exports = {
scan: Scanner.scan,
parse: Parser.parse,
pack: Packer.pack
};
| let Scanner = require('./lib/scanner.js');
let Parser = require('./lib/parser.js');
let Packer = require('./lib/packer.js');
let Executor = require('./lib/executor.js');
module.exports = {
scan: Scanner.scan,
parse: Parser.parse,
pack: Packer.pack,
unpack: Packer.unpack,
execute: Executor.execute
}... | Add unpack() to the public interface | Add unpack() to the public interface
| JavaScript | mit | cranbee/template,cranbee/template |
13e72c4b5b4b5f57ef517baefbc28f019e00d026 | src/Native/Global.js | src/Native/Global.js | const _elm_node$core$Native_Global = function () {
const Err = _elm_lang$core$Result$Err
const Ok = _elm_lang$core$Result$Ok
// parseInt : Int -> String -> Result Decode.Value Int
const parseInt = F2((radix, string) => {
try {
// radix values integer from 2-36
const val... | const _elm_node$core$Native_Global = function () {
const Err = _elm_lang$core$Result$Err
const Ok = _elm_lang$core$Result$Ok
// parseInt : Int -> String -> Result Decode.Value Int
const parseInt = F2((radix, string) => {
try {
// NOTE radix can be any integer from 2-36
... | Add check for NaN in parseInt native code. | Add check for NaN in parseInt native code.
| JavaScript | unlicense | elm-node/core |
91da0f03a2cebcd09ce3e6a72a4cbad9f899f0b3 | _js/utils/get-url-parameter.js | _js/utils/get-url-parameter.js | import URI from 'urijs';
/**
* Return a URL parameter.
*/
const getUrlParameter = function(url, param, type) {
const uri = new URI(url),
query = URI.parseQuery(uri.query());
if (!uri.hasQuery(param)) {
throw new Error(`Parameter "${param}" missing from URL`);
}
if (type == 'int') ... | import URI from 'urijs';
/**
* Return a URL parameter.
*/
const getUrlParameter = function(url, param, type) {
const uri = new URI(url),
query = URI.parseQuery(uri.query());
if (!uri.hasQuery(param)) {
return null;
}
if (type == 'int') {
if (isNaN(parseInt(query[param]))) ... | Return null of param not found | Return null of param not found
| JavaScript | mit | alexandermendes/tei-viewer,alexandermendes/tei-viewer,alexandermendes/tei-viewer |
d72da7c135bbf9441e22b1a54a6e30f169872004 | seeds/4_publishedProjects.js | seeds/4_publishedProjects.js | exports.seed = function(knex, Promise) {
return Promise.join(
knex('publishedProjects').insert({
title: 'sinatra-contrib',
tags: 'ruby, sinatra, community, utilities',
description: 'Hydrogen atoms Sea of Tranquility are creatures of the cosmos shores of the cosmic ocean.',
date_created: '2... | exports.seed = function(knex, Promise) {
return Promise.join(
knex('publishedProjects').insert({
title: 'sinatra-contrib',
tags: 'ruby, sinatra, community, utilities',
description: 'Hydrogen atoms Sea of Tranquility are creatures of the cosmos shores of the cosmic ocean.',
date_created: '2... | Fix race condition between updating project before creating corresponding published project | Fix race condition between updating project before creating corresponding published project
| JavaScript | mpl-2.0 | mozilla/publish.webmaker.org,sedge/publish.webmaker.org,mozilla/publish.webmaker.org,Pomax/publish.webmaker.org,Pomax/publish.webmaker.org,sedge/publish.webmaker.org,sedge/publish.webmaker.org,mozilla/publish.webmaker.org,Pomax/publish.webmaker.org |
3f9c0f33d1848a1b28c202868a0f58a257232d0a | index.js | index.js | /**
* Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}
*
* @module turf/featurecollection
* @category helper
* @param {Feature} features input Features
* @returns {FeatureCollection} a FeatureCollection of input features
* @example
* var features = [
* turf.point([-75.343, 39... | /**
* Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}
*
* @module turf/featurecollection
* @category helper
* @param {Feature<(Point|LineString|Polygon)>} features input features
* @returns {FeatureCollection<(Point|LineString|Polygon)>} a FeatureCollection of input features
* ... | Switch doc to closure compiler templating | Switch doc to closure compiler templating
| JavaScript | mit | Turfjs/turf-featurecollection |
1334e33b73f465803b96d847b61f743cdabf566f | lib/utils.js | lib/utils.js | /**
* Helper functions
*/
'use strict';
module.exports = {
parseVideoUrl(url) {
function getIdFromUrl(url, re) {
let matches = url.match(re);
return (matches && matches[1]) || null;
}
let id;
// https://www.youtube.com/watch?v=24X9FpeSASY
if (url.indexOf('youtube.com/') > -1) {
id = getIdFromUr... | /**
* Helper functions
*/
'use strict';
module.exports = {
parseVideoUrl(url) {
function getIdFromUrl(url, re) {
let matches = url.match(re);
return (matches && matches[1]) || null;
}
let id;
// https://www.youtube.com/watch?v=24X9FpeSASY
// http://stackoverflow.com/questions/5830387/how-to-find-a... | Allow underscores and hyphens in Youtube video ID | Allow underscores and hyphens in Youtube video ID
Fixes #122
| JavaScript | bsd-2-clause | macbre/nodemw |
554ceb2837c9f71f6454b34a75769fa05ecb25d2 | lib/message.js | lib/message.js | function Message(queue, message, headers, deliveryInfo) {
// Crane uses slash ('/') separators rather than period ('.')
this.queue = deliveryInfo.queue.replace(/\./g, '/');
this.headers = {};
if (deliveryInfo.contentType) { headers['content-type'] = deliveryInfo.contentType; }
this.body = message;
this._... | function Message(queue, message, headers, deliveryInfo) {
// Crane uses slash ('/') separators rather than period ('.')
this.topic = deliveryInfo.routingKey.replace(/\./g, '/');
this.headers = {};
if (deliveryInfo.contentType) { headers['content-type'] = deliveryInfo.contentType; }
this.body = message;
}
mo... | Set topic based on routing key. | Set topic based on routing key.
| JavaScript | mit | jaredhanson/antenna-amqp |
4c3d453b2c880b9d7773f9c15184401b78a03092 | test/extractors/spectralKurtosis.js | test/extractors/spectralKurtosis.js | var chai = require('chai');
var assert = chai.assert;
var TestData = require('../TestData');
// Setup
var spectralKurtosis = require('../../dist/node/extractors/spectralKurtosis');
describe('spectralKurtosis', function () {
it('should return correct Spectral Kurtosis value', function (done) {
var en = spectralK... | var chai = require('chai');
var assert = chai.assert;
var TestData = require('../TestData');
// Setup
var spectralKurtosis = require('../../dist/node/extractors/spectralKurtosis');
describe('spectralKurtosis', function () {
it('should return correct Spectral Kurtosis value', function (done) {
var en = spectralK... | Modify test for approximate equality | Modify test for approximate equality
A change in Node 12 means that the test value we were previously using differs from the new result by `2.7755575615628914e-17`. | JavaScript | mit | meyda/meyda,hughrawlinson/meyda,meyda/meyda,meyda/meyda |
3cbf626c27f8cfd777b99265f5f2f9f356466943 | client/app/scripts/filters.js | client/app/scripts/filters.js | /*global Showdown */
'use strict';
angular.module('memoFilters', [])
.filter('markdown', function ($sce) {
// var converter = new Showdown.converter({ extensions: ['github', 'youtube'] });
var marked = window.marked;
var hljs = window.hljs;
marked.setOptions({
highlight: function (code, lang)... | /*global Showdown */
'use strict';
angular.module('memoFilters', [])
.filter('markdown', function ($sce) {
// var converter = new Showdown.converter({ extensions: ['github', 'youtube'] });
var marked = window.marked;
var hljs = window.hljs;
marked.setOptions({
highlight: function (code, lang)... | Fix an issue to show code without language option | Fix an issue to show code without language option
| JavaScript | mit | eqot/memo |
a8689937a9f202e5efd4a003435fd6e3652ef72c | lib/service.js | lib/service.js | var ts = require('typescript');
var process = require('process');
var IncrementalChecker = require('./IncrementalChecker');
var CancellationToken = require('./CancellationToken');
var checker = new IncrementalChecker(
process.env.TSCONFIG,
process.env.TSLINT === '' ? false : process.env.TSLINT,
process.env.WATCH... | var ts = require('typescript');
var process = require('process');
var IncrementalChecker = require('./IncrementalChecker');
var CancellationToken = require('./CancellationToken');
var checker = new IncrementalChecker(
process.env.TSCONFIG,
process.env.TSLINT === '' ? false : process.env.TSLINT,
process.env.WATCH... | Simplify pass through of CHECK_SYNTACTIC_ERRORS | Simplify pass through of CHECK_SYNTACTIC_ERRORS | JavaScript | mit | Realytics/fork-ts-checker-webpack-plugin,Realytics/fork-ts-checker-webpack-plugin |
9acb0f7396da889dab0182cd22ba2d7f91883c82 | build.js | build.js | let fs = require('fs');
let mkdirp = require('mkdirp');
let sass = require('node-sass');
sass.render({
file: 'sass/matter.sass',
}, function (renderError, result) {
if (renderError) {
console.log(renderError);
} else {
mkdirp('dist/css', function (mkdirError) {
if (mkdirError) {
console.log... | let fs = require('fs');
let mkdirp = require('mkdirp');
let sass = require('node-sass');
sass.render({
file: 'sass/matter.sass',
indentedSyntax: true,
outputStyle: 'expanded',
}, function (renderError, result) {
if (renderError) {
console.log(renderError);
} else {
mkdirp('dist/css', function (mkdirE... | Use expanded style in rendered css | Use expanded style in rendered css
| JavaScript | mit | yusent/matter,yusent/matter |
2251a3d504b511aebd3107c8a7c94da14cbbea1a | config/environment.js | config/environment.js | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'smallprint',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-... | /* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'smallprint',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-... | Stop console error about content security policy | Stop console error about content security policy
| JavaScript | mit | Br3nda/priv-o-matic,OPCNZ/priv-o-matic,Br3nda/priv-o-matic,OPCNZ/priv-o-matic |
0fef1857715cc92e6f8f58576b039b39f2ff1038 | lib/assert-paranoid-equal/utilities.js | lib/assert-paranoid-equal/utilities.js | 'use strict';
function isNothing(subject) {
return (undefined === subject) || (null === subject);
}
function isObject(subject) {
return ('object' === typeof subject) && (null !== subject);
}
function isNaNConstant(subject) {
// There is not Number.isNaN in Node 0.6.x
return ('number' === typeof subject) &... | 'use strict';
function isNothing(subject) {
return (undefined === subject) || (null === subject);
}
function isObject(subject) {
return ('object' === typeof subject) && (null !== subject);
}
function isNaNConstant(subject) {
if (undefined !== Number.isNaN) {
return Number.isNaN(subject);
} else {
... | Use `Number.isNaN` when it's available. | Use `Number.isNaN` when it's available.
| JavaScript | mit | dervus/assert-paranoid-equal |
9c01da3c20f726f78308381e484f4c9b53396dae | src/exchange-main.js | src/exchange-main.js | 'use babel'
import {Disposable, CompositeDisposable} from 'sb-event-kit'
import Communication from 'sb-communication'
class Exchange {
constructor(worker) {
this.worker = worker
this.port = worker.port || worker
this.communication = new Communication()
this.subscriptions = new CompositeDisposable()... | 'use babel'
import {Disposable, CompositeDisposable} from 'sb-event-kit'
import Communication from 'sb-communication'
class Exchange {
constructor(worker) {
this.worker = worker
this.port = worker.port || worker
this.communication = new Communication()
this.subscriptions = new CompositeDisposable()... | Send a ping on worker init This fixes non-shared workers | :bug: Send a ping on worker init
This fixes non-shared workers
| JavaScript | mit | steelbrain/Worker-Exchange,steelbrain/Worker-Exchange |
14b277eb296e9cc90f8d70fc82e07128f432adb2 | addon/component.js | addon/component.js | import ClickOutsideMixin from './mixin';
import Component from '@ember/component';
import { on } from '@ember/object/evented';
import { next, cancel } from '@ember/runloop';
import $ from 'jquery';
export default Component.extend(ClickOutsideMixin, {
clickOutside(e) {
if (this.isDestroying || this.isDestroyed) ... | import ClickOutsideMixin from './mixin';
import Component from '@ember/component';
import { next, cancel } from '@ember/runloop';
import $ from 'jquery';
export default Component.extend(ClickOutsideMixin, {
clickOutside(e) {
if (this.isDestroying || this.isDestroyed) {
return;
}
const exceptSelec... | Fix lifecycle events to satisfy recommendations | Fix lifecycle events to satisfy recommendations
| JavaScript | mit | zeppelin/ember-click-outside,zeppelin/ember-click-outside |
f547c16a9648ad15265283ed856352b73aadc69d | src/server/server.js | src/server/server.js | const express = require('express');
const cors = require('cors');
const session = require('express-session');
const bodyParser = require('body-parser');
const authMiddleware = require('./authMiddleware');
const auth = require('./controllers/auth');
const documents = require('./controllers/documents');
const deadlines ... | const express = require('express');
const cors = require('cors');
const session = require('express-session');
const bodyParser = require('body-parser');
const authMiddleware = require('./authMiddleware');
const auth = require('./controllers/auth');
const documents = require('./controllers/documents');
const deadlines ... | Set maxAge of two hours on session cookie | Set maxAge of two hours on session cookie
| JavaScript | mit | ShevaDas/exhibitor-management,ShevaDas/exhibitor-management |
522e0af7990d6bcf5ccc25880f3f3e186f935a5a | examples/js/loaders/ctm/CTMWorker.js | examples/js/loaders/ctm/CTMWorker.js | importScripts( "lzma.js", "ctm.js" );
self.onmessage = function( event ) {
var files = [];
for ( var i = 0; i < event.data.offsets.length; i ++ ) {
var stream = new CTM.Stream( event.data.data );
stream.offset = event.data.offsets[ i ];
files[ i ] = new CTM.File( stream );
}
self.postMessage( files );
... | importScripts( "lzma.js", "ctm.js" );
self.onmessage = function( event ) {
var files = [];
for ( var i = 0; i < event.data.offsets.length; i ++ ) {
var stream = new CTM.Stream( event.data.data );
stream.offset = event.data.offsets[ i ];
files[ i ] = new CTM.File( stream, [event.data.data.buffer] );
}
s... | Optimize sending data from worker | Optimize sending data from worker
When transferable list is specified, postingMessage to worker doesn't copy data.
Since ctm.js references original data, we can specify original stream to be transferred back to the main thread. | JavaScript | mit | nhalloran/three.js,jostschmithals/three.js,ondys/three.js,zhoushijie163/three.js,Hectate/three.js,ValtoLibraries/ThreeJS,nhalloran/three.js,06wj/three.js,Aldrien-/three.js,ngokevin/three.js,sherousee/three.js,colombod/three.js,mese79/three.js,fanzhanggoogle/three.js,gero3/three.js,WestLangley/three.js,satori99/three.js... |
fba051054a620955435c0d4e7cf7ad1d53a77e53 | pages/index.js | pages/index.js | import React, { Fragment } from 'react';
import Head from 'next/head';
import { Header, RaffleContainer } from '../components';
export default () => (
<Fragment>
<Head>
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
... | import React, { Fragment } from 'react';
import Head from 'next/head';
import { Header, RaffleContainer } from '../components';
export default () => (
<Fragment>
<Head>
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
... | Move script tag below content | Move script tag below content
| JavaScript | mit | wKovacs64/meetup-raffle,wKovacs64/meetup-raffle |
b3122ca59cef75447df5de3aeefc85f95dfc4073 | popup.js | popup.js | window.addEventListener('load', function(){
'use strict';
// Get elements
var title = document.getElementById('page_title');
var url = document.getElementById('page_url');
var copyTitle = document.getElementById('copy_title');
var copyUrl = document.getElementById('copy_url');
// Get tab info
chrome.t... | function copyToClipboard(str){
'use strict';
var textArea = document.createElement('textarea');
document.body.appendChild(textArea);
textArea.value = str;
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
}
window.addEventListener('load', function(){
'use strict';
... | Split copy part to a function | Split copy part to a function
| JavaScript | mit | Roadagain/TitleViewer,Roadagain/TitleViewer |
f1d9bb6de06a201c0fee83d1c536fffbe2070016 | app/js/instances/init.js | app/js/instances/init.js | /*
* Copyright 2015 Caleb Brose, Chris Fogerty, Rob Sheehy, Zach Taylor, Nick Miller
*
* 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... | /*
* Copyright 2015 Caleb Brose, Chris Fogerty, Rob Sheehy, Zach Taylor, Nick Miller
*
* 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... | Fix bug introduced in merge | Fix bug introduced in merge
| JavaScript | apache-2.0 | lighthouse/harbor,lighthouse/harbor |
7d88dec0afcbdbf15262e06a3bb8f59980e51251 | app/libs/locale/index.js | app/libs/locale/index.js | 'use strict';
// Load our requirements
const i18n = require('i18n'),
path = require('path'),
logger = require('../log');
// Variables
let localeDir = path.resolve(__base + '../locales');
// Configure the localization engine
i18n.configure({
locales: require('./available-locales')(localeDir),
defaultL... | 'use strict';
// Load our requirements
const i18n = require('i18n'),
path = require('path'),
logger = require(__base + 'libs/log');
// Variables
let localeDir = path.resolve(__base + '../locales');
// Configure the localization engine
i18n.configure({
locales: require('./available-locales')(localeDir),... | Update locale to use object notation | Update locale to use object notation
| JavaScript | apache-2.0 | transmutejs/core |
ef6b9a827c9f5af6018e08d69cc1cf4491d52386 | frontend/src/app.js | frontend/src/app.js | import Rx from 'rx';
import Cycle from '@cycle/core';
import CycleDOM from '@cycle/dom';
function main() {
return {
DOM: Rx.Observable.interval(1000)
.map(i => CycleDOM.h(
'h1', '' + i + ' seconds elapsed'
))
};
}
let drivers = {
DOM: CycleDOM.makeDOMDriver('#app')
};
Cycle.run(main, dr... | import Cycle from '@cycle/core';
import {makeDOMDriver, h} from '@cycle/dom';
function main(drivers) {
return {
DOM: drivers.DOM.select('input').events('click')
.map(ev => ev.target.checked)
.startWith(false)
.map(toggled =>
h('label', [
h('input', {type: 'checkbox'}), 'Toggle... | Remove Rx as a direct dependency | Remove Rx as a direct dependency
| JavaScript | mit | blakelapierre/cyclebox,blakelapierre/base-cyclejs,blakelapierre/cyclebox,blakelapierre/cyclebox,blakelapierre/base-cyclejs |
243050586e55033f74debae5f2eac4ad17931161 | myapp/public/javascripts/game-board.js | myapp/public/javascripts/game-board.js | /**
* game-board.js
*
* Maintain game board object properties
*/
// Alias our game board
var gameBoard = game.objs.board;
/**
* Main game board factory
*
* @returns {object}
*/
var getGameBoard = function() {
var gameBoard = document.getElementById('game-board');
var width = gameBoard.width.baseVal.va... | /**
* game-board.js
*
* Maintain game board object properties
*/
// Alias our game board
var gameBoard = game.objs.board;
/**
* Main game board factory
*
* @returns {object}
*/
var getGameBoard = function() {
var gameBoard = document.getElementById('game-board');
var width = gameBoard.width.baseVal.va... | Add boundaries to game board | Add boundaries to game board
| JavaScript | mit | gabrielliwerant/SquareEatsSquare,gabrielliwerant/SquareEatsSquare |
03653efc0acbf51875a78c3647d4ed6676052e1f | javascript/word-count/word-count.js | javascript/word-count/word-count.js | // super ugly but I'm tired
var Words = function() {};
Words.prototype.count = function(input) {
var wordArray = normalize(input.replace(/[\n\t]/g, ' ').trim()).split(' ');
var result = {};
toLower(wordArray).forEach(function(item) {
if (result[item] && Number.isInteger(result[item]))
result[item] += ... | // super ugly but I'm tired
var Words = function() {};
Words.prototype.count = function(input) {
var wordArray = normalize(input.replace(/[\n\t]/g, ' ').trim()).split(' ');
var result = {};
toLower(wordArray).forEach(function(item) {
if (result[item] && Number.isInteger(result[item]))
result[item] += ... | Solve Word Count in JS | Solve Word Count in JS
| JavaScript | mit | parkertm/exercism |
109101b6d6fc7131a41f9f4ffd24305c1d5d1c09 | tasks/development.js | tasks/development.js | module.exports = function (grunt) {
grunt.config.merge({
connect: {
server: {
options: {
base: {
path: 'build',
options: {
index: 'index.html'
}
},
livereload: true
}
}
},
watch: {
sources: {
... | module.exports = function (grunt) {
grunt.config.merge({
connect: {
server: {
options: {
base: {
path: 'build',
options: {
index: 'index.html'
}
},
livereload: true
}
}
},
watch: {
sources: {
... | Add helper.js to grunt watch | [TASK] Add helper.js to grunt watch
| JavaScript | agpl-3.0 | Freifunk-Troisdorf/meshviewer,FreifunkMD/Meshviewer,hopglass/ffrgb-meshviewer,Freifunk-Rhein-Neckar/meshviewer,rubo77/meshviewer-1,rubo77/meshviewer-1,Freifunk-Troisdorf/meshviewer,FreifunkBremen/meshviewer-ffrgb,freifunkMUC/meshviewer,Freifunk-Rhein-Neckar/meshviewer,xf-/meshviewer-1,FreifunkMD/Meshviewer,hopglass/ffr... |
fb7d7d4b2a4c4015c9193064dcb41a44df70c312 | client/templates/posts/posts_list.js | client/templates/posts/posts_list.js | var postsData = [
{
title: 'Introducing Telescope',
url: 'http://sachagreif.com/introducing-telescope/'
},
{
title: 'Meteor',
url: 'http://meteor.com'
},
{
title: 'The Meteor Book',
url: 'http://themeteorbook.com'
}
];
Template.postsList.helpers({
posts: function() {
return Posts.find();
}
}); | var postsData = [
{
title: 'Introducing Telescope',
url: 'http://sachagreif.com/introducing-telescope/'
},
{
title: 'Meteor',
url: 'http://meteor.com'
},
{
title: 'The Meteor Book',
url: 'http://themeteorbook.com'
}
];
Template.postsList.helpers({
posts: function() {
return Posts.find({}, {sort: {... | Sort posts by submitted timestamp | Sort posts by submitted timestamp
| JavaScript | mit | valgalin/microscope,valgalin/microscope |
c6f398add9622d5dd84b8347a4f85fa98da6c5ad | spec/import-notebook-spec.js | spec/import-notebook-spec.js | "use babel";
// const { dialog } = require("electron").remote;
const { existsSync } = require("fs");
import { _loadNotebook } from "../lib/import-notebook";
import { waitAsync } from "./helpers/test-utils";
describe("Import notebook", () => {
const sampleNotebook = require.resolve("./helpers/test-notebook.ipynb");
... | "use babel";
// const { dialog } = require("electron").remote;
const { existsSync } = require("fs");
const { EOL } = require("os");
import { _loadNotebook } from "../lib/import-notebook";
import { waitAsync } from "./helpers/test-utils";
describe("Import notebook", () => {
const sampleNotebook = require.resolve("./... | Use platform EOL for newlines | Use platform EOL for newlines
- Fixes test for Windows
| JavaScript | mit | nteract/hydrogen,nteract/hydrogen |
d22e1cc72041a3453f7a54bfb989ca71bd76c96a | webpack.config.client.production.js | webpack.config.client.production.js | const webpack = require('webpack')
const path = require('path')
const Dotenv = require('dotenv-webpack')
const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin')
const WebpackChunkHash = require('webpack-chunk-hash')
module.exports = {
entry: {
client: './src/client'
},
target: 'web',
module: {... | const webpack = require('webpack')
const path = require('path')
const Dotenv = require('dotenv-webpack')
const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin')
const WebpackChunkHash = require('webpack-chunk-hash')
module.exports = {
entry: {
client: './src/client'
},
target: 'web',
module: {... | Fix syntax error, rename manifest | Fix syntax error, rename manifest
| JavaScript | mit | madeagency/reactivity |
b331d9b5cb1ce6122737a4b1136f0ae83449d282 | lib/info-iframe-receiver.js | lib/info-iframe-receiver.js | 'use strict';
var inherits = require('inherits')
, EventEmitter = require('events').EventEmitter
, JSON3 = require('json3')
, XHRLocalObject = require('./transport/sender/xhr-local')
, InfoAjax = require('./info-ajax')
;
function InfoReceiverIframe(transUrl, baseUrl) {
var self = this;
EventEmitter.call... | 'use strict';
var inherits = require('inherits')
, EventEmitter = require('events').EventEmitter
, JSON3 = require('json3')
, XHRLocalObject = require('./transport/sender/xhr-local')
, InfoAjax = require('./info-ajax')
;
function InfoReceiverIframe(transUrl) {
var self = this;
EventEmitter.call(this);
... | Fix iframe info receiver using wrong url | Fix iframe info receiver using wrong url
| JavaScript | mit | modulexcite/sockjs-client,the1sky/sockjs-client,bulentv/sockjs-client,webmechanicx/sockjs-client,vkorehov/sockjs-client,jmptrader/sockjs-client,JohnKossa/sockjs-client,sockjs/sockjs-client,woosoobar/sockjs-client,bulentv/sockjs-client,jmptrader/sockjs-client,reergymerej/sockjs-client,arusakov/sockjs-client,modulexcite/... |
97f8f233846493d5809dd63155fe156acb635c43 | lib/assets/javascripts/views/shared/create_account_form.js | lib/assets/javascripts/views/shared/create_account_form.js | import ariatiseForm from '../../utils/ariatiseForm';
import { togglisePasswords } from '../../utils/passwordHelper';
import validateOrgSelection from '../shared/my_org';
import { isValidText } from '../../utils/isValidInputType';
$(() => {
const options = { selector: '#create-account-form' };
ariatiseForm(options)... | import ariatiseForm from '../../utils/ariatiseForm';
import { togglisePasswords } from '../../utils/passwordHelper';
import { validateOrgSelection } from '../shared/my_org';
$(() => {
const options = { selector: '#create-account-form' };
ariatiseForm(options);
togglisePasswords(options);
$('#create_account_fo... | Fix lint issues in JS | Fix lint issues in JS
| JavaScript | mit | CDLUC3/dmptool,DigitalCurationCentre/roadmap,DMPRoadmap/roadmap,DigitalCurationCentre/roadmap,CDLUC3/dmptool,DigitalCurationCentre/roadmap,CDLUC3/dmptool,CDLUC3/roadmap,CDLUC3/roadmap,DMPRoadmap/roadmap,CDLUC3/roadmap,CDLUC3/dmptool,DMPRoadmap/roadmap,CDLUC3/roadmap |
9263492051ac911f429e9585afce5568fe2eb8ff | app/scripts/app.js | app/scripts/app.js | 'use strict';
angular
.module('visualizerApp', [
'ngRoute',
'angularFileUpload',
'angularMoment',
'angularPeity'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
redirectTo: '/read/'
})
.when('/read/', {
templateUrl: 'views/read.html',
... | 'use strict';
angular
.module('visualizerApp', [
'ngRoute',
'angularFileUpload',
'angularMoment',
'angularPeity'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
redirectTo: '/read/'
})
.when('/read/', {
templateUrl: 'views/read.html',
... | Add routing for specified repos | Add routing for specified repos
| JavaScript | mit | PRioritizer/PRioritizer-visualizer,PRioritizer/PRioritizer-visualizer |
21d3e05ce05ee3d0e8eb2237c43335d8e4d12d8d | samples/fortytwo_test.js | samples/fortytwo_test.js | define(['chai', 'mocha', 'samples/fortytwo'], function(chai, mocha, fortytwo) {
'use strict';
var expect = chai.expect;
describe('fortytwo', function() {
it('should return fortytwo', function() {
expect(fortytwo.fortytwo()).to.equal(42);
});
});
});
| define(['chai',
'mocha',
'samples/fortytwo'],
function(chai,
unusedMocha,
fortytwo) {
'use strict';
var expect = chai.expect;
describe('fortytwo', function() {
it('should return fortytwo', function() {
expect(fortytwo.fortytwo()).to.equal(42);
}... | Align the variables slightly differently. | Align the variables slightly differently.
| JavaScript | mit | solventz/js |
07d28940c615563b434c7a982bd89c8fc9356f15 | lib/event_bus/in_memory/receiver.js | lib/event_bus/in_memory/receiver.js | var inherit = require("../../inherit");
var CommonEventBusReceiver = require("../common/receiver");
var InMemoryEventBus;
inherit(InMemoryEventBusReceiver, CommonEventBusReceiver);
function InMemoryEventBusReceiver(options) {
CommonEventBusReceiver.call(this, options);
InMemoryEventBus = InMemoryEv... | var inherit = require("../../inherit");
var CommonEventBusReceiver = require("../common/receiver");
var InMemoryEventBus;
inherit(InMemoryEventBusReceiver, CommonEventBusReceiver);
function InMemoryEventBusReceiver(options) {
CommonEventBusReceiver.call(this, options);
InMemoryEventBus = InMemoryEv... | Add intiialize method to InMemoryEventBusReceiver | Add intiialize method to InMemoryEventBusReceiver
| JavaScript | mit | jbpros/plutonium |
e05609d5ec95f804daf0e403647b98483abc4fb5 | extensions/markdown/media/loading.js | extensions/markdown/media/loading.js | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | Fix markdown style load error | Fix markdown style load error
| JavaScript | mit | microlv/vscode,landonepps/vscode,eamodio/vscode,eamodio/vscode,0xmohit/vscode,the-ress/vscode,landonepps/vscode,joaomoreno/vscode,0xmohit/vscode,0xmohit/vscode,rishii7/vscode,eamodio/vscode,0xmohit/vscode,microlv/vscode,landonepps/vscode,Microsoft/vscode,0xmohit/vscode,Krzysztof-Cieslak/vscode,microlv/vscode,microlv/vs... |
007d247a719af3e9149a915a33034742efb98c0c | src/components/stream-app.js | src/components/stream-app.js | 'use strict';
var React = require('react');
var io = require('socket.io-client');
var TwitterStreamList = require('./stream-list');
var TwitterStreamApp = React.createClass({
getInitialState: function() {
return {
tweets: []
};
},
componentDidMount: function() {
var so... | 'use strict';
var React = require('react');
var io = require('socket.io-client');
var TwitterStreamList = require('./stream-list');
var TwitterStreamApp = React.createClass({
getInitialState: function() {
return {
tweets: []
};
},
onTweetReceived: function(tweet) {
var... | Move setState logic on new tweet to component method | Move setState logic on new tweet to component method
| JavaScript | mit | bjarneo/TwitterStream,bjarneo/TwitterStream |
0334e6c0138bfef3b11c400d3da58633c8697257 | library/CM/Page/Abstract.js | library/CM/Page/Abstract.js | /**
* @class CM_Page_Abstract
* @extends CM_Component_Abstract
*/
var CM_Page_Abstract = CM_Component_Abstract.extend({
/** @type String */
_class: 'CM_Page_Abstract',
/** @type String[] */
_stateParams: [],
/** @type String|Null */
_fragment: null,
_ready: function() {
this._fragment = window.... | /**
* @class CM_Page_Abstract
* @extends CM_Component_Abstract
*/
var CM_Page_Abstract = CM_Component_Abstract.extend({
/** @type String */
_class: 'CM_Page_Abstract',
/** @type String[] */
_stateParams: [],
/** @type String|Null */
_fragment: null,
_ready: function() {
var location = window.lo... | Call "routeToState" on page's ready() | Call "routeToState" on page's ready()
| JavaScript | mit | vogdb/cm,cargomedia/CM,mariansollmann/CM,vogdb/cm,njam/CM,christopheschwyzer/CM,njam/CM,tomaszdurka/CM,tomaszdurka/CM,mariansollmann/CM,alexispeter/CM,njam/CM,fauvel/CM,njam/CM,fvovan/CM,alexispeter/CM,zazabe/cm,fvovan/CM,vogdb/cm,zazabe/cm,christopheschwyzer/CM,fauvel/CM,zazabe/cm,alexispeter/CM,njam/CM,mariansollmann... |
d192bf8fcb996c5d4d0a86e6fab2e0c4fac3bc8a | src/functions/run.js | src/functions/run.js | 'use strict'
const { addGenErrorHandler } = require('../errors')
const { getParams } = require('./params')
const { stringifyConfigFunc } = require('./tokenize')
// Process config function, i.e. fires it and returns its value
const runConfigFunc = function ({
configFunc,
mInput,
mInput: { serverParams },
para... | 'use strict'
const { addGenPbHandler } = require('../errors')
const { getParams } = require('./params')
const { stringifyConfigFunc } = require('./tokenize')
// Process config function, i.e. fires it and returns its value
const runConfigFunc = function ({
configFunc,
mInput,
mInput: { serverParams },
params,... | Improve error handling of config functions | Improve error handling of config functions
| JavaScript | apache-2.0 | autoserver-org/autoserver,autoserver-org/autoserver |
f04c6bf92ee6e09bb2fa0b1686bfdc5fc8c98ffd | lighthouse-inline-images.js | lighthouse-inline-images.js | // ==UserScript==
// @name Lighthouse Inline Image Attachments
// @namespace headinsky.dk
// @description Show image attachments for Lighthouse tickets inline
// @include https://*.lighthouseapp.com/*
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
var width = $("d... | // ==UserScript==
// @name Lighthouse Inline Image Attachments
// @namespace headinsky.dk
// @description Show image attachments for Lighthouse tickets inline
// @include https://*.lighthouseapp.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserSc... | Use optimized jQuery from Google APIs | Use optimized jQuery from Google APIs | JavaScript | mit | kasperg/lighthouse-inline-images |
7eca0341a136b75907c58287a8d16f625be85e31 | src/http/pdf-http.js | src/http/pdf-http.js | const ex = require('../util/express');
const pdfCore = require('../core/pdf-core');
const getRender = ex.createRoute((req, res) => {
const opts = {
// TODO: add all params here
};
return pdfCore.render(req.query)
.then((data) => {
res.set('content-type', 'application/pdf');
res.send(data);
... | const ex = require('../util/express');
const pdfCore = require('../core/pdf-core');
const getRender = ex.createRoute((req, res) => {
const opts = {
url: req.query.url,
scrollPage: req.query.scrollPage,
emulateScreenMedia: req.query.emulateScreenMedia,
waitFor: req.query.waitFor,
viewport: {
... | Implement parameters for GET request | Implement parameters for GET request
| JavaScript | mit | alvarcarto/url-to-pdf-api,alvarcarto/url-to-pdf-api |
85af498cbc8f3bad4fc8d15e0332fe46cdbf7d73 | js/components/module-container.js | js/components/module-container.js | (function(app) {
'use strict';
var jCore = require('jcore');
var helper = app.helper || require('../helper.js');
var Module = app.Module || require('./module.js');
var ModuleContainer = helper.inherits(function(props) {
ModuleContainer.super_.call(this);
this.modules = this.prop([]);
this.eleme... | (function(app) {
'use strict';
var jCore = require('jcore');
var helper = app.helper || require('../helper.js');
var Module = app.Module || require('./module.js');
var ModuleContainer = helper.inherits(function(props) {
ModuleContainer.super_.call(this);
this.modules = this.prop([]);
this.eleme... | Add method to move a module on top of others | Add method to move a module on top of others
| JavaScript | mit | ionstage/modular,ionstage/modular |
2bf536eb1d383b479c0df0477cde3bd5ceb76290 | keyhole/static/keyhole/js/main.js | keyhole/static/keyhole/js/main.js | (function($) {
function init_editor(e) {
var editor = $(e);
var selector = editor.data('selector');
editor.cropit({
imageState: {
src: editor.data('original-image')
}
});
$("body").on('click', '#' + selector + '_btn', function(e) {
... | (function($) {
function init_editor(e) {
var editor = $(e);
var selector = editor.data('selector');
editor.cropit({
imageState: {
src: editor.data('original-image')
}
});
$("form[class*='form'").submit(function( event ) {
/... | Save cropped image on submit and not by clicking on the button. | Save cropped image on submit and not by clicking on the button. | JavaScript | mit | BontaVlad/DjangoKeyhole,BontaVlad/DjangoKeyhole |
cf248f613e7334acc46629787c1134aadc07801d | src/reducers/root.js | src/reducers/root.js | import { LOAD_PAGE, LOAD_PAGE_REQUEST } from '../actions/constants'
const initialState = {
page: 1,
photos: [],
loading: true
}
export default function (state = initialState, action) {
switch (action.type) {
case LOAD_PAGE_REQUEST:
return Object.assign({}, state, {
loading: true
})
... | import { LOAD_PAGE, LOAD_PAGE_REQUEST } from '../actions/constants'
const initialState = {
page: 1,
photos: [],
loading: true
}
export default function (state = initialState, action) {
switch (action.type) {
case LOAD_PAGE_REQUEST:
return {
...state,
loading: true
}
case L... | Use object spread operator instead of Object.assign | Use object spread operator instead of Object.assign
| JavaScript | mit | stackia/unsplash-trending,stackia/unsplash-trending |
e2695a633c0fef9ef0402ba765f4e7322574f324 | language-command.js | language-command.js | var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
* @param {String} args... | var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
* @param {Array} args... | Support an array of arguments. | Support an array of arguments.
| JavaScript | mit | blakeembrey/node-language-command |
65b836b5c005faba6335ce65cc31a95e0d74251d | app/assets/javascripts/map-overlay.js | app/assets/javascripts/map-overlay.js | (function($) {
if (!$.cookie('first_time_visitor')) {
$.cookie('first_time_visitor', true, { expires: 1000, path: '/' });
var $overlayWrapper = $('.overlay-wrapper');
$overlayWrapper.show();
setTimeout(function() {
$overlayWrapper.addClass('in');
}, 0);
$overlayWrapper.find('.close-... | (function($) {
if (!$.cookie('first_time_visitor')) {
$.cookie('first_time_visitor', true, { expires: 1000, path: '/' });
var $overlayWrapper = $('.overlay-wrapper');
$overlayWrapper.show();
setTimeout(function() {
$overlayWrapper.addClass('in');
}, 0);
$overlayWrapper.find('.close-... | Fix missing transition variable in map overlay. | Fix missing transition variable in map overlay.
| JavaScript | agpl-3.0 | sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap |
5b288f095f8b7ed76a9f8331f1c330119e8d9786 | feeds.js | feeds.js | "use strict";
var BlogController = require('./controllers/blog');
var BloggerController = require('./controllers/blogger');
var RSS = require('rss');
exports.serveRoutes = function(router) {
router.get('/main', function(req, res) {
var mainFeed = new RSS({
title: "CS Blogs Main Feed",
description: "All of th... | "use strict";
var BlogController = require('./controllers/blog');
var BloggerController = require('./controllers/blogger');
var RSS = require('rss');
exports.serveRoutes = function(router) {
router.get('/main', function(req, res) {
var mainFeed = new RSS({
title: "CS Blogs Main Feed",
description: "All of th... | Fix for sending XML before async call returns | Fix for sending XML before async call returns
| JavaScript | mit | robcrocombe/csblogs,csblogs/csblogs-web-app,csblogs/csblogs-web-app |
5caf144cad6ef3362ebf15afb112cc8e62a142f5 | Resources/Private/Javascripts/Modules/Module.js | Resources/Private/Javascripts/Modules/Module.js | /**
* Defines a dummy module
*
* @module Modules/Module
*/
var App;
/**
* App
* @param el
* @constructor
*/
App = function(el) {
'use strict';
this.el = el;
};
/**
* Function used to to render the App
*
* @memberof module:Modules/Module
* @returns {Object} the App itself.
*/
App.prototype.render = fu... | /**
* Defines a dummy module
*
* @module Modules/Module
*/
var App;
/**
* App
* @param el
* @constructor
*/
App = function(el) {
'use strict';
this.el = el;
};
/**
* Function used to to render the App
*
* @memberof module:Modules/Module
* @returns {Object} The App itself.
*/
App.prototype.render = fu... | Make sure the example App modules render method returns the module | [TASK] Make sure the example App modules render method returns the module
| JavaScript | mit | t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template,t3b/t3b_template |
53374261765f24b58db7bc71337d9f7eb7900433 | lib/cli/index.js | lib/cli/index.js | 'use strict';
var path = require('path');
var program = require('commander');
var jsdoctest = require('../..');
var packageJson = require('../../package.json');
/**
* The main command-line utility's entry point.
*
* @param {Array.<String>} The `process.argv` array.
*/
exports.run = function(argv) {
program
... | 'use strict';
var path = require('path');
var program = require('commander');
var jsdoctest = require('../..');
var packageJson = require('../../package.json');
/**
* The main command-line utility's entry point.
*
* @param {Array.<String>} The `process.argv` array.
*/
exports.run = function(argv) {
program
... | Fix help message on wrong calls | Fix help message on wrong calls
This fixes the display of usage information when the program is called
without arguments.
| JavaScript | mit | yamadapc/jsdoctest,yamadapc/jsdoctest |
1a149064f53560e72c3ff763683011e29e67604c | www/js/keyManager.js | www/js/keyManager.js | function displayKeys() {
// Retrieve all keyPairs
var sql = "select K.name from key K";
dbRetrieve(sql, [], function(res) {
// Populate key list
var html = '<hr>';
for (var i = 0; i < res.rows.length; ++i) {
var keyName = res.rows.item(i).name;
html += '<s... | function displayKeys() {
// Retrieve all keyPairs
var sql = "select K.name from key K";
dbRetrieve(sql, [], function(res) {
// Populate key list
var html = '<hr>';
for (var i = 0; i < 1; ++i) {
var keyName = res.rows.item(i).name;
html += '<button onclick=... | Print key on click (try 5 - button) | Print key on click (try 5 - button)
| JavaScript | agpl-3.0 | lromerio/cothority-mobile,lromerio/cothority-mobile |
7cf7979e06f0774f46d133e070887cb29957c9d5 | index.js | index.js | "use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = Object.keys || require('object-keys');
var assignShim = function assign(target, source) {
return keys(source).reduce(function (target, key) {
target[key] = source[key];
return target;
}, target);
};
assignShim.shim = function shimOb... | "use strict";
// modified from https://github.com/es-shims/es6-shim
var keys = Object.keys || require('object-keys');
var assignShim = function assign(target, source) {
var props = keys(source);
for (var i = 0; i < props.length; ++i) {
target[props[i]] = source[props[i]];
}
return target;
};
assignShim.shim = ... | Use a for loop, because ES3 browsers don't have "reduce" | Use a for loop, because ES3 browsers don't have "reduce"
| JavaScript | mit | ljharb/object.assign,es-shims/object.assign,reggi/object.assign |
c72a5d2988107208b2a344df2b55656f81ca545d | index.js | index.js | 'use strict';
var mote = require('mote');
exports.name = 'mote';
exports.outputFormat = 'html';
exports.compile = function (str, options) {
return mote.compile(str);
};
| 'use strict';
var mote = require('mote');
exports.name = 'mote';
exports.outputFormat = 'html';
exports.compile = mote.compile;
| Make compile use mote's compile | refactor(~): Make compile use mote's compile | JavaScript | mit | jstransformers/jstransformer-mote |
73d5d2b89ef60ffc1035e2a3787ae86c5f360725 | index.js | index.js | /**
* Copyright (c) 2016, Christopher Ramírez
* All rights reserved.
*
* This source code is licensed under the MIT license.
*/
'use strict'
const validIdNumberRegExp = /^(\d{3})[ -]?(\d{6})[ -]?(\d{4}\S{1})$/
class NicaraguanId {
constructor(number) {
this.fullName = undefined
this.birthPla... | /**
* Copyright (c) 2016, Christopher Ramírez
* All rights reserved.
*
* This source code is licensed under the MIT license.
*/
'use strict'
const validIdNumberRegExp = /^(\d{3})[ -]?(\d{6})[ -]?(\d{4}\S{1})$/
class NicaraguanId {
constructor(number) {
this.fullName = undefined
this.birthPla... | Move checkNumber function to the buttom of class implementation. | Move checkNumber function to the buttom of class implementation.
| JavaScript | mit | christopher-ramirez/nic-id |
a16f274a861655f73ad07adff88196540aacd698 | emoji.js | emoji.js | Emoji = {};
Emoji.baseImagePath = '/packages/davidfrancisco_twemoji/img/';
Emoji.convert = function (str) {
if (typeof str !== 'string') {
return '';
}
return str.replace(/:[\+\-a-z0-9_]+:/gi, function(match) {
var imgName = match.slice(1, -1),
path = Emoji.baseImagePath + img... | Emoji = {};
Emoji.baseImagePath = '/packages/davidfrancisco_twemoji/img/';
Emoji.convert = function (str) {
if (typeof str !== 'string') {
return '';
}
return str.replace(/:[\+\-a-z0-9_]+:/gi, function(match) {
var imgName = match.slice(1, -1),
path = Emoji.baseImagePath + img... | Add draggable attr to <img>s and set it to false | Add draggable attr to <img>s and set it to false
| JavaScript | mit | dmfrancisco/meteor-twemoji |
b71c2f7fbf9d7aa16ef5c7e702f19ad50a9dc6d0 | index.js | index.js | #!/usr/bin/env node
'use strict'; /*jslint node: true, es5: true, indent: 2 */
var Parser = exports.Parser = require('./parser');
var Stringifier = exports.Stringifier = require('./stringifier');
// function logEvents(emitter, prefix, names) {
// names.forEach(function(name) {
// emitter.on(name, function(/*...... | #!/usr/bin/env node
'use strict'; /*jslint node: true, es5: true, indent: 2 */
var Parser = exports.Parser = require('./parser');
var Stringifier = exports.Stringifier = require('./stringifier');
// function logEvents(emitter, prefix, names) {
// names.forEach(function(name) {
// emitter.on(name, function(/*...... | Check for process.stdin.isTTY when run directly | Check for process.stdin.isTTY when run directly
| JavaScript | mit | chbrown/sv,chbrown/sv |
e6c66260031b793e25b2c4c50859699b9d0d7e17 | index.js | index.js | "use strict"
var fs = require("fs")
var path = require("path")
var dz = require("dezalgo")
var npa = require("npm-package-arg")
module.exports = function (spec, where, cb) {
if (where instanceof Function) cb = where, where = null
if (where == null) where = "."
cb = dz(cb)
try {
var dep = npa(spec)
}
ca... | "use strict"
var fs = require("fs")
var path = require("path")
var dz = require("dezalgo")
var npa = require("npm-package-arg")
module.exports = function (spec, where, cb) {
if (where instanceof Function) cb = where, where = null
if (where == null) where = "."
cb = dz(cb)
try {
var dep = npa(spec)
}
ca... | Resolve ONLY file:// deps relative to package root, everything else CWD | Resolve ONLY file:// deps relative to package root, everything else CWD
| JavaScript | isc | npm/realize-package-specifier |
c6eb2c136ed61fc0ac5e38a1c2e16872a7f99822 | index.js | index.js | const onepass = require("onepass")({
bundleId: "com.sudolikeaboss.sudolikeaboss"
});
exports.decorateTerm = (Term, { React }) => {
return class extends React.Component {
_onTerminal (term) {
if (this.props && this.props.onTerminal) this.props.onTerminal(term);
term.uninstallKeyboard();
ter... | const onepass = require("onepass")({
bundleId: "com.sudolikeaboss.sudolikeaboss"
});
exports.decorateTerm = (Term, { React }) => {
return class extends React.Component {
_onTerminal (term) {
if (this.props && this.props.onTerminal) this.props.onTerminal(term);
term.uninstallKeyboard();
ter... | Extend existing keydown handler, instead of overriding it | Extend existing keydown handler, instead of overriding it
| JavaScript | mit | sibartlett/hyperterm-1password |
91b608d905aa602fd9f8d7b0019602b6d077f6ea | src/umd-wrapper.js | src/umd-wrapper.js | (function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['backbone', 'underscore', 'backbone.paginator'], function(Backbone, Underscore, PageableCollection) {
return (root.Hal = factory(root, Backbone, _, PageableCollection));
});
}
... | (function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['backbone', 'underscore', 'backbone.paginator'], function(Backbone, Underscore, PageableCollection) {
Backbone.PageableCollection = PageableCollection;
return (root.Hal = ... | Fix AMD / UMD problems. | Fix AMD / UMD problems. | JavaScript | mit | gomoob/backbone.hateoas,gomoob/backbone.hateoas,gomoob/backbone.hateoas |
48aeb44374abc3baae4bb098f9e94dea26c91494 | index.js | index.js | #! /usr/bin/env node
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n')
cb()
})
... | #! /usr/bin/env node
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
opts = opts || {}
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n... | Allow passing in a title | Allow passing in a title
| JavaScript | mit | dominictarr/indexhtmlify |
cd460dadc9bd85f4dc7356b20abf7cb3e3401dd0 | index.js | index.js | const Automerge = require('automerge')
function applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {
const startPos = cm.indexFromPos(change.from)
if (change.to.line === change.from.line && change.to.ch === change.from.ch) {
// nothing was removed.
} else {
// delete.removed contains an array... | const Automerge = require('automerge')
function applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {
const startPos = cm.indexFromPos(change.from)
if (change.to.line === change.from.line && change.to.ch === change.from.ch) {
// nothing was removed.
} else {
// delete.removed contains an array... | Use Array.reduce to compute how much to delete | Use Array.reduce to compute how much to delete
| JavaScript | mit | aslakhellesoy/automerge-codemirror,aslakhellesoy/automerge-codemirror |
5b5e156f3581cce8ecca166198e4a2d758eb576e | websites/submit.vefverdlaun.is/src/App.js | websites/submit.vefverdlaun.is/src/App.js | import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome ... | import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome ... | Add some text to try out ci setup | Add some text to try out ci setup
| JavaScript | mit | svef/www,svef/www |
065ba9eda7d93f2bb956ac74166b241af83c6202 | modules/core/content/services/url-helper.js | modules/core/content/services/url-helper.js | // DecentCMS (c) 2015 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';
function UrlHelper(scope) {
this.scope = scope;
}
UrlHelper.prototype.feature = 'content';
UrlHelper.prototype.service = 'url-helper';
UrlHelper.prototype.scope = 'shell';
UrlHelper.prototype.getUrl = function getU... | // DecentCMS (c) 2015 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';
function UrlHelper(scope) {
this.scope = scope;
}
UrlHelper.feature = 'content';
UrlHelper.service = 'url-helper';
UrlHelper.scope = 'shell';
UrlHelper.prototype.getUrl = function getUrl(id) {
var middlewares = t... | Define UrlHelper meta-data on the class instead of the prototype. | Define UrlHelper meta-data on the class instead of the prototype.
| JavaScript | mit | DecentCMS/DecentCMS |
6cae911047d15eef3bb48c39a448f8b66f54ee49 | tests/trafficSpec.js | tests/trafficSpec.js | describe('traffic', function() {
beforeEach(function() {
window.matrix.settings = {
profileId: ''
};
subject = window.matrix.traffic;
});
it('has initial points', function() {
expect(subject.points).to.eq(720);
});
it('has empty counts', function() {
expect(subject.counts).to.eql([]... | describe('traffic', function() {
beforeEach(function() {
window.matrix.settings = {
profileId: ''
};
subject = window.matrix.traffic;
});
it('has initial points', function() {
expect(subject.points).to.eq(720);
});
it('has empty counts', function() {
expect(subject.counts).to.eql([]... | Add test for the endpoint method | Add test for the endpoint method
| JavaScript | mit | codeforamerica/city-analytics-dashboard,codeforamerica/city-analytics-dashboard,codeforamerica/city-analytics-dashboard |
e25ee1f46a21bcee96821e459617090a5bb922e5 | spec/arethusa.core/key_capture_spec.js | spec/arethusa.core/key_capture_spec.js | "use strict";
describe('keyCapture', function() {
beforeEach(module('arethusa.core'));
describe('onKeyPressed', function() {
it('calls the given callback', inject(function(keyCapture) {
var event = {
keyCode: 27,
target: { tagname: '' }
};
var callbackCalled = false;
va... | "use strict";
describe('keyCapture', function() {
beforeEach(module('arethusa.core'));
var keyCapture;
beforeEach(inject(function(_keyCapture_) {
keyCapture = _keyCapture_;
}));
var Event = function(key, shift) {
this.keyCode = key;
this.shiftKey = shift;
this.target = { tagname: '' };
};... | Add spec for new keyCapture modifier handling | Add spec for new keyCapture modifier handling
| JavaScript | mit | alpheios-project/arethusa,Masoumeh/arethusa,Masoumeh/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa |
d4edd2fba11ee073a65807f347ca9857a1663572 | spec/javascripts/helpers/SpecHelper.js | spec/javascripts/helpers/SpecHelper.js | require.config({
paths:{
jquery: "vendor/assets/javascripts/jquery/jquery-1.7.2.min",
jsmin: "vendor/assets/javascripts/jsmin",
polyfills: "vendor/assets/javascripts/polyfills",
lib: 'public/assets/javascripts/lib',
handlebars: 'vendor/assets/javascripts/handlebars',
underscore: 'vendor/assets... | require.config({
paths:{
jquery: "vendor/assets/javascripts/jquery/jquery-1.7.2.min",
jsmin: "vendor/assets/javascripts/jsmin",
lib: 'public/assets/javascripts/lib',
handlebars: 'vendor/assets/javascripts/handlebars',
underscore: 'vendor/assets/javascripts/underscore',
jplugs: "vendor/assets/j... | Remove polyfills from the specHelper temporarily (as it fixes a weird bug) | Remove polyfills from the specHelper temporarily (as it fixes a weird bug)
| JavaScript | mit | Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo |
0c313cf2f04bc5f769f1fa1e4ba9dc31da615861 | packages/components/hooks/useBlackFriday.js | packages/components/hooks/useBlackFriday.js | import { useEffect, useState } from 'react';
import { isBlackFridayPeriod } from 'proton-shared/lib/helpers/blackfriday';
const EVERY_TEN_MINUTES = 10 * 60 * 1000;
const useBlackFriday = () => {
const [blackFriday, setBlackFriday] = useState(isBlackFridayPeriod());
useEffect(() => {
const intervalID ... | import { useEffect, useState } from 'react';
import { isBlackFridayPeriod } from 'proton-shared/lib/helpers/blackfriday';
const EVERY_MINUTE = 60 * 1000;
const useBlackFriday = () => {
const [blackFriday, setBlackFriday] = useState(isBlackFridayPeriod());
useEffect(() => {
const intervalID = setInter... | Check BF condition every minute | Check BF condition every minute
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
65cdcae6172ce01bcc8be4e31252f9740816438d | index.js | index.js | var isPatched = false;
if (isPatched) return console.log('already patched');
function addColor(string, name) {
var colors = {
green: ['\x1B[32m', '\x1B[39m'],
red: ['\x1B[1m\x1B[31m', '\x1B[39m\x1B[22m'],
yellow: ['\x1B[33m', '\x1B[39m']
}
return colors[name][0] + string + colors[name][1];
}
funct... | var isPatched = false;
var slice = Array.prototype.slice;
if (isPatched) return console.log('already patched');
function addColor(string, name) {
var colors = {
green: ['\x1B[32m', '\x1B[39m'],
red: ['\x1B[1m\x1B[31m', '\x1B[39m\x1B[22m'],
yellow: ['\x1B[33m', '\x1B[39m']
}
return colors[name][0] +... | Move slice variable assignment out of loop | Move slice variable assignment out of loop
| JavaScript | mit | coachme/console-time |
022e9339a27d89511811bff56e417e069d21610e | index.js | index.js | var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
module.exports = function dmpSass ($, document, done) {
sass.render({
file: 'assets/css/style.scss',
outputStyle: 'compressed',
sourceMap: false,
success: function (result) {
var cache = require('doc... | var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
var cacheHelper = require('documark-cache');
module.exports = function dmpSass ($, document, done) {
sass.render({
file: 'assets/css/style.scss',
outputStyle: 'compressed',
sourceMap: false,
su... | Move documark-cache dependency to top of the document. Check for head container | Move documark-cache dependency to top of the document. Check for head container
| JavaScript | mit | jeroenkruis/dmp-sass |
34cd265eb9284effdffb6b6314ea4632e80fbd86 | index.js | index.js |
var postcss = require('postcss'),
colors = require('color');
module.exports = postcss.plugin('postcss-lowvision', function () {
return function (css) {
css.walkDecls('color', function (decl) {
var color = decl.value
var rgb = colors.rgb(color);
decl.value = rgb;
... |
var postcss = require('postcss'),
color = require('color');
module.exports = postcss.plugin('postcss-lowvision', function () {
return function (css) {
css.walkDecls('color', function (decl) {
var val = decl.value
var rgb = color(val);
rgb.rgb();
decl.val... | Test to see if colors package works | Test to see if colors package works
| JavaScript | mit | keukenrolletje/postcss-lowvision |
56415d857b49a427736679050a0b59cddbbfb65f | index.js | index.js | 'use strict'
const driver = require('node-phantom-simple')
function genPromiseFunc(originalFunc) {
return function () {
const _args = Array.prototype.slice.call(arguments)
const _this = this
return new Promise(function (resolve, reject) {
_args.push(function () {
const _args2 = Array.prot... | 'use strict'
const driver = require('node-phantom-simple')
function genPromiseFunc(originalFunc) {
return function () {
const _args = Array.prototype.slice.call(arguments)
const _this = this
return new Promise(function (resolve, reject) {
_args.push(function () {
const _args2 = Array.prot... | Use module.exports instead of return | Use module.exports instead of return
| JavaScript | mit | foray1010/node-phantom-promise |
f7a134a8ebe7fa255932ceb9aba9bb8197dbdfac | index.js | index.js | var fs = require('fs'),
path = require('path');
// Load all stated versions into the module exports
module.exports.version = {};
['2.0.0', '2.0.1', '2.0.2', '2.1.0', '2.1.1', 'latest'].map(function(version) {
module.exports.version[version] = JSON.parse(
fs.readFileSync(
path.join(__dirnam... | var fs = require('fs'),
path = require('path');
// Load all stated versions into the module exports
module.exports.version = {};
['2.0.0', '2.0.1', '2.0.2', '2.1.0', '2.1.1', 'latest'].map(function(version) {
module.exports.version[version] = JSON.parse(
fs.readFileSync(
path.join(__dirnam... | Include datasources key in latest reference. | Include datasources key in latest reference.
| JavaScript | unlicense | mapycz/mapnik-reference,CartoDB/mapnik-reference,mapnik/mapnik-reference,mapnik/mapnik-reference,mojodna/mapnik-reference,florianf/mapnik-reference,mapycz/mapnik-reference,florianf/mapnik-reference,gravitystorm/mapnik-reference,mojodna/mapnik-reference,gravitystorm/mapnik-reference,CartoDB/mapnik-reference,mapnik/mapni... |
5239a5418abaac18e3a15cf1f0581f361f54449e | index.js | index.js | "use strict";
// Return the panorama ID
var getPanoID = function(string) {
let value = decodeURIComponent(string).match("^https:\/\/.*\!1s(.*)\!2e.*$");
if (value === null) {
throw "URL incorrect";
}
value = "F:" + value[1];
return value;
};
// Return Embed URL to use on iframe
var getEmbed = function(strin... | "use strict";
// Return the panorama ID
var getPanoID = function(string) {
let value = decodeURIComponent(string).match("^https:\/\/.*\!1s(.*)\!2e.*$");
if (value === null) {
throw "Incorrect URL";
}
return "F:" + value[1];
};
// Return Embed URL to use on iframe
var getEmbed = function(string) {
let id = ge... | Fix typo and remove some illogical code | Fix typo and remove some illogical code
| JavaScript | mit | dorianneto/get-streetview-panorama-id |
2c534a16c1bfabb72ba01f40f8a50ab941df15fe | index.js | index.js | /*
* This is a very basic webserver and HTTP Client.
* In production, you may want to use something like Express.js
* or Botkit to host a webserver and manage API calls
*/
const {TOKEN, PORT} = process.env,
triage = require('./triage'),
qs = require('querystring'),
axios = require('axios'),
... | /*
* This is a very basic webserver and HTTP Client.
* In production, you may want to use something like Express.js
* or Botkit to host a webserver and manage API calls
*/
const {TOKEN, PORT} = process.env,
triage = require('./triage'),
qs = require('querystring'),
axios = require('axios'),
... | Handle rejected promise, handle zero message case. | Handle rejected promise, handle zero message case.
| JavaScript | mit | Ihamblen/slacktriage |
24093d73f2b3b7518f7447d9261f0bf896f13526 | index.js | index.js | /* eslint-env node */
'use strict';
module.exports = {
name: 'ember-cli-chart',
included: function included(app) {
this._super.included(app);
app.import(app.bowerDirectory + '/chartjs/dist/Chart.js');
}
};
| /* eslint-env node */
'use strict';
module.exports = {
name: 'ember-cli-chart',
included: function(app, parentAddon) {
this._super.included.apply(this, arguments);
var target = (parentAddon || app);
if (target.app) {
target = target.app;
}
var bowerDir = target.bowerDirectory;
... | Allow usage in nested addons | Allow usage in nested addons | JavaScript | mit | aomra015/ember-cli-chart,aomran/ember-cli-chart,aomran/ember-cli-chart,aomra015/ember-cli-chart |
662aaae249f1411499aaf21b02c6527ceec1cca4 | app/js/arethusa.conf_editor/directives/plugin_conf.js | app/js/arethusa.conf_editor/directives/plugin_conf.js | "use strict";
angular.module('arethusa.confEditor').directive('pluginConf', function() {
return {
restrict: 'AE',
scope: true,
link: function(scope, element, attrs) {
var name = scope.$eval(attrs.name);
scope.template = 'templates/configs/' + name + '.html';
},
templateUrl: 'templates... | "use strict";
angular.module('arethusa.confEditor').directive('pluginConf', function() {
return {
restrict: 'AE',
scope: true,
link: function(scope, element, attrs) {
var name = scope.$eval(attrs.name);
// Right now paths to such configuration are hardcoded to a specific
// folder. Thi... | Add comment to plugin conf | Add comment to plugin conf
| JavaScript | mit | fbaumgardt/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,Masoumeh/arethusa,PonteIneptique/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa |
93f0d993dbfc7bbbd88c452c5aace505b73c761f | index.js | index.js | 'use strict';
module.exports = function(){
};
| 'use strict';
var fs = require('fs');
var stream = require('stream');
var readline = require('readline');
var moment = require('moment');
function readFileContent(filename, callback){
var lines = [];
var instream = fs.createReadStream(filename);
var outstream = new stream;
outstream.readable = true;
outstr... | Add initial file-reading and line formatting | Add initial file-reading and line formatting
| JavaScript | mit | matiassingers/whatsapp-log-parser |
d42fcb9add392e3cca86600b494af6bb7c51468d | index.js | index.js | var forIn = require('for-in'),
xobj = require('xhr'),
XhrError = require('xhrerror');
function noop() { }
function xhr(options, callback, errback) {
var req = xobj();
if(Object.prototype.toString.call(options) == '[object String]') {
options = { url: options };
}
req.open(options.method || 'GET'... | var forIn = require('for-in'),
xobj = require('xhr'),
XhrError = require('xhrerror');
function noop() { }
function xhr(options, callback, errback) {
var req = xobj();
if(Object.prototype.toString.call(options) == '[object String]') {
options = { url: options };
}
req.open(options.method || 'GET'... | Send the req to the callback. | Send the req to the callback.
| JavaScript | mit | matthewp/xhr,npmcomponent/matthewp-xhr |
3a18004c4d66395faf0559e37c68d02370f5e1b5 | index.js | index.js | var mozjpeg = require('mozjpeg')
var dcp = require('duplex-child-process')
/**
* @param {Object} options
* @param {Number} opts.quality the 1 to 100. Docs suggest 5 to 95 is actual useable range.
* @param {String} opts.args raw `mozjpeg` args for the connoisseur. See: https://github.com/mozilla/mozjpeg/blob/mast... | var mozjpeg = require('mozjpeg')
var dcp = require('duplex-child-process')
/**
* @param {Object} options
* @param {Number} opts.quality the 1 to 100. Docs suggest 5 to 95 is actual useable range.
* @param {String} opts.args raw `mozjpeg` args for the connoisseur. See: https://github.com/mozilla/mozjpeg/blob/mast... | Fix args option not functioning | Fix args option not functioning | JavaScript | isc | tableflip/mozjpeg-stream |
e374134bd7ff60faeaa561ee984f2d23802d486e | index.js | index.js | var Promise = require('bluebird')
var request = require('got')
var extend = require('xtend')
var BASE_URL = 'http://www.broadbandmap.gov/broadbandmap/broadband/jun2014/'
module.exports = function broadbandMap (lat, long, options) {
options = extend({
types: ['wireline', 'wireless']
}, options || {})
var pr... | var Promise = require('bluebird')
var request = require('got')
var extend = require('xtend')
var BASE_URL = 'http://www.broadbandmap.gov/broadbandmap/broadband/jun2014/'
module.exports = function broadbandMap (lat, long, options) {
options = extend({
types: ['wireline', 'wireless']
}, options || {})
return... | Use promise.map to build requests | Use promise.map to build requests
Requires moving buildRequest into inner fn scope
| JavaScript | mit | bsiddiqui/broadband-map |
954762c783fa53ab6772f2ff08a63b7dc018b396 | index.js | index.js | /*!
* data-driven
* Copyright(c) 2013 Fluent Software Solutions Ltd <info@fluentsoftware.co.uk>
* MIT Licensed
*/
module.exports = function(data, fn) {
var mochaIt = it
data.forEach(function(testData) {
try {
it = function(title, f) {
for (var key ... | /*!
* data-driven
* Copyright(c) 2013 Fluent Software Solutions Ltd <info@fluentsoftware.co.uk>
* MIT Licensed
*/
module.exports = function(data, fn) {
var mochaIt = it
var mochaBefore = before
data.forEach(function(testData) {
try {
it = function(title, f) {
for (... | Add support for pending, undefined it() tests and for data-driving Mocha's before() | Add support for pending, undefined it() tests and for data-driving Mocha's before()
| JavaScript | mit | danbehar/data-driven,fluentsoftware/data-driven |
a16fe50dad78d42b10fe9fd6af24a3b63754afa3 | index.js | index.js | 'use strict';
function DefaultRegistry(){
this._tasks = {};
}
DefaultRegistry.prototype.get = function get(name){
return this._tasks[name];
};
DefaultRegistry.prototype.set = function set(name, fn){
this._tasks[name] = fn;
};
DefaultRegistry.prototype.tasks = function tasks(){
return Object.keys(this._tasks... | 'use strict';
function DefaultRegistry(){
this._tasks = {};
}
DefaultRegistry.prototype.get = function get(name){
return this._tasks[name];
};
DefaultRegistry.prototype.set = function set(name, fn){
this._tasks[name] = fn;
};
DefaultRegistry.prototype.tasks = function tasks(){
var self = this;
return Obj... | Make `.tasks` return an object instead of array | Breaking: Make `.tasks` return an object instead of array
| JavaScript | mit | phated/undertaker-registry,gulpjs/undertaker-registry |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.