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 |
|---|---|---|---|---|---|---|---|---|---|
bea896c7f4571997e4ca5c2315a5fa5788394820 | src/ecs/controller.js | src/ecs/controller.js | import * as ecsChanges from './changes';
const ECSController = {
[ecsChanges.ENTITY_CREATE]: (change, store, notify) => {
const { id, template } = change.data;
// Manipulate change data to include entity data
change.data.entity = store.state.create(id, template);
notify(change);
},
[ecsChanges.EN... | import * as ecsChanges from './changes';
const ECSController = {
[ecsChanges.ENTITY_CREATE]: (change, store, notify) => {
const { id, template } = change.data;
// Manipulate change data to include entity data
let entity = store.state.create(id);
change.data.entity = entity;
for (let name in templ... | Change entity create to call set event | Change entity create to call set event
| JavaScript | mit | yoo2001818/ecsalator |
b457dff3afca3a9d1f297b71571fa85310e4dbc6 | lib/node_modules/@stdlib/repl/ctor/lib/fs_alias_args.js | lib/node_modules/@stdlib/repl/ctor/lib/fs_alias_args.js | /**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | /**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | Rename function and update description | Rename function and update description
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib |
cf4c6b5384aa965748f59390029fce86f33d4df8 | app/lib/angular-ui-bootstrap-addOns/ui-bootstrap-addOns-0.1.0.js | app/lib/angular-ui-bootstrap-addOns/ui-bootstrap-addOns-0.1.0.js | angular.module('ui.bootstrapAddOns.collapse',['ui.bootstrap.transition'])
.directive('collapsableelement', function() {
return {
restrict: 'E',
replace: true,
scope: {
name: '='
},
transclude: true,
template: '<div class="collapse" collapse="isExpand" ng-transclude></div>... | angular.module('ui.bootstrapAddOns.collapse',['ui.bootstrap.transition'])
.directive('collapsableelement', function() {
return {
restrict: 'E',
replace: true,
scope: {
name: '='
},
transclude: true,
template: '<div class="collapse" collapse="isCollapse" ng-transclude></di... | Set collapsable element's initial state to collapse. | Set collapsable element's initial state to collapse.
| JavaScript | mit | mbmihura/horseShoeApp,mbmihura/goodHotel,mbmihura/goodHotel,mbmihura/goodHotel,mbmihura/horseShoeApp,mbmihura/horseShoeApp,mbmihura/goodHotel,mbmihura/horseShoeApp |
b864482da93015a8246d89c5d5ab6d9c56e04538 | app.js | app.js | // Bring in our dependencies
const app = require('express')();
const routes = require('./routes');
YAML = require('yamljs');
const swaggerDoc = YAML.load('./openapi.yaml');
const swaggerTools = require('swagger-tools');
swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {
// Serve the Swagger docume... | // Bring in our dependencies
const app = require('express')();
const routes = require('./routes');
YAML = require('yamljs');
const swaggerDoc = YAML.load('./openapi.yaml');
const swaggerTools = require('swagger-tools');
// Add Swagger docs
swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {
// Serv... | Enable CORS as this is publicly accessible content. | Enable CORS as this is publicly accessible content.
| JavaScript | apache-2.0 | AngusMorton/blur-api |
2b77f03977435e4b444f9bce1db511bc2325c1b5 | main.js | main.js |
require([], function() {
'use strict';
function makeFileDrop(el, callback) {
if (typeof el === 'string') {
el = document.getElementById(el);
if (!el) {
console.error('filedrop element not found');
return;
}
el.addEventListener('dragenter', function(e) {
el.... |
require([ByteSource], function(ByteSource) {
'use strict';
function makeFileDrop(el, callback) {
if (typeof el === 'string') {
el = document.getElementById(el);
if (!el) {
console.error('filedrop element not found');
return;
}
el.addEventListener('dragenter', funct... | Create a ByteSource for a dropped file | Create a ByteSource for a dropped file | JavaScript | mit | radishengine/drowsy,radishengine/drowsy |
f46de5a4f66291b95ca5e08de3ee1f7c02d21f72 | grunt/contrib-watch.js | grunt/contrib-watch.js | // Watch project files for and spawn associated tasks upon changes
module.exports = function(grunt) {
grunt.config('watch', {
options: {
spawn: false
},
// svg: {
// files: 'src/icons/*.svg',
// tasks: ['svgstore'],
// },
assemble: {
... | // Watch project files for and spawn associated tasks upon changes
module.exports = function(grunt) {
grunt.config('watch', {
options: {
spawn: false
},
// svg: {
// files: 'src/icons/*.svg',
// tasks: ['svgstore'],
// },
assemble: {
... | Simplify watching handlebars files for assemble | Simplify watching handlebars files for assemble
| JavaScript | mit | yellowled/yl-bp,yellowled/yl-bp |
fc5bb9c9b254e3646b90f6b6ce37bfaf64f1129f | main.js | main.js | 'use strict';
var visitors = require('./vendor/fbtransform/visitors');
var transform = require('jstransform').transform;
module.exports = {
transform: function(code, options) {
var visitorList;
if (options && options.harmony) {
visitorList = visitors.getAllVisitors();
} else {
visitorList = ... | 'use strict';
var visitors = require('./vendor/fbtransform/visitors');
var transform = require('jstransform').transform;
var Buffer = require('buffer').Buffer;
module.exports = {
React: React,
transform: function(input, options) {
options = options || {};
var result = transform(visitors.react, input, opti... | Add sourceMap option to react-tools transform | Add sourceMap option to react-tools transform
Allow tools like grunt-react to include inline source maps in the
generated JavaScript. Browserify can then combine these source maps when
bundling everything together.
Usage:
```
var transform = require('react-tools').transform;
var output = transform(jsxContent, {
so... | JavaScript | bsd-3-clause | JanChw/react,afc163/react,AlexJeng/react,kevin0307/react,STRML/react,nathanmarks/react,alvarojoao/react,Riokai/react,billfeller/react,angeliaz/react,isathish/react,chrisjallen/react,vincentnacar02/react,ArunTesco/react,DJCordhose/react,SpencerCDixon/react,acdlite/react,jorrit/react,linqingyicen/react,0x00evil/react,Zho... |
31b722c4a34cb4c11eca66ebf556ae4cc880b4cb | redef/patron-client/src/backend/utils/queryConstants.js | redef/patron-client/src/backend/utils/queryConstants.js | module.exports = {
queryDefaults: {
size: 100
},
defaultAggregates: {
facets: {
global: {},
aggs: {}
}
},
defaultPublicationFields: [
'agents^10',
'author^50',
'country',
'desc',
'ean',
'format',
'inst',
'isbn',
'ismn',
'language',
'mainTitle... | module.exports = {
queryDefaults: {
size: 100
},
defaultAggregates: {
facets: {
global: {},
aggs: {}
}
},
defaultPublicationFields: [
'agents^10',
'author^50',
'country',
'desc',
'ean',
'format',
'inst',
'isbn',
'ismn',
'language',
'mainTitle... | Add mainTitle.raw to default work search field | Add mainTitle.raw to default work search field | JavaScript | mit | digibib/ls.ext,digibib/ls.ext,digibib/ls.ext,digibib/ls.ext |
e4e254c41f4752185497e0c0dfa15541fb625606 | addon/transforms/string.js | addon/transforms/string.js | import { isNone as none } from '@ember/utils';
import Transform from './transform';
/**
The `DS.StringTransform` class is used to serialize and deserialize
string attributes on Ember Data record objects. This transform is
used when `string` is passed as the type parameter to the
[DS.attr](../../data#method_att... | import { isNone as none } from '@ember/utils';
import Transform from './transform';
/**
The `DS.StringTransform` class is used to serialize and deserialize
string attributes on Ember Data record objects. This transform is
used when `string` is passed as the type parameter to the
[DS.attr](./DS/methods/attr?anc... | Update broken link to DS.attr docs | Update broken link to DS.attr docs
Closes #5816 | JavaScript | mit | HeroicEric/data,arenoir/data,arenoir/data,HeroicEric/data,HeroicEric/data,HeroicEric/data,arenoir/data,arenoir/data |
9cc0ea273961994e92a6b61fecd2c548720e1466 | test/attributes_test.js | test/attributes_test.js | /*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function(el, document) {
test("creating element attributes", ... | /*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function(el, document) {
test("creating an element with attri... | Add more tests for the most common attributes | Add more tests for the most common attributes
| JavaScript | mit | webmat/sugar_dom |
1c879ba5b61a94ea5370a74760f0bb08407ffcf0 | feedpaper-web/params.js | feedpaper-web/params.js | var fs = require('fs');
var p = require('path');
var slug = require('slug');
var url = require('url');
var util = require('util');
slug.defaults.mode ='rfc3986';
var env = process.env['FEEDPAPER_ENV'];
var feedsCategories = JSON.parse(fs.readFileSync(p.join('..', 'conf', env, 'feeds.json')));
var conf = JSON.pa... | var fs = require('fs');
var p = require('path');
var slug = require('slug');
var url = require('url');
var util = require('util');
slug.defaults.mode ='rfc3986';
var env = process.env['FEEDPAPER_ENV'];
var feedsCategories = JSON.parse(fs.readFileSync(p.join('../conf', env, 'feeds.json')));
var conf = JSON.parse... | Split feeds and app config locations. | Split feeds and app config locations.
| JavaScript | mit | cliffano/feedpaper,cliffano/feedpaper,cliffano/feedpaper |
98f8d7f51c32718e741d4daa60f4fa9aeeee3bfb | services/document-updater/app/js/DiffCodec.js | services/document-updater/app/js/DiffCodec.js | const DMP = require('diff-match-patch')
const dmp = new DMP()
module.exports = {
ADDED: 1,
REMOVED: -1,
UNCHANGED: 0,
diffAsShareJsOp(before, after, callback) {
const diffs = dmp.diff_main(before.join('\n'), after.join('\n'))
dmp.diff_cleanupSemantic(diffs)
const ops = []
let position = 0
... | const DMP = require('diff-match-patch')
const dmp = new DMP()
// Do not attempt to produce a diff for more than 100ms
dmp.Diff_Timeout = 0.1
module.exports = {
ADDED: 1,
REMOVED: -1,
UNCHANGED: 0,
diffAsShareJsOp(before, after, callback) {
const diffs = dmp.diff_main(before.join('\n'), after.join('\n'))
... | Set the diff-match-patch timeout to 100ms | Set the diff-match-patch timeout to 100ms
This might result in worse diffs, but we don't want to spend a second
blocking the event loop while we figure out nicer diffs when comparing
documents.
| JavaScript | agpl-3.0 | sharelatex/sharelatex |
f6a50cacd8cd7663650d3ff5557cc20bfcdcd765 | test/data/testrunner.js | test/data/testrunner.js | jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
| jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
// load testswarm agent
(function() {
var url = window.location.search;
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
if ( !url || url.indexOf("http") !== 0 ) {
return;
}
document.write("<scr" + "ipt src='http://... | Handle auto-running of the TestSwarm injection script in the test suite. | Handle auto-running of the TestSwarm injection script in the test suite.
| JavaScript | mit | dtjm/jquery,chitranshi/jquery,RubyLouvre/jquery,scottjehl/jquery,sancao2/jquery,jquery/jquery,fat/jquery,roytoo/jquery,chitranshi/jquery,hoorayimhelping/jquery,gnarf/jquery,diracdeltas/jquery,Karyotyper/jquery,sancao2/jquery,isaacs/jquery,rwaldron/jquery,roytoo/jquery,eburgos/jquery,diracdeltas/jquery,jquery/jquery,jcu... |
8137d89ff6d3584b10eda4a982de5ecc808b6d5e | app/extension-scripts/main.js | app/extension-scripts/main.js | (function() {
chrome.browserAction.onClicked.addListener(function() {
var appUrl = chrome.extension.getURL('index.html');
chrome.tabs.create({ url: appUrl });
});
})();
| (function() {
chrome.browserAction.onClicked.addListener(function() {
if (chrome.extension.inIncognitoContext) {
var appUrl = chrome.extension.getURL('index.html');
chrome.tabs.create({ url: appUrl });
} else {
chrome.runtime.openOptionsPage();
}
});
})();
| Maintain current operation for non-incognito mode | Maintain current operation for non-incognito mode
| JavaScript | mit | 48klocs/DIM,chrisfried/DIM,DestinyItemManager/DIM,delphiactual/DIM,bhollis/DIM,DestinyItemManager/DIM,chrisfried/DIM,48klocs/DIM,chrisfried/DIM,delphiactual/DIM,bhollis/DIM,bhollis/DIM,48klocs/DIM,LouisFettet/DIM,delphiactual/DIM,bhollis/DIM,delphiactual/DIM,DestinyItemManager/DIM,LouisFettet/DIM,DestinyItemManager/DIM... |
fdbde68e9f9cdf5a17b0b8e0e17503883a86dbca | src/parser.js | src/parser.js | import chrono from 'chrono-node'
import militaryParser from './parsers/militaryParser'
import requireMeridiemRefiner from './refiners/requireMeridiemRefiner'
import impliedAMEndRefiner from './refiners/impliedAMEndRefiner'
import impliedPMStartRefiner from './refiners/impliedPMStartRefiner'
import dayOverlapRefiner fro... | import chrono from 'chrono-node'
import militaryParser from './parsers/militaryParser'
import requireMeridiemRefiner from './refiners/requireMeridiemRefiner'
import impliedAMEndRefiner from './refiners/impliedAMEndRefiner'
import impliedPMStartRefiner from './refiners/impliedPMStartRefiner'
import dayOverlapRefiner fro... | Change isValid to isRange and include results | Change isValid to isRange and include results
| JavaScript | agpl-3.0 | chadfawcett/entry-parser,tickbin/parser,chadfawcett/parser |
0d086a6d56be0431f5e3cb9957bf0d44e0307fb3 | server/config/middleware.js | server/config/middleware.js | const path = require('path');
const morgan = require('morgan');
const bodyParser = require('body-parser');
const webpack = require('webpack');
const webpackConfig =
require(process.env.WEBPACK_CONFIG ? process.env.WEBPACK_CONFIG : '../../webpack.config');
const compiler = webpack(webpackConfig);
module.exports = (... | const path = require('path');
const morgan = require('morgan');
const bodyParser = require('body-parser');
const webpack = require('webpack');
const webpackConfig =
require(process.env.WEBPACK_CONFIG ? process.env.WEBPACK_CONFIG : '../../webpack.config');
const compiler = webpack(webpackConfig);
module.exports = (... | Add wildcard condition to handle navigation to non-root url | Add wildcard condition to handle navigation to non-root url
| JavaScript | mit | alexxisroxxanne/SpeechDoctor,nonchalantkettle/SpeechDoctor,nonchalantkettle/SpeechDoctor,alexxisroxxanne/SpeechDoctor |
794152d31c540bc5bf3c4bb3a7588cb65a851e8b | src/Receiver.js | src/Receiver.js | var events = require("events");
var io = require('socket.io-client');
var Receiver = function () {};
Receiver.prototype = new events.EventEmitter;
Receiver.prototype.connect = function() {
var self = this;
var socket = io.connect(window.location.href);
console.log('Connected to socket server: ' + window.locatio... | var events = require("events");
var io = require('socket.io-client');
var Receiver = function () {};
Receiver.prototype = new events.EventEmitter;
Receiver.prototype.connect = function() {
var self = this;
var socket = io.connect(window.location.href);
console.log('Connected to socket server: ' + window.locatio... | Allow receiver to emit control events | Allow receiver to emit control events
| JavaScript | mit | Dermah/pulsar,Dermah/pulsar |
471a09849042ce3de94c562e24373b0895b9d65a | website/src/app/global.components/mc-editable-header.component.js | website/src/app/global.components/mc-editable-header.component.js | angular.module('materialscommons').component('mcEditableHeader', {
template: `
<div layout="column" layout-align="start stretch">
<span ng-if="!$ctrl.editField"
ng-click="$ctrl.editField = true"
ng-class="$ctrl.headerClasses"
style="cursor: pointer">
... | angular.module('materialscommons').component('mcEditableHeader', {
template: `
<div layout="column" layout-align="start stretch">
<span ng-if="!$ctrl.editField"
ng-click="$ctrl.editField = true"
ng-class="$ctrl.headerClasses"
style="cursor: pointer">
... | Add onChange handle to call back when a field has been changed. | Add onChange handle to call back when a field has been changed.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
14fbf0fca60e6f0000c742157a3b26e89204de29 | page/app.js | page/app.js | var registerMiddleware = require('./middleware'),
registerModel = require('./model'),
registerApi = require('./api');
module.exports = function setup(options, imports, register) {
var frontend = imports.frontend.app,
backend = imports.backend,
content = imports.content,
security = i... | var registerMiddleware = require('./middleware'),
registerModel = require('./model'),
registerApi = require('./api');
module.exports = function setup(options, imports, register) {
var frontend = imports.frontend.app,
backend = imports.backend,
content = imports.content,
security = i... | Add addType method to page | Add addType method to page
| JavaScript | mit | bauhausjs/bauhausjs,bauhausjs/bauhausjs,bauhausjs/bauhausjs,bauhausjs/bauhausjs |
bbfce8fcfa43c0bf74ef39f6c70e933a6c7d00dc | Client/Components/Router.js | Client/Components/Router.js | const styles = require('../Style/style.js')
import React, { Component } from 'react'
import { Navigator } from 'react-native'
import HomeMap from './HomeMap'
import ParkingDetails from './ParkingDetails'
export default class Router extends Component {
constructor(props) {
super(props)
this.state = {}
th... | const styles = require('../Style/style.js')
import React, { Component } from 'react'
import { Navigator } from 'react-native'
import HomeMap from './HomeMap'
import ParkingDetails from './ParkingDetails'
export default class Router extends Component {
constructor(props) {
super(props)
this.state = {}
th... | Add navbar prop to router. | Add navbar prop to router.
| JavaScript | mit | JabroniZambonis/pLot |
41ebaa36e8ac4d85c29c2299fb8f2a3fd29619de | packages/strapi-utils/lib/packageManager.js | packages/strapi-utils/lib/packageManager.js | const shell = require('shelljs');
const _ = require('lodash');
let isStrapiInstalledWithNPM;
const watcher = (cmd) => {
const data = shell.exec(cmd, {
silent: true,
});
if (data.stderr && data.code !== 0) {
throw new Error('Command not found');
}
return data.stdout.toString();
};
try {
const d... | const shell = require('shelljs');
const { includes } = require('lodash');
let isStrapiInstalledWithNPM;
let skipCheck = false;
const watcher = (cmd) => {
const data = shell.exec(cmd, {
silent: true,
});
if (includes(data.stderr, 'command not found') && data.code !== 0) {
console.log('ERRRRR');
thro... | Remove yarn check when creating an application in dev mode | Remove yarn check when creating an application in dev mode
| JavaScript | mit | wistityhq/strapi,wistityhq/strapi |
f6fe0df19dd3299a1b5a6ca2f38bdaeef949fe05 | web/google-analytics.js | web/google-analytics.js | var _gaq = [
['_setAccount', 'UA-7409939-1'],
['_trackPageview']
];
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = '//www.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
}(document, 'script'));
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('cr... | Update to current google analytics | Update to current google analytics | JavaScript | mit | beautify-web/js-beautify,bitwiseman/js-beautify,bitwiseman/js-beautify,beautify-web/js-beautify,beautify-web/js-beautify,bitwiseman/js-beautify,bitwiseman/js-beautify,beautify-web/js-beautify |
ab57ad3b7547089eee9a2fb4484c370ef6730c2a | src/js/app.js | src/js/app.js | // JS Goes here - ES6 supported
if (window.netlifyIdentity) {
window.netlifyIdentity.on('login', () => {
document.location.href = '/admin/';
});
}
| // JS Goes here - ES6 supported
if (window.netlifyIdentity && !window.netlifyIdentity.currentUser()) {
window.netlifyIdentity.on('login', () => {
document.location.href = '/admin/';
});
}
| Fix issue with always redirecting to /admin when logged in | Fix issue with always redirecting to /admin when logged in
| JavaScript | mit | koiamericas/one-click-hugo-cms,mobarreto/one-click-hugo-cms,dwaiba/one-click-hugo-cms,karsens/one-click-hugo-cms,PolymerChar/polymerchar-cms,philipppolder/ppolder,ranasingh/psn-hugo-cms,ecerecerez/one-click-hugo-cms,hvp17/netlify-cms-test,covingtondoan/radiorounds,biilmann/cms-identity-demo,thgrace/one-click-hugo-cms,p... |
2f6e2af43a473aea737894c7fc7f13ff6ee40970 | delay.safariextension/start.js | delay.safariextension/start.js | (function () {
"use strict";
var settings, id;
if (window !== window.top) {
return;
}
safari.self.tab.dispatchMessage('getSettings');
safari.self.addEventListener('message', function (event) {
if (event.name === 'settings') {
settings = event.message;
... | (function () {
"use strict";
var settings, display;
if (window !== window.top) {
return;
}
safari.self.tab.dispatchMessage('getSettings');
safari.self.addEventListener('message', function (event) {
if (event.name === 'settings') {
settings = event.message;
... | Switch from delay ID to direct style manipulation. | Switch from delay ID to direct style manipulation.
I was having trouble with the extension CSS file so I figured this was
easier.
| JavaScript | mit | tfausak/delay |
06aa89d3c7ea350032bbaa6cb5f91f7a6ec9b05d | lib/assets/javascripts/cartodb/common/vendor_scripts_view.js | lib/assets/javascripts/cartodb/common/vendor_scripts_view.js | var cdb = require('cartodb.js-v3');
module.exports = cdb.core.View.extend({
initialize: function () {
this.config = this.options.config;
this.assetsVersion = this.options.assetsVersion;
this.user = this.options.user;
this.template = cdb.templates.getTemplate('common/views/vendor_scripts');
},
re... | var cdb = require('cartodb.js-v3');
module.exports = cdb.core.View.extend({
initialize: function () {
this.config = this.options.config;
this.assetsVersion = this.options.assetsVersion;
this.user = this.options.user;
this.template = cdb.templates.getTemplate('common/views/vendor_scripts');
},
re... | Change vendor script view to not be strictly couple to a user. | Change vendor script view to not be strictly couple to a user.
For public views, we will not have a user.
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,splashblot/dronedb,CartoDB/cartodb,splashblot/dronedb,splashblot/dronedb,splashblot/dronedb,splashblot/dronedb,CartoDB/cartodb |
4970ba2cc6bd0da65c96ae0159a825e0e0bd5359 | src/Backend/Modules/Profiles/Js/Components/MassAddToGroup.js | src/Backend/Modules/Profiles/Js/Components/MassAddToGroup.js | export class MassAddToGroup {
constructor () {
// update the hidden input for the new group's ID with the remembered value
const $txtNewGroup = $('input[name="newGroup"]')
// clone the groups SELECT into the "add to group" mass action dialog
$('.jsMassActionAddToGroupSelectGroup').replaceWith(
... | export class MassAddToGroup {
constructor () {
// update the hidden input for the new group's ID with the remembered value
const $txtNewGroup = $('input[name="newGroup"]')
// clone the groups SELECT into the "add to group" mass action dialog
$('.jsMassActionAddToGroupSelectGroup').replaceWith(
... | Remove the first empty option after duplicating the filter group dropdown | Remove the first empty option after duplicating the filter group dropdown
| JavaScript | mit | justcarakas/forkcms,justcarakas/forkcms,justcarakas/forkcms |
63c7b8dc868f14e2454671530a1b7d6753085294 | src/LondonTravel.Site/assets/scripts/js/serviceWorker.js | src/LondonTravel.Site/assets/scripts/js/serviceWorker.js | // Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
(function () {
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("/service-worker.js")
.... | // Copyright (c) Martin Costello, 2017. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
(function () {
if ("serviceWorker" in navigator) {
navigator.serviceWorker
.register("/service-worker.js")
.... | Remove service worker registration log | Remove service worker registration log
Remove the service worker registration log message as it fires on every
page load (seemingly).
| JavaScript | apache-2.0 | martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site |
6e32495111b623fdce16b50fbf710551ade8b02a | node_modules/nad_os_util/index.js | node_modules/nad_os_util/index.js | var os = require('os'),
exec = require('child_process').exec;
exports.lookup_hostname = function (callback) {
var os_type = os.type();
var process_hostname = function(error, stdout, stderr) {
if ( error != null ) {
console.error("Could not look up hostname: " + error);
p... | var os = require('os'),
exec = require('child_process').exec;
exports.lookup_hostname = function (callback) {
var os_type = os.type();
var process_hostname = function(error, stdout, stderr) {
if ( error != null ) {
console.error("Could not look up hostname: " + error);
p... | Make progress toward auto-registration for FreeBSD | Make progress toward auto-registration for FreeBSD
| JavaScript | bsd-3-clause | HeinrichHartmann/nad,sean-/nad,sean-/nad,esproul/nad,sean-/nad,maier/nad,circonus-labs/nad,hjhart/nad,sean-/nad,esproul/nad,keithf4/nad,maier/nad,hjhart/nad,esproul/nad,esproul/nad,sean-/nad,HeinrichHartmann/nad,maier/nad,circonus-labs/nad,maier/nad,hjhart/nad,HeinrichHartmann/nad,hjhart/nad,hjhart/nad,HeinrichHartmann... |
87cecc4104dbf7191d54d90827eb6c520ed62abb | src/components/TeamPage.js | src/components/TeamPage.js | import * as actions from '../actions/StatusActions'
import React from 'react'
import TeamList from './TeamList'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
export const TeamPage = (props) => {
return (
<div>
<h2 className="alt-header">{props.region.name}</h2>
<TeamLis... | import * as actions from '../actions/StatusActions'
import React from 'react'
import TeamList from './TeamList'
import TeamListItem from './TeamListItem'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
export const TeamPage = (props) => {
let memberItems = props.region.members.map(member... | Add LOK members to the team list | Add LOK members to the team list
| JavaScript | mit | nathejk/status-app,nathejk/status-app |
686bbdfe596daff89f0844fb60c6f61d6bdaf020 | modules/orders/client/config/orders.client.config.js | modules/orders/client/config/orders.client.config.js | (function () {
'use strict';
angular
.module('orders')
.run(menuConfig);
menuConfig.$inject = ['Menus'];
function menuConfig(Menus) {
// Set top bar menu items
Menus.addMenuItem('topbar', {
title: 'Orders',
state: 'orders',
type: 'dropdown',
roles: ['*']
});
//... | (function () {
'use strict';
angular
.module('orders')
.run(menuConfig);
menuConfig.$inject = ['Menus'];
function menuConfig(Menus) {
// Set top bar menu items
Menus.addMenuItem('topbar', {
title: 'Orders',
state: 'orders.list',
type: 'item',
roles: ['*']
});
M... | Change the Cart and Orders top bar again | Change the Cart and Orders top bar again
| JavaScript | mit | JavaScriptAcademy/oneStep,JavaScriptAcademy/oneStep,JavaScriptAcademy/oneStep |
2e92c020312d6ff50a92c5b684c6bc5a0576ed97 | vertical-scroll-mouse-move.js | vertical-scroll-mouse-move.js | $(function(){
var $container = $("#container"),
$blocks = $("#blocks"),
heightContainer = $container.outerHeight(),
scrolledHeight = $container[0].scrollHeight,
mousePos = 0,
posY = 0,
hDiff = ( scrolledHeight / heightContainer ) - 1
$container.mouse... | (function($){
var $container = $("#container"),
$blocks = $("#blocks"),
heightContainer = $container.outerHeight(),
scrolledHeight = $container[0].scrollHeight,
mousePos = 0,
posY = 0,
hDiff = ( scrolledHeight / heightContainer ) - 1
$container.mouse... | Enable usage of $ sign | Enable usage of $ sign | JavaScript | mit | ristaa/vertical-scroll-on-mouse-move,ristaa/vertical-scroll-on-mouse-move |
f0e9de4e24076b45eda37b55c39d18d32483e20f | examples/html/main.js | examples/html/main.js | (function () {
// Check that the browser supports the FileReader API.
if (typeof FileReader === 'undefined') {
document.write('<strong>Sorry, your web browser does not support the FileReader API.</strong>');
return;
}
var handleFile = function (evt) {
var files = evt.target.files;
var reader = new FileReade... | (function () {
// Check that the browser supports the FileReader API.
if (!window.FileReader) {
document.write('<strong>Sorry, your web browser does not support the FileReader API.</strong>');
return;
}
var handleFile = function (evt) {
var files = evt.target.files;
var reader = new FileReader();
reader.o... | Change to nicer check for FileReader | Change to nicer check for FileReader
| JavaScript | mpl-2.0 | mattiasw/ExifReader |
b2f20baa20d39150539e921a1c4cfa59bae0b8d3 | jquery.characount.js | jquery.characount.js | (function($) {
"use strict";
function countCharactersLeft() {
var counting = setTimeout(function() {
if (counting) clearTimeout(counting);
var $input = $(this);
var charCountLabelTarget = $input.data('characount-label-target');
var limit = parseInt( $inp... | (function($) {
"use strict";
function countCharactersLeft() {
var $input = $(this);
var counting = setTimeout(function() {
if (counting) clearTimeout(counting);
var charCountLabelTarget = $input.data('characount-label-target');
var limit = parseInt( $input.at... | Add IE8 compatibility by avoiding .bind() | Add IE8 compatibility by avoiding .bind()
| JavaScript | mit | dhl/jquery.characount |
dc93cf46dd0c41d7c2b2b883e160efe7b78251d2 | src/reducers/PagesReducer.js | src/reducers/PagesReducer.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { DataTablePageReducer } from '../pages/dataTableUtilities/reducer/DataTablePageReducer';
import getPageInitialiser from '../pages/dataTableUtilities/getPageInitialiser';
/**
* Redux reducer controlling the `pages` field.
* @param {Object} sta... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { DataTablePageReducer } from '../pages/dataTableUtilities/reducer/DataTablePageReducer';
import getPageInitialiser from '../pages/dataTableUtilities/getPageInitialiser';
import { FINALISE_ACTIONS } from '../actions/FinaliseActions';
/**
* Redu... | Add finalise action handling in pages reducer | Add finalise action handling in pages reducer
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
01532689c6382e710675a629893021f3f99f68d0 | register.js | register.js | var postmortem = require('./lib');
// Automatically install postmortem when this postmortem/register is required.
postmortem.install();
module.exports = postmortem;
| var postmortem = require('./lib');
// Automatically install postmortem when this postmortem/register is required.
postmortem.install({handleUncaughtExceptions: false});
module.exports = postmortem;
| Make postmortem play nice with mocha. | Make postmortem play nice with mocha.
| JavaScript | mit | zeekay/postmortem |
d6f089d73d7b7c55643e6d46c0ab6fac0cf48571 | src/router.js | src/router.js | import Vue from "vue";
import Router from "vue-router";
import Search from "./views/Search.vue";
import Live from "@/views/Live.vue";
// import Stats from '@/views/Stats.vue'
Vue.use(Router);
export default new Router({
mode: "history",
base: process.env.BASE_URL,
routes: [
{
path: "/",
name: "s... | import Vue from "vue";
import Router from "vue-router";
import Search from "./views/Search.vue";
// import Live from "@/views/Live.vue";
// import Stats from '@/views/Stats.vue';
Vue.use(Router);
export default new Router({
mode: "history",
base: process.env.BASE_URL,
linkActiveClass: "is-active",
routes: [
... | Set Live page as a webpack chunk | Set Live page as a webpack chunk
| JavaScript | mit | predbdotovh/website-vuejs,predbdotovh/website-vuejs |
279ca9fa0d7dbc00949106155a7ada5ad8d705ff | src/routes.js | src/routes.js | import React, { Component } from "react"
import { Route } from "react-router"
import AppContainer from "./AppContainer"
import { PageContainer as PhenomicPageContainer } from "phenomic"
import Page from "./layouts/Page"
import PageError from "./layouts/PageError"
import PageLoading from "./layouts/PageLoading"
import... | import React, { Component } from "react"
import { Route } from "react-router"
import AppContainer from "./AppContainer"
import { default as PhenomicPageContainer } from "phenomic/lib/PageContainer"
import Page from "./layouts/Page"
import PageError from "./layouts/PageError"
import PageLoading from "./layouts/PageLoad... | Fix import path of PageContainer | Fix import path of PageContainer
| JavaScript | mit | thangngoc89/blog |
d99e710e5aa3d1b61662afdd9292bd8bc65ac151 | Snowflake.Node/snowflake.js | Snowflake.Node/snowflake.js | var najax = require("najax");
var Promise = require('promise');
var Snowflake = function Snowflake(snowflakeUrl) {
var instance = this;
this.snowflakeUrl = snowflakeUrl;
this.platforms = {};
this.games = {};
this.loadGames = function () {
return this.ajax('', '').then(function (response) {... | var najax = require("najax");
var Promise = require('promise');
var Snowflake = function Snowflake(snowflakeUrl) {
var instance = this;
this.snowflakeUrl = snowflakeUrl;
this.platforms = {};
this.games = {};
this.loadGames = function () {
return this.ajax('Core', 'Game.GetAllGames').then(f... | Make load methods call proper ajax urls | Make load methods call proper ajax urls
| JavaScript | mpl-2.0 | SnowflakePowered/snowflake,faint32/snowflake-1,SnowflakePowered/snowflake,RonnChyran/snowflake,RonnChyran/snowflake,RonnChyran/snowflake,faint32/snowflake-1,SnowflakePowered/snowflake,faint32/snowflake-1 |
8d75565cb4bfa5bae4c5e85ea94ba7d585284a56 | src/lib/setEnvVariables.js | src/lib/setEnvVariables.js | "use strict";
const _ = require("lodash");
/**
* Set Serverless environment variables for local invocations
*
* @param {Serverless} serverless - Serverless Instance
* @param {Map<String>} environment - Resolved environment
*/
function setEnvVariables(serverless, environment) {
const functions = _.get(serverless... | "use strict";
const _ = require("lodash");
/**
* Set Serverless environment variables for local invocations
*
* @param {Serverless} serverless - Serverless Instance
* @param {Map<String>} environment - Resolved environment
*/
function setEnvVariables(serverless, environment) {
const functions = _.get(serverless... | Fix issue with multiple functions | Fix issue with multiple functions
| JavaScript | mit | arabold/serverless-export-env |
b8988e0b39892b9755e266bb5d52b89f3f2776c8 | src/routes/Morph/styles.js | src/routes/Morph/styles.js | import * as v from '../../styles/variables'
const styles = {
section: {
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-between',
alignItems: 'stretch',
alignContent: 'flex-start',
width: '100%'
},
container: {
position: 'relative',
width: '100%'
},
dataInput: {
... | import * as v from '../../styles/variables'
const styles = {
section: {
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-between',
alignItems: 'stretch',
alignContent: 'flex-start',
width: '100%'
},
container: {
position: 'relative',
width: '100%',
height: `calc(100% ... | Adjust MorphForm textarea boxes to fill available height | Adjust MorphForm textarea boxes to fill available height
| JavaScript | agpl-3.0 | nai888/langua,nai888/langua |
0349efd62c73919f2e9137301d7be4c06825210f | packages/truffle-compile/test/compilerSupplier/loadingStrategies/LoadingStrategy.js | packages/truffle-compile/test/compilerSupplier/loadingStrategies/LoadingStrategy.js | const assert = require("assert");
const sinon = require("sinon");
const request = require("request-promise");
const {
LoadingStrategy
} = require("../../../compilerSupplier/loadingStrategies");
let result;
describe("LoadingStrategy base class", () => {
beforeEach(() => {
instance = new LoadingStrategy();
});... | const assert = require("assert");
const {
LoadingStrategy
} = require("../../../compilerSupplier/loadingStrategies");
let result, expectedDefaultConfig;
describe("LoadingStrategy base class", () => {
beforeEach(() => {
instance = new LoadingStrategy();
expectedDefaultConfig = {
versionsUrl: "https://... | Add basic test for default config values | Add basic test for default config values
| JavaScript | mit | ConsenSys/truffle |
467a7beda11f83464971272a4da2202fbdc917f6 | src/apps/search/transformers.js | src/apps/search/transformers.js | const { find } = require('lodash')
const { transformInvestmentProjectToListItem } = require('../investment-projects/transformers')
const { transformContactToListItem } = require('../contacts/transformers')
const { buildPagination } = require('../../lib/pagination')
const { buildSearchAggregation } = require('./builder... | const { find } = require('lodash')
const { transformInvestmentProjectToListItem } = require('../investment-projects/transformers')
const { transformContactToListItem } = require('../contacts/transformers')
const { buildPagination } = require('../../lib/pagination')
const { buildSearchAggregation } = require('./builder... | Allow transformResultsToCollection to fallback to other props | Allow transformResultsToCollection to fallback to other props | JavaScript | mit | uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend |
86127e1bf70f90088080dedf22fe3c84298cc1ec | server/index.js | server/index.js | const app = new (require('koa'))()
const send = require('koa-send')
const path = require('path')
const config = require('./config.json')
app.use(require('koa-static')(path.join(__dirname, '/../dist/')))
app.use(async (ctx, next) => {
await send(ctx, (path.join(__dirname, '/../dist/index.ht... | const app = new (require('koa'))()
const send = require('koa-send')
const path = require('path')
const config = require('./config.json')
app.use(require('koa-static')(path.join(__dirname, '/../dist/')))
app.use(async (ctx, next) => {
await send(ctx, (path.join('/../dist/index.html')))
})
a... | Correct error handling route path. | Correct error handling route path.
| JavaScript | mit | Limeishu/limeishu.org,Limeishu/limeishu.org |
71ed66c0477ce81b98a48a6db4bccf1343507135 | src/methods/streetLevel.js | src/methods/streetLevel.js | const makeRequest = require('../common/makeRequest')
const PATHS = require('../common/paths')
/**
* Make a request for street level crimes based on a location.
* @param {number} latitude - A number representing a latitude value.
* @param {number} longitude - A number representing a longitude value.
* @returns {pro... | const makeRequest = require('../common/makeRequest')
const PATHS = require('../common/paths')
/**
* Make a request for street level crimes based on a location.
* @param {number} latitude - A number representing a latitude value.
* @param {number} longitude - A number representing a longitude value.
* @param {strin... | Add date to street level | Add date to street level
| JavaScript | mit | AlexChesters/ukpd,AlexChesters/ukpd,AlexChesters/ukpd |
21cfd61642adadef6a611a9c7120c6469febef80 | static/src/utils/requests.js | static/src/utils/requests.js | export const loadJSON = (url, postData = undefined) => new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open(postData ? 'post' : 'get', url, true);
xhr.responseType = 'json';
xhr.onload = () => {
const { status } = xhr;
if (status === 200) {
resolve(xhr.response);
} els... | export const loadJSON = (url, postData) => new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open(postData ? 'post' : 'get', url, true);
xhr.responseType = 'json';
xhr.onload = () => {
const { status } = xhr;
if (status === 200) {
resolve(xhr.response);
} else {
re... | Remove undefined default parameter value | Remove undefined default parameter value
| JavaScript | mit | ffont/freesound-explorer,ffont/freesound-explorer,ffont/freesound-explorer |
08277c0e2e65ca355cccdf9233085b3c36d4cf7b | src/roll.js | src/roll.js | const qs = require('qs');
module.exports.handler = (event, context, callback) => {
/** Immediate response for WarmUP plugin */
if (event.source === 'serverless-plugin-warmup') {
console.log('WarmUP - Lambda is warm!');
return callback(null, 'Lambda is warm!');
}
const body = qs.parse(event.body);
co... | const qs = require('qs');
module.exports.handler = (event, context, callback) => {
/** Immediate response for WarmUP plugin */
if (event.source === 'serverless-plugin-warmup') {
console.log('WarmUP - Lambda is warm!');
return callback(null, 'Lambda is warm!');
}
const body = qs.parse(event.body);
co... | Remove @ in front of 'You'. | Remove @ in front of 'You'.
| JavaScript | mit | jaypeng2015/decision-maker,jaypeng2015/decision-maker |
4d85918485f253530769584544773d50b1bbed6d | src/components/overviewPage/OverviewPage.js | src/components/overviewPage/OverviewPage.js | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import OverviewPageBody from './OverviewPageBody';
import OverviewPageHeader from './OverviewPageHeader';
import Box from '../box';
class OverviewPage extends PureComponent {
render() {
const { children, className, ...others } = th... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import OverviewPageBody from './OverviewPageBody';
import OverviewPageHeader from './OverviewPageHeader';
import Box from '../box';
class OverviewPage extends PureComponent {
render() {
const { children, className, ...others } = th... | Set subcomponent display names for proper documentation | Set subcomponent display names for proper documentation
| JavaScript | mit | teamleadercrm/teamleader-ui |
376319915e6b06df84de61fabb9ce587cecc7775 | test/specTest.js | test/specTest.js | 'use strict';
var auth = require('./auth.json');
var sinon = require('sinon');
var expect = require('chai').expect;
var should = require('chai').should();
var request = require('request');
describe('SAP module', function () {
var sap;
function initModule(auth) {
sap = require('../index')(auth);
}
before... | 'use strict';
var auth = require('./auth.json');
var sinon = require('sinon');
var expect = require('chai').expect;
var should = require('chai').should();
var request = require('request');
describe('SAP module', function () {
var sap;
function initModule(auth) {
sap = require('../index')(auth);
}
before... | Refactor unit test to use `sinon.test` for automatic cleanup | Refactor unit test to use `sinon.test` for automatic cleanup
| JavaScript | mit | DarylRodrigo/node-sap |
94aea594476618936e3f6936a0277dc6790e15e3 | src/util.js | src/util.js | export function responseOk(response) {
if(response.status >= 200 && response.status < 300) {
return response
} else {
throw new Error(response.statusText)
}
}
export function responseToJson(response) {
return response.json()
}
// Store array with mappings from numerical to hex representation
const _he... | export function responseOk(response, throwError=Error) {
if(response.status >= 200 && response.status < 300) {
return response
} else {
throw new throwError(response.statusText)
}
}
export function responseToJson(response) {
return response.json()
}
// Store array with mappings from numerical to hex r... | Support responseOk for custom errors | Support responseOk for custom errors
| JavaScript | mit | LivelyKernel/lively4-core,LivelyKernel/lively4-core |
c2d570481a5f58bb47f8fa41e9b90f818b717314 | src/js/shared/render-form.js | src/js/shared/render-form.js | const tag = require('forms/lib/tag');
const MULTIPLE_FIELD_TYPES = ['multipleCheckbox', 'multipleRadio'];
function isMultipleField(type) {
return MULTIPLE_FIELD_TYPES.includes(type);
}
module.exports = function (name, field, options = { }) {
const widgetHtml = field.widget.toHTML(name, field);
const innerConte... | const tag = require('forms/lib/tag');
const MULTIPLE_FIELD_TYPES = ['multipleCheckbox', 'multipleRadio'];
function isMultipleField(type) {
return MULTIPLE_FIELD_TYPES.includes(type);
}
module.exports = function (name, field, options = { }) {
const widgetHtml = field.widget.toHTML(name, field);
const innerConte... | Use fieldsets rather than divs | Use fieldsets rather than divs
| JavaScript | mit | hackcambridge/hack-cambridge-website,hackcambridge/hack-cambridge-website,hackcambridge/hack-cambridge-website,hackcambridge/hack-cambridge-website |
c43cf78d794dd870e7e90ad94bbb501d10236503 | src/reducers/workspace/evaluationReducer.js | src/reducers/workspace/evaluationReducer.js | import {
BRICK,
MAIN_BRICK,
PRIMITIVE,
SELECTABLE_PIPE
} from '../../utils/componentNames'
import {
elementInputValueIds,
evalBrick
} from '../../utils/evalUtils'
export const evaluateAllWorkspaces = (workspace, elementId) => {
const brick = workspace.entities[elementId]
const valueIds = elementInputV... | import {
BRICK,
MAIN_BRICK,
PRIMITIVE,
SELECTABLE_PIPE
} from '../../utils/componentNames'
import {
elementInputValueIds,
evalBrick
} from '../../utils/evalUtils'
export const evaluateAllWorkspaces = (workspace, elementId) => {
const brick = workspace.entities[elementId]
const valueIds = elementInputV... | Delete function 'evalNewPipe' not used anymore | Delete function 'evalNewPipe' not used anymore
| JavaScript | agpl-3.0 | lambdabricks/bricks-front-react |
50daaa500507d38299c6ff307e8d5c59bf6eb343 | lib/models/patch/filter.js | lib/models/patch/filter.js | export const MAX_PATCH_CHARS = 10240;
export function filter(original, fileSet) {
let accumulating = false;
let accumulated = '';
let includedChars = 0;
let index = 0;
while (index !== -1) {
let include = true;
const result = original.indexOf('\ndiff --git ', index);
const nextIndex = result !=... | export const MAX_PATCH_CHARS = 10 * 1024 * 1024;
export function filter(original) {
let accumulating = false;
let accumulated = '';
let includedChars = 0;
let index = 0;
while (index !== -1) {
let include = true;
const result = original.indexOf('\ndiff --git ', index);
const nextIndex = result ... | Remove unused argument and increase patch size limit | Remove unused argument and increase patch size limit
| JavaScript | mit | atom/github,atom/github,atom/github |
4709b7b06444237bfab42bc5c627b9308022dadb | app/initializers/active-model-adapter.js | app/initializers/active-model-adapter.js | import ActiveModelAdapter from "active-model-adapter";
import ActiveModelSerializer from "active-model-adapter/active-model-serializer";
export default {
name: 'active-model-adapter',
initialize: function(registry, application) {
registry.register('adapter:-active-model', ActiveModelAdapter);
registry.regi... | import ActiveModelAdapter from "active-model-adapter";
import ActiveModelSerializer from "active-model-adapter/active-model-serializer";
export default {
name: 'active-model-adapter',
initialize: function() {
var application = arguments[1] || arguments[0];
application.register('adapter:-active-model', Acti... | Fix initializer deprecation warning for >= ember 2.1.0 | Fix initializer deprecation warning for >= ember 2.1.0
| JavaScript | mit | bmac/active-model-adapter,bmac/active-model-adapter,bmac/active-model-adapter,fivetanley/active-model-adapter,jcope2013/active-model-adapter,ember-data/active-model-adapter,ember-data/active-model-adapter,bmac/active-model-adapter,fivetanley/active-model-adapter,jcope2013/active-model-adapter,fivetanley/active-model-ad... |
7184387eecc8f8183cd44dd315ab6304ac05a000 | addon/services/is-mobile.js | addon/services/is-mobile.js | import Service from 'ember-service';
import get from 'ember-metal/get';
import set from 'ember-metal/set';
import computed from 'ember-computed';
import getOwner from 'ember-owner/get';
import isMobile from 'ismobilejs';
export default Service.extend({
fastboot: computed(function() {
return getOwner(this).looku... | import Service from 'ember-service';
import get, { getProperties } from 'ember-metal/get';
import set from 'ember-metal/set';
import computed from 'ember-computed';
import getOwner from 'ember-owner/get';
import isMobile from 'ismobilejs';
export default Service.extend({
fastboot: computed(function() {
return g... | Whitelist params returned from isMobile | Whitelist params returned from isMobile
Fixes bugs where the environment leaks through isMobile.
| JavaScript | mit | sandydoo/ember-is-mobile,sandydoo/ember-is-mobile |
87ebd3ea4596e4285519b84a818ddd68d78b847a | security.js | security.js | /* eslint-disable import/no-unresolved */
import SimpleSchema from 'simpl-schema';
import MessageBox from 'message-box';
MessageBox.defaults({
messages: {
en: {
Untrusted: 'Inserts/Updates from untrusted code not supported',
},
},
});
SimpleSchema.denyUntrusted = function denyUntr... | /* eslint-disable import/no-unresolved */
import { Meteor } from 'meteor/meteor';
import SimpleSchema from 'simpl-schema';
import MessageBox from 'message-box';
/* We check for server code here to deal with a buffer issue in meteor-message-box
* This shouldn't be a major issue as I doubt we will need to display this ... | Fix issue with MessageBox causing a Buffer is not defined on client. | Fix issue with MessageBox causing a Buffer is not defined on client.
| JavaScript | mit | copleykj/socialize-base-model |
a3ae230b5354db67f3ac03f9d926e7e0f4a4ca80 | mac/resources/open_WIND.js | mac/resources/open_WIND.js | define(['mac/roman'], function(macintoshRoman) {
'use strict';
return function(resource) {
var dataDV = new DataView(resource.data.buffer, resource.data.byteOffset, resource.data.byteLength);
resource.dataObject = {
initialRectangle: {
top: dataDV.getInt16(0, false),
left: dataDV.g... | define(['mac/roman'], function(macintoshRoman) {
'use strict';
return function(item) {
return item.getBytes().then(function(bytes) {
var dataDV = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
var dataObject = {
initialRectangle: {
top: dataDV.getInt16(0, false... | Update WIND to new loader format | Update WIND to new loader format | JavaScript | mit | radishengine/drowsy,radishengine/drowsy |
299a77c1f9c764af242834cff581e83a1cc854f7 | unittests/Athena-Entities/scripts/Entity_Children.js | unittests/Athena-Entities/scripts/Entity_Children.js | scene = new Athena.Entities.Scene('test');
entity1 = scene.create("Entity1");
CHECK_EQUAL(0, entity1.nbChildren);
entity2 = scene.create("Entity2");
CHECK(entity2.parent === undefined);
entity1.addChild(entity2);
CHECK_EQUAL(1, entity1.nbChildren);
CHECK(entity2.parent !== undefined);
CHECK_EQUAL('Entity1', enti... | scene = new Athena.Entities.Scene('test');
entity1 = scene.create("Entity1");
CHECK_EQUAL(0, entity1.nbChildren);
entity2 = scene.create("Entity2");
CHECK(entity2.parent === undefined);
entity1.addChild(entity2);
CHECK_EQUAL(1, entity1.nbChildren);
CHECK(entity2.parent !== undefined);
CHECK_EQUAL('Entity1', enti... | Remove an incorrectly copy/pasted line | [Unittests] Remove an incorrectly copy/pasted line
| JavaScript | mit | Kanma/Athena-Entities,Kanma/Athena-Entities,Kanma/Athena-Entities |
aa433fb93894939273e822a8854ca235328d8f87 | test/collect.js | test/collect.js | var xenstat = require('../build/Release/xenstat.node');
module.exports = {
'Collect asynchronous': function(test) {
xenstat.collect(function(err, stats) {
test.ifError(err);
test.ok(stats && typeof stats === 'object');
test.ok(stats.num_domains >= 1);
test.strictEqual(Object.keys(stats).l... | var xenstat = require('../build/Release/xenstat.node');
module.exports = {
'Collect asynchronous': function(test) {
xenstat.collect(function(err, stats) {
test.ifError(err);
test.ok(stats && typeof stats === 'object');
test.ok(stats.num_domains >= 1);
test.ok(stats.domains && stats.domain... | Add test to check length of domains array matches num_domains | Add test to check length of domains array matches num_domains
| JavaScript | mit | siboulet/node-xenstat,siboulet/node-xenstat,siboulet/node-xenstat |
b4494903556d668d01f1f00a44008974c59bf05b | app/js/arethusa.morph/directives/morph_form_attributes.js | app/js/arethusa.morph/directives/morph_form_attributes.js | "use strict";
angular.module('arethusa.morph').directive('morphFormAttributes', [
'morph',
'$document',
function(morph, $document) {
return {
restrict: 'A',
scope: {
form: '=morphFormAttributes',
tokenId: '='
},
link: function(scope, element, attrs) {
var id = ... | "use strict";
angular.module('arethusa.morph').directive('morphFormAttributes', [
'morph',
function(morph) {
return {
restrict: 'A',
scope: {
form: '=morphFormAttributes',
tokenId: '='
},
link: function(scope, element, attrs) {
var id = scope.tokenId;
sc... | Remove more unneeded DI in mFA | Remove more unneeded DI in mFA
| JavaScript | mit | Masoumeh/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,Masoumeh/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa |
d860e221a0e20cf3435f6455d6c830f6ac6b8bec | packages/haste-map-webpack-resolver-demo-webpack2/webpack.config.js | packages/haste-map-webpack-resolver-demo-webpack2/webpack.config.js | // volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var buildResolver = require('haste-map-webpack-resolver');
var currentDir = path.resolve(__dirname, '.');
module.exports = {
con... | // volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var HasteMapWebPackResolver = require('haste-map-webpack-resolver');
var currentDir = path.resolve(__dirname, '.');
module.exports =... | Use more natural constructor call | Use more natural constructor call
| JavaScript | mit | flegall/haste-map-webpack-resolver |
6a8d41904d34f33e48969574ab4cfa1f46bfd52b | test/jenkins.js | test/jenkins.js | /* jshint mocha: true */
'use strict';
const assert = require('assert');
const jenkins = require('../lib/jenkins');
describe('jenkins', function() {
describe('getComputers()', function() {
it('returns all nodes', function(done) {
this.timeout(10000);
jenkins.getComputers(function(err, nodes) {
... | /* jshint mocha: true */
'use strict';
const assert = require('assert');
const jenkins = require('../lib/jenkins');
describe('jenkins', function() {
describe('getComputers()', function() {
it('returns all nodes', function(done) {
this.timeout(10000);
jenkins.getComputers(function(err, nodes) {
... | Substitute console logs with proper asserts | Substitute console logs with proper asserts
| JavaScript | mit | Starefossen/jenkins-monitor |
65aab77d79c5468256c60b2e38e9762d5668f46d | addon/components/md-text.js | addon/components/md-text.js | import Ember from 'ember';
import Remarkable from 'remarkable';
import hljs from 'hljs';
export default Ember.Component.extend({
text: '',
typographer: false,
linkify: false,
html: false,
parsedMarkdown: function() {
var md = new Remarkable({
typographer: this.get('typographer'),
linkify: th... | import Ember from 'ember';
import Remarkable from 'remarkable';
import hljs from 'hljs';
const { computed } = Ember;
export default Ember.Component.extend({
text: '',
typographer: false,
linkify: false,
html: false,
parsedMarkdown: computed('text', 'html', 'typographer', 'linkify', function() {
var md ... | Remove use of prototype extension | Remove use of prototype extension
This makes the component compatible with newer versions of Ember.
| JavaScript | mit | maciek134/ember-remarkable,johnotander/ember-remarkable,johnotander/ember-remarkable,maciek134/ember-remarkable |
06b91954e1e6025ae43e0a8a2064738f671d4975 | test/index.js | test/index.js | const emptyDir = require('../');
const expect = require('chai').expect;
describe('emptyDir', function () {
it('should call back with true if a directory is empty', function (done) {
expect(emptyDir.sync('./')).to.be.false;
emptyDir('./', function (err, result) {
expect(result).to.be.false;
done()... | const emptyDir = require('../');
const expect = require('chai').expect;
const fs = require('fs');
try {
fs.mkdirSync('./test/empty');
} catch (e) {}
describe('emptyDir', function () {
it('should call back with true if a directory is empty', function (done) {
expect(emptyDir.sync('./')).to.be.false;
emptyD... | Create the fixture directory for tests | Update: Create the fixture directory for tests
| JavaScript | mit | tkellen/js-empty-dir |
6042f7c819aae4d66b486b9a0b21a801a4aec1b7 | src/crash-reporter-start.js | src/crash-reporter-start.js | module.exports = function(params) {
const { crashReporter } = require('electron');
const platformRelease = require('os').release();
const { uploadToServer } = params;
crashReporter.start({
productName: 'Atom',
companyName: 'GitHub',
submitURL: 'https://atom.io/crash_reports',
uploadToServer,
... | module.exports = function(params) {
const { crashReporter } = require('electron');
const os = require('os');
const platformRelease = os.release();
const arch = os.arch();
const { uploadToServer } = params;
crashReporter.start({
productName: 'Atom',
companyName: 'GitHub',
submitURL: 'https://ato... | Include architecture in data posted to Atom.io with crashes | Include architecture in data posted to Atom.io with crashes
| JavaScript | mit | Mokolea/atom,Mokolea/atom,atom/atom,brettle/atom,atom/atom,PKRoma/atom,atom/atom,PKRoma/atom,PKRoma/atom,brettle/atom,brettle/atom,Mokolea/atom |
b3db3a881daf2eebbb4ebb99be871274a753ef7e | data/JsonQueryRestStore.js | data/JsonQueryRestStore.js | define("dojox/data/JsonQueryRestStore", ["dojo", "dojox", "dojox/data/JsonRestStore", "dojox/data/util/JsonQuery"], function(dojo, dojox) {
dojo.requireIf(!!dojox.data.ClientFilter,"dojox.json.query"); // this is so we can perform queries locally
// this is an extension of JsonRestStore to convert object attribute qu... | define("dojox/data/JsonQueryRestStore", ["dojo", "dojox", "dojox/data/JsonRestStore", "dojox/data/util/JsonQuery", "dojox.data.ClientFilter", "dojox.json.query"], function(dojo, dojox) {
// this is an extension of JsonRestStore to convert object attribute queries to
// JSONQuery/JSONPath syntax to be sent to the serve... | Remove requireIf and always load dependent modules | Remove requireIf and always load dependent modules
git-svn-id: ee6e786acc44c9cca5ee17c71a5576c45c210361@25200 560b804f-0ae3-0310-86f3-f6aa0a117693
| JavaScript | bsd-3-clause | redaktor/deliteful |
09b1240307b85fb3770a800ca60a558b1e1ef6c0 | wrappers/md.js | wrappers/md.js | import React from 'react'
import 'css/markdown-styles.css'
import Helmet from 'react-helmet'
import { config } from 'config'
module.exports = React.createClass({
propTypes () {
return {
router: React.PropTypes.object,
}
},
render () {
const post = this.props.route.page.data
return (
<... | import React from 'react'
import 'css/markdown-styles.css'
import Helmet from 'react-helmet'
import { config } from 'config'
module.exports = React.createClass({
propTypes () {
return {
router: React.PropTypes.object,
}
},
render () {
const post = this.props.route.page.data
return (
<... | Add author support to the markdown wrapper | Add author support to the markdown wrapper
| JavaScript | mit | tcpbros/tcpbros.github.io |
88b77ddaa9d6b3d55e537dc21030ac58ddfcb86e | test/mocha/string-literal.js | test/mocha/string-literal.js | var UglifyJS = require('../../');
var assert = require("assert");
describe("String literals", function() {
it("Should throw syntax error if a string literal contains a newline", function() {
var inputs = [
"'\n'",
"'\r'",
'"\r\n"',
"'\u2028'",
'"\... | var UglifyJS = require('../../');
var assert = require("assert");
describe("String literals", function() {
it("Should throw syntax error if a string literal contains a newline", function() {
var inputs = [
"'\n'",
"'\r'",
'"\r\n"',
"'\u2028'",
'"\... | Add test case for line continuation | Add test case for line continuation
| JavaScript | bsd-2-clause | avdg/UglifyJS2,rvanvelzen/UglifyJS2,dabretin/UglifyJS2,butchi/decodecodeJS,butchi/codedecodeJS,davidbau/UglifyJS2 |
bcf6e175df5df11b80b512493e0fd565b8cb41e0 | app/js/arethusa.relation/directives/label_selector.js | app/js/arethusa.relation/directives/label_selector.js | "use strict";
angular.module('arethusa.relation').directive('labelSelector', [
'relation',
'$timeout',
function(relation, $timeout) {
return {
restrict: 'A',
scope: {
obj: '=',
change: '&'
},
link: function(scope, element, attrs) {
scope.plugin = relation;
... | "use strict";
angular.module('arethusa.relation').directive('labelSelector', [
'relation',
'$timeout',
function(relation, $timeout) {
return {
restrict: 'A',
scope: {
obj: '=',
change: '&'
},
link: function(scope, element, attrs) {
scope.plugin = relation;
... | Fix reference to oldAncestors in labelSelector | Fix reference to oldAncestors in labelSelector
| JavaScript | mit | Masoumeh/arethusa,Masoumeh/arethusa,latin-language-toolkit/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,alpheios-project/arethusa,alpheios-project/arethusa |
c48f8c35add72abfa918cd5a7c34b6d84ab9b058 | app/link_context_menu.js | app/link_context_menu.js | const remote = require('electron').remote;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
module.exports = {
build: function(target) {
var template = [
{
label: 'Copy Link Address',
role: 'copy'
}
];
if (process.platform ... | const remote = require('electron').remote;
const clipboard = require('electron').clipboard;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
module.exports = {
build: function(target) {
var template = [
{
label: 'Copy Link Address',
click: function (e,... | Copy role doesn't work, need to manually copy the link target | Copy role doesn't work, need to manually copy the link target
| JavaScript | apache-2.0 | irccloud/irccloud-desktop |
559407b929096934657a488353885baee21fe624 | app/routes/teams/show.js | app/routes/teams/show.js | import Ember from 'ember';
export default Ember.Route.extend({
teamQuery: Ember.inject.service(),
model({ domain }) {
return this.get('teamQuery').findByDomain(domain);
},
actions: {
didCreateCanvas(canvas) {
this.transitionTo('canvases.show', canvas);
}
}
});
| import Ember from 'ember';
export default Ember.Route.extend({
teamQuery: Ember.inject.service(),
model({ domain }) {
return this.get('teamQuery').findByDomain(domain);
},
actions: {
didCreateCanvas(canvas) {
this.transitionTo('canvases.show',
canvas.get('team.domain'), canvas.get('id')... | Fix redirect for new canvas (must not include model) | Fix redirect for new canvas (must not include model)
| JavaScript | apache-2.0 | usecanvas/web-v2,usecanvas/web-v2,usecanvas/web-v2 |
d25fc78dadc9b240920c13b7d422c15f87a69d44 | test/unit/controllersSpec.js | test/unit/controllersSpec.js | 'use strict';
/* jasmine specs for controllers go here */
describe('Real Racing Telemetry Client controllers', function() {
describe('carController', function(){
beforeEach(module('rrtClientApp'));
it('should create "cars" model with 4 cars', inject(function($controller) {
var scope = {},
... | 'use strict';
/* jasmine specs for controllers go here */
describe('Real Racing Telemetry Client controllers', function() {
describe('carController', function(){
beforeEach(module('rrtClientApp'));
it('should create "cars" model with 4 cars', inject(function($controller) {
var scope = {},
... | Test the order of cars is by model as selected by the orderProp default. | Test the order of cars is by model as selected by the orderProp default.
| JavaScript | mit | optimized4u/real-racing-telemetry-client,optimized4u/real-racing-telemetry-client |
7a5680a5aa4fd593aae2dfd5cb4871eae172c4fb | server/caps.js | server/caps.js | var authcommon = require('../authcommon'),
common = require('../common'),
config = require('../config'),
db = require('../db');
exports.can_access = function (ident, board) {
if (is_admin_ident(ident))
return true; // including graveyard
return db.is_board(board);
};
function is_mod_ident(ident) {
re... | var authcommon = require('../authcommon'),
common = require('../common'),
config = require('../config'),
db = require('../db');
exports.can_access = function (ident, board) {
if (board == 'graveyard' && is_admin_ident(ident))
return true;
return db.is_board(board);
};
function is_mod_ident(ident) {
r... | Fix can_access allowing admin all possible boards | Fix can_access allowing admin all possible boards
| JavaScript | mit | KoinoAoi/meguca,theGaggle/sleepingpizza,theGaggle/sleepingpizza,alokal/meguca,reiclone/doushio,alokal/meguca,KoinoAoi/meguca,vampiricwulf/tanoshiine,alokal/meguca,vampiricwulf/ex-tanoshiine,theGaggle/sleepingpizza,theGaggle/sleepingpizza,lalcmellkmal/doushio,reiclone/doushio,KoinoAoi/meguca,lalcmellkmal/doushio,vampiri... |
9650ffe3c8170b07504cc248cdb5c4524c2d3856 | template/webpack.config.js | template/webpack.config.js | var sagui = require('sagui')
module.exports = sagui().webpack({
sagui: {
/**
* Different application entry-points
* Each page is a combination of a JavaScript file and a HTML file
*
* Example: 'index' -> 'index.html' and 'index.js'
*/
pages: ['index'],
/**
* List of Sagui p... | var sagui = require('sagui')
module.exports = sagui().webpack({
sagui: {
/**
* Different application entry-points
* Each page is a combination of a JavaScript file and a HTML file
*
* Example: 'index' -> 'index.html' and 'index.js'
*/
pages: ['index'],
/**
* List of Sagui p... | Update the template on preset wording | Update the template on preset wording | JavaScript | mit | saguijs/sagui,saguijs/sagui |
ad60ddc7e61583e6dbc3750b5ae88fdbafc6cce6 | deploy/index.js | deploy/index.js | 'use strict'
const {
env: {
GITHUB_RELEASE_OAUTH,
GIT_REPO_TAG,
GIT_REPO_OWNER,
GIT_REPO_NAME
},
stdout,
stderr,
exit
} = require('process')
const GitHubAPIs = require('github')
const github = new GitHubAPIs()
github.authenticate({
type: 'token',
token: GITHUB_RELEASE_OAUTH
})
const {... | 'use strict'
const {join} = require('path')
const {
env: {
GITHUB_RELEASE_OAUTH,
GIT_REPO_TAG,
GIT_REPO_OWNER,
GIT_REPO_NAME,
ARTIFACTS_DIRECTORY
},
stdout,
stderr,
exit
} = require('process')
const {readdirSync} = require('fs')
const co = require('co')
const GitHubAPIs = require('git... | Complete deployment script (for GitHub Release) | Complete deployment script (for GitHub Release)
| JavaScript | mit | khai-gallery/badge-template,khai-gallery/badge-template,KSXGitHub/react-hello-world,KSXGitHub/react-hello-world,KSXGitHub/react-hello-world,khai-gallery/badge-template,cuong8321/react-hello-world,cuong8321/react-hello-world,cuong8321/react-hello-world |
a47169311407012f39c170da37956e5130245626 | packages/strapi-helper-plugin/lib/src/utils/hasPermissions.js | packages/strapi-helper-plugin/lib/src/utils/hasPermissions.js | import { isEmpty, pickBy, transform } from 'lodash';
import request from './request';
const findMatchingPermissions = (userPermissions, permissions) => {
return transform(
userPermissions,
(result, value) => {
const associatedPermission = permissions.find(
perm => perm.action === value.action &... | import { isEmpty, pickBy, transform } from 'lodash';
import request from './request';
const findMatchingPermissions = (userPermissions, permissions) => {
return transform(
userPermissions,
(result, value) => {
const associatedPermission = permissions.find(
perm => perm.action === value.action &... | Fix param sent to the API | Fix param sent to the API
Signed-off-by: soupette <0a59f0508aa203bc732745954131d022d9f538a9@gmail.com>
| JavaScript | mit | wistityhq/strapi,wistityhq/strapi |
89d6b8c6df15a17acfde4b36a9c5ccc5782f94cd | lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-collection.js | lib/assets/javascripts/dashboard/views/organization/icon-picker/icons/organization-icon-collection.js | const Backbone = require('backbone');
const IconModel = require('./organization-icon-model');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'orgId',
'configModel'
];
module.exports = Backbone.Collection.extend({
initialize: function (models, options) {
checkAndB... | const Backbone = require('backbone');
const IconModel = require('./organization-icon-model');
const checkAndBuildOpts = require('builder/helpers/required-opts');
const REQUIRED_OPTS = [
'orgId',
'configModel'
];
module.exports = Backbone.Collection.extend({
initialize: function (models, options) {
checkAndB... | Use this._configModel instead of opts.collection.configModel in icon-collection | Use this._configModel instead of opts.collection.configModel in icon-collection
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb |
8216df04cdeb78fe0cc3c5ff52726f4ab6e2aaa9 | docs/_static/coderunner.js | docs/_static/coderunner.js | /*global jQuery, document */
/*jslint nomen: true, unparam: true, bitwise: true*/
(function ($) {
"use strict";
var run, register_click_event;
run = function (event) {
$('#my_form').remove();
var button = $(event.currentTarget),
code_block = button.prev();
button.after... | /*global jQuery, document */
/*jslint nomen: true, unparam: true, bitwise: true*/
(function ($) {
"use strict";
var run, register_click_event;
run = function (event) {
$('#my_form').remove();
var button = $(event.currentTarget),
code_block = button.prev();
button.after... | Use same styling for "Run" button as is used by buttons in Sphinx. | Use same styling for "Run" button as is used by buttons in Sphinx. | JavaScript | mit | gocept/ajja,gocept/ajja |
ace2ff53f68a47b810277180284f8599cdcce290 | src/apps/dashboard/repos.js | src/apps/dashboard/repos.js | const { pick } = require('lodash')
const { authorisedRequest } = require('../../lib/authorised-request')
const config = require('../../config')
function fetchRawCompanyListItems(token, id) {
return authorisedRequest(token, {
method: 'GET',
url: `${config.apiRoot}/v4/company-list/${id}/item`,
})
}
const fe... | const { pick } = require('lodash')
const { authorisedRequest } = require('../../lib/authorised-request')
const config = require('../../config')
function fetchRawCompanyListItems(token, id) {
return authorisedRequest(token, {
method: 'GET',
url: `${config.apiRoot}/v4/company-list/${id}/item`,
})
}
const fe... | Remove comments for ignoring eslint | Remove comments for ignoring eslint
| JavaScript | mit | uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2 |
63028bde9a10189cddfd80b8203236288312c2d8 | src/helpers/matchRedirect.js | src/helpers/matchRedirect.js | import resolveNode from "./resolveNode";
// import {resolve} from "path";
export default function (filename, regexps, root, extensions) {
for(let redirectPair of regexps) {
const regexp = redirectPair[0];
if(regexp.test(filename)) {
console.log("FOUND MATCH", regexp);
let redirect = redirectPair[1];
c... | import resolveNode from "./resolveNode";
// import {resolve} from "path";
export default function (filename, regexps, root, extensions) {
const redirectPair = regexps.find(([regexp]) => regexp.test(filename));
if(redirectPair) {
let [regexp, redirect] = redirectPair;
console.log("FOUND MATCH", regexp);
conso... | Change for loop to Array.find | refactor(match): Change for loop to Array.find
| JavaScript | mit | Velenir/babel-plugin-import-redirect |
62c37ac94210699b3a6f77acb9aaedcf4807ce9f | src/History.js | src/History.js | import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
this.onPopHref(event.state)
}, false)
}
update (action) {
const href = this.g... | import { replace } from './actions'
import { NAVIGATE } from './constants'
export default class History {
constructor (store) {
this.store = store
}
listen () {
window.addEventListener('popstate', event => {
const { state } = event
if (typeof state === 'string') {
this.onPopHref(sta... | Fix popstate issue in Safari | Fix popstate issue in Safari
| JavaScript | isc | callum/redux-routing,callum/redux-routing |
5c6a045d2b2d75df02373b1fe8b31962cfbc8b60 | example/demo.js | example/demo.js | var sys = require('util');
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
sys.puts("State: " + this.readyState);
if (this.readyState === 4) {
sys.puts("Complete.\nBody length: " + this.responseText.length);
sys.puts("Body:\n... | var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
console.log("State: " + this.readyState);
if (this.readyState === 4) {
console.log("Complete.\nBody length: " + this.responseText.length);
console.log("Body:\n" + this.responseT... | Use console.log() instead of util.puts() | Use console.log() instead of util.puts()
Since NodeJS v0.11.3, util.puts becomes deprecated API.
| JavaScript | mit | driverdan/node-XMLHttpRequest,driverdan/node-XMLHttpRequest |
dda8dd13e8ab786a303a22bf6f16e25bbe382dc0 | src/scripts/renderer/main.js | src/scripts/renderer/main.js | window.onerror = function (message, source, lineno, colno, error) {
logError(error);
};
| window.onerror = function (message, source, lineno, colno, error) {
logError(error instanceof Error ? error : new Error(error || message));
};
| Improve logging of errors in renderer | Improve logging of errors in renderer
| JavaScript | apache-2.0 | rafael-neri/whatsapp-webapp,Aluxian/Facebook-Messenger-Desktop,Aluxian/Facebook-Messenger-Desktop,rafael-neri/whatsapp-webapp,Aluxian/Messenger-for-Desktop,Aluxian/Messenger-for-Desktop,Aluxian/Facebook-Messenger-Desktop,rafael-neri/whatsapp-webapp,Aluxian/Messenger-for-Desktop |
9c8645607a1a5eb3ab3eec8b81dfbafcae701a00 | src/modules/form/reducers.js | src/modules/form/reducers.js | import * as types from './constants';
export function form(config) {
const initialState = {
id: '',
isActive: false,
lastUpdated: 0,
form: {},
url: '',
error: '',
};
return (state = initialState, action) => {
// Only proceed for this form.
if (action.name !== config.name) {
... | import * as types from './constants';
export function form(config) {
const initialState = {
id: '',
isActive: false,
lastUpdated: 0,
form: {},
url: '',
error: '',
};
return (state = initialState, action) => {
// Only proceed for this form.
if (action.name !== config.name) {
... | Clear form on form request. | Clear form on form request.
| JavaScript | mit | formio/react-formio |
97fbda25fefb1fd8a4e7fe93e422ce308520c083 | lib/get-data.js | lib/get-data.js | const path = require('path')
const fs = require('fs-extra')
const dataDir = require('data-dir')
const logger = require('./logger')
/**
* Get json form given directory or file. Return empty
* data if nothing is found.
*
* @param {string} src source to read data from
*
* @returns {object}
*/
module.exports = src ... | const path = require('path')
const fs = require('fs-extra')
const dataDir = require('data-dir')
const logger = require('./logger')
/**
* Get json form given directory or file. Return empty
* data if nothing is found.
*
* @param {string} src source to read data from
*
* @returns {object}
*/
module.exports = src ... | Fix crash when no data option is passed | Fix crash when no data option is passed
| JavaScript | mit | mohitsinghs/njk |
f4f897f33c59f573c20c87ff4c9387a7cec0bf08 | app/controllers/application.js | app/controllers/application.js | /* eslint-disable ghost/ember/alias-model-in-controller */
import Controller from '@ember/controller';
import {inject as service} from '@ember/service';
export default class ApplicationController extends Controller {
@service billing;
@service customViews;
@service config;
@service dropdown;
@servi... | /* eslint-disable ghost/ember/alias-model-in-controller */
import Controller from '@ember/controller';
import {computed} from '@ember/object';
import {inject as service} from '@ember/service';
export default Controller.extend({
billing: service(),
customViews: service(),
config: service(),
dropdown: se... | Revert "Refactored ApplicationController to use native class" | Revert "Refactored ApplicationController to use native class"
This reverts commit a7912c49c31cf2031f543eaa0995dd68d93b4453.
- there is an issue with properties not being tracked correctly and the menu not being shown when returning from the editor
- reverting to working version with computed properties for now
| JavaScript | mit | TryGhost/Ghost-Admin,TryGhost/Ghost-Admin |
6ba6598d152bab64beb9487af8f02c715c0676c2 | web/public/js/controllers/cancel-session-invite-controller.js | web/public/js/controllers/cancel-session-invite-controller.js | (function () {
'use strict';
function cancelSessionInviteCtrl($scope, $state, $stateParams, currentUser, $translate, alertService, usSpinnerService, cdEventsService) {
usSpinnerService.spin('session-spinner');
var applicationId = $stateParams.applicationId;
var ticketId = $stateParams.eventId... | (function () {
'use strict';
function cancelSessionInviteCtrl($scope, $state, $stateParams, currentUser, $translate, alertService, usSpinnerService, cdEventsService) {
usSpinnerService.spin('session-spinner');
var applicationId = $stateParams.applicationId;
var eventId = $stateParams.eventId;... | Fix cancel session invite so that it doesn't require admin rights | Fix cancel session invite so that it doesn't require admin rights
| JavaScript | mit | CoderDojo/cp-zen-platform,CoderDojo/cp-zen-platform |
d2b9b8a35f1cb8a06fe3412e69965e875b18e139 | src/js/mixins/clonable.js | src/js/mixins/clonable.js | (function() {
var SirTrevor = window.SirTrevor;
var BlockMixins = SirTrevor.BlockMixins;
var Block = SirTrevor.Block;
Block.prototype.availableMixins.push('clonable');
BlockMixins.Clonable = {
mixinName: 'Clonable',
initializeClonable: function() {
// For this mixin to ... | (function() {
var _ = window._;
var SirTrevor = window.SirTrevor;
var BlockMixins = SirTrevor.BlockMixins;
var Block = SirTrevor.Block;
Block.prototype.availableMixins.push('clonable');
BlockMixins.Clonable = {
mixinName: 'Clonable',
initializeClonable: function() {
... | Create a deep clone of block data when cloning | Mixins/Clonable: Create a deep clone of block data when cloning
| JavaScript | mit | Upplication/sir-trevor-blocks,Upplication/sir-trevor-blocks |
4249c842fb835e188c9901f02b24dfefb50abcea | src/get-element-override.js | src/get-element-override.js | export default function getElementOverride (element, overrides) {
const parentNode = getTopMostElementParent(element)
for (let override in overrides) {
if (overrides.hasOwnProperty(override)) {
try {
const matches = parentNode.querySelectorAll(override)
if (Array.from(matches).indexOf(ele... | export default function getElementOverride (element, overrides) {
const parentNode = getTopMostElementParent(element)
for (let override in overrides) {
if (overrides.hasOwnProperty(override)) {
try {
const matches = parentNode.querySelectorAll(override)
if (Array.from(matches).indexOf(ele... | Fix obvious bug in `getTopMostElementParent` | Fix obvious bug in `getTopMostElementParent`
| JavaScript | mit | Deschtex/html2react |
b802adbe9b895b2636ab757f51a607554c75716d | lib/sauce-launch-service.js | lib/sauce-launch-service.js | import SauceConnectLauncher from 'sauce-connect-launcher'
class SauceLaunchService {
/**
* modify config and launch sauce connect
*/
onPrepare (config) {
if (!config.sauceConnect) {
return
}
config.host = 'localhost'
config.port = 4445
this.sauceC... | import SauceConnectLauncher from 'sauce-connect-launcher'
class SauceLaunchService {
/**
* modify config and launch sauce connect
*/
onPrepare (config) {
if (!config.sauceConnect) {
return
}
this.sauceConnectOpts = Object.assign({
username: config.user... | Remove hardcoded sauce connect port | Remove hardcoded sauce connect port
| JavaScript | mit | webdriverio/wdio-sauce-service |
6e96f97d08420323b4df727a97f4c5cebe2967f7 | src/js/main.js | src/js/main.js | /* global console, Calendar, vis */
(function() {
"use strict";
var calendar = new Calendar();
calendar.init(document.getElementById('visualization'),
{
height: "100vh",
orientation: "top",
zoomKey: 'shiftKey',
zoomMax: 315360000000,
zoomMin: 600000,
editable: {
... | /* global console, Calendar, vis */
(function() {
"use strict";
var calendar = new Calendar();
calendar.init(document.getElementById('visualization'),
{
height: "100vh",
orientation: "top",
zoomKey: 'shiftKey',
zoomMax: 315360000000,
zoomMin: 600000,
editable: {
... | Remove unnecesary logs from order function | Remove unnecesary logs from order function
| JavaScript | apache-2.0 | fidash/widget-calendar,fidash/widget-calendar |
5f75e241dcd8bb7727f2fac7608092e26c7c2920 | src/main/resources/static/js/durationValidationFactory.js | src/main/resources/static/js/durationValidationFactory.js | (function () {
'use strict';
var factoriesModul;
try {
factoriesModul = angular.module('dcc.factories');
} catch (e) {
factoriesModul = angular.module('dcc.factories', []);
}
factoriesModul.factory('durationValidationFactory', [function () {
var factory = {};
f... | (function () {
'use strict';
var factoriesModul;
try {
factoriesModul = angular.module('dcc.factories');
} catch (e) {
factoriesModul = angular.module('dcc.factories', []);
}
factoriesModul.factory('durationValidationFactory', [function () {
var factory = {};
f... | Fix bug, appering only in Firefox (Date.parse("xx-xx-xxxx xx:xx")) | Fix bug, appering only in Firefox (Date.parse("xx-xx-xxxx xx:xx"))
| JavaScript | apache-2.0 | pongo710/workinghours,pongo710/workinghours,pongo710/workinghours |
a4280b19fa4cdb4a05590d0de518ffbd12c2b6e4 | client/scripts/directives/previewPictures.js | client/scripts/directives/previewPictures.js | require('../app').directive('previewPictures', /* @ngInject */function () {
return {
restrict: 'EA',
templateUrl: '/views/directives/previewpictures.html',
scope: {
pictures: '='
},
bindToController: true,
link: function ($scope, $element, $attrs, $ctrl) {
$element.on('click', $ctr... | var angular = require('angular')
require('../app').directive('previewPictures', /* @ngInject */function () {
return {
restrict: 'EA',
templateUrl: '/views/directives/previewpictures.html',
scope: {
pictures: '='
},
bindToController: true,
link: function ($scope, $element, $attrs, $ctrl)... | Return new object instead of modifying input objects | Return new object instead of modifying input objects
| JavaScript | agpl-3.0 | BspbOrg/smartbirds-server,BspbOrg/smartbirds-server,BspbOrg/smartbirds-server |
4c08e4aa3da62004fe64aa2171eea4333ccc7550 | tasks/sw.js | tasks/sw.js | 'use strict';
const config = require('config');
const sw = require('../lib/tasks/sw');
const task = require('../lib/helpers/task');
const sync = require('browser-sync');
module.exports = gulp => {
const watch = `${config.folders.output}/**/*`;
gulp.task('sw', 'Generates a dynamic Service Worker', cb => {
sw(... | 'use strict';
const config = require('config');
const sw = require('../lib/tasks/sw');
const task = require('../lib/helpers/task');
module.exports = gulp => {
const watch = [
`${config.folders.output}/**/*`,
`!${config.folders.output}/${config.sw.file}`,
];
gulp.task('sw', 'Generates a dynamic Service ... | Fix SW watching for SW changes | :bug: Fix SW watching for SW changes
| JavaScript | mit | kellychurchill/gulp-armadillo,Snugug/gulp-armadillo |
fbd60fbee713b5d0a1472ef05dee013bcc04a0e4 | app/assets/javascripts/legacy/views/mission_change_dropdown.js | app/assets/javascripts/legacy/views/mission_change_dropdown.js | // ELMO.Views.MissionChangeDropdown
(function(ns, klass) {
// constructor
ns.MissionChangeDropdown = klass = function(params) {
$(params.el).on('change', function(e){
var new_mission_name = $(e.currentTarget).find('option:selected').val();
if (new_mission_name == '') {
// Redirect straight ... | // ELMO.Views.MissionChangeDropdown
(function(ns, klass) {
// constructor
ns.MissionChangeDropdown = klass = function(params) {
$(params.el).on('change', function(e){
var new_mission_name = $(e.currentTarget).find('option:selected').val();
if (new_mission_name == '') {
// Redirect straight ... | Stop preserving search query between missions | 9958: Stop preserving search query between missions
| JavaScript | apache-2.0 | thecartercenter/elmo,thecartercenter/elmo,thecartercenter/elmo |
f214e13704058eff65d89a2e34abd95bacbd5a35 | blogic/PartitionLockManager.js | blogic/PartitionLockManager.js | var locks = require('locks');
//Map lock only used to create new partitionLocks entries
var mapLock = locks.createMutex();
var partitionLocks = new Object();
var timeoutSeconds = 2;
//key is unique for the namespace & partition.
module.exports.lockedOperation = function lockedOperation (key, callback) {
var keyStr =... | var locks = require('locks');
//Map lock only used to create new partitionLocks entries
var mapLock = locks.createMutex();
var partitionLocks = new Object();
var timeoutSeconds = 2;
//key is unique for the namespace & partition.
module.exports.lockedOperation = function lockedOperation (key, callback) {
var keyStr =... | Revert "Remove unnecessary lock logging" | Revert "Remove unnecessary lock logging"
This reverts commit ffce61611933786a9f01d01925fc154f6a7f1ecd.
| JavaScript | apache-2.0 | IHTSDO/component-identifier-service,IHTSDO/component-identifier-service,IHTSDO/component-identifier-service |
eb6ab3bf496f31fed45a3694a221b6f6868e8c20 | test/bin.js | test/bin.js | var child = require('child_process');
var http = require('http');
var test = require('tape');
var fs = require('fs');
var path = require('path');
var url = require('url');
test('bin print version', function (test) {
test.plan(4);
var options = [
'-V',
'--version'
];
options.forEach(function (option) {... | var child = require('child_process');
var http = require('http');
var test = require('tape');
var fs = require('fs');
var path = require('path');
var url = require('url');
var version = [
'-V',
'--version',
];
version.forEach(function (arg) {
var args = ['bin/amok.js', arg];
test(args.join(' '), function (tes... | Move short option tests into top level tests | Move short option tests into top level tests
| JavaScript | mit | stereokai/amok,stereokai/amok,stereokai/amok |
4c236ecd0c2d1e3a90168a67c5fc50bb7a2db778 | src/parsley/factory/constraint.js | src/parsley/factory/constraint.js | define('parsley/factory/constraint', [
'parsley/utils'
], function (ParsleyUtils) {
var ConstraintFactory = function (parsleyField, name, requirements, priority, isDomConstraint) {
if (!new RegExp('ParsleyField').test(ParsleyUtils.get(parsleyField, '__class__')))
throw new Error('ParsleyField or ParsleyF... | define('parsley/factory/constraint', [
'parsley/utils'
], function (ParsleyUtils) {
var ConstraintFactory = function (parsleyField, name, requirements, priority, isDomConstraint) {
var assert = {};
if (!new RegExp('ParsleyField').test(ParsleyUtils.get(parsleyField, '__class__')))
throw new Error('Par... | Store created assert and reuse. This makes it clearer when asserts need to be created and is more efficient. | Store created assert and reuse.
This makes it clearer when asserts need to be created and is more efficient.
| JavaScript | mit | wizardbab/Parsley.js,rockmandew/Parsley.js,garylgh/Parsley.js,noikiy/Parsley.js,garylgh/Parsley.js,xiwc/Parsley.js,david84/Parsley.js,treyhunner/Parsley.js,tsioukas/Parsley.js,rockmandew/Parsley.js,Rashid-Asif/Parsley.js,zaoli/Parsley.js,sharq88/Parsley.js,LoveMondays/Parsley.js,payssion/Parsley.js,Jeremy017/Parsley.js... |
68dea48bd0d92fbcf8f3b20bddc04f1cd5b89caa | generators/authentication/modules/common/ensure-authenticated-jwt.js | generators/authentication/modules/common/ensure-authenticated-jwt.js |
exports.ensureAuthenticated = function(req, res, next) {
if (req.isAuthenticated()) {
next();
} else {
res.sendStatus(401);
}
};
|
exports.ensureAuthenticated = function(req, res, next) {
if (req.isAuthenticated()) {
next();
} else {
res.status(401).send({ msg: 'Unauthorized' });
}
};
| Send valid json message back when used is unauthorized | Send valid json message back when used is unauthorized
| JavaScript | mit | sahat/boilerplate,sahat/boilerplate,sahat/megaboilerplate,sahat/megaboilerplate,sahat/megaboilerplate |
1e0a4a79f0bba11848ccb4231de139424ebd3cde | src/dashboard/src/media/js/ingest/normalization_report.js | src/dashboard/src/media/js/ingest/normalization_report.js | /*
This file is part of Archivematica.
Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
Archivematica 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 ... | /*
This file is part of Archivematica.
Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
Archivematica 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 ... | Remove old JS code in the normalization report | Remove old JS code in the normalization report
This fixes a JS `Uncaught TypeError` error in the normalization report
caused by code that was used to setup dialogs for displaying job
information but which were removed a few years ago.
| JavaScript | agpl-3.0 | artefactual/archivematica,artefactual/archivematica,artefactual/archivematica,artefactual/archivematica |
2b46319b1483f159995d89c923957111b2e0ab71 | util/transitionToParams.js | util/transitionToParams.js | function transitionToParams(params) {
const location = this.props.location;
const allParams = Object.assign({}, location.query, params);
const keys = Object.keys(allParams);
let url = location.pathname;
if (keys.length) {
url += `?${keys.map(key => `${key}=${encodeURIComponent(allParams[key])}`).join('&'... | function transitionToParams(params) {
const location = this.props.location;
const allParams = Object.assign({}, location.query, params);
const keys = Object.keys(allParams);
let url = location.pathname;
if (keys.length) {
url += `?${keys.map(key => `${key}=${encodeURIComponent(allParams[key])}`).join('&'... | Use API from released version of react-router v4 STRIPES-173 | Use API from released version of react-router v4 STRIPES-173
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.