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 |
|---|---|---|---|---|---|---|---|---|---|
d37806edbf8f09b1f7e632d79af70bc0fb43008e | config/config.js | config/config.js | const env = process.env.NODE_ENV || 'development';
const config = {
development: {
server: {
port: process.env.PORT || 3000,
hostname: process.env.HOSTNAME || 'localhost',
},
database: {
url: 'mongodb://localhost/express-development',
},
},
test: {
server: {
port: pro... | const env = process.env.NODE_ENV || 'development';
const config = {
development: {
server: {
port: process.env.PORT || 3000,
hostname: process.env.HOSTNAME || 'localhost',
},
database: {
url: 'mongodb://localhost/express-development',
},
},
test: {
server: {
port: pro... | Add environment properties: isDev, isTest, isProd | Add environment properties: isDev, isTest, isProd
| JavaScript | mit | oguzhanoya/express-mvc-boilerplate,oguzhanoya/express-mvc-boilerplate |
917752e5ad63d469df0711d69696ca5771503a3d | influx-stats-store.js | influx-stats-store.js | 'use strict'
var influx = require('influx')
var _ = require('lodash')
var defaults = {
plugin: 'influx-stats-store',
enabled: true,
log_input: false,
log_output: false,
influx: {
host:'localhost',
port:'8086',
username:'stats',
password:'stats',
database:'seneca_stats'
}
}
module.expo... | 'use strict'
var influx = require('influx')
var _ = require('lodash')
var defaults = {
plugin: 'influx-stats-store',
enabled: true,
log_input: false,
log_output: false,
influx: {
host:'localhost',
port:'8086',
username:'stats',
password:'stats',
database:'seneca_stats'
}
}
module.expo... | Update to new stats format | Update to new stats format
| JavaScript | mit | vidi-insights/vidi-influx-sink |
2a28607018a325d2af506473e916f2848d3b5359 | es6.js | es6.js | 'use strict';
module.exports = {
extends: 'rowno',
env: { es6: true },
rules: {
// ES6
'arrow-parens': 1,
'arrow-spacing': [1, { before: true, after: true }],
'constructor-super': 2,
'generator-star-spacing': [1, { before: true, after: false }],
'no-class-ass... | 'use strict';
module.exports = {
extends: 'rowno',
env: { es6: true },
rules: {
// ES6
'arrow-body-style': [2, 'as-needed'],
'arrow-parens': 1,
'arrow-spacing': [1, { before: true, after: true }],
'constructor-super': 2,
'generator-star-spacing': [1, { before... | Add new eslint 1.8.0 options | Add new eslint 1.8.0 options
| JavaScript | isc | Rowno/eslint-config-rowno |
50f0e8c4f730614dd0429deb2e9d34b7c415dfc5 | src/subgenerators/arrays.js | src/subgenerators/arrays.js | // [...elements]
exports.ArrayExpression = (node, generator) => {
generator.advance("[");
node.elements.forEach((elementNode, idx) => {
if (idx !== 0) { generator.advance(","); }
generator.generate(elementNode);
});
generator.advance("]");
};
| // [...elements]
exports.ArrayExpression = (node, generator) => {
generator.advance("[");
node.elements.forEach((elementNode, idx) => {
if (idx !== 0) { generator.advance(","); }
if (elementNode !== null) {
generator.generate(elementNode);
}
});
generator.advance("]");
};
| Allow for empty array elements, like [1, , 3]. | Allow for empty array elements, like [1, , 3].
| JavaScript | mit | interlockjs/intergenerator |
cb9f64bcffa478da83b09cae2bf5fa031a952ad6 | js/apps/system/aardvark/frontend/js/views/applicationDetailView.js | js/apps/system/aardvark/frontend/js/views/applicationDetailView.js | /*jshint browser: true */
/*jshint strict: false, unused: false */
/*global Backbone, $, window, arangoHelper, templateEngine, Joi, _*/
window.ApplicationDetailView = Backbone.View.extend({
el: '#content',
template: templateEngine.createTemplate('applicationDetailView.ejs'),
events: {
'click .open': 'openA... | /*jshint browser: true */
/*jshint strict: false, unused: false */
/*global Backbone, $, window, arangoHelper, templateEngine, Joi, _*/
window.ApplicationDetailView = Backbone.View.extend({
el: '#content',
template: templateEngine.createTemplate('applicationDetailView.ejs'),
events: {
'click .open': 'openA... | Enable button if the app is neither devel nor system | Enable button if the app is neither devel nor system
| JavaScript | apache-2.0 | nvoron23/arangodb,aurelijusb/arangodb,nvoron23/arangodb,kkdd/arangodb,nvoron23/arangodb,nvoron23/arangodb,nvoron23/arangodb,razvanphp/arangodb,mujiansu/arangodb,kkdd/arangodb,aurelijusb/arangodb,mujiansu/arangodb,mujiansu/arangodb,aurelijusb/arangodb,nekulin/arangodb,kkdd/arangodb,mujiansu/arangodb,abaditsegay/arangodb... |
96bb615ed3d9d9986f5bd8055b2b84e89f23944b | bin/pages_build.js | bin/pages_build.js | var ghpages = require('gh-pages');
var path = require('path');
ghpages.publish(path.join(__dirname, 'build'), function(err) { console.log('Built, yo') });
| var ghpages = require('gh-pages');
var path = require('path');
ghpages.publish(path.join(__dirname, '..', 'build'), function(err) {
if (err) {
console.log('Build errors OH NOES', err);
} else {
console.log('Built, yo');
}
});
| Add proper output in gh-pages build script | Add proper output in gh-pages build script
| JavaScript | mit | mileszs/dwtools,mileszs/dwtools |
8d5d215aaa75579f0ab5af77f0edd259b6d264fa | lib/lumbar-long-expires.js | lib/lumbar-long-expires.js | var exec = require('child_process').exec,
lumbar = require('lumbar');
module.exports = {
generateToken: function(command, callback) {
if (!command) {
return callback(undefined, '');
}
exec(command, {cwd: lumbar.fileUtil.lookupPath()}, function(err, stdout, stderr) {
callback(err, (stdout... | var exec = require('child_process').exec,
lumbar = require('lumbar');
module.exports = {
generateToken: function(command, callback) {
if (!command) {
return callback(undefined, '');
}
exec(command, {cwd: lumbar.fileUtil.lookupPath()}, function(err, stdout, stderr) {
callback(err, (stdout... | Store expires token on the config cache | Store expires token on the config cache
This will help prevent errors where the token changes and not all resources are updated to reflect the change. | JavaScript | mit | walmartlabs/lumbar-long-expires |
8dfa260726c14015e0fd2bd6d40f0ca336a85a06 | git-date.js | git-date.js | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
let fatal = err => {
console.error(`fatal: ${err}`);
process.exit(1);
};
process.argv.splice(0, 2);
if (process.argv.length === 0) {... | #!/usr/bin/env node
"use strict";
const moment = require("moment");
const sugar = require("sugar");
const chalk = require("chalk");
const exec = require("child_process").exec;
let fatal = err => {
console.error(`fatal: ${err}`);
process.exit(1);
};
process.argv.splice(0, 2);
if (process.argv.length === 0) {... | Change colour of command executed | Change colour of command executed
| JavaScript | mit | sam3d/git-date |
c479a91b96ce6741980ef493a8a6fc7bed32cf1a | docs/leaderboard-component/src/index.js | docs/leaderboard-component/src/index.js | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import { LeaderBoard } from './components/LeaderBoard';
// import registerServiceWorker from './registerServiceWorker';
export default {
DEConfig: null,
config: (config) => {
this.DEConfig = config;
},
components: {
... | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import { LeaderBoard } from './components/LeaderBoard';
// import registerServiceWorker from './registerServiceWorker';
// Uncomment this to build for production
export default {
DEConfig: null,
config: (config) => {
this.... | Clean up. Comments for running in prod and dev | Clean up. Comments for running in prod and dev
| JavaScript | apache-2.0 | dashboardearth/rewardsplatform,dashboardearth/rewardsplatform,dashboardearth/rewardsplatform,dashboardearth/rewardsplatform,dashboardearth/rewardsplatform,dashboardearth/rewardsplatform,dashboardearth/rewardsplatform,dashboardearth/rewardsplatform |
0a2b5cd94f5d282f52a1f5d19aa4c50ddfac40b2 | lib/options.js | lib/options.js | // Includes
var request = require('request-promise');
var settings = require('../settings.json');
var session_only = settings.session_only;
exports.sessionOnly = session_only;
exports.jar = (session_only ? {session: ''} : request.jar());
exports.errorHandler = function (err) {
console.error(err.stack);
};
var cach... | // Includes
var settings = require('../settings.json');
var jar = require('./util/jar.js').func;
var newCache = require('./cache/new.js');
exports.init = function () {
exports.jar = jar();
var cacheList = [];
var cache = settings.cache;
for (var name in cache) {
var item = cache[name];
var cacheObj = ... | Adjust for reformat and add init | Adjust for reformat and add init
Options can now be reinitialized if settings change during the run
| JavaScript | mit | sentanos/roblox-js,FroastJ/roblox-js,OnlyTwentyCharacters/roblox-js |
1e28d7990d0bc0ca375dc9c240088ce4f80d8db5 | javascript/sitetree-noedit.js | javascript/sitetree-noedit.js | /*
* Do not display ability to add pages or Settings tab
* loaded only when !Permission::check('SITETREE_REORGANISE')
*/
(function($){
$.entwine('ss', function($){
/* Hide Add Page button */
$('a.cms-page-add-button').entwine({
onmatch: function(){
this.hide();
}
});
/* Hide Settings Tab */
$('ul... | /*
* Do not display ability to add pages or Settings tab
* loaded only when !Permission::check('SITETREE_REORGANISE')
*/
(function($){
$.entwine('ss', function($){
/* Hide Add Page button */
$('a[href="admin/pages/add/"]').entwine({
onmatch: function(){
this.hide();
}
});
/* Hide Settings Tab */
... | Fix removal of "Add new" page | Fix removal of "Add new" page
| JavaScript | mit | axllent/silverstripe-cms-tweaks,axllent/silverstripe-cms-tweaks |
c2c0633b3733a65d5fb40781b022f46ed0cb817f | client/ksEdit.js | client/ksEdit.js | Template.ksEdit.helpers({
ks: function () {
var ks = this;
ks.books = Books.find();
return ks;
}
});
Template.ksEdit.events({
'submit form': function (elt) {
var _id = $('input.id').val(),
ks = _id ? KSessions.findOne(_id) : {};
elt.preventDefault();
ks.i = +$("input.i").val();
... | Template.ksEdit.helpers({
ks: function () {
var ks = this;
ks.books = Books.find();
return ks;
}
});
Template.ksEdit.events({
'submit form': function (elt) {
var _id = $('input.id').val(),
ks = _id ? KSessions.findOne(_id) : {};
elt.preventDefault();
ks.i = +$("input.i").val();
... | Insert or update anonymous when no klubmaster are specify | Insert or update anonymous when no klubmaster are specify
| JavaScript | mit | claudeaubry/klub,claudeaubry/klub,claudeaubry/klub |
8038f4280727dc77bc76c72b41ef38e858418851 | js/widgets/clock/timezones.js | js/widgets/clock/timezones.js | var timeZoneData = {
"UTC/UTC": 0,
"Europe/London": 0,
"Europe/Amsterdam": 1,
"America/Los_Angeles":-8,
"America/Minneapolis":-6,
"America/New_York":-5,
"Europe/Moscow":+3,
"Asia/Novosibirsk":+6
};
| var timeZoneData = {
"UTC/UTC": 0,
"Europe/London": 0,
"Europe/Amsterdam": 1,
"America/Los_Angeles":-8,
"America/Denver":-7,
"America/Minneapolis":-6,
"America/New_York":-5,
"Europe/Moscow":3,
"Asia/Hong_Kong":8,
"Asia/Beijing":8,
"Asia/Novosibirsk":6
};
| Add a few more needed time zones to clock widget | Add a few more needed time zones to clock widget
| JavaScript | agpl-3.0 | sipcapture/homer-ui,sipcapture/homer-ui,sipcapture/homer-ui |
2362e791fe35307d049e1e20d5520d1cc70fbd14 | bufferjs/concat.js | bufferjs/concat.js | (function () {
"use strict";
function concat(bufs) {
var buffer, length = 0, index = 0;
if (!Array.isArray(bufs)) {
bufs = Array.prototype.slice.call(arguments);
}
for (var i=0, l=bufs.length; i<l; i++) {
buffer = bufs[i];
if (!Buffer.isBuffer(buffer)) {
buffer = bufs[i] ... | (function () {
"use strict";
function concat(bufs) {
if (!Array.isArray(bufs)) {
bufs = Array.prototype.slice.call(arguments);
}
var bufsToConcat = [], length = 0;
bufsToConcat.forEach(function (buf) {
if (buf) {
if (!Buffer.isBuffer(buf)) {
buf = new Buffer(b... | Fix to allow for null buffers to be passed in. | Fix to allow for null buffers to be passed in. | JavaScript | mit | coolaj86/node-bufferjs,alexbooker/node-bufferjs |
457ab5bd35a2856f5a3c177628ec80b959745130 | registration/point-set/js/hungarian.js | registration/point-set/js/hungarian.js | /*exported Hungarian*/
var Hungarian = (function() {
'use strict';
/**
* Array minima mutation functions.
*/
function subtractRowMinima( row ) {
var min = Math.min.apply( Math, row );
for ( var i = 0, il = row.length; i < il; i++ ) {
row[i] -= min;
}
return row;
}
/**
* Take... | /*exported Hungarian*/
var Hungarian = (function() {
'use strict';
/**
* Array minima mutation functions.
*/
function subtractRowMinima( row ) {
var min = Math.min.apply( Math, row );
for ( var i = 0, il = row.length; i < il; i++ ) {
row[i] -= min;
}
return row;
}
function subt... | Add Hungarian minima subtraction step. | registration[points]: Add Hungarian minima subtraction step.
| JavaScript | mit | razh/experiments,razh/experiments,razh/experiments |
7ee40072cda05e656a3695d8ce02205cfbd9e35c | src/js/googleOauth.js | src/js/googleOauth.js | 'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
constant('GoogleTokenVerifier', function($http) {
retur... | 'use strict';
/**
* A module to include instead of `angularOauth` for a service preconfigured
* for Google OAuth authentication.
*
* Guide: https://developers.google.com/accounts/docs/OAuth2UserAgent
*/
angular.module('googleOauth', ['angularOauth']).
constant('GoogleTokenVerifier', function(config, accessToke... | Fix bug in GoogleTokenVerifier causing it never to work. | Fix bug in GoogleTokenVerifier causing it never to work.
Apparently, I was horribly misusing constants. Comprehensive tests would have uncovered this. I'm not convinced that I'm doing the right thing by injecting services inside the verification function, and this particular section (the verification function and ho... | JavaScript | mit | mutualmobile/angular-oauth,mutualmobile/angular-oauth,angular-oauth/angular-oauth |
8addfb0dffbc46ff053a44b5f3cbcb1c3f4ba340 | lib/rules/mixins-before-declarations.js | lib/rules/mixins-before-declarations.js | 'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'mixins-before-declarations',
'defaults': {
'exclude': [
'breakpoint',
'mq'
]
},
'detect': function (ast, parser) {
var result = [],
error;
ast.traverseByType('include', function (node, i, parent... | 'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'mixins-before-declarations',
'defaults': {
'exclude': [
'breakpoint',
'mq'
]
},
'detect': function (ast, parser) {
var result = [],
error;
ast.traverseByType('include', function (node, i, parent... | Fix mixins-before-declaration rule to work with latest gonzales | :art: Fix mixins-before-declaration rule to work with latest gonzales
| JavaScript | mit | srowhani/sass-lint,sasstools/sass-lint,sasstools/sass-lint,srowhani/sass-lint,sktt/sass-lint,DanPurdy/sass-lint,flacerdk/sass-lint,bgriffith/sass-lint |
dffffcda17f07fe8ff11e78056dc3ffa33a27cd5 | base.js | base.js | var util = require('util');
module.exports = function (name, defaultMessage, status) {
util.inherits(Constructor, Error);
return Constructor;
function Constructor (message, code) {
Error.call(this, message || defaultMessage);
Error.captureStackTrace(this, arguments.callee);
this.name = name;
t... | var util = require('util');
module.exports = function (name, defaultMessage, status) {
util.inherits(Constructor, Error);
return Constructor;
function Constructor (message, code) {
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
this.name = name;
this.message = message || de... | Revert "Set error message using constructor" | Revert "Set error message using constructor"
This reverts commit 931fa47355cb7f5d5bce4d77affb7313211ac043.
| JavaScript | mit | aantthony/errors |
a064b8d6438fff5a83fb03c463fe03a69b8342d2 | server/richer-editor-setting-helper.js | server/richer-editor-setting-helper.js | Meteor.startup(() => {
const RCCE = process.env.RICHER_CARD_COMMENT_EDITOR;
if (RCCE) {
Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR = RCCE !== 'false';
}
});
| Meteor.startup(() => {
// Disable comment WYSIWYG editor for everyone to fix
// Pasting text into a card is adding a line before and after
// (and multiplies by pasting more)
// https://github.com/wekan/wekan/issues/2890
Meteor.settings.public.RICHER_CARD_COMMENT_EDITOR = 'false';
//// Old original code f... | Fix Pasting text into a card is adding a line before and after (and multiplies by pasting more) by disabling WYSIWYG comment editor for everyone. | Fix Pasting text into a card is adding a line before and after
(and multiplies by pasting more) by disabling WYSIWYG comment editor
for everyone.
Closes #2890
| JavaScript | mit | wekan/wekan,wekan/wekan,wekan/wekan,wekan/wekan,wekan/wekan |
ce0331a4ac92fa702f1afea3d5064f7606bb607a | tests/unit/models/notification-test.js | tests/unit/models/notification-test.js | import { moduleForModel, test } from 'ember-qunit';
moduleForModel('notification', 'Unit | Model | notification', {
// Specify the other units that are required for this test.
needs: []
});
test('it exists', function(assert) {
let model = this.subject();
// let store = this.store();
assert.ok(!!model);
});
| import { moduleForModel, test } from 'ember-qunit';
moduleForModel('notification', 'Unit | Model | notification', {
needs: []
});
test('it exists', function (assert) {
assert.expect(1);
const model = this.subject();
assert.ok(!!model);
});
test('it should have a creation date', function (assert) {
assert... | Add basic unit test for notification model | Add basic unit test for notification model
Reviewers: asteinlein
Reviewed By: asteinlein
Differential Revision: http://dev.e5r.no/D3847
| JavaScript | mit | eliksir/ember-notification-center,eliksir/ember-notification-center |
4b2298e1eb7988798b0ab60406dc256b7ff34d38 | app/models/courseList.js | app/models/courseList.js | 'use strict';
import * as _ from 'lodash'
import * as React from 'react'
import Course from './course'
var CourseList = React.createClass({
render() {
// console.log('courses', courseElements)
return React.DOM.div({className: 'course-list'},
_.map(this.props.courses,
course => Course({key: course.clbid,... | 'use strict';
import * as _ from 'lodash'
import * as React from 'react'
import Course from './course'
import {DragDropMixin} from '../../node_modules/react-dnd/dist/ReactDND.min'
import itemTypes from '../objects/itemTypes'
var CourseList = React.createClass({
mixins: [DragDropMixin],
configureDragDrop(registe... | Make CourseList accept dropped Courses Logs the clbid of the dropped course | Make CourseList accept dropped Courses
Logs the clbid of the dropped course
| JavaScript | agpl-3.0 | hawkrives/gobbldygook,hawkrives/gobbldygook,hawkrives/gobbldygook |
821902601267a636fd2ef8c404f220b6439334bf | client/mobrender/components/widget-overlay.js | client/mobrender/components/widget-overlay.js | import React, { PropTypes } from 'react'
const WidgetOverlay = ({ children, widget, onClick, onMouseOver, onMouseOut, hasMouseOver }) => (
<div
className='relative'
style={{ cursor: 'pointer' }}
onMouseOver={() => onMouseOver('widget', widget.id)}
onMouseOut={() => onMouseOut('widget')}
onClick={... | import React, { PropTypes } from 'react'
const overlayStyle = {
position: 'absolute',
top: '0',
right: '0',
bottom: '0',
left: '0',
fontWeight: 'bold',
borderWidth: '6px',
opacity: '.82',
backgroundColor: '#222222',
fontSize: '1.8rem'
}
const WidgetOverlay = ({ children, widget, onClick, onMouseOv... | Add overlay style to widget overlay | Add overlay style to widget overlay
| JavaScript | agpl-3.0 | nossas/bonde-client,nossas/bonde-client,nossas/bonde-client |
d5bded8b974655f9a7ead3f5ca0b0f899cc72cea | webpack-lean.config.js | webpack-lean.config.js | // The lean build does not include any of the third-party runtime dependencies, rather
// it assumes they are in the global namespace at runtime.
var config = require('./webpack.base.config');
var merge = require('webpack-merge');
module.exports = merge(config, {
entry: {
'geo.lean': './index.js',
'geo.lean.... | // The lean build does not include any of the third-party runtime dependencies, rather
// it assumes they are in the global namespace at runtime.
var config = require('./webpack.base.config');
var merge = require('webpack-merge');
module.exports = merge(config, {
entry: {
'geo.lean': './index.js',
'geo.lean.... | Exclude vtk.js from lean bundle | Exclude vtk.js from lean bundle
| JavaScript | apache-2.0 | Kitware/geojs,OpenGeoscience/geojs,Kitware/geojs,Kitware/geojs,OpenGeoscience/geojs,OpenGeoscience/geojs |
335d7ab22aae3a0e8d9432777c1484c811bf823a | js/components/content-header.js | js/components/content-header.js | (function(app) {
'use strict';
var jCore = require('jcore');
var helper = app.helper || require('../helper.js');
var dom = app.dom || require('../dom.js');
var ContentHeader = helper.inherits(function(props) {
ContentHeader.super_.call(this);
this.sidebarToggleType = this.prop(ContentHeader.SIDEBAR... | (function(app) {
'use strict';
var jCore = require('jcore');
var helper = app.helper || require('../helper.js');
var dom = app.dom || require('../dom.js');
var ContentHeader = helper.inherits(function(props) {
ContentHeader.super_.call(this);
this.sidebarToggleType = this.prop(ContentHeader.SIDEBAR... | Change the toggle button icon according to sidebar-toggle-type | Change the toggle button icon according to sidebar-toggle-type
| JavaScript | mit | ionstage/modular,ionstage/modular |
20f03a3234b72667efcfa65ac505adcc451fc06e | src/global/registry.js | src/global/registry.js | import apiEmit from '../api/emit';
import globals from './vars';
import hasOwn from '../util/has-own';
import typeElement from '../type/element';
var definitions = {};
var map = [];
var types = [];
export default globals.registerIfNotExists('registry', {
get (id) {
return hasOwn(definitions, id) && definitions[... | import globals from './vars';
import hasOwn from '../util/has-own';
import typeElement from '../type/element';
var definitions = {};
var map = [];
var types = [];
export default globals.registerIfNotExists('registry', {
get (id) {
return hasOwn(definitions, id) && definitions[id];
},
set (id, opts) {
if... | Remove importing of emit() as it's not needed. | Remove importing of emit() as it's not needed.
| JavaScript | mit | skatejs/skatejs,chrisdarroch/skatejs,antitoxic/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs |
f369ff0410f4098d047cad03fc910a929ae0c977 | client/src/ui/HeroStats/index.js | client/src/ui/HeroStats/index.js | /** @jsx React.DOM */
var React = require("react");
var GameModel = require("../../GameModel");
var HeroStats = React.createClass({
propTypes: {
game: React.PropTypes.instanceOf(GameModel).isRequired,
hero: React.PropTypes.object.isRequired
},
render: function(){
var hero = this.props.hero;
var f... | /** @jsx React.DOM */
var React = require("react");
var GameModel = require("../../GameModel");
var HeroStats = React.createClass({
propTypes: {
game: React.PropTypes.instanceOf(GameModel).isRequired,
hero: React.PropTypes.object.isRequired
},
render: function(){
var hero = this.props.hero;
var f... | Add back the "crashed" icon when an AI stopped responding | Add back the "crashed" icon when an AI stopped responding
| JavaScript | mit | printedheart/vindinium,concerned3rdparty/vindinium,ornicar/vindinium,printedheart/vindinium,ornicar/vindinium,ornicar/vindinium,concerned3rdparty/vindinium,concerned3rdparty/vindinium,printedheart/vindinium |
661097a6a412d15b086581582e3021af20fd3b2a | sw-precache-config.js | sw-precache-config.js | module.exports = {
staticFileGlobs: [
'manifest.json',
'bower_components/webcomponentsjs/*.js',
'images/*'
],
runtimeCaching: [
{
urlPattern: /\/data\/images\/.*/,
handler: 'cacheFirst',
options: {
cache: {
maxEntries: 200,
name: 'items-cache'
... | module.exports = {
navigateFallbackWhitelist: [/^\/nothing\//],
staticFileGlobs: [
'manifest.json',
'bower_components/webcomponentsjs/*.js',
'images/*'
],
runtimeCaching: [
{
urlPattern: /\/data\/images\/.*/,
handler: 'cacheFirst',
options: {
cache: {
maxEntri... | Fix : exclude api from whitelist | Fix : exclude api from whitelist
| JavaScript | apache-2.0 | frocher/bnb_app,frocher/bnb_app |
1fe2dd54b39754c66599c3b7656382bfbf33204a | site/src/main/resources/theme/js/demo/maps.js | site/src/main/resources/theme/js/demo/maps.js | define([], function(){
var maps = [
L.mapbox.map('map-1', 'azavea.i8f6m5el'),
L.mapbox.map('map-2', 'azavea.i8f6m5el'),
L.mapbox.map('map-3', 'azavea.i8f6m5el')
];
maps[0].setView([39.99, -75.21], 12);
maps[1].setView([46.30, -121.50], 11);
_.forEach(maps, function(map) {
map.scrollWheelZoom... | define([], function(){
var maps = [
L.mapbox.map('map-1', 'azavea.i8f80o61'),
L.mapbox.map('map-2', 'azavea.i8f80o61'),
L.mapbox.map('map-3', 'azavea.i8f80o61')
];
maps[0].setView([39.99, -75.21], 12);
maps[1].setView([46.30, -121.50], 11);
_.forEach(maps, function(map) {
map.scrollWheelZoom... | Use Azavea's mapbox account for real this time | Use Azavea's mapbox account for real this time
| JavaScript | apache-2.0 | geotrellis/geotrellis-site,geotrellis/geotrellis-site,geotrellis/geotrellis-site,geotrellis/geotrellis-site |
13575e09306f616198f3a58e60c633f985ee4c24 | lib/apis.js | lib/apis.js | module.exports = {};
function define( key, value ) {
module.exports[key] = value;
}
define( 'token', { 'get' : '/user/getToken' } );
define( 'message', { 'publish' : '/message/publish', 'broadcast' : '/message/broadcast' } );
define( 'group', { 'sync' : '/group/sync', 'create' : '/group/create' } ); | module.exports = {};
function define( key, value ) {
module.exports[key] = value;
}
define( 'token', { 'get' : '/user/getToken' } );
define( 'message', { 'publish' : '/message/publish', 'broadcast' : '/message/broadcast' } );
define( 'group', { 'sync' : '/group/sync', 'create' : '/group/create', 'quit' : '/group/qui... | Add the path definition for quiting group API. | Add the path definition for quiting group API.
| JavaScript | mit | coocon/server-sdk-nodejs,rongcloud/server-sdk-nodejs,crystaldust/server-sdk-nodejs |
5013b427baa7ac0cc82f0a52ae8eab7364e8186c | app/scripts/app/views/groups.js | app/scripts/app/views/groups.js | var GroupsView = Em.View.extend({
classNameBindings: ['groups', 'animateMe:yoyo:yaya'],
init: function () {
this._super();
this.one('click', this, function (e) { console.log('clicked !! ', this, e)});
window.a = this;
},
tryThis: function () {
var yesnow = this.get('controller.yesnow');
if... | var GroupsView = Em.View.extend({
classNameBindings: ['groups'],
});
export default GroupsView;
| Remove experimental fluff from GroupsView | Remove experimental fluff from GroupsView
| JavaScript | mit | darvelo/wishlist,darvelo/wishlist |
ece0ca35a1879bdac1c063a797e0a871241904ac | src/js/components/app-WeeklyViewDay.js | src/js/components/app-WeeklyViewDay.js | /*global require, module*/
/** @jsx React.DOM */
var React = require('react'),
randomMC = require('random-material-color');
var WeeklyViewDay = React.createClass({
render: function () {
"use strict";
var iconStyle = {
backgroundColor: randomMC.getColor({ text: this.props.taskName ... | /*global require, module*/
/** @jsx React.DOM */
var React = require('react'),
randomMC = require('random-material-color');
var WeeklyViewDay = React.createClass({
render: function () {
"use strict";
var iconStyle = {
backgroundColor: randomMC.getColor({ text: this.props.taskName ... | Add hours for each task list item per day | Add hours for each task list item per day
| JavaScript | mit | AwadMaharoof/Lazymine,AwadMaharoof/Lazymine,Raathigesh/Lazymine,Raathigesh/Lazymine |
63b8fba326ae0d58687b700cbe1fcbe2437c261b | packages/accounts-weibo/package.js | packages/accounts-weibo/package.js | Package.describe({
summary: "Login service for Sina Weibo accounts",
version: "1.1.0"
});
Package.onUse(function(api) {
api.use('accounts-base', ['client', 'server']);
// Export Accounts (etc) to packages using this one.
api.imply('accounts-base', ['client', 'server']);
api.use('accounts-oauth', ['client',... | Package.describe({
summary: "Login service for Sina Weibo accounts",
version: "1.1.0"
});
Package.onUse(function(api) {
api.use('accounts-base', ['client', 'server']);
// Export Accounts (etc) to packages using this one.
api.imply('accounts-base', ['client', 'server']);
api.use('accounts-oauth', ['client',... | Change `twitter-oauth` => to `weibo-oauth` | Change `twitter-oauth` => to `weibo-oauth`
Seemingly copy-paste residue in the PR, but this is the Weibo package
it should be Weibo, not Twitter.
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor |
ba418a1a9f461c0539e487c7a051fdc6b5b6debf | addon-test-support/@ember/test-helpers/-utils.js | addon-test-support/@ember/test-helpers/-utils.js | import { Promise } from 'rsvp';
export const nextTick = setTimeout;
export const futureTick = setTimeout;
/**
@private
@returns {Promise<void>} promise which resolves on the next turn of the event loop
*/
export function nextTickPromise() {
return new Promise(resolve => {
nextTick(resolve);
});
}
/**
Retr... | import { Promise } from 'rsvp';
export const nextTick =
typeof Promise === 'undefined' ? setTimeout : cb => Promise.resolve().then(cb);
export const futureTick = setTimeout;
/**
@private
@returns {Promise<void>} promise which resolves on the next turn of the event loop
*/
export function nextTickPromise() {
ret... | Allow internal `nextTick` utility to use microtasks when possible. | Allow internal `nextTick` utility to use microtasks when possible.
| JavaScript | apache-2.0 | switchfly/ember-test-helpers,switchfly/ember-test-helpers |
d60bdf0d786a579a3b6c7eec6ae1ed1a378623e1 | lib/make.js | lib/make.js | /**
* Runs "make generator" using a child process.
*
* @package generator
* @author Andrew Sliwinski <andrew@diy.org>
*/
/**
* Dependencies
*/
var child = require('child_process');
/**
* Export
*/
module.exports = function (path, callback) {
var exec = child.exec('make generator', {cwd: path});
exec... | /**
* Runs "make generator" using a child process.
*
* @package generator
* @author Andrew Sliwinski <andrew@diy.org>
*/
/**
* Dependencies
*/
var child = require('child_process');
/**
* Export
*/
module.exports = function (path, callback) {
var exec = child.exec('make generator', {cwd: path});
exec... | Handle child process errors gracefully | Handle child process errors gracefully
| JavaScript | mit | thisandagain/generator |
706ca42a0aab9c3e9a8e2063cfac4d90a4708df8 | helpers/utils.js | helpers/utils.js |
module.exports.isValidUrl = function(_url) {
if (_url && typeof _url === 'string' && _url.indexOf('amqp://') === 0) {
return true;
}
return false;
};
module.exports.parseMsg = function(_msg) {
if (_msg.properties.contentType === 'application/json') {
return JSON.parse(_msg.content.toString());
}
... |
module.exports.isValidUrl = function(_url) {
if (_url && typeof _url === 'string' && (_url.indexOf('amqp://') === 0 || _url.indexOf('amqps://') === 0)) {
return true;
}
return false;
};
module.exports.parseMsg = function(_msg) {
if (_msg.properties.contentType === 'application/json') {
return JSON.... | Check if is secured url | Check if is secured url
| JavaScript | mit | dial-once/node-bunnymq |
7d74c770b08a8878e38a6193472935d942828bde | client/js/libs/obaAPI.js | client/js/libs/obaAPI.js | import fetch from 'isomorphic-fetch';
import queryString from 'query-string';
export default function request(endpoint, query = {}) {
// const url = `http://localhost:8080/api/where/${endpoint}.json`;
// const url = `http://ec2-52-34-101-15.us-west-2.compute.amazonaws.com:8080/api/where/${endpoint}.json`;
const... | import fetch from 'isomorphic-fetch';
import queryString from 'query-string';
export default function request(endpoint, query = {}) {
// const url = `http://localhost:8080/api/where/${endpoint}.json`;
const url = `http://52.35.48.91:8080/api/where/${endpoint}.json`;
// const url = `http://api.tampa.onebusaway.o... | Use elastic ip for austin OBA instance | Use elastic ip for austin OBA instance
| JavaScript | unlicense | open-austin/instabus,open-austin/instabus |
75cde6ab800aba0102eccf10b8198f27a02b05eb | __tests__/src/store/index.js | __tests__/src/store/index.js | /* globals describe, expect, it, jest */
describe('store', () => {
it('should create a development redux store with the reducers passed', () => {
jest.resetModules()
process.env.NODE_ENV = 'development'
const createStore = require('../../../src/store')
const store = createStore({})
expect(store.... | // @flow
describe('store', () => {
beforeEach(() => jest.resetModules())
afterEach(() => jest.resetModules())
it('should create a development redux store with the reducers passed', () => {
process.env.NODE_ENV = 'development'
const createStore = require('../../../src/store')
const store = createStore... | Reset jest modules and NODE_ENV after store tests | test(store): Reset jest modules and NODE_ENV after store tests
| JavaScript | mit | conveyal/woonerf |
dd937a59b116cc1a0038fb6c1bc966a039bdc225 | lib/rules/mixins-before-declarations.js | lib/rules/mixins-before-declarations.js | 'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'mixins-before-declarations',
'defaults': {
'exclude': [
'breakpoint',
'mq'
]
},
'detect': function (ast, parser) {
var result = [],
error;
ast.traverseByType('include', function (node, i, parent... | 'use strict';
var helpers = require('../helpers');
module.exports = {
'name': 'mixins-before-declarations',
'defaults': {
'exclude': [
'breakpoint',
'mq'
]
},
'detect': function (ast, parser) {
var result = [],
error;
ast.traverseByType('include', function (node, i, parent... | Fix mixins-before-declaration rule to work with latest gonzales | :art: Fix mixins-before-declaration rule to work with latest gonzales
| JavaScript | mit | bgriffith/sass-lint,srowhani/sass-lint,sktt/sass-lint,sasstools/sass-lint,srowhani/sass-lint,sasstools/sass-lint,flacerdk/sass-lint,DanPurdy/sass-lint |
bb61d714a0d7fbd97a6d4341ff9744424691db60 | jquery.touchclick.js | jquery.touchclick.js | (function ($) {
$.event.special.touchclick = {
setup: function () {
if (typeof window.ontouchstart !== "undefined") {
$(this).on('touchstart', $.event.special.touchclick.touchstart);
$(this).on('touchmove', $.event.special.touchclick.touchmove);
$(... | (function ($) {
$.event.special.touchclick = {
setup: function () {
if (typeof window.ontouchstart !== "undefined") {
$(this).on("touchstart", $.event.special.touchclick.touchstart);
$(this).on("touchmove", $.event.special.touchclick.touchmove);
$(... | Apply touchactive for mouse and touch | Apply touchactive for mouse and touch
| JavaScript | mit | tuxracer/touchclick,tuxracer/touchclick |
6ee9721b32906326e97204b0bb00421484680cd8 | blueprints/ember-cli-summernote/index.js | blueprints/ember-cli-summernote/index.js | module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {
var that = this;
return that.addBowerPackageToProject('summernote', "~0.7.0");
//
// return this.addBowerPackageToProject('rangy-1.3').then(function() {
// return this.addBowerPackageToProject('wysihtml5x').th... | module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {
var that = this;
return that.addBowerPackageToProject('summernote', "0.8.3");
}
};
| Fix the bug of summernote dependency mismatch between the blueprint and the package.js thanks to @billdami. It causes the error while running the blueprint | Fix the bug of summernote dependency mismatch between the blueprint and the package.js thanks to @billdami.
It causes the error while running the blueprint
| JavaScript | mit | vsymguysung/ember-cli-summernote,vsymguysung/ember-cli-summernote |
7bbf6bdd91edfafea7b9b6dfb079e08fa39c29eb | lib/server/middleware/sender.js | lib/server/middleware/sender.js | var path = require('path');
var deliver = require('deliver');
var mime = require('mime');
var url = require('url');
module.exports = function (fileStore) {
return function (req, res, next) {
res.send = function (pathname, isNotRelative, statusCode) {
req.url = (isNotRelative)
? pathname
: f... | var path = require('path');
var deliver = require('deliver');
var mime = require('mime');
var url = require('url');
module.exports = function (fileStore) {
return function (req, res, next) {
res.send = function (pathname, isNotRelative, statusCode) {
req.url = (isNotRelative)
? pathname
: f... | Set status code for now found | Set status code for now found
| JavaScript | mit | carrot/superstatic,firebase/superstatic,firebase/superstatic,firebase/superstatic,aj0strow/superstatic,divshot/superstatic,aj0strow/superstatic,nnnnathann/superstatic,cysys/stratum,cysys/stratum,divshot/superstatic |
47abeb32ae67762a5cc38145015f7d75189d4637 | src/js/components/PrimarySidebarLink.js | src/js/components/PrimarySidebarLink.js | import classNames from "classnames";
import React from "react";
import { Link } from "react-router";
import NotificationStore from "../stores/NotificationStore";
const PrimarySidebarLink = ({
to,
children,
hasChildren,
icon,
isChildActive,
isExpanded,
onClick
}) => {
const notificationCount = Notifica... | import classNames from "classnames";
import React from "react";
import { Link } from "react-router";
import NotificationStore from "../stores/NotificationStore";
const PrimarySidebarLink = ({
to,
children,
hasChildren,
icon,
isChildActive,
isExpanded,
onClick
}) => {
const notificationCount = Notifica... | Change badge style on sidebar notification count | style(badge): Change badge style on sidebar notification count
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
c388a85b87c85d2996474e73dab22bcbb709eb71 | src/components/Footer/component.js | src/components/Footer/component.js | import React from 'react'
import './style.scss'
const Footer = () => {
return (
<div className="footer container">
<hr/>
<div className="grid">
<p className="left">
© 2013 - { new Date().getUTCFullYear() } IPv6-adresse.dk
<span className="sep">·</span>
<a hr... | import React from 'react'
import './style.scss'
const Footer = () => {
return (
<div className="footer container">
<hr/>
<div className="grid">
<p className="left">
© 2013 - { new Date().getUTCFullYear() } IPv6-adresse.dk
<span className="sep">·</span>
<a hr... | Remove www from footer links | Remove www from footer links | JavaScript | mit | emilstahl/ipv6 |
c2651fac1891a4aa120c00f99525f254363b0070 | Gruntfile.js | Gruntfile.js | /*
* Copyright 2013, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/node-gh/gh/blob/master/LICENSE.md
*
* @author Zeno Rocha <zno.rocha@gmail.com>
*/
module.exports = function(grunt) {
grunt.initConfig({
jsbeautifier: {
files: ['bin/*.js', 'lib/**/*.js... | /*
* Copyright 2013, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/node-gh/gh/blob/master/LICENSE.md
*
* @author Zeno Rocha <zno.rocha@gmail.com>
* @author Eduardo Lundgren <zno.rocha@gmail.com>
*/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-jsbeautifi... | Move task dependencies to the top | Move task dependencies to the top
| JavaScript | bsd-3-clause | TomzxForks/gh,henvic/gh,dustinryerson/gh,tomzx/gh,TomzxForks/gh,tomzx/gh,modulexcite/gh,oouyang/gh,oouyang/gh,dustinryerson/gh,henvic/gh,modulexcite/gh |
c295d9a6d223f5a27f7869cf00e94d3034518ded | src/routes/referrers.js | src/routes/referrers.js | 'use strict'
const { createError } = require('micro')
const referrers = require('../database/referrers')
const {
REFERRERS_SORTING_TOP,
REFERRERS_SORTING_RECENT
} = require('../constants/referrers')
const response = (entry) => ({
type: 'referrer',
data: {
id: entry._id,
count: entry.count
}
})
const respo... | 'use strict'
const { createError } = require('micro')
const referrers = require('../database/referrers')
const {
REFERRERS_SORTING_TOP,
REFERRERS_SORTING_RECENT
} = require('../constants/referrers')
const response = (entry) => ({
type: 'referrer',
data: {
id: entry._id,
count: entry.count
}
})
const respo... | Check if sorting exists when returning response | Check if sorting exists when returning response
| JavaScript | mit | electerious/Ackee |
fcf70985ccc27c6d9a097f98876b3ce061bcc5af | javascript/gallery.js | javascript/gallery.js | (function($) {
$(document).ready(function() {
var ad_galleries = $('.ad-gallery').adGallery();
});
})(jQuery)
| (function($) {
$(document).ready(function() {
var ad_galleries = $('.ad-gallery').adGallery({ loader_image: 'gallery/images/loader.gif' });
});
})(jQuery)
| Add default url for loading gif | Add default url for loading gif
| JavaScript | bsd-3-clause | ntd/silverstripe-gallery |
d0f5eecf703067fc9baa134151d7923514a0f168 | src/filters/display-name-filter.js | src/filters/display-name-filter.js | (function (angular, _) {
'use strict';
var drf = angular.module('drf-display-name-filter', []);
// A filter to return a display name.
drf.filter('drfDisplayName', function () {
return _.memoize(function (displayName, array) {
var foundName = _.find(array, {
value: ... | (function (angular, _) {
'use strict';
var drf = angular.module('drf-display-name-filter', []);
// A filter to return a display name.
// it matches the displayName from an array of objects, and returns the matching display_name.
// Example
// choice = 'choice 1';
//
// array = [
/... | Improve the comments on the filter. | Improve the comments on the filter.
| JavaScript | mit | incuna/djangular-rest-framework,incuna/djangular-rest-framework |
2c31ddd4e3475c3882e2edf9b577d11065152f0c | js/ui/options.js | js/ui/options.js | (function () {
// Add behaviour for option buttons
app(function (api) {
var resetbtn = document.querySelector("#resetbtn");
resetbtn.addEventListener("click", function () {
api.reset();
}, false);
});
})();
| (function () {
// Add behaviour for option buttons
app(function (api) {
var resetbtn = document.querySelector("#resetbtn");
resetbtn.addEventListener("click", function () {
api.reset();
}, false);
// Perform additional UI cleanup when reset is called
api.o... | Add extra UI cleanup for reset | Add extra UI cleanup for reset
Signed-off-by: Kaustav Das Modak <ba1ce5b1e09413a89404909d8d270942c5dadd14@yahoo.co.in>
| JavaScript | apache-2.0 | applait/finder,vasuki1996/finder,vasuki1996/finder,applait/finder |
c236523f0b079e528b761f5d516da87294591c1e | assets/static/js/garagepi.js | assets/static/js/garagepi.js | "use strict";
$(document).ready(function(){
var $btnLight = $("#btnLight");
var lightText = $btnLight.text();
var lightOn;
if (lightText = "Light On") {
lightOn = true;
} else {
lightOn = false;
}
function toggleGarageDoor() {
$.post("/toggle");
}
function turnLightOn() {
$.post("... | "use strict";
$(document).ready(function(){
var $btnLight = $("#btnLight");
var lightText = $btnLight.text();
var lightOn = (lightText == "Light Off");
function toggleGarageDoor() {
$.post("/toggle");
}
function turnLightOn() {
$.post("/light?state=on", parseLightState);
}
function turnLig... | Add callback for homepage javascript light POST request. | Add callback for homepage javascript light POST request.
| JavaScript | mit | robdimsdale/garagepi,robdimsdale/garagepi,robdimsdale/garagepi |
86185e2674db0bcd87c3c6b9125c8647b3b39188 | app/assets/javascripts/multi-part.js | app/assets/javascripts/multi-part.js | // Javascript specific to guide admin
$(function() {
// collapse the parts using the bootstrap accordion
$(".collapse").collapse();
var sortable_opts = {
axis: "y",
handle: "a.accordion-toggle",
stop: function(event, ui) {
$('.part').each(function (i, elem) {
$(elem).find('input.order')... | // Javascript specific to guide admin
$(function() {
var sortable_opts = {
axis: "y",
handle: "a.accordion-toggle",
stop: function(event, ui) {
$('.part').each(function (i, elem) {
$(elem).find('input.order').val(i + 1);
ui.item.find("a.accordion-toggle").addClass("highlight");
... | Remove unnecessary call to collapse the accordion | Remove unnecessary call to collapse the accordion
bootstrap does that for us
| JavaScript | mit | alphagov/publisher,telekomatrix/publisher,alphagov/publisher,telekomatrix/publisher,leftees/publisher,alphagov/publisher,telekomatrix/publisher,telekomatrix/publisher,theodi/publisher,leftees/publisher,leftees/publisher,theodi/publisher,leftees/publisher,theodi/publisher,theodi/publisher |
25b9f792abc02439b8838cff8d72a13f1e528d51 | app/assets/scripts/reducers/index.js | app/assets/scripts/reducers/index.js | import { combineReducers } from 'redux';
import baseData from './base-data';
import projects from './projects';
import locations from './locations';
import location from './location';
import nearbyLocations from './nearby-locations';
import baseStats from './base-stats';
import geolocation from './geolocation';
import ... | import { combineReducers } from 'redux';
import baseData from './base-data';
import projects from './projects';
import locations from './locations';
import location from './location';
import baseStats from './base-stats';
import geolocation from './geolocation';
import measurements from './measurements';
import compare... | Remove leftover references to reducer | Remove leftover references to reducer
| JavaScript | bsd-3-clause | openaq/openaq.org,openaq/openaq.org,openaq/openaq.org |
af49fca9b49697b5580e1075717bcb6710af1af9 | app/services/passwordCheckService.js | app/services/passwordCheckService.js | var app = angular.module("AdmissionsApp");
app.service("PasswordCheckService", ["$http", function ($http) {
var submitBaseUrl = "http://localhost:8001/part";
this.checkPassword = function (password, partNumber) {
var submitData = {answer: password};
return $http.post(submitBaseUrl + "/" + part... | var app = angular.module("AdmissionsApp");
app.service("PasswordCheckService", ["$http", function ($http) {
var submitBaseUrl = "http://admissions-project.codingcamp.us/part";
this.checkPassword = function (password, partNumber) {
var submitData = {answer: password};
return $http.post(submitBa... | Change baseurl from angular to admissions-project.codingcamp.us | Change baseurl from angular to admissions-project.codingcamp.us
| JavaScript | mit | bobziroll/admissions,bobziroll/admissions |
8336537980bba848a14b02c979b72e92f870b1d5 | src/cli.js | src/cli.js | // @flow
import _ from 'lodash'
import program from 'commander'
import info from '../package.json'
export type Options = {
command: ?string,
files: Array<string>,
format: string,
branch: string,
linter: string,
warning: boolean,
hash?: string,
}
export function parseOptions(): Options {
program
.... | // @flow
import _ from 'lodash'
import program from 'commander'
import info from '../package.json'
export type Options = {
command: ?string,
files: Array<string>,
format: string,
branch: string,
linter: string,
warning: boolean,
hash?: string,
}
export function parseOptions(): Options {
program
.... | Add support for configuration through env variables | feat: Add support for configuration through env variables
Fixes #23
| JavaScript | mit | relekang/lint-filter,relekang/lint-filter,relekang/lint-filter |
392894fd311e3ac0cc2dc9110c338c5b3d05769f | lib/background-size.js | lib/background-size.js | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-background-size/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-background-size/tachyons-background-size.min.css', ... | var _ = require('lodash')
var fs = require('fs')
var gzip = require('gzip-size')
var filesize = require('filesize')
var cssstats = require('cssstats')
var module = require('tachyons-background-size/package.json')
var moduleCss = fs.readFileSync('node_modules/tachyons-background-size/tachyons-background-size.min.css', ... | Add site footer to each documentation generator | Add site footer to each documentation generator
| JavaScript | mit | pietgeursen/pietgeursen.github.io,cwonrails/tachyons,fenderdigital/css-utilities,topherauyeung/portfolio,matyikriszta/moonlit-landing-page,getfrank/tachyons,topherauyeung/portfolio,fenderdigital/css-utilities,tachyons-css/tachyons,topherauyeung/portfolio |
eab703b15786b5a0b0ffe8abe91ca3559728e1d9 | src/config.js | src/config.js | /* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongod... | /* jslint node:true */
'use strict';
exports = module.exports = {
db: null,
databaseUrl: process.env.CLOUDRON_MONGODB_URL || 'mongodb://127.0.0.1:27017/meemo',
_clearDatabase: clearDatabase,
attachmentDir: process.env.ATTACHMENT_DIR || (__dirname + '/../storage')
};
var MongoClient = require('mongod... | Fix mongodb usage in tests | Fix mongodb usage in tests
| JavaScript | mit | nebulade/meemo,nebulade/guacamoly,nebulade/guacamoly,nebulade/meemo,nebulade/meemo,nebulade/guacamoly |
eae55f53cec2f033b8474530c4785f9cfbb18580 | main.js | main.js | var app = require('app')
var BrowserWindow = require('browser-window')
var crashReporter = require('crash-reporter')
crashReporter.start()
var mainWindow = null
app.on('window-all-closed', function appQuit () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('ready', function appReady () {
mai... | var app = require('app')
var BrowserWindow = require('browser-window')
var crashReporter = require('crash-reporter')
var Menu = require('menu')
var darwinTemplate = require('./darwin-menu.js')
var otherTemplate = require('./other-menu.js')
var mainWindow = null
var menu = null
crashReporter.start()
app.on('window-a... | Add basic menu to app | Add basic menu to app
Will refine later on.
| JavaScript | bsd-2-clause | paulcbetts/git-it-electron,jlord/git-it-electron,jlord/git-it-electron,jlord/git-it-electron,countryoven/git-it-electron,IonicaBizauKitchen/git-it-electron,countryoven/git-it-electron,countryoven/git-it-electron,dice/git-it-electron,vongola12324/git-it-electron,dice/git-it-electron,dice/git-it-electron,vongola12324/git... |
99e9a2713a4bc8f26334317a67a6ac63a468f500 | js/helper.js | js/helper.js | createSubdivisionsArray = function(){
var subdivisions = [];
var possibleNoteValues = ["#eighths", "#triplets", "#sixteenths", "#quintuplets"];
var possibleSubdivisions = [2, 3, 4, 5];
for (var i = 0; i < possibleSubdivisions.length; i++){
if ($(possibleNoteValues[i])[0].checked){
subdivisions.push(po... | createSubdivisionsArray = function(){
var subdivisions = [];
var possibleNoteValues = ["#eighths", "#triplets", "#sixteenths", "#quintuplets"];
var possibleSubdivisions = [2, 3, 4, 5];
for (var i = 0; i < possibleSubdivisions.length; i++){
if ($(possibleNoteValues[i])[0].checked){
subdivisions.push(po... | Create remove2if4 method to fix bug with sixteenths and eights | Create remove2if4 method to fix bug with sixteenths and eights
| JavaScript | mit | dmilburn/beatrice,dmilburn/beatrice |
0f7f701d32261030ce10c0f0cc776847c5b2e3a8 | lib/find-test-path.js | lib/find-test-path.js | 'use strict';
var path = require('path')
, findRoot = require('next/lib/module/find-package-root')
, resolve = path.resolve, sep = path.sep;
module.exports = function (tpath) {
return findRoot(tpath)(function (root) {
var e;
tpath = tpath.slice(root.length + 1).split(sep);
if (tpath[0] === 'lib') {
... | 'use strict';
var path = require('path')
, findRoot = require('next/lib/module/find-package-root')
, resolve = path.resolve, sep = path.sep;
module.exports = function (tpath) {
return findRoot(tpath)(function (root) {
var e;
tpath = tpath.slice(root.length + 1).split(sep);
if (tpath[0] === 'test') {
... | Remove special handling of `lib` folder | Remove special handling of `lib` folder
| JavaScript | isc | medikoo/tad |
a6140a5238aede949ef1c552e879e0f5cba201bc | website/app/application/core/projects/project/project-controller.js | website/app/application/core/projects/project/project-controller.js | Application.Controllers.controller('projectsProject',
["$scope", "$stateParams", "actionStatus", "provStep",
"model.projects", "projectColors", projectsProject]);
function projectsProject ($scope, $stateParams, actionStatus, provStep, projects, pro... | Application.Controllers.controller('projectsProject',
["$scope", "$stateParams", "actionStatus", "provStep",
"model.projects", "projectColors", projectsProject]);
function projectsProject ($scope, $stateParams, actionStatus, provStep, projects, pro... | Comment out console statement that will be needed later. | Comment out console statement that will be needed later.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
81334e2bfbe2885c113d96eb51615dfe70417c87 | app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js | app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { revealAccount } from 'flavours/glitch/actions/accounts';
import { FormattedMessage } from 'react-intl';
import Button from 'flavours/glitch/components/button';
const mapDispatchToProps = (dispatch, { accountI... | import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { revealAccount } from 'flavours/glitch/actions/accounts';
import { FormattedMessage } from 'react-intl';
import Button from 'flavours/glitch/components/button';
import { domain } from 'flavours/glitch/initial_s... | Fix limited account hint referencing "your" server when logged out | [Glitch] Fix limited account hint referencing "your" server when logged out
Port 139ea4c981f563e51d80ec3ec407d6265e29cb70 to glitch-soc
Signed-off-by: Claire <82b964c50e9d1d222e48cf5046e6484a966a7b07@sitedethib.com>
| JavaScript | agpl-3.0 | im-in-space/mastodon,glitch-soc/mastodon,im-in-space/mastodon,glitch-soc/mastodon,glitch-soc/mastodon,im-in-space/mastodon,im-in-space/mastodon,glitch-soc/mastodon |
fded40bba7fae41bee7ba52653c6742bc20db2f6 | app/assets/javascripts/verify_fingerprint.js | app/assets/javascripts/verify_fingerprint.js | //= require fingerprint2
(function (exports) {
'use strict';
// based on jQuery's param implementation https://github.com/jquery/jquery/blob/master/src/serialize.js
function serialiseComponents(components) {
var componentsToExclude = ['webgl'];
var r = [];
jQuery.each(components, fu... | //= require fingerprint2
(function (exports) {
'use strict';
// based on jQuery's param implementation https://github.com/jquery/jquery/blob/master/src/serialize.js
function serialiseComponents(components) {
var componentsToExclude = ['webgl'];
var r = [];
jQuery.each(components, fu... | Remove components= prefix from FP string | 3559: Remove components= prefix from FP string
After discussion we decided to remove the components= prefix from the
query params of the fp.gif resource requested by the JS fingerprinting
code, because it's not required and will probably make the string harder
to parse.
| JavaScript | mit | alphagov/verify-frontend,alphagov/verify-frontend,alphagov/verify-frontend,alphagov/verify-frontend |
ac84104ae27fd2fe8adc6bdc501a41a502e2e3a8 | addon/services/filesystem.js | addon/services/filesystem.js | import Ember from 'ember';
import fetch from 'ember-network/fetch';
export default Ember.Service.extend({
prompt(){
return new Promise((resolve, reject) => {
const input = document.createElement('input');
input.setAttribute("type","file");
input.click();
Ember.$(input).change(() => {
... | import Ember from 'ember';
import config from 'degenerator-ui/config/environment';
export default Ember.Controller.extend({
filesystem: Ember.inject.service(),
init() {
this._super(...arguments);
this.set('uploadFile', null);
},
actions:{
selectPhoto() {
this.get('filesystem').prompt().then... | Initialize input for proper behavior | Initialize input for proper behavior
| JavaScript | mit | mhigbyflowers/ember-filesystem,mhigbyflowers/ember-filesystem |
c5d41ccc5aff6c897a6015424ccc52439d2ae5a9 | scripts/bundle-dts.js | scripts/bundle-dts.js | 'use strict';
var fs = require('fs');
var mkdirp = require('mkdirp');
var path = require('path');
var banner = require('./banner');
var dest = path.resolve(__dirname, '../dist/event-station.d.ts');
var dist = path.resolve(__dirname, '../dist');
var src = path.resolve(__dirname, '../build/dts/main.d.ts');
mkdirp(dis... | 'use strict';
var fs = require('fs');
var mkdirp = require('mkdirp');
var path = require('path');
var banner = require('./banner');
var dest = path.resolve(__dirname, '../dist/event-station.d.ts');
var dist = path.resolve(__dirname, '../dist');
var src = path.resolve(__dirname, '../build/dts/main.d.ts');
mkdirp(dis... | Improve module definition generation script | Improve module definition generation script
The script no longer produces unnecessary module declarations.
| JavaScript | mit | morrisallison/event-station,morrisallison/event-station |
52a76851a7a6808ff126078f92c12d1b41dec578 | share/spice/dogo_news/dogo_news.js | share/spice/dogo_news/dogo_news.js | (function(env) {
"use strict";
env.ddg_spice_dogo_news = function(api_result) {
if (!api_result || !api_result.results || !api_result.results.length) {
return Spice.failed('dogo_news');
}
// Get original query.
var script = $('[src*="/js/spice/dogo_news/"]')[0],
... | (function(env) {
"use strict";
env.ddg_spice_dogo_news = function(api_result) {
if (!api_result || !api_result.results || !api_result.results.length) {
return Spice.failed('dogo_news');
}
// Get original query.
var script = $('[src*="/js/spice/dogo_news/"]')[0],
... | Add news footer to media tile | Add news footer to media tile
| JavaScript | apache-2.0 | mayo/zeroclickinfo-spice,shyamalschandra/zeroclickinfo-spice,dachinzo/zeroclickinfo-spice,TomBebbington/zeroclickinfo-spice,stevenmg/zeroclickinfo-spice,sevki/zeroclickinfo-spice,kevintab95/zeroclickinfo-spice,Queeniebee/zeroclickinfo-spice,bibliotechy/zeroclickinfo-spice,bigcurl/zeroclickinfo-spice,GrandpaCardigan/zer... |
dc7fb87e1eb2a04d059f489ca4e743bb10ce3dbe | client/src/js/views/IndexDogListView.js | client/src/js/views/IndexDogListView.js | var fs = require('fs');
var _ = require('underscore');
var Backbone = require('backbone');
var Flickity = require('flickity-imagesloaded');
var IndexDogListTemplate = fs.readFileSync(__dirname + '/IndexDogListTemplate.html', 'utf8');
var IndexDogListView = Backbone.View.extend({
template: _.template(IndexDogListTemp... | var fs = require('fs');
var _ = require('underscore');
var Backbone = require('backbone');
var Flickity = require('flickity-imagesloaded');
var IndexDogListTemplate = fs.readFileSync(__dirname + '/IndexDogListTemplate.html', 'utf8');
var IndexDogListView = Backbone.View.extend({
template: _.template(IndexDogListTemp... | Hide dogs without avatars on homepage slider, randomize dogs on homepage slider | Hide dogs without avatars on homepage slider, randomize dogs on homepage slider
| JavaScript | mit | istrategylabs/paw,istrategylabs/paw |
92b009807f44ea594a334d2005bf088b28d7441a | server/browser/js/fetch_file.factory.js | server/browser/js/fetch_file.factory.js | 'use strict';
angular.module('fileBrowserApp').factory('FetchFileFactory', ['$http',
function($http) {
var _factory = {};
_factory.fetchFile = function(file) {
return $http.get('/browse/api/resource?resource=' + encodeURIComponent(file));
};
return _factory;
}
]);
| 'use strict';
angular.module('fileBrowserApp').factory('FetchFileFactory', ['$http',
function($http) {
var _factory = {};
var apiPath = '/browse/api';
function getResource(path, file) {
return $http.get(apiPath + '/' + path + '?resource=' + encodeURIComponent(file));
}
_factory.fetchFile... | Add fetchStats function in FetchFileFactory | Add fetchStats function in FetchFileFactory
| JavaScript | mit | Masoumeh/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,fbaumgardt/arethusa,alpheios-project/arethusa,alpheios-project/arethusa,latin-language-toolkit/arethusa,Masoumeh/arethusa,PonteIneptique/arethusa,latin-language-toolkit/arethusa,fbaumgardt/arethusa,PonteIneptique/arethusa |
d88c51d4bce55e051b02c6b722b59b44ed6c30ce | src/console.js | src/console.js | let index = 0;
const logEntries = [];
for (let i = 0; i < 500; i++) {
logEntries.push(null);
}
export function getLog() {
return logEntries;
}
export function log(name, message) {
logEntries.shift();
logEntries.push({
index: index++,
date: (new Date()).toISOString(),
level: 'log',
name,
mes... | let index = 0;
const logEntries = [];
for (let i = 0; i < 500; i++) {
logEntries.push(null);
}
export function getLog() {
return logEntries;
}
export function log(name, message) {
logEntries.shift();
logEntries.push({
index: index++,
date: (new Date()).toISOString(),
level: 'log',
name,
mes... | Include detail in "The listed user cannot be searched" message | Include detail in "The listed user cannot be searched" message | JavaScript | mit | ForbesLindesay/unpkg-bot |
66251327789d53fcbfd373eea9d634c6387124e6 | src/components/Settings/Socials.js | src/components/Settings/Socials.js | import React from 'react';
import update from 'immutability-helper';
import * as firebase from 'firebase';
import { Field } from '../Field';
import { notifications } from '../../service/notifications';
import './socials.css';
class Socials extends React.Component {
state = {
}
constructor() {
sup... | import React from 'react';
import update from 'immutability-helper';
import * as firebase from 'firebase';
import { Field } from '../Field';
import { notifications } from '../../service/notifications';
import './socials.css';
class Socials extends React.Component {
state = {
socials: {}
}
construc... | Add adding new social record | Add adding new social record
| JavaScript | apache-2.0 | nahody/biografia,nahody/biografia |
4e569dd8af6b4250f1ac668b49dc3f0ea478cd9d | lib/index.js | lib/index.js | /*global document, alert*/
'use strict';
var editStory = require('./edit-story');
function emptyStory() {
return {
locations: {
start: {}
},
screens: {
start: {
type: 'text',
text: '## Welcome',
next: 'finish'
},
finish: {
type: 'finish'
}
... | /*global document, alert*/
'use strict';
var editStory = require('./edit-story');
function emptyStory() {
return {
locations: {
start: {}
},
screens: {
start: {
type: 'text',
text: '## Welcome'
}
}
};
}
document.addEventListener('DOMContentLoaded', function () {
... | Remove finish screen from empty default story | Remove finish screen from empty default story
| JavaScript | mit | geo-tales/geo-tales-editor,geo-tales/geo-tales-editor |
e0eb662168a263463acf214cab19fda461d97bdd | lib/index.js | lib/index.js | 'use strict';
module.exports = {
'decode': require('./decode'),
'encode': require('./encode'),
'Server': require('./server'),
};
| 'use strict';
module.exports = {
'decode': require('./decode'),
'encode': require('./encode'),
'Server': require('./server'),
'Client': require('./client')
};
| Add client to lib wrap | Add client to lib wrap
| JavaScript | mit | jamen/rela |
14aa55700e2459ad258df4a5b2cc2432abb66c92 | lib/index.js | lib/index.js | /**
* sails-generate-controller
*
* Usage:
* `sails generate controller`
*
* @type {Object}
*/
module.exports = {
templatesDirectory: require('path').resolve(__dirname,'../templates'),
before: require('./before'),
targets: {
'./:filename': { template: './controller.template' }
}
};
| /**
* sails-generate-controller
*
* Usage:
* `sails generate controller`
*
* @type {Object}
*/
module.exports = {
templatesDirectory: require('path').resolve(__dirname,'../templates'),
before: require('./before'),
targets: {
'./api/controllers/:filename': { template: './controller.template' }
}
};
| Put generated controller file into api/controllers | Put generated controller file into api/controllers
| JavaScript | mit | dsninjas/sails-generate-dscontroller,balderdashy/sails-generate-controller |
70ce6593f68e0d6751d6e356a4f8893e123b3c1b | src/backend/middleware/firebase.js | src/backend/middleware/firebase.js | import {
LOAD_MESSAGES,
LOGIN,
LOGOUT,
SAVE_PREFERENCES,
SEND_MESSAGE,
UPDATE_USER
} from '../../actions'
const firebaseMiddleware = firebase => store => next => action => {
const firebaseCommand = action.firebase
const state = store.getState()
if (firebaseCommand) {
if (firebaseCommand !== LOG... | import {
LOAD_MESSAGES,
LOGIN,
LOGOUT,
SAVE_PREFERENCES,
SEND_MESSAGE,
UPDATE_USER
} from '../../actions'
const firebaseMiddleware = firebase => store => next => action => {
const firebaseCommand = action.firebase
const state = store.getState()
// Early return if nothing for Firebase
if (firebaseC... | Clean up Firebase middleware code. | Clean up Firebase middleware code.
| JavaScript | mit | jsonnull/aleamancer,jsonnull/aleamancer |
5b1c73c997c830f4860c1ec5c90a3e7e10ec1d56 | server/sensor-simulator.js | server/sensor-simulator.js | var Bacon = require('baconjs')
var _ = require('lodash')
var simulatorStream = Bacon.interval(2000)
.map(() => ({
tag: 't',
instance: _.random(1, 3),
temperature: _.random(0, 28, true),
vcc: _.random(3500, 4200)
}))
module.exports = simulatorStream | var Bacon = require('baconjs')
var _ = require('lodash')
var simulatorStream = Bacon.interval(2000)
.map(() => Math.random() > 0.25 ? randomTemperature() : randomPressure())
function randomTemperature() {
return {
tag: 't',
instance: _.random(1, 5),
temperature: _.random(0, 28, true),
vcc: _.ran... | Add pressure readings to sensor simulator | Add pressure readings to sensor simulator | JavaScript | apache-2.0 | chacal/nrf-sensor-receiver,chacal/nrf-sensor-receiver,chacal/nrf-sensor-receiver |
0fbdce6f79a358230e61824088f889a874830049 | src/client/components/Task/saga.js | src/client/components/Task/saga.js | import _ from 'lodash'
import { take, put, spawn, call, select } from 'redux-saga/effects'
import {
TASK__START,
TASK__PROGRESS,
TASK__SUCCESS,
TASK__ERROR,
TASK__CLEAR,
} from '../../actions'
function* taskSaga(task, action) {
yield put({ ...action, type: TASK__PROGRESS })
try {
const result = yiel... | import _ from 'lodash'
import { take, put, spawn, call, select } from 'redux-saga/effects'
import {
TASK__START,
TASK__PROGRESS,
TASK__ERROR,
TASK__CLEAR,
} from '../../actions'
function* taskSaga(task, action) {
yield put({ ...action, type: TASK__PROGRESS })
try {
const result = yield call(task, acti... | Add name and id to success action | Add name and id to success action
| JavaScript | mit | uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2 |
e23617bb2e0c4a12c0dfa9cc394ff1b4d6f61c6f | ember-cli-build.js | ember-cli-build.js | /* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different... | /* global require, module, process */
var EmberApp = require('ember-cli/lib/broccoli/ember-app'),
cdnPrefix = process.env.CDN_PREFIX || '';
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
fingerprint: {
prepend: cdnPrefix
}
});
// Use `app.import` to add additional lib... | Support CDN prefix for production builds | Support CDN prefix for production builds
Signed-off-by: Rohan Jain <f3a935f2cb7c3d75d1446a19169b923809d6e623@gmail.com>
| JavaScript | agpl-3.0 | sbuss/qotr,sbuss/qotr,crodjer/qotr,sbuss/qotr,curtiszimmerman/qotr,crodjer/qotr,rmoorman/qotr,sbuss/qotr,curtiszimmerman/qotr,crodjer/qotr,crodjer/qotr,rmoorman/qotr,curtiszimmerman/qotr,rmoorman/qotr,curtiszimmerman/qotr,rmoorman/qotr |
9400109c8b0c866661f6aaea078d9c663fd4dad5 | jsonprocessor.js | jsonprocessor.js |
/**
*
*
* @param {object} object The output from Alpaca
* @return {object} A corrected version of the output. This should be a
* valid Swagger spec.
*/
module.exports = function processJSON (objectFuncParam) {
const object = objectFuncParam;
if (object.paths) {
/*
* T... |
/**
*
*
* @param {object} object The output from Alpaca
* @return {object} A corrected version of the output. This should be a
* valid Swagger spec.
*/
module.exports = function processJSON (objectFuncParam) {
const object = JSON.parse(JSON.stringify(objectFuncParam));
if (obj... | Clone object before processing JSON | Clone object before processing JSON
| JavaScript | mit | apinf/open-api-designer,apinf/openapi-designer,apinf/open-api-designer,apinf/openapi-designer |
9ca562f96af6ef3ad93fe1fa2abfd0da091995be | lib/utils.js | lib/utils.js | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
function _getHostURL(url) {
const host = url.match(/^(?:https?\:\/\/)(?:[^\/])+/);
if (hos... | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
'use strict';
function _getHostURL(url) {
const host = url.match(/^(?:https?\:\/\/)(?:[^\/])+/);
return ... | Simplify _getHostURL using Ternary operator | Simplify _getHostURL using Ternary operator
| JavaScript | mpl-2.0 | alexgibson/uitour-config,alexgibson/uitour-config |
9c0a82fa20aa07697d8b170bbbfae9f2e5f2675d | bookmarklets/tumblr-share.js | bookmarklets/tumblr-share.js | ((window, document) => {
const encode = window.encodeURIComponent;
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
const url = ((t=$("link[rel=canonical]")) && t.href)
|| ((t=$('meta[property="og:url"],meta[property="twitter:url"]')) && t.content)
... | ((window, document) => {
const encode = window.encodeURIComponent;
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
const url = ((t=$("link[rel=canonical]")) && t.href)
|| ((t=$('meta[property="og:url"],meta[property="twitter:url"]')) && t.content)
... | Use external window for tumlr share | Use external window for tumlr share
| JavaScript | unlicense | kui/dotfiles,kui/dotfiles,kui/dotfiles,kui/dotfiles |
e2ca27a6fcb304a666c9b14c3d0332e97f2deaf8 | lib/utils.js | lib/utils.js | module.exports = {
arraysAreEqual : function(a, b) {
for(var i = 0; i < a.length; i++){
if(a[i] !== b[i]) {
return false;
}
}
return true;
}
};
| module.exports = {
arraysAreEqual : function(a, b) {
for(var i = 0; i < a.length; i++){
if(a[i] !== b[i]) {
return false;
}
}
return true;
},
connectWithDots : function(a, b) {
var totalLength = 40;
var dotLength = totalLength - a.length - b.length;
var dots = "";
... | Add two string dot joiner method | Add two string dot joiner method
| JavaScript | mit | plato721/lights-out,plato721/lights-out |
1b7efa4de96e62b2b63378272226388ed8975b78 | examples/client.js | examples/client.js | require.paths.unshift('../lib')
var xmpp = require('node-xmpp');
var inflect = require('inflect');
var options = {
type: 'client',
jid: 'user@example.com',
password: 'secret',
host: 'example.com',
port: 5222
};
var connection = inflect.createConnection(options);
connection.use(inflect.logger);
connection.us... | require.paths.unshift('../lib')
var inflect = require('inflect');
var options = {
type: 'client',
jid: 'user@example.com',
password: 'secret',
host: 'example.com',
port: 5222
};
var connection = inflect.createConnection(options);
connection.use(inflect.logger());
connection.use(inflect.serviceDiscovery([ { ... | Make example work with refactored code. | Make example work with refactored code.
| JavaScript | mit | jaredhanson/junction |
f3da7ac40738657abb91ad8c46951dc23ad7adde | example/index.js | example/index.js | /*-----------------------------------------------------------------------------
| Copyright (c) 2014-2016, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|--------------------------------------------------... | /*-----------------------------------------------------------------------------
| Copyright (c) 2014-2016, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|--------------------------------------------------... | Remove use of arrow function | Remove use of arrow function
| JavaScript | bsd-3-clause | afshin/phosphide,afshin/phosphide,afshin/phosphide,afshin/phosphide |
26984a61ff7498f45cce45593f01d77f430e440b | bin/elementor.js | bin/elementor.js | #!/usr/bin/env node
var elementorServer = require('../lib/server');
elementorServer.start();
| #!/usr/bin/env node
var minimist = require('minimist');
var path = require('path');
var args = minimist(process.argv.slice(2), {
string: 'chrome',
alias: {h: 'help', v: 'version'}
});
if (args.help) {
var cmd = require('path').basename(process.argv[1]);
console.log(
require('fs')
.readFileSyn... | Handle flags and options with minimist | Handle flags and options with minimist
| JavaScript | mit | andresdominguez/elementor,andresdominguez/elementor |
81c16d5bb2f19ef8808ce9a456c2a7a3a07aec7e | test/model.js | test/model.js | var should = require('should');
var mogwai = require('../');
var UserSchema = new mogwai.Schema({
name: String
});
User = mogwai.model('User', UserSchema);
var user;
describe('Model', function() {
it('should instantiate a new model', function() {
user = new User();
user.should.be.an.instanceOf(model);
... | var should = require('should');
var mogwai = require('../');
var UserSchema = new mogwai.Schema({
name: String
});
User = mogwai.model('User', UserSchema);
var user;
describe('Model', function() {
it('should instantiate a new model', function() {
user = new User();
user.should.be.an.instanceOf(model);
... | Add test for Groovy findById() function | Add test for Groovy findById() function
| JavaScript | mit | jbmusso/mogwai |
7efc71319b0d22b2a30a174d3cfa7d984200105f | src/markdown-it-incremental-dom.js | src/markdown-it-incremental-dom.js | import rendererMixin from './mixins/renderer'
import incrementalizedRules from './mixins/rules'
const mixinTo = (base, mixin) =>
(Object.assign(Object.create(Object.getPrototypeOf(base)), base, mixin))
const processIncrementalDOMArgument = incrementalDOM =>
((!incrementalDOM && typeof window !== 'undefined') ? wi... | import rendererMixin from './mixins/renderer'
import incrementalizedRules from './mixins/rules'
const mixinTo = (base, mixin) =>
Object.assign(Object.create(Object.getPrototypeOf(base)), base, mixin)
const processIncrementalDOMArgument = incrementalDOM =>
(!incrementalDOM && typeof window !== 'undefined') ? windo... | Fix to use object rest spread syntax | Fix to use object rest spread syntax
| JavaScript | mit | yhatt/markdown-it-incremental-dom |
69f4d249f31c7882f0a1239cc66116d1ed8b5239 | src/components/HighlightedMarkdown/H.js | src/components/HighlightedMarkdown/H.js | import React, {PureComponent, PropTypes, createElement} from 'react'
import {Link} from 'react-scroll'
import {Link as LinkIcon} from '../icons'
import {scrollDuration} from '../../constants/animations'
const createId = str => str.toLowerCase().replace(/\s/g, '-').replace(/[^-\w]/g, '')
/**
* Renders `h*` tags and ... | import React, {PureComponent, PropTypes, createElement} from 'react'
import {Link} from 'react-scroll'
import {Link as LinkIcon} from '../icons'
import {scrollDuration} from '../../constants/animations'
const createId = data => {
if (Array.isArray(data)) {
data = data.map(value => {
if (typeof value === '... | Fix fatal error on pages with nested nodes in header | Fix fatal error on pages with nested nodes in header
| JavaScript | mit | cssinjs/cssinjs |
5dd47884707d300c825f7337e95e3b5c72d9c59d | http/assets/js/ArticleLoader.js | http/assets/js/ArticleLoader.js | 'use strict';
var ArticleLoader = new Class({
feed: 12,
page: 0,
initialize: function (feed) {
this.feed = feed;
this.getArticles();
},
getArticles: function () {
new Request.JSON({
method: 'get',
url: window.ZerobRSS.apiUri + '/v1/feeds/' + this.f... | 'use strict';
var ArticleLoader = new Class({
feed: 12,
page: 0,
initialize: function (feed) {
this.feed = feed;
this.getArticles();
},
getArticles: function () {
new Request.JSON({
method: 'get',
url: window.ZerobRSS.apiUri + '/v1/feeds/' + this.f... | Add article-identifier to article in HTML | Add article-identifier to article in HTML
| JavaScript | isc | etu/0bRSS,etu/0bRSS,etu/0bRSS |
ac31d3190ef3637feb073a71a63609ce55623a0f | lib/channel-mapping.js | lib/channel-mapping.js | var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var errors = require('./errors');
function getChannelMapping() {
var mapping = process.env.CHANNEL_MAPPING;
try {
var jsonMapping = JSON.parse(mapping);
return jsonMapping;
} catch(e) {
// Mapping might be given as a file... | var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var errors = require('./errors');
function getChannelMapping() {
var mapping = process.env.CHANNEL_MAPPING;
try {
var jsonMapping = JSON.parse(mapping);
return jsonMapping;
} catch(e) {
// Mapping might be given as a file... | Update channel mapping ot use process.cwd() | Update channel mapping ot use process.cwd()
| JavaScript | mit | robertkety/slack-irc,erikdesjardins/slack-irc,leeopop/slack-irc,reactiflux/discord-irc,umegaya/slack-irc,zabirauf/slack-irc,chipx86/slack-irc,andreaja/slack-irc,tcr/slack-irc,php-ug/slack-irc,ekmartin/slack-irc,mxm/slack-irc,xbmc/slack-irc,lmtierney/slack-irc |
dc81dbea3c79a230f9cc932ed0d1d24491d808e0 | src/select-target-platform-view.js | src/select-target-platform-view.js | 'use babel';
import { SelectView } from 'particle-dev-views';
let $$ = null;
export default class SelectTargetPlatformView extends SelectView {
constructor(...args) {
super(...args);
this.show = this.show.bind(this);
}
initialize(profileManager) {
this.profileManager = profileManager;
super.initialize(..... | 'use babel';
import { SelectView } from 'particle-dev-views';
let $$ = null;
export default class SelectTargetPlatformView extends SelectView {
constructor(...args) {
super(...args);
this.show = this.show.bind(this);
}
initialize(profileManager) {
this.profileManager = profileManager;
super.initialize(..... | Make platform ID a Number | Make platform ID a Number
| JavaScript | mit | spark/particle-dev-profiles,spark/particle-dev-profiles |
66cd0a3feef2d14d86761fbd6d1ea25974032edf | src/server/reducers/CostReducer.js | src/server/reducers/CostReducer.js | import { Map, notSetValue } from 'immutable'
import { CREDATE_COSTS } from '../../actions'
export default function costs (state = Map(), action) {
switch (action.type) {
case CREDATE_COSTS:
if (state.get(action.category) === notSetValue) {
return state.set(action.category, action.cost)
} els... | import { Map, notSetValue } from 'immutable'
import { CREDATE_COSTS } from '../../actions'
export default function costs (state = Map(), action) {
switch (action.type) {
case CREDATE_COSTS:
if (state.get(action.category) === notSetValue) {
return state.set(action.category, action.cost)
}
... | Remove else statement in switch statement | Remove else statement in switch statement
This allows the tests to reach any statements and reach 100% coverage.
| JavaScript | mit | rollacaster/costa,rollacaster/costa,rollacaster/costa,rollacaster/costa |
3978b4e05e1fb510413388a80ee232124429ee0e | form_strategy.js | form_strategy.js | var sys = require('sys');
var _ = require('underscore');
var users = require('./users');
module.exports= function(options) {
options= options || {};
var that= {};
var my= {};
that.name = options.name || "form";
var send_to_login = function(response) {
response.redirect('/login',303);
... | var sys = require('sys');
var _ = require('underscore');
var users = require('./users');
module.exports= function(options) {
options= options || {};
var that= {};
var my= {};
that.name = options.name || "form";
var send_to_login = function(response) {
response.redirect('/login',303);
... | Save user email and name in session. | Save user email and name in session.
| JavaScript | bsd-3-clause | scsibug/read52,scsibug/read52 |
cfa4b67f3cf688215bbe2be4efed0a4aa0344fc7 | components/calendar/event.js | components/calendar/event.js | import Remarkable from 'remarkable';
const markdown = (text) => {
var md = new Remarkable();
return {
__html: md.render(text)
};
};
const Event = ({ title, start_time, end_time, content, eventClickHandler, index, active }) => {
const classes = (index === active) ? 'cal-event-content-active' : '';
retur... | import Remarkable from 'remarkable';
const markdown = (text) => {
var md = new Remarkable();
return {
__html: md.render(text)
};
};
const Event = ({ title, start_time, end_time, content, eventClickHandler, index, active }) => {
const classes = (index === active) ? 'cal-event-content-active' : '';
retur... | Update class names for more consistency | Update class names for more consistency
| JavaScript | mit | dotKom/glowing-fortnight,dotKom/glowing-fortnight |
0703ba1efbe1a17b4c503b33db09acbac264485a | src/util/updateEntityChildArray.js | src/util/updateEntityChildArray.js | import { without } from 'substance'
export default function updateEntityChildArray(editorSession, nodeId, tagName, attribute, oldEntityIds, newEntityIds) {
editorSession.transaction(tx => {
let node = tx.get(nodeId)
let addedEntityIds = without(newEntityIds, ...oldEntityIds)
let removedEntityIds = with... | import { without } from 'substance'
export default function updateEntityChildArray(editorSession, nodeId, tagName, attribute, oldEntityIds, newEntityIds) {
editorSession.transaction(tx => {
let node = tx.get(nodeId)
let addedEntityIds = without(newEntityIds, ...oldEntityIds)
let removedEntityIds = with... | Sort elements according to newEntityIds order. | Sort elements according to newEntityIds order.
| JavaScript | mit | substance/texture,substance/texture |
a6b239545982d91dedc7c2cff1294eb20de72929 | src/constants/gametypes.js | src/constants/gametypes.js | export const PLAYER_ONE = "X";
export const PLAYER_TWO = "O";
export const WINNER = "WINNER";
export const NOT_WINNER = "NOT WINNER";
export const DRAW = "DRAW";
export const NEW_GAME = "NEW GAME"; | export const PLAYER_ONE = "X";
export const PLAYER_TWO = "O";
export const WINNER = "WINNER";
export const NOT_WINNER = "NOT WINNER";
export const DRAW = "DRAW"; | Remove duplicate constant from GameTypes. | Remove duplicate constant from GameTypes.
| JavaScript | mit | aelawson/tic_tac_toe,aelawson/tic_tac_toe |
ff5f4da3088bd83602e319a145f464116fb7c3c1 | helpers/index.js | helpers/index.js | // Define handlebars helpers
var hbs = require('hbs');
// blocks and extends
var blocks = {};
hbs.registerHelper('extend', function(name, context) {
var block = blocks[name];
if (!block) {
block = blocks[name] = [];
}
block.push(context.fn(this)); // for older versions of handlebars, use block.push(cont... | // Define handlebars helpers
var hbs = require('hbs');
// blocks and extends
var blocks = {};
hbs.registerHelper('extend', function(name, context) {
var block = blocks[name];
if (!block) {
block = blocks[name] = [];
}
block.push(context.fn(this));
});
hbs.registerHelper('block', function(name) {
var ... | Remove comment for old version of Handlebars | Remove comment for old version of Handlebars
| JavaScript | mit | thegreatsunra/propeller |
1764c78639093d43e29c5fd0521dba9f4392949d | lib/RegexLibrary.js | lib/RegexLibrary.js | /*
* regex-pill
* https://github.com/lgoldstien/regex-pill
*
* Copyright (c) 2014 Lawrence Goldstien
* Licensed under the MIT license.
*/
'use strict';
var RegexLibraryContents = {
"hostnames/databases/mongodb": /^(mongodb:\/\/)([a-z0-9]+:[a-z0-9]+@)?([a-zA-Z0-9-_.]+)(:[0-9]+)?(\/[a-z_-]+)?$/g,
};
var Reg... | /*
* regex-pill
* https://github.com/lgoldstien/regex-pill
*
* Copyright (c) 2014 Lawrence Goldstien
* Licensed under the MIT license.
*/
'use strict';
var RegexLibraryContents = {
"hostnames/databases/mongodb": /^(mongodb:\/\/)([a-z0-9]+:[a-z0-9]+@)?([a-zA-Z0-9-_.]+)(:[0-9]+)?(\/[a-z_-]+)?$/g,
"primati... | Add decimal and integer regex | Add decimal and integer regex | JavaScript | mit | lgoldstien/regexpill |
2af6872f760e7ed4ddca2b1db689e56649a28090 | src/helpers/expeditions.js | src/helpers/expeditions.js | import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group))... | import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.startsWith(group))... | Change .map to .forEach so that we can append to a list | Change .map to .forEach so that we can append to a list
| JavaScript | apache-2.0 | zooniverse/notes-from-nature-landing,zooniverse/notes-from-nature-landing |
ab770d3cb62a7de22d5cb243a10ba87a7c1f0705 | gulp/tasks/sass.js | gulp/tasks/sass.js | var gulp = require('gulp-help')(require('gulp'));
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').sass;
var autoprefixer = require('gulp-autoprefixer');
var tas... | var gulp = require('gulp-help')(require('gulp'));
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').sass;
var autoprefixer = require('gulp-autoprefixer');
var tas... | Write sourcemaps prior to prefixing | Write sourcemaps prior to prefixing
| JavaScript | mit | MadeInHaus/react-flux-gulp-starter,MadeInHaus/react-flux-gulp-starter |
e4f2e463a59a27c0b301a86c48275e70e31503b0 | src/start/LoadingScreen.js | src/start/LoadingScreen.js | /* @flow strict-local */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import { BRAND_COLOR } from '../styles';
import { LoadingIndicator } from '../common';
const styles = StyleSheet.create({
center: {
flex: 1,
justifyContent: 'center',
alignItems: 'cent... | /* @flow strict-local */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import { BRAND_COLOR } from '../styles';
import { LoadingIndicator, ZulipStatusBar } from '../common';
const styles = StyleSheet.create({
center: {
flex: 1,
justifyContent: 'center',
a... | Fix color of status bar on loading screen. | ui: Fix color of status bar on loading screen.
On Android, the color of the status bar clashes with the background
color on the loading screen. Use ZulipStatusBar to provide a better
one.
[Commit message amended by Ray Kraesig.]
Fixes: #3860.
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
9e1cf440a38708da059c300e6981c807b3430186 | src/date.js | src/date.js | import moment from 'moment-timezone';
import AbstractFormat from './abstract';
export default class DateFormat extends AbstractFormat {
format(dateValue, dateFormat, locale, timezone) {
locale = locale || this._locale();
timezone = timezone || this._timezone();
return this
.moment(dateValue, local... | import moment from 'moment-timezone';
import AbstractFormat from './abstract';
export default class DateFormat extends AbstractFormat {
format(dateValue, dateFormat, locale, timezone) {
locale = locale || this._locale();
timezone = timezone || this._timezone();
return this
.moment(dateValue, local... | Return moment object after parsing | Return moment object after parsing
| JavaScript | mit | scola84/node-i18n |
4b69a7859d426583c9d6e50a2695061ee0178709 | src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditormenu.directive.js | src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditormenu.directive.js | (function () {
'use strict';
function EditorMenuDirective($injector, treeService, navigationService, umbModelMapper, appState) {
function link(scope, el, attr, ctrl) {
scope.dropdown = {
isOpen: false
};
function onInit() {
getOpti... | (function () {
'use strict';
function EditorMenuDirective($injector, treeService, navigationService, umbModelMapper, appState) {
function link(scope, el, attr, ctrl) {
scope.dropdown = {
isOpen: false
};
function onInit() {
getOpti... | Make sure the app menu state is set | Make sure the app menu state is set
| JavaScript | mit | arknu/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,hfloyd/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,tcmorris/Umbraco-CMS,mattbrailsford/Umbraco-CMS,NikRimington/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,rasmusee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.