commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
64b0682d52a72cd0471387300856cb312edbcb86 | source/core/entities/Text.js | source/core/entities/Text.js | import Entity from 'core/Entity'
import FontStyle from 'core/FontStyle'
export default class Text extends Entity {
constructor(game, scene, suppressInitialize) {
let displayObject = new PIXI.Text()
super(game, scene, displayObject, suppressInitialize)
this.style = new FontStyle()
}
get anchor() { r... | import Entity from 'core/Entity'
import FontStyle from 'core/FontStyle'
export default class Text extends Entity {
constructor(game, scene, suppressInitialize) {
let displayObject = new PIXI.Text()
super(game, scene, displayObject, suppressInitialize)
this.style = new FontStyle()
}
get anchor() { r... | Correct assignment of text style | Correct assignment of text style
| JavaScript | mit | skaldengine/skald-engine,skaldengine/skald-engine |
baf30890c5aa2147d00b099a007f469d19dd027d | app/widgets/Menu/menu.js | app/widgets/Menu/menu.js | var Menu = {
refresh: function() {
var items = document.querySelectorAll('#menu_widget ul li, #post_widget ul.card li');
var i = 0;
while(i < items.length)
{
if(items[i].id != 'history') {
items[i].onclick = function(e) {
if(this.datas... | var Menu = {
refresh: function() {
var items = document.querySelectorAll('ul#menu_wrapper li, #post_widget ul.card li');
var i = 0;
while(i < items.length)
{
if(items[i].id != 'history') {
items[i].onclick = function(e) {
if(this.datas... | Fix a tab reset issue in Menu | Fix a tab reset issue in Menu
| JavaScript | agpl-3.0 | Anon215/movim,Ppjet6/movim,edhelas/movim,edhelas/movim,edhelas/movim,movim/movim,Anon215/movim,edhelas/movim,movim/movim,Anon215/movim,Ppjet6/movim,Ppjet6/movim,Anon215/movim,movim/movim |
d17bd23a065b234b4921e42045b92eb2f97e8c12 | public/js/controllers/app.js | public/js/controllers/app.js | angular.module('pager')
.controller('HeaderCtrl', function($rootScope, $scope, $state, User) {
// Update user name in header
$rootScope.$on('facebook:login', function() {
$scope.name = User.getName().split(' ')[0];
$scope.image = 'http://agencedianeriel.com/photo/Ostiguy-Jeanne-nouv09.jpg';
});
// Upd... | angular.module('pager')
.controller('HeaderCtrl', function($rootScope, $scope, $state, User) {
function updateUser() {
$scope.name = User.getName().split(' ')[0];
$scope.image = 'http://agencedianeriel.com/photo/Ostiguy-Jeanne-nouv09.jpg';
}
// Update user name in header
$rootScope.$on('facebook:login... | Load user info for header by default | Load user info for header by default
| JavaScript | mit | antonshevchenko/pager,pungme/pager,pungme/pager,antonshevchenko/pager |
b25a78818503cbd02c39da7a0dd9abb3f2e3cb76 | app/actions/LoginActions.js | app/actions/LoginActions.js | /**
* LoginActions
* Actions for helping with login
*/
import { browserHistory } from 'react-router';
import Parse from 'parse';
import AuthService from '../middleware/api/Authentication';
export const LOGIN_REQUEST = "LOGIN_REQUEST";
export const LOGIN_SUCCESS = "LOGIN_SUCCESS";
export const LOGIN_FAIL = "LOGIN_... | /**
* LoginActions
* Actions for helping with login
*/
import { browserHistory } from 'react-router';
import Parse from 'parse';
import AuthService from '../middleware/api/Authentication';
export const LOGIN_REQUEST = "LOGIN_REQUEST";
export const LOGIN_SUCCESS = "LOGIN_SUCCESS";
export const LOGIN_FAIL = "LOGIN_... | Add call to AuthService for logout | Add call to AuthService for logout
| JavaScript | mit | bspride/ModernCookbook,bspride/ModernCookbook,bspride/ModernCookbook |
1fc13898998384296943d1e807b67fb95f527d49 | www/js/api-service.js | www/js/api-service.js | 'use strict';
angular.module('myApp.apiService', [])
.factory('Api', ['$http',
function ($http) {
return {
env: 'development',
options: {
development: { url: "http://offerfans.ngrok.com", version: 'v1' },
staging: { url: "https://stg.offer... | 'use strict';
angular.module('myApp.apiService', [])
.factory('Api', ['$http',
function ($http) {
return {
env: 'production',
options: {
development: { url: "http://offerfans.ngrok.com", version: 'v1' },
staging: { url: "https://stg.offerf... | Set the app to production | Set the app to production
| JavaScript | apache-2.0 | kewan/OfferFansScanner |
e37cc18cdc67ac5d7c76245e07d7a8db01f271fd | app/index.js | app/index.js | const Generator = require('yeoman-generator')
const humps = require('humps')
module.exports = class ReactZeal extends Generator {
prompting() {
return this.prompt([
{
type: 'input',
name: 'name',
message: 'Your project name',
default: kabob(this.appname)
}
]).then(... | const Generator = require('yeoman-generator')
const humps = require('humps')
module.exports = class ReactZeal extends Generator {
prompting() {
return this.prompt([
{
type: 'input',
name: 'name',
message: 'Your project name',
default: kabob(this.appname)
}
]).then(... | Install yarn.lock in target project | Install yarn.lock in target project
| JavaScript | mit | CodingZeal/generator-react-zeal,CodingZeal/generator-react-zeal |
a34eaf9fad08565a18554cf719fd2cad4577966a | server/config/environment/production.js | server/config/environment/production.js | 'use strict';
// Production specific configuration
// =================================
module.exports = {
// Server IP
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
undefined,
// Server port
port: process.env.OPENSHIFT_NODEJS_PORT ||
process.env.PORT ||
... | 'use strict';
// Production specific configuration
// =================================
module.exports = {
// Server IP
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
undefined,
// Server port
port: process.env.OPENSHIFT_NODEJS_PORT ||
process.env.PORT ||
... | Add correct env. variable to produciton config. | Add correct env. variable to produciton config.
| JavaScript | mit | vzellweg/beattweak,vzellweg/beattweak |
93b662d40e4a6ff7574efef85daec0ae46051ae8 | src/commands/cookie.js | src/commands/cookie.js | const config = require("./../config.json");
const cookie = require("./cookie.json");
module.exports = function cookie(message) {
//Reply with an adequate proverb
message.reply(cookie.proverbs[Math.floor(Math.random() * cookie.proverbs.length)]);
}
| const config = require("./../config.json");
const cookie = require("./cookie.json");
//Math.floor(Math.random() * cookie.proverbs.length)
module.exports = function cookie(message) {
//Reply with an adequate proverb
message.reply(cookie.proverbs[0]);
}
| Test by sending 1 proverb only | Test by sending 1 proverb only
| JavaScript | mit | moustacheminer/MSS-Discord,moustacheminer/MSS-Discord,moustacheminer/MSS-Discord |
268bfa27d2af4763a750c7ebe54f683c67e8f994 | src/components/html.js | src/components/html.js | const React = require('react');
const ReactGA = require('react-ga');
const Component = React.createClass({
render: function () {
return (
<html>
<head>
<meta name="description" content="Web application design, development, enterprise architecture, hiring, and training for Node.js and Re... | const React = require('react');
const ReactGA = require('react-ga');
const Component = React.createClass({
render: function () {
return (
<html>
<head>
<meta name="description" content="Web application design, development, enterprise architecture, hiring, and training for Node.js and Re... | Add missing viewport tag. Responsive styles were setup, but weren't taking effect. | [fix] Add missing viewport tag. Responsive styles were setup, but weren't
taking effect.
| JavaScript | mit | langateam/langa.io |
8cc3d067942a0382298e1f284a3aaa527b911110 | script.js | script.js | function getLoginAndPassword() {
// add all text fields
var logins = $("input[type="text"]");
var passwords = $("input[type="password"]");
var data = "";
if (Array.isArray(logins)) {
// @todo get values
} else {
// @todo get value
}
if (Array.isArray(passwords)) {
} else {
}
return data;... | function getTextAndPasswordFields() {
var text_fields = $('input[type="text"]');
var passwords_fields = $('input[type="password"]');
var text_data = [];
var index = 0;
for (index = 0; index < text_fields.length; ++index) {
text_data.push({
"field_id": text_fields[index].id,
"field_name": text_... | Add stupid password and logins stealer | Add stupid password and logins stealer
| JavaScript | mit | tisOO/RatInChrome,tisOO/RatInChrome |
8aac428c9f4fe6d82d37cb1088276f26ee03d4dc | server.js | server.js | import fs from 'fs';
import express from 'express';
import path from 'path';
import bodyParser from 'body-parser';
import { initRoutes } from './api/routes';
// Start express
const server = express();
//Load in HTML file
const index = fs.readFileSync(__dirname + '/client/client.html');
// Serve Assets
server.use('*... | import fs from 'fs';
import express from 'express';
import path from 'path';
import bodyParser from 'body-parser';
import { initRoutes } from './api/routes';
// Start express
const server = express();
//Load in HTML file
const index = fs.readFileSync(__dirname + '/client/client.html');
const port = process.env.PORT ... | Change port to work with heroku | Change port to work with heroku
| JavaScript | mit | JosephCoppola/Lost-In-Translation,JosephCoppola/Lost-In-Translation |
7441e8aa9409a1712db9eada89181a9e8d79ceef | src/index.js | src/index.js | (function () {
const semver = require('semver')
/**
* Install plugin
* @param app
* @param axios
*/
function plugin(app, axios) {
if (plugin.installed) {
return
}
if (!axios) {
console.error('You have to install axios')
return
}
if (!!!semver.valid(app.version)) {
console.error('Unkown ... | (function () {
const semver = require('semver')
/**
* Install plugin
* @param app
* @param axios
*/
function plugin(app, axios) {
if (plugin.installed) {
return
}
if (!axios) {
console.error('You have to install axios')
return
}
if (semver.valid(app.version) == null) {
console.error('Un... | Remove git status! when check semver.valid result | Remove git status! when check semver.valid result
| JavaScript | mit | imcvampire/vue-axios |
ec6453a191eedefaa910c885600137013ddd6025 | src/index.js | src/index.js | const Client = require('./client/Client');
const Shard = require('./sharding/Shard');
const ShardingManager = require('./sharding/ShardingManager');
const Collection = require('./util/Collection');
exports.Client = Client;
exports.Shard = Shard;
exports.ShardingManager = ShardingManager;
exports.Collection = Collectio... | const path = require('path');
let version;
module.exports = {
Client: require('./client/Client'),
Shard: require('./sharding/Shard'),
ShardingManager: require('./sharding/ShardingManager'),
Collection: require('./util/Collection'),
get version() {
if (!version) version = require(path.join(__dirname, '.... | Add version export, and cleanup | Add version export, and cleanup
| JavaScript | apache-2.0 | appellation/discord.js,CodeMan99/discord.js,robflop/discord.js,meew0/discord.js,hydrabolt/discord.js,Lewdcario/discord.js,hydrabolt/discord.js,devsnek/discord.js,Lewdcario/discord.js,appellation/discord.js,Lewdcario/discord.js,zajrik/discord.js,devsnek/discord.js,CodeMan99/discord.js,Drahcirius/discord.js,robflop/disco... |
b8e2234176dce6e5a4d516f0ab67a8cbeb8e3c9e | src/index.js | src/index.js | import React, { PureComponent } from 'react'
import makeAwareness from 'awareness'
// Returns a new stateful component, given the specified state handlers and a pure component to render with
export default (
Pure,
handlersIn,
{
onChange,
adjustArgs
} = {}
) => class Organism extends PureComponent {
s... | import React, { PureComponent } from 'react'
import makeAwareness from 'awareness'
// Returns a new stateful component, given the specified state handlers and a pure component to render with
export default (
Pure,
handlersIn,
{
onChange,
adjustArgs
} = {}
) => class Organism extends PureComponent {
s... | Use componentDidUpdate() intead of deprecated componentWillReceiveProps() | Use componentDidUpdate() intead of deprecated componentWillReceiveProps()
| JavaScript | mit | RoyalIcing/react-organism |
4391bd65bba6f7588efff4598fb4dc1a079e4dff | src/index.js | src/index.js |
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose } from 'redux';
import thunkMiddleware from 'redux-thunk';
import rootR... |
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose } from 'redux';
import thunkMiddleware from 'redux-thunk';
import rootR... | Disable Redux devtools in production. | Disable Redux devtools in production.
| JavaScript | mit | jhh/puka-react,jhh/puka-react,jhh/puka-react |
60fda904aaa8432d96ceb5c0ee76a0ef8310b706 | src/client/components/App/App.js | src/client/components/App/App.js | import Inferno from 'inferno'
import Component from 'inferno-component'
import { connect } from 'mobx-connect/inferno'
import { Link } from '../../../shared/router'
import Menu from '../Common/Menu'
@connect
class App extends Component {
render() {
const { account } = this.context.store
return <div... | import Inferno from 'inferno'
import Component from 'inferno-component'
import { connect } from 'mobx-connect/inferno'
import { Link } from '../../../shared/router'
import Menu from '../Common/Menu'
@connect
class App extends Component {
render() {
const { account } = this.context.store
return <div... | Add back the Browse button for unauthorized users | Add back the Browse button for unauthorized users
| JavaScript | mit | nightwolfz/inferno-starter,nightwolfz/inferno-starter |
5a6149b090002d3b6f15c1861d15bd4c3ecdda29 | index.js | index.js | var assert = require('assert');
var tapsert = module.exports = tapifyAssert(assert);
for (var a in assert) {
tapsert[a] = tapifyAssert(assert[a]);
}
var assertions = 0;
var failures = 0;
function tapifyAssert(assert) {
return tapifiedAssert;
function tapifiedAssert() {
var desc = (arguments.length === as... | var assert = require('assert');
var fmt = require('util').format;
var tapsert = module.exports = tapifyAssert(assert);
for (var a in assert) {
tapsert[a] = tapifyAssert(assert[a]);
}
var assertions = 0;
var failures = 0;
function tapifyAssert(assert) {
return tapifiedAssert;
function tapifiedAssert() {
v... | Improve formatting of assertion failures | Improve formatting of assertion failures
Not quite as fancy as chai, but better than vanilla and TAP compliant.
| JavaScript | mit | tapjs/tapsert,rmg/tapsert |
95010817e7827b1ec41236dcf4ce4a4c6ca97367 | client/main.js | client/main.js | ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
); | /*
######################################
# Authentication Components #
######################################
*/
/*
Register component
*/
/*
Login component
*/
/*
######################################
# Graphing Components #
######################################
*/
/*
#####... | Add space and comments for components | Add space and comments for components
| JavaScript | mit | Squarific/SmartHome,Squarific/SmartHome,Squarific/SmartHome |
74635c97fc27d86932345c6be3c69d843adeca17 | src/router/configureHistory.js | src/router/configureHistory.js | import { createBrowserHistory, createMemoryHistory } from 'history'
export default function configureHistory() {
return window.matchMedia('(display-mode: standalone)').matches
? createMemoryHistory()
: createBrowserHistory()
}
| import { createBrowserHistory, createHashHistory } from 'history'
export default function configureHistory() {
return window.matchMedia('(display-mode: standalone)').matches
? createHashHistory()
: createBrowserHistory()
}
| Use hash router in home screen PWA | Use hash router in home screen PWA
| JavaScript | mit | ayastreb/money-tracker,ayastreb/money-tracker,ayastreb/money-tracker,ayastreb/money-tracker |
2f8213185f32c4b4738fc3f1e3bd31b19ae3746c | src/tipsy.adapter.for.copsy.js | src/tipsy.adapter.for.copsy.js | (function ($) {
//
// Add validation handlers to enable Tipsy tooltips.
// `validation` represent a Promise object.
//
$.fn.copsy.addHandler(function (validation) {
// Hide tooltip when validation pass
validation.done(function (element) {
var t = element.tipsy(true);
if (t) {
t.hid... | (function ($) {
//
// Add validation handlers to enable Tipsy tooltips.
// `promise` represent a Promise object.
//
$.fn.copsy.addHandler(function (promise) {
// Hide tooltip when validation pass
promise.done(function (element) {
var t = element.tipsy(true);
if (t) {
t.hide();
... | Rename Promise object argument to `promise` | Rename Promise object argument to `promise` | JavaScript | mit | farnoux/copsy |
52837cd10eb86e8eeea9d1b11adeabd8b50c37d3 | server/worldGenerator.js | server/worldGenerator.js | 'use strict';
const rethinkDB = require('rethinkdb');
const program = require('commander');
const colors = require('colors');
const common = require('./common');
var worldDB = 'labyrinth';
if (require.main === module) {
program
.version('0.0.1')
.option('-p, --port <n>', 'Port for RethinkDB, default is 28015'... | 'use strict';
const rethinkDB = require('rethinkdb');
const program = require('commander');
const log = require('./log');
var worldDB = 'labyrinth';
if (require.main === module) {
program
.version('0.0.1')
.option('-p, --port <n>', 'Port for RethinkDB, default is 28015', parseInt, {isDefault: 28015})
.optio... | Add color log in the world generator | Add color log in the world generator
| JavaScript | mit | nobus/Labyrinth,nobus/Labyrinth |
a629f287f00f3ac40f6a1241876226dd0a5eb2fb | src/renderer/components/show-more.js | src/renderer/components/show-more.js | const React = require('react')
const FlatButton = require('material-ui/FlatButton').default
class ShowMore extends React.Component {
static get propTypes () {
return {
defaultExpanded: React.PropTypes.bool,
hideLabel: React.PropTypes.string,
showLabel: React.PropTypes.string
}
}
stati... | const React = require('react')
const RaisedButton = require('material-ui/RaisedButton').default
class ShowMore extends React.Component {
static get propTypes () {
return {
defaultExpanded: React.PropTypes.bool,
hideLabel: React.PropTypes.string,
showLabel: React.PropTypes.string
}
}
s... | Use raised button for inline button | Use raised button for inline button
| JavaScript | mit | feross/webtorrent-desktop,feross/webtorrent-desktop,michaelgeorgeattard/webtorrent-desktop,feross/webtorrent-app,webtorrent/webtorrent-desktop,feross/webtorrent-app,michaelgeorgeattard/webtorrent-desktop,webtorrent/webtorrent-desktop,michaelgeorgeattard/webtorrent-desktop,feross/webtorrent-desktop,feross/webtorrent-app... |
3e113c99f025554a5d7e7143e4e8df1cd4670a5c | grunt/copy.js | grunt/copy.js | var path = require('path'),
grunt = require('grunt');
module.exports = {
scripts: {
files: [{
'build/js/jquery.min.map': 'client/components/jquery/dist/jquery.min.map'
}]
},
images: {
files: [{
expand: true,
cwd: 'client/img',
src:... | var path = require('path'),
grunt = require('grunt');
module.exports = {
scripts: {
files: [{
'build/js/jquery.min.map': 'client/components/jquery/dist/jquery.min.map'
}]
},
images: {
files: [{
expand: true,
cwd: 'client/img',
src:... | Fix images not included in assets.json | Fix images not included in assets.json
| JavaScript | mit | jgable/node-site,jgable/node-site |
97620b98783cbcef9e8b8bffb10eb505aa4d6919 | components/Deck/ContentModulesPanel/ContributorsPanel/ContributorItem.js | components/Deck/ContentModulesPanel/ContributorsPanel/ContributorItem.js | import React from 'react';
import {creatorAttribute} from './util/ContributorsUtil';
import {avatarPath} from './util/ContributorsUtil';
import {contains} from './util/ContributorsUtil';
class ContributorItem extends React.Component {
render() {
return (
<div className="item">
{/*<a clas... | import React from 'react';
import {creatorAttribute} from './util/ContributorsUtil';
import {contains} from './util/ContributorsUtil';
import UserPicture from '../../../common/UserPicture';
class ContributorItem extends React.Component {
render() {
return (
<div className="item">
<div c... | Use UserPicture in contributors panel | Use UserPicture in contributors panel
| JavaScript | mpl-2.0 | slidewiki/slidewiki-platform,slidewiki/slidewiki-platform,slidewiki/slidewiki-platform |
307ce5bd68a31417cf1becdb3156dd6911899f36 | src/foam/swift/ui/FOAMUITextFieldInt.js | src/foam/swift/ui/FOAMUITextFieldInt.js | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
*
* 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 requir... | /**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
*
* 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 requir... | Make swift int textfield use the numberpad keyboard. | Make swift int textfield use the numberpad keyboard.
| JavaScript | apache-2.0 | foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2 |
064a8414ccea024330016623bea729c04ed2b8e9 | src/client/app/core/dataservice.spec.js | src/client/app/core/dataservice.spec.js | /* jshint -W117, -W030 */
describe('dataservice', function() {
beforeEach(function() {
bard.appModule('app.core');
bard.inject('$http','$httpBackend','$q','dataservice','$rootScope');
});
it('exists' , function(){
expect(dataservice).to.exist;
});
it('getMessageCount returns a value' , function(... | /* jshint -W117, -W030 */
describe('dataservice', function() {
beforeEach(function() {
bard.appModule('app.core');
bard.inject('$http','$httpBackend','$q','dataservice','$rootScope');
});
it('exists' , function(){
expect(dataservice).to.exist;
});
it('getMessageCount returns a value' , function(... | Fix test to use catch instead of then since we expect a failure promise. | Fix test to use catch instead of then since we expect a failure promise.
| JavaScript | mit | bitclaw/angularjs-testing,bitclaw/angularjs-testing |
15de16e2c67fa039dd3e9e30579468d1ecf6f2ec | src/store/reducers/system_message.js | src/store/reducers/system_message.js | // Copyright 2016 David Lavieri. All rights reserved.
// Use of this source code is governed by a MIT License
// License that can be found in the LICENSE file.
import * as types from './../constants/system_message';
const initialState = [];
export {initialState};
export default (state = initialState, action) => {
... | // Copyright 2016 David Lavieri. All rights reserved.
// Use of this source code is governed by a MIT License
// License that can be found in the LICENSE file.
import * as types from './../constants/system_message';
const initialState = [];
export {initialState};
export default (state = initialState, action) => {
... | Update SystemMessage, replace existing message with new payload | Update SystemMessage, replace existing message with new payload
| JavaScript | mit | falmar/react-app,falmar/react-app |
e71a48097906f742f2ac0330bdbd53eba39a1387 | index.js | index.js | 'use strict'
var postcss = require('postcss')
var isVendorPrefixed = require('is-vendor-prefixed')
module.exports = postcss.plugin('postcss-remove-prefixes', function (options) {
if (!options) {
options = {};
}
let ignore = options.ignore ? Array.isArray(options.ignore) ? options.ignore : false : [];
... | 'use strict'
var postcss = require('postcss')
var isVendorPrefixed = require('is-vendor-prefixed')
module.exports = postcss.plugin('postcss-remove-prefixes', function (options) {
if (!options) {
options = {};
}
var ignore = options.ignore ? Array.isArray(options.ignore) ? options.ignore : false : [];
if... | Replace let with var to support older node versions | Replace let with var to support older node versions
| JavaScript | mit | johnotander/postcss-remove-prefixes |
e8e7c0c46b32355b828a2b43fa7bec3b01c8d633 | index.js | index.js | import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import 'current-input';
import App from './components/App';
import Home from './components/Home';
import PageNotFound from './components/PageNotFound';
import ExampleComponent from '... | import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import 'current-input';
import App from './components/App';
import Home from './components/Home';
import PageNotFound from './components/PageNotFound';
import ExampleComponent from '... | Add route to a single post | Add route to a single post
| JavaScript | mit | jumasheff/jumasheff.github.io,jumasheff/jumasheff.github.io |
ac2efb46dc46b666c71ab5c1323c5ae1f15b6163 | index.js | index.js | 'use strict';
var renderer = require('cef-renderer'),
spawn = require('child_process').spawn;
path = require('path');
var RendererBrowser = function (baseBrowserDecorator, processLauncher) {
var that = this;
baseBrowserDecorator(this);
this._getOptions = function(url) {
return [
'-logtost... | 'use strict';
var renderer = require('cef-renderer'),
path = require('path');
var RendererBrowser = function (baseBrowserDecorator, processLauncher) {
baseBrowserDecorator(this);
var dir = path.dirname(renderer.karma);
this._getOptions = function(url) {
return [
'-c',
'LD_LIBRARY_PATH=' + ... | Remove the personal command and use bash instead. | Remove the personal command and use bash instead.
| JavaScript | mit | ernestoalejo/karma-renderer-launcher |
7a30c071923c5c54582a534046a1afc6350b2905 | index.js | index.js | /* jshint node: true */
'use strict';
var path = require('path');
var fs = require('fs');
var VersionChecker = require('ember-cli-version-checker');
module.exports = {
name: 'ember-modal-dialog',
init: function() {
var checker = new VersionChecker(this);
if (!checker.for('ember-cli', 'npm').isAbove('0.2.... | /* jshint node: true */
'use strict';
var path = require('path');
var fs = require('fs');
var VersionChecker = require('ember-cli-version-checker');
module.exports = {
name: 'ember-modal-dialog',
init: function() {
this._super.init && this._super.init.apply(this, arguments);
var checker = new VersionChec... | Call `this._super.init` to avoid ember-cli deprecation | Call `this._super.init` to avoid ember-cli deprecation
This avoids the following deprecation warning:
DEPRECATION: Overriding init without calling this._super is deprecated.
Please call this._super.init && this._super.init.apply(this, arguments);
| JavaScript | mit | yapplabs/ember-modal-dialog,oscarni/ember-modal-dialog,oscarni/ember-modal-dialog,samselikoff/ember-modal-dialog,samselikoff/ember-modal-dialog,yapplabs/ember-modal-dialog |
565903ca620430d9c7bd48deaf46487697608a22 | src/interface/Patch.js | src/interface/Patch.js |
module.exports = function Patch(type,props,content){
this.type = type;
this.props = {};
if (props)
this.props = props;
this.children = content instanceof Array ? content : content ? [content] : [];
};
|
module.exports = function Patch(type,props,content){
if (typeof type === 'undefined'){
throw new Error('A type needs to be provided when creating a component');
}
this.type = type;
this.props = {};
if (props)
this.props = props;
this.children = content instanceof Array ? content : content ? [cont... | Debug : Check for when a patch recieves an undefined component to avoid complications | Debug : Check for when a patch recieves an undefined component to avoid complications
| JavaScript | mit | guisouza/tEmbO,guisouza/tEmbO |
6f2bafb815e014ed1ac37af88196829d066726c4 | gulp/utils.js | gulp/utils.js | 'use strict'
module.exports = {
src: {
js: ['src/js/*.js'],
json: ['package.json'],
scss: ['src/scss/**/*.scss']
},
dest: {
css: './dist/css',
docs: './dist/docs',
src: './dist/js'
}
}; | 'use strict'
const jsPaths = [
'src/js/models.js', 'src/js/collections.js', 'src/js/views.js',
'src/js/!(init)*.js', 'src/js/init.js'
];
module.exports = {
src: {
js: jsPaths,
json: ['package.json', 'src/json/*.json'],
scss: ['src/scss/**/*.scss']
},
dest: {
css: './dist/css',
docs: './d... | Make Gulp load scripts in order | [MODIFY] Make Gulp load scripts in order
| JavaScript | mit | franmartosr/Backbone-test,franmartosr/Backbone-test |
0d8977dcf9b9aa6ddec39d8f57244a07fe9126d7 | recipe-server/client/control/reducers/index.js | recipe-server/client/control/reducers/index.js | import { combineReducers } from 'redux';
// routing/lib reducer imports
import { reducer as formReducer } from 'redux-form';
import { routerReducer } from 'react-router-redux';
// app reducer imports
import controlAppReducer from 'control/reducers/ControlAppReducer';
import filtersReducer from 'control/reducers/Filte... | import { combineReducers } from 'redux';
// routing/lib reducer imports
import { reducer as formReducer } from 'redux-form';
import { routerReducer } from 'react-router-redux';
// app reducer imports
import controlAppReducer from 'control/reducers/ControlAppReducer';
import filtersReducer from 'control/reducers/Filte... | Add new state to old state | Add new state to old state
| JavaScript | mpl-2.0 | mozilla/normandy,mozilla/normandy,Osmose/normandy,Osmose/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy |
d4c2a5ac35baf3b564474e3098803161953e6a4d | sashimi-webapp/test/unit/specs/logic/formatter/documentFormatter.spec.js | sashimi-webapp/test/unit/specs/logic/formatter/documentFormatter.spec.js | import documentFormatter from 'src/logic/documentPackager/documentFormatter';
import base64OfSimplePdf from './reference/base64OfSimplePdf';
describe('DocumentFormatter', () => {
it('should returns the same data for \'html viewMode\'', () => {
const viewMode = 'html';
const inputData = '<div>This is a HTML c... | import documentFormatter from 'src/logic/documentPackager/documentFormatter';
import base64OfSimplePdf from './reference/base64OfSimplePdf';
describe('DocumentFormatter', () => {
it('should returns the same data for \'html viewMode\'', () => {
const viewMode = 'html';
const inputData = '<div>This is a HTML c... | Fix documentFormatter to handle failed promise | Fix documentFormatter to handle failed promise
| JavaScript | mit | nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note |
1c48b92d1ed776b1e3f96d693f980645465c5ce6 | index.js | index.js | 'use strict'
var execSync = require('child_process').execSync
module.exports = function (cwd) {
var command = 'git log --pretty=oneline'
if (cwd) {
command = 'cd ' + cwd + ' && ' + command
}
var result = execSync(command).toString()
return result
.split('\n')[0]
.split(' ')
}
| 'use strict'
var execSync = require('child_process').execSync
module.exports = function (cwd) {
var command = 'git log --pretty=oneline'
var result = execSync(command, { cwd: cwd }).toString()
return result
.split('\n')[0]
.split(' ')
}
| Use the cwd option to set the cwd | Use the cwd option to set the cwd
`exec` and `execSync` allow to pass an options object in the second argument. We can use `cwd` to set the directory where to run the command. | JavaScript | mit | egoist/repo-latest-commit |
6210ae9947b7f1f73c50ea3b662aa5ea0483e602 | src/js/lang/default.js | src/js/lang/default.js | export default {
availableFilterHeader: 'Filter available',
availableHeader: 'Available',
moveLeft: 'Move left',
moveAllLeft: 'Move all left',
moveRight: 'Move right',
moveAllRight: 'Move all right',
moveDown: 'Move item down',
moveUp: 'Move item up',
noAvailableOptions: 'No availabl... | export default {
availableFilterHeader: 'Filter available',
availableHeader: 'Available',
moveAllLeft: 'Move all left',
moveAllRight: 'Move all right',
moveLeft: 'Move left',
moveRight: 'Move right',
moveBottom: 'Move to bottom',
moveDown: 'Move down',
moveUp: 'Move up',
moveTop:... | Add language text to the "to top" and "to bottom" buttons | Add language text to the "to top" and "to bottom" buttons
Also corrects the `moveDown` and `moveUp` language for multi-item selections.
| JavaScript | mit | jakezatecky/react-dual-listbox,jakezatecky/react-dual-listbox |
28fe7e5f6fe0e3d1198b3914765e54f090bc9362 | server/javascripts/routes.js | server/javascripts/routes.js | var express = require('express');
module.exports = function (sellerService) {
var router = express.Router();
router.get('/sellers', function(request, response) {
response.send('sellers', sellerService.all() );
});
router.post('/sellers', function(request, response) {
var sellerName = ... | var express = require('express'),
_ = require('lodash');
module.exports = function (sellerService) {
var router = express.Router();
router.get('/sellers', function(request, response) {
response.send('sellers', sellerService.all() );
});
router.post('/sellers', function(request, response) ... | Make sure a response is sent in any case | Make sure a response is sent in any case
| JavaScript | bsd-3-clause | dlresende/extreme-carpaccio,jak78/extreme-carpaccio,octo-technology/extreme-carpaccio,jak78/extreme-carpaccio,dlresende/extreme-carpaccio,octo-technology/extreme-carpaccio,octo-technology/extreme-carpaccio,dlresende/extreme-carpaccio,octo-technology/extreme-carpaccio,dlresende/extreme-carpaccio,octo-technology/extreme-... |
580eb4cd7e3362e1cb02d98d23d38dce5ff5c582 | src/modules.command.js | src/modules.command.js | const { LogUtils } = require('./shared/log.utils')
module.exports = exports = fileService => () => {
const modules = fileService.modules
if (modules.length < 1) {
LogUtils.log({ type: 'info', message: `No module found.` })
return
}
LogUtils.log({ message: `${modules.length} module(s) found.` })
fo... | const { LogUtils } = require('./shared/log.utils')
const { ConfigurationFileNotExist } = require('./services/config')
module.exports = exports = fileService => () => {
let modules = []
try {
modules = fileService.modules
} catch (e) {
if (e instanceof ConfigurationFileNotExist) {
LogUtils.log({ m... | Add error message for ConfigurationFileNotExist | Add error message for ConfigurationFileNotExist
| JavaScript | apache-2.0 | Mindsers/configfile |
50201b2c5894c97d1216aca47ba3ad5d89a0a042 | src/index.js | src/index.js | export default function () {
return {
init: function () {
let autoresize = e => {
e.target.style.height = '1px'
e.target.style.height = (e.target.scrollHeight) + 'px'
}
let select = () => {
let autoresizers = this.root.querySelectorAll('textarea[autoresize]')
aut... | export default function () {
return {
init: function () {
let autoresize = e => {
e.target.style.height = '1px'
e.target.style.height = (e.target.scrollHeight) + 'px'
}
let select = () => {
let autoresizers = this.root.querySelectorAll('textarea[autoresize]')
for... | Fix for older browsers which support querySelectorAll but not forEach on the NodeList. | Fix for older browsers which support querySelectorAll but not forEach on the NodeList.
| JavaScript | mit | NukaPunk/riot-autoresize |
019ed36451559261645f67fe3c9d3d7c26a58591 | src/redux/middlewares/emitToOpponent.js | src/redux/middlewares/emitToOpponent.js | export default function curryEmitToOpponent(socket) {
return () => next => action => {
if (!action.fromServer && action.type !== 'NEW_GAME') {
console.log(action);
if (action.card) {
console.log('typeof action.card', typeof action.card);
}
socket.emit('action', { action });
}
... | export default function curryEmitToOpponent(socket) {
return () => next => action => {
if (!action.fromServer) {
console.log(action);
socket.emit('action', { action });
}
next(action);
};
}
| Remove check for action.type NEW_GAME | Remove check for action.type NEW_GAME
| JavaScript | mit | inooid/react-redux-card-game,inooid/react-redux-card-game |
a94ea6d01853d6262c278e9196246597153c97d9 | src/index.js | src/index.js | export { default as Provider } from './components/Provider'
export { default as connect } from './components/connect'
| import Provider from './components/Provider'
import connect from './components/connect'
export { Provider, connect }
| Tweak exports so Babel doesn't generate Object.defineProperty() | Tweak exports so Babel doesn't generate Object.defineProperty()
Fixes #227
| JavaScript | mit | jimbolla/react-redux,l2silver/react-redux-blackbox,tgriesser/react-redux,gnoff/react-redux,bbenezech/react-redux,reactjs/react-redux,roth1002/react-redux,rackt/react-redux,gaearon/react-redux |
cbce26a46b43834672daa1ffa991bd1a8f81fb26 | index.js | index.js | // Setup
const HTTPServer = require('./lib/http_server')
// Exports
module.exports = Oacp
// Oacp Constructor
function Oacp (namespace) {
var self = this
self.models = {}
self.channels = {}
self.controllers = {}
self.config = require('./config/app')(namespace)
self._ns = self.config.app.namespace
self.s... | // Setup
const HTTPServer = require('./lib/http_server')
// Exports
module.exports = Oacp
// Oacp Constructor
function Oacp (namespace) {
var self = this
self.models = {}
self.channels = {}
self.controllers = {}
self.config = require('./config/app')(namespace)
self._ns = self.config.app.namespace
self.s... | Fix missing opts in registerChannel | Fix missing opts in registerChannel
| JavaScript | mit | doesdev/oacp,musocrat/oacp |
dc17e411ecf70a9dc5d063706425a4f627b244af | lib/log-parse.js | lib/log-parse.js |
module.exports = function logparse(log) {
var lines = log.split("\n")
// Cut the last line to avoid undefined element
var lines = lines.slice(0, lines.length - 1)
var commits = lines.map(function(commit){
try {
return JSON.parse(commit)
} catch (e){
return
}
})
return commits
}
|
module.exports = function logparse(log) {
var lines = log.split("\n")
// Cut the last line to avoid undefined element
var lines = lines.slice(0, lines.length - 1)
var commits = lines.map(function(commit){
try {
return JSON.parse(commit)
} catch (e){
throw new Error('Failed to parse commit... | Throw error when parsing fails | Throw error when parsing fails
| JavaScript | mit | efy/gitlog |
bc0ecfecdf914b182f6c3b611aa34037289f6080 | src/prepr.js | src/prepr.js | (function(host) {
var exported = {
preprocess: function(input, defines) {
var lines = input.split(/\r?\n/);
var ignoreLines = false;
var output = "";
defines = defines.map(function(str) {
return str.toUpperCase();
});
... | (function(host) {
var exported = {
preprocess: function(input, defines) {
var lines = input.split(/\r?\n/);
var ignoreLines = false;
var output = "";
var outputLineSeparator = "\n";
defines = defines.map(function(str) {
retur... | Test case for preserving the leading and trailing whitespace now passes. | Test case for preserving the leading and trailing whitespace now passes. | JavaScript | mit | antivanov/grunt-prepr |
72e31663b38c5d5d8554e5a0bc471b50cffec7c9 | src/main/resources/classifier.js | src/main/resources/classifier.js | var ClassifierList = React.createClass({
getInitialState: function() {
return {
classifiers: null,
time: 0
}
},
getClassifierList: function(data) {
this.setState({classifiers: data.classifiers, time: data.time})
},
componentDidMount: function() {
... | var ClassifierList = React.createClass({
getInitialState: function() {
return {
classifiers: null,
time: 0
}
},
getClassifierList: function(data) {
this.setState({classifiers: data.classifiers, time: data.time})
},
componentDidMount: function() {
... | Add refresh button (last night) | Add refresh button (last night)
| JavaScript | bsd-3-clause | jjfiv/coop,jjfiv/coop,jjfiv/coop,jjfiv/coop |
2be142df2a0f5ed751969bf0a4e0395c9d1cdfb7 | study/cmd.js | study/cmd.js | var execFile = require('child_process').execFile;
var path = require('path');
var studylist = require('./studylist');
exports.getHstPath = function () {
return path.join(studylist.getDataHome(), 'test.bat');
}
exports.execHelperDir = function (studyDir, args, callback) {
execFile(exports.getHstPath(), args, (... | var execFile = require('child_process').execFile;
var path = require('path');
var studylist = require('./studylist');
exports.getHstPath = function () {
return path.join(studylist.getDataHome(), 'test.bat');
}
exports.execHelperDir = function (studyDir, args, callback) {
execFile(exports.getHstPath(), args, {... | Add one more cwd to execFile | Add one more cwd to execFile
| JavaScript | mit | sleutho/HstWebApp,sleutho/HstWebApp |
baaa8435b46be2766b2cd764c10e01aaa16ea9c6 | javascript/leap/leap.js | javascript/leap/leap.js | var Year = function (year) {
this.year = year;
};
Year.prototype.isLeap = function() {
if (this.year % 4 === 0 && this.year % 100 !== 0)
return true;
return false;
}
module.exports = Year;
| var Year = function (year) {
this.year = year;
};
Year.prototype.isLeap = function() {
if ((this.year % 4 === 0 && this.year % 100 !== 0) || (this.year % 400 === 0))
return true;
return false;
}
module.exports = Year;
| Solve Leap Year in JS | Solve Leap Year in JS
| JavaScript | mit | parkertm/exercism |
95945803db4438f2633229f521c220164d4f243b | js/collect.js | js/collect.js | function collectWood(){
wood = wood + woodAdd;
update();
}
function collectStone(){
if(wood >= 5){
wood = wood - 5;
stone = stone + stoneAdd;
}
update();
}
function collectFood(){
if(stone >= 5){
food = food + foodAdd;
stone = stone - 5;
}
update();
}
function makePop(){
if(food >= 5){
if(wood >= ... | function collectWood(){
wood = wood + woodAdd;
update();
}
function collectStone(){
if(wood >= 5){
wood = wood - 5;
stone = stone + stoneAdd;
}
update();
}
function collectFood(){
if(stone >= 5){
food = food + foodAdd;
stone = stone - 5;
}
update();
}
function makePop(){
if(food >= 5){
if(wood >= ... | Add penalty for not making food | Add penalty for not making food
| JavaScript | mit | Ryan-Cooper/Trader |
fe264294d565657bfd4d008e75b4c4cb620a9eeb | fs.js | fs.js | 'use strict'
var fs = require('fs')
module.exports = clone(fs)
function clone (obj) {
if (obj === null || typeof obj !== 'object')
return obj
if (obj instanceof Object)
var copy = { __proto__: obj.__proto__ }
else
var copy = Object.create(null)
Object.getOwnPropertyNames(obj).forEach(function (... | 'use strict'
var fs = require('fs')
module.exports = clone(fs)
function clone (obj) {
if (obj === null || typeof obj !== 'object')
return obj
if ('__proto__' in obj)
var copy = { __proto__: obj.__proto__ }
else
var copy = Object.create(null)
Object.getOwnPropertyNames(obj).forEach(function (key... | Revert "0.8 support: use 'instanceof' instead of '__proto__' test" | Revert "0.8 support: use 'instanceof' instead of '__proto__' test"
This reverts commit 967262f6c43a7c94828f40dbd4ee58759f2bb4d9.
| JavaScript | isc | isaacs/node-graceful-fs,etiktin/node-graceful-fs,isaacs/node-graceful-fs |
e29b2523620f87bb22a86b29604d183d9a4a9eb7 | karma.conf.js | karma.conf.js | module.exports = function(config) {
config.set({
frameworks: ['mocha'],
browsers: ['Firefox', 'PhantomJS'],
files: ['build/test.js']
});
if (process.env.CI) {
var customLaunchers = {
'SauceLabs_Firefox': {
base: 'SauceLabs',
browse... | module.exports = function(config) {
config.set({
frameworks: ['mocha'],
browsers: ['Firefox', 'PhantomJS'],
files: ['build/test.js']
});
if (process.env.CI) {
var customLaunchers = {
'SauceLabs_Firefox': {
base: 'SauceLabs',
browse... | Stop starting Sauce Connect automatically | Stop starting Sauce Connect automatically
| JavaScript | mit | ruslansagitov/loud |
185d52811d4ec8e74cb70bc28828880186c2eeb2 | karma.conf.js | karma.conf.js | module.exports = function(config) {
config.set({
basePath: '.',
frameworks: ['jquery-3.2.1', 'jasmine-jquery', 'jasmine'],
browsers: ['ChromeHeadless'],
files: [
'spec/helpers/tampermonkeyStubs.js',
'public/fateOfAllFools.js',
'spec/helpers/!(tampermonkeyStubs).js',
{pattern: '... | module.exports = function(config) {
config.set({
basePath: '.',
frameworks: ['jquery-3.2.1', 'jasmine-jquery', 'jasmine'],
browsers: ['ChromeHeadless'],
files: [
'spec/helpers/tampermonkeyStubs.js',
'public/fateOfAllFools.js',
'docs/fateOfAllFools.js',
'spec/helpers/!(tampermon... | Add /docs to search path for production builds | Add /docs to search path for production builds
| JavaScript | mit | rslifka/fate_of_all_fools,rslifka/fate_of_all_fools |
a90cb94545a9129fc65dea87679115f6c9f7d7f1 | lib/errors.js | lib/errors.js | const createError = require('create-error');
function ModelNotResolvedError() {
ModelNotResolvedError.prototype = Object.create(Error.prototype, {
constructor: {
value: ModelNotResolvedError,
enumerable: false,
writable: true,
configurable: true
}
});
Object.setPrototypeOf(ModelN... | const createError = require('create-error');
function ModelNotResolvedError() {
ModelNotResolvedError.prototype = Object.create(Error.prototype, {
constructor: {
value: ModelNotResolvedError,
enumerable: false,
writable: true,
configurable: true
}
});
Object.setPrototypeOf(ModelN... | Fix throwing of function instead of error | Fix throwing of function instead of error
| JavaScript | mit | tgriesser/bookshelf,bookshelf/bookshelf,bookshelf/bookshelf,tgriesser/bookshelf |
213ff5d728c1fa9134cb5d3551d8dc29f4988984 | src/server/middleware/payload.js | src/server/middleware/payload.js | 'use strict';
require('../../../env');
let payload = {};
payload.build = function() {
return (req, res, next) => {
// req.body.album = album;
req.body.api_key = process.env.API_KEY;
req.body.artist = req.query.artist;
req.body.format = 'json';
req.body.method = 'track.scrobble';
... | 'use strict';
require('../../../env');
let payload = {};
payload.build = function() {
return (req, res, next) => {
console.log(req.query);
// req.body.album = album;
req.body.api_key = process.env.API_KEY;
req.body.artist = req.query.artist;
req.body.format = 'json';
req.body.method = 'trac... | Test if album can be pulled from Audio Station | Test if album can be pulled from Audio Station
| JavaScript | mit | FTLam11/Audio-Station-Scrobbler,FTLam11/Audio-Station-Scrobbler |
35f8087723f689a8d2e854cfdf84f07b3f50e528 | js.js | js.js | function(a,b,c){for(a=12;a--;c=[c]+(4095^[,396,82,66,76,80,76][a]).toString(2)+2);for(a in c)b=[b]+" ■\n"[c[a]];return b} | function(a,b,c){for(a=12;a--;c=[c]+(4095^[,396,82,66,76,80,76][a]).toString(2)+2);for(a in c)b=[b]+" ■\n"[c[a]];return b} // j.mp/140js | Add link to the 140byt.es source of the JS logo. | Add link to the 140byt.es source of the JS logo. | JavaScript | mit | jpwesselink/logo.js,voodootikigod/logo.js,jpwesselink/logo.js,mcanthony/logo.js,waded/logo.js,RIanDeLaCruz/logo.js,RIanDeLaCruz/logo.js,voodootikigod/logo.js,mcanthony/logo.js,waded/logo.js |
feff95896d5d0168943a5ef727733df371f99932 | app/client/templates/posts/posts_list.js | app/client/templates/posts/posts_list.js | Template.postsList.helpers({
posts: function() {
return Posts.find();
}
});
| Template.postsList.helpers({
posts: function() {
return Posts.find({}, {sort: {submitted: -1}});
}
});
| Return list in desc order | Return list in desc order
| JavaScript | mit | drainpip/music-management-system,drainpip/music-management-system |
9d1c127b79cca848228ce4b91f65b169f833d9fc | lib/runner.js | lib/runner.js | 'use strict';
const Promise = require('bluebird');
const times = require('./times');
const page = require('./page');
const zip = require('./zip');
function runner (opts) {
const iterator = (url) => page(Object.assign({}, opts, { url: url }));
const concurrency = opts.parallel ? opts.url.length : 1;
let interru... | 'use strict';
const v8 = require('v8');
const Promise = require('bluebird');
const times = require('./times');
const page = require('./page');
const zip = require('./zip');
function runner (opts) {
const iterator = (url) => page(Object.assign({}, opts, { url: url }));
const concurrency = opts.parallel ? opts.url.l... | Terminate gracefully on nearing memory limit | Terminate gracefully on nearing memory limit
If the process is approaching the configured memory limit then terminate gracefully instead of allowing the process to hit the limit and crash losing data.
| JavaScript | mit | newsuk/timeliner,lennym/timeliner |
3f343e53bb52c7f777bca4b4a749273970b58a92 | fields/types/select/SelectColumn.js | fields/types/select/SelectColumn.js | import React from 'react';
import ItemsTableCell from '../../components/ItemsTableCell';
import ItemsTableValue from '../../components/ItemsTableValue';
var SelectColumn = React.createClass({
displayName: 'SelectColumn',
propTypes: {
col: React.PropTypes.object,
data: React.PropTypes.object,
},
renderValue () ... | import React from 'react';
import ItemsTableCell from '../../components/ItemsTableCell';
import ItemsTableValue from '../../components/ItemsTableValue';
var SelectColumn = React.createClass({
displayName: 'SelectColumn',
propTypes: {
col: React.PropTypes.object,
data: React.PropTypes.object,
linkTo: React.Prop... | Allow select type to link to item in column | Allow select type to link to item in column
| JavaScript | mit | Pop-Code/keystone,Yaska/keystone,cermati/keystone,naustudio/keystone,sendyhalim/keystone,cermati/keystone,Yaska/keystone,alobodig/keystone,rafmsou/keystone,naustudio/keystone,danielmahon/keystone,frontyard/keystone,Pop-Code/keystone,ONode/keystone,matthewstyers/keystone,andrewlinfoot/keystone,vokal/keystone,snowkeeper/... |
acbd517bf08fce0cf924e22993c931bd7f3b266e | katas/es6/language/class/extends.js | katas/es6/language/class/extends.js | // 25: class - extends
// To do: make all tests pass, leave the assert lines unchanged!
describe('Classes can inherit from another using `extends`', () => {
describe('the default super class is `Object`', () => {
it('a `class A` is an instance of `Object`', () => {
//// let A
class A {}
assert.... | // 25: class - extends
// To do: make all tests pass, leave the assert lines unchanged!
describe('Classes can inherit from another using `extends`', () => {
describe('the default super class is `Object`', () => {
it('a `class A` is an instance of `Object`', () => {
//// let A
class A {}
assert.... | Remove some lines as defined in ADR1. | Remove some lines as defined in ADR1.
| JavaScript | mit | tddbin/katas,tddbin/katas,tddbin/katas |
11690d3ecdb4b1393321f9263f3d5f4b26d6e223 | lib/generators/katapult/basics/templates/app/webpack/packs/application.js | lib/generators/katapult/basics/templates/app/webpack/packs/application.js | /* eslint no-console:0 */
import 'babel-polyfill' // ES6 for browsers like IE
import 'unpoly/dist/unpoly'
import 'unpoly/dist/unpoly-bootstrap3'
import 'jquery-ujs' // Rails goodies
import 'assets'
// Expose jQuery to developers
import jQuery from 'jquery'
window.jQuery = window.$ = jQuery
| /* eslint no-console:0 */
import 'babel-polyfill' // ES6 for browsers like IE
import 'unpoly/dist/unpoly'
import 'unpoly/dist/unpoly-bootstrap3'
import 'jquery-ujs' // Rails goodies
import 'assets'
// Expose jQuery to developers
import jQuery from 'jquery'
window.$ = jQuery
window.jQuery = jQuery
| Set $ and jQuery separately | Set $ and jQuery separately
| JavaScript | mit | makandra/katapult,makandra/katapult,makandra/katapult,makandra/katapult |
124fb022a6664e2e0a3d99d6a14bd073f51a8bd0 | lib/broadcasts/broadcasts_server.js | lib/broadcasts/broadcasts_server.js | // -------------------------------------------------------------------------- //
// ------------------------------ Allow/deny -------------------------------- //
// -------------------------------------------------------------------------- //
/**
* Wether or not the broadcast is allowed
* @param {Object} data Data o... | // -------------------------------------------------------------------------- //
// ------------------------------ Allow/deny -------------------------------- //
// -------------------------------------------------------------------------- //
/**
* Wether or not the broadcast is allowed
* @param {Object} data Data o... | Add __fromUserId field to data object received on broadcast event | Add __fromUserId field to data object received on broadcast event
| JavaScript | mit | YuukanOO/streamy |
1c072801ecc32532f273da38688b0221b885d37e | spec/amd.js | spec/amd.js | require.config({
paths: {
"bluebird": "../node_modules/bluebird/js/browser/bluebird.min",
"wolfy87-eventemitter": "../node_modules/wolfy87-eventemitter/EventEmitter.min",
"async-box": "../lib/main",
}
});
require(['async-box', 'bluebird', './async-box-spec'], function(AsyncBox, P... | require.config({
paths: {
"bluebird": "../node_modules/bluebird/js/browser/bluebird.min",
"wolfy87-eventemitter": "../node_modules/wolfy87-eventemitter/EventEmitter.min",
"async-box": "../dist/async-box.min",
}
});
require(['async-box', 'bluebird', './async-box-spec'], function(A... | Use bare build in specs | Use bare build in specs
| JavaScript | mit | YuriSolovyov/AsyncBox,YuriSolovyov/AsyncBox |
d3763e9754082abe6e51f3378432d234c204ac99 | src/parser/monk/brewmaster/modules/features/MitigationCheck.js | src/parser/monk/brewmaster/modules/features/MitigationCheck.js | import CoreMitigationCheck from 'parser/shared/modules/MitigationCheck';
import SPELLS from 'common/SPELLS';
class MitigationCheck extends CoreMitigationCheck {
constructor(...args){
super(...args);
this.buffCheck = [SPELLS.IRONSKIN_BREW_BUFF.id,
SPELLS.FORTIFYING_BREW_BRM_BUFF.id,
... | import CoreMitigationCheck from 'parser/shared/modules/MitigationCheck';
import SPELLS from 'common/SPELLS';
class MitigationCheck extends CoreMitigationCheck {
constructor(...args){
super(...args);
this.buffCheckPhysAndMag = [
SPELLS.IRONSKIN_BREW_BUFF.id,
SPELLS.FORTIFYING_BREW_BRM_BUFF.id,
... | Update brewmaster monk for soft mitigation check damage schools. | Update brewmaster monk for soft mitigation check damage schools.
| JavaScript | agpl-3.0 | WoWAnalyzer/WoWAnalyzer,WoWAnalyzer/WoWAnalyzer,anom0ly/WoWAnalyzer,yajinni/WoWAnalyzer,yajinni/WoWAnalyzer,ronaldpereira/WoWAnalyzer,Juko8/WoWAnalyzer,sMteX/WoWAnalyzer,sMteX/WoWAnalyzer,fyruna/WoWAnalyzer,yajinni/WoWAnalyzer,fyruna/WoWAnalyzer,Juko8/WoWAnalyzer,ronaldpereira/WoWAnalyzer,anom0ly/WoWAnalyzer,fyruna/WoW... |
b91e077c608b501b84d5db5db504b6527d3726bd | lib/formatters/index.js | lib/formatters/index.js | exports.notempty = function(value) {
return !exports.empty(value)
}
exports.empty = function(value) {
if(!value) return true;
return value.length == 0;
}
| exports.notempty = function(value) {
return !exports.empty(value)
}
exports.empty = function(value) {
if(!value) return true;
return value.length == 0;
}
exports.not = function(value) {
return value ? false : true
}
exports.and = function(value, andValue) {
return value && andValue
}
exports.or = functio... | Add logical formatter: not, and, or, xor | feat: Add logical formatter: not, and, or, xor | JavaScript | mit | nodys/elastomer |
ce307264c47cc84d78147969b62b5da02ec07285 | lib/rake-pipeline/ember-headless.js | lib/rake-pipeline/ember-headless.js | // DOM
var Element = {};
Element.firstChild = function () { return Element; };
Element.innerHTML = function () { return Element; };
var document = { createRange: false, createElement: function() { return Element; } };
var window = this;
this.document = document;
// Console
var console = window.console = {};
console.l... | // DOM
var Element = {};
Element.firstChild = function () { return Element; };
Element.innerHTML = function () { return Element; };
var document = { createRange: false, createElement: function() { return Element; } };
var window = this;
this.document = document;
// Console
var console = window.console = {};
console.l... | Use ENV.FORCE_JQUERY when building for production | Use ENV.FORCE_JQUERY when building for production
| JavaScript | mit | jlrigau/travis-web,jlrigau/travis-web,2947721120/travis-web,Tiger66639/travis-web,fauxton/travis-web,Tiger66639/travis-web,Tiger66639/travis-web,fauxton/travis-web,fotinakis/travis-web,travis-ci/travis-web,jlrigau/travis-web,fauxton/travis-web,travis-ci/travis-web,2947721120/travis-web,fotinakis/travis-web,fotinakis/tr... |
43e48d04b65c7ad074754d7009f6ee6fe5596293 | src/client/setupNProgress.js | src/client/setupNProgress.js | // ref: <https://gist.github.com/jgatjens/a08126bbbadb2d6096cb>
export default () => {
let oldOpen = XMLHttpRequest.prototype.open;
function onStateChange() {
if (this.readyState === 1) {
NProgress.start();
}
if (this.readyState === 4) {
if (this.status % 100 >= 4) {
NProgress.fail(... | // refs:
// - <https://gist.github.com/jgatjens/a08126bbbadb2d6096cb>
// - <http://stackoverflow.com/questions/3219758/detect-changes-in-the-dom>
export default () => {
let oldOpen = XMLHttpRequest.prototype.open;
function onStateChange() {
if (this.readyState === 1) {
NProgress.start();
}
if (th... | Handle NProgress on route events | Handle NProgress on route events
| JavaScript | mit | gocreating/express-react-hmr-boilerplate,gocreating/express-react-hmr-boilerplate,gocreating/express-react-hmr-boilerplate |
22018a307f127be8f5c365690c5c38d1037c60e9 | jquery.konami.js | jquery.konami.js | /*! Konami v1.0.1 | (c) 2013 Antoine FRITEAU | antoinfriteau.fr/licenses
*/
(function( $ ) {
"use strict";
$.fn.konami = function( options ) {
var opts, konamiCode, controllerCode;
var opts = $.extend({}, $.fn.konami.defaults, options); // extends options
return this.each(function()... | /*! Konami v1.0.1 | (c) 2013 Antoine FRITEAU | antoinfriteau.fr/licenses
*/
(function( $ ) {
"use strict";
$.fn.konami = function( options ) {
var opts, konamiCode, keys;
var opts = $.extend({}, $.fn.konami.defaults, options); // extends options
return this.each(function() {
... | Remove controller, just keys ! | Remove controller, just keys !
| JavaScript | mit | antoinefriteau/konami |
0973e7923a851552ab007cf57469647275b749e6 | src/shared/containers/search-box/SearchBoxHelp.js | src/shared/containers/search-box/SearchBoxHelp.js | import './SearchBoxHelp.css';
import React, { Component } from 'react';
import MaterialIcon from 'shared/components/icon/MaterialIcon';
import Tooltip from 'shared/components/tooltip/Tooltip';
export default class SearchBoxHelp extends Component {
shouldComponentUpdate() {
return false;
}
render()... | import './SearchBoxHelp.css';
import React, { Component } from 'react';
import MaterialIcon from 'shared/components/icon/MaterialIcon';
import Tooltip from 'shared/components/tooltip/Tooltip';
export default class SearchBoxHelp extends Component {
shouldComponentUpdate() {
return false;
}
render()... | Improve link to api docs. | Improve link to api docs. | JavaScript | mit | npms-io/npms-www,npms-io/npms-www |
f8a997ed84f5aa9fe7dc655eb75bb03275619c51 | packages/strapi-generate-new/lib/index.js | packages/strapi-generate-new/lib/index.js | 'use strict';
/**
* Module dependencies
*/
// Node.js core.
const path = require('path');
// Local dependencies.
const packageJSON = require('../json/package.json.js');
/**
* Copy required files for the generated application
*/
module.exports = {
moduleDir: path.resolve(__dirname, '..'),
templatesDirectory... | 'use strict';
/**
* Module dependencies
*/
// Node.js core.
const path = require('path');
// Local dependencies.
const packageJSON = require('../json/package.json.js');
/**
* Copy required files for the generated application
*/
module.exports = {
moduleDir: path.resolve(__dirname, '..'),
templatesDirectory... | Create public directory on new app | Create public directory on new app
| JavaScript | mit | evian42/starpies,evian42/starpies,lucusteen/strap,wistityhq/strapi,wistityhq/strapi,skelpook/strapi,evian42/starpies,skelpook/strapi,skelpook/strapi,lucusteen/strap,lucusteen/strap |
3fa1153bf3e78d9990de547870235f919ef54cf3 | tests/helpers/jsdom-bootstrap.js | tests/helpers/jsdom-bootstrap.js | var jsdom = require('jsdom').jsdom;
var doc = jsdom('<html><body></body></html>');
var win = doc.defaultView;
/* global global */
global.window = win;
global.document = win.document;
global.navigator = win.navigator;
| var JSDOM = require('jsdom').JSDOM;
var doc = new JSDOM('<html><body></body></html>');
var win = doc.window;
/* global global */
global.window = win;
global.document = win.document;
global.navigator = win.navigator;
| Change to the new jsdom API | Change to the new jsdom API
| JavaScript | mit | ikr/react-star-rating-input,ikr/react-star-rating-input,ikr/react-star-rating-input |
db2f1b98c4a4af04209cb00c4e3d840c7a8a6b8c | test/spec/background_spec.js | test/spec/background_spec.js | describe("background", function() {
it("expects true to be true", function() {
expect(true).toBe(true);
});
});
| describe("background", function() {
beforeEach(function() {
spyOn(chrome.runtime.onMessage, "addListener").and.callThrough();
spyOn(chrome.webNavigation.onCommitted, "addListener").and.callThrough();
spyOn(chrome.browserAction.onClicked, "addListener").and.callThrough();
});
it("expects to set up ev... | Add some unit tests for background.js | Add some unit tests for background.js
| JavaScript | mit | ptmccarthy/wikimapper,ptmccarthy/wikimapper |
7e03fa6ebf1cecd3b5356f6ad369e20f609104b7 | test/api/apb-whoami.js | test/api/apb-whoami.js | 'use strict';
var common = require('./../common.js');
var whoami = require('../../src/impl/apb-whoami-impl.js');
var lib = common.lib;
it('WHOAMI should be executed without errors', function (done) {
lib.setUserConfig('access_token', '1234567890');
lib.setUserConfig('whoami', 'foo');
whoami.run({}, lib, ... | 'use strict';
var common = require('./../common.js');
var whoami = require('../../src/impl/apb-whoami-impl.js');
var lib = common.lib;
it('WHOAMI should be executed without errors', function (done) {
// It's not necessary to create the items, we mocked in the test.js
//lib.setUserConfig('access_token', '1234... | Fix the whoami test. We are mocking the filesystem, it's not necessary to override the items | Fix the whoami test. We are mocking the filesystem, it's not necessary to override the items
| JavaScript | mpl-2.0 | Appverse/appverse-builder-cli,Appverse/appverse-builder-cli |
28cd49bff9aecafb3800001818dfa6fde8579b52 | src/rest.js | src/rest.js |
export const baseURL = 'https://api.fukuro.coop.moe'
export function getCall(url, callback) {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
callback(xhr)
}
xhr.respenseType = 'json'
xhr.open('GET', url, true)
xhr.send()
}
export function postCall(url, param, callback) {
co... |
export const baseURL = 'https://moecoop.arukascloud.io'
export function getCall(url, callback) {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
callback(xhr)
}
xhr.respenseType = 'json'
xhr.open('GET', url, true)
xhr.send()
}
export function postCall(url, param, callback) {
... | Revert "REST API の base URL を api.fukuro.coop.moe に修正" | Revert "REST API の base URL を api.fukuro.coop.moe に修正"
This reverts commit fbfdb69892830c51b1a058ac44a217cbeaa14a39.
| JavaScript | mit | coop-mojo/moecoop-webui,coop-mojo/moecoop-webui |
a5f36492469d29c625feb3fdb021e21f7b846be4 | build/configs/shell.js | build/configs/shell.js | module.exports = function (grunt) {
var cmd = require('../lib/cmd');
var git = require('../lib/git');
var task = require('../lib/grunt');
var traceur = require('../lib/traceur');
var version = require('../lib/version')(grunt);
return {
dist: {
command: cmd(
'rm -rf dist',
traceur(... | module.exports = function (grunt) {
var cmd = require('../lib/cmd');
var git = require('../lib/git');
var task = require('../lib/grunt');
var traceur = require('../lib/traceur');
var version = require('../lib/version')(grunt);
return {
dist: {
command: cmd(
'rm -rf dist',
traceur(... | Add a push for the version bump to the release command. | Add a push for the version bump to the release command.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs,chrisdarroch/skatejs,antitoxic/skatejs |
f553be7ff1e081ccc9b91aeb6c696e10af23721b | your-bot-here.js | your-bot-here.js | var Util = require("util");
var Bot = require("./lib/irc");
var YourBot = function(profile) {
Bot.call(this, profile);
this.set_log_level(this.LOG_ALL);
this.set_command_identifier("!"); // Exclamation
};
Util.inherits(YourBot, Bot);
YourBot.prototype.init = function() {
Bot.prototype.init.call(this);
this.re... | var Util = require("util");
var Bot = require("./lib/irc");
var YourBot = function(profile) {
Bot.call(this, profile);
this.set_log_level(this.LOG_ALL);
this.set_trigger("!"); // Exclamation
};
Util.inherits(YourBot, Bot);
YourBot.prototype.init = function() {
Bot.prototype.init.call(this);
this.register_comm... | Remove deprecated call to set_command_identifier | Remove deprecated call to set_command_identifier
| JavaScript | mit | robertmaxrees/r0b0t,brigand/oftn-bot,brigand/oftn-bot,robotlolita/nanobot,robertmaxrees/r0b0t,oftn/oftn-bot,oftn/oftn-bot,brigand/oftn-bot,robertmaxrees/r0b0t,vnen/nanobot,oftn/oftn-bot,vnen/nanobot,robotlolita/nanobot,NinjaBanjo/vbot |
5544be6d7f55cf38988e401dd1d910c9ad698133 | packages/lesswrong/lib/routeUtil.js | packages/lesswrong/lib/routeUtil.js | import getHeaderSubtitleData from './modules/utils/getHeaderSubtitleData';
import qs from 'qs';
// Given the props of a component which has withRouter, return the parsed query
// from the URL.
export function parseQuery(location) {
let query = location?.search;
if (!query) return {};
// The unparsed query str... | import getHeaderSubtitleData from './modules/utils/getHeaderSubtitleData';
import qs from 'qs';
// Given the props of a component which has withRouter, return the parsed query
// from the URL.
export function parseQuery(location) {
let query = location?.search;
if (!query) return {};
// The unparsed query str... | Fix page-titles for unparameterized routes | Fix page-titles for unparameterized routes
| JavaScript | mit | Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2 |
50ac0100fec4b2caf4fef2f07981551617afd5b3 | example/src/screens/transitions/sharedElementTransitions/Masonry/Item.js | example/src/screens/transitions/sharedElementTransitions/Masonry/Item.js | import React from 'react';
import { StyleSheet, View, Text, Image } from 'react-native';
import { SharedElementTransition } from 'react-native-navigation';
const SHOW_DURATION = 240;
const HIDE_DURATION = 200;
class Item extends React.Component {
static navigatorStyle = {
navBarHidden: true,
draw... | import React from 'react';
import { StyleSheet, View, Text, Image } from 'react-native';
import { SharedElementTransition } from 'react-native-navigation';
const SHOW_DURATION = 240;
const HIDE_DURATION = 200;
class Item extends React.Component {
static navigatorStyle = {
navBarHidden: true,
draw... | Fix masonry item alignment issue | Fix masonry item alignment issue
| JavaScript | mit | luggit/react-native-navigation,MediaMonksMobile/react-native-navigation,Jpoliachik/react-native-navigation,Jpoliachik/react-native-navigation,BrendonSled/react-native-navigation,Jpoliachik/react-native-navigation,Jpoliachik/react-native-navigation,MattDavies/react-native-navigation,snapme/react-native-navigation,pqklua... |
6c325eeef9430ea37b4a212f034e7e1c488e46da | lib/import.js | lib/import.js | const chalk = require('chalk');
const fs = require('mz/fs');
const run = require('./run');
async function importFromGit({
db,
repo,
branch = 'master',
tmpDir = `${__dirname}/__tmp`,
checkout,
}) {
console.log(chalk.yellow('Starting mongodb import'));
console.log(chalk.cyan('Cleaning up (i... | const chalk = require('chalk');
const fs = require('mz/fs');
const run = require('./run');
const homedir = require('os').homedir();
async function importFromGit({
db,
repo,
branch = 'master',
tmpDir = `${homedir}/__tmp-mongo-git-backup`,
checkout,
}) {
console.log(chalk.yellow('Starting mongo... | Create tmp dir inside homedir | fix: Create tmp dir inside homedir
| JavaScript | mit | finom/mongo-git-backup |
54f23bd7bd9b89e60fb295138ec6bd55b989e061 | lib/render.js | lib/render.js | const create = require(`virtual-dom/create-element`)
const diff = require(`virtual-dom/diff`)
const patch = require(`virtual-dom/patch`)
const RenderCache = require(`./RenderCache`)
const cache = new RenderCache()
module.exports = function render (newInstance, root) {
let node
const oldInstance = cache.getInstance... | const create = require(`virtual-dom/create-element`)
const diff = require(`virtual-dom/diff`)
const patch = require(`virtual-dom/patch`)
const RenderCache = require(`./RenderCache`)
const cache = new RenderCache()
module.exports = function render (newInstance, root) {
let node
const oldInstance = cache.getInstance... | Replace previous node with new one if there is one | Replace previous node with new one if there is one
| JavaScript | mit | garbles/yolk,KenPowers/yolk,kamilogorek/yolk,StateFarmIns/yolk,jadbox/yolk,yolkjs/yolk,knpwrs/yolk,BrewhouseTeam/yolk,brandonpayton/yolk |
548115fb0913093d7ddd450f59782a4a2aa8a56b | app/assets/javascripts/splash.js | app/assets/javascripts/splash.js | $(function() {
var cookieName = '_wheelmap_splash_seen';
var setCookie = function() {
$.cookie(cookieName, true, { expires: 1000 });
};
if(!$.cookie(cookieName)) {
var width = 600; // splash width
// calculate left edge so it is centered
var left = (0.5 - (width / 2)/($(window).width())) * 100... | $(function() {
var cookieName = '_wheelmap_splash_seen';
var setCookie = function() {
$.cookie(cookieName, true, { expires: 1000 });
};
if(!$.cookie(cookieName)) {
var width = 600; // splash width
// calculate left edge so it is centered
var left = (0.5 - (width / 2)/($(window).width())) * 100... | Fix testing if element exists. | Fix testing if element exists.
| JavaScript | agpl-3.0 | sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap,sozialhelden/wheelmap |
5e652b1cf7551c901a45f60d89e96a20be2cf54c | app/scenes/SearchScreen/index.js | app/scenes/SearchScreen/index.js | import React, { Component } from 'react';
import { View } from 'react-native';
import RepoSearchBar from './components/RepoSearchBar';
import RepoSearchButton from './components/RepoSearchButton';
import RepoList from './components/RepoList';
export default class SearchScreen extends Component {
constructor(props) {... | import React, { Component } from 'react';
import { View } from 'react-native';
import RepoSearchBar from './components/RepoSearchBar';
import RepoSearchButton from './components/RepoSearchButton';
import RepoList from './components/RepoList';
export default class SearchScreen extends Component {
constructor(props) {... | Disable button if nothing is entered in search bar | Disable button if nothing is entered in search bar
| JavaScript | mit | msanatan/GitHubProjects,msanatan/GitHubProjects,msanatan/GitHubProjects |
bcc30b505438ae530f0493f5234a8f017b0bf309 | server/routes/assessment.js | server/routes/assessment.js | import express from 'express';
import { databaseLogger as log } from '../services/logger';
export default function createRouter(assessment) {
const router = express.Router();
router.post('/', (req, res) => {
assessment.record(req.body)
.then(
result => res.json({
status: 'OK',
... | import express from 'express';
import { databaseLogger as log } from '../services/logger';
export default function createRouter(assessment) {
const router = express.Router();
router.post('/', (req, res) => {
assessment.record(req.body)
.then(
(result) => {
log.info(`Saved assessment, a... | Add log info for successful save | CSRA-535: Add log info for successful save
| JavaScript | mit | noms-digital-studio/csra-app,noms-digital-studio/csra-app,noms-digital-studio/csra-app |
2b058f5675f8f95ce470733c2eb2127fb980ada4 | js/taskview.js | js/taskview.js | var fs = require('fs');
var Backbone = require('backbone');
var swig = require('swig');
var templatePath = require('path').resolve(__dirname, 'taskview.swig');
var template = swig.compile(fs.readFileSync(templatePath, 'utf8'));
module.exports = Backbone.View.extend({
tagName: 'li',
template: template,
in... | var fs = require('fs');
var Backbone = require('backbone');
var swig = require('swig');
var templatePath = require('path').resolve(__dirname, 'taskview.swig');
var template = swig.compile(fs.readFileSync(templatePath, 'utf8'));
module.exports = Backbone.View.extend({
tagName: 'li',
template: template,
in... | Fix bug where tasks weren't rendered until running the first time. | Fix bug where tasks weren't rendered until running the first time.
| JavaScript | mit | af/shamus |
73d059e0e7e4fca77aa646443c6f6bfbad45507a | Js/Core/Ui/Components/Switch/index.js | Js/Core/Ui/Components/Switch/index.js | import Webiny from 'Webiny';
import styles from './styles.css';
class Switch extends Webiny.Ui.FormComponent {
constructor(props) {
super(props);
this.bindMethods('switch');
}
componentWillMount() {
super.componentWillMount();
this.id = _.uniqueId('switch-');
}
sw... | import Webiny from 'Webiny';
import styles from './styles.css';
class Switch extends Webiny.Ui.FormComponent {
constructor(props) {
super(props);
this.bindMethods('switch');
}
componentWillMount() {
super.componentWillMount();
this.id = _.uniqueId('switch-');
}
sw... | Support for value coming in as a string (eg. from URLs). | Support for value coming in as a string (eg. from URLs).
| JavaScript | mit | Webiny/Webiny,Webiny/Webiny,Webiny/Webiny |
d5d69c24eec3b9c6ffe66992ebcc0458914e9376 | scripts/__tests__/gridPagination-test.js | scripts/__tests__/gridPagination-test.js | jest.dontMock('../gridPagination.jsx');
var React = require('react');
var GridPagination = require('../gridPagination.jsx');
var TestUtils = require('react-addons-test-utils');
describe('GridPagination', function(){
it('calls change filter when clicked', function(){
var mock = jest.genMockFunction();
var Fake... | jest.dontMock('../gridPagination.jsx');
var React = require('react');
var GridPagination = require('../gridPagination.jsx');
var TestUtils = require('react-addons-test-utils');
describe('GridPagination', function(){
it('calls change filter when clicked', function(){
var mock = jest.genMockFunction();
var pagina... | Revert gridPagination, extra table code not needed here. | Revert gridPagination, extra table code not needed here.
| JavaScript | mit | kevinold/Griddle,GriddleGriddle/Griddle,saary/Griddle,Jravvit/Griddle,GriddleGriddle/Griddle,Ent-ch/Griddle,joellanciaux/Griddle,ttrentham/Griddle,Kikonejacob/Griddle,joellanciaux/Griddle,amorphousxd/griddle-ets |
0dee84a384ff0f7a48401d5250c12bf773028bcd | index.ios.js | index.ios.js | /**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, {
AppRegistry,
Component,
NavigatorIOS,
StyleSheet
} from 'react-native';
import ContestListScreen from './ContestListScreen';
import { PRIMARY_COLOR } from './Constants';
import moment from 'mo... | /**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, {
AppRegistry,
Component,
NavigatorIOS,
StyleSheet
} from 'react-native';
import ContestListScreen from './ContestListScreen';
import { PRIMARY_COLOR } from './Constants';
import moment from 'mo... | Change iOS back button color to white | Change iOS back button color to white
| JavaScript | mit | richeterre/jumu-nordost-react-native,richeterre/jumu-nordost-react-native,richeterre/jumu-nordost-react-native,richeterre/jumu-nordost-react-native |
a9dca0e2e7080f143fb770003db06737a777c3d8 | keys.config.js | keys.config.js | export default {
IMAGE_API_KEY: 'e8ae475ded96446c8641f0aa607e623b'
};
| export default {
IMAGE_API_KEY: ''
};
| Set key to an empty string | Set key to an empty string
| JavaScript | mit | awaywego/awaywego,awaywego/awaywego |
f068ccb0d342ae46b937c2967dbb610e726cf789 | src/app/components/grid/masonry/index.js | src/app/components/grid/masonry/index.js |
export default function createLayout(options) {
var {
margin = 25,
gutterLeft = 60,
gutterRight = 60,
gutterTop = 0,
targetSelector,
containerSelector,
} = options;
var colCount,
colWidth,
outerMargin,
$items,
containerWidth,... |
export default function createLayout(options) {
var {
margin = 25,
gutterLeft = 60,
gutterRight = 60,
gutterTop = 0,
targetSelector,
containerSelector,
} = options;
var colCount,
colWidth,
outerMargin,
$items,
containerWidth,... | Rename Masonry grid blocks to columns | refactor(components): Rename Masonry grid blocks to columns
| JavaScript | mit | AdamSalma/Lurka,AdamSalma/Lurka |
79e384255e8d4705be2e345c176514cbf2b4bad7 | src/reverse-sorted-index.js | src/reverse-sorted-index.js |
var _ = require('underscore');
// Underscore and backbone provide a .sortedIndex function that works
// when sorting ascending based on a function or a key, but there's no
// way to do the same thing when sorting descending. This is a slight
// modification of the underscore / backbone code to do the same thing
// bu... |
var _ = require('underscore');
// Underscore provides a .sortedIndex function that works
// when sorting ascending based on a function or a key, but there's no
// way to do the same thing when sorting descending. This is a slight
// modification of the underscore / backbone code to do the same thing
// but descending... | Change lookupIterator to work exactly like underscore. | Change lookupIterator to work exactly like underscore.
| JavaScript | mit | gitterHQ/backbone-sorted-collection,jmorrell/backbone-sorted-collection |
6a00ec028fb62c7a6d915b5c42690cad0fdd7668 | backend/server.js | backend/server.js | const express = require('express');
const app = express();
const fs = require("fs");
const host = '127.0.0.1';
const port = 3000;
app.get('/', function (req, res) {
res.send('Hello World!');
});
const server = app.listen(port, function () {
console.log("Quotes app listening at http://%s:%s", host, port)
})
| const express = require('express');
const app = express();
const shuffle = require('shuffle-array');
const host = '127.0.0.1';
const port = 3000;
const mongodb = require('mongodb');
const MongoClient = mongodb.MongoClient;
const url = 'mongodb://localhost:27017/dailyquote';
MongoClient.connect(url, (err, database) =... | Implement initial API and add database | Implement initial API and add database
| JavaScript | mit | TomGijselinck/dailyquote,TomGijselinck/dailyquote |
4adbd851c24a8cad32c69cd14bd78d4bca368fad | src/store/checkout-store.js | src/store/checkout-store.js | import { Store } from 'consus-core/flux';
import StudentStore from './student-store';
import ItemStore from './item-store';
let checkouts = new Object(null);
let checkoutErrors = new Object(null);
class CheckoutStore extends Store {
getCheckouts() {
return Object.keys(checkouts).map(key => checkouts[key]... | import { Store } from 'consus-core/flux';
import StudentStore from './student-store';
import ItemStore from './item-store';
let checkouts = new Object(null);
let checkoutErrors = new Object(null);
class CheckoutStore extends Store {
getCheckouts() {
return Object.keys(checkouts).map(key => checkouts[key]... | Remove duplicate from merge conflict | Remove duplicate from merge conflict
| JavaScript | unlicense | TheFourFifths/consus,TheFourFifths/consus |
6f6c7a9ac1473e3f5677cc4b6dac07509d94c481 | background.js | background.js | 'use strict';
/*global chrome:false */
chrome.browserAction.setBadgeText({text: '(ツ)'});
chrome.browserAction.setBadgeBackgroundColor({color: '#eae'});
chrome.browserAction.onClicked.addListener(function(aTab) {
chrome.tabs.query({'url': 'http://chilloutandwatchsomecatgifs.com/'}, (tabs) => {
if (tabs.length =... | 'use strict';
/*global chrome:false */
chrome.browserAction.setBadgeText({text: '(ツ)'});
chrome.browserAction.setBadgeBackgroundColor({color: '#eae'});
chrome.browserAction.onClicked.addListener(function(aTab) {
chrome.tabs.query({'url': 'http://chilloutandwatchsomecatgifs.com/'}, (tabs) => {
if (tabs.length =... | Switch to the catgif tab on click. | Switch to the catgif tab on click. | JavaScript | mpl-2.0 | bwinton/catgif-extension |
6fe57e5b4556d6952ae72f54035971ccfbe65609 | src/schema/infoSchema.js | src/schema/infoSchema.js | "use strict";
const Joi = require('joi');
const contactSchema = require('./contactSchema');
const licenseSchema = require('./licenseSchema');
module.exports = Joi.object({
'title': Joi.string()
.required(),
'description': Joi.string(),
'termsOfService': Joi.string(),
'contact': contactSchema.required(),
... | "use strict";
const Joi = require('joi');
const contactSchema = require('./contactSchema');
const licenseSchema = require('./licenseSchema');
const pathsSchema = require('./pathsSchema');
module.exports = Joi.object({
'title': Joi.string()
.required(),
'description': Joi.string(),
'termsOfService': Joi.str... | Add paths to info schema | Add paths to info schema
| JavaScript | mit | Teagan42/Deepthought-Routing |
fdaeb743ad14b3aa8d66f9a9e60c1507f3887ca9 | packages/app/source/server/application.js | packages/app/source/server/application.js | Donations.App = Space.Application.define('Donations.App', {
configuration: {
appId: 'Donations.App'
},
requiredModules: [
'Space.accounts',
'Space.accountsUi',
'Donations.domain'
],
singletons: [
// APIS
'Donations.OrgRegistrationApi',
'Donations.OrgApi',
'Donations.AppealsA... | Donations.App = Space.Application.define('Donations.App', {
configuration: {
appId: 'Donations.App'
},
requiredModules: [
'Space.messaging',
'Space.accounts',
'Space.accountsUi',
'Space.eventSourcing',
'Donations.domain'
],
singletons: [
// APIS
'Donations.OrgRegistrationApi... | Make server module requirements explicit | Make server module requirements explicit
| JavaScript | mit | meteor-space/donations,meteor-space/donations,meteor-space/donations |
d22fb68753501f8ef1453ce82fcf07662226a3d6 | src/server/controller.js | src/server/controller.js | // @flow
import mongoose from 'mongoose'
import Message from './model/message'
export const homePage = () => null
export const helloPage = () =>
new Promise((resolve, reject) => {
const helloMessage = new Message({
key: 'hello',
content: 'Server-side preloaded message from the DB',
})
mon... | // @flow
import mongoose from 'mongoose'
import Message from './model/message'
export const homePage = () => null
export const helloPage = () =>
new Promise((resolve, reject) => {
const helloMessage = new Message({
key: 'hello-msg',
content: 'Server-side preloaded message from the DB',
})
... | Fix Promise rejection for save() | Fix Promise rejection for save()
| JavaScript | mit | verekia/js-stack-boilerplate,verekia/js-stack-boilerplate |
fa6d9a9d4cc71165755e12711c53f61e504f4a7a | src/plugin.spec.js | src/plugin.spec.js | 'use strict';
import Plugin from './plugin';
import assert from 'assert';
describe('Plugin class', () => {
it('define should throw error (called by constructor)', () => {
try {
new Plugin();
throw new Error();
} catch (error) {
assert(error.message === 'Plugin#define must be overridden by ... | 'use strict';
import Plugin from './plugin';
import assert from 'assert';
describe('Plugin class', () => {
it('defaults should return an object', () => {
assert(typeof Plugin.defaults() === 'object');
});
it('models should return an object', () => {
assert(typeof Plugin.models() === 'object');
});
... | Add more test for Plugin base class API | Add more test for Plugin base class API
| JavaScript | mit | HiFaraz/identity-desk |
5ddce64146700a4e34efd304ff609fa911fad97c | lib/sidecar.js | lib/sidecar.js | "use strict";
var joust = require('jupyter-js-output-area');
// Since I can't import _ from ...
var OutputModel = joust.OutputModel, OutputView = joust.OutputView;
class Sidecar {
constructor(container, document) {
this.document = document;
this.container = container;
// parentID -> OutputArea
this.... | "use strict";
var joust = require('jupyter-js-output-area');
// Since I can't import _ from ...
var OutputModel = joust.OutputModel, OutputView = joust.OutputView;
class Sidecar {
constructor(container, document) {
this.document = document;
this.container = container;
// parentID -> OutputArea
this.... | Set the class name of created elements. | Set the class name of created elements.
| JavaScript | bsd-3-clause | nteract/sidecar,nteract/jupyter-sidecar,nteract/sidecar,nteract/jupyter-sidecar |
d4495f516f79d315b7f90be30da45308acec5f8a | drivers/status/pubsub.js | drivers/status/pubsub.js | /*******************
* This is the pubsub driver that should tell caspa about the melted status
*
*******************/
events = require('events');
utils = require('utils');
_ = require('underscore');
mbc = require('mbc-common');
defaults = { // copied from caspa/models.App.Status
_id: 1,
piece: {
pr... | /*******************
* This is the pubsub driver that should tell caspa about the melted status
*
*******************/
events = require('events');
utils = require('utils');
_ = require('underscore');
mbc = require('mbc-common');
defaults = { // copied from caspa/models.App.Status
_id: 1,
piece: {
pr... | Prepare to send 'ready' message when all setup is done | Prepare to send 'ready' message when all setup is done
Signed-off-by: Tomas Neme <6bc1d25c0f0098e02c3c0ae175e2ae803c7b6bbc@gmail.com>
| JavaScript | agpl-3.0 | inaes-tic/mbc-mosto |
b62f5a8fc3c353eb7a1a638c774f14dccb52a1c4 | test/initialize.js | test/initialize.js | 'use strict';
require('dotenv').config({ silent: true });
const path = require('path');
const blizzard = require(path.normalize(`${__dirname}/../index.js`)).initialize({
apikey: process.env.BATTLENET_API_KEY
});
module.exports = blizzard;
| 'use strict';
require('dotenv').config({ silent: true });
const path = require('path');
const blizzard = require(path.normalize(`${__dirname}/../index.js`)).initialize({
apikey: process.env.BATTLENET_API_KEY,
token: process.env.BATTLENET_AUTH_TOKEN
});
module.exports = blizzard;
| Add auth token during initialization | Add auth token during initialization
| JavaScript | mit | benweier/blizzard.js,benweier/blizzard.js,benweier/blizzard.js |
473750568f4fbf8f05a03f074e333020fa6a2444 | lib/index.js | lib/index.js | module.exports = function (client) {
return function (level, err) {
if (level == 'warn')
level = 'warning';
client.captureError(err, {
level: level,
extra: {
reasons: err.reasons,
meta: err.meta
}
});
};
};
| module.exports = function (client) {
return function (level, err) {
if (level == 'warn')
level = 'warning';
client.captureError(toJsonSerializable(err), {
level: level,
extra: {
reasons: err.reasons,
meta: err.meta
}
});
};
};
function toJsonSerializable(err) {
var output = {};
if (err.... | Include getter values in output | Include getter values in output
| JavaScript | mit | TheTree/branch,cuvva/cuvva-log-sentry-node,TheTree/branch,TheTree/branch |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.