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 |
|---|---|---|---|---|---|---|---|---|---|
b56d78047b8865e382810b750abc61db381160b9 | tasks/spritesheet.js | tasks/spritesheet.js | module.exports = function(grunt) {"use strict";
var Builder = require('../').Builder;
grunt.registerMultiTask("spritesheet", "Compile images to sprite sheet", function() {
var helpers = require('grunt-lib-contrib').init(grunt);
var options = helpers.options(this);
var done = this.async... | module.exports = function(grunt) {"use strict";
var Builder = require('../').Builder;
grunt.registerMultiTask("spritesheet", "Compile images to sprite sheet", function() {
var helpers = require('grunt-lib-contrib').init(grunt);
var options = helpers.options(this);
var done = this.async... | Move from `expandFiles` to grunt 0.4's `expand` This largely fixes 0.4 compatibility for me | Move from `expandFiles` to grunt 0.4's `expand`
This largely fixes 0.4 compatibility for me | JavaScript | mit | richardbutler/node-spritesheet |
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 |
a7f2519f6b94ead24084978a611c8f799abf760b | lib/handlers/PostHandler.js | lib/handlers/PostHandler.js | 'use strict';
const BaseHandler = require('./BaseHandler');
const ERRORS = require('../constants').ERRORS;
const EVENT_ENDPOINT_CREATED = require('../constants').EVENT_ENDPOINT_CREATED;
class PostHandler extends BaseHandler {
/**
* Create a file in the DataStore.
*
* @param {object} req http.incom... | 'use strict';
const BaseHandler = require('./BaseHandler');
const ERRORS = require('../constants').ERRORS;
const EVENT_ENDPOINT_CREATED = require('../constants').EVENT_ENDPOINT_CREATED;
class PostHandler extends BaseHandler {
/**
* Create a file in the DataStore.
*
* @param {object} req http.incom... | Remove HTTP as part of POST handler response | Remove HTTP as part of POST handler response | JavaScript | mit | tus/tus-node-server |
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 |
412c8f46f99efeb830bc5683fb238c0fb9990f18 | generators/app/templates/src/__tools-jest._jest.config.js | generators/app/templates/src/__tools-jest._jest.config.js | // https://github.com/thymikee/jest-preset-angular#brief-explanation-of-config
module.exports = {
preset: 'jest-preset-angular',
roots: ['src'],
coverageDirectory: 'reports',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
moduleNameMapper: {
'@app/(.*)': '<rootDir>/src/app/$1',
'@env': '<rootDir... | // https://github.com/thymikee/jest-preset-angular#brief-explanation-of-config
module.exports = {
preset: 'jest-preset-angular',
roots: ['src'],
coverageDirectory: 'reports',
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
moduleNameMapper: {
'@app/(.*)': '<rootDir>/src/app/$1',
'@env': '<rootDir... | Include libraries for transformation with Jest | Include libraries for transformation with Jest
| JavaScript | mit | angular-starter-kit/generator-ngx-app,angular-starter-kit/generator-ngx-app,ngx-rocket/generator-ngx-rocket,ngx-rocket/generator-ngx-rocket,ngx-rocket/generator-ngx-rocket,ngx-rocket/generator-ngx-rocket,angular-starter-kit/generator-ngx-app,angular-starter-kit/generator-ngx-app |
181d2ce8bcffc566f3a3be9d7fca412195ed65f9 | client/views/settings/users/enroll/autoform.js | client/views/settings/users/enroll/autoform.js | AutoForm.addHooks('usersEnrollForm', {
onError (formType, error) {
// Show the error to end user
// TODO: add internationalization support for specefic error type(s)
FlashMessages.sendError(`${error.error}: ${error.reason}`, { autoHide: false });
}
});
| AutoForm.addHooks('usersEnrollForm', {
onError (formType, error) {
// Show the error to end user
// TODO: add internationalization support for specefic error type(s)
// Make sure there is an error type, otherwise don't show error
// to prevent 'unknown' or undefined error messages from triggering fla... | Make sure error type exists before flash message | Make sure error type exists before flash message
| JavaScript | agpl-3.0 | GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing |
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... |
4227a56fe23fdd3c43128c4e86df4e532cd24993 | __tests__/end-to-end/e2e-constants.js | __tests__/end-to-end/e2e-constants.js | export const ENTER_UNICODE = '\u000d';
export const SIMPLE_TEST_TIMEOUT = 10 * 1000;
const NIGHTMARE_ACTION_TIMEOUT = (process.env.CIRCLECI ? 4 : 2) * 1000;
export const NIGHTMARE_CONFIG = {
waitTimeout: NIGHTMARE_ACTION_TIMEOUT,
gotoTimeout: NIGHTMARE_ACTION_TIMEOUT,
loadTimeout: NIGHTMARE_ACTION_TIMEOUT,
exec... | export const ENTER_UNICODE = '\u000d';
export const SIMPLE_TEST_TIMEOUT = 10 * 1000;
const NIGHTMARE_ACTION_TIMEOUT = (process.env.CIRCLECI ? 6 : 2) * 1000;
export const NIGHTMARE_CONFIG = {
waitTimeout: NIGHTMARE_ACTION_TIMEOUT,
gotoTimeout: NIGHTMARE_ACTION_TIMEOUT,
loadTimeout: NIGHTMARE_ACTION_TIMEOUT,
exec... | Increase nightmare action timeout on CI for e2e tests | Increase nightmare action timeout on CI for e2e tests
| JavaScript | mit | thegazelle-ad/gazelle-front-end,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-server,thegazelle-ad/gazelle-front-end,thegazelle-ad/gazelle-server |
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 |
f016db1ff759c47e602e0aaa0984bfbcd694438b | src/main/webapp/components/BuildSnapshotContainer.js | src/main/webapp/components/BuildSnapshotContainer.js | import * as React from "react";
import {BuildSnapshot} from "./BuildSnapshot";
import {Wrapper} from "./Wrapper";
/**
* Container Component for BuildSnapshots.
*
* @param {*} props input property containing an array of build data to be
* rendered through BuildSnapshot.
*/
export const BuildSnapshotContainer = Re... | import * as React from "react";
import {BuildSnapshot} from "./BuildSnapshot";
import {Wrapper} from "./Wrapper";
/**
* Container Component for BuildSnapshots.
*
* @param {*} props input property containing an array of build data to be
* rendered through BuildSnapshot.
*/
export const BuildSnapshotContainer = Re... | Add space between comment summary and @see | Add space between comment summary and @see | JavaScript | apache-2.0 | googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020,googleinterns/step240-2020 |
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 |
2af6a80603f3b17106fb11a15b02636d18540fc3 | src/shared/config.js | src/shared/config.js | import { InjectionToken } from 'yabf'
import { LOG_LEVEL } from '../services'
export const OPTION_PATH_FILE_TOKEN = new InjectionToken()
export const APP_LOG_LEVEL_TOKEN = new InjectionToken()
export const APP_LOG_LEVEL = LOG_LEVEL.ALL
| import { InjectionToken } from 'yabf'
import { LOG_LEVEL } from '../services'
export const OPTION_PATH_FILE_TOKEN = new InjectionToken()
export const APP_LOG_LEVEL_TOKEN = new InjectionToken()
export const APP_LOG_LEVEL = LOG_LEVEL.ERROR
| Set log level to ERROR | Set log level to ERROR
| JavaScript | apache-2.0 | Mindsers/configfile |
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 |
b06898cf54a898a03817599f46c074e2c8901c73 | lib/capabilities.js | lib/capabilities.js | import Oasis from "oasis";
import { services } from "conductor/services";
import { copy } from "conductor/lang";
import { a_indexOf } from "oasis/shims";
function ConductorCapabilities() {
this.capabilities = [
'xhr', 'metadata', 'render', 'data', 'lifecycle', 'height',
'nestedWiretapping' ];
this.services... | import Oasis from "oasis";
import { services } from "conductor/services";
import { copy } from "conductor/lang";
import { a_indexOf } from "oasis/shims";
function ConductorCapabilities() {
this.capabilities = [
'xhr', 'metadata', 'render', 'data', 'lifecycle', 'height',
'nestedWiretapping' ];
this.services... | Fix index check in `removeDefaultCapability`. | Fix index check in `removeDefaultCapability`.
| JavaScript | mit | tildeio/conductor.js |
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 |
922e3caa9810b45a173524a4f9b7b451835c86c0 | index.js | index.js | 'use strict'
var svg = require('virtual-dom/virtual-hyperscript/svg')
var bezier = require('bezier-easing')
var Size = require('create-svg-size')
var Circle = require('./circle')
var Mask = require('./mask')
module.exports = function CircleBounce (data) {
return function render (time) {
var mask = Mask(renderIn... | 'use strict'
var svg = require('virtual-dom/virtual-hyperscript/svg')
var bezier = require('bezier-easing')
var Size = require('create-svg-size')
var Circle = require('./circle')
var Mask = require('./mask')
module.exports = function CircleBounce (data) {
return function render (time) {
var mask = Mask(renderIn... | Multiply inner circle coefficient by .95 to ensure a stroke remains | Multiply inner circle coefficient by .95 to ensure a stroke remains
| JavaScript | mit | bendrucker/circle-bounce |
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 |
e5d46a0a24acd994ccd5c2f59c89f8c7c69485c6 | example/src/pages/MeshPage.js | example/src/pages/MeshPage.js | import React, {Component, PropTypes} from 'react';
import {Akkad, Scene, shapes, cameras, lights, systems} from "akkad";
const googleStorageEndpoint = `http://storage.googleapis.com/akkad-assets-1/`;
const {ArcRotateCamera} = cameras;
const {HemisphericLight} = lights;
const {Mesh, Position, Rotate} = systems;
class... | import React, {Component, PropTypes} from 'react';
import {Akkad, Scene, shapes, cameras, lights, systems} from "akkad";
const googleStorageEndpoint = `https://storage.googleapis.com/akkad-assets-1/`;
const {ArcRotateCamera} = cameras;
const {HemisphericLight} = lights;
const {Mesh, Position, Rotate} = systems;
clas... | Change google storage endpoint to us https | Change google storage endpoint to us https
| JavaScript | mit | brochington/Akkad,cgrinker/Akkad,brochington/Akkad,cgrinker/Akkad |
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 |
8decbaffecdfa2528f6dafaeb3dcde940a208c61 | index.js | index.js | /**
* Turnpike.JS
*
* A lightweight and politely opinionated MVC framework for Node.js. Turnpike can be used as a traditional
* framework, with code generation and rapid deployment, or invoked as a library for more obscure use cases.
*
* Within the framework, some elements will be documented as "plumbing". If you... | /**
* Turnpike.JS
*
* A lightweight and politely opinionated MVC framework for Node.js. Turnpike can be used as a traditional
* framework, with code generation and rapid deployment, or invoked as a library for more obscure use cases.
*
* Within the framework, some elements will be documented as "plumbing". If you... | Declare a few more entry points | Declare a few more entry points
| JavaScript | mit | jay-depot/turnpike,jay-depot/turnpike |
cca531597c989497759bdcf3bbd6cd8da0a0a4ef | index.js | index.js | var es = require('event-stream');
var coffee = require('coffee-script');
var gutil = require('gulp-util');
var formatError = require('./lib/formatError');
var Buffer = require('buffer').Buffer;
module.exports = function(opt){
function modifyFile(file, cb){
if (file.isNull()) return cb(null, file); // pass along
... | var es = require('event-stream');
var coffee = require('coffee-script');
var gutil = require('gulp-util');
var formatError = require('./lib/formatError');
var Buffer = require('buffer').Buffer;
module.exports = function(opt){
function modifyFile(file){
if (file.isNull()) return this.emit('data', file); // pass a... | Use es.through instead of es.map | Use es.through instead of es.map
See https://github.com/gulpjs/gulp/issues/75#issuecomment-31581317
Partial results for continue-on-error behaviour. | JavaScript | mit | steveluscher/gulp-coffee,develar/gulp-coffee,t3chnoboy/gulp-coffee-es6,doublerebel/gulp-iced-coffee,contra/gulp-coffee,coffee-void/gulp-coffee,jrolfs/gulp-coffee,leny/gulp-coffee,stevelacy/gulp-coffee,dereke/gulp-pogo,mattparlane/gulp-coffee,halhenke/gulp-coffee,typicode/gulp-coffee,wearefractal/gulp-coffee |
836cdee104ab82d2d1eebebf403ae415563a20f2 | src/yunity/materialConfig.js | src/yunity/materialConfig.js | export default function materialConfig($mdThemingProvider) {
'ngInject';
$mdThemingProvider.theme('default')
.primaryPalette('pink')
.accentPalette('orange');
} | export default function materialConfig($mdThemingProvider) {
'ngInject';
$mdThemingProvider.theme('default')
.primaryPalette('brown')
.accentPalette('orange');
} | Change primary palette to brown | Change primary palette to brown
| JavaScript | agpl-3.0 | yunity/yunity-webapp-mobile,yunity/yunity-webapp-mobile,yunity/yunity-webapp-mobile |
60aabaa0d9c071939b7960557f122224d4e5231b | config.js | config.js | 'use strict';
/**
* Global config settings.
* (C) 2015 Diego Lafuente.
*/
// requires
var Log = require('log');
// globals
exports.logLevel = 'info';
var log = new Log(exports.logLevel);
exports.limit = 100;
exports.expressPort = 8080;
exports.packagesCollection = 'packages';
exports.mongoConnection = 'mongodb:... | 'use strict';
/**
* Global config settings.
* (C) 2015 Diego Lafuente.
*/
// requires
var Log = require('log');
// globals
exports.logLevel = 'info';
var log = new Log(exports.logLevel);
exports.limit = 100;
exports.expressPort = 8080;
exports.packagesCollection = 'packages';
exports.mongoConnection = 'mongodb:... | Add an empty githubToken to avoid request auth crash | Add an empty githubToken to avoid request auth crash
| JavaScript | mit | alexfernandez/package-quality,alexfernandez/package-quality,alexfernandez/package-quality |
84562c0e47351abb6a2db7d58e58b5820af15131 | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'emberfire-utils'
};
| /* jshint node: true */
'use strict';
var Funnel = require('broccoli-funnel');
var featuresToExclude = [];
function filterFeatures(addonConfig) {
addonConfig.exclude.forEach((exclude) => {
if (exclude === 'firebase-util') {
featuresToExclude.push('**/firebase-util.js');
featuresToExclude.push('**/ha... | Add base code for tree-shaking | Add base code for tree-shaking
| JavaScript | mit | rmmmp/emberfire-utils,rmmmp/emberfire-utils |
e0fc535bba6b9e08548a43ef47b2d692ec0a8119 | index.js | index.js | var fs = require( "fs" );
var path = require( "path" );
var slash = require( "slash" );
var through = require( "through2" );
module.exports = function( jadeFile, options ) {
var scriptTags = "";
options.root = options.root || process.cwd();
var write = function( file, encoding, callback ) {
if( file.path != "und... | var fs = require( "fs" );
var path = require( "path" );
var slash = require( "slash" );
var through = require( "through2" );
module.exports = function( jadeFile, options ) {
var scriptTags = "";
options.root = options.root || process.cwd();
var write = function( file, encoding, callback ) {
if( file.path != "und... | Put newline at end of output | Put newline at end of output
| JavaScript | mit | oliversalzburg/gulp-pug-script,oliversalzburg/gulp-jade-script |
8bb53eb34850bc0ff0cc7aab1a3bacd39b0a6acc | index.js | index.js | 'use strict';
var buttons = require('sdk/ui/button/action');
buttons.ActionButton({
id: 'elasticmarks-sidebar-button',
label: 'Open Elastic Bookmarks Sidebar',
icon: {
'16': './bookmark-16.png',
'32': './bookmark-32.png',
'64': './bookmark-64.png'
},
onClick: handleClick
})... | 'use strict';
var buttons = require('sdk/ui/button/action');
buttons.ActionButton({
id: 'elasticmarks-sidebar-button',
label: 'Open Elastic Bookmarks Sidebar',
icon: {
'16': './bookmark-16.png',
'32': './bookmark-32.png',
'64': './bookmark-64.png'
},
onClick: handleClick
})... | Make tags accessible in sidebar | Make tags accessible in sidebar
The tags as provided by the query are a Set element.
The sidebar js does not understand Set elements, so
we convert the set to an array.
This is prework for issue #4
| JavaScript | agpl-3.0 | micgro42/firefox-addon-elasticmarks,micgro42/firefox-addon-elasticmarks |
d06d593a348d01a633b7ac23babfbe0f96e563ad | index.js | index.js | var path = require('path');
var DtsCreator = require('typed-css-modules');
var loaderUtils = require('loader-utils');
module.exports = function(source, map) {
this.cacheable && this.cacheable();
this.addDependency(this.resourcePath);
var callback = this.async();
// Pass on query parameters as an options objec... | var path = require('path');
var DtsCreator = require('typed-css-modules');
var loaderUtils = require('loader-utils');
module.exports = function(source, map) {
this.cacheable && this.cacheable();
this.addDependency(this.resourcePath);
var callback = this.async();
// Pass on query parameters as an options objec... | Use Object.assign for better performance | Use Object.assign for better performance | JavaScript | mit | olegstepura/typed-css-modules-loader |
7e4d2ccc6a1ecfabcdd70ec73a3d49a1fc835721 | index.js | index.js | var build = require('./build');
var clean = require('./clean');
var copy = require('./copy');
var karma = require('./default-karma.conf');
var lint = require('./lint');
var requirejs = require('./requirejs');
var resolve = require('./resolve');
var test = require('./test');
var teamCity = require('./teamCity');
var typ... | var build = require('./build');
var clean = require('./clean');
var compile = require('./compile');
var copy = require('./copy');
var karma = require('./default-karma.conf');
var lint = require('./lint');
var requirejs = require('./requirejs');
var resolve = require('./resolve');
var teamCity = require('./teamCity');
v... | Add compile and rearrange (alphabetical) | Add compile and rearrange (alphabetical)
| JavaScript | mit | RenovoSolutions/Gulp-Typescript-Utilities,SonofNun15/Gulp-Typescript-Utilities |
5eaee47df9738da4fe488289e2b3220d9585f0ca | index.js | index.js | const Assert = require('assert');
const FS = require('fs');
const Winston = require('winston');
const Factory = require('./lib/factory');
var exceptionLogger;
function isString(str) {
return typeof str === 'string';
}
module.exports = function (namespace) {
var level;
Assert(namespace && isString(namespace)... | const Assert = require('assert');
const FS = require('fs');
const Winston = require('winston');
const Factory = require('./lib/factory');
var exceptionLogger;
function isString(str) {
return typeof str === 'string';
}
module.exports = function (namespace) {
var level;
Assert(namespace && isString(namespace)... | Add exitOnError as optional parameter | Add exitOnError as optional parameter
| JavaScript | mit | onmodulus/logger |
063113769c777c480732856fb66d575856a3b1b4 | app/assets/javascripts/admin/analytics.js | app/assets/javascripts/admin/analytics.js | $(document).ready(function() {
$("#date_range").daterangepicker({ format: 'YYYY-MM-DD' });
$("#date_range").on('apply.daterangepicker', function(ev, picker){
Chartkick.eachChart( function(chart) {
var path, search;
[path, search] = chart.dataSource.split('?')
var params = new URLSearchParams(... | $(document).ready(function() {
$("#date_range").daterangepicker({
locale: { format: 'YYYY-MM-DD' }
});
$("#date_range").on('apply.daterangepicker', function(ev, picker){
Chartkick.eachChart( function(chart) {
var path, search;
[path, search] = chart.dataSource.split('?')
var params = ne... | Fix date ranrge picker format | Fix date ranrge picker format
| JavaScript | agpl-3.0 | EFForg/action-center-platform,EFForg/action-center-platform,EFForg/action-center-platform,EFForg/action-center-platform |
d219f427858f0bf97e2ae13564113e49659acb5b | index.js | index.js | 'use strict'
const port = 5000
var server = require('./server')
server.listen(port, () => console.log('Server is up on port %d.', port))
| 'use strict'
let ENV
try { // look for local environment variable file first
ENV = require('./env')
} catch (LocalEnvFileNotFound) {
ENV = process.env
}
const PORT = ENV.PORT || 5000
let server = require('./server')
server.listen(PORT, () => console.log('Server is up on port %d.', PORT))
| Use port specified in environment for server | Use port specified in environment for server
| JavaScript | mit | mooniker/captran |
24f59d9b90e634932e801870ade69e2fa6cd9a84 | index.js | index.js | 'use strict';
var catchErrors = require('./lib/catchErrors');
var log = require('./lib/log');
var transportConsole = require('./lib/transports/console');
var transportFile = require('./lib/transports/file');
var transportRemote = require('./lib/transpo... | 'use strict';
var catchErrors = require('./lib/catchErrors');
var log = require('./lib/log');
var transportConsole = require('./lib/transports/console');
var transportFile = require('./lib/transports/file');
var transportRemote = require('./lib/transpo... | Add log function for compatibility with Console API | Add log function for compatibility with Console API
| JavaScript | mit | megahertz/electron-log,megahertz/electron-log,megahertz/electron-log |
2dfb621099b647dd5b513fef9abc02256dcd74ec | index.js | index.js | var ls = require('ls');
var fs = require('fs');
exports.generate = function(dir) {
if(dir === undefined || dir === null) {
dir = __dirname;
}
fs.mkdir(dir);
var decks = ls(__dirname + "/decks/*.js");
for(var i = 0, len = decks.length; i < len; i++) {
var json = require(decks[i].full)... | var ls = require('ls');
var fs = require('fs');
exports.generate = function(dir) {
if(dir === undefined || dir === null) {
dir = __dirname;
}
fs.mkdir(dir, 0777, function(err) {
if(err && err.code != 'EEXIST') {
return console.error(err);
}
var decks = ls(__dirnam... | Handle mkdir error when directory exists | Handle mkdir error when directory exists
| JavaScript | mit | DataDecks/DataDecks-Data |
14edb196096b9263a5e119a69a83d729dc0607f2 | api/signup/index.js | api/signup/index.js | var async = require( 'async' );
var Validation = require( './validation' );
var Data = require( './data' );
var Output = require( './output' );
var utils = require( '../utils' );
var validationError = require( '../utils/error_messages' ).validationError;
exports.userSignup = function ( req, res ) {
async.waterfa... | var async = require( 'async' );
var Data = require( './data' );
var Output = require( './output' );
var utils = require( '../utils' );
exports.userSignup = function ( req, res ) {
async.waterfall( [
function ( callback ) {
req.checkBody( 'email', "Must be an email address" ).isEmail();
... | Clean out old validation stuff from Signup | Clean out old validation stuff from Signup
| JavaScript | mit | projectweekend/Node-Backend-Seed |
09920accba7a74d481e57b6389af6c45b3307375 | index.js | index.js | var rollbar = require("rollbar");
module.exports = {
install: function(Vue, options) {
Vue.rollbar = rollbar.init(options);
}
};
| var Rollbar = require("rollbar");
module.exports = {
install: function(Vue, options) {
Vue.rollbar = new Rollbar(options);
}
};
| Use new Rollbar initialization method | Use new Rollbar initialization method
| JavaScript | mit | Zevran/vue-rollbar,Zevran/vue-rollbar |
03a39b08a64b898717a46405c92d67b285dae98f | index.js | index.js | var fs = require('fs');
var postcss = require('postcss');
var autoprefixer = require('autoprefixer');
var app = 'src/app.css';
var dist = 'dist/build.css';
var css = fs.readFileSync(app);
postcss([autoprefixer])
.process(css, {
from: app,
to: dist
})
.then(function(res) {
fs.writeFileSync(dist, res... | var fs = require('fs');
var postcss = require('postcss');
var autoprefixer = require('autoprefixer');
var app = 'src/app.css';
var dist = 'dist/build.css';
var css = fs.readFileSync(app);
var processors = [
autoprefixer({
browsers: ['> 1%', 'last 2 versions'],
cascade: false
})
];
postcss(processors)
... | Store processors into array. Pass through options to Autoprefixer. | Store processors into array. Pass through options to Autoprefixer.
| JavaScript | mit | cahamilton/postcss-test |
8ef4d85fd4fcc1a90841730fd01b3dd95354bd9c | index.js | index.js | module.exports = {
parser: 'babel-eslint',
extends: 'airbnb',
globals: {
describe: true,
it: true,
},
};
| module.exports = {
parser: 'babel-eslint',
extends: 'airbnb',
globals: {
before: true,
beforeEach: true,
after: true,
afterEach: true,
describe: true,
it: true,
},
};
| Allow some more test functions. | Allow some more test functions.
| JavaScript | mit | crewmeister/eslint-config-crewmeister |
fb3cfeda6e6f3dcb7c72df8ae750005067b7ed94 | test/docco_test.js | test/docco_test.js | "use strict"
var grunt = require('grunt');
var rr = require("rimraf");
exports.docco = {
tests: function(test) {
var css = grunt.file.read("docs/docco.css");
var html = grunt.file.read("docs/docco.html");
test.expect(2);
test.equal(css.length, 7207, "Should create CSS.");
test.equal(html.l... | "use strict";
var grunt = require('grunt');
var rr = require("rimraf");
exports.docco = {
tearDown: function (callback) {
rr('docs', function(){});
callback();
},
tests: function(test) {
var css = grunt.file.read("docs/docco.css");
var html = grunt.file.read("docs/docco.html");
test.e... | Change of assertion to not depend on exact file length. Removal of docs moved to tearDown, to call it on test failure. | Change of assertion to not depend on exact file length. Removal of docs moved to tearDown, to call it on test failure.
| JavaScript | mit | DavidSouther/grunt-docco,neocotic/grunt-docco,joseph-jja/grunt-docco-dir,joseph-jja/grunt-docco-dir |
1a54820bbac1c3fff9f68ecee7b979cb9679bbc8 | index.js | index.js | var importcss = require('rework-npm')
, rework = require('rework')
, variables = require('rework-vars')
, path = require('path')
, read = require('fs').readFileSync
module.exports = function (opts, cb) {
opts = opts || {}
var css = rework(read(opts.entry, 'utf8'))
css.use(importcss(path.dirname(opts.entr... | var importcss = require('rework-npm')
, rework = require('rework')
, variables = require('rework-vars')
, path = require('path')
, read = require('fs').readFileSync
module.exports = function (opts, cb) {
opts = opts || {}
var css = rework(read(opts.entry, 'utf8'))
css.use(importcss(path.dirname(opts.entr... | Add opts.plugins for specifying additional rework plugins | Add opts.plugins for specifying additional rework plugins | JavaScript | mit | atomify/atomify-css |
5904b6e737d32dd743a2c323c56e105ab5a710b6 | gulpfile.babel.js | gulpfile.babel.js | 'use strict';
import gulp from 'gulp';
import ignite from 'gulp-ignite';
import browserify from 'gulp-ignite-browserify';
import babelify from 'babelify';
import inject from 'gulp-inject';
import uglify from 'uglify-js';
const ASSET_PATH = './src/Bonfire.JavascriptLoader/Assets';
const INJECT_PATH = './src/Bonfire.Ja... | 'use strict';
import gulp from 'gulp';
import ignite from 'gulp-ignite';
import browserify from 'gulp-ignite-browserify';
import babelify from 'babelify';
import inject from 'gulp-inject';
import uglify from 'uglify-js';
import yargs from 'yargs';
const ASSET_PATH = './src/Bonfire.JavascriptLoader/Assets';
const INJE... | Add ability to build other js files | Add ability to build other js files
| JavaScript | mit | buildabonfire/Bonfire.JavascriptLoader,buildabonfire/Bonfire.JavascriptLoader,buildabonfire/Bonfire.JavascriptLoader |
e8dffdae918fd10fdc547b80a10c5fb09e8fe188 | app/scripts/map-data.js | app/scripts/map-data.js | (function(window, undefined) {
var data = window.data = window.data || { };
var map = data.map = data.map || { };
map['Germany'] = [52.5, 13.4];
map['France'] = [48.9, 2.4];
})(window); | (function(window, undefined) {
var data = window.data = window.data || { };
var map = data.map = data.map || { };
map['Germany'] = [52.5, 13.4];
map['France'] = [48.9, 2.4];
map['Spain'] = [40.4, -3.7];
map['Russia'] = [55.7, 37.6];
map['Italy'] = [41.9, 12.5];
map['Ukraine'] = [50.5, 30.5];
map['Swe... | Add remaining capitals for FPO dataset | Add remaining capitals for FPO dataset
| JavaScript | apache-2.0 | SF-Housing-Visualization/mids-sf-housing-visualization,SF-Housing-Visualization/mids-sf-housing-visualization |
5190e1409985f4c1e1268772fd378e8a275c128e | index.js | index.js | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-sinon',
options: {
nodeAssets: {
'sinon': {
import: [{ path: 'pkg/sinon.js', type: 'test' }]
}
}
},
included: function (app) {
this._super.included.apply(this, arguments);
app.import('vendor/shims/sinon... | /* jshint node: true */
'use strict';
module.exports = {
name: 'ember-sinon',
options: {
nodeAssets: {
'sinon': {
import: [{ path: 'pkg/sinon.js', type: 'test' }]
}
}
},
included: function(app) {
this._super.included.apply(this, arguments);
while (typeof app.import !== 'f... | Add support for being a nested dependency | Add support for being a nested dependency
| JavaScript | mit | csantero/ember-sinon,csantero/ember-sinon |
2b5ca9641957a664b772d8d146273abd0fcf286b | index.js | index.js | const loaderUtils = require('loader-utils');
const path = require('path');
const deepMerge = require('./lib/deep-merge');
module.exports = function(source) {
const HEADER = '/**** Start Merge Loader ****/';
const FOOTER = '/**** End Merge Loader ****/';
const callback = this.async();
const options = loaderUtil... | const loaderUtils = require('loader-utils');
const path = require('path');
const deepMerge = require('./lib/deep-merge');
module.exports = function(source) {
const callback = this.async();
const options = loaderUtils.getOptions(this);
const overridePath = path.resolve(__dirname,
`test/cases/lib/${options.ove... | Remove unnecessary variables in loader | Remove unnecessary variables in loader
| JavaScript | mit | bitfyre/config-merge-loader |
c22b100cbd55f6bb4e4097f2def34839f5d70780 | packages/generator-react-server/generators/app/templates/test.js | packages/generator-react-server/generators/app/templates/test.js | import cp from 'child_process';
import http from 'http';
import test from 'ava';
let rs;
test.before('start the server', async () => {
rs = cp.spawn('npm', ['start']);
rs.stderr.on('data', data => console.error(data.toString()));
await sleep(10000);
});
test('server is running', async t => {
t.is(200, await getR... | import cp from 'child_process';
import http from 'http';
import test from 'ava';
let rs;
test.before('start the server', async () => {
rs = cp.spawn('npm', ['start']);
rs.stderr.on('data', data => console.error(data.toString()));
await sleep(15000);
});
test('server is running', async t => {
t.is(200, await getR... | Increase wait time for server start to 15s | Increase wait time for server start to 15s
| JavaScript | apache-2.0 | emecell/react-server,lidawang/react-server,redfin/react-server,lidawang/react-server,emecell/react-server,redfin/react-server |
33ab3db66a6f37f0e8c8f48a19035464fea358c1 | index.js | index.js | import { Kefir as K } from "kefir";
const NEVER = K.never();
const ZERO = K.constant(0);
const ADD1 = (x) => x + 1;
const SUBTRACT1 = (x) => x - 1;
const ALWAYS = (x) => () => x;
const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i);
function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = ... | import { Kefir as K } from "kefir";
const NEVER = K.never();
const ZERO = K.constant(0);
const ADD1 = (x) => x + 1;
const SUBTRACT1 = (x) => x - 1;
const ALWAYS = (x) => () => x;
const delay = (n, s) => s.slidingWindow(n + 1, 2).map(([i, _]) => i);
function galvo({ advance = NEVER, recede = NEVER, index = ZERO } = ... | Change slides variable to collection | Change slides variable to collection
| JavaScript | mit | standard-library/galvo |
266931cf123010a232981421b96c6d7381f9fe57 | index.js | index.js | 'use strict';
var ejs = require('ejs');
var fs = require('fs');
exports.name = 'ejs';
exports.outputFormat = 'xml';
exports.compile = ejs.compile;
exports.compileClient = function (source, options) {
options = options || {};
options.client = true;
return exports.compile(source, options).toString();
};
exports.... | 'use strict';
var ejs = require('ejs');
var fs = require('fs');
exports.name = 'ejs';
exports.outputFormat = 'html';
exports.compile = ejs.compile;
exports.compileClient = function (source, options) {
options = options || {};
options.client = true;
return exports.compile(source, options).toString();
};
exports... | Use `'html'` as output format | Use `'html'` as output format
Per jstransformers/jstransformer#3.
| JavaScript | mit | jstransformers/jstransformer-ejs,jstransformers/jstransformer-ejs |
aba731a6b68d09a065e2b97c4eff2d51a86195e1 | index.js | index.js | const express = require('express');
const helmet = require('helmet');
const winston = require('winston');
const bodyParser = require('body-parser');
const env = require('./src/env');
var server = express();
var router = require('./src/router');
var PORT = env.PORT || 8000;
server.use(bodyParser.urlencoded({ extended:... | const express = require('express');
const helmet = require('helmet');
const winston = require('winston');
const bodyParser = require('body-parser');
const env = require('./src/env');
var server = express();
var router = require('./src/router');
var PORT = env.PORT || 8000;
server.use(bodyParser.json());
server.use(he... | Switch to use JSON payload parser | fix: Switch to use JSON payload parser
| JavaScript | mit | NSAppsTeam/nickel-bot |
4dec8ace74bc153a67cd32b1e5be026bfbf852be | index.js | index.js | /**
* A lightweight promise-based Reddit API wrapper.
* @module reddit-api
*/
exports = module.exports = Reddit;
function Reddit() {
this.baseApiUrl = 'http://www.reddit.com';
return this;
};
/**
* Logs in a Reddit user.
*
* @param {string} username
* @param {string} password
*/
Reddit.prototype.lo... | /**
* A lightweight promise-based Reddit API wrapper.
* @module reddit-api
*/
exports = module.exports = Reddit;
function Reddit() {
this._baseApiUrl = 'http://www.reddit.com';
return this;
};
/**
* Logs in a Reddit user.
*
* @param {string} username
* @param {string} password
*/
Reddit.prototype.l... | Use underscore for private properties | Use underscore for private properties
| JavaScript | mit | imiric/reddit-api |
5a58033f8cc97ac0d07b220ac73c8ae76a34d5c3 | index.js | index.js | /*!
* Mongoose findOrCreate Plugin
* Copyright(c) 2012 Nicholas Penree <nick@penree.com>
* MIT Licensed
*/
function findOrCreatePlugin(schema, options) {
schema.statics.findOrCreate = function findOrCreate(conditions, doc, options, callback) {
if (arguments.length < 4) {
if (typeof options === 'functio... | /*!
* Mongoose findOrCreate Plugin
* Copyright(c) 2012 Nicholas Penree <nick@penree.com>
* MIT Licensed
*/
function findOrCreatePlugin(schema, options) {
schema.statics.findOrCreate = function findOrCreate(conditions, doc, options, callback) {
if (arguments.length < 4) {
if (typeof options === 'functio... | Use doc instead of conditions | Use doc instead of conditions | JavaScript | mit | yura415/mongoose-findorcreate |
3bc450b26c681b10efc3144e1e83cd97f703aa3b | app/models/users.js | app/models/users.js | 'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var User = new Schema({
name: String,
username: String,
password: String,
date: Date
});
module.exports = mongoose.model('User', User);
| 'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var User = new Schema({
name: String,
username: String,
password: String,
date: Date,
friends: Array
});
module.exports = mongoose.model('User', User);
| Add friends column to store info | Add friends column to store info
| JavaScript | mit | mirabalj/graphriend,mirabalj/graphriend |
bb95b8a1375f5bd395e6cb9d3db40b7b427d12b7 | production/defaults/collective.js | production/defaults/collective.js | var CELOS_USER = "celos";
var CELOS_DEFAULT_OOZIE = "http://oozie002.ny7.collective-media.net:11000/oozie";
var CELOS_DEFAULT_HDFS = "hdfs://nameservice1";
var NAME_NODE = CELOS_DEFAULT_HDFS;
var JOB_TRACKER = "admin1.ny7.collective-media.net:8032";
var HIVE_METASTORE = "thrift://hive002.ny7.collective-media.net:9... | var CELOS_USER = "celos";
var CELOS_DEFAULT_OOZIE = "http://oozie002.ny7.collective-media.net:11000/oozie";
var CELOS_DEFAULT_HDFS = "hdfs://nameservice1";
var NAME_NODE = CELOS_DEFAULT_HDFS;
var JOB_TRACKER = "admin1.ny7.collective-media.net:8032";
var HIVE_METASTORE = "thrift://hive002.ny7.collective-media.net:9... | Add etl002 FQDN to Celos Oozie default properties. | Add etl002 FQDN to Celos Oozie default properties.
| JavaScript | apache-2.0 | collectivemedia/celos,collectivemedia/celos,collectivemedia/celos |
f086077dd8eee8503192c13f646e9d63231e0174 | app/routes/index.js | app/routes/index.js | import Ember from 'ember';
import ResetScrollMixin from '../mixins/reset-scroll';
import Analytics from 'ember-osf/mixins/analytics';
/**
* @module ember-preprints
* @submodule routes
*/
/**
* Loads all disciplines and preprint providers to the index page
* @class Index Route Handler
*/
export default Ember.Ro... | import Ember from 'ember';
import ResetScrollMixin from '../mixins/reset-scroll';
import Analytics from 'ember-osf/mixins/analytics';
/**
* @module ember-preprints
* @submodule routes
*/
/**
* Loads all disciplines and preprint providers to the index page
* @class Index Route Handler
*/
export default Ember.Ro... | Use highlighted taxonomies instead of top level taxonomies | Use highlighted taxonomies instead of top level taxonomies
| JavaScript | apache-2.0 | laurenrevere/ember-preprints,baylee-d/ember-preprints,baylee-d/ember-preprints,laurenrevere/ember-preprints,CenterForOpenScience/ember-preprints,CenterForOpenScience/ember-preprints |
08b84474bedcc17f810289364b91011ebd6219ec | public/javascripts/application.js | public/javascripts/application.js | $(document).ready(function() {
$('.add_child').click(function() {
var assoc = $(this).attr('data-association');
var content = $('#' + assoc + '_fields_template').html();
var regexp = new RegExp('new_' + assoc, 'g')
var new_id = new Date().getTime();
$(this).parent().before(content.rep... | $(document).ready(function() {
$('.add_child').click(function() {
var assoc = $(this).attr('data-association');
var content = $('#' + assoc + '_fields_template').html();
var regexp = new RegExp('new_' + assoc, 'g')
var new_id = new Date().getTime();
$(this).parent().before(content.rep... | Add a missing return false at the end of a jquery event | Add a missing return false at the end of a jquery event
| JavaScript | mit | timriley/complex-form-examples,timriley/complex-form-examples |
c333a80c898397ff2905a67cf2b28b1833157841 | public/modules/common/readMode.js | public/modules/common/readMode.js | 'use strict';
angular.module('theLawFactory')
.directive('readMode', ['$location', function($location) {
return {
restrict: 'A',
controller: function($scope) {
$scope.read = $location.search()['read'] === '1';
$scope.readmode = function () {
$("#sidebar").ad... | 'use strict';
angular.module('theLawFactory')
.directive('readMode', ['$location', function($location) {
return {
restrict: 'A',
controller: function($rootScope, $scope) {
$rootScope.read = $location.search()['read'] === '1';
$rootScope.readmode = function () {
... | Move readmode to root scope | Move readmode to root scope
Prevents incorrect angular scope inheritance behaviour (calling $scope.readmode()
would set the "read" variable on the calling scope, not in the readMode controller
scope).
| JavaScript | agpl-3.0 | regardscitoyens/the-law-factory,regardscitoyens/the-law-factory,regardscitoyens/the-law-factory |
0716c83e8ec9bbd3b7359d962c95ecb1b43e00e4 | application/src/main/resources/assets/js/app/controller.js | application/src/main/resources/assets/js/app/controller.js | define([
'backbone',
'marionette'
], function(Backbone, Marionette) {
var Controller = Marionette.Controller.extend({
initialize: function(options) {
this.app = options.app;
this.addressBar = new Backbone.Router();
},
navigateHome: function() {
th... | define([
'backbone',
'marionette'
], function(Backbone, Marionette) {
var Controller = Marionette.Controller.extend({
initialize: function(options) {
this.app = options.app;
},
navigateHome: function() {
Backbone.history.navigate('/');
console.log... | Call Backbone.history directly (instead of through a dummy router) | Call Backbone.history directly (instead of through a dummy router)
| JavaScript | apache-2.0 | tumbarumba/dropwizard-marionette,tumbarumba/dropwizard-marionette,tumbarumba/dropwizard-marionette |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.