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 |
|---|---|---|---|---|---|---|---|---|---|---|
f65f19bf7d737cffdbe629247ac4913357c9d1ec | test/feature/Classes/NameBinding.js | test/feature/Classes/NameBinding.js | class ElementHolder {
element;
getElement() { return this.element; }
makeFilterCapturedThis() {
var capturedThis = this;
return function (x) {
return x == capturedThis.element;
}
}
makeFilterLostThis() {
return function (x) { return x == this.element; }
}
makeFilterHidden(element... | class ElementHolder {
element;
getElement() { return this.element; }
makeFilterCapturedThis() {
var capturedThis = this;
return function (x) {
return x == capturedThis.element;
}
}
makeFilterLostThis() {
return function () { return this; }
}
makeFilterHidden(element) {
return... | Fix invalid test and disable it due to V8 bug | Fix invalid test and disable it due to V8 bug
| JavaScript | apache-2.0 | ide/traceur,ide/traceur,ide/traceur | ---
+++
@@ -11,7 +11,7 @@
}
makeFilterLostThis() {
- return function (x) { return x == this.element; }
+ return function () { return this; }
}
makeFilterHidden(element) {
@@ -26,7 +26,9 @@
obj.element = 40;
assertEquals(40, obj.getElement());
assertTrue(obj.makeFilterCapturedThis()(40));
-ass... |
5b3a341d2d53223775d7e09ab11819a5d433290f | packages/internal-test-helpers/lib/ember-dev/run-loop.js | packages/internal-test-helpers/lib/ember-dev/run-loop.js | import { cancelTimers, end, getCurrentRunLoop, hasScheduledTimers } from '@ember/runloop';
function RunLoopAssertion(env) {
this.env = env;
}
RunLoopAssertion.prototype = {
reset: function() {},
inject: function() {},
assert: function() {
let { assert } = QUnit.config.current;
if (getCurrentRunLoop()... | import { cancelTimers, end, getCurrentRunLoop, hasScheduledTimers } from '@ember/runloop';
export default class RunLoopAssertion {
constructor(env) {
this.env = env;
}
reset() {}
inject() {}
assert() {
let { assert } = QUnit.config.current;
if (getCurrentRunLoop()) {
assert.ok(false, 'S... | Convert `RunLoopAssert` to ES6 class | internal-test-helpers: Convert `RunLoopAssert` to ES6 class
| JavaScript | mit | kellyselden/ember.js,GavinJoyce/ember.js,mfeckie/ember.js,emberjs/ember.js,kellyselden/ember.js,Turbo87/ember.js,sandstrom/ember.js,stefanpenner/ember.js,bekzod/ember.js,kellyselden/ember.js,tildeio/ember.js,qaiken/ember.js,mixonic/ember.js,stefanpenner/ember.js,fpauser/ember.js,elwayman02/ember.js,fpauser/ember.js,giv... | ---
+++
@@ -1,13 +1,15 @@
import { cancelTimers, end, getCurrentRunLoop, hasScheduledTimers } from '@ember/runloop';
-function RunLoopAssertion(env) {
- this.env = env;
-}
+export default class RunLoopAssertion {
+ constructor(env) {
+ this.env = env;
+ }
-RunLoopAssertion.prototype = {
- reset: function(... |
22d6877b66c928bda0e53fbe4c43a3bdf50f01d2 | data/file.js | data/file.js | // TODO docs, see data/breakpoint.js
define(function(require, exports, module) {
var Data = require("./data");
function File(options) {
this.data = options || {};
if (!this.data.items)
this.data.items = [];
if (!this.data.status)
this.data.status = "pend... | // TODO docs, see data/breakpoint.js
define(function(require, exports, module) {
var Data = require("./data");
function File(options) {
this.data = options || {};
if (!this.data.items)
this.data.items = [];
if (!this.data.status)
this.data.status = "pend... | Create Tests Dynamically When Needed | Create Tests Dynamically When Needed
| JavaScript | mit | c9/c9.ide.test | ---
+++
@@ -28,9 +28,9 @@
return this.data.label == file.label;
};
- File.prototype.addTest = function(def) {
+ File.prototype.addTest = function(def, parent) {
var test = Data.fromJSON([def])[0];
- this.data.items.push(test);
+ (parent || this).data.items.push(test);
... |
6e3621cb2032e7bf9e6a5ad977efecd70798f8b7 | test/util.test.js | test/util.test.js | /* global describe, it, beforeEach */
import React from 'react'
import { expect } from 'chai'
import { sizeClassNames } from '../src/js/util'
describe('Util', () => {
describe('sizeClassNames', () => {
it('should return one classname given props', () => {
const props = { xs: 12 }
const actual = size... | /* global describe, it, beforeEach */
import React from 'react'
import { expect } from 'chai'
import { sizeClassNames } from '../src/js/util'
describe('Util', () => {
describe('sizeClassNames', () => {
describe('using props', () => {
it('should return one classname given props', () => {
const prop... | Add sizeClassNames Given Props & Offset Tests | Add sizeClassNames Given Props & Offset Tests
| JavaScript | mit | frig-js/frigging-bootstrap,frig-js/frigging-bootstrap | ---
+++
@@ -6,33 +6,58 @@
describe('Util', () => {
describe('sizeClassNames', () => {
- it('should return one classname given props', () => {
- const props = { xs: 12 }
- const actual = sizeClassNames(props)
- expect(actual).to.equal('col-xs-12')
+ describe('using props', () => {
+ it(... |
31ee8ce20659751cb45fc1fc7c78167ce9171e1a | client/views/home/activities/trend/trend.js | client/views/home/activities/trend/trend.js | Template.homeResidentActivityLevelTrend.rendered = function () {
// Get reference to template instance
var instance = this;
instance.autorun(function () {
// Get reference to Route
var router = Router.current();
// Get current Home ID
var homeId = router.params.homeId;
// Get data for trend... | Template.homeResidentActivityLevelTrend.rendered = function () {
// Get reference to template instance
var instance = this;
instance.autorun(function () {
// Get reference to Route
var router = Router.current();
// Get current Home ID
var homeId = router.params.homeId;
// Get data for trend... | Use object attributes; adjust appearance | Use object attributes; adjust appearance
| JavaScript | agpl-3.0 | GeriLife/wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing | ---
+++
@@ -16,15 +16,16 @@
MG.data_graphic({
title: "Count of residents per activity level for each of last seven days",
description: "Daily count of residents with inactive, semi-active, and active status.",
- data: [data[0], data[1], data[2]],
- x_axis: false,
+ ... |
2d105c1489e2648a4a5036bce8a4d0059da3eb82 | resources/public/js/rx.ontrail.pager.js | resources/public/js/rx.ontrail.pager.js | (function(){
// todo: remove depsu to elementBottomIsAlmostVisible
var nextPage = function(elem) {
var e = ($.isFunction(elem)) ? elem() : elem
return Rx.Observable.interval(200).where(function() { return elementBottomIsAlmostVisible(e, 100) })
}
var pager = function(ajaxSearch, page, next) {
retur... | (function(){
var timer = Rx.Observable.interval(100).publish()
timer.connect()
// todo: remove depsu to elementBottomIsAlmostVisible
var nextPage = function(elem) {
var e = ($.isFunction(elem)) ? elem() : elem
return timer.where(function() { return elementBottomIsAlmostVisible(e, 100) })
}
var pag... | Use single hot observable as timed event stream. | Use single hot observable as timed event stream. | JavaScript | mit | jrosti/ontrail,jrosti/ontrail,jrosti/ontrail,jrosti/ontrail,jrosti/ontrail | ---
+++
@@ -1,8 +1,11 @@
(function(){
+ var timer = Rx.Observable.interval(100).publish()
+ timer.connect()
+
// todo: remove depsu to elementBottomIsAlmostVisible
var nextPage = function(elem) {
var e = ($.isFunction(elem)) ? elem() : elem
- return Rx.Observable.interval(200).where(function() { retu... |
ab5f7faeb6b09693c6804b011113ebe6bb8e9cd1 | src/components/LandingCanvas/index.js | src/components/LandingCanvas/index.js | import React from 'react';
import Helmet from 'react-helmet';
import styles from './styles';
function calculateViewportFromWindow() {
if (window.innerWidth >= 544) return 'sm';
if (window.innerWidth >= 768) return 'md';
if (window.innerWidth >= 992) return 'lg';
if (window.innerWidth >= 1200) return 'xl';
re... | import React from 'react';
import Helmet from 'react-helmet';
import styles from './styles';
function calculateViewportFromWindow() {
if (typeof window !== 'undefined') {
if (window.innerWidth >= 544) return 'sm';
if (window.innerWidth >= 768) return 'md';
if (window.innerWidth >= 992) return 'lg';
i... | Disable viewport calculation in case of server side render | Disable viewport calculation in case of server side render
| JavaScript | mit | line64/landricks-components | ---
+++
@@ -3,11 +3,15 @@
import styles from './styles';
function calculateViewportFromWindow() {
- if (window.innerWidth >= 544) return 'sm';
- if (window.innerWidth >= 768) return 'md';
- if (window.innerWidth >= 992) return 'lg';
- if (window.innerWidth >= 1200) return 'xl';
- return'xs';
+ if (typeof wi... |
f43bcef83577cbc4ef82098ee9bae8fdf709b559 | ui/src/stores/photos/index.js | ui/src/stores/photos/index.js | const SET_PHOTOS = 'SET_PHOTOS'
const initialState = {
photos: [],
photosDetail: []
}
const photos = (state = initialState, action = {}) => {
switch (action.type) {
case SET_PHOTOS:
return {...state, photos: action.payload.ids, photosDetail:action.payload.photoList}
default:
return state
... | const SET_PHOTOS = 'SET_PHOTOS'
const initialState = {
photos: [],
photosDetail: []
}
const photos = (state = initialState, action = {}) => {
switch (action.type) {
case SET_PHOTOS:
let index = state.photosDetail.filter((el) => {
return action.payload.photoList.findIndex( (node) => e... | Add conditions to remove duplicates. | Add conditions to remove duplicates.
| JavaScript | agpl-3.0 | damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager,damianmoore/photo-manager | ---
+++
@@ -9,7 +9,12 @@
switch (action.type) {
case SET_PHOTOS:
- return {...state, photos: action.payload.ids, photosDetail:action.payload.photoList}
+
+ let index = state.photosDetail.filter((el) => {
+ return action.payload.photoList.findIndex( (node) => el.node.id == node.node.... |
a73508bdc6301e616eb15a7f3ee88a5eb982e466 | lib/registration.js | lib/registration.js | if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service-worker.js', {scope: './'})
.catch(function(error) {
alert('Error registering service worker:'+error);
});
} else {
alert('service worker not supported');
} | if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service-worker.js', {scope: './'})
.catch(function(error) {
console.error('Error registering service worker:'+error);
});
} else {
console.log('service worker not supported');
}
| Use console.error and console.log instead of alert | Use console.error and console.log instead of alert
| JavaScript | mit | marco-c/broccoli-serviceworker,jkleinsc/broccoli-serviceworker | ---
+++
@@ -1,8 +1,8 @@
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service-worker.js', {scope: './'})
.catch(function(error) {
- alert('Error registering service worker:'+error);
+ console.error('Error registering service worker:'+error);
});
} else {
- alert('se... |
1ebfe684c986124dd8fbf7a951b1c8e8ae94f371 | lib/socketServer.js | lib/socketServer.js | const socketio = require('socket.io')
const data = require('../data/tasks')
let counter = 0
exports.listen = function (server) {
io = socketio.listen(server)
io.sockets.on('connection', function (socket) {
console.log('Connection created')
createTask(socket)
displayAllTask(socket)
})
const createTa... | const socketio = require('socket.io')
const data = require('../data/tasks')
exports.listen = function (server) {
io = socketio.listen(server)
io.sockets.on('connection', function (socket) {
console.log('Connection created')
createTask(socket)
displayAllTask(socket)
})
const createTask = (socket) =>... | Add createTask on and emit event with mock data | [SocketServer.js] Add createTask on and emit event with mock data
| JavaScript | mit | geekskool/taskMaster,geekskool/taskMaster | ---
+++
@@ -1,6 +1,5 @@
const socketio = require('socket.io')
const data = require('../data/tasks')
-let counter = 0
exports.listen = function (server) {
io = socketio.listen(server)
io.sockets.on('connection', function (socket) {
@@ -10,21 +9,18 @@
})
const createTask = (socket) => {
- socket.on(... |
3cebd82a19df42814f79725c8ab168ca50ff2b2e | routes/updateUserProfile.js | routes/updateUserProfile.js | /*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const models = require('../models/index')
const insecurity = require('../lib/insecurity')
const utils = require('../lib/utils')
const cache = require('../data/datacache')
const challenges = cache.challenges
module.exports = function u... | /*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const models = require('../models/index')
const insecurity = require('../lib/insecurity')
const utils = require('../lib/utils')
const cache = require('../data/datacache')
const challenges = cache.challenges
module.exports = function u... | Fix spelling of HTTP referer header | Fix spelling of HTTP referer header
| JavaScript | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop | ---
+++
@@ -17,7 +17,7 @@
models.User.findByPk(loggedInUser.data.id).then(user => {
utils.solveIf(challenges.csrfChallenge, () => {
return ((req.headers.origin && req.headers.origin.includes('://htmledit.squarefree.com')) ||
- (req.headers.referrer && req.headers.referrer.include... |
5cf61c9fb5cb120e1531ac636e12727aee3768a6 | lib/rsautl.js | lib/rsautl.js | var fs = require('fs');
var run = require('./runner');
var defaults = {
opensslPath : '/usr/bin/openssl',
padding : 'pkcs'
};
function verifyOptions (options) {
if (!fs.existsSync(options.opensslPath)) {
throw new Error(options.opensslPath + ': No such file or directory');
}
if (options.p... | var fs = require('fs');
var run = require('./runner');
var defaults = {
opensslPath : '/usr/bin/openssl',
padding : 'pkcs'
};
function verifyOptions (options) {
if (fs.existsSync !== undefined && !fs.existsSync(options.opensslPath)) {
throw new Error(options.opensslPath + ': No such file or direct... | Handle Meteor's stripping out methods from the fs core API. | Handle Meteor's stripping out methods from the fs core API.
| JavaScript | bsd-2-clause | ragnar-johannsson/rsautl | ---
+++
@@ -7,7 +7,7 @@
};
function verifyOptions (options) {
- if (!fs.existsSync(options.opensslPath)) {
+ if (fs.existsSync !== undefined && !fs.existsSync(options.opensslPath)) {
throw new Error(options.opensslPath + ': No such file or directory');
}
|
43590c27a485c93298bd89be4a1fe84e32aae30b | rollup.config.js | rollup.config.js | import resolve from 'rollup-plugin-node-resolve';
import eslint from 'rollup-plugin-eslint';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import pkg from './package.json';
export default [
{
input: 'src/index.js',
... | import resolve from 'rollup-plugin-node-resolve';
import eslint from 'rollup-plugin-eslint';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import pkg from './package.json';
export default [
{
input: 'src/index.js',
... | Fix 'rollup-plugin-replace' order and variable name | Fix 'rollup-plugin-replace' order and variable name
| JavaScript | mit | springload/react-accessible-accordion,springload/react-accessible-accordion,springload/react-accessible-accordion | ---
+++
@@ -15,6 +15,9 @@
],
name: 'reactAccessibleAccordion',
plugins: [
+ replace({
+ 'process.env.NODE_ENV': JSON.stringify('production'),
+ }),
resolve({
jsnext: true,
main: true,
@@ -23,10 +26,6 @@
... |
206175481008af3ad074840a80f41816dcc2991c | public/app/components/chooseLanguage/chooseLanguage.js | public/app/components/chooseLanguage/chooseLanguage.js | product
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'components/chooseLanguage/chooseLanguage.tpl.html'
,controller: 'ChooseLanguageCtrl'
,resolve: {
LanguageService: 'LanguageService',
languages: function(L... | product
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'components/chooseLanguage/chooseLanguage.tpl.html'
,resolve: {
$b: ["$q", "LanguageService",
function ($q, LanguageService) {
return $... | Fix change to resolve promise before controller | Fix change to resolve promise before controller
| JavaScript | mit | stevenrojasv21/product-list-steven-rojas,stevenrojasv21/product-list-steven-rojas,stevenrojasv21/product-list-steven-rojas | ---
+++
@@ -2,27 +2,29 @@
.config(function ($routeProvider) {
$routeProvider
.when('/', {
- templateUrl: 'components/chooseLanguage/chooseLanguage.tpl.html'
+ templateUrl: 'components/chooseLanguage/chooseLanguage.tpl.html'
+ ,resolve: {
+ $b:... |
4817ef6d6d10db74bc67a3f07c8db75bb2e3dd6e | common/predictive-text/unit_tests/headless/default-word-breaker.js | common/predictive-text/unit_tests/headless/default-word-breaker.js | /**
* Smoke-test the default
*/
var assert = require('chai').assert;
var breakWords = require('../../build/intermediate').wordBreakers['uax29'];
const SHY = '\u00AD';
describe('The default word breaker', function () {
it('should break multilingual text', function () {
let breaks = breakWords(
`ᑖᓂᓯ᙮ раб... | /**
* Smoke-test the default
*/
var assert = require('chai').assert;
var breakWords = require('../../build/intermediate').wordBreakers['uax29'];
const SHY = '\u00AD';
describe('The default word breaker', function () {
it('should break multilingual text', function () {
let breaks = breakWords(
`Добрый д... | Make unit test slightly less weird. | Make unit test slightly less weird.
| JavaScript | apache-2.0 | tavultesoft/keymanweb,tavultesoft/keymanweb | ---
+++
@@ -9,13 +9,13 @@
describe('The default word breaker', function () {
it('should break multilingual text', function () {
let breaks = breakWords(
- `ᑖᓂᓯ᙮ рабочий — after working on ka${SHY}wen${SHY}non:${SHY}nis
- let's eat phở! 🥣`
+ `Добрый день! ᑕᐻ᙮ — after working on ka${SHY}wen$... |
5f079cbed8904f50c273aa5a017172081d91021f | js/projects.js | js/projects.js | /**
* Created by sujithkatakam on 3/15/16.
*/
function pagination() {
var monkeyList = new List('test-list', {
valueNames: ['name'],
page: 4,
innerWindow: 4,
plugins: [ ListPagination({}) ]
});
}
window.onload = function() {
pagination();
getMonthsCount('experience', ... | /**
* Created by sujithkatakam on 3/15/16.
*/
function pagination() {
var monkeyList = new List('test-list', {
valueNames: ['name'],
page: 4,
innerWindow: 4,
plugins: [ ListPagination({}) ]
});
}
window.onload = function() {
pagination();
getMonthsCount('experience', ... | Work ex fix in summary | Work ex fix in summary
| JavaScript | apache-2.0 | sujithktkm/sujithktkm.github.io,sujithktkm/sujithktkm.github.io | ---
+++
@@ -13,5 +13,5 @@
window.onload = function() {
pagination();
- getMonthsCount('experience', new Date(2014, 10, 15));
+ getMonthsCount('experience', new Date(2014, 10, 15), new Date(2016, 03, 15));
}; |
c91d95333da23c09b5f9df9e5a591b2d007ea531 | server/auth/craftenforum.js | server/auth/craftenforum.js | "use strict";
const passport = require('passport');
const BdApiStrategy = require('passport-bdapi').Strategy;
module.exports = (config, app, passport, models) => {
passport.use(new BdApiStrategy({
apiURL: config.apiUrl,
clientID: config.clientId,
clientSecret: config.clientSecret,
... | "use strict";
const passport = require('passport');
const BdApiStrategy = require('passport-bdapi').Strategy;
module.exports = (config, app, passport, models) => {
passport.use(new BdApiStrategy({
apiURL: config.apiUrl,
clientID: config.clientId,
clientSecret: config.clientSecret,
... | Fix wrong oauthId when creating users. | Fix wrong oauthId when creating users.
| JavaScript | mit | leMaik/EduCraft-Editor,leMaik/EduCraft-Editor,leMaik/EduCraft-Editor,leMaik/EduCraft-Editor | ---
+++
@@ -17,7 +17,7 @@
}
else {
models.User.create({
- oauthId: "cf-#{profile.user_id}",
+ oauthId: `cf-${profile.user_id}`,
username: profile.username
})
.the... |
1eeb1d49f7214732754b359bea00025d11395e4b | server/game/cards/02.2-FHaG/RaiseTheAlarm.js | server/game/cards/02.2-FHaG/RaiseTheAlarm.js | const DrawCard = require('../../drawcard.js');
class RaiseTheAlarm extends DrawCard {
setupCardAbilities(ability) {
this.action({
title: 'Flip a dynasty card',
condition: context => this.game.isDuringConflict('military') && context.player.isDefendingPlayer(),
cannotBeMir... | const DrawCard = require('../../drawcard.js');
class RaiseTheAlarm extends DrawCard {
setupCardAbilities(ability) {
this.action({
title: 'Flip a dynasty card',
condition: context => this.game.isDuringConflict('military') && context.player.isDefendingPlayer(),
cannotBeMir... | Fix Raise the Alarm bug | Fix Raise the Alarm bug
| JavaScript | mit | gryffon/ringteki,jeremylarner/ringteki,gryffon/ringteki,gryffon/ringteki,jeremylarner/ringteki,jeremylarner/ringteki | ---
+++
@@ -8,7 +8,7 @@
cannotBeMirrored: true,
effect: 'flip the card in the conflict province faceup',
gameAction: ability.actions.flipDynasty(context => ({
- target: context.player.controller.getDynastyCardInProvince(this.game.currentConflict.conflictProvince.l... |
51be095bab5e4c8b34b8e2dda0bd56a565d43bad | app.js | app.js | /**
* @module App Main Application Module
*/
'use strict';
const express = require('express');
const app = express();
const api = require('./api/api.router');
app.use('/', express.static('public'));
app.use('/api', api);
module.exports = app; | /**
* @module App Main Application Module
*/
'use strict';
const express = require('express');
const app = express();
app.set('trust proxy', true);
const api = require('./api/api.router');
app.use('/', express.static('public'));
app.use('/api', api);
module.exports = app; | Set trust proxy to true | Set trust proxy to true
| JavaScript | mit | agroupp/test-api,agroupp/test-api | ---
+++
@@ -5,6 +5,9 @@
const express = require('express');
const app = express();
+
+app.set('trust proxy', true);
+
const api = require('./api/api.router');
app.use('/', express.static('public')); |
55a86b726335b4dbc2fa45b43e82c6245fdfed82 | src/routes/Home/components/HomeView.js | src/routes/Home/components/HomeView.js | import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import Sidebar from '../../../components/Sidebar'
import TopicList from '../../../components/TopicList'
import './HomeView.scss'
class HomeView extends Component {
static propTypes = {
topics: PropT... | import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import Sidebar from '../../../components/Sidebar'
import TopicList from '../../../components/TopicList'
import './HomeView.scss'
class HomeView extends Component {
static propTypes = {
topics: PropT... | Sort topics by the number of upvotes/downvotes | Sort topics by the number of upvotes/downvotes
| JavaScript | mit | AdrielLimanthie/carousell-reddit,AdrielLimanthie/carousell-reddit | ---
+++
@@ -9,6 +9,12 @@
class HomeView extends Component {
static propTypes = {
topics: PropTypes.object
+ }
+
+ constructor (props) {
+ super(props)
+
+ this.preprocessTopics = this.preprocessTopics.bind(this)
}
transformTopicsToArray (obj) {
@@ -23,11 +29,20 @@
return arr
}
+ so... |
a9817a7d8b33fa27072d5f5a55cfc49e00eada71 | webpack.development.config.js | webpack.development.config.js | //extend webpack.config.js
var config = require('./webpack.config');
var path = require('path');
//for more info, look into webpack.config.js
//this will add a new object into default settings
// config.entry = [
// 'webpack/hot/dev-server',
// 'webpack-dev-server/client?http://localhost:8080',
// ];
config.entry.... | //extend webpack.config.js
var config = require('./webpack.config');
var path = require('path');
//for more info, look into webpack.config.js
//this will add a new object into default settings
// config.entry = [
// 'webpack/hot/dev-server',
// 'webpack-dev-server/client?http://localhost:8080',
// ];
config.entry.... | Allow server to be accessed via IP | Allow server to be accessed via IP
| JavaScript | isc | terryx/react-webpack,terryx/react-webpack | ---
+++
@@ -23,7 +23,15 @@
stats: {
colors: true
},
- hot: true
+ host: '0.0.0.0',
+ hot: true,
+ //UNCOMMENT THIS if you need to call you backend server
+ // proxy: {
+ // '/api/**': {
+ // target: 'http://localhost:3000',
+ // secure: false
+ // }
+ // }
};
module.exports = conf... |
c1439e9e07786a46290a550304f3c9014a1b3d06 | src/app/projects/controller/project_list_controller.js | src/app/projects/controller/project_list_controller.js | /*
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless re... | /*
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless re... | Tweak for Superuser UI in projects. | Tweak for Superuser UI in projects.
This will properly align the create-project button for superadmin.
Change-Id: Id79c7daa66b7db559bda5a41e494f17d519cf6a3
| JavaScript | apache-2.0 | ColdrickSotK/storyboard-webclient,ColdrickSotK/storyboard-webclient,ColdrickSotK/storyboard-webclient | ---
+++
@@ -20,8 +20,11 @@
* rather than a browse (exclusive) approach.
*/
angular.module('sb.projects').controller('ProjectListController',
- function ($scope) {
+ function ($scope, isSuperuser) {
'use strict';
+
+ // inject superuser flag to properly adjust UI.
+ $scope.is_superuse... |
dbf22af2728160fbe45245c9a779dec2f634cbe4 | app/assets/javascripts/tests/helpers/common.js | app/assets/javascripts/tests/helpers/common.js | const chai = require('chai');
const sinon = require('sinon');
const sinonChai = require('sinon-chai');
// Require and load .env vars
require('./dotenv');
// Configure chai to use Sinon-Chai
chai.should();
chai.use(sinonChai);
global.expect = chai.expect;
global.sinon = sinon;
| /**
* This file is globally included on every testcase instance. It is useful to
* load constants such as `chai`, `sinon` or any setup phase that we need. In
* our case, we need to setup sinon-chai, avoiding repeating a chunk of code
* across our test files.
*/
const chai = require('chai');
const sinon = require... | Add docs on global test file | Add docs on global test file
| JavaScript | bsd-3-clause | kriansa/amelia,kriansa/amelia,kriansa/amelia,kriansa/amelia | ---
+++
@@ -1,3 +1,9 @@
+/**
+ * This file is globally included on every testcase instance. It is useful to
+ * load constants such as `chai`, `sinon` or any setup phase that we need. In
+ * our case, we need to setup sinon-chai, avoiding repeating a chunk of code
+ * across our test files.
+ */
const chai = requi... |
b260f27e0176f2615236e78e06c8af045f5b0680 | scripts/build.js | scripts/build.js | const buildBaseCss = require(`./_build-base-css.js`);
const buildBaseHtml = require(`./_build-base-html.js`);
const buildPackageCss = require(`./_build-package-css.js`);
const buildPackageHtml = require(`./_build-package-html.js`);
const getDirectories = require(`./_get-directories.js`);
const packages = getDirectorie... | const buildBaseCss = require(`./_build-base-css.js`);
const buildBaseHtml = require(`./_build-base-html.js`);
const buildPackageCss = require(`./_build-package-css.js`);
const buildPackageHtml = require(`./_build-package-html.js`);
const getDirectories = require(`./_get-directories.js`);
const packages = getDirectorie... | Add global.css file to pages by default | Add global.css file to pages by default
| JavaScript | mit | avalanchesass/avalanche-website,avalanchesass/avalanche-website | ---
+++
@@ -6,14 +6,16 @@
const packages = getDirectories(`avalanche/packages`);
-const data = {};
+const data = {
+ css: `<link rel="stylesheet" href="/base/css/global.css">`
+};
-buildBaseHtml({});
+buildBaseHtml(data);
buildBaseCss();
packages.forEach((packageName) => {
data.title = packageName;
- ... |
c8a608cf64c5fb9ce0f24beee53b7acccfc4cd03 | packages/custom/icu/public/components/data/context/context.service.js | packages/custom/icu/public/components/data/context/context.service.js | 'use strict';
angular.module('mean.icu').service('context', function ($injector, $q) {
var mainMap = {
task: 'tasks',
user: 'people',
project: 'projects',
discussion: 'discussions',
officeDocument:'officeDocuments',
office: 'offices',
templateDoc: 'templateDo... | 'use strict';
angular.module('mean.icu').service('context', function ($injector, $q) {
var mainMap = {
task: 'tasks',
user: 'people',
project: 'projects',
discussion: 'discussions',
officeDocument:'officeDocuments',
office: 'offices',
templateDoc: 'templateDo... | Make correct context when select entity in search | Make correct context when select entity in search
| JavaScript | mit | linnovate/icu,linnovate/icu,linnovate/icu | ---
+++
@@ -32,6 +32,11 @@
main = reverseMainMap[parts[1]];
}
+ // When in context of search, the entity you selected is in parts[2]
+ if (parts[1] == 'search') {
+ main = reverseMainMap[parts[2]];
+ }
+
... |
e5985521ee1fd0960dcc6af004e5dd831857685d | app/props/clickable.js | app/props/clickable.js | import Prop from 'props/prop';
import canvas from 'canvas';
import mouse from 'lib/mouse';
// http://stackoverflow.com/questions/16628184/add-onclick-and-onmouseover-to-canvas-element
export default class Clickable extends Prop {
constructor(x, y, width, height, fn) {
super(x, y, width, height);
this.fn = f... | import Prop from 'props/prop';
import canvas from 'canvas';
import mouse from 'lib/mouse';
// http://stackoverflow.com/questions/16628184/add-onclick-and-onmouseover-to-canvas-element
export default class Clickable extends Prop {
constructor(x, y, width, height, fn) {
super(x, y, width, height);
this.fn = f... | Remove rendering for debugging click handlers | Remove rendering for debugging click handlers
| JavaScript | mit | oliverbenns/pong,oliverbenns/pong | ---
+++
@@ -22,9 +22,6 @@
render() {
canvas.addEventListener('click', this.onClick);
-
- // @TODO: Remove this debug when complete.
- super.render(null, null, 'rgba(50, 50, 50, 1)');
}
destroy() { |
2a8cd200a67562a32fcce6dd01e253985e94d18a | 05/jjhampton-ch5-every-some.js | 05/jjhampton-ch5-every-some.js | // Arrays also come with the standard methods every and some. Both take a predicate function that, when called with an array element as argument, returns true or false. Just like && returns a true value only when the expressions on both sides are true, every returns true only when the predicate returns true for all ele... | // Arrays also come with the standard methods every and some. Both take a predicate function that, when called with an array element as argument, returns true or false. Just like && returns a true value only when the expressions on both sides are true, every returns true only when the predicate returns true for all ele... | Enable every/some methods to return early to prevent iterating over entire array | Enable every/some methods to return early to prevent iterating over entire array
| JavaScript | mit | OperationCode/eloquent-js | ---
+++
@@ -3,19 +3,19 @@
// Write two functions, every and some, that behave like these methods, except that they take the array as their first argument rather than being a method.
function every(array, action) {
- let conditional = true;
for (let i = 0; i < array.length; i++) {
- if (!action(arra... |
35ead74f1fcb0b20d83be28cc9e187cdfe115373 | servers/index.js | servers/index.js | require('coffee-script').register();
var argv = require('minimist')(process.argv);
// require('./lib/source-server')
module.exports = require('./lib/server');
| require('coffee-script').register();
// require('./lib/source-server')
module.exports = require('./lib/server');
| Remove unused command line options parsing code | Remove unused command line options parsing code
Signed-off-by: Sonmez Kartal <d2d15c3d37396a5f2a09f8b42cf5f27d43a3fbde@koding.com>
| JavaScript | agpl-3.0 | usirin/koding,gokmen/koding,acbodine/koding,alex-ionochkin/koding,mertaytore/koding,kwagdy/koding-1,kwagdy/koding-1,gokmen/koding,jack89129/koding,szkl/koding,drewsetski/koding,andrewjcasal/koding,szkl/koding,usirin/koding,rjeczalik/koding,koding/koding,drewsetski/koding,jack89129/koding,kwagdy/koding-1,rjeczalik/kodin... | ---
+++
@@ -1,7 +1,4 @@
require('coffee-script').register();
-
-var argv = require('minimist')(process.argv);
-
// require('./lib/source-server')
module.exports = require('./lib/server');
|
376fda5bcdd5e0d4511ab08cd5c7125d72905e8b | lib/feature.js | lib/feature.js | var debug = require('debug')('rose');
var mongoose = require('mongoose');
var mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/mydb';
debug('Connecting to MongoDB at ' + mongoURI + '...');
mongoose.connect(mongoURI);
var featureSchema = new mongoose.Schema({
name: {
type: String,
required: true
... | var debug = require('debug')('rose');
var mongoose = require('mongoose');
var mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/rose';
debug('Connecting to MongoDB at ' + mongoURI + '...');
mongoose.connect(mongoURI);
var featureSchema = new mongoose.Schema({
name: {
type: String,
required: true
... | Rename the DB from mydb to rose | Rename the DB from mydb to rose
| JavaScript | mit | nickmccurdy/rose,nickmccurdy/rose,nicolasmccurdy/rose,nicolasmccurdy/rose | ---
+++
@@ -1,7 +1,7 @@
var debug = require('debug')('rose');
var mongoose = require('mongoose');
-var mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/mydb';
+var mongoURI = process.env.MONGOLAB_URI || 'mongodb://localhost/rose';
debug('Connecting to MongoDB at ' + mongoURI + '...');
mongoose.connec... |
59ae7095d382380d0a14871a1a571fb7c99b31f6 | examples/hello-world/app.js | examples/hello-world/app.js | var app = module.exports = require('appjs').createApp({CachePath: '/Users/dbartlett/.cache1'});
app.serveFilesFrom(__dirname + '/content');
var window = app.createWindow({
width : 640,
height : 460,
icons : __dirname + '/content/icons'
});
window.on('create', function(){
console.log("Window Created");
wi... | var app = module.exports = require('appjs').createApp();
app.serveFilesFrom(__dirname + '/content');
var window = app.createWindow({
width : 640,
height : 460,
icons : __dirname + '/content/icons'
});
window.on('create', function(){
console.log("Window Created");
window.frame.show();
window.frame.cente... | Remove testing CachePath from example. | Remove testing CachePath from example.
| JavaScript | mit | tempbottle/appjs,SaravananRajaraman/appjs,yuhangwang/appjs,appjs/appjs,appjs/appjs,imshibaji/appjs,tempbottle/appjs,yuhangwang/appjs,modulexcite/appjs,yuhangwang/appjs,SaravananRajaraman/appjs,eric-seekas/appjs,eric-seekas/appjs,eric-seekas/appjs,SaravananRajaraman/appjs,appjs/appjs,SaravananRajaraman/appjs,modulexcite... | ---
+++
@@ -1,4 +1,4 @@
-var app = module.exports = require('appjs').createApp({CachePath: '/Users/dbartlett/.cache1'});
+var app = module.exports = require('appjs').createApp();
app.serveFilesFrom(__dirname + '/content');
|
01e2d7f7a2a533d6eebd750096ccb542e5c524ae | web/lib/socket.js | web/lib/socket.js | import log from './lib/log';
let socket = root.io.connect('');
socket.on('connect', () => {
log.debug('socket.io: connected');
});
socket.on('error', () => {
log.error('socket.io: error');
socket.destroy();
});
socket.on('close', () => {
log.debug('socket.io: closed');
});
export default socket;
| import log from './log';
let socket = root.io.connect('');
socket.on('connect', () => {
log.debug('socket.io: connected');
});
socket.on('error', () => {
log.error('socket.io: error');
socket.destroy();
});
socket.on('close', () => {
log.debug('socket.io: closed');
});
export default socket;
| Change the import path for log | Change the import path for log
| JavaScript | mit | cheton/cnc.js,cheton/cnc,cncjs/cncjs,cheton/cnc,cncjs/cncjs,cheton/piduino-grbl,cheton/cnc,cheton/cnc.js,cheton/cnc.js,cheton/piduino-grbl,cncjs/cncjs,cheton/piduino-grbl | ---
+++
@@ -1,4 +1,4 @@
-import log from './lib/log';
+import log from './log';
let socket = root.io.connect('');
|
dd6f17e4f57e799a6200dec3f339f5ccba75de8d | webpack.config.js | webpack.config.js | var webpack = require('webpack');
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
context: __dirname,
entry: './src/whoami.js',
output: {
path: './dist',
filename: 'whoami.min.js',
libraryTarget: 'var',
library: 'whoami'
},
module: {
loaders: [
... | var webpack = require('webpack');
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
context: __dirname,
entry: './src/whoami.js',
output: {
path: './dist',
filename: 'whoami.min.js',
libraryTarget: 'var',
library: 'whoami'
},
module: {
loaders: [
... | Watch dist files on browsersync | Watch dist files on browsersync
| JavaScript | mit | andersonba/whoami.js | ---
+++
@@ -25,6 +25,7 @@
new BrowserSyncPlugin({
host: 'localhost',
port: 3000,
+ files: 'dist/*.*',
server: {
baseDir: ['dist']
} |
1ab999034c53389d359ab2161492a70e82c1ab47 | src/wirecloud/fiware/static/js/WirecloudAPI/NGSIAPI.js | src/wirecloud/fiware/static/js/WirecloudAPI/NGSIAPI.js | (function () {
"use strict";
var key, manager = window.parent.NGSIManager, NGSIAPI = {};
NGSIAPI.Connection = function Connection(url, options) {
manager.Connection.call(this, 'operator', MashupPlatform.operator.id, url, options);
};
NGSIAPI.Connection.prototype = window.parent.NGSIManage... | (function () {
"use strict";
var key, manager = window.parent.NGSIManager, NGSIAPI = {};
if (MashupPlatform.operator != null) {
NGSIAPI.Connection = function Connection(url, options) {
manager.Connection.call(this, 'operator', MashupPlatform.operator.id, url, options);
};
... | Fix bug: export NGSI API also for widgets | Fix bug: export NGSI API also for widgets
| JavaScript | agpl-3.0 | jpajuelo/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud | ---
+++
@@ -4,9 +4,17 @@
var key, manager = window.parent.NGSIManager, NGSIAPI = {};
- NGSIAPI.Connection = function Connection(url, options) {
- manager.Connection.call(this, 'operator', MashupPlatform.operator.id, url, options);
- };
+ if (MashupPlatform.operator != null) {
+ NGSIAPI... |
1dcc6eab08d4df0e01427402503c5e26808e58ca | test/utils/to-date-time-in-time-zone.js | test/utils/to-date-time-in-time-zone.js | 'use strict';
module.exports = function (t, a) {
var mayanEndOfTheWorld = new Date(2012, 11, 21, 1, 1);
a.deep(t(mayanEndOfTheWorld, 'America/Guatemala').valueOf(),
new Date(2012, 11, 20, 18, 1).valueOf());
a.deep(t(mayanEndOfTheWorld, 'Europe/Warsaw').valueOf(),
new Date(2012, 11, 21, 1, 1).valueOf());
};
| 'use strict';
module.exports = function (t, a) {
var mayanEndOfTheWorld = new Date(Date.UTC(2012, 11, 21, 1, 1));
a.deep(t(mayanEndOfTheWorld, 'America/Guatemala').valueOf(),
new Date(2012, 11, 20, 19, 1).valueOf());
a.deep(t(mayanEndOfTheWorld, 'Europe/Warsaw').valueOf(),
new Date(2012, 11, 21, 2, 1).valueOf(... | Fix test so is timezone independent | Fix test so is timezone independent
| JavaScript | mit | egovernment/eregistrations,egovernment/eregistrations,egovernment/eregistrations | ---
+++
@@ -1,10 +1,10 @@
'use strict';
module.exports = function (t, a) {
- var mayanEndOfTheWorld = new Date(2012, 11, 21, 1, 1);
+ var mayanEndOfTheWorld = new Date(Date.UTC(2012, 11, 21, 1, 1));
a.deep(t(mayanEndOfTheWorld, 'America/Guatemala').valueOf(),
- new Date(2012, 11, 20, 18, 1).valueOf());
+ ne... |
10c19dabd1178de4f561327e348c3c114b54ea67 | Web/Application.js | Web/Application.js | var express = require('express');
var app = express();
var CurrentUser = require('../Architecture/CurrentUser').CurrentUser;
var WebService = require('../Architecture/WebService').WebService;
var MongoAdapter = require('../Adapters/Mongo').MongoAdapter;
var RedisAdapter = require('../Adapters/Redis').RedisAdapter;
va... | var express = require('express');
var app = express();
var CurrentUser = require('../Architecture/CurrentUser').CurrentUser;
var WebService = require('../Architecture/WebService').WebService;
var MongoAdapter = require('../Adapters/Mongo').MongoAdapter;
var RedisAdapter = require('../Adapters/Redis').RedisAdapter;
va... | Remove params from login route. | Remove params from login route.
| JavaScript | mit | rootsher/server-side-portal-framework | ---
+++
@@ -33,7 +33,7 @@
// ### Routing ###
-app.get('/login', runService('loginGet', [0, 1, 2, 3], { param1: 'value1', param2: 'value2' }));
+app.get('/login', runService('loginGet', [0, 1, 2, 3]));
app.get('/secret', runService('secretGet', [2, 3], { param1: 'value1', param2: 'value2' }));
|
d7983d0ed5f18fb64e046fb4aefa718c7cdd2a8b | src/bot/index.js | src/bot/index.js |
import 'babel-polyfill';
import { existsSync } from 'fs';
import { resolve } from 'path';
import merge from 'lodash.merge';
import TipsBot from './Tipsbot';
const tokenPath = resolve(__dirname, '..', '..', 'token.js');
const defaultToken = existsSync(tokenPath) ? require(tokenPath) : null;
const defaultName = 'Tipsb... |
import 'babel-polyfill';
import { existsSync } from 'fs';
import { resolve } from 'path';
import merge from 'lodash.merge';
import TipsBot from './Tipsbot';
const tokenPath = resolve(__dirname, '..', '..', 'token.js');
const defaultToken = existsSync(tokenPath) ? require(tokenPath) : '';
const defaultName = 'Tipsbot... | Set default token to empty string insted of null | Set default token to empty string insted of null
| JavaScript | mit | simon-johansson/tipsbot | ---
+++
@@ -7,7 +7,7 @@
import TipsBot from './Tipsbot';
const tokenPath = resolve(__dirname, '..', '..', 'token.js');
-const defaultToken = existsSync(tokenPath) ? require(tokenPath) : null;
+const defaultToken = existsSync(tokenPath) ? require(tokenPath) : '';
const defaultName = 'Tipsbot';
const defaultTips ... |
61d51a215bed8e447a528c8a65a9d2ba92453790 | js/memberlist.js | js/memberlist.js | //Memberlist JavaScript
function hookUpMemberlistControls() {
$("#orderBy,#order,#sex,#power").change(function(e) {
refreshMemberlist();
});
$("#submitQuery").click(function() {
refreshMemberlist();
});
refreshMemberlist();
}
function refreshMemberlist(page) {
var orderBy = document.getElementById("orderB... | //Memberlist JavaScript
function hookUpMemberlistControls() {
$("#orderBy,#order,#sex,#power").change(function(e) {
refreshMemberlist();
});
$("#submitQuery").click(function() {
refreshMemberlist();
});
refreshMemberlist();
}
function refreshMemberlist(page) {
var orderBy = $("#orderBy").val();
var order... | Use jQuery instead of document.getElementById. | Use jQuery instead of document.getElementById.
| JavaScript | bsd-2-clause | Jceggbert5/ABXD,ABXD/ABXD,carlosfortes/ABXD,carlosfortes/ABXD,carlosfortes/ABXD,Jceggbert5/ABXD,Jceggbert5/ABXD,ABXD/ABXD,ABXD/ABXD | ---
+++
@@ -13,11 +13,11 @@
}
function refreshMemberlist(page) {
- var orderBy = document.getElementById("orderBy").value;
- var order = document.getElementById( "order").value;
- var sex = document.getElementById( "sex").value;
- var power = document.getElementById( "power").value;
- var query = d... |
b6d411f8cd7a895394227ec6b1b3e226a69bb5e6 | lib/chlg-init.js | lib/chlg-init.js | 'use strict';
var fs = require('fs');
var program = require('commander');
program
.option('-f, --file [filename]', 'Changelog filename', 'CHANGELOG.md')
.parse(process.argv);
function chlgInit(file, callback) {
file = file || program.file;
fs.stat(file, function (err) {
if (!err || err.code !== 'ENOENT... | 'use strict';
var fs = require('fs');
var program = require('commander');
program
.option('-f, --file [filename]', 'Changelog filename', 'CHANGELOG.md')
.parse(process.argv);
function chlgInit(file, callback) {
file = file || program.file;
fs.stat(file, function (err) {
if (!err || err.code !== 'ENOENT... | Fix chld-show command line usage | Fix chld-show command line usage
| JavaScript | mit | fldubois/changelog-cli | ---
+++
@@ -30,7 +30,7 @@
}
if (require.main === module) {
- chlgInit(function (err) {
+ chlgInit(program.file, function (err) {
if (err) {
console.error('chlg-init: ' + err.message);
process.exit(1); |
599c023798d96766d4552ad3619b95f5e84f8ed3 | lib/form-data.js | lib/form-data.js | /*global window*/
var isBrowser = typeof window !== 'undefined' &&
typeof window.FormData !== 'undefined';
// use native FormData in a browser
var FD = isBrowser?
window.FormData :
require('form-data');
module.exports = FormData;
module.exports.isBrowser = isBrowser;
function FormData() {
... | /*global window*/
var isBrowser = typeof window !== 'undefined' &&
typeof window.FormData !== 'undefined';
// use native FormData in a browser
var FD = isBrowser?
window.FormData :
require('form-data');
module.exports = FormData;
module.exports.isBrowser = isBrowser;
function FormData() {
... | Convert ArrayBuffer to Blob in FormData | Convert ArrayBuffer to Blob in FormData
| JavaScript | mit | lakenen/node-box-view | ---
+++
@@ -16,6 +16,10 @@
FormData.prototype.append = function (name, data, opt) {
if (isBrowser) {
+ // data must be converted to Blob if it's an arraybuffer
+ if (data instanceof window.ArrayBuffer) {
+ data = new window.Blob([ data ]);
+ }
if (opt && opt.filename) {
... |
9d214f96490ae3ac6eeea2f24e970e12e91a677e | client/app/components/fileUploadModal/index.js | client/app/components/fileUploadModal/index.js | import React from 'react';
import style from './style.css';
import Modal from 'react-modal';
import H1 from '../h1';
import ControllButton from '../controllButton';
import SelectedPrinters from '../selectedPrinters';
let fileInput;
function extractFileNameFromPath(path) {{
}
return path.match(/[^\/\\]+$/);
}
fun... | import React from 'react';
import style from './style.css';
import Modal from 'react-modal';
import H1 from '../h1';
import ControllButton from '../controllButton';
import SelectedPrinters from '../selectedPrinters';
let fileInput;
function extractFileNameFromPath(path) {{
}
return path.match(/[^\/\\]+$/);
}
fun... | Fix file extension in file input | Fix file extension in file input
| JavaScript | agpl-3.0 | MakersLab/farm-client,MakersLab/farm-client | ---
+++
@@ -40,7 +40,7 @@
<SelectedPrinters selectedPrinters={selectedPrinters} />
<span className={style.fileName}>{fileInput && extractFileNameFromPath(fileInput.value)}</span>
<ControllButton onClick={() => { fileInput.click(); }}>Load file</ControllButton>
- <input type="file" hidden open ref={(... |
daa7c07dc6eaaad441c35c9da540ef4863f2bee3 | client/views/activities/latest/latestByType.js | client/views/activities/latest/latestByType.js | Template.latestActivitiesByType.created = function () {
// Create 'instance' variable for use througout template logic
var instance = this;
// Subscribe to all activity types
instance.subscribe('allActivityTypes');
// Create variable to hold activity type selection
instance.activityTypeSelection = new Rea... | Template.latestActivitiesByType.created = function () {
// Create 'instance' variable for use througout template logic
var instance = this;
// Subscribe to all activity types
instance.subscribe('allActivityTypes');
// Create variable to hold activity type selection
instance.activityTypeSelection = new Rea... | Change activity type selection on change event | Change activity type selection on change event
| JavaScript | agpl-3.0 | brylie/juhani-wellbeing,brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,GeriLife/wellbeing | ---
+++
@@ -17,3 +17,14 @@
return activityTypes;
}
});
+
+Template.latestActivitiesByType.events({
+ 'change #activity-type-select': function (event, template) {
+ // Create instance variable for consistency
+ var instance = Template.instance();
+
+ var selectedActivityType = event.target.value;
+
... |
4b765f32e63599995bef123d47fd9ddd39bdb235 | pages/books/read.js | pages/books/read.js | // @flow
/**
* Part of GDL gdl-frontend.
* Copyright (C) 2017 GDL
*
* See LICENSE
*/
import * as React from 'react';
import { fetchBook } from '../../fetch';
import type { BookDetails, Context } from '../../types';
import defaultPage from '../../hocs/defaultPage';
import Head from '../../components/Head';
import... | // @flow
/**
* Part of GDL gdl-frontend.
* Copyright (C) 2017 GDL
*
* See LICENSE
*/
import * as React from 'react';
import { fetchBook } from '../../fetch';
import type { BookDetails, Context } from '../../types';
import defaultPage from '../../hocs/defaultPage';
import errorPage from '../../hocs/errorPage';
im... | Add error handling to Read book page | Add error handling to Read book page
| JavaScript | apache-2.0 | GlobalDigitalLibraryio/gdl-frontend,GlobalDigitalLibraryio/gdl-frontend | ---
+++
@@ -11,6 +11,7 @@
import { fetchBook } from '../../fetch';
import type { BookDetails, Context } from '../../types';
import defaultPage from '../../hocs/defaultPage';
+import errorPage from '../../hocs/errorPage';
import Head from '../../components/Head';
import Reader from '../../components/Reader';
@@... |
56583e9cb09dfbcea6da93af4d10268b51b232e9 | js/casper.js | js/casper.js | var fs = require('fs');
var links;
function getLinks() {
// Scrape the links from primary nav of the website
var links = document.querySelectorAll('.nav-link.t-nav-link');
return Array.prototype.map.call(links, function (e) {
return e.getAttribute('href')
});
}
casper.start('http://192.168.13.37/i... | var fs = require('fs');
var links;
function getLinks() {
var links = document.querySelectorAll('.nav-link.t-nav-link');
return Array.prototype.map.call(links, function (e) {
return e.getAttribute('href')
});
}
casper.start('http://192.168.13.37/index.php', function() {
fs.write('tests/validati... | Fix For Loop to Iterate Every Link in Primary Nav | Fix For Loop to Iterate Every Link in Primary Nav
| JavaScript | mit | jadu/pulsar,jadu/pulsar,jadu/pulsar | ---
+++
@@ -2,7 +2,6 @@
var links;
function getLinks() {
-// Scrape the links from primary nav of the website
var links = document.querySelectorAll('.nav-link.t-nav-link');
return Array.prototype.map.call(links, function (e) {
return e.getAttribute('href')
@@ -10,17 +9,24 @@
}
casper.start(... |
626e52c243ee1e82988d4650cbb22d3d8c304ed6 | js/modals.js | js/modals.js | /* ========================================================================
* Ratchet: modals.js v2.0.2
* http://goratchet.com/components#modals
* ========================================================================
* Copyright 2015 Connor Sears
* Licensed under MIT (https://github.com/twbs/ratchet/blob/master... | /* ========================================================================
* Ratchet: modals.js v2.0.2
* http://goratchet.com/components#modals
* ========================================================================
* Copyright 2015 Connor Sears
* Licensed under MIT (https://github.com/twbs/ratchet/blob/master... | Create modalOpen and modalClose events. | Create modalOpen and modalClose events.
| JavaScript | mit | jackyzonewen/ratchet,hashg/ratchet,AndBicScadMedia/ratchet,mazong1123/ratchet-pro,Joozo/ratchet,calvintychan/ratchet,asonni/ratchet,aisakeniudun/ratchet,youprofit/ratchet,Diaosir/ratchet,wallynm/ratchet,vebin/ratchet,mbowie5/playground2,arnoo/ratchet,AladdinSonni/ratchet,youzaiyouzai666/ratchet,ctkjose/ratchet-1,liangx... | ---
+++
@@ -9,6 +9,14 @@
!(function () {
'use strict';
+ var eventModalOpen = new CustomEvent('modalOpen', {
+ bubbles: true,
+ cancelable: true
+ });
+ var eventModalClose = new CustomEvent('modalClose', {
+ bubbles: true,
+ cancelable: true
+ });
var findModals = function (target) {
va... |
65a9b66c2d9f30bad14a06b0646737ec86799f39 | src/matchNode.js | src/matchNode.js | /*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'us... | /*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'us... | Fix fatal when matching null values in needle | Fix fatal when matching null values in needle
| JavaScript | mit | facebook/jscodeshift,fkling/jscodeshift | ---
+++
@@ -30,8 +30,9 @@
return false;
}
if (haystack[prop] &&
- typeof haystack[prop] === 'object' &&
- typeof needle[prop] === 'object') {
+ needle[prop] &&
+ typeof haystack[prop] === 'object' &&
+ typeof needle[prop] === 'object') {
return matchNode(haystack... |
a69af39c3d2f4b1ec80a08bd6abe70e2a431b083 | packages/staplegun/test/fixtures/good-plugins/threepack/three.js | packages/staplegun/test/fixtures/good-plugins/threepack/three.js | const R = require('ramda')
export default async () => {
console.log('1...2...3...')
return R.range(1, 4)
// return [1, 2, 3]
}
| const R = require('ramda')
export default async () => {
return R.range(1, 4)
}
| Remove the console log from a fixture. | Remove the console log from a fixture.
| JavaScript | mit | infinitered/gluegun,infinitered/gluegun,infinitered/gluegun | ---
+++
@@ -1,7 +1,5 @@
const R = require('ramda')
export default async () => {
- console.log('1...2...3...')
return R.range(1, 4)
- // return [1, 2, 3]
} |
eef93ee29ecec1f150dc8af0e9277709a39daaed | dotjs.js | dotjs.js | var hostname = location.hostname.replace(/^www\./, '');
var style = document.createElement('link');
style.rel = 'stylesheet';
style.href = chrome.extension.getURL('styles/' + hostname + '.css');
document.documentElement.insertBefore(style);
var defaultStyle = document.createElement('link');
defaultStyle.rel = 'styles... | var hostname = location.hostname.replace(/^www\./, '');
var style = document.createElement('link');
style.rel = 'stylesheet';
style.href = chrome.extension.getURL('styles/' + hostname + '.css');
document.documentElement.appendChild(style);
var defaultStyle = document.createElement('link');
defaultStyle.rel = 'stylesh... | Use appendChild instead of insertBefore for a small perfomance boost | Use appendChild instead of insertBefore for a small perfomance boost
- Fixes #11
| JavaScript | mit | p3lim/dotjs-universal,p3lim/dotjs-universal | ---
+++
@@ -3,17 +3,17 @@
var style = document.createElement('link');
style.rel = 'stylesheet';
style.href = chrome.extension.getURL('styles/' + hostname + '.css');
-document.documentElement.insertBefore(style);
+document.documentElement.appendChild(style);
var defaultStyle = document.createElement('link');
de... |
d0b8c473fa886a208dcdfa4fd8bc97fc4c1b6770 | lib/graph.js | lib/graph.js | import _ from 'lodash';
import {Graph, alg} from 'graphlib';
const dijkstra = alg.dijkstra;
export function setupGraph(relationships) {
let graph = new Graph({
directed: true
});
_.each(relationships, function (relationship) {
graph.setEdge(relationship.from, relationship.to, relationship.method);
});... | import _ from 'lodash';
import {Graph, alg} from 'graphlib';
_.memoize.Cache = WeakMap;
let dijkstra = _.memoize(alg.dijkstra);
export function setupGraph(pairs) {
let graph = new Graph({
directed: true
});
_.each(pairs, ({from, to, method}) => graph.setEdge(from, to, method));
return graph;
}
export fun... | Use ES2015 destructuring and add memoization to dijkstra | Use ES2015 destructuring and add memoization to dijkstra
| JavaScript | mit | siddharthkchatterjee/graph-resolver | ---
+++
@@ -1,15 +1,14 @@
import _ from 'lodash';
import {Graph, alg} from 'graphlib';
-const dijkstra = alg.dijkstra;
+_.memoize.Cache = WeakMap;
+let dijkstra = _.memoize(alg.dijkstra);
-export function setupGraph(relationships) {
+export function setupGraph(pairs) {
let graph = new Graph({
directed: ... |
b20135c356901cd16f8fd94f3ac05af4ab464005 | lib/index.js | lib/index.js | import constant from './constant';
import freeze from './freeze';
import is from './is';
import _if from './if';
import ifElse from './ifElse';
import map from './map';
import omit from './omit';
import reject from './reject';
import update from './update';
import updateIn from './updateIn';
import withDefault from './... | import constant from './constant';
import freeze from './freeze';
import is from './is';
import _if from './if';
import ifElse from './ifElse';
import map from './map';
import omit from './omit';
import reject from './reject';
import update from './update';
import updateIn from './updateIn';
import withDefault from './... | Allow updeep to be require()’d from CommonJS | Allow updeep to be require()’d from CommonJS | JavaScript | mit | substantial/updeep,substantial/updeep | ---
+++
@@ -26,4 +26,4 @@
u.updateIn = updateIn;
u.withDefault = withDefault;
-export default u;
+module.exports = u; |
f3735c9b214ea8bbe2cf3619409952fedb1eb7ac | lib/index.js | lib/index.js | 'use strict';
var path = require('path');
var BinWrapper = require('bin-wrapper');
var pkg = require('../package.json');
var url = 'https://raw.githubusercontent.com/jihchi/giflossy-bin/v' + pkg.version + '/vendor/';
module.exports = new BinWrapper()
.src(url + 'macos/giflossy', 'darwin')
.src(url + 'linux/x86/gifl... | 'use strict';
var path = require('path');
var BinWrapper = require('bin-wrapper');
var pkg = require('../package.json');
var url = 'https://raw.githubusercontent.com/jihchi/giflossy-bin/v' + pkg.version + '/vendor/';
module.exports = new BinWrapper()
.src(url + 'macos/gifsicle', 'darwin')
.src(url + 'linux/x86/gifs... | Rename binary filename to gifsicle | Rename binary filename to gifsicle
| JavaScript | mit | jihchi/giflossy-bin | ---
+++
@@ -6,12 +6,12 @@
var url = 'https://raw.githubusercontent.com/jihchi/giflossy-bin/v' + pkg.version + '/vendor/';
module.exports = new BinWrapper()
- .src(url + 'macos/giflossy', 'darwin')
- .src(url + 'linux/x86/giflossy', 'linux', 'x86')
- .src(url + 'linux/x64/giflossy', 'linux', 'x64')
- .src(url + 'f... |
fec0c1ca4048c3590396cd5609cb3085e6c61bf5 | lib/index.js | lib/index.js | 'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[a-z1-9]+(\s+[a-z]+=["'](.*)["'])*\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(document.data.html === undef... | 'use strict';
var config = require('../config/configuration.js');
function htmlReplace(str) {
return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
}
module.exports = function(path, document, changes, finalCb) {
if(document.data.html === undefined) {
changes.data.html... | Update regexp for HTML strip | Update regexp for HTML strip
| JavaScript | mit | AnyFetch/embedmail-hydrater.anyfetch.com | ---
+++
@@ -3,7 +3,7 @@
var config = require('../config/configuration.js');
function htmlReplace(str) {
- return str.replace(/<\/?[a-z1-9]+(\s+[a-z]+=["'](.*)["'])*\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g, '\n').trim();
+ return str.replace(/<\/?[^>]+\/?>/g, ' ').replace(/ +/g, ' ').replace(/ ?\n ?/g,... |
7ca1d708a9a9c22e596e9c4a64db74115994d54a | koans/AboutExpects.js | koans/AboutExpects.js | describe("About Expects", function() {
//We shall contemplate truth by testing reality, via spec expectations.
it("should expect true", function() {
expect(false).toBeTruthy(); //This should be true
});
//To understand reality, we must compare our expectations against reality.
it("should expect equali... | describe("About Expects", function() {
// We shall contemplate truth by testing reality, via spec expectations.
it("should expect true", function() {
expect(false).toBeTruthy(); // This should be true
});
// To understand reality, we must compare our expectations against reality.
it("should expect equ... | Correct spacing and language in comments | Correct spacing and language in comments
| JavaScript | mit | DhiMalo/javascript-koans,GMatias93/javascript-koans,JosephSun/javascript-koans,existenzial/javascript-koans,GMatias93/javascript-koans,darrylnu/javascript-koans,JosephSun/javascript-koans,DhiMalo/javascript-koans,existenzial/javascript-koans,GMatias93/javascript-koans,darrylnu/javascript-koans,darrylnu/javascript-koans... | ---
+++
@@ -1,11 +1,11 @@
describe("About Expects", function() {
- //We shall contemplate truth by testing reality, via spec expectations.
+ // We shall contemplate truth by testing reality, via spec expectations.
it("should expect true", function() {
- expect(false).toBeTruthy(); //This should be true... |
f6b82baae39560c733160d292dcbcec043b5edb3 | Packages/ohif-viewerbase/client/lib/classes/plugins/OHIFPlugin.js | Packages/ohif-viewerbase/client/lib/classes/plugins/OHIFPlugin.js | export class OHIFPlugin {
// TODO: this class is still under development and will
// likely change in the near future
constructor () {
this.name = "Unnamed plugin";
this.description = "No description available";
}
// load an individual script URL
static loadScript(scriptURL) {
... | export class OHIFPlugin {
// TODO: this class is still under development and will
// likely change in the near future
constructor () {
this.name = "Unnamed plugin";
this.description = "No description available";
}
// load an individual script URL
static loadScript(scriptURL, typ... | Add moduleURLs in addition to scriptURLs | feat(plugins): Add moduleURLs in addition to scriptURLs
| JavaScript | mit | OHIF/Viewers,OHIF/Viewers,OHIF/Viewers | ---
+++
@@ -7,11 +7,11 @@
}
// load an individual script URL
- static loadScript(scriptURL) {
+ static loadScript(scriptURL, type = "text/javascript") {
const script = document.createElement("script");
script.src = scriptURL;
- script.type = "text/javascript";
+ scr... |
6eea14a4d3291b3d6e1088a6cd4eacda056ce56a | tests/dummy/mirage/factories/pledge.js | tests/dummy/mirage/factories/pledge.js | import { Factory, faker } from 'ember-cli-mirage';
export default Factory.extend({
fund: () => faker.random.arrayElement(["WNYC", "WQXR", "Radiolab"]),
orderPrice: () => faker.random.arrayElement([60, 72, 120, 12, 90, 100]),
orderDate: faker.date.past,
orderCode: () => faker.random.arrayElement([1234567,234567... | import { Factory, faker } from 'ember-cli-mirage';
export default Factory.extend({
fund: () => faker.random.arrayElement(["WNYC", "WQXR", "Radiolab", "J.Schwartz"]),
orderPrice: () => faker.random.arrayElement([60, 72, 120, 12, 90, 100]),
orderDate: faker.date.past,
orderCode: () => faker.random.arrayElement([... | Add Jonathan Schwartz as fund in mirage factory | Add Jonathan Schwartz as fund in mirage factory
| JavaScript | mit | nypublicradio/nypr-account-settings,nypublicradio/nypr-account-settings | ---
+++
@@ -1,7 +1,7 @@
import { Factory, faker } from 'ember-cli-mirage';
export default Factory.extend({
- fund: () => faker.random.arrayElement(["WNYC", "WQXR", "Radiolab"]),
+ fund: () => faker.random.arrayElement(["WNYC", "WQXR", "Radiolab", "J.Schwartz"]),
orderPrice: () => faker.random.arrayElement([6... |
c19fc02c3ea90da940bb39a9f59f0c9b06632175 | lib/index.js | lib/index.js | var _ = require('lodash');
var path = require('path');
var exec = require('child_process').exec;
var LOG_TYPES = [
"ERROR", "WARNING"
];
module.exports = function(filepath, options, callback) {
if (!callback) {
callback = options;
options = {};
}
options = _.defaults(options || {}, {
epubcheck: "epubcheck... | var _ = require('lodash');
var path = require('path');
var exec = require('child_process').exec;
var LOG_TYPES = [
"ERROR", "WARNING"
];
module.exports = function(filepath, options, callback) {
if (!callback) {
callback = options;
options = {};
}
options = _.defaults(options || {}, {
epubcheck: "epubcheck... | Handle correctly error from epubcheck | Handle correctly error from epubcheck
| JavaScript | apache-2.0 | GitbookIO/node-epubcheck | ---
+++
@@ -23,7 +23,7 @@
exec(command, function (error, stdout, stderr) {
var output = stderr.toString();
var lines = stderr.split("\n");
- error = null;
+ var err = null;
lines = _.chain(lines)
.map(function(line) {
@@ -34,7 +34,7 @@
var content = parts.slice(1).join(":");
if (type == "e... |
7fbdffa0bb2c82589c2d786f9fa16863780a63db | app/assets/javascripts/download-menu.js | app/assets/javascripts/download-menu.js | function show_download_menu() {
$('#download-menu').slideDown();
setTimeout(hide_download_menu, 20000);
$('#download-link').html('cancel');
}
function hide_download_menu() {
$('#download-menu').slideUp();
$('#download-link').html('download');
}
function toggle_download_menu() {
if ($('#download-link').htm... | function show_download_menu() {
$('#download-menu').slideDown({ duration: 200 });
setTimeout(hide_download_menu, 20000);
$('#download-link').html('cancel');
}
function hide_download_menu() {
$('#download-menu').slideUp({ duration: 200 });
$('#download-link').html('download');
}
function toggle_download_menu... | Speed up the download menu appear/disappear a bit | Speed up the download menu appear/disappear a bit
| JavaScript | agpl-3.0 | BatedUrGonnaDie/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io,glacials/splits-io,BatedUrGonnaDie/splits-io,glacials/splits-io | ---
+++
@@ -1,11 +1,11 @@
function show_download_menu() {
- $('#download-menu').slideDown();
+ $('#download-menu').slideDown({ duration: 200 });
setTimeout(hide_download_menu, 20000);
$('#download-link').html('cancel');
}
function hide_download_menu() {
- $('#download-menu').slideUp();
+ $('#download-m... |
78a75ddd6de442e9e821a1bb09192d17635ff1b6 | config/default.js | config/default.js |
module.exports = {
Urls: {
vault_base_url: '',
base_url: process.env.BASE_URL || process.env.HUBOT_ROOT_URL
},
Strings: {
sorry_dave: 'I\'m sorry %s, I\'m afraid I can\'t do that.'
},
};
|
module.exports = {
Urls: {
vault_base_url: process.env.HUBOT_VAULT_URL,
base_url: process.env.BASE_URL || process.env.HUBOT_ROOT_URL
},
Strings: {
sorry_dave: 'I\'m sorry %s, I\'m afraid I can\'t do that.'
},
};
| Add vault url config environment variable | Add vault url config environment variable
| JavaScript | mit | uWhisp/hubot-db-heimdall,uWhisp/hubot-db-heimdall | ---
+++
@@ -1,7 +1,7 @@
module.exports = {
Urls: {
- vault_base_url: '',
+ vault_base_url: process.env.HUBOT_VAULT_URL,
base_url: process.env.BASE_URL || process.env.HUBOT_ROOT_URL
},
Strings: { |
bd13b83b42ac2e552010f228f20fa7f5e67b896a | lib/utils.js | lib/utils.js | utils = {
startsAtMomentWithOffset: function (game) {
var offset = game.location.utc_offset;
if (! Match.test(offset, UTCOffset)) {
offset: -8; // Default to California
}
// UTC offsets returned by Google Places API,
// which is the source of game.location.utc_offset,
// differ in sign f... | utils = {
startsAtMomentWithOffset: function (game) {
var offset = game.location.utc_offset;
if (! Match.test(offset, UTCOffset)) {
offset = -8; // Default to California
}
// UTC offsets returned by Google Places API,
// which is the source of game.location.utc_offset,
// differ in sign ... | Fix typo in setting default time zone for game | Fix typo in setting default time zone for game
Close #110
| JavaScript | mit | pushpickup/pushpickup,pushpickup/pushpickup,pushpickup/pushpickup | ---
+++
@@ -2,7 +2,7 @@
startsAtMomentWithOffset: function (game) {
var offset = game.location.utc_offset;
if (! Match.test(offset, UTCOffset)) {
- offset: -8; // Default to California
+ offset = -8; // Default to California
}
// UTC offsets returned by Google Places API,
// whic... |
3691387bdf33e6c02899371de63497baea3ab807 | app/routes.js | app/routes.js | // @flow
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from './containers/App';
import VerticalTree from './containers/VerticalTree';
export default (
<Route path="/" component={App}>
<IndexRoute component={VerticalTree} />
</Route>
);
| // @flow
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from './containers/App';
import Menu from './components/Menu';
import VerticalTree from './containers/VerticalTree';
import AVLTree from './containers/AVLTree';
export default (
<Route path="/" component={App}>
<Ind... | Add route for example structures, and home page | Add route for example structures, and home page
| JavaScript | mit | ivtpz/brancher,ivtpz/brancher | ---
+++
@@ -2,11 +2,15 @@
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from './containers/App';
+import Menu from './components/Menu';
import VerticalTree from './containers/VerticalTree';
+import AVLTree from './containers/AVLTree';
export default (
<Route path=... |
2ed2947f05c86d25e47928fa3eedbca0e84b92d8 | LayoutTests/http/tests/notifications/resources/update-event-test.js | LayoutTests/http/tests/notifications/resources/update-event-test.js | if (self.importScripts) {
importScripts('/resources/testharness.js');
importScripts('worker-helpers.js');
}
async_test(function(test) {
if (Notification.permission != 'granted') {
assert_unreached('No permission has been granted for displaying notifications.');
return;
}
var notifi... | if (self.importScripts) {
importScripts('/resources/testharness.js');
importScripts('worker-helpers.js');
}
async_test(function(test) {
if (Notification.permission != 'granted') {
assert_unreached('No permission has been granted for displaying notifications.');
return;
}
// We requ... | Verify in a layout test that replacing a notification closes the old one. | Verify in a layout test that replacing a notification closes the old one.
We do this by listening to the "close" event on the old notification as
well. This test passes with or without the Chrome-sided fix because it's
properly implemented in the LayoutTestNotificationManager, but is a good
way of verifying the fix ma... | JavaScript | bsd-3-clause | Bysmyyr/blink-crosswalk,kurli/blink-crosswalk,smishenk/blink-crosswalk,Bysmyyr/blink-crosswalk,jtg-gg/blink,jtg-gg/blink,kurli/blink-crosswalk,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,modulexcite/blink,Pluto-tv/blink-crosswalk,jtg-gg/blink,nwjs/blink,XiaosongWei/blink-crosswal... | ---
+++
@@ -9,16 +9,23 @@
return;
}
+ // We require two asynchronous events to happen when a notification gets updated, (1)
+ // the old instance should receive the "close" event, and (2) the new notification
+ // should receive the "show" event, but only after (1) has happened.
+ var clos... |
750402603dd7060bec89b98704be75597c6634bd | bin/oust.js | bin/oust.js | #!/usr/bin/env node
var oust = require('../index');
var pkg = require('../package.json');
var fs = require('fs');
var argv = require('minimist')((process.argv.slice(2)))
var printHelp = function() {
console.log('oust');
console.log(pkg.description);
console.log('');
console.log('Usage:');
console.log(' $ oust... | #!/usr/bin/env node
var oust = require('../index');
var pkg = require('../package.json');
var fs = require('fs');
var argv = require('minimist')((process.argv.slice(2)))
var printHelp = function() {
console.log('oust');
console.log(pkg.description);
console.log('');
console.log('Usage:');
console.log(' $ oust ... | Update CLI based on @sindresorhus feedback | Update CLI based on @sindresorhus feedback
* don't use flagged args for file and selector
* exit properly if error opening file
| JavaScript | apache-2.0 | addyosmani/oust,addyosmani/oust,actmd/oust,actmd/oust | ---
+++
@@ -3,7 +3,6 @@
var oust = require('../index');
var pkg = require('../package.json');
var fs = require('fs');
-
var argv = require('minimist')((process.argv.slice(2)))
@@ -12,7 +11,7 @@
console.log(pkg.description);
console.log('');
console.log('Usage:');
- console.log(' $ oust --file <filename... |
fdee590648c6fdad1d6b19ef83bb9ce4b33fb0dc | src/merge-request-schema.js | src/merge-request-schema.js | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
module.exports = new Schema({
merge_request: {
id: Number,
url: String,
target_branch: String,
source_branch: String,
created_at: String,
updated_at: String,
title: String,
description: String,
status: String,
... | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
module.exports = {
name: 'MergeRequest',
schema: new Schema({
merge_request: {
id: Number,
url: String,
target_branch: String,
source_branch: String,
created_at: String,
updated_at: String,
title: St... | Merge request now exports its desired collection name | refactor: Merge request now exports its desired collection name
| JavaScript | mit | NSAppsTeam/nickel-bot | ---
+++
@@ -1,40 +1,43 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
-module.exports = new Schema({
- merge_request: {
- id: Number,
- url: String,
- target_branch: String,
- source_branch: String,
- created_at: String,
- updated_at: String,
- title: String,
- d... |
26aca19bd633c7c876099d39b8d688d51bb7e773 | spec/specs.js | spec/specs.js | describe('pingPongOutput', function() {
it("is the number for most input numbers", function() {
expect(pingPongOutput(2)).to.equal(2);
});
it("is 'ping' for numbers divisible by 3", function() {
expect(pingPongOutput(6)).to.equal("ping");
});
});
| describe('pingPongOutput', function() {
it("is the number for most input numbers", function() {
expect(pingPongOutput(2)).to.equal(2);
});
it("is 'ping' for numbers divisible by 3", function() {
expect(pingPongOutput(6)).to.equal("ping");
});
it("is 'pong' for numbers divisible by 5", function() {
... | Add spec for numbers divisible by 5 | Add spec for numbers divisible by 5
| JavaScript | mit | JeffreyRuder/ping-pong-app,JeffreyRuder/ping-pong-app | ---
+++
@@ -6,4 +6,8 @@
it("is 'ping' for numbers divisible by 3", function() {
expect(pingPongOutput(6)).to.equal("ping");
});
+
+ it("is 'pong' for numbers divisible by 5", function() {
+ expect(pingPongOutput(5)).to.equal("pong");
+ });
}); |
a00605eaf01b7ebe50aea57981b85faa3b406d4a | app/js/arethusa.sg/directives/sg_context_menu_selector.js | app/js/arethusa.sg/directives/sg_context_menu_selector.js | "use strict";
angular.module('arethusa.sg').directive('sgContextMenuSelector', [
'sg',
function(sg) {
return {
restrict: 'A',
scope: {
obj: '='
},
link: function(scope, element, attrs) {
scope.sg = sg;
function ancestorChain(chain) {
arethusaUtil.map(c... | "use strict";
angular.module('arethusa.sg').directive('sgContextMenuSelector', [
'sg',
function(sg) {
return {
restrict: 'A',
scope: {
obj: '='
},
link: function(scope, element, attrs) {
scope.sg = sg;
function ancestorChain(chain) {
return arethusaUti... | Fix typo in sg context menu selector | Fix typo in sg context menu selector
| JavaScript | mit | fbaumgardt/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,fbaumgardt/arethusa,Masoumeh/arethusa,Masoumeh/arethusa,PonteIneptique/arethusa,latin-language-toolkit/arethusa,PonteIneptique/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa | ---
+++
@@ -12,7 +12,7 @@
scope.sg = sg;
function ancestorChain(chain) {
- arethusaUtil.map(chain, function(el) {
+ return arethusaUtil.map(chain, function(el) {
return el.short;
}).join(' > ');
} |
da15d3de4dca28bb7ade0818b8dc0b97967c067d | lib/widgets/KeyBar.js | lib/widgets/KeyBar.js | 'use strict';
const CLI = require('clui');
const clc = require('cli-color');
const gauge = CLI.Gauge;
const Line = CLI.Line;
module.exports = function (tactile, max) {
if (!tactile) {
return new Line();
}
let name = tactile.label;
if (tactile.name) {
name += ` (${tactile.name.toUpperCase()})`;
}
return new L... | 'use strict';
const CLI = require('clui');
const clc = require('cli-color');
const gauge = CLI.Gauge;
const Line = CLI.Line;
module.exports = function (tactile, maxIdLength, max) {
if (!tactile) {
return new Line();
}
let id = Array(maxIdLength - tactile.id.toString().length).join(0) + tactile.id.toString();
let... | Add tactile id to output | Add tactile id to output | JavaScript | mit | ProbablePrime/interactive-keyboard,ProbablePrime/beam-keyboard | ---
+++
@@ -4,16 +4,18 @@
const gauge = CLI.Gauge;
const Line = CLI.Line;
-module.exports = function (tactile, max) {
+module.exports = function (tactile, maxIdLength, max) {
if (!tactile) {
return new Line();
}
+ let id = Array(maxIdLength - tactile.id.toString().length).join(0) + tactile.id.toString();
... |
3cd107a985bcfd81b79633f06d3c21fe641f68c5 | app/js/services.js | app/js/services.js | 'use strict';
/* Services */
var splitcoinServices = angular.module('splitcoin.services', ['ngResource']);
// Demonstrate how to register services
// In this case it is a simple value service.
splitcoinServices.factory('Ticker', ['$resource',
function($resource){
return $resource('/sampledata/ticker.json... | 'use strict';
/* Services */
var splitcoinServices = angular.module('splitcoin.services', ['ngResource']);
// Demonstrate how to register services
// In this case it is a simple value service.
splitcoinServices.factory('Ticker', ['$resource',
function($resource){
// For real data use: http://blockchain.i... | Add comment about real data | Add comment about real data
| JavaScript | mit | kpeatt/splitcoin,kpeatt/splitcoin,kpeatt/splitcoin | ---
+++
@@ -8,6 +8,7 @@
// In this case it is a simple value service.
splitcoinServices.factory('Ticker', ['$resource',
function($resource){
+ // For real data use: http://blockchain.info/ticker
return $resource('/sampledata/ticker.json', {}, {
query: {method:'GET'}
}); |
e324b674c13a39b54141acaa0ab31ebc66177eb2 | app/assets/javascripts/umlaut/expand_contract_toggle.js | app/assets/javascripts/umlaut/expand_contract_toggle.js | /* expand_contract_toggle.js: Support for show more/hide more in lists of umlaut content.
The JS needs to swap out the image for expand/contract toggle. AND we need
the URL it swaps in to be an ABSOLUTE url when we're using partial html
widget.
So we swap in a non-fingerprinted URL, even if the ori... | /* expand_contract_toggle.js: Support for show more/hide more in lists of umlaut content.
The JS needs to swap out the image for expand/contract toggle. AND we need
the URL it swaps in to be an ABSOLUTE url when we're using partial html
widget.
So we swap in a non-fingerprinted URL, even if the ori... | Add JS hack cuz Bootstrap don't work right with collapsible. | Add JS hack cuz Bootstrap don't work right with collapsible.
| JavaScript | mit | team-umlaut/umlaut,team-umlaut/umlaut,team-umlaut/umlaut | ---
+++
@@ -9,20 +9,26 @@
*/
jQuery(document).ready(function($) {
$(".collapse-toggle").live("click", function(event) {
+ event.preventDefault();
$(this).collapse('toggle');
- event.preventDefault();
return false;
});
$(".collapse").live("shown", function(event) {
- // Update the icon
- ... |
e23a40064468c27be76dbb27efd4e4f2ac91ece5 | app/js/arethusa.core/directives/arethusa_grid_handle.js | app/js/arethusa.core/directives/arethusa_grid_handle.js | "use strict";
angular.module('arethusa.core').directive('arethusaGridHandle', [
function() {
return {
restrict: 'E',
scope: true,
link: function(scope, element, attrs, ctrl, transclude) {
},
templateUrl: 'templates/arethusa.core/arethusa_grid_handle.html'
};
}
]);
| "use strict";
angular.module('arethusa.core').directive('arethusaGridHandle', [
function() {
return {
restrict: 'E',
scope: true,
link: function(scope, element, attrs, ctrl, transclude) {
function mouseEnter() {
scope.$apply(function() { scope.visible = true; });
}
... | Fix mouse events in arethusaGridHandle | Fix mouse events in arethusaGridHandle
| JavaScript | mit | PonteIneptique/arethusa,Masoumeh/arethusa,Masoumeh/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,PonteIneptique/arethusa,fbaumgardt/arethusa,latin-language-toolkit/arethusa | ---
+++
@@ -6,7 +6,19 @@
restrict: 'E',
scope: true,
link: function(scope, element, attrs, ctrl, transclude) {
+ function mouseEnter() {
+ scope.$apply(function() { scope.visible = true; });
+ }
+ function mouseLeave(event) {
+ scope.$apply(function() { sc... |
21b22e766902e94c60f6a257bde1dae9b7a16975 | index.js | index.js | const yaml = require('js-yaml');
const ignore = require('ignore');
module.exports = robot => {
robot.on('pull_request.opened', autolabel);
robot.on('pull_request.synchronize', autolabel);
async function autolabel(context) {
const content = await context.github.repos.getContent(context.repo({
path: '.g... | const yaml = require('js-yaml');
const ignore = require('ignore');
module.exports = robot => {
robot.on('pull_request.opened', autolabel);
robot.on('pull_request.synchronize', autolabel);
async function autolabel(context) {
const content = await context.github.repos.getContent(context.repo({
path: '.g... | Use yaml safeLoad instead of load | Use yaml safeLoad instead of load | JavaScript | isc | SymbiFlow/autolabeler | ---
+++
@@ -9,7 +9,7 @@
const content = await context.github.repos.getContent(context.repo({
path: '.github/autolabeler.yml'
}));
- const config = yaml.load(Buffer.from(content.data.content, 'base64').toString());
+ const config = yaml.safeLoad(Buffer.from(content.data.content, 'base64').toStri... |
5e579bd846f2fd223688dbfeca19b8a9a9f98295 | src/config.js | src/config.js | import dotenv from "dotenv";
import moment from "moment";
dotenv.load();
export const MONGODB_URL = process.env.MONGODB_URL || "mongodb://localhost:27017/test";
export const KINESIS_STREAM_NAME = process.env.KINESIS_STREAM_NAME || "test";
export const AGGREGATES_COLLECTION_NAME = process.env.AGGREGATES_COLLECTION_NAM... | import dotenv from "dotenv";
import moment from "moment";
dotenv.load();
export const MONGODB_URL = process.env.MONGODB_URL || "mongodb://localhost:27017/test";
export const KINESIS_STREAM_NAME = process.env.KINESIS_STREAM_NAME || "test";
export const AGGREGATES_COLLECTION_NAME = process.env.AGGREGATES_COLLECTION_NAM... | Add reference to allowed sources | Add reference to allowed sources
| JavaScript | apache-2.0 | innowatio/iwwa-lambda-virtual-aggregator,innowatio/iwwa-lambda-virtual-aggregator | ---
+++
@@ -8,7 +8,7 @@
export const AGGREGATES_COLLECTION_NAME = process.env.AGGREGATES_COLLECTION_NAME || "readings-daily-aggregates";
export const LOG_LEVEL = process.env.LOG_LEVEL || "info";
-export const ALLOWED_SOURCES = ["reading", "forecast"];
+export const ALLOWED_SOURCES = ["reading", "forecast", "refer... |
eaf923a11d75bbdb5373cd4629d31e4a38c5a659 | js/rapido.utilities.js | js/rapido.utilities.js | (function($, window, document, undefined) {
$.rapido_Utilities = {
// Get class of element object
getClass: function(el) {
el = $(el).attr('class').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
return '.' + el.split(' ').join('.');
},
// Remove dot from class
dotlessClass: function(s... | (function($, window, document, undefined) {
$.rapido_Utilities = {
// Get class of element object
getClass: function(el) {
var attr = $(el).attr('class');
if (typeof attr !== 'undefined' && attr !== false) {
el = $(el).attr('class').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
re... | Fix error in IE8 "attr(...)' is null or not an object" | Fix error in IE8 "attr(...)' is null or not an object"
| JavaScript | mit | raffone/rapido,raffone/rapido,raffone/rapido | ---
+++
@@ -4,8 +4,11 @@
// Get class of element object
getClass: function(el) {
- el = $(el).attr('class').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- return '.' + el.split(' ').join('.');
+ var attr = $(el).attr('class');
+ if (typeof attr !== 'undefined' && attr !== false) {
+ ... |
018018062b1a4f127d4861707ec9c438248a8dab | index.js | index.js | "use strict";
var glob = require("glob");
var path = require("path");
module.exports = function (content, sourceMap) {
this.cacheable && this.cacheable();
var resourceDir = path.dirname(this.resourcePath);
var pattern = content.trim();
var files = glob.sync(pattern, {
cwd: resourceDir,
realpath: true
... | "use strict";
var glob = require("glob");
var path = require("path");
module.exports = function (content, sourceMap) {
var resourceDir = path.dirname(this.resourcePath);
var pattern = content.trim();
var files = glob.sync(pattern, {
cwd: resourceDir,
realpath: true
});
if (!files.length) {
this... | Revert "feat: make results cacheable" | Revert "feat: make results cacheable"
This reverts commit 43ac8eee4f33ac43c97ed6831a3660b1387148cb.
| JavaScript | mit | seanchas116/glob-loader | ---
+++
@@ -4,7 +4,6 @@
var path = require("path");
module.exports = function (content, sourceMap) {
- this.cacheable && this.cacheable();
var resourceDir = path.dirname(this.resourcePath);
var pattern = content.trim();
var files = glob.sync(pattern, { |
f2ac02fcd69265f4e045883f5b033a91dd4e406d | index.js | index.js | var fs = require('fs'),
path = require('path')
module.exports = function (target) {
var directory = path.dirname(module.parent.filename),
rootDirectory = locatePackageJson(directory)
return requireFromRoot(target, rootDirectory)
}
function locatePackageJson(directory) {
try {
fs.readFileSync(path... | "use strict";
// Node
var lstatSync = require("fs").lstatSync;
var path = require("path");
/**
* Attempts to find the project root by finding the nearest package.json file.
* @private
* @param {String} currentPath - Path of the file doing the including.
* @return {String?}
*/
function findProjectRoot(currentPath... | Fix relative path being relative to install location and not requesting file | Fix relative path being relative to install location and not requesting file
Fixes #2.
| JavaScript | mit | anthonynichols/node-include | ---
+++
@@ -1,29 +1,52 @@
-var fs = require('fs'),
- path = require('path')
+"use strict";
-module.exports = function (target) {
- var directory = path.dirname(module.parent.filename),
- rootDirectory = locatePackageJson(directory)
+// Node
+var lstatSync = require("fs").lstatSync;
+var path = require("pat... |
78da26a359947988dbcacd635600909764b410a3 | src/UCP/AbsenceBundle/Resources/public/js/app/views/planningview.js | src/UCP/AbsenceBundle/Resources/public/js/app/views/planningview.js | App.Views.PlanningView = Backbone.View.extend({
className: 'planning',
initialize: function() {
this.lessons = this.collection;
this.lessons.on('add change remove reset', this.render, this);
},
render: function() {
var lessons = this.lessons.toArray();
// Build day vie... | App.Views.PlanningView = Backbone.View.extend({
className: 'planning',
initialize: function() {
this.lessons = this.collection;
this.lessons.on('add change remove reset', this.render, this);
},
render: function() {
var lessons = this.lessons.toArray();
// Build day vie... | Fix planning page on Safari | Fix planning page on Safari
new Date("…") cannot parse ISO8601 with a timezone on certain non-fully
ES5 compliant browsers
| JavaScript | mit | mdarse/take-the-register,mdarse/take-the-register | ---
+++
@@ -30,7 +30,7 @@
lessonBag = []; // Temporary array holding holding lessons between each iterator call
_.each(lessons, function(lesson) {
- lessonDate = new Date(lesson.get('start'));
+ lessonDate = moment(lesson.get('start')).toDate();
lessonDate.se... |
e32792f7b23aa899a083f0618d1b093f93101e9f | src/errors.js | src/errors.js | export function ValidationError(message, details = {}) {
const {
columns = {},
value = null
} = details;
this.message = message;
this.columns = columns;
this.value = value;
if (message instanceof Error) {
this.message = message.message;
this.stack = message.stac... | export function ValidationError(message, details = {}) {
const {
columns = {},
value = null
} = details;
this.message = message;
this.columns = columns;
this.value = value;
if (message instanceof Error) {
this.message = message.message;
this.stack = message.stac... | Define 'name' on the prototype instead of constructor | Define 'name' on the prototype instead of constructor
| JavaScript | mit | goodybag/nagoya | ---
+++
@@ -20,6 +20,6 @@
ValidationError.prototype.constructor = ValidationError;
ValidationError.prototype.toString = Error.prototype.toString;
-Object.defineProperty(ValidationError, 'name', {
+Object.defineProperty(ValidationError.prototype, 'name', {
value: 'ValidationError'
}); |
a4b63fa20875feef9f7e5e940b5873dd8fb2c082 | index.js | index.js | 'use strict';
const choo = require('choo');
const html = require('choo/html');
const app = choo();
app.model({
state: {
todos: [],
},
reducers: {
addTodo: (state, data) => {
const newTodos = state.todos.slice();
newTodos.push(data);
return {
todos: newTodos,
};
},
},... | 'use strict';
const extend = require('xtend');
const choo = require('choo');
const html = require('choo/html');
const app = choo();
app.model({
state: {
todos: [],
},
reducers: {
addTodo: (state, data) => {
const todo = extend(data, {
completed: false,
});
const newTodos = sta... | Use `xtend` to add a property to tasks, add view to show state | Use `xtend` to add a property to tasks, add view to show state
State is not being saved anywhere.
| JavaScript | mit | fernandocanizo/choodo | ---
+++
@@ -1,5 +1,6 @@
'use strict';
+const extend = require('xtend');
const choo = require('choo');
const html = require('choo/html');
const app = choo();
@@ -11,6 +12,9 @@
},
reducers: {
addTodo: (state, data) => {
+ const todo = extend(data, {
+ completed: false,
+ });
con... |
e16f18fadb94f7eee4b71db653e65f4bbe4ab396 | index.js | index.js | 'use strict';
var eco = require('eco');
exports.name = 'eco';
exports.outputFormat = 'xml';
exports.compile = eco;
| 'use strict';
var eco = require('eco');
exports.name = 'eco';
exports.outputFormat = 'html';
exports.compile = eco;
| Fix to use `html` outputFormat | Fix to use `html` outputFormat | JavaScript | mit | jstransformers/jstransformer-eco,jstransformers/jstransformer-eco | ---
+++
@@ -3,5 +3,5 @@
var eco = require('eco');
exports.name = 'eco';
-exports.outputFormat = 'xml';
+exports.outputFormat = 'html';
exports.compile = eco; |
3908e9c9fea87ec27ab8ce3434f14f0d50618e11 | src/js/app.js | src/js/app.js | 'use strict';
/**
* @ngdoc Main App module
* @name app
* @description Main entry point of the application
*
*/
angular.module('app', [
'ui.router', 'ui.bootstrap',
'app.environment',
'module.core'
]).config(function($urlRouterProvider, ENV) {
$urlRouterProvider.otherwise('/app');
}).run(function() {});
| 'use strict';
/**
* @ngdoc Main App module
* @name app
* @description Main entry point of the application
*
*/
angular.module('app', [
'ui.router', 'ui.bootstrap',
'app.environment',
'module.core'
]).config(function($urlRouterProvider, ENV) {
$urlRouterProvider.otherwise('/page/home');
}).run(function() {... | Change default route to pages/home | Change default route to pages/home
| JavaScript | mit | genu/simple-frontend-boilerplate,genu/simple-angular-boilerplate,genu/simple-frontend-boilerplate,genu/simple-angular-boilerplate | ---
+++
@@ -11,5 +11,5 @@
'app.environment',
'module.core'
]).config(function($urlRouterProvider, ENV) {
- $urlRouterProvider.otherwise('/app');
+ $urlRouterProvider.otherwise('/page/home');
}).run(function() {}); |
951adf61d874553956ac63d2268629d7b2a603ec | core/imagefile.js | core/imagefile.js | function ImageFile(_game) {
this.game = _game;
this.name = new Array();
this.data = new Array();
this.counter = 0;
return this;
};
ImageFile.prototype.load = function(_imageSrc, _width, _height) {
if(!this.getImageDataByName(_imageSrc)) {
var self = this;
var _image = new Image();
_image.sr... | function ImageFile(_game) {
this.game = _game;
this.name = new Array();
this.data = new Array();
this.counter = 0;
return this;
};
ImageFile.prototype.load = function(_imageSrc, _width, _height) {
if(!this.getImageDataByName(_imageSrc)) {
var self = this;
var _image = new Image();
_image.sr... | Create loadMap function to load map images | Create loadMap function to load map images
| JavaScript | mit | fjsantosb/Molecule | ---
+++
@@ -23,6 +23,19 @@
return s;
};
+
+ImageFile.prototype.loadMap = function(_imageSrc, _width, _height) {
+ if(!this.getImageDataByName(_imageSrc)) {
+ var self = this;
+ var _image = new Image();
+ _image.src = _imageSrc;
+ _image.addEventListener('load', function(){self.counter++});
+ this.name.pus... |
9f71330ad43cb188feef6a6c6053ae9f6dd731f5 | index.js | index.js | var babelPresetEs2015,
commonJsPlugin,
es2015PluginList,
es2015WebpackPluginList;
babelPresetEs2015 = require('babel-preset-es2015');
try {
// npm ^2
commonJsPlugin = require('babel-preset-es2015/node_modules/babel-plugin-transform-es2015-modules-commonjs');
} catch (error) {
}
if (!commonJsPlug... | var babelPresetEs2015,
commonJsPlugin,
es2015PluginList,
es2015WebpackPluginList;
babelPresetEs2015 = require('babel-preset-es2015');
try {
// npm ^3
commonJsPlugin = require('babel-plugin-transform-es2015-modules-commonjs');
} catch (error) {
}
if (!commonJsPlugin) {
try {
// npm ^2... | Fix module resolution for npm 3+ | Fix module resolution for npm 3+
| JavaScript | bsd-3-clause | gajus/babel-preset-es2015-webpack | ---
+++
@@ -6,16 +6,16 @@
babelPresetEs2015 = require('babel-preset-es2015');
try {
- // npm ^2
- commonJsPlugin = require('babel-preset-es2015/node_modules/babel-plugin-transform-es2015-modules-commonjs');
+ // npm ^3
+ commonJsPlugin = require('babel-plugin-transform-es2015-modules-commonjs');
} ca... |
8929cc57fe95f1802a7676250ed489562f76c8db | index.js | index.js | /* jshint node: true */
'use strict';
var request = require('request');
var BasePlugin = require('ember-cli-deploy-plugin');
module.exports = {
name: 'ember-cli-deploy-cdnify-purge-cache',
createDeployPlugin: function(options) {
var DeployPlugin = BasePlugin.extend({
name: options.name,
requiredCo... | /* jshint node: true */
'use strict';
var request = require('request');
var BasePlugin = require('ember-cli-deploy-plugin');
module.exports = {
name: 'ember-cli-deploy-cdnify-purge-cache',
createDeployPlugin: function(options) {
var DeployPlugin = BasePlugin.extend({
name: options.name,
requiredCo... | Remove let until upstream Ember-CLI issue is fixed | Remove let until upstream Ember-CLI issue is fixed
| JavaScript | mit | fauxton/ember-cli-deploy-cdnify-purge-cache,fauxton/ember-cli-deploy-cdnify-purge-cache | ---
+++
@@ -12,12 +12,12 @@
requiredConfig: ['cdnifyResourceId', 'cdnifyApiKey'],
didDeploy: function(context) {
- let config = context.config['cdnify-purge-cache']
- let apiKey = config['cdnifyApiKey'];
- let resourceId = config['cdnifyResourceId'];
+ var config = context.... |
fbed9d4aac28c0ef9d5070b31aeec9de09009e26 | index.js | index.js | var url = require('url')
module.exports = function(uri, cb) {
var parsed
try {
parsed = url.parse(uri)
}
catch (err) {
return cb(err)
}
if (!parsed.host) {
return cb(new Error('Invalid url: ' + uri))
}
var opts = {
host: parsed.host
, port: parsed.port
, path: parsed.path
, meth... | var request = require('request')
module.exports = function(options, cb) {
if ('string' === typeof options) {
options = {
uri: options
}
}
options = options || {}
options.method = 'HEAD'
options.followAllRedirects = true
request(options, function(err, res, body) {
if (err) return cb(err)... | Use request and allow passing object | Use request and allow passing object
| JavaScript | mit | evanlucas/remote-file-size | ---
+++
@@ -1,38 +1,31 @@
-var url = require('url')
+var request = require('request')
-module.exports = function(uri, cb) {
- var parsed
- try {
- parsed = url.parse(uri)
+module.exports = function(options, cb) {
+ if ('string' === typeof options) {
+ options = {
+ uri: options
+ }
}
- catch (e... |
05e85127b8a0180651c0d5eba9116106fbc40ce9 | index.js | index.js | /* eslint-env node */
'use strict';
module.exports = {
name: 'ember-cli-flagpole',
flagpoleConfigPath: 'config/flagpole',
init() {
this._super.init && this._super.init.apply(this, arguments);
const Registry = require('./lib/-registry');
this._flagRegistry = new Registry();
this.flag = require... | /* eslint-env node */
'use strict';
const DEFAULT_CFG_PATH = 'config/flagpole';
const DEFAULT_CFG_PROPERTY = 'featureFlags';
module.exports = {
name: 'ember-cli-flagpole',
isDevelopingAddon() { return true; },
flagpoleConfigPath: DEFAULT_CFG_PATH,
flagpolePropertyName: DEFAULT_CFG_PROPERTY,
init() {
t... | Allow configuration of property name and config path in app *build options* (ember-cli-build.js) | Allow configuration of property name and config path in app *build options* (ember-cli-build.js)
| JavaScript | mit | camhux/ember-cli-flagpole,camhux/ember-cli-flagpole,camhux/ember-cli-flagpole | ---
+++
@@ -1,10 +1,15 @@
/* eslint-env node */
'use strict';
+const DEFAULT_CFG_PATH = 'config/flagpole';
+const DEFAULT_CFG_PROPERTY = 'featureFlags';
+
module.exports = {
name: 'ember-cli-flagpole',
+ isDevelopingAddon() { return true; },
- flagpoleConfigPath: 'config/flagpole',
+ flagpoleConfigPath: ... |
7920bd541507d35990f146aa45168a4b2f4331be | index.js | index.js | "use strict"
const examine = require("./lib/examine")
const inspect = require("./lib/inspect")
const isPlainObject = require("./lib/is-plain-object")
const whereAll = require("./lib/where-all")
module.exports = { examine, inspect, isPlainObject, whereAll }
| "use strict"
const { examine, see } = require("./lib/examine")
const inspect = require("./lib/inspect")
const isPlainObject = require("./lib/is-plain-object")
const whereAll = require("./lib/where-all")
module.exports = { examine, inspect, isPlainObject, see, whereAll }
| Include the missing `see` function | Include the missing `see` function
| JavaScript | mit | icylace/icylace-object-utils | ---
+++
@@ -1,8 +1,8 @@
"use strict"
-const examine = require("./lib/examine")
+const { examine, see } = require("./lib/examine")
const inspect = require("./lib/inspect")
const isPlainObject = require("./lib/is-plain-object")
const whereAll = require("./lib/where-all")
-module.exports = { examine, inspect, is... |
0ed42a900e206c2cd78fdf6b5f6578254394f3e2 | src/sprites/Common/index.js | src/sprites/Common/index.js | import Phaser from 'phaser';
export default class extends Phaser.Sprite {
constructor(game, x, y, sprite, frame) {
super(game, x, y, sprite, frame);
this.anchor.setTo(0.5, 0.5);
}
}
| import Phaser from 'phaser';
import { alignToGrid } from '../../tiles';
export default class extends Phaser.Sprite {
constructor(game, x, y, sprite, frame) {
const alignedCoords = alignToGrid({ x, y });
x = alignedCoords.x;
y = alignedCoords.y;
super(game, x, y, sprite, frame);
this.anchor.se... | Align to grid before placing object | Align to grid before placing object
| JavaScript | mit | ThomasMays/incremental-forest,ThomasMays/incremental-forest | ---
+++
@@ -1,7 +1,14 @@
import Phaser from 'phaser';
+
+import { alignToGrid } from '../../tiles';
export default class extends Phaser.Sprite {
constructor(game, x, y, sprite, frame) {
+ const alignedCoords = alignToGrid({ x, y });
+
+ x = alignedCoords.x;
+ y = alignedCoords.y;
+
super(game, x,... |
ae1ac92b8884f41656eda30a0949fec0eceb2428 | server/services/passport.js | server/services/passport.js | const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy;
const keys = require('../config/keys');
const mongoose = require('mongoose');
const User = mongoose.model('users'); // retrieve this collection
// Tell passport to use google oauth for authentication
passport.use(... | const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy;
const keys = require('../config/keys');
const mongoose = require('mongoose');
const User = mongoose.model('users'); // retrieve this collection
// Tell passport to use google oauth for authentication
passport.use(... | Add serialization and deserlization for User | Add serialization and deserlization for User
Serialization step: get the user.id as a cookie value and send it back to the client for later user.
Deserialization: client sends make a request with cookie value that can be turned into an actual user instance. | JavaScript | mit | chhaymenghong/FullStackReact | ---
+++
@@ -30,3 +30,20 @@
});
} )
);
+
+// Once we get the user instance from the db ( this happens after the authentication process above finishes )
+// We ask passport to use user.id ( not googleId ), created by MongoDb, to send this info to the client
+// by setting it in the cookie, so... |
4bfa64cf19896baf36af8a21f022771252700c27 | ui/app/common/components/pnc-temporary-build-record-label/pncTemporaryBuildRecordLabel.js | ui/app/common/components/pnc-temporary-build-record-label/pncTemporaryBuildRecordLabel.js | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014-2018 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the ... | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014-2018 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the ... | Fix temporary build label init process | Fix temporary build label init process
| JavaScript | apache-2.0 | thescouser89/pnc,jdcasey/pnc,matedo1/pnc,matedo1/pnc,alexcreasy/pnc,alexcreasy/pnc,jdcasey/pnc,rnc/pnc,matejonnet/pnc,alexcreasy/pnc,matedo1/pnc,pkocandr/pnc,jdcasey/pnc,project-ncl/pnc | ---
+++
@@ -38,13 +38,12 @@
function Controller() {
var $ctrl = this;
- var buildRecord = $ctrl.buildRecord ? $ctrl.buildRecord : $ctrl.buildGroupRecord;
+ var buildRecord;
- // -- Controller API --
-
- $ctrl.isTemporary = isTemporary;
-
- // --------------------
+ $ctrl.$onInit = functi... |
e39eb6b1f2c4841ddc293428ab0c358214e897ad | src/colors.js | src/colors.js | const colors = {
red: '#e42d40',
white: '#ffffff',
veryLightGray: '#ededed',
lightGray: '#cccccc',
gray: '#888888',
darkGray: '#575757'
}
const brandPreferences = {
primary: colors.red,
bg: colors.white,
outline: colors.lightGray,
placeholder: colors.veryLightGray,
userInput: colors.darkGray
}
... | const colors = {
red: '#e42d40',
white: '#ffffff',
veryLightGray: '#ededed',
lightGray: '#cccccc',
gray: '#888888',
darkGray: '#575757'
}
const brandPreferences = {
primary: colors.red,
bg: colors.white,
outline: colors.lightGray,
placeholder: colors.veryLightGray,
userInput: colors.darkGray
}
... | Use spread syntax instead of Object.assign | Use spread syntax instead of Object.assign
| JavaScript | mit | hackclub/api,hackclub/api,hackclub/api | ---
+++
@@ -16,4 +16,7 @@
userInput: colors.darkGray
}
-export default Object.assign({}, colors, brandPreferences)
+export default {
+ ...colors,
+ ...brandPreferences
+} |
edd75a3c15c81feb05d51736af6dd605bb10a72f | src/routes.js | src/routes.js | import React from 'react';
import {IndexRoute, Route} from 'react-router';
import { isLoaded as isAuthLoaded, load as loadAuth } from 'redux/modules/auth';
import {
App,
Chat,
Home,
Widgets,
About,
Login,
LoginSuccess,
Survey,
NotFound,
} from 'containers';
export default (store) ... | import React from 'react';
import {IndexRoute, Route} from 'react-router';
import { isLoaded as isAuthLoaded, load as loadAuth } from 'redux/modules/auth';
import {
App,
Chat,
Home,
Widgets,
About,
Login,
LoginSuccess,
Survey,
NotFound,
} from 'containers';
export default (store) ... | Use alphabetical route order for easier merging | Use alphabetical route order for easier merging
| JavaScript | mit | ames89/keystone-react-redux,sunh11373/t648,ptim/react-redux-universal-hot-example,andyshora/memory-tools,huangc28/palestine-2,quicksnap/react-redux-universal-hot-example,melodylu/react-redux-universal-hot-example,moje-skoly/web-app,AndriyShepitsen/svredux,dieface/react-redux-universal-hot-example,ThatCheck/AutoLib,dumb... | ---
+++
@@ -31,17 +31,27 @@
}
};
+ /**
+ * Please keep routes in alphabetical order
+ */
return (
<Route path="/" component={App}>
+ { /* Home (main) route */ }
<IndexRoute component={Home}/>
- <Route path="widgets" component={Widgets}/>
- <Route path="about" component={Ab... |
3dfaa509dcae64b13f8b68c74fb6085e18c1ccc2 | src/app/auth/auth.service.js | src/app/auth/auth.service.js | (function() {
'use strict';
var app = angular.module('radar.auth');
app.factory('authService', function(session, $q, store, adapter) {
return {
login: login
};
function login(username, password) {
var deferred = $q.defer();
adapter.post('/login', {}, {username: username, password... | (function() {
'use strict';
var app = angular.module('radar.auth');
app.factory('authService', function(session, $q, store, adapter) {
return {
login: login
};
function login(username, password) {
var deferred = $q.defer();
adapter.post('/login', {}, {username: username, password... | Add pagination support to API | Add pagination support to API
| JavaScript | agpl-3.0 | renalreg/radar-client,renalreg/radar-client,renalreg/radar-client | ---
+++
@@ -11,25 +11,29 @@
function login(username, password) {
var deferred = $q.defer();
- adapter.post('/login', {}, {username: username, password: password}).then(function(response) {
- var userId = response.data.userId;
- var token = response.data.token;
+ adapter.post('/lo... |
ad4f2512ab1e42bf19b877c04eddd831cf747fb0 | models/collections.js | models/collections.js | var TreeModel = require('tree-model');
module.exports = function(DataTypes) {
return [{
name: {
type: DataTypes.STRING,
allowNull: false
}
}, {
instanceMethods: {
insertIntoDirs: function(UUID, parentUUID) {
var tree = new TreeModel();
var dirs = tree.parse(JSON.parse(... | var TreeModel = require('tree-model');
module.exports = function(DataTypes) {
return [{
name: {
type: DataTypes.STRING,
allowNull: false
}
}];
};
| Remove unnecessary instance methods of collection | Remove unnecessary instance methods of collection
| JavaScript | mit | wikilab/wikilab-api | ---
+++
@@ -6,24 +6,5 @@
type: DataTypes.STRING,
allowNull: false
}
- }, {
- instanceMethods: {
- insertIntoDirs: function(UUID, parentUUID) {
- var tree = new TreeModel();
- var dirs = tree.parse(JSON.parse(this.dirs));
- var parent;
- if (parentUUID) {
- ... |
f0dc23100b7563c60f62dad82a4aaf364a69c2cb | test/index.js | test/index.js | // require Johnny's static
var JohhnysStatic = require("../index")
// require http
, http = require('http');
// set static server: public folder
JohhnysStatic.setStaticServer({root: "./public"});
// set routes
JohhnysStatic.setRoutes({
"/": { "url": __dirname + "/html/index.html" }
, "/test1/": { "... | // require Johnny's static
var JohhnysStatic = require("../index")
// require http
, http = require('http');
// set static server: public folder
JohhnysStatic.setStaticServer({root: __dirname + "/public"});
// set routes
JohhnysStatic.setRoutes({
"/": { "url": "/html/index.html" }
, "/test1/": { "u... | Use __dirname when setting the root | Use __dirname when setting the root
| JavaScript | mit | IonicaBizauTrash/johnnys-node-static,IonicaBizau/statique,IonicaBizauTrash/johnnys-node-static,IonicaBizau/node-statique,IonicaBizau/johnnys-node-static,IonicaBizau/johnnys-node-static | ---
+++
@@ -5,13 +5,13 @@
, http = require('http');
// set static server: public folder
-JohhnysStatic.setStaticServer({root: "./public"});
+JohhnysStatic.setStaticServer({root: __dirname + "/public"});
// set routes
JohhnysStatic.setRoutes({
- "/": { "url": __dirname + "/html/index.html" }
- , "/... |
d01325010342043712e1680d4fb577eaa4df3634 | test/index.js | test/index.js | 'use strict';
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const sass = require('../');
const root = path.resolve(__dirname, './test-cases');
const cases = fs.readdirSync(root);
cases.forEach((test) => {
let hasPackageJson;
try {
hasPackageJson = require(path.... | 'use strict';
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const sass = require('../');
const css = require('css');
const root = path.resolve(__dirname, './test-cases');
const cases = fs.readdirSync(root);
cases.forEach((test) => {
let hasPackageJson;
try {
ha... | Check output is valid css in test cases | Check output is valid css in test cases
| JavaScript | mit | GeorgeTaveras1231/npm-sass,lennym/npm-sass | ---
+++
@@ -4,6 +4,7 @@
const path = require('path');
const cp = require('child_process');
const sass = require('../');
+const css = require('css');
const root = path.resolve(__dirname, './test-cases');
const cases = fs.readdirSync(root);
@@ -28,6 +29,7 @@
it('can compile from code without error', (done... |
98943dcae31dbee0ad3e7a4b2b568128a3d20524 | app/controllers/DefaultController.js | app/controllers/DefaultController.js | import AppController from './AppController'
export default class DefaultController extends AppController {
async indexAction(context) {
return context.redirectToRoute('hello', {name: 'Christoph', foo: 'bar'})
}
}
| import AppController from './AppController'
export default class DefaultController extends AppController {
async indexAction(context) {
return context.redirectToRoute('hello', {name: 'Christoph', foo: 'bar'})
}
async missingRouteAction(context) {
return context.redirectToRoute('foobarbazboo')
}
}
| Add an action that redirects to a missing route | Add an action that redirects to a missing route
| JavaScript | mit | CHH/learning-node,CHH/learning-node | ---
+++
@@ -4,4 +4,8 @@
async indexAction(context) {
return context.redirectToRoute('hello', {name: 'Christoph', foo: 'bar'})
}
+
+ async missingRouteAction(context) {
+ return context.redirectToRoute('foobarbazboo')
+ }
} |
f76d185650f187a509b59e86a09df063a177af78 | test/utils.js | test/utils.js | import assert from 'power-assert';
import { camelToKebab } from '../src/utils';
describe('utils', () => {
it('translates camelCase to kebab-case', () => {
assert(camelToKebab('camelCaseToKebabCase') === 'camel-case-to-kebab-case');
});
it('does not add hyphen to the first position', () => {
assert(camel... | import assert from 'power-assert';
import { camelToKebab, assign, pick, mapValues } from '../src/utils';
describe('utils', () => {
describe('camelToKebab', () => {
it('translates camelCase to kebab-case', () => {
assert(camelToKebab('camelCaseToKebabCase') === 'camel-case-to-kebab-case');
});
it(... | Add test cases for utility functions | Add test cases for utility functions
| JavaScript | mit | ktsn/vuex-connect,ktsn/vuex-connect | ---
+++
@@ -1,20 +1,57 @@
import assert from 'power-assert';
-import { camelToKebab } from '../src/utils';
+import { camelToKebab, assign, pick, mapValues } from '../src/utils';
describe('utils', () => {
- it('translates camelCase to kebab-case', () => {
- assert(camelToKebab('camelCaseToKebabCase') === 'came... |
069de55f17261315570eff2183b1c042abbec45a | services/resource-updater.js | services/resource-updater.js | 'use strict';
var P = require('bluebird');
var _ = require('lodash');
var Schemas = require('../generators/schemas');
function ResourceUpdater(model, params) {
var schema = Schemas.schemas[model.collection.name];
this.perform = function () {
return new P(function (resolve, reject) {
var query = model
... | 'use strict';
var P = require('bluebird');
var _ = require('lodash');
var Schemas = require('../generators/schemas');
function ResourceUpdater(model, params) {
var schema = Schemas.schemas[model.collection.name];
this.perform = function () {
return new P(function (resolve, reject) {
var query = model
... | Fix the populate query on update | Fix the populate query on update
| JavaScript | mit | SeyZ/forest-express-mongoose | ---
+++
@@ -16,7 +16,7 @@
});
_.each(schema.fields, function (field) {
- if (field.reference) { query.populate(field); }
+ if (field.reference) { query.populate(field.field); }
});
query |
073c72bb5caef958a820cdeadc440a042dd4f111 | test/_page.js | test/_page.js | import puppeteer from 'puppeteer';
export async function evaluatePage (url, matches, timeout = 4000) {
const args = await puppeteer.defaultArgs();
const browser = await puppeteer.launch({
args: [...args, '--enable-experimental-web-platform-features']
});
const page = await browser.newPage();
await page.g... | import puppeteer from 'puppeteer';
export async function evaluatePage (url, matches, timeout = 4000) {
const args = await puppeteer.defaultArgs();
const browser = await puppeteer.launch({
args: [
...args,
'--no-sandbox',
'--disable-setuid-sandbox',
'--enable-experimental-web-platform-fe... | Disable chrome sandbox in tests | Disable chrome sandbox in tests | JavaScript | apache-2.0 | GoogleChromeLabs/worker-plugin | ---
+++
@@ -3,7 +3,12 @@
export async function evaluatePage (url, matches, timeout = 4000) {
const args = await puppeteer.defaultArgs();
const browser = await puppeteer.launch({
- args: [...args, '--enable-experimental-web-platform-features']
+ args: [
+ ...args,
+ '--no-sandbox',
+ '--dis... |
7317ad7bfd9b9d55ab1cf54c09c537a64ea0e798 | routes/year.js | routes/year.js | 'use strict';
const debug = require('debug')('calendar:routes:year');
const express = require('express');
const common = require('./common');
const monthRouter = require('./month');
const validators = require('../lib/validators');
const kollavarsham = require('./../lib/kollavarsham');
const yearRouter = express.Route... | 'use strict';
const debug = require('debug')('calendar:routes:year');
const express = require('express');
const common = require('./common');
const monthRouter = require('./month');
const validators = require('../lib/validators');
const kollavarsham = require('./../lib/kollavarsham');
const yearRouter = express.Route... | Use arrow functions instead of `function` keyword | Use arrow functions instead of `function` keyword | JavaScript | mit | kollavarsham/calendar-api | ---
+++
@@ -9,7 +9,7 @@
const yearRouter = express.Router();
-yearRouter.route('/years/:year').get(validators.validateYear, function (req, res) {
+yearRouter.route('/years/:year').get(validators.validateYear, (req, res) => {
debug('Within the month route');
const year = parseInt(req.params.year, 10);
|
e5954cf78a8daf138ca1a81ead64f1d38719a970 | public/ssr.js | public/ssr.js | var ssr = require('done-ssr-middleware');
module.exports = ssr({
config: __dirname + "/package.json!npm",
main: "bitcentive/index.stache!done-autorender",
liveReload: true
});
| var ssr = require('done-ssr-middleware');
module.exports = ssr({
config: __dirname + "/package.json!npm",
main: "bitcentive/index.stache!done-autorender",
liveReload: true,
auth: {
cookie: "feathers-jwt",
domains: [
"localhost"
]
}
});
| Add auth-cookie options to SSR. | Add auth-cookie options to SSR.
| JavaScript | mit | donejs/bitcentive,donejs/bitcentive | ---
+++
@@ -3,5 +3,11 @@
module.exports = ssr({
config: __dirname + "/package.json!npm",
main: "bitcentive/index.stache!done-autorender",
- liveReload: true
+ liveReload: true,
+ auth: {
+ cookie: "feathers-jwt",
+ domains: [
+ "localhost"
+ ]
+ }
}); |
b404a2f25f0259fd49dbc3f851765e5be2bc7050 | packages/vega-util/src/logger.js | packages/vega-util/src/logger.js | function log(level, msg) {
var args = [level].concat([].slice.call(msg));
console.log.apply(console, args); // eslint-disable-line no-console
}
export var None = 0;
export var Warn = 1;
export var Info = 2;
export var Debug = 3;
export default function(_) {
var level = _ || None;
return {
level: functi... | function log(level, msg) {
var args = [level].concat([].slice.call(msg));
console.log.apply(console, args); // eslint-disable-line no-console
}
export var None = 0;
export var Warn = 1;
export var Info = 2;
export var Debug = 3;
export default function(_) {
var level = _ || None;
return {
level: functi... | Update logging to return this. | Update logging to return this.
| JavaScript | bsd-3-clause | vega/vega,vega/vega,vega/vega,lgrammel/vega,vega/vega | ---
+++
@@ -11,9 +11,9 @@
export default function(_) {
var level = _ || None;
return {
- level: function(_) { if (arguments.length) level = +_; return level; },
- warn: function() { if (level >= Warn) log('WARN', arguments); },
- info: function() { if (level >= Info) log('INFO', arguments); },... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.