commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
b74e5d8d697f113d43f6c0793dc669168220632c | lib/axiom_pnacl/executables.js | lib/axiom_pnacl/executables.js | // Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import AxiomError from 'axiom/core/error';
import environment from 'axiom_shell/environment';
import VimCommand from 'axiom_pnacl/vim';
// @note... | // Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import AxiomError from 'axiom/core/error';
import environment from 'axiom_shell/environment';
import VimCommand from 'axiom_pnacl/vim';
// @note... | Allow 'vim' command to accept an array of arguments. | Allow 'vim' command to accept an array of arguments.
| JavaScript | apache-2.0 | rpaquay/axiom,chromium/axiom,umop/axiom_old_private,ussuri/axiom,mcanthony/axiom | ---
+++
@@ -12,7 +12,7 @@
export var executables = function(sourceUrl) {
return {
- 'vim()': function() {
+ 'vim(@)': function() {
var vimCommand = new VimCommand(sourceUrl);
return vimCommand.run.bind(vimCommand);
}() |
7c5ddc02666adb0bd8f011e908fb1d0e11a01244 | util.js | util.js | function quote(s) {
return "\"" + s.replace(/([\\\"])/, "\\$1") + "\"";
}
function maybe_quote(s) {
if (/[\\\"]/.test(s))
return quote(s);
else
return s;
}
function repr(x, max_depth) {
if (max_depth == undefined)
max_depth = 1;
if (x === null) {
return "null";
} if (typeof x == "object") {
if ("hash... | function quote(s) {
return "\"" + s.replace(/([\\\"])/, "\\$1") + "\"";
}
function maybe_quote(s) {
if (/[\\\"]/.test(s))
return quote(s);
else
return s;
}
function repr(x, max_depth) {
if (max_depth == undefined)
max_depth = 1;
if (x === null) {
return "null";
} else if (x instanceof java.lang.Iterabl... | Allow repr to show java.lang.Iterables. | Allow repr to show java.lang.Iterables.
| JavaScript | mit | arlolra/flashproxy,infinity0/flashproxy,infinity0/flashproxy,arlolra/flashproxy,infinity0/flashproxy,arlolra/flashproxy,arlolra/flashproxy,glamrock/flashproxy,glamrock/flashproxy,glamrock/flashproxy,infinity0/flashproxy,arlolra/flashproxy,arlolra/flashproxy,infinity0/flashproxy,glamrock/flashproxy,arlolra/flashproxy,gl... | ---
+++
@@ -15,7 +15,13 @@
if (x === null) {
return "null";
- } if (typeof x == "object") {
+ } else if (x instanceof java.lang.Iterable) {
+ var elems = [];
+ var i = x.iterator();
+ while (i.hasNext())
+ elems.push(repr(i.next()));
+ return x["class"] + ":[ " + elems.join(", ") + " ]";
+ } else if (typ... |
a7fb7e9a16e45bbc29603be46d082910c06b30b7 | app.js | app.js | function Actor(other) {
other = other || {};
this.name = other.name || "";
this.init = other.init || 0;
this.hp = other.hp || 0;
};
var sort = function(left, right) {
return left.init==right.init ? 0 : (left.init > right.init ? -1 : 1);
};
function Encounter() {
this.actors = [];
};
var ViewModel = function() {... | function Actor(other) {
other = other || {};
this.name = other.name || "";
this.init = other.init || 0;
this.hp = other.hp || 1;
};
var sort = function(left, right) {
return left.init==right.init ? 0 : (left.init > right.init ? -1 : 1);
};
function Encounter() {
this.actors = [];
};
var ViewModel = function() {... | Change default health to 1. | Change default health to 1.
| JavaScript | mit | madigan/ncounter,madigan/ncounter | ---
+++
@@ -2,7 +2,7 @@
other = other || {};
this.name = other.name || "";
this.init = other.init || 0;
- this.hp = other.hp || 0;
+ this.hp = other.hp || 1;
};
var sort = function(left, right) {
return left.init==right.init ? 0 : (left.init > right.init ? -1 : 1); |
c15fc1bae4bd27839a0d78e220d02eb94bd4bdae | test/helpers/supportsWorker.js | test/helpers/supportsWorker.js | module.exports = function supportsWorker() {
try {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
return require("worker_threads") !== undefined;
} catch (e) {
return false;
}
};
| const nodeVersion = process.versions.node.split(".").map(Number);
module.exports = function supportsWorker() {
// Verify that in the current node version new Worker() accepts URL as the first parameter:
// https://nodejs.org/api/worker_threads.html#worker_threads_new_worker_filename_options
if (nodeVersion[0] >= 14... | Fix new Worker() compatibility check in unit tests for older node versions | Fix new Worker() compatibility check in unit tests for older node versions
| JavaScript | mit | SimenB/webpack,webpack/webpack,webpack/webpack,webpack/webpack,webpack/webpack,SimenB/webpack,SimenB/webpack,SimenB/webpack | ---
+++
@@ -1,8 +1,14 @@
+const nodeVersion = process.versions.node.split(".").map(Number);
+
module.exports = function supportsWorker() {
- try {
- // eslint-disable-next-line node/no-unsupported-features/node-builtins
- return require("worker_threads") !== undefined;
- } catch (e) {
- return false;
+ // Verify ... |
d78824b2be952e65117258d3ec701304425fe304 | frontend/src/containers/TeamPage/TeamPage.js | frontend/src/containers/TeamPage/TeamPage.js | import React, { Component } from 'react'
import Helmet from 'react-helmet'
import { NavBar } from '../../components'
const styles = {
iframe: {
width: '100%',
}
}
class TeamPage extends Component {
componentDidMount() {
var iframe = this.refs.iframe
iframe.addEventListener('load', () => {
va... | import React, { Component } from 'react'
import Helmet from 'react-helmet'
import { NavBar } from '../../components'
const styles = {
iframe: {
width: '100%',
}
}
class TeamPage extends Component {
componentDidMount() {
var iframe = this.refs.iframe
iframe.addEventListener('load', () => {
va... | Fix issue where team page is not found | Fix issue where team page is not found
| JavaScript | mit | hackclub/api,hackclub/api,hackclub/api | ---
+++
@@ -26,7 +26,7 @@
<Helmet title="Team" />
<NavBar />
- <iframe ref="iframe" style={styles.iframe} src="/staticPage/team"/>
+ <iframe ref="iframe" style={styles.iframe} src="/staticPage/team/index.html" />
</div>
)
} |
6c19c79f596ae6872c7b5b2fe2b31ff4f5c8cb51 | test/mjsunit/asm/math-clz32.js | test/mjsunit/asm/math-clz32.js | // Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var stdlib = { Math: Math };
var f = (function Module(stdlib) {
"use asm";
var clz32 = stdlib.Math.clz32;
fun... | // Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var stdlib = { Math: Math };
var f = (function Module(stdlib) {
"use asm";
var clz32 = stdlib.Math.clz32;
fun... | Fix test of %_MathClz32 intrinsic. | [turbofan] Fix test of %_MathClz32 intrinsic.
This test will fail once we optimize top-level code, because the
aforementioned intrinsic doesn't perform a NumberToUint32 conversion.
R=titzer@chromium.org
TEST=mjsunit/asm/math-clz32
Review URL: https://codereview.chromium.org/1041173002
Cr-Commit-Position: 972c6d2dc6... | JavaScript | mit | UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh | ---
+++
@@ -27,5 +27,5 @@
}
for (var i = -2147483648; i < 2147483648; i += 3999773) {
assertEquals(%MathClz32(i), f(i));
- assertEquals(%_MathClz32(i), f(i));
+ assertEquals(%MathClz32(i), %_MathClz32(i >>> 0));
} |
2747aa2c950deb95a99ef937c23c8d7db17d5f86 | src/main/resources/com/semperos/screwdriver/js/extension/process-rjs.js | src/main/resources/com/semperos/screwdriver/js/extension/process-rjs.js | //Create a runner that will run a separate build for each item
//in the configs array. Thanks to @jwhitley for this cleverness
for (var i = 0; i < __Screwdriver.rjs.moduleConfigs.length; i++) {
requirejs.optimize(__Screwdriver.rjs.moduleConfigs[i], function(x) {
print("Screwdriver RequireJS Optimizer (r.js)... | //Create a runner that will run a separate build for each item
//in the configs array. Thanks to @jwhitley for this cleverness
print("Starting RequireJS (r.js) Optimizer...");
for (var i = 0; i < __Screwdriver.rjs.moduleConfigs.length; i++) {
requirejs.optimize(__Screwdriver.rjs.moduleConfigs[i], function(x) {
... | Make it clearer when the r.js optimizer starts | Make it clearer when the r.js optimizer starts
| JavaScript | apache-2.0 | semperos/screwdriver,semperos/screwdriver | ---
+++
@@ -1,5 +1,6 @@
//Create a runner that will run a separate build for each item
//in the configs array. Thanks to @jwhitley for this cleverness
+print("Starting RequireJS (r.js) Optimizer...");
for (var i = 0; i < __Screwdriver.rjs.moduleConfigs.length; i++) {
requirejs.optimize(__Screwdriver.rjs.modul... |
9678e952e50cef724dfae8871ceda7b3dc056a4f | src/services/fetchOverallStats.js | src/services/fetchOverallStats.js | import fetch from 'node-fetch';
import { API_URL, HTTP_HEADERS } from '../constants';
const headers = HTTP_HEADERS;
const formatStats = (data, battletag, competitive) => {
const stats = data['overall_stats'];
const gameMode = competitive ? 'Competitive' : 'Quick Play';
return `*${battletag}*'s Overall Stats ($... | import fetch from 'node-fetch';
import { API_URL, HTTP_HEADERS } from '../constants';
const headers = HTTP_HEADERS;
const formatStats = (data, battletag, competitive) => {
const stats = data['overall_stats'];
const gameMode = competitive ? 'Competitive' : 'Quick Play';
let level = stats['level'];
if (typeof s... | Add skill rating and make win rate more precise | Add skill rating and make win rate more precise
Fixes #1
| JavaScript | mit | chesterhow/overwatch-telegram-bot | ---
+++
@@ -6,13 +6,20 @@
const formatStats = (data, battletag, competitive) => {
const stats = data['overall_stats'];
const gameMode = competitive ? 'Competitive' : 'Quick Play';
+ let level = stats['level'];
+ if (typeof stats['prestige'] === 'number') {
+ level += (stats['prestige'] * 100);
+ }
+
+ c... |
ca37507057f8920d078f203fc56cf3070defc8c7 | src/List/List.js | src/List/List.js | var React = require('react');
var classNames = require('classnames');
var ListItem = require('./ListItem');
var ListItemGroup = require('./ListItemGroup');
var List = React.createClass({
displayName: 'List',
getDefaultProps: function() {
return {
className: ''
}
},
getListItems: function(list)... | var React = require('react');
var classNames = require('classnames');
var _ = require('underscore');
var ListItem = require('./ListItem');
var ListItemGroup = require('./ListItemGroup');
var List = React.createClass({
displayName: 'List',
propTypes: {
className: React.PropTypes.string,
items: React.PropT... | Add key to iterated objects | Add key to iterated objects
| JavaScript | apache-2.0 | mesosphere/reactjs-components,mesosphere/reactjs-components | ---
+++
@@ -1,5 +1,6 @@
var React = require('react');
var classNames = require('classnames');
+var _ = require('underscore');
var ListItem = require('./ListItem');
var ListItemGroup = require('./ListItemGroup');
@@ -7,26 +8,35 @@
var List = React.createClass({
displayName: 'List',
+ propTypes: {
+ cla... |
2068d2d2bc6907b2bd7990a933d93d5044cf35e3 | src/lib/session/index.js | src/lib/session/index.js | import routes from '../routes'
import request from '../request'
const create = (opts, email, password) =>
request.post(opts, routes.session, { email, password })
const verify = Promise.resolve(1)
const destroy = Promise.resolve(1)
export default {
create,
verify,
destroy,
}
| import routes from '../routes'
import request from '../request'
const create = (opts, email, password) =>
request.post(opts, routes.session, { email, password })
export default {
create,
}
| Remove unused endpoints on session route | Remove unused endpoints on session route
| JavaScript | mit | pagarme/pagarme-js | ---
+++
@@ -4,12 +4,7 @@
const create = (opts, email, password) =>
request.post(opts, routes.session, { email, password })
-const verify = Promise.resolve(1)
-const destroy = Promise.resolve(1)
-
export default {
create,
- verify,
- destroy,
}
|
e02a8202e83018b10adabc986b720c552df9bcae | website/app/application/core/projects/project/files/files-controller.js | website/app/application/core/projects/project/files/files-controller.js | Application.Controllers.controller("FilesController", ["$state", FilesController]);
function FilesController($state) {
//console.log("FileController going to projects.project.files.all");
//$state.go('projects.project.files.all');
var ctrl = this;
ctrl.showSearchResults = showSearchResults;
//////... | Application.Controllers.controller("FilesController", ["$state", FilesController]);
function FilesController($state) {
var ctrl = this;
ctrl.showSearchResults = showSearchResults;
init();
//////////////////
function showSearchResults() {
$state.go('projects.project.files.search');
}
... | Remove console statement. Move initialization logic for controller into init() method. | Remove console statement. Move initialization logic for controller into init() method.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -1,13 +1,19 @@
Application.Controllers.controller("FilesController", ["$state", FilesController]);
function FilesController($state) {
- //console.log("FileController going to projects.project.files.all");
- //$state.go('projects.project.files.all');
var ctrl = this;
ctrl.showSearchResul... |
78be30be622d78ce3146ae659f1277b5ff127b57 | website/app/index/sidebar-projects.js | website/app/index/sidebar-projects.js | Application.Directives.directive("sidebarProjects", sidebarProjectsDirective);
function sidebarProjectsDirective() {
return {
restrict: "AE",
replace: true,
templateUrl: "index/sidebar-projects.html",
controller: "sidebarProjectsDirectiveController"
};
}
Application.Controllers... | Application.Directives.directive("sidebarProjects", sidebarProjectsDirective);
function sidebarProjectsDirective() {
return {
restrict: "AE",
replace: true,
templateUrl: "index/sidebar-projects.html",
controller: "sidebarProjectsDirectiveController"
};
}
Application.Controllers... | Switch project view when user picks a different project. | Switch project view when user picks a different project.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org | ---
+++
@@ -11,10 +11,10 @@
Application.Controllers.controller("sidebarProjectsDirectiveController",
["$scope", "current", "sidebarUtil",
- "mcapi", "model.projects",
+ "mcapi", "model.projects", "$state",
... |
94352ff890da1dc1a83651b316eba519d9101243 | optimize/index.js | optimize/index.js | var eng = require('./node/engine');
module.exports = {
minimize: function(func, options, callback) {
eng.runPython('minimize', func, options, callback);
},
nonNegLeastSquares: function(A, b, callback) {
eng.runPython('nnls', A, b, callback);
}
}
| var eng = require('./node/engine');
module.exports = {
localMinimize: function(func, options, callback) {
eng.runPython('local', func, options, callback);
},
globalMinimize: function(func, options, callback) {
eng.runPython('global', func, options, callback);
},
nonNegLeastSquares: function(A, b, c... | Add localMin and globalMin to API | Add localMin and globalMin to API
| JavaScript | mit | acjones617/scipy-node,acjones617/scipy-node | ---
+++
@@ -1,9 +1,12 @@
var eng = require('./node/engine');
module.exports = {
- minimize: function(func, options, callback) {
- eng.runPython('minimize', func, options, callback);
+ localMinimize: function(func, options, callback) {
+ eng.runPython('local', func, options, callback);
},
+ globalMinim... |
fe8f4e74ed73f3c56e8747b393e0036261cc3d4d | app/scripts/components/openstack/openstack-volume/openstack-volume-snapshots.js | app/scripts/components/openstack/openstack-volume/openstack-volume-snapshots.js | const volumeSnapshots = {
templateUrl: 'views/partials/filtered-list.html',
controller: VolumeSnapshotsListController,
controllerAs: 'ListController',
bindings: {
resource: '<'
}
};
export default volumeSnapshots;
// @ngInject
function VolumeSnapshotsListController(
baseResourceListController,
$scop... | const volumeSnapshots = {
templateUrl: 'views/partials/filtered-list.html',
controller: VolumeSnapshotsListController,
controllerAs: 'ListController',
bindings: {
resource: '<'
}
};
export default volumeSnapshots;
// @ngInject
function VolumeSnapshotsListController(
baseResourceListController,
$scop... | Use arrow functions instead of vm variable (WAL-400) | Use arrow functions instead of vm variable (WAL-400)
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | ---
+++
@@ -22,10 +22,10 @@
this.listActions = null;
var list_type = 'snapshots';
var fn = this._super.bind(this);
- var vm = this;
- actionUtilsService.loadNestedActions(this, controllerScope.resource, list_type).then(function(result) {
- vm.listActions = result;
+ this.l... |
a150a6caa9db55a262335df60a8048e03171a227 | feature-detects/es6/promises.js | feature-detects/es6/promises.js | /*!
{
"name": "ES6 Promises",
"property": "promises",
"caniuse": "promises",
"polyfills": ["es6promises"],
"authors": ["Krister Kari", "Jake Archibald"],
"tags": ["es6"],
"notes": [{
"name": "The ES6 promises spec",
"href": "https://github.com/domenic/promises-unwrapping"
},{
"name": "Chromi... | /*!
{
"name": "ES6 Promises",
"property": "promises",
"caniuse": "promises",
"polyfills": ["es6promises"],
"authors": ["Krister Kari", "Jake Archibald"],
"tags": ["es6"],
"notes": [{
"name": "The ES6 promises spec",
"href": "https://github.com/domenic/promises-unwrapping"
},{
"name": "Chromi... | Remove "cast" from Promise test | Remove "cast" from Promise test
Promise.resolve now behaves as Promise.cast
| JavaScript | mit | Modernizr/Modernizr,Modernizr/Modernizr | ---
+++
@@ -26,7 +26,6 @@
return 'Promise' in window &&
// Some of these methods are missing from
// Firefox/Chrome experimental implementations
- 'cast' in window.Promise &&
'resolve' in window.Promise &&
'reject' in window.Promise &&
'all' in window.Promise && |
607cedc66dcee8d76c2786e1aa2b2389577bd204 | src/plugins/loading-bar.js | src/plugins/loading-bar.js | import Vue from 'vue'
import { isSSR } from './platform.js'
import QAjaxBar from '../components/ajax-bar/QAjaxBar.js'
export default {
start () {},
stop () {},
increment () {},
install ({ $q, cfg }) {
if (isSSR) {
$q.loadingBar = this
return
}
const bar = $q.loadingBar = new Vue({
... | import Vue from 'vue'
import { isSSR } from './platform.js'
import QAjaxBar from '../components/ajax-bar/QAjaxBar.js'
export default {
start () {},
stop () {},
increment () {},
install ({ $q, cfg }) {
if (isSSR) {
$q.loadingBar = this
return
}
const bar = $q.loadingBar = new Vue({
... | Add component name for LoadingBar plugin | chore: Add component name for LoadingBar plugin
| JavaScript | mit | pdanpdan/quasar,quasarframework/quasar,pdanpdan/quasar,pdanpdan/quasar,rstoenescu/quasar-framework,rstoenescu/quasar-framework,fsgiudice/quasar,fsgiudice/quasar,quasarframework/quasar,pdanpdan/quasar,quasarframework/quasar,quasarframework/quasar,rstoenescu/quasar-framework,fsgiudice/quasar | ---
+++
@@ -15,6 +15,7 @@
}
const bar = $q.loadingBar = new Vue({
+ name: 'LoadingBar',
render: h => h(QAjaxBar, {
ref: 'bar',
props: cfg.loadingBar |
9496ca53251d22fa7c43af672dbc39feeeace5fe | test/helpers/capture-candidates.js | test/helpers/capture-candidates.js | module.exports = function(pc, candidates, callback) {
var timer;
pc.onicecandidate = function(evt) {
if (evt.candidate) {
console.log(evt);
candidates.push(evt.candidate);
}
else {
// TODO: trigger callback when supported
}
};
timer = setInterval(function() {
if (pc.iceGa... | module.exports = function(pc, candidates, callback) {
pc.onicecandidate = function(evt) {
if (evt.candidate) {
console.log(evt);
candidates.push(evt.candidate);
}
else {
callback();
}
};
};
| Remove the timer for monitoring the icegatheringstate | Remove the timer for monitoring the icegatheringstate
| JavaScript | bsd-2-clause | ssaroha/node-webrtc,vshymanskyy/node-webrtc,lresc/node-webrtc,siphontv/node-webrtc,martindale/node-webrtc,martindale/node-webrtc,diffalot/node-webrtc,martindale/node-webrtc,siphontv/node-webrtc,siphontv/node-webrtc,ssaroha/node-webrtc,ssaroha/node-webrtc,siphontv/node-webrtc,guymguym/node-webrtc,martindale/node-webrtc,... | ---
+++
@@ -1,22 +1,11 @@
module.exports = function(pc, candidates, callback) {
- var timer;
-
pc.onicecandidate = function(evt) {
if (evt.candidate) {
console.log(evt);
candidates.push(evt.candidate);
}
else {
- // TODO: trigger callback when supported
+ callback();
}... |
088a0c67588f9334eb8dbed9447055eff3fbfe30 | example/controllers/football.js | example/controllers/football.js | 'use strict'
module.exports = (function(){
/**
* Import modules
*/
const footballDb = require('./../db/footballDb')
/**
* football module API
*/
return {
'leagues': leagues,
'leagueTable_id': leagueTable_id
}
/**
* football module API --... | 'use strict'
module.exports = (function(){
/**
* Import modules
*/
const footballDb = require('./../db/footballDb')
/**
* football module API
*/
return {
'leagues': leagues,
'leagueTable_id': leagueTable_id
}
/**
* football module API --... | Correct comment on parsing route parameters instead of query | Correct comment on parsing route parameters instead of query
| JavaScript | mit | CCISEL/connect-controller,CCISEL/connect-controller | ---
+++
@@ -16,7 +16,7 @@
/**
* football module API -- leagueTable
*/
- function leagueTable_id(id) { // Auto parses id from query-string
+ function leagueTable_id(id) { // Auto parses id from route parameters
return footballDb
.leagueTable(id)
.then(league =>... |
5a63f87a9bf6fa7c4ce54f7c5f650b85190fd930 | fetch-browser.js | fetch-browser.js | (function () {
'use strict';
function fetchPonyfill(options) {
var Promise = options && options.Promise || self.Promise;
var XMLHttpRequest = options && options.XMLHttpRequest || self.XMLHttpRequest;
var global = self;
return (function () {
var self = Object.create(global, {
fetch: {... | (function () {
'use strict';
function fetchPonyfill(options) {
var Promise = options && options.Promise || self.Promise;
var XMLHttpRequest = options && options.XMLHttpRequest || self.XMLHttpRequest;
var global = self;
return (function () {
var self = Object.create(global, {
fetch: {... | Remove global binding that is now not needed anymore | Remove global binding that is now not needed anymore
| JavaScript | mit | qubyte/fetch-ponyfill,qubyte/fetch-ponyfill | ---
+++
@@ -17,7 +17,7 @@
// {{whatwgFetch}}
return {
- fetch: self.fetch.bind(global),
+ fetch: self.fetch,
Headers: self.Headers,
Request: self.Request,
Response: self.Response |
2cb746c292c9c68d04d9393eeccdf398573a84af | build/tests/bootstrap.js | build/tests/bootstrap.js | // Remove the PUBLIC_URL, if defined
process.env.PUBLIC_URL = ''
process.env.INSPIRE_API_URL = 'inspire-api-url'
require('babel-register')()
const { jsdom } = require('jsdom')
const moduleAlias = require('module-alias')
const path = require('path')
moduleAlias.addAlias('common', path.join(__dirname, '../../src'))
... | const { JSDOM } = require('jsdom')
const moduleAlias = require('module-alias')
const path = require('path')
require('babel-register')()
moduleAlias.addAlias('common', path.join(__dirname, '../../src'))
// Remove the PUBLIC_URL, if defined
process.env.PUBLIC_URL = ''
process.env.INSPIRE_API_URL = 'inspire-api-url'
... | Update JSDOM usage due to API change | Update JSDOM usage due to API change
| JavaScript | mit | sgmap/inspire,sgmap/inspire | ---
+++
@@ -1,20 +1,22 @@
+const { JSDOM } = require('jsdom')
+const moduleAlias = require('module-alias')
+const path = require('path')
+
+require('babel-register')()
+
+moduleAlias.addAlias('common', path.join(__dirname, '../../src'))
+
// Remove the PUBLIC_URL, if defined
process.env.PUBLIC_URL = ''
process.e... |
c14bea03e77d0b7573ae087c879cadfc3ca9c970 | firefox/prefs.js | firefox/prefs.js | user_pref("accessibility.typeaheadfind.flashBar", 0);
user_pref("accessibility.typeaheadfind.prefillwithselection", true);
user_pref("browser.backspace_action", 2);
user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.newtab.url", "about:blank");
user_pref("browser.search.suggest.enabled"... | user_pref("accessibility.typeaheadfind.flashBar", 0);
user_pref("accessibility.typeaheadfind.prefillwithselection", true);
user_pref("browser.backspace_action", 2);
user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.newtab.url", "about:blank");
user_pref("browser.readinglist.enabled", f... | Disable a few unused features | firefox: Disable a few unused features
| JavaScript | mit | poiru/dotfiles,poiru/dotfiles,poiru/dotfiles | ---
+++
@@ -3,6 +3,7 @@
user_pref("browser.backspace_action", 2);
user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.newtab.url", "about:blank");
+user_pref("browser.readinglist.enabled", false);
user_pref("browser.search.suggest.enabled", false);
user_pref("browser.selfsupport.u... |
9d43d46eac238af0ac1a038916e6ebe21383fc95 | gatsby-config.js | gatsby-config.js | module.exports = {
siteMetadata: {
siteUrl: 'https://chocolate-free.com/',
title: 'Chocolate Free',
},
plugins: [
{
resolve: 'gatsby-source-contentful',
options: {
spaceId: '0w6gaytm0wfv',
accessToken: 'c9414fe612e8c31f402182354c5263f9c6b1f0c611ae5597585cb78692dc2493',
... | module.exports = {
siteMetadata: {
siteUrl: 'https://chocolate-free.com/',
title: 'Chocolate Free',
},
plugins: [
{
resolve: 'gatsby-source-contentful',
options: {
spaceId: process.env.CHOCOLATE_FREE_CF_SPACE,
accessToken: process.env.CHOCOLATE_FREE_CF_TOKEN
},
},... | Replace api key with env vars | Replace api key with env vars
| JavaScript | apache-2.0 | Khaledgarbaya/chocolate-free-website,Khaledgarbaya/chocolate-free-website | ---
+++
@@ -7,8 +7,8 @@
{
resolve: 'gatsby-source-contentful',
options: {
- spaceId: '0w6gaytm0wfv',
- accessToken: 'c9414fe612e8c31f402182354c5263f9c6b1f0c611ae5597585cb78692dc2493',
+ spaceId: process.env.CHOCOLATE_FREE_CF_SPACE,
+ accessToken: process.env.CHOCOLATE_FR... |
930bcf06b7cca0993d0c13250b1ae7bd484643ba | src/js/routes.js | src/js/routes.js | 'use strict';
angular.module('mission-control').config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
// For unmatched routes
$urlRouterProvider.otherwise('/');
// Application routes
$stateProvider
.state('index', {
url: '/',
templateUr... | 'use strict';
angular.module('mission-control').config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
// For unmatched routes
$urlRouterProvider.otherwise('/');
// Application routes
$stateProvider
.state('index', {
url: '/',
templateUr... | Add mentors route to router | Add mentors route to router
| JavaScript | mit | craigcabrey/mission-control,craigcabrey/mission-control | ---
+++
@@ -27,6 +27,11 @@
templateUrl: 'views/members.html',
controller: 'MembersCtrl'
})
+ .state('mentors', {
+ url: '/mentors',
+ templateUrl: 'views/mentors.html',
+ controller: 'MentorsCtrl'
+ })
.state('sponsors', {
url: '/sponsors',
... |
b40447a79ed4d94ba05e379e4192556c271a1e4b | test/browser.spec.js | test/browser.spec.js | var expect = require('chai').expect;
var request = require('supertest');
var http = require('http');
var cookie = require('../lib/browser');
describe('server-side cookie', function() {
describe('.set', function() {
it('should work', function() {
cookie.set('yolo', 'swag');
expect(cookie.get('yolo')).... | var expect = require('chai').expect;
var request = require('supertest');
var http = require('http');
var cookie = require('../lib/browser');
describe('server-side cookie', function() {
describe('.get', function() {
it('should work', function() {
expect(cookie.get('swag_swag_swag_')).to.be.undefined;
})... | Add simple test case for browser `.get` | Add simple test case for browser `.get`
| JavaScript | mit | srph/cookie-machine | ---
+++
@@ -4,6 +4,12 @@
var cookie = require('../lib/browser');
describe('server-side cookie', function() {
+ describe('.get', function() {
+ it('should work', function() {
+ expect(cookie.get('swag_swag_swag_')).to.be.undefined;
+ });
+ });
+
describe('.set', function() {
it('should work', ... |
09c0f85065d496bec9e869f3ec170648b99f77c9 | lib/middleware/request_proxy.js | lib/middleware/request_proxy.js | // Copyright (C) 2007-2014, GoodData(R) Corporation.
var httpProxy = require('http-proxy');
module.exports = function(host) {
var currentHost, currentPort;
var proxy = new httpProxy.RoutingProxy({
target: {
https: true
}
});
var requestProxy = function(req, res, next) {
... | // Copyright (C) 2007-2014, GoodData(R) Corporation.
var httpProxy = require('http-proxy');
module.exports = function(host) {
var currentHost, currentPort;
var proxy = new httpProxy.RoutingProxy({
target: {
https: true
}
});
var requestProxy = function(req, res, next) {
... | Set referer header to prevent CSRF | Set referer header to prevent CSRF
| JavaScript | bsd-3-clause | gooddata/grunt-grizzly,crudo/grunt-grizzly | ---
+++
@@ -23,6 +23,9 @@
// Remove Origin header so it's not evaluated as cross-domain request
req.headers['origin'] = null;
+ // To prevent CSRF
+ req.headers['referer'] = 'https://' + host;
+
// Proxy received request to curret backend endpoint
proxy.proxyRequest... |
6e6ec8c967ddb486a979a267016e7eb2b5c7ff4d | eachSeries.js | eachSeries.js | import when from 'when';
let
openFiles = ['a.js', 'b.js', 'c.js'],
saveFile = (file) => {
console.log('saveFile', file);
return new Promise((resolve, reject) => {
setTimeout(
() => {
console.log('timeout', file);
resolve(file);... | import when from 'when';
let
openFiles = ['a.js', 'b.js', 'c.js'],
saveFile = (file) => {
console.log('saveFile', file);
return new Promise((resolve, reject) => {
setTimeout(
() => {
console.log('timeout', file);
resolve(file);... | Update each series results to be embedded in the reduce | Update each series results to be embedded in the reduce
| JavaScript | mit | jgornick/asyncp | ---
+++
@@ -15,17 +15,15 @@
});
};
-let results = [];
openFiles.reduce(
- (promise, file) => {
- return promise
- .then(saveFile.bind(null, file))
+ (promise, file) => promise.then((results) => {
+ return saveFile(file)
.then((result) => {
... |
f7d374595d08b3421f0da67932f5fcbb7a092e8d | src/lib/watch.js | src/lib/watch.js | "use strict";
var db = require("./firebase");
// Ensure the updated timestamp is always accurate-ish
module.exports = function(ref) {
ref.on("child_changed", function(snap) {
var key = snap.key(),
auth;
// Avoid looping forever
if(key === "updated_at" || key === "updat... | "use strict";
var db = require("./firebase");
// Ensure the updated timestamp is always accurate-ish
module.exports = function(ref) {
ref.on("child_changed", function(snap) {
var key = snap.key(),
auth;
// Avoid looping forever
if(key === "updated_at" || key === "updat... | Convert two .set() calls into one .update() | Convert two .set() calls into one .update()
| JavaScript | mit | tivac/crucible,Ryan-McMillan/crucible,kevinkace/crucible,tivac/anthracite,kevinkace/crucible,tivac/anthracite,tivac/crucible,Ryan-McMillan/crucible | ---
+++
@@ -18,7 +18,9 @@
// Clean up any old updated timestamps floating around
ref.child("updated").remove();
- ref.child("updated_at").set(db.TIMESTAMP);
- ref.child("updated_by").set(auth.uid);
+ ref.update({
+ updated_at : db.TIMESTAMP,
+ upd... |
3b0ea4f643c065a14b8bd79d27111e69d3698b2b | erisevents.js | erisevents.js | const eris = justcord.eris;
const config = justcord.config;
const chat = justcord.chat;
eris.on("ready", () => {
console.log("Justcord ready!"); // TODO: Add logging utility functions
eris.createMessage(config.eris.id, "Server connected to the guild successfully!")
});
eris.on("messageCreate", (message) => {
... | const eris = justcord.eris;
const config = justcord.config;
const chat = justcord.chat;
eris.on("ready", () => {
console.log("Justcord ready!"); // TODO: Add logging utility functions
eris.createMessage(config.eris.id, "Server connected to the guild successfully!")
});
eris.on("messageCreate", (message) => {
... | Use username if nickname is null | Use username if nickname is null
| JavaScript | mit | md678685/justcord-3 | ---
+++
@@ -9,7 +9,9 @@
eris.on("messageCreate", (message) => {
if (message.channel.id == config.eris.id && message.member.id != eris.user.id) {
- chat.broadcast(`${message.member.nick}: ${message.content}`);
- console.log(`Discord: ${message.member.nick}: ${message.content}`);
+ let name... |
560f6420d7681201cb404eb39e80f3000102e53c | lib/_memoize-watcher.js | lib/_memoize-watcher.js | 'use strict';
var noop = require('es5-ext/function/noop')
, assign = require('es5-ext/object/assign')
, memoize = require('memoizee')
, ee = require('event-emitter')
, deferred = require('deferred')
, isPromise = deferred.isPromise;
module.exports = function (fn/*, options*/) {
var factory, m... | 'use strict';
var noop = require('es5-ext/function/noop')
, assign = require('es5-ext/object/assign')
, memoize = require('memoizee')
, ee = require('event-emitter')
, eePipe = require('event-emitter/lib/pipe')
, deferred = require('deferred')
, isPromise = deferred.isPromise;
module.expor... | Update up to changes in event-emitter package | Update up to changes in event-emitter package
| JavaScript | isc | medikoo/fs2 | ---
+++
@@ -4,6 +4,7 @@
, assign = require('es5-ext/object/assign')
, memoize = require('memoizee')
, ee = require('event-emitter')
+ , eePipe = require('event-emitter/lib/pipe')
, deferred = require('deferred')
, isPromise = deferred.isPromise;
@@ -23,7 +24,7 @@
} else {
emitter =... |
79c32b103f5cbd76b5f9d287c89372704cfbc35e | bin/setup.js | bin/setup.js | #!/usr/bin/env node
// Must symlink the generator from xtc's modules up to the project's modules.
// Else Yeoman won't find it.
var path = require('path')
fs = require('fs')
;
// process.cwd() == __dirname
if ('install' === process.env.npm_lifecycle_event) {
try {
fs.symlinkSync(path.join(process.cwd(), '/node... | #!/usr/bin/env node
// Must symlink the generator from xtc's modules up to the project's modules.
// Else Yeoman won't find it.
var path = require('path')
fs = require('fs')
;
// process.cwd() == __dirname
if ('install' === process.env.npm_lifecycle_event) {
try {
fs.symlinkSync(path.join(process.cwd(), '/node... | Fix typo in error message | Fix typo in error message
| JavaScript | mit | MarcDiethelm/xtc | ---
+++
@@ -16,7 +16,7 @@
console.log('symlink: generator-xtc into node_modules\n')
} catch (e) {
if (e.code === 'EEXIST') {
- console.info('symlink: generator-xtc already already exists node_modules\n');
+ console.info('symlink: generator-xtc already exists in node_modules\n');
}
else {
throw e... |
24bd88bb2965515ac7f9ffecde850e7f63ce23a5 | app/scripts/app/routes/items.js | app/scripts/app/routes/items.js | var ItemsRoute = Em.Route.extend({
model: function (params) {
return this.api.fetchAll('items', 'groups', params.group_id);
},
setupController: function (controller, model) {
// allow sub-routes to access the GroupId since it seems the dynamic segment is not available otherwise
controller.set('GroupI... | var ItemsRoute = Em.Route.extend({
model: function (params) {
this.set('currentGroupId', parseInt(params.group_id, 10));
return this.api.fetchAll('items', 'groups', params.group_id);
},
setupController: function (controller, model) {
// allow sub-routes to access the GroupId since it seems the dynami... | Fix setting GroupId on ItemsController when its model is empty | Fix setting GroupId on ItemsController when its model is empty
| JavaScript | mit | darvelo/wishlist,darvelo/wishlist | ---
+++
@@ -1,11 +1,12 @@
var ItemsRoute = Em.Route.extend({
model: function (params) {
+ this.set('currentGroupId', parseInt(params.group_id, 10));
return this.api.fetchAll('items', 'groups', params.group_id);
},
setupController: function (controller, model) {
// allow sub-routes to access t... |
51e2104a004ca63fb1e7f5262e61441b558bd288 | packages/react-native-version-check-expo/src/ExpoVersionInfo.js | packages/react-native-version-check-expo/src/ExpoVersionInfo.js | let RNVersionCheck;
if (process.env.RNVC_ENV === 'test') {
RNVersionCheck = {
country: 'ko',
packageName: 'com.reactnative.versioncheck',
currentBuildNumber: 1,
currentVersion: '0.0.1',
};
} else {
const { Platform } = require('react-native');
const { Constants, Util } = require('expo');
cons... | let RNVersionCheck;
if (process.env.RNVC_ENV === 'test') {
RNVersionCheck = {
country: 'ko',
packageName: 'com.reactnative.versioncheck',
currentBuildNumber: 1,
currentVersion: '0.0.1',
};
} else {
const { Platform } = require('react-native');
const { Constants, Localization, Util } = require('e... | Use `Localization.getCurrentDeviceCountryAsync` if its version of expo is over 26 since it's deprecated. | Use `Localization.getCurrentDeviceCountryAsync` if its version of expo is over 26 since it's deprecated.
ref:https://github.com/expo/expo-docs/tree/master/versions/v26.0.0/sdk
| JavaScript | mit | kimxogus/react-native-version-check,kimxogus/react-native-version-check,kimxogus/react-native-version-check | ---
+++
@@ -8,7 +8,7 @@
};
} else {
const { Platform } = require('react-native');
- const { Constants, Util } = require('expo');
+ const { Constants, Localization, Util } = require('expo');
const { manifest = {} } = Constants;
const {
@@ -19,7 +19,7 @@
RNVersionCheck = {
currentVersion: ver... |
c1b67784c26c4c2658446dddbed92ef44b8bd84a | web/src/js/app/views/ViewportView.js | web/src/js/app/views/ViewportView.js | cinema.views.ViewportView = Backbone.View.extend({
initialize: function () {
this.$el.html(cinema.app.templates.viewport());
this.camera = new cinema.models.CameraModel({
info: this.model
});
this.renderView = new cinema.views.VisualizationCanvasWidget({
el... | cinema.views.ViewportView = Backbone.View.extend({
initialize: function (opts) {
this.$el.html(cinema.app.templates.viewport());
this.camera = opts.camera || new cinema.models.CameraModel({
info: this.model
});
this.renderView = new cinema.views.VisualizationCanvasWidg... | Allow viewport to be initialized with a pre-existing camera model | Allow viewport to be initialized with a pre-existing camera model
| JavaScript | bsd-3-clause | Kitware/cinema,Kitware/cinema,Kitware/cinema,Kitware/cinema | ---
+++
@@ -1,9 +1,9 @@
cinema.views.ViewportView = Backbone.View.extend({
- initialize: function () {
+ initialize: function (opts) {
this.$el.html(cinema.app.templates.viewport());
- this.camera = new cinema.models.CameraModel({
+ this.camera = opts.camera || new cinema.models.Came... |
1c7c553128fcc842f394c429dfc28dbce934fb86 | pegasus/sites.v3/code.org/public/js/applab-docs.js | pegasus/sites.v3/code.org/public/js/applab-docs.js | /*global CodeMirror*/
$(function() {
$('pre').each(function() {
var preElement = $(this);
var code = dedent(preElement.text()).trim();
preElement.empty();
CodeMirror(this, {
value: code,
mode: 'javascript',
lineNumbers: !preElement.is('.inline'),
readOnly: true
});
});
... | /*global CodeMirror*/
$(function() {
$('pre').each(function() {
var preElement = $(this);
var code = dedent(preElement.text()).trim();
preElement.empty();
CodeMirror(this, {
value: code,
mode: 'javascript',
lineNumbers: !preElement.is('.inline'),
readOnly: true
});
});
... | Rewrite documentation urls to forward on the embedded flag | Rewrite documentation urls to forward on the embedded flag
| JavaScript | apache-2.0 | rvarshney/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org,pickettd/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org,rvarshne... | ---
+++
@@ -13,7 +13,34 @@
});
$("a[href^='http']").attr("target", "_blank");
+ rewrite_urls();
});
+
+/**
+ * Our x-frame-options require that any page that is embedded
+ * in an iframe include embedded as a query arg.
+ */
+function rewrite_urls() {
+ var is_embedded = window.location.href.endsWith("embe... |
45c28fca5c5bfad96691fb61b71967f3eb38ffe6 | brainfuck.js | brainfuck.js | (function(global) {
'use strict';
(function(id) {
var i, j;
var tab = document.getElementById(id);
var thead = tab.querySelector('thead');
var tbody = tab.querySelector('tbody');
var tr, th, td;
// tr = document.createElement('tr');
// th = document.creat... | (function(global) {
'use strict';
(function(id) {
var i, j;
var tab = document.getElementById(id);
var thead = tab.querySelector('thead');
var tbody = tab.querySelector('tbody');
var tr, th, td;
// tr = document.createElement('tr');
// th = document.creat... | Add ids to the markup | Add ids to the markup
| JavaScript | mit | Lexicality/esolang,Lexicality/esolang | ---
+++
@@ -18,12 +18,14 @@
// thead.appendChild(tr);
for (i = 0; i < 3; i++) {
tr = document.createElement('tr');
+ tr.id = "row-" + i;
// th = document.createElement('th');
// th.textContent = i + 1;
// tr.appendChild(th);
... |
2cdd929e7ee6924387e0f96a84c080d111de6604 | config/secrets.js | config/secrets.js | module.exports = {
db: process.env.MONGODB || process.env.MONGOHQ_URL || 'mongodb://localhost:27017/gamekeller',
sessionSecret: process.env.SESSION_SECRET || 'gkdevel'
} | module.exports = {
db: process.env.MONGODB || 'mongodb://localhost:27017/gamekeller',
sessionSecret: process.env.SESSION_SECRET || 'gkdevel'
} | Remove support for MONGOHQ_URL env variable | Remove support for MONGOHQ_URL env variable
| JavaScript | mit | gamekeller/next,gamekeller/next | ---
+++
@@ -1,4 +1,4 @@
module.exports = {
- db: process.env.MONGODB || process.env.MONGOHQ_URL || 'mongodb://localhost:27017/gamekeller',
+ db: process.env.MONGODB || 'mongodb://localhost:27017/gamekeller',
sessionSecret: process.env.SESSION_SECRET || 'gkdevel'
} |
790b051f536065f97da5699f9d9332391d4ec97a | config/targets.js | config/targets.js | /* eslint-env node */
module.exports = {
browsers: [
'ie 9',
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
]
};
| /* eslint-env node */
// Which browsers are returned can be found at http://browserl.ist/
module.exports = {
browsers: [
'last 1 edge versions',
'last 1 chrome versions',
'firefox esr', //actually points to the last 2 ESR releases as they overlap
'last 1 safari versions',
'last 1 ios versions',
... | Drop support for older browsers | Drop support for older browsers
By only targeting modern evergreen browsers in our build we can
significantly reduce the amount of extra code we generate to be
compatible with older browsers. This will make our application smaller
to download and faster to parse.
| JavaScript | mit | thecoolestguy/frontend,thecoolestguy/frontend,djvoa12/frontend,ilios/frontend,dartajax/frontend,jrjohnson/frontend,dartajax/frontend,ilios/frontend,jrjohnson/frontend,djvoa12/frontend | ---
+++
@@ -1,9 +1,13 @@
/* eslint-env node */
+
+// Which browsers are returned can be found at http://browserl.ist/
module.exports = {
browsers: [
- 'ie 9',
- 'last 1 Chrome versions',
- 'last 1 Firefox versions',
- 'last 1 Safari versions'
+ 'last 1 edge versions',
+ 'last 1 chrome versions'... |
7f84fd91f2196394261e287b0048ea30612858b3 | index.js | index.js | var through = require('through2');
var choppa = function(chunkSize) {
chunkSize = chunkSize === undefined ? 1 : chunkSize;
var prev = new Buffer(0);
var transform = function(chunk, enc, cb) {
chunk = Buffer.concat([prev, chunk]);
var self = this;
if (chunkSize > 0) {
while (chunk.length >= chu... | var through = require('through2');
var choppa = function(chunkSize) {
chunkSize = chunkSize === undefined ? 1 : chunkSize;
var prev = new Buffer(0);
var transform = function(chunk, enc, cb) {
chunk = Buffer.concat([prev, chunk]);
var self = this;
if (chunkSize > 0) {
while (chunk.length >= chu... | Fix async reads from the choppa. | Fix async reads from the choppa. | JavaScript | mit | sorribas/choppa | ---
+++
@@ -29,7 +29,7 @@
cb();
};
- return through(transform, flush);
+ return through.obj(transform, flush);
};
module.exports = choppa; |
f5f96e1458e43f2360f16297b8e52eb71c666d8d | index.js | index.js | var aglio = require('aglio');
var through2 = require('through2');
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var defaults = require('lodash.defaults');
var path = require('path');
module.exports = function (options) {
'use strict';
// Mixes in default options.
options = defaults(optio... | var aglio = require('aglio');
var through2 = require('through2');
var gutil = require('gulp-util');
var PluginError = gutil.PluginError;
var defaults = require('lodash.defaults');
var path = require('path');
module.exports = function (options) {
'use strict';
// Mixes in default options.
options = defaults(optio... | Fix error when files are not found | :bug: Fix error when files are not found
Using include syntax with a wrong path resulted in a crash without emitting an error message. | JavaScript | mit | nnnnathann/gulp-aglio,nnnnathann/gulp-aglio | ---
+++
@@ -38,17 +38,21 @@
// Inject includePath for relative includes
opts.includePath = opts.includePath || path.dirname(opts.filename);
-
- aglio.render(str, opts, function (err, html) {
- if (err) {
- self.emit('error', new PluginError('gulp-aglio', err));
- } else {
- file... |
43b808affcd475e7ad94e4f494c306334323dbb3 | index.js | index.js | const getJSON = require('get-json');
const overpass = 'http://overpass-api.de/api/interpreter?data=';
const query = '[out:json];way[%22highway%22](around:50,51.424037,-0.148666);out;';
getJSON(`${overpass}${query}`, (err, result) => {
if (err) console.log(err);
console.log(result);
});
| const getJSON = require('get-json');
const overpass = 'http://overpass-api.de/api/interpreter?data=';
const lat = 51.424037;
const long = -0.148666;
const distance = 50;
const query = `[out:json]; way["highway"](around:${distance},${lat},${long}); out;`;
getJSON(`${overpass}${query}`, (err, result) => {
if (err) ... | Use templates to cleanup query | Use templates to cleanup query
| JavaScript | mit | mkhalila/nearest-roads | ---
+++
@@ -1,7 +1,12 @@
const getJSON = require('get-json');
const overpass = 'http://overpass-api.de/api/interpreter?data=';
-const query = '[out:json];way[%22highway%22](around:50,51.424037,-0.148666);out;';
+
+const lat = 51.424037;
+const long = -0.148666;
+const distance = 50;
+
+const query = `[out:json]; ... |
74f1842a096c184982a94d4fc5a95c1a90d18a63 | index.js | index.js | var qs = require('querystring')
module.exports = function (network, url, opts) {
opts = opts || {}
if (!linkfor[network]) throw new Error('Unsupported network ' + network)
return linkfor[network](url, opts)
}
var linkfor = {
facebook: function (url, opts) {
var share = {
u: url
}
if (opts... | var qs = require('querystring')
module.exports = function (network, url, opts) {
opts = opts || {}
if (!linkfor[network]) throw new Error('Unsupported network ' + network)
return linkfor[network](url, opts)
}
var linkfor = {
facebook: function (url, opts) {
var share = {
u: url
}
if (opts... | Add google+ as alias for googleplus | Add google+ as alias for googleplus
| JavaScript | mit | tableflip/share-my-url | ---
+++
@@ -40,3 +40,5 @@
return 'https://twitter.com/intent/tweet?' + qs.stringify(share)
}
}
+
+linkfor['google+'] = linkfor.googleplus |
64c4b12d5300c2a52b56b150f7202757c4d7c958 | index.js | index.js | var _ = require('lodash');
var postcss = require('postcss');
var SEProperties = require('swedish-css-properties');
var SEValues = require('swedish-css-values');
module.exports = postcss.plugin('postcss-swedish-stylesheets', function (opts) {
opts = opts || {
properties: {},
values: {}
};
... | const _ = require('lodash');
const SEProperties = require('swedish-css-properties');
const SEValues = require('swedish-css-values');
const postcssSwedishStylesheets = (opts = {}) => {
if (_.isObject(opts.properties)) {
_.merge(SEProperties, opts.properties);
}
if (_.isObject(opts.values)) {
_.merge(SEVa... | Update plugin to use PostCSS 8 | feat: Update plugin to use PostCSS 8
| JavaScript | mit | johnie/postcss-swedish-stylesheets | ---
+++
@@ -1,45 +1,41 @@
-var _ = require('lodash');
-var postcss = require('postcss');
-var SEProperties = require('swedish-css-properties');
-var SEValues = require('swedish-css-values');
+const _ = require('lodash');
+const SEProperties = require('swedish-css-properties');
+const SEValues = require('swedish-css-v... |
e53f9e79ce9b90480f11341a7427e6e8a63ca65a | index.js | index.js | var exec = require('child_process').exec;
module.exports = function sysPrefix() {
return new Promise(function(resolve, reject) {
exec('python -c \'import sys; print(sys.prefix)\'',
function(err, stdout) {
if (err !== null) {
reject(err);
}
else {
resolve(stdout.to... | var exec = require('child_process').exec;
module.exports = function sysPrefix() {
return new Promise(function(resolve, reject) {
exec('python -c "import sys; print(sys.prefix)"',
function(err, stdout) {
if (err !== null) {
reject(err);
}
else {
resolve(stdout.toSt... | Switch to double quotes inside the exec | Switch to double quotes inside the exec
This allows the exec call to work properly with Windows.
| JavaScript | apache-2.0 | rgbkrk/sys-prefix-promise | ---
+++
@@ -1,7 +1,7 @@
var exec = require('child_process').exec;
module.exports = function sysPrefix() {
return new Promise(function(resolve, reject) {
- exec('python -c \'import sys; print(sys.prefix)\'',
+ exec('python -c "import sys; print(sys.prefix)"',
function(err, stdout) {
if (err ... |
a2ac0281ef8e4a489b87553edec11f650418ef83 | index.js | index.js | const express = require('express');
const shortUrlController = require('./lib/short-url-controller.js');
const stubController = require('./lib/stub-controller.js');
const logger = require('winston');
const port = process.env.PORT || 5000;
const app = express();
app.set('view engine', 'pug');
app.use('/', stubControll... | require('dotenv').config();
const express = require('express');
const shortUrlController = require('./lib/short-url-controller.js');
const stubController = require('./lib/stub-controller.js');
const logger = require('winston');
const port = process.env.PORT || 5000;
const app = express();
app.set('view engine', 'pug'... | Fix dotenv to work locally instead of just on heroku | Fix dotenv to work locally instead of just on heroku
| JavaScript | mit | glynnw/url-shortener,glynnw/url-shortener | ---
+++
@@ -1,3 +1,4 @@
+require('dotenv').config();
const express = require('express');
const shortUrlController = require('./lib/short-url-controller.js');
const stubController = require('./lib/stub-controller.js'); |
4e9b368ea408768aa52b44660b564fa23d344781 | index.js | index.js | /*!
* array-last <https://github.com/jonschlinkert/array-last>
*
* Copyright (c) 2014 Jon Schlinkert, contributors.
* Licensed under the MIT license.
*/
var isNumber = require('is-number');
module.exports = function last(arr, n) {
if (!Array.isArray(arr)) {
throw new Error('expected the first argument to b... | /*!
* array-last <https://github.com/jonschlinkert/array-last>
*
* Copyright (c) 2014 Jon Schlinkert, contributors.
* Licensed under the MIT license.
*/
var isNumber = require('is-number');
module.exports = function last(arr, n) {
if (!Array.isArray(arr)) {
throw new Error('expected the first argument to b... | Return a single value when n=1 | Return a single value when n=1
* Worked previously: last([1], 1) === 1
* Broken previously: last([1, 2], 1) === 2
| JavaScript | mit | jonschlinkert/array-last | ---
+++
@@ -18,8 +18,8 @@
}
n = isNumber(n) ? +n : 1;
- if (n === 1 && len === 1) {
- return arr[0];
+ if (n === 1) {
+ return arr[len - 1];
}
var res = new Array(n); |
bb273759bbb9f9edb716fa6596477fa019057fec | index.js | index.js | /* jshint node: true */
'use strict';
var fs = require('fs');
module.exports = {
name: 'uncharted-describe-models',
config: function(env, config) {
if (env === 'test') {
return;
}
if (!fs.existsSync('app/schema.json')) {
throw new Error('You must include a schema.json in the root of app/... | /* jshint node: true */
'use strict';
var fs = require('fs');
module.exports = {
name: 'uncharted-describe-models',
config: function(env, config) {
if (!fs.existsSync('app/schema.json')) {
throw new Error('You must include a schema.json in the root of app/');
}
var schema = JSON.parse(fs.readF... | Make sure we always load the schema, even within a test | Make sure we always load the schema, even within a test
| JavaScript | mit | unchartedcode/describe-models,unchartedcode/describe-models | ---
+++
@@ -7,10 +7,6 @@
name: 'uncharted-describe-models',
config: function(env, config) {
- if (env === 'test') {
- return;
- }
-
if (!fs.existsSync('app/schema.json')) {
throw new Error('You must include a schema.json in the root of app/');
} |
206a09a32b2f41f19c7340ec599e5d73e86d8cfc | index.js | index.js | var restify = require('restify');
var messenger = require('./lib/messenger');
var session = require('./lib/session');
var server = restify.createServer();
server.use(restify.queryParser());
server.use(restify.bodyParser());
server.use(restify.authorizationParser());
server.get('/', function (req, res, next) {
res... | var restify = require('restify');
var messenger = require('./lib/messenger');
var session = require('./lib/session');
var server = restify.createServer();
server.use(restify.queryParser());
server.use(restify.bodyParser());
server.use(restify.authorizationParser());
server.get('/', function (req, res, next) {
res... | Send HTTP responses for all messages | Send HTTP responses for all messages
| JavaScript | mpl-2.0 | rockawayhelp/emergencybadges,rockawayhelp/emergencybadges | ---
+++
@@ -17,13 +17,18 @@
var phoneNumber = req.params.From;
session.get(phoneNumber, function(err, user) {
- if (err) messenger.send(phoneNumber, 'There was some kind of error.')
+ if (err) {
+ messenger.send(phoneNumber, 'There was some kind of error.');
+ res.send(500, {error: 'Somethin... |
b069edce8a3e82dc64e34678db4dd7fe5c508aa3 | index.js | index.js | // var http = require("http");
// app.set('view engine', 'html');
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/views'));
app.use(express.static(__dirname + '/scripts'));
app.listen(3000, function () {
console.log('Example app listening on port 3000!')
})
app.get('/', f... | // var http = require("http");
// app.set('view engine', 'html');
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/views'));
app.use(express.static(__dirname + '/scripts'));
app.listen(3000, function () {
console.log('Example app listening on port 3000!')
})
app.get('/', f... | Add info on setting parameters in route | Add info on setting parameters in route
| JavaScript | apache-2.0 | XanderPSON/febrezehackathon,XanderPSON/febrezehackathon | ---
+++
@@ -24,3 +24,12 @@
app.delete('/user', function (req, res) {
res.send('Got a DELETE request at /user')
})
+
+// Route path: /users/:userId/books/:bookId
+// Request URL: http://localhost:3000/users/34/books/8989
+// req.params: { "userId": "34", "bookId": "8989" }
+// To define routes with route paramete... |
992c7b2c2cc3f73eaef974a5c885da6fe27ebd6c | index.js | index.js | module.exports = {
handlebars: require('./lib/handlebars'),
marked: require('./lib/marked'),
componentTemplate: 'node_modules/foundation-docs/templates/component.html',
handlebarsHelpers: 'node_modules/foundation-docs/helpers/'
}
| var path = require('path');
var TEMPLATE_PATH = path.join(__dirname, 'templates/component.html');
var HELPERS_PATH = path.join(__dirname, 'helpers');
module.exports = {
handlebars: require('./lib/handlebars'),
marked: require('./lib/marked'),
componentTemplate: path.relative(process.cwd(), TEMPLATE_PATH),
han... | Use relative paths for componentTemplate and handlebarsHelpers paths | Use relative paths for componentTemplate and handlebarsHelpers paths
| JavaScript | mit | zurb/foundation-docs,zurb/foundation-docs | ---
+++
@@ -1,6 +1,11 @@
+var path = require('path');
+
+var TEMPLATE_PATH = path.join(__dirname, 'templates/component.html');
+var HELPERS_PATH = path.join(__dirname, 'helpers');
+
module.exports = {
handlebars: require('./lib/handlebars'),
marked: require('./lib/marked'),
- componentTemplate: 'node_modules/... |
d60976582c1c4f8035a41e59c36489f5fbe95be1 | index.js | index.js | var Map = require('./lib/map'),
Format = require('./lib/format'),
safe64 = require('./lib/safe64');
module.exports = {
Map: Map,
Format: Format,
safe64: safe64,
pool: function(datasource) {
return {
create: function(callback) {
var resource = new Map(datasour... | var Map = require('./lib/map'),
Format = require('./lib/format'),
safe64 = require('./lib/safe64');
module.exports = {
Map: Map,
Format: Format,
safe64: safe64,
pool: function(datasource) {
return {
create: function(callback) {
var resource = new Map(datasour... | Update tilelive pool factory create method to pass errors. | Update tilelive pool factory create method to pass errors.
| JavaScript | bsd-3-clause | dshorthouse/tilelive-mapnik,CartoDB/tilelive-mapnik,mapbox/tilelive-mapnik,tomhughes/tilelive-mapnik,wsw0108/tilesource-mapnik | ---
+++
@@ -11,8 +11,7 @@
create: function(callback) {
var resource = new Map(datasource);
resource.initialize(function(err) {
- if (err) throw err;
- callback(resource);
+ callback(err, resource);
... |
93d89dfef836e493dc2a13b18ff08ee6b020cc91 | index.js | index.js | "use strict";
const util = require("gulp-util");
const through = require("through2");
const moment = require("moment");
module.exports = function(options) {
options = options || {};
function updateDate(file, options) {
const now = moment().format("YYYY/MM/DD"),
regex = /Last updated: (\d{4}\/\d{2... | "use strict";
const util = require("gulp-util");
const through = require("through2");
const moment = require("moment");
module.exports = function(options) {
options = options || {};
function updateDate(file, options) {
const now = moment().format("YYYY/MM/DD"),
regex = /Last updated?: ?(\d{4}\/\d... | Make the 'd' in 'updated' optional along with the space before the date | Make the 'd' in 'updated' optional along with the space before the date
| JavaScript | mit | Pinjasaur/gulp-update-humanstxt-date | ---
+++
@@ -9,7 +9,7 @@
function updateDate(file, options) {
const now = moment().format("YYYY/MM/DD"),
- regex = /Last updated: (\d{4}\/\d{2}\/\d{2})/i,
+ regex = /Last updated?: ?(\d{4}\/\d{2}\/\d{2})/i,
prev = regex.exec(file)[1];
if (options.log) { |
3e0998496283eb83b66f97d765e069a470f3ba5d | index.js | index.js | 'use strict';
module.exports = {
name: 'live-reload-middleware',
serverMiddleware: function(options) {
var app = options.app;
options = options.options;
if (options.liveReload === true) {
var livereloadMiddleware = require('connect-livereload');
app.use(livereloadMiddleware({
por... | 'use strict';
module.exports = {
name: 'live-reload-middleware',
serverMiddleware: function(options) {
var app = options.app;
options = options.options;
if (options.liveReload === true) {
var livereloadMiddleware = require('connect-livereload');
app.use(livereloadMiddleware({
ign... | Fix ignore list to work with query string params. | Fix ignore list to work with query string params.
| JavaScript | mit | jbescoyez/ember-cli-inject-live-reload,rwjblue/ember-cli-inject-live-reload,scottkidder/ember-cli-inject-live-reload | ---
+++
@@ -11,6 +11,17 @@
var livereloadMiddleware = require('connect-livereload');
app.use(livereloadMiddleware({
+ ignore: [
+ /\.js(?:\?.*)?$/,
+ /\.css(?:\?.*)$/,
+ /\.svg(?:\?.*)$/,
+ /\.ico(?:\?.*)$/,
+ /\.woff(?:\?.*)$/,
+ /\.png(?:\... |
688146ec463c255b6000ce72a4462dff1a99cb3c | gatsby-browser.js | gatsby-browser.js | import ReactGA from 'react-ga'
import {config} from 'config'
ReactGA.initialize(config.googleAnalyticsId);
exports.onRouteUpdate = (state, page, pages) => {
ReactGA.pageview(state.pathname);
}; | import ReactGA from 'react-ga'
import {config} from 'config'
ReactGA.initialize(config.googleAnalyticsId);
ReactGA.plugin.require('linkid');
exports.onRouteUpdate = (state, page, pages) => {
ReactGA.pageview(state.pathname);
};
| Add linkid to google analytics | Add linkid to google analytics
| JavaScript | bsd-3-clause | tadeuzagallo/blog,tadeuzagallo/blog | ---
+++
@@ -2,6 +2,7 @@
import {config} from 'config'
ReactGA.initialize(config.googleAnalyticsId);
+ReactGA.plugin.require('linkid');
exports.onRouteUpdate = (state, page, pages) => {
ReactGA.pageview(state.pathname); |
8f82186dfb27825a7b2220f9a6c3f66346f0f300 | worker/web_client/JobStatus.js | worker/web_client/JobStatus.js | import JobStatus from 'girder_plugins/jobs/JobStatus';
JobStatus.registerStatus({
WORKER_FETCHING_INPUT: {
value: 820,
text: 'Fetching input',
icon: 'icon-download',
color: '#89d2e2'
},
WORKER_CONVERTING_INPUT: {
value: 821,
text: 'Converting input',
... | import JobStatus from 'girder_plugins/jobs/JobStatus';
JobStatus.registerStatus({
WORKER_FETCHING_INPUT: {
value: 820,
text: 'Fetching input',
icon: 'icon-download',
color: '#89d2e2'
},
WORKER_CONVERTING_INPUT: {
value: 821,
text: 'Converting input',
... | Add button to cancel job | WIP: Add button to cancel job
| JavaScript | apache-2.0 | girder/girder_worker,girder/girder_worker,girder/girder_worker | ---
+++
@@ -24,5 +24,11 @@
text: 'Pushing output',
icon: 'icon-upload',
color: '#89d2e2'
+ },
+ WORKER_CANCELING: {
+ value: 824,
+ text: 'Canceling',
+ icon: 'icon-cancel',
+ color: '#f89406'
}
}); |
2e8c529dee0385daf201ecb5fca2e1d4b69d9376 | jest-setup.js | jest-setup.js | import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
// Configure Enzyme
Enzyme.configure({ adapter: new Adapter() });
// Add RAF for React 16
global.requestAnimationFrame = function requestAnimationFrame(callback) {
setTimeout(callback, 0);
};
| const Enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');
// Configure Enzyme
Enzyme.configure({ adapter: new Adapter() });
// Add RAF for React 16
global.requestAnimationFrame = function requestAnimationFrame(callback) {
setTimeout(callback, 0);
};
| Use require() instead of import(). | Use require() instead of import().
| JavaScript | mit | milesj/build-tool-config,milesj/build-tool-config,milesj/build-tool-config | ---
+++
@@ -1,5 +1,5 @@
-import Enzyme from 'enzyme';
-import Adapter from 'enzyme-adapter-react-16';
+const Enzyme = require('enzyme');
+const Adapter = require('enzyme-adapter-react-16');
// Configure Enzyme
Enzyme.configure({ adapter: new Adapter() }); |
441dd784316cf734126b0ca95116070bd6147189 | js/components.js | js/components.js | class SearchBox extends React.Component {
// constructor(){
// super();
// this.state = {
// searched:false;
// };
// }
render() {
return (
<div>
CLICK AND HIT ENTER TO SEARCH
<form className="search-form" onSubmit={this._handleSubmit.bind(this)}>
<input placehol... | Write first component and start first API call | Write first component and start first API call
| JavaScript | mit | scottychou/WikipediaViewer,scottychou/WikipediaViewer | ---
+++
@@ -0,0 +1,53 @@
+class SearchBox extends React.Component {
+ // constructor(){
+ // super();
+ // this.state = {
+ // searched:false;
+ // };
+ // }
+ render() {
+ return (
+ <div>
+ CLICK AND HIT ENTER TO SEARCH
+ <form className="search-form" onSubmit={this._handleSubmit... | |
a1e21bd2df72b0bfd54d2d5ecdab766d6390f785 | packages/core/lib/commands/db/commands/serve.js | packages/core/lib/commands/db/commands/serve.js | const command = {
command: "serve",
description: "Start Truffle's GraphQL UI playground",
builder: {},
help: {
usage: "truffle db serve",
options: []
},
/* This command does starts an express derived server that invokes
* `process.exit()` on SIGINT. As a result there is no need to invoke
* tr... | const command = {
command: "serve",
description: "Start Truffle's GraphQL UI playground",
builder: {},
help: {
usage: "truffle db serve",
options: []
},
/* This command does starts an express derived server that invokes
* `process.exit()` on SIGINT. As a result there is no need to invoke
* tr... | Make the port attribute lowercase | Make the port attribute lowercase
```
// truffle-config.js
{
// ...
db: {
port: 69420
}
}
```
| JavaScript | mit | ConsenSys/truffle | ---
+++
@@ -19,7 +19,7 @@
const { playgroundServer } = require("truffle-db");
const config = Config.detect(argv);
- const port = (config.db && config.db.PORT) || 4444;
+ const port = (config.db && config.db.port) || 4444;
const { url } = await playgroundServer(config).listen({ port });
|
b0ae69002cb6b5e9b3a2e7bee82c5fea1cd6677f | client/index.js | client/index.js | import React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import App from './containers/App'
ReactDOM.render(
<AppContainer>
<App/>
</AppContainer>,
document.getElementById('root')
)
if (module.hot) {
module.hot.accept('./containers/App', () => {
// If ... | import React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import App from './containers/App'
ReactDOM.render(
<AppContainer>
<App/>
</AppContainer>,
document.getElementById('root')
)
if (module.hot) {
module.hot.accept('./containers/App', () => {
// If ... | Add line break at end of file | Add line break at end of file
| JavaScript | mit | shinosakarb/tebukuro-client | |
6cacd255d4c963af7454da36656926f213b676f8 | client/index.js | client/index.js | require('jquery')
require('expose?$!expose?jQuery!jquery')
require("bootstrap-webpack")
require('./less/index.less')
| require('jquery')
require('expose?$!expose?jQuery!jquery')
require("bootstrap-webpack")
require('./less/index.less')
$.get('http://10.90.100.1:8080/signalk/v1/api/vessels/self/navigation/position')
.then(res => $.get(`http://www.tuuleeko.fi:8000/nearest-station?lat=${res.latitude}&lon=${res.longitude}`))
.then(sta... | Add POC for showing the closes weather observation data | Add POC for showing the closes weather observation data | JavaScript | apache-2.0 | chacal/nrf-sensor-receiver,chacal/nrf-sensor-receiver,chacal/nrf-sensor-receiver | ---
+++
@@ -2,3 +2,19 @@
require('expose?$!expose?jQuery!jquery')
require("bootstrap-webpack")
require('./less/index.less')
+
+$.get('http://10.90.100.1:8080/signalk/v1/api/vessels/self/navigation/position')
+ .then(res => $.get(`http://www.tuuleeko.fi:8000/nearest-station?lat=${res.latitude}&lon=${res.longitude}... |
b5e2e552814b00858fce4fa844d326e6b3d81bc0 | src/index.js | src/index.js | import * as path from 'path';
import {fs} from 'node-promise-es6';
import * as fse from 'fs-extra-promise-es6';
export default class {
constructor(basePath) {
this.basePath = path.resolve(basePath);
}
async create() {
await fse.mkdirs(this.basePath);
}
path(...components) {
return path.resolve(... | import * as path from 'path';
import {fs} from 'node-promise-es6';
import * as fse from 'fs-extra-promise-es6';
export default class {
constructor(basePath) {
this.basePath = path.resolve(basePath);
}
async create() {
await fse.mkdirs(this.basePath);
}
path(...components) {
return path.resolve(... | Use Object.entries instead of Object.keys | Use Object.entries instead of Object.keys
| JavaScript | mit | vinsonchuong/directory-helpers | ---
+++
@@ -20,14 +20,13 @@
}
async write(files) {
- for (const file of Object.keys(files)) {
- const filePath = this.path(file);
- const fileContents = files[file];
+ for (const [filePath, fileContents] of Object.entries(files)) {
+ const absoluteFilePath = this.path(filePath);
- ... |
c9e44c6d990f95bb7e92bfa97fc0a74bf636c290 | app/templates/tasks/utils/notify-style-lint.js | app/templates/tasks/utils/notify-style-lint.js | var notify = require("./notify");
module.exports = function notifyStyleLint (stdout) {
var messages = stdout.split("\n");
messages.pop(); // Remove last empty new message.
if(0 < messages.length) {
var message = "{{length}} lint warning(s) found.".replace(/{{length}}/g, messages.length);
notify.showNo... | var notify = require("./notify");
var util = require("util");
module.exports = function notifyStyleLint (stdout) {
var messages = stdout.split("\n");
messages.pop(); // Remove last empty new message.
if(0 < messages.length) {
var message = util.format("%d lint warning(s) found.", messages.length);
n... | Use built-in utils to format the string. | Use built-in utils to format the string.
| JavaScript | mit | rishabhsrao/generator-ironhide-webapp,rishabhsrao/generator-ironhide-webapp,rishabhsrao/generator-ironhide-webapp | ---
+++
@@ -1,4 +1,5 @@
var notify = require("./notify");
+var util = require("util");
module.exports = function notifyStyleLint (stdout) {
var messages = stdout.split("\n");
@@ -6,7 +7,7 @@
messages.pop(); // Remove last empty new message.
if(0 < messages.length) {
- var message = "{{length}} lin... |
b656897309110504fbc52e2c2048ed5dc3d17e23 | js/sinbad-app.js | js/sinbad-app.js | appRun();
function appRun() {
$(document).ready(function() {
console.log("READY");
$(".loading").hide();
$(".complete").show();
//PAGE SWIPES
$(document).on('pageinit', function(event){
$('.pages').on("swipeleft", function () {
var nextpage = $(this).next('div... | appRun();
function appRun() {
$(document).ready(function() {
console.log("READY");
$(".loading").hide();
$(".complete").show();
//PAGE SWIPES
$(document).on('pageinit', function(event){
$('.pages').on("swipeleft", function () {
var nextpage = $(this).next('div... | Add jquery UI drag/drop functionality | Add jquery UI drag/drop functionality
| JavaScript | mit | andkerel/sinbad-and-the-phonegap,andkerel/sinbad-and-the-phonegap | ---
+++
@@ -25,8 +25,59 @@
});
});
+ //DRAG AND DROP
+
+ //initialize dragging
+ $("#watercolor").draggable( {
+ revert: true,
+ cursor: 'move',
+ } );
+ $("#leaves").draggable( {
+ revert: true,
+ cursor: 'move',
+ } );
+ $("#bubbles").draggable( {
+ ... |
0cb6a403de01d6dd60750ac1cc337d1c8f10177b | src/index.js | src/index.js | // @flow
const promiseBindMiddleware = (
{ dispatch } : { dispatch : Function },
) => (next: Function) => (action: Object) => {
if (action && action.promise && typeof action.promise === 'function') {
const { type, metadata, promise, promiseArg } = action
dispatch({
type: `${type}_START`,
metada... | // @flow
const extendBy = (object: Object, { metadata } : { metadata : any }) => {
if (metadata) return { ...object, metadata }
return object
}
const promiseBindMiddleware = (
{ dispatch } : { dispatch : Function },
) => (next: Function) => (action: Object) => {
if (action && action.promise && typeof action.p... | Add meted only if exist | Add meted only if exist
| JavaScript | mit | machnicki/redux-promise-bind | ---
+++
@@ -1,31 +1,35 @@
// @flow
+
+const extendBy = (object: Object, { metadata } : { metadata : any }) => {
+ if (metadata) return { ...object, metadata }
+ return object
+}
+
const promiseBindMiddleware = (
{ dispatch } : { dispatch : Function },
) => (next: Function) => (action: Object) => {
if (acti... |
a549e6988de5071dbbf397c5fd1f894f5ad0a8f7 | assets/js/util/tracking/createDataLayerPush.js | assets/js/util/tracking/createDataLayerPush.js |
/**
* Internal dependencies
*/
import { DATA_LAYER } from './index.private';
/**
* Returns a function which, when invoked will initialize the dataLayer and push data onto it.
*
* @param {Object} target Object to enhance with dataLayer data.
* @return {Function} Function that pushes data onto the dataLayer.
*/
... |
/**
* Internal dependencies
*/
import { DATA_LAYER } from './index.private';
/**
* Returns a function which, when invoked will initialize the dataLayer and push data onto it.
*
* @param {Object} target Object to enhance with dataLayer data.
* @return {Function} Function that pushes data onto the dataLayer.
*/
... | Refactor dataLayerPush to use func.arguments. | Refactor dataLayerPush to use func.arguments.
| JavaScript | apache-2.0 | google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp | ---
+++
@@ -13,11 +13,10 @@
export default function createDataLayerPush( target ) {
/**
* Pushes data onto the data layer.
- *
- * @param {...any} args Arguments to push onto the data layer.
+ * Must use `arguments` internally.
*/
- return function dataLayerPush( ...args ) {
+ return function dataLayerPus... |
f6cb55ec87878fdd2849dc4ba5ea6bd19b6c96c0 | Analyser/src/Models/FnModels.js | Analyser/src/Models/FnModels.js | export default function(state, ctx, model, helpers) {
const ConcretizeIfNative = helpers.ConcretizeIfNative;
//TODO: Test IsNative for apply, bind & call
model.add(Function.prototype.apply, ConcretizeIfNative(Function.prototype.apply));
model.add(Function.prototype.call, ConcretizeIfNative(Function.prototype.call... | export default function(state, ctx, model, helpers) {
const ConcretizeIfNative = helpers.ConcretizeIfNative;
//TODO: Test IsNative for apply, bind & call
model.add(Function.prototype.apply, ConcretizeIfNative(Function.prototype.apply));
model.add(Function.prototype.call, ConcretizeIfNative(Function.prototype.call... | Add a model for Object.assign | Add a model for Object.assign
| JavaScript | mit | ExpoSEJS/ExpoSE,ExpoSEJS/ExpoSE,ExpoSEJS/ExpoSE | ---
+++
@@ -24,6 +24,10 @@
return Object.prototype.keys.apply(this.getConcrete(base), args);
});
+
+ model.add(Object.assign, (base, args) => {
+ return Object.assign.call(base, this.getConcrete(args[0]), this.getConcrete(args[1]));
+ });
model.add(console.log, function(base, args) {
|
001259b0263e6b2534b0efdc9a3b6936965bf9b8 | config/nconf.js | config/nconf.js | var nconf = require('nconf');
nconf
.env()
.file({ file: './gateway.json' });
nconf.defaults({
'RIPPLE_REST_API': 'http://localhost:5990',
'DATABASE_URL': 'postgres://username:password@localhost/ripple_gateway'
});
module.exports = nconf;
| var nconf = require('nconf');
nconf
.env()
.file({ file: './config/config.json' });
nconf.defaults({
'RIPPLE_REST_API': 'http://localhost:5990',
'DATABASE_URL': 'postgres://username:password@localhost/ripple_gateway'
});
module.exports = nconf;
| Move config file from gateway to config/config | [FEATURE] Move config file from gateway to config/config
| JavaScript | isc | whotooktwarden/gatewayd,crazyquark/gatewayd,Parkjeahwan/awegeeks,zealord/gatewayd,Parkjeahwan/awegeeks,xdv/gatewayd,whotooktwarden/gatewayd,crazyquark/gatewayd,zealord/gatewayd,xdv/gatewayd | ---
+++
@@ -2,7 +2,7 @@
nconf
.env()
- .file({ file: './gateway.json' });
+ .file({ file: './config/config.json' });
nconf.defaults({
'RIPPLE_REST_API': 'http://localhost:5990', |
b9ef8725552b57061865e73ca54b901bdf773465 | app/js/app.js | app/js/app.js | //onReady
$(function() {
//temporary testing functionality
$('#refreshBtn').on('click', function() {
updateStreams();
});
});
function updateStreams() {
// Clear out the stale data
$('#mainContainer').html("");
// And fetch the fresh
var streamList = $('#streamList').val().split('\n');
for (var i ... | //onReady
$(function() {
//temporary testing functionality
$('#refreshBtn').on('click', function() {
updateStreams();
});
});
function updateStreams() {
// Clear out the stale data
$('#mainContainer').html("");
// And fetch the fresh
var streamList = $('#streamList').val().split('\n');
for (var i ... | Refactor displayStream. Add background-image and onClick | Refactor displayStream. Add background-image and onClick
| JavaScript | mit | xipxoom/fcc-twitch_status,xipxoom/fcc-twitch_status | ---
+++
@@ -24,18 +24,22 @@
streamObj.preview = data.stream.preview.medium;
streamObj.status = data.stream.channel.status;
streamObj.logo = data.stream.channel.logo;
- streamObj.url = data.stream._links.self;
+ streamObj.url = data.stream.channel.url;
displayStream(streamObj);
});
}
... |
bf80fe88a9966d70d94bd567f60805be396fb375 | examples/app/main.js | examples/app/main.js | /**
* Created by leojin on 3/20/16.
*/
import ReactDom from 'react-dom';
import React from 'react';
import App from './App';
ReactDom.render(<App/>, document.getElementById("examples")); | /**
* Created by leojin on 3/20/16.
*/
import ReactDom from 'react-dom';
import React from 'react';
import App from './app';
ReactDom.render(<App/>, document.getElementById("examples"));
| Fix file name case on example import | Fix file name case on example import
| JavaScript | mit | dougcalobrisi/react-jointjs | ---
+++
@@ -3,6 +3,6 @@
*/
import ReactDom from 'react-dom';
import React from 'react';
-import App from './App';
+import App from './app';
ReactDom.render(<App/>, document.getElementById("examples")); |
00211245eafbd799b7feda2076d6a84a981e41ad | index.js | index.js | 'use strict';
var assign = require('object-assign');
var Filter = require('broccoli-filter');
var Rework = require('rework');
/**
* Initialize `ReworkFilter` with options
*
* @param {Object} inputTree
* @param {Object} opts
* @api public
*/
function ReworkFilter(inputTree, opts) {
if (!(this instanceof Rew... | 'use strict';
var assign = require('object-assign');
var Filter = require('broccoli-filter');
var Rework = require('rework');
/**
* Initialize `ReworkFilter` with options
*
* @param {Object} inputTree
* @param {Object} opts
* @api public
*/
function ReworkFilter(inputTree, opts) {
if (!(this instanceof Rew... | Set rework `source` from `relativePath` | Set rework `source` from `relativePath`
This will enable sourcemaps generated from rework to refer to the source by
its name, versus the generic `source.css`.
| JavaScript | mit | kevva/broccoli-rework | ---
+++
@@ -42,8 +42,10 @@
* @api public
*/
-ReworkFilter.prototype.processString = function (str) {
- var rework = new Rework(str);
+ReworkFilter.prototype.processString = function (str, relativePath) {
+ var rework = new Rework(str, {
+ source: relativePath
+ });
if (this.opts.use) {
... |
828aba16dfb4273329392c369bf637897b80ec87 | index.js | index.js | 'use strict'
var document = require('global/document')
var Loop = require('main-loop')
var virtualDom = require('virtual-dom')
var assert = require('assert')
var partial = require('ap').partial
var Delegator = require('dom-delegator')
// Instantiate a DOM delegator once, since it caches itself
Delegator()
exports.cr... | 'use strict'
var document = require('global/document')
var Loop = require('main-loop')
var virtualDom = require('virtual-dom')
var assert = require('assert')
var partial = require('ap').partial
var Delegator = require('dom-delegator')
// Instantiate a DOM delegator once, since it caches itself
Delegator()
exports.cr... | Set component div to 100% height | Set component div to 100% height
| JavaScript | mit | bendrucker/thermometer | ---
+++
@@ -26,6 +26,7 @@
// Add an element for later use
var div = document.createElement('div')
+ div.style.height = '100%'
document.body.appendChild(div)
// create a raf rendering loop and add the target element to the dom |
db8e102e618ef8b49a4887523da6563146a3ea91 | index.js | index.js | export class DecoratorUtils {
static declarationType = [
"CLASS",
"CLASS_METHOD",
"CLASS_ACCESSOR",
"OBJECT_LITERAL_METHOD",
"OBJECT_LITERAL_ACCESSOR"
].reduce((obj, name) => {
return Object.defineProperty(obj, name, { value: Symbol(name) });
}, {})
static getDeclarationType(args) {
... | export class DecoratorUtils {
static declarationType = [
"CLASS",
"CLASS_METHOD",
"CLASS_ACCESSOR",
"OBJECT_LITERAL_METHOD",
"OBJECT_LITERAL_ACCESSOR"
].reduce((obj, name) => {
return Object.defineProperty(obj, name, { value: Symbol(name) });
}, {})
static getDeclarationType(args) {
... | Throw an error for invalid declaration types | Throw an error for invalid declaration types
| JavaScript | mit | lukehorvat/decorator-utils | ---
+++
@@ -20,6 +20,6 @@
return DecoratorUtils.declarationType[`${isObjectLiteral ? "OBJECT_LITERAL" : "CLASS"}_${isAccessor ? "ACCESSOR" : "METHOD"}`];
}
- return null;
+ throw new Error("Invalid declaration type.");
}
}; |
5c4f313e3aff67e71dca344ef46a7cb25851b525 | jujugui/static/gui/src/app/components/dropdown-menu/test-dropdown-menu.js | jujugui/static/gui/src/app/components/dropdown-menu/test-dropdown-menu.js | /* Copyright (C) 2017 Canonical Ltd. */
'use strict';
const React = require('react');
const DropdownMenu = require('./dropdown-menu');
const Panel = require('../panel/panel');
const jsTestUtils = require('../../utils/component-test-utils');
describe('Dropdown Menu', function() {
function renderComponent(options... | /* Copyright (C) 2017 Canonical Ltd. */
'use strict';
const React = require('react');
const enzyme = require('enzyme');
const DropdownMenu = require('./dropdown-menu');
describe('Dropdown Menu', function() {
const renderComponent = (options = {}) => enzyme.shallow(
<DropdownMenu.WrappedComponent
handle... | Update dropdown menu tests to use enzyme. | Update dropdown menu tests to use enzyme.
| JavaScript | agpl-3.0 | mitechie/juju-gui,mitechie/juju-gui,mitechie/juju-gui,mitechie/juju-gui | ---
+++
@@ -3,36 +3,28 @@
'use strict';
const React = require('react');
+const enzyme = require('enzyme');
const DropdownMenu = require('./dropdown-menu');
-const Panel = require('../panel/panel');
-
-const jsTestUtils = require('../../utils/component-test-utils');
describe('Dropdown Menu', function() {
-... |
02601074d529577222d594a01be4d82fc936622b | lib/client.js | lib/client.js | var needle = require('needle');
function Client(base_url, token) {
this.base_url = base_url
this.token = token || {}
}
Client.prototype.get = function (path, body, callback) {
this.__send('get', path, body, callback);
}
Client.prototype.post = function (path, body, callback) {
this.__send('post', path, body, ... | var needle = require('needle');
function Client(base_url, token) {
this.base_url = base_url
this.token = token || null
}
Client.prototype.get = function (path, body, callback) {
this.__send('get', path, body, callback);
}
Client.prototype.post = function (path, body, callback) {
this.__send('post', path, body... | Use null instead of empty object as {} != false but null == false | Use null instead of empty object as {} != false but null == false
| JavaScript | mit | tresni/node-networkedhelpdesk | ---
+++
@@ -2,7 +2,7 @@
function Client(base_url, token) {
this.base_url = base_url
- this.token = token || {}
+ this.token = token || null
}
Client.prototype.get = function (path, body, callback) { |
afe60f1030ac7cdff1e0acca3229f9b1ba19fc00 | Kinect2Scratch.js | Kinect2Scratch.js | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
// Check for the various File API support.
if (window.... | (function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
// Check for the various File API support.
if (window.... | Put statuses back to correct, adjust unsupported status | Put statuses back to correct, adjust unsupported status
| JavaScript | bsd-3-clause | visor841/SkelScratch,Calvin-CS/SkelScratch | ---
+++
@@ -8,10 +8,9 @@
ext._getStatus = function() {
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
- return {status: 1, msg: 'The File APIs are not fully supported by your browser.'};
- //return {stat... |
c826899a6c86e1ac96505965ca7ae7a8781328d6 | js/TimeFilter.js | js/TimeFilter.js | (function(app){
"use strict"
/**
* Creates a filter to convert a time in milliseconds to
* an hours:minutes:seconds format.
*
* e.g.
* {{60000 | millisecondsToTime}} // 01:00
* {{3600000 | millisecondsToTime}} // 01:00:00
*/
app.filter("millisecondsToTime", MillisecondsToTime);
function... | (function(app){
"use strict"
/**
* Creates a filter to convert a time in milliseconds to
* an hours:minutes:seconds format.
*
* e.g.
* {{60000 | millisecondsToTime}} // 01:00
* {{3600000 | millisecondsToTime}} // 01:00:00
*/
app.filter("millisecondsToTime", MillisecondsToTime);
function... | Add security on time filter to be sure this is an integer and not a float | Add security on time filter to be sure this is an integer and not a float
| JavaScript | agpl-3.0 | veo-labs/openveo-player,veo-labs/openveo-player,veo-labs/openveo-player | ---
+++
@@ -17,6 +17,8 @@
if(time < 0 || isNaN(time))
return "";
+ time = parseInt(time);
+
var seconds = parseInt((time / 1000) % 60);
var minutes = parseInt((time / (60000)) % 60);
var hours = parseInt((time / (3600000)) % 24); |
4df51733774fdbde4e23020127a3084f403d1179 | src/assets/drizzle/scripts/navigation/mobileNav.js | src/assets/drizzle/scripts/navigation/mobileNav.js | /* global document window */
import { focusFirstEl } from '../../../../../packages/spark-core/utilities/elementState';
const hideMobileNav = (nav) => {
document.body.classList.remove('sprk-u-OverflowHidden');
nav.classList.remove('is-active');
};
const focusTrap = (nav, mainNav) => {
if (nav.classList.contains(... | /* global document window */
import { focusFirstEl } from '../../../../../packages/spark-core/utilities/elementState';
const hideMobileNav = (nav) => {
document.body.classList.remove('sprk-u-OverflowHidden');
nav.classList.remove('is-active');
};
const focusTrap = (nav, mainNav) => {
if (nav.classList.contains(... | Add check for if mobilenav exists | Add check for if mobilenav exists
| JavaScript | mit | sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system | ---
+++
@@ -14,6 +14,7 @@
const bindUIEvents = () => {
const nav = document.querySelector('.drizzle-o-Layout__nav');
+ if (nav === null) return;
const mainNav = nav.querySelector('.drizzle-c-Navigation__main');
const mainLayout = document.querySelector('.drizzle-o-Layout__main');
|
696343cd90c8aa3b21a289b363441e005a7413da | system.config.js | system.config.js | 'use strict';
const externalDeps = [
'@angular/*',
'angular',
'angular-mocks',
'rxjs/*',
'lodash',
'moment',
'moment-timezone',
];
const map = {
'@angular': 'node_modules/@angular',
'angular': 'node_modules/angular/angular',
'angular-mocks': 'node_modules/angular-mocks/angular-mocks',
'rxjs': 'node_modules... | 'use strict';
const externalDeps = [
'@angular/*',
'angular',
'angular-mocks',
'rxjs/*',
'lodash',
'moment',
'moment-timezone',
];
const map = {
'@angular': 'node_modules/@angular',
'angular': 'node_modules/angular/angular',
'angular-mocks': 'node_modules/angular-mocks/angular-mocks',
'rxjs': 'node_modules... | Use reduce to avoid mutating the object unneededly. | Use reduce to avoid mutating the object unneededly.
| JavaScript | mit | RenovoSolutions/TypeScript-Angular-Utilities,SamGraber/TypeScript-Angular-Utilities,SamGraber/TypeScript-Angular-Utilities,RenovoSolutions/TypeScript-Angular-Utilities | ---
+++
@@ -19,12 +19,12 @@
'node-uuid': 'node_modules/node-uuid/uuid',
'moment': 'node_modules/moment/moment',
'moment-timezone': 'node_modules/moment-timezone/builds/moment-timezone-with-data.min',
-}
+};
-let meta = {};
-externalDeps.forEach(dep => {
- meta[dep] = { build: false };
-});
+const meta = exter... |
39bb5e7acfde32763f1f8c228f0335db84f9cae7 | karma.conf.js | karma.conf.js | // Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['mocha', 'chai'],... | // Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['mocha', 'chai'],... | Change reporter style in Karma. | Change reporter style in Karma.
| JavaScript | mit | seriema/angular-apimock,MartinSandstrom/angular-apimock,seriema/angular-apimock,MartinSandstrom/angular-apimock | ---
+++
@@ -9,7 +9,10 @@
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['mocha', 'chai'],
- // list of files / patterns to load in the browser
+ // reporter style
+ reporters: [ 'dots' ],
+
+ // list of files / patterns to load in the browser
files: [
'app/bower_compo... |
afdf07a331ed5f7dad218f9f23e7466ffcf75597 | scripts/components/Header.js | scripts/components/Header.js | import React from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
import IconMenu from 'material-ui/IconMenu';
import MenuItem from 'material-ui/MenuItem';
import MoreVertIcon from 'material-ui/svg-ico... | import React from 'react';
import { Link } from 'react-router';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
import IconMenu from 'material-ui/IconMenu';
import MenuItem from 'material-ui/MenuItem';
import... | Add my account to header | Add my account to header
| JavaScript | mit | ahoarfrost/metaseek,ahoarfrost/metaseek,ahoarfrost/metaseek | ---
+++
@@ -1,4 +1,7 @@
import React from 'react';
+
+import { Link } from 'react-router';
+
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
@@ -30,8 +33,9 @@
targetOrigin={{horizontal: 'righ... |
0c59eb01b242e7591bc1a9218f1eb330ec9ec9f4 | app/components/organization-profile.js | app/components/organization-profile.js | import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['organization-profile'],
credentials: Ember.inject.service(),
organizationMembers: Ember.computed.mapBy('organization.organizationMemberships', 'organization'),
didReceiveAttrs() {
this._super(...arguments);
this.get('cr... | import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['organization-profile'],
credentials: Ember.inject.service(),
organizationMembers: Ember.computed.mapBy('organization.organizationMemberships', 'member'),
didReceiveAttrs() {
this._super(...arguments);
this.get('credenti... | Fix organization profile by changing computed property | Fix organization profile by changing computed property
| JavaScript | mit | jderr-mx/code-corps-ember,code-corps/code-corps-ember,jderr-mx/code-corps-ember,code-corps/code-corps-ember | ---
+++
@@ -5,11 +5,10 @@
credentials: Ember.inject.service(),
- organizationMembers: Ember.computed.mapBy('organization.organizationMemberships', 'organization'),
+ organizationMembers: Ember.computed.mapBy('organization.organizationMemberships', 'member'),
didReceiveAttrs() {
this._super(...argum... |
b557cbb6c8e98fc5ed0183a8c902561389e4e013 | EduChainApp/js/common/GlobalStyles.js | EduChainApp/js/common/GlobalStyles.js | /**
*
* @flow
*/
'use strict';
import {StyleSheet} from 'react-native';
const GlobalStyles = {
contentWrapper: {
paddingLeft: 5,
paddingRight: 5,
},
sectionHeader: {
fontSize: 20,
marginTop: 10,
},
thumbnail: {
height: 45,
width: 45,
... | /**
*
* @flow
*/
'use strict';
import {StyleSheet} from 'react-native';
const GlobalStyles = {
contentWrapper: {
paddingLeft: 5,
paddingRight: 5,
},
sectionHeader: {
fontSize: 20,
marginTop: 10,
},
thumbnail: {
height: 45,
width: 45,
bord... | Add backBtn styling, fix indentation | Add backBtn styling, fix indentation
| JavaScript | mit | bkrem/educhain,bkrem/educhain,bkrem/educhain,bkrem/educhain | ---
+++
@@ -7,33 +7,38 @@
import {StyleSheet} from 'react-native';
- const GlobalStyles = {
- contentWrapper: {
- paddingLeft: 5,
- paddingRight: 5,
- },
- sectionHeader: {
- fontSize: 20,
- marginTop: 10,
- },
- thumbnail: {
- height: 45,
- wid... |
a81e5611622ac50a1c82a26df88e63c87d888e88 | lib/converter.js | lib/converter.js | const puppeteer = require("puppeteer")
const defaults = require("../configurations/defaults")
const puppeteerArgs = [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-gpu"
]
const allowedOptions = [
"scale",
"printBackground",
"margin"
]
const formatOptions = options => allowedOptions.reduce((filte... | const puppeteer = require("puppeteer")
const defaults = require("../configurations/defaults")
const puppeteerArgs = [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-gpu"
]
const allowedOptions = [
"scale",
"displayHeaderFooter",
"printBackground",
"format",
"landscape",
"pageRanges",
"wid... | Allow almost all puppeteer pdf configurations | Allow almost all puppeteer pdf configurations
| JavaScript | mit | tecnospeed/pastor | ---
+++
@@ -7,9 +7,16 @@
"--disable-gpu"
]
+
const allowedOptions = [
"scale",
+ "displayHeaderFooter",
"printBackground",
+ "format",
+ "landscape",
+ "pageRanges",
+ "width",
+ "height",
"margin"
]
|
447902934914f8a803a705044252eb71beb7cc62 | lib/logger.js | lib/logger.js | 'use strict';
const Winston = require('winston');
function Logger(level) {
const logLevel = level.toLowerCase() || 'info';
const logger = new Winston.Logger({
level: logLevel,
transports: [
new Winston.transports.Console({
colorize: false,
timestamp: true,
json: true,
... | 'use strict';
const Winston = require('winston');
function Logger(level) {
const logLevel = (level || 'info').toLowerCase();
const logger = new Winston.Logger({
level: logLevel,
transports: [
new Winston.transports.Console({
colorize: false,
timestamp: true,
json: true,
... | Handle null and undefined log levels properly | Handle null and undefined log levels properly
| JavaScript | mit | rapid7/acs,rapid7/acs,rapid7/acs | ---
+++
@@ -3,7 +3,7 @@
const Winston = require('winston');
function Logger(level) {
- const logLevel = level.toLowerCase() || 'info';
+ const logLevel = (level || 'info').toLowerCase();
const logger = new Winston.Logger({
level: logLevel, |
5b3686c9a28feaeda7e51526f8cdc9e27793b95c | bin/config.js | bin/config.js | 'use strict'
var fs = require('fs')
var path = require('path')
var existFile = require('exists-file')
var minimistPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_modules', 'minimist')
var minimist = require(minimistPath)
var trimNewlinesPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_... | 'use strict'
var fs = require('fs')
var path = require('path')
var existFile = require('exists-file')
var minimistPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_modules', 'minimist')
var minimist = require(minimistPath)
var trimNewlinesPath = path.join(__dirname, '..', 'node_modules', 'meow', 'node_... | Load file if params are not present | Load file if params are not present
| JavaScript | mit | Kikobeats/farm-cli,Kikobeats/worker-farm-cli | ---
+++
@@ -14,9 +14,9 @@
function readConfig (filepath) {
var yargs = process.argv.slice(2)
- if (yargs.length === 0) return yargs
+ if (yargs.length > 1) return yargs
- var filepath = path.resolve(yargs[yargs.length - 1], FILENAME)
+ var filepath = path.resolve(yargs[0], FILENAME)
if (!existFile(file... |
b183de1dbadae83d82c6573ba61dc7b5fa386856 | app/containers/gif/sagas.js | app/containers/gif/sagas.js | import { remote } from 'electron';
import { call, select, put, takeLatest } from 'redux-saga/effects';
import GIF from './constants';
import { result, error, clear } from './actions';
import request from '../../utils/request';
export function* requestGif(action) {
const requestURL = `http://api.giphy.com/v1/gifs/ran... | import { remote } from 'electron';
import { call, select, put, takeLatest } from 'redux-saga/effects';
import GIF from './constants';
import { result, error, clear } from './actions';
import request from '../../utils/request';
export function* requestGif(action) {
// If there is no query given, grab the latest one f... | Fix down button to dp the same tag search | Fix down button to dp the same tag search
| JavaScript | mit | astrogif/astrogif,astrogif/astrogif | ---
+++
@@ -5,7 +5,12 @@
import request from '../../utils/request';
export function* requestGif(action) {
- const requestURL = `http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=${action.payload}`;
+ // If there is no query given, grab the latest one from state
+ const tag = action.payload
+ ? a... |
7f5f5482fc30ab8f6fd1470f15569023f95d4920 | app/src/containers/ContactUs.js | app/src/containers/ContactUs.js | import { connect } from 'react-redux';
import ContactUs from '../components/ContactUs';
import { submitForm } from '../actions/contact';
const mapStateToProps = (state) => ({
contactStatus: state.contactStatus,
defaultUserName: state.user.loggedUser && state.user.loggedUser.displayName,
defaultUserEmail: state.u... | import { connect } from 'react-redux';
import ContactUs from '../components/ContactUs';
import { submitForm } from '../actions/contact';
const mapStateToProps = (state) => ({
contactStatus: state.contactStatus,
defaultUserName: state.user.loggedUser ? state.user.loggedUser.displayName : '',
defaultUserEmail: sta... | Fix issue when logging out on contact page | Fix issue when logging out on contact page
| JavaScript | mit | Vizzuality/GlobalFishingWatch,Vizzuality/GlobalFishingWatch,Vizzuality/GlobalFishingWatch | ---
+++
@@ -4,8 +4,8 @@
const mapStateToProps = (state) => ({
contactStatus: state.contactStatus,
- defaultUserName: state.user.loggedUser && state.user.loggedUser.displayName,
- defaultUserEmail: state.user.loggedUser && state.user.loggedUser.email
+ defaultUserName: state.user.loggedUser ? state.user.logge... |
88d7a14c2640c8ee7eddd6044fe84970a0f724c8 | Resources/public/scripts/globals.js | Resources/public/scripts/globals.js | var AJAX_LOADER = '<span class="ajax_loader"></span>';
$(document).bind('ajaxComplete', function () {
$('.ajax_loader').remove();
});
| var AJAX_LOADER = '<span class="ajax_loader"></span>';
$(document).bind('ajaxComplete', function () {
$('.ajax_loader').remove();
$('form').removeData('submitted');
});
| Mark forms as not submitted after AJAX complete. | Mark forms as not submitted after AJAX complete.
| JavaScript | mit | DarvinStudio/DarvinAdminBundle,DarvinStudio/DarvinAdminBundle,DarvinStudio/DarvinAdminBundle | ---
+++
@@ -2,4 +2,6 @@
$(document).bind('ajaxComplete', function () {
$('.ajax_loader').remove();
+
+ $('form').removeData('submitted');
}); |
6c355830dcf91e90e3fce6f2ff9d59654716c8b7 | bin/source.js | bin/source.js | var fs = require('fs'),
path = require('path'),
util = require('../lib/util');
var Source = util.inherit(Object, {
_initialize: function (root) {
this._root = root;
},
travel: function (callback, pathname) {
pathname = pathname || '';
var root = this._root,
node = path.join(root, pathname),
... | var fs = require('fs'),
path = require('path'),
util = require('../lib/util');
var Source = util.inherit(Object, {
_initialize: function (root) {
this._root = root;
},
travel: function (callback, pathname) {
pathname = pathname || '';
var root = this._root,
node = path.join(root, pathname),
... | Fix read hidden directory error. | Fix read hidden directory error.
| JavaScript | mit | nqdeng/ucc | ---
+++
@@ -17,7 +17,7 @@
if (stats.isFile()) {
callback(pathname, fs.readFileSync(node));
- } else if (stats.isDirectory()) {
+ } else if (stats.isDirectory() && pathname.charAt(0) != '.'){
fs.readdirSync(node).forEach(function (filename) {
self.travel(callback, path.join(pathname, filename... |
147b15ee4b14c2a69fb12b17d7742f0760eb63f1 | server/routes/session.js | server/routes/session.js | var router = require('express').Router();
var jwt = require('jsonwebtoken');
var jwtSecret = require('../config/jwt_secret');
var User = require('../models/user');
router.post('/', function(req, res) {
User.findOne({ username: req.body.user.username }).then(function(user) {
if (user) {
user.authenticate(re... | var router = require('express').Router();
var jwt = require('jsonwebtoken');
var jwtSecret = require('../config/jwt_secret');
var User = require('../models/user');
router.post('/', function(req, res) {
User.findOne({ username: req.body.user.username }).then(function(user) {
if (user) {
user.authenticate(re... | Use expiresIn instead of expiresInMinutes. | Use expiresIn instead of expiresInMinutes.
expiresInMinutes and expiresInSeconds is deprecated. | JavaScript | mit | unixmonkey/caedence.net-2015,unixmonkey/caedence.net-2015 | ---
+++
@@ -7,7 +7,7 @@
User.findOne({ username: req.body.user.username }).then(function(user) {
if (user) {
user.authenticate(req.body.user.password, function(isMatch) {
- var token = jwt.sign(user._id, jwtSecret, { expiresInMinutes: 60*24 });
+ var token = jwt.sign(user._id, jwtSecret, ... |
386bd63f8d21fde74018815d410179758f5241cf | server/store/requests.js | server/store/requests.js | const redis = require('./redis');
const config = require('./config');
const getRequest = async (requestId) => {
// Set TTL for request
redis.expire(`requests:${requestId}`, config('requests_ttl'));
return await redis.hgetallAsync(`requests:${requestId}`);
};
const createRequest = async (requestDetails) => {
/... | const redis = require('./redis');
const config = require('../config/index.js');
const getRequest = async (requestId) => {
// Set TTL for request
redis.expire(`requests:${requestId}`, config('requests_ttl'));
return await redis.hgetallAsync(`requests:${requestId}`);
};
const createRequest = async (requestDetails... | Fix dependency inclusion for require statement | Fix dependency inclusion for require statement
| JavaScript | mit | DAVFoundation/missioncontrol,DAVFoundation/missioncontrol,DAVFoundation/missioncontrol | ---
+++
@@ -1,5 +1,5 @@
const redis = require('./redis');
-const config = require('./config');
+const config = require('../config/index.js');
const getRequest = async (requestId) => {
// Set TTL for request |
0ab40cc1769b66a7e72891a79a204b8c0455933f | lib/loadLists.js | lib/loadLists.js | var fs = require("fs");
var path = require("path");
var _ = require("lodash");
var animals;
var adjectives;
module.exports = function () {
if (animals && adjectives) {
return { animals : animals, adjectives : adjectives };
}
adjectives = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "lists", "adjec... | var fs = require("fs");
var path = require("path");
var _ = require("lodash");
var animals;
var adjectives;
module.exports = function () {
if (animals && adjectives) {
return { animals : animals, adjectives : adjectives };
}
adjectives = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "lists", "adjec... | Fix adjective and number count to match the updated lists. | Fix adjective and number count to match the updated lists.
| JavaScript | mit | a-type/adjective-adjective-animal,a-type/adjective-adjective-animal,gswalden/adjective-adjective-animal | ---
+++
@@ -17,7 +17,7 @@
_.each(animals, function (word, idx) { animals[idx] = word.toLowerCase(); });
return { adjectives : adjectives, animals : animals };
-};
+};NUM_
-module.exports.NUM_ADJECTIVES = 8981;
-module.exports.NUM_ANIMALS = 590;
+module.exports.NUM_ADJECTIVES = 1500;
+module.exports.NUM_ANIMAL... |
3d48ad17557a322f23ac9e1d8a1587507f351bea | app/templates/karma.conf.js | app/templates/karma.conf.js | 'use strict';
module.exports = function (config) {
config.set({
autowatch: false,
basePath: __dirname,
browsers: ['PhantomJS'],
files: [
'app/assets/bower_components/jquery/dist/jquery.js',
'app/assets/bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'spec/javascripts/helpers... | 'use strict';
module.exports = function (config) {
config.set({
autowatch: false,
basePath: __dirname,
browsers: ['PhantomJS'],
files: [
'app/assets/bower_components/jquery/dist/jquery.js',
'app/assets/bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'spec/javascripts/helpers... | Comment out fixtures until needed | Comment out fixtures until needed
| JavaScript | mit | jbnicolai/generator-gulp-rk,jbnicolai/generator-gulp-rk,jbnicolai/generator-gulp-rk | ---
+++
@@ -10,7 +10,7 @@
'app/assets/bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'spec/javascripts/helpers/*Helper.js',
'spec/javascripts/**/*Spec.js',
- {pattern: 'spec/javascripts/fixtures/**/*.html', included: false}
+ // {pattern: 'spec/javascripts/fixtures/**/*.html', ... |
4ca82da87e04c8b0b2d9a73ae67c7af99e7888da | src/store.js | src/store.js | import { createStore } from 'redux';
import reducer from 'reducers';
import initialState from 'initialState';
const store = createStore(reducer, initialState,
window.devToolsExtension ? window.devToolsExtension() : undefined
);
export default store;
| import { createStore } from 'redux';
import reducer from 'reducers';
import initialState from 'initialState';
const devToolExtension = (() => {
if ('production' !== process.env.NODE_ENV) {
return window.devToolsExtension ? window.devToolsExtension() : undefined;
} else {
return undefined;
}
})();
expor... | Remove Redux devtools from production build | Remove Redux devtools from production build
| JavaScript | mit | vincentriemer/io-808,vincentriemer/io-808,vincentriemer/io-808 | ---
+++
@@ -3,8 +3,12 @@
import reducer from 'reducers';
import initialState from 'initialState';
-const store = createStore(reducer, initialState,
- window.devToolsExtension ? window.devToolsExtension() : undefined
-);
+const devToolExtension = (() => {
+ if ('production' !== process.env.NODE_ENV) {
+ retur... |
a172dc9a3ee1343933140b97f8a2bca48c43cff6 | js.js | js.js | var through = require('through')
, falafel = require('falafel')
, unparse = require('escodegen').generate
, util = require('util')
, minimist = require('minimist')
var argv = minimist(process.argv.slice(2))
var defaultLang = argv['jedify-lang'] || process.env['JEDIFY_LANG'] || 'en'
var re = /\.js$/
module.e... | var through = require('through')
, falafel = require('falafel')
, unparse = require('escodegen').generate
, util = require('util')
, minimist = require('minimist')
var defaultLang = process.env['JEDIFY_LANG'] || 'en'
var re = /\.js$/
module.exports = function (file, options) {
if (!re.test(file)) return th... | Remove `--jedify-lang` command line option | Remove `--jedify-lang` command line option
| JavaScript | mit | tellnes/jedify | ---
+++
@@ -4,16 +4,14 @@
, util = require('util')
, minimist = require('minimist')
-var argv = minimist(process.argv.slice(2))
-
-var defaultLang = argv['jedify-lang'] || process.env['JEDIFY_LANG'] || 'en'
+var defaultLang = process.env['JEDIFY_LANG'] || 'en'
var re = /\.js$/
module.exports = function ... |
25e44bb5e37df64916cd4d249bbf7d10115e2d49 | src/utils.js | src/utils.js | export function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response.json();
}
throw new Error(response.statusText);
}
export function getShortDate(dateString) {
const d = new Date(dateString);
return `${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear() % 100}`;... | import moment from 'moment';
export function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response.json();
}
throw new Error(response.statusText);
}
export function getShortDate(dateString) {
return moment(dateString).format('MM/DD/YY');
}
| Fix getShortDate to return leading zeros | Fix getShortDate to return leading zeros
| JavaScript | mit | ZachGawlik/print-to-resist,ZachGawlik/print-to-resist | ---
+++
@@ -1,3 +1,5 @@
+import moment from 'moment';
+
export function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response.json();
@@ -6,6 +8,5 @@
}
export function getShortDate(dateString) {
- const d = new Date(dateString);
- return `${d.getMonth() + 1}/${d... |
a8e690949e1ae14faa228a9df9f5dce32183d6fa | lib/apis/fetch.js | lib/apis/fetch.js | import { defaults } from 'lodash';
import request from 'request';
import config from '../../config';
export default (url, options = {}) => {
return new Promise((resolve, reject) => {
const opts = defaults(options, {
method: 'GET',
timeout: config.REQUEST_TIMEOUT_MS,
});
request(url, opts, (e... | import { get, defaults, compact } from 'lodash';
import request from 'request';
import config from '../../config';
export default (url, options = {}) => {
return new Promise((resolve, reject) => {
const opts = defaults(options, {
method: 'GET',
timeout: config.REQUEST_TIMEOUT_MS,
});
request... | Improve error handling by returning the `statusCode` and including the failed URL in the rejected Error | Improve error handling by returning the `statusCode` and including the failed URL in the rejected Error
| JavaScript | mit | artsy/metaphysics,broskoski/metaphysics,mzikherman/metaphysics-1,1aurabrown/metaphysics,artsy/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1,craigspaeth/metaphysics,craigspaeth/metaphysics,artsy/metaphysics,mzikherman/metaphysics-1 | ---
+++
@@ -1,4 +1,4 @@
-import { defaults } from 'lodash';
+import { get, defaults, compact } from 'lodash';
import request from 'request';
import config from '../../config';
@@ -11,7 +11,15 @@
request(url, opts, (err, response) => {
if (!!err || response.statusCode !== 200) {
- return rejec... |
8a09e658300e825bbbcbb8ab42999bf3d9ce8958 | extensions/roc-plugin-dredd/src/dredd/index.js | extensions/roc-plugin-dredd/src/dredd/index.js | import UpstreamDredd from 'dredd';
import Reporter from './reporter';
export default class Dredd extends UpstreamDredd {
constructor(config, logger) {
super(config);
this.canceled = false;
this.reporter = new Reporter(this.configuration.emitter, this.stats, logger,
config.opt... | import UpstreamDredd from 'dredd';
import Reporter from './reporter';
export default class Dredd extends UpstreamDredd {
constructor(config, logger) {
super(config);
this.canceled = false;
this.reporter = new Reporter(this.configuration.emitter, this.stats, logger,
config.opt... | Exit with status 0 when not running in watch mode | Exit with status 0 when not running in watch mode
| JavaScript | mit | voldern/roc-plugin-dredd | ---
+++
@@ -28,7 +28,7 @@
}
if (!watch) {
- process.exit(1);
+ process.exit(0);
}
});
} |
1f1f94c22e0e1d6132dfb813e467c8f642df56db | src/screens/rename/views/configure/containers/files/actions.js | src/screens/rename/views/configure/containers/files/actions.js | export function load(files) {
return {
type: 'FILES_DATA_LOAD',
payload: files.map(file => {
return {
id: file.Id,
newName: file.NewName,
originalName: file.OriginalName,
size: file.Size,
type: file.Type,
isSelected: file.Filtered,
};
}),
};
}
export function sort(type, direction,... | export function load(files) {
return {
type: 'FILES_DATA_LOAD',
payload: files.map(file => {
return {
id: file.Id,
newName: file.NewName,
originalName: file.OriginalName,
size: file.Size,
type: file.Type,
isSelected: file.Selected,
};
}),
};
}
export function sort(type, direction,... | Update Filtered to Selected object key | Update Filtered to Selected object key
| JavaScript | mit | radencode/reflow-client,radencode/reflow-client,radencode/reflow,radencode/reflow | ---
+++
@@ -8,7 +8,7 @@
originalName: file.OriginalName,
size: file.Size,
type: file.Type,
- isSelected: file.Filtered,
+ isSelected: file.Selected,
};
}),
}; |
fbc505bfc58d825d5440a260293ea3dcae04d56d | addon/services/google-charts.js | addon/services/google-charts.js | import RSVP from 'rsvp';
import Service from '@ember/service';
export default Service.extend({
language: 'en',
init() {
this._super(...arguments);
this.googlePackages = this.googlePackages || ['corechart', 'bar', 'line', 'scatter'];
this.defaultOptions = this.defaultOptions || {
animation: {
... | import RSVP from 'rsvp';
import Service from '@ember/service';
export default Service.extend({
language: 'en',
init() {
this._super(...arguments);
this.googlePackages = this.googlePackages || ['corechart', 'bar', 'line', 'scatter'];
this.defaultOptions = this.defaultOptions || {
animation: {
... | Fix google visualization undefined error | Fix google visualization undefined error
similar to https://github.com/sir-dunxalot/ember-google-charts/pull/56 (with failing tests), see also the comment in https://github.com/sir-dunxalot/ember-google-charts/issues/57 | JavaScript | mit | sir-dunxalot/ember-google-charts,sir-dunxalot/ember-google-charts | ---
+++
@@ -17,12 +17,10 @@
},
loadPackages() {
- const { google: { charts } } = window;
+ const { google: { charts, visualization } } = window;
return new RSVP.Promise((resolve, reject) => {
- const packagesAreLoaded = charts.loader;
-
- if (packagesAreLoaded) {
+ if (visualizatio... |
d267a3b7deb8d478ee2e17a64921b44cf3f29b17 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat... | Remove unused foundation JS components. | Remove unused foundation JS components.
| JavaScript | agpl-3.0 | teikei/teikei,sjockers/teikei,sjockers/teikei,sjockers/teikei,teikei/teikei,teikei/teikei | ---
+++
@@ -20,21 +20,8 @@
//
// TODO: Remove foundation dependencies with upcoming redesign:
//
-//= require foundation/modernizr.foundation
-//= require foundation/jquery.placeholder
//= require foundation/jquery.foundation.alerts
-//= require foundation/jquery.foundation.accordion
-//= require foundation/jquer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.