commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 624 | message stringlengths 15 4.7k | lang stringclasses 3
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
cb4c27d7b90b1e525db8eef3b5f9b72a29efd6c1 | client/js/controllers/index-controller.js | client/js/controllers/index-controller.js | "use strict";
var IndexController = function($scope, analytics, navigation, progressbar, search) {
$scope.searchQuery = "";
$scope.search = function() {
if ($scope.searchQuery.trim().length === 0) {
navigation.toEntry("the-narrows");
} else {
search.search($scope.searchQuery);
}
};
$scope.htmlReady();... | "use strict";
var IndexController = function($scope, analytics, navigation, progressbar, search) {
$scope.searchQuery = "";
progressbar.start();
$scope.search = function() {
if ($scope.searchQuery.trim().length === 0) {
navigation.toEntry("the-narrows");
} else {
search.search($scope.searchQuery);
}
};... | Add progress bar to / for consistency. | Add progress bar to / for consistency.
| JavaScript | mit | zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io,zaknelson/hike.io |
5269da98660c34169b998fe1719eb86c7958cda1 | fs/md5File.js | fs/md5File.js | "use strict";
var fs = require('fs'),
crypto = require('crypto');
module.exports = function (file_path, callback){
var shasum = crypto.createHash('md5');
var s = fs.ReadStream(file_path);
s.on('data', shasum.update.bind(shasum));
s.on('end', function() {
callback(null, shasum.digest('hex'));
});
}
| "use strict";
const fs = require('fs');
const crypto = require('crypto');
module.exports = function md5File (file_path, cb) {
if (typeof cb !== 'function')
throw new TypeError('Argument cb must be a function')
var output = crypto.createHash('md5')
var input = fs.createReadStream(file_path)
input.on('e... | Use crypto stream (prevent memory exhaustion on raspbian) | Use crypto stream (prevent memory exhaustion on raspbian)
| JavaScript | mit | 131/nyks |
9947f637ca0b0b169d61ff9246bdc1e9d608ebc4 | hxbot/Poll.js | hxbot/Poll.js | var PollModule = function () {
};
PollModule.prototype.Message = function(message)
{
if(message.deletable)
{
message.delete();
}
var keyword = "poll";
var pollIndex = message.content.indexOf(keyword);
var questionmarkIndex = message.content.lastIndexOf("?");
var question = message.... | var PollModule = function () {
};
PollModule.prototype.Message = function(message)
{
if(message.deletable)
{
message.delete();
}
var keyword = "poll";
var pollIndex = message.content.indexOf(keyword);
var questionmarkIndex = message.content.lastIndexOf("?");
var question = message.... | Fix custom emote parsing in polls | Fix custom emote parsing in polls
| JavaScript | mit | HxxxxxS/DiscordBot,HxxxxxS/DiscordBot |
5d4c7fbb46fa60cb02510eb3cab1238565c87b1d | src/ko.sortable-table.js | src/ko.sortable-table.js | ko.bindingHandlers.sortBy = {
init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
var asc = true;
element.style.cursor = 'pointer';
element.onclick = function(){
var value = valueAccessor();
var data = value.array;
var sortBy = value.sortBy;
i... | ko.bindingHandlers.sortBy = {
init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
var asc = true;
element.style.cursor = 'pointer';
element.onclick = function(){
var value = valueAccessor();
var data = value.array;
var sortBy = value.sortBy;
i... | Fix for reverse sorting. Styling fixes | Fix for reverse sorting. Styling fixes
| JavaScript | mit | RyanFrench/ko.sortable-table.js |
e050f4e1b2138de68ee1eaf6b71ea8285b2e1546 | src/ms/symbol/isvalid.js | src/ms/symbol/isvalid.js | export default function isValid(extended) {
var drawInstructions =
JSON.stringify(this.drawInstructions).indexOf("null") == -1;
if (extended) {
return {
drawInstructions: drawInstructions,
icon: this.validIcon,
mobility: this.metadata.mobility != undefined
};
} else {
return (
... | export default function isValid(extended) {
var drawInstructions =
JSON.stringify(this.drawInstructions).indexOf("null") == -1;
if (extended) {
return {
affiliation: this.metadata.affiliation,
dimension: this.metadata.dimension,
dimensionUnknown: this.metadata.dimensionUnknown,
draw... | Add check for affiliation and dimension to validation control | Add check for affiliation and dimension to validation control
#203
| JavaScript | mit | spatialillusions/milsymbol |
af9244dadf0a21b55edca2634e114ebf79f10038 | src/vdom.js | src/vdom.js | import vdom from 'skatejs-dom-diff/src/vdom/element';
export default vdom;
| import vdom from 'skatejs-dom-diff/lib/vdom/element';
export default vdom;
| Use lib instead of src for skatejs dom diff. | Use lib instead of src for skatejs dom diff.
| JavaScript | mit | skatejs/kickflip,skatejs/kickflip |
a7b2005e731f9b82782a7c1e5a10958b974842db | scripts/release.js | scripts/release.js | var vow = require('vow'),
vowNode = require('vow-node'),
childProcess = require('child_process'),
fs = require('fs'),
exec = vowNode.promisify(childProcess.exec),
readFile = vowNode.promisify(fs.readFile),
writeFile = vowNode.promisify(fs.writeFile);
version = process.argv.slice(2)[0] || 'pa... | var vow = require('vow'),
vowNode = require('vow-node'),
childProcess = require('child_process'),
fs = require('fs'),
exec = vowNode.promisify(childProcess.exec),
readFile = vowNode.promisify(fs.readFile),
writeFile = vowNode.promisify(fs.writeFile);
version = process.argv.slice(2)[0] || 'pa... | Use "npm ci" instead of "npm i" | Use "npm ci" instead of "npm i"
| JavaScript | mit | dfilatov/vidom,dfilatov/vidom,dfilatov/vidom |
12730d88ead306ea569dd2152c34a9823883f5a5 | app/assets/javascripts/express_admin/utility.js | app/assets/javascripts/express_admin/utility.js | $(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hi... | $(function() {
// toggle on/off switch
$(document).on('click', '[data-toggle]', function() {
targetHide = $(this).data('toggle-hide')
targetShow = $(this).data('toggle-show')
$('[data-toggle-name="' + targetHide + '"]').addClass('hide')
$('[data-toggle-name="' + targetShow + '"]').removeClass('hi... | Add autofocus on the first input text or textarea | Add autofocus on the first input text or textarea
| JavaScript | mit | aelogica/express_admin,aelogica/express_admin,aelogica/express_admin,aelogica/express_admin |
78ef99ad5ac530063ec6de7416c04e1106b8f913 | api/index.js | api/index.js | var userApi = require('./user');
var fableApi = require('./fable');
var mongoose = require('mongoose');
var credentials = require('./credentials');
module.exports = function(app){
const route = '/api';
// Connect to MongoDB
console.log('Connecting to MongoLab as ' + credentials.username + '...');
var dbUrl =... | var userApi = require('./user');
var fableApi = require('./fable');
var mongoose = require('mongoose');
var credentials = require('./credentials');
module.exports = function(app){
const route = '/api';
// Connect to MongoDB
console.log('Connecting to MongoLab as ' + credentials.username + '...');
var dbUrl =... | Add env variables for heroku deployment | Add env variables for heroku deployment
| JavaScript | isc | RyanNHG/Aesop,RyanNHG/Aesop |
7aabb7730019229807dd350c290f9418a11a2d58 | app/index.js | app/index.js | import 'babel-polyfill';
import React from 'react';
import moment from 'moment';
import { render } from 'react-dom';
import { hashHistory } from 'react-router';
import { AppContainer } from 'react-hot-loader';
import { syncHistoryWithStore } from 'react-router-redux';
import configureStore from 'app/utils/configureStor... | import 'babel-polyfill';
import React from 'react';
import moment from 'moment';
import { render } from 'react-dom';
import { browserHistory } from 'react-router';
import { AppContainer } from 'react-hot-loader';
import { syncHistoryWithStore } from 'react-router-redux';
import configureStore from 'app/utils/configureS... | Switch from hashHistory to browserHistory | Switch from hashHistory to browserHistory
| JavaScript | mit | webkom/lego-webapp,webkom/lego-webapp,webkom/lego-webapp |
0ed43edd2eabb8edda94fe6f91f271ed00d7096b | HigherOrderFunctions/repeat.js | HigherOrderFunctions/repeat.js | function repeat(operation, num) {
if(num == 1 || num == 0){
return operation();
}
return repeat(operation(), num-1);
}
// Do not remove the line below
module.exports = repeat
| function repeat(operation, num) {
if(num <= 0){
return operation();
}
return repeat(operation, --num);
}
// Do not remove the line below
module.exports = repeat
| Edit higher order function solution | Edit higher order function solution
| JavaScript | mit | BrianLusina/JS-Snippets |
229c325aae9c3aa2e255457eab838c4fbd4b6707 | lib/modules/storage/utils/apply_modifier.js | lib/modules/storage/utils/apply_modifier.js | Astro.utils.storage.applyModifier = function(doc, modifier) {
// Apply $set modifier.
if (modifier.$set) {
_.each(modifier.$set, function(fieldValue, fieldPattern) {
Astro.utils.fields.setOne(doc, fieldPattern, fieldValue);
});
}
// Apply $push modifier.
if (modifier.$push) {
_.each(modifie... | Astro.utils.storage.applyModifier = function(doc, modifier) {
// Use Minimongo "_modify" method to apply modifier.
LocalCollection._modify(doc, modifier);
// Cast values that was set using modifier.
Astro.utils.fields.castNested(doc);
// Get modified fields.
let modified = Astro.utils.storage.getModified(... | Use Minimongo to perform modifications | Use Minimongo to perform modifications
| JavaScript | mit | jagi/meteor-astronomy |
786ae0b1f0dea9da1894a33c4380f5838e2154e7 | packages/redux-simple-auth/test/authenticators/credentials.spec.js | packages/redux-simple-auth/test/authenticators/credentials.spec.js | import createCredentialsAuthenticator from '../../src/authenticators/credentials'
beforeEach(() => {
fetch.resetMocks()
})
it('fetches from given endpoint using default config', () => {
fetch.mockResponse(JSON.stringify({ ok: true }))
const credentials = createCredentialsAuthenticator({
endpoint: '/authenti... | import createCredentialsAuthenticator from '../../src/authenticators/credentials'
beforeEach(() => {
fetch.resetMocks()
})
it('fetches from given endpoint using default config', () => {
fetch.mockResponse(JSON.stringify({ ok: true }))
const credentials = createCredentialsAuthenticator({
endpoint: '/authenti... | Add test to verify it handles errors correctly | Add test to verify it handles errors correctly
| JavaScript | mit | jerelmiller/redux-simple-auth |
a101fc768cedc7ac9754006e5b7292bb7084ab54 | Libraries/Core/setUpGlobals.js | Libraries/Core/setUpGlobals.js | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
/**
* Sets up global variables for React Native.
* You can use this module directly... | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
/**
* Sets up global variables for React Native.
* You can use this module directly... | Remove unnecessary global variable named GLOBAL | Remove unnecessary global variable named GLOBAL
Summary:
We are defining an alias for the global variable in React Native called `GLOBAL`, which is not used at all at Facebook and it doesn't seem it's used externally either. This alias is not standard nor common in the JS ecosystem, so we can just remove it to reduce ... | JavaScript | mit | janicduplessis/react-native,javache/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,facebook/react-native,javache/react-native,facebook/react-native,javache/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,facebook/reac... |
420bb9bcf135190223506693a6e3abef3ffa0c9b | src/main.js | src/main.js | /* global GuardianAPI, NYTAPI, DomUpdater */
function fillZero(num) {
return num < 10 ? `0${num}` : num;
}
function formatGuardianDate(date) {
return `${date.getFullYear()}-${fillZero(date.getMonth() + 1)}-${fillZero(date.getDate())}`;
}
function formatNYTDate(date) {
return `${date.getFullYear()}${fillZero(d... | /* global GuardianAPI, NYTAPI, DomUpdater */
function main() {
const today = new Date(Date.now());
console.log(today);
const datesLastWeek = Array.from({ length: 7 }, (_, idx) => new Date(today - (idx + 1) * (8.64 * Math.pow(10, 7))));
console.log(datesLastWeek);
const navDates = datesLastWeek.map(el => el... | Add Array of responsive dates for navDates display | Add Array of responsive dates for navDates display
| JavaScript | mit | Kata-Martagon/NewsAPI,Kata-Martagon/NewsAPI |
7c4b65ea7f00ba206d9f79e61209af284c8f5864 | scripts/js/020-components/05-feedback.js | scripts/js/020-components/05-feedback.js | var helpful_yes = document.querySelector( '.helpful_yes' );
var helpful_no = document.querySelector( '.helpful_no' );
var helpful_text = document.querySelector( '.helpful__question' );
function thanks(){
helpful_text.innerHTML = "Thanks for your response and helping us improve our content.";
helpful_no.remove();
he... | var helpful_yes = document.querySelector( '.helpful_yes' );
var helpful_no = document.querySelector( '.helpful_no' );
var helpful_text = document.querySelector( '.helpful__question' );
function thanks(){
helpful_text.innerHTML = "Thanks for your response and helping us improve our content.";
helpful_no.remove();
he... | Make a -1 value for "No" | Make a -1 value for "No"
| JavaScript | mit | govau/service-manual |
001dfa2fb926606369ba36b46448c1cda3d8f488 | config/env/development.js | config/env/development.js | 'use strict';
module.exports = {
db: 'mongodb://localhost/codeaux-dev',
app: {
title: 'Codeaux - Development Environment'
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/auth/facebook/callback'
},
twitter: {
clientI... | 'use strict';
module.exports = {
db: 'mongodb://localhost/codeaux-dev',
app: {
title: 'Codeaux - Development Environment',
description: 'Codeaux development stage'
}
};
| Remove duplicates code and update app variable. | Remove duplicates code and update app variable.
| JavaScript | mit | Codeaux/Codeaux,Codeaux/Codeaux,Codeaux/Codeaux |
d89c55588196f8f58910d470652cc2388fc72f25 | client/components/view-gist.js | client/components/view-gist.js | Template.viewGist.helpers({
description: function () {
return JSON.parse(this.content).description
},
files: function () {
console.log(JSON.parse(this.content).files)
const array = Object.keys(JSON.parse(this.content).files).map(filename => JSON.parse(this.content).files[filename])
return array
... | Template.viewGist.helpers({
description: function () {
return JSON.parse(this.content).description
},
files: function () {
return Object.keys(JSON.parse(this.content).files)
.map(filename => Object.assign(
JSON.parse(this.content).files[filename],
{ gistId: this._id }
))
}
})... | Fix updating to github gist | Fix updating to github gist
| JavaScript | isc | caalberts/code-hangout,caalberts/code-hangout |
f934e5201b6db5ee0eabf1b6f1613f70f2c1512e | page/templates/script.js | page/templates/script.js | 'use strict';
angular.module('edge.app.controllers').controller('<%= controllerName %>Controller', function () {
var <%= controllerName.toLowerCase() %> = this;
<%= controllerName.toLowerCase() %>.info = '<%= appTitle %> » <%= _.capitalize(name) %>';
});
| 'use strict';
angular.module('edge.app.controllers').controller('<%= controllerName %>Controller', function () {
var <%= controllerName.toLowerCase() %> = this;
<%= controllerName.toLowerCase() %>.info = '<%= appTitle %> - <%= _.capitalize(name) %>';
});
| Remove raquo so that it not necessary to sanitize html | Remove raquo so that it not necessary to sanitize html
| JavaScript | mit | greaterweb/generator-edgeplate,greaterweb/generator-edgeplate |
e3b8893664e0f2cd9249b63d5660d5000d11b2e5 | src/mean.js | src/mean.js | var mean = function (numArr) {
if(!Object.prototype.toString.call(numArr) === "[object Array]"){
return false;
}
return numArr.reduce(function(previousVal, currentVal){return previousVal + currentVal;}) / numArr.length;
};
anything.prototype.mean = mean;
| var mean = function (numArr) {
if(!Object.prototype.toString.call(numArr) === "[object Array]"){
return false;
}
return numArr.reduce(function(previousVal, currentVal){return previousVal + currentVal;}) / numArr.length;
};
anything.prototype.mean = mean;
| Remove extra space in indent | Remove extra space in indent | JavaScript | mit | dstrekelj/anything.js,developer787/anything.js,developer787/anything.js,developer787/anything.js,vekat/anything.js,awadYehya/anything.js,Rabrennie/anything.js,Sha-Grisha/anything.js,dstrekelj/anything.js,dstrekelj/anything.js,vekat/anything.js,awadYehya/anything.js,developer787/anything.js,vekat/anything.js,dstrekelj/a... |
0b700b286a6bc29dd2d4d8e8403533c8cd846bf2 | packages/accounts-twitter/twitter_server.js | packages/accounts-twitter/twitter_server.js | (function () {
Accounts.oauth.registerService('twitter', 1, function(oauthBinding) {
var identity = oauthBinding.get('https://api.twitter.com/1.1/account/verify_credentials.json').data;
return {
serviceData: {
id: identity.id_str,
screenName: identity.screen_name,
accessToken: ... | (function () {
Accounts.oauth.registerService('twitter', 1, function(oauthBinding) {
var identity = oauthBinding.get('https://api.twitter.com/1.1/account/verify_credentials.json').data;
var serviceData = {
id: identity.id_str,
screenName: identity.screen_name,
accessToken: oauthBindi... | Include avatar and language in serviceData when user signs in to Twitter | Include avatar and language in serviceData when user signs in to Twitter
| JavaScript | mit | h200863057/meteor,pandeysoni/meteor,LWHTarena/meteor,baiyunping333/meteor,esteedqueen/meteor,henrypan/meteor,evilemon/meteor,cherbst/meteor,Paulyoufu/meteor-1,guazipi/meteor,yiliaofan/meteor,HugoRLopes/meteor,jdivy/meteor,imanmafi/meteor,yonas/meteor-freebsd,queso/meteor,fashionsun/meteor,rabbyalone/meteor,deanius/mete... |
a4d7a5f9a19d56d51ba21702486e7f157da52785 | Blog/src/js/components/login.react.js | Blog/src/js/components/login.react.js | import React from 'react';
export default class Login extends React.Component {
render() {
return (
<form>
<div className="form-group">
<label htmlFor="username">{'Name'}</label>
<input
className="form-control"
... | import React from 'react';
export default class Login extends React.Component {
static get displayName() {
return 'Login';
}
render() {
return (
<form>
<div
className="form-group"
>
<label
... | Fix lint issues with Login component | Fix lint issues with Login component
| JavaScript | mit | rcatlin/ryancatlin-info,rcatlin/ryancatlin-info,rcatlin/ryancatlin-info,rcatlin/ryancatlin-info |
bac6c4e72db69dc7f7c6b79754046b8957779fed | tests/acceptance/build-info-test.js | tests/acceptance/build-info-test.js | import { test } from 'qunit';
import moduleForAcceptance from 'croodle/tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | build info');
test('version is included as html meta tag', function(assert) {
visit('/');
andThen(function() {
assert.ok($('head meta[name="build-info"]').length === ... | import { test } from 'qunit';
import moduleForAcceptance from 'croodle/tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | build info');
test('version is included as html meta tag', function(assert) {
visit('/');
andThen(function() {
assert.ok($('head meta[name="build-info"]').length === ... | Fix test after version in package.json has been corrected | Fix test after version in package.json has been corrected
| JavaScript | mit | jelhan/croodle,jelhan/croodle,jelhan/croodle |
39cc7b2b8521294d96d5d76b08773abe3739dd54 | addon/adapters/web-api.js | addon/adapters/web-api.js | import DS from 'ember-data';
export default DS.RESTAdapter.extend({
namespace: 'api',
ajaxError: function(_, response) {
return new DS.InvalidError(JSON.parse(response));
}
});
| import DS from 'ember-data';
const VALIDATION_ERROR_STATUSES = [400, 422];
export default DS.RESTAdapter.extend({
namespace: 'api',
ajaxError: function(xhr, response) {
let error = this._super(xhr);
if(!error || VALIDATION_ERROR_STATUSES.indexOf(error.status) < 0) {
return error;
}
... | Modify the adapter to only catch 400 and 422 responses as model validation errors | Modify the adapter to only catch 400 and 422 responses as model validation errors
| JavaScript | mit | CrshOverride/ember-web-api,CrshOverride/ember-web-api |
da648c56dc3098744d3316bfe5e38048c4c961b4 | test/app.js | test/app.js | 'use strict';
var path = require('path');
var assert = require('yeoman-assert');
var helpers = require('yeoman-test');
describe('generator-drizzle:app', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../generators/app'))
.withPrompts({someAnswer: true})
.on('end', done);
}... | /* eslint-env mocha */
'use strict';
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
describe('generator-drizzle:app', () => {
before(done => {
helpers.run(path.join(__dirname, '../generators/app'))
.withPrompts({someAnswer: true})
.on(... | Make stylistic changes to test file | Make stylistic changes to test file
| JavaScript | mit | cloudfour/generator-drizzle |
84e170852786e21a990da636501e8ddaf459be6c | examples/simple.js | examples/simple.js | var injector = require('../');
var app = injector();
app.value('port', 8080);
app.post('/greet/:name/:age', function(req, res) {
res.write('hello ' + req.params.name +
' age ' + req.params.age);
res.end();
});
app.listen(app.value('port'));
| var injector = require('../');
var app = injector();
app.value('port', 8080);
app.get('/greet/:name/:age', function(req, res) {
res.write('hello ' + req.params.name +
' age ' + req.params.age);
res.end();
});
app.listen(app.value('port'));
| Switch sample to use a GET instead of POST handler | Switch sample to use a GET instead of POST handler
| JavaScript | mit | itsananderson/molded |
312ce603a97e7befa5e666604c1dc18e0a767c1c | public/tutorial/index.js | public/tutorial/index.js | define(
["jquery"],
function($) {
function Tutorial(steps, content) {
var _this = this;
var currentIdx;
function show(idx) {
var step = steps[idx];
if (step.init) step.init.apply(_this);
step.$content = $('[data-step="' + step.name + '"]', content);
step.$conte... | define(
["jquery"],
function($) {
function Tutorial(steps, content) {
var _this = this;
var currentIdx;
function show(idx) {
var step = steps[idx];
if (step.init) step.init.apply(_this);
step.$content = $('[data-step="' + step.name + '"]', content);
step.$conte... | Reposition tooltips when window is resized | Reposition tooltips when window is resized
| JavaScript | mpl-2.0 | ekospinach/appmaker,uche40/appmaker,nirdeshdwa/appmaker,secretrobotron/appmaker,uche40/appmaker,valmzetvn/appmaker,lexoyo/appmaker,pcoughlin/appmaker,sheafferusa/appmaker,vaginessa/appmaker,lexoyo/appmaker,lexoyo/appmaker,vaginessa/appmaker,sheafferusa/appmaker,ekospinach/appmaker,ekospinach/appmaker,sheafferusa/appmak... |
f19722e7d14b1de3594f3bdfb42e4509a8606c40 | client/templates/projects/project_item.js | client/templates/projects/project_item.js | Template.projectItem.helpers({
canJoinProject: function(userId, projectId) {
var projectOwnerOrMember = Projects.find({ $or:
[{
'owner.userId': userId,
_id: projectId},
{
members:
{
$elemMatch:
{
userId: userId
}
... | Template.projectItem.helpers({
canJoinProject: function(userId, projectId) {
var projectOwnerOrMember = Projects.find({ $or:
[{
'owner.userId': userId,
_id: projectId},
{
members:
{
$elemMatch:
{
userId: userId
}
... | Add click action to project item template when clicking Join | Add click action to project item template when clicking Join
| JavaScript | mit | PUMATeam/puma,PUMATeam/puma |
30735514ce9ef7f9aff46c77ac417dbb5b79a4ec | src/gelato.js | src/gelato.js | 'use strict';
if ($ === undefined) {
throw 'Gelato requires jQuery as a dependency.'
} else {
window.jQuery = window.$ = $;
}
if (_ === undefined) {
throw 'Gelato requires Lodash as a dependency.'
} else {
window._ = _;
}
if (Backbone === undefined) {
throw 'Gelato requires Backbone as a dependency.'
} els... | 'use strict';
if ($ === undefined) {
throw 'Gelato requires jQuery as a dependency.'
} else {
window.jQuery = window.$ = $;
}
if (_ === undefined) {
throw 'Gelato requires Lodash as a dependency.'
} else {
window._ = _;
}
if (Backbone === undefined) {
throw 'Gelato requires Backbone as a dependency.'
} els... | Use lodash includes when testing for http string. | Use lodash includes when testing for http string.
| JavaScript | mit | mcfarljw/backbone-gelato,mcfarljw/gelato-framework,jernung/gelato,mcfarljw/gelato-framework,mcfarljw/backbone-gelato,jernung/gelato |
a3d113f35e6f4d429fb9a0c65dc23375dba0b38b | frontend/src/scenes/SplashScreen/index.js | frontend/src/scenes/SplashScreen/index.js | import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Button, Container, Input } from 'rebass';
import { actions } from '../../redux/players';
import HomeLayout from './components/HomeLayout';
class SplashScreen extends Component {
play = e => {
if (this._username !== undefin... | // @flow
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Container } from 'rebass';
import { actions } from '../../redux/players';
import { InputGroup, Button, Classes, Intent } from '@blueprintjs/core';
import HomeLayout from './components/HomeLayout';
class SplashScreen ext... | Change username input to use blueprint | Change username input to use blueprint
| JavaScript | mit | luxons/seven-wonders,luxons/seven-wonders,luxons/seven-wonders |
a872d24aff37f907d8c22b39b968c8121ed5213b | clipboard.js | clipboard.js | var clipboard = {};
clipboard.copy = (function() {
var _intercept = false;
var _data; // Map from data type (e.g. "text/html") to value.
document.addEventListener("copy", function(e){
if (_intercept) {
for (key in _data) {
e.clipboardData.setData(key, _data[key]);
}
e.preventDefaul... | var clipboard = {};
clipboard.copy = (function() {
var _intercept = false;
var _data; // Map from data type (e.g. "text/html") to value.
document.addEventListener("copy", function(e){
if (_intercept) {
for (var key in _data) {
e.clipboardData.setData(key, _data[key]);
}
e.preventDe... | Add missing `var` declaration for "use strict"; | Add missing `var` declaration for "use strict"; | JavaScript | mit | Coolaxer/clipboard.js,Zimbra/clipboard.js,Zimbra/clipboard.js,Coolaxer/clipboard.js |
d2911a29a82bd2b053fd09c7909012fc091ddd4a | book.js | book.js | module.exports = { "root": "./protocol-spec" };
// Only add piwik if we're building on the CI and deploying
if (process.env.CI) {
module.exports["plugins"] = ["piwik", "mermaid-gb3"];
module.exports["pluginsConfig"] = {
"piwik": {
"URL": "apps.nonpolynomial.com/p/",
"siteId": 7,
"phpPath": "j... | module.exports = { "root": "./protocol-spec" };
module.exports["plugins"] = ["mermaid-gb3"];
// Only add piwik if we're building on the CI and deploying
if (process.env.CI) {
module.exports["plugins"].push("piwik");
module.exports["pluginsConfig"] = {
"piwik": {
"URL": "apps.nonpolynomial.com/p/",
... | Fix mermaid plugin config inclusion | Fix mermaid plugin config inclusion
Config changed a lot while adding piwik
| JavaScript | bsd-3-clause | metafetish/buttplug |
45945d92e124f9e91ad3afdcfac068e2126e692b | src/config.js | src/config.js | let dotAnsel = `${process.env.HOME}/.ansel`;
if (process.env.ANSEL_DEV_MODE)
dotAnsel = `${process.env.INIT_CWD}/dot-ansel`;
export default {
characters: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZéè',
acceptedRawFormats: [ 'raf', 'cr2', 'arw', 'dng' ],
acceptedImgFormats: [ 'png', 'jpg', ... | let dotAnsel = `${process.env.HOME}/.ansel`;
if (process.env.ANSEL_DEV_MODE)
dotAnsel = `${process.env.INIT_CWD}/dot-ansel`;
export default {
characters: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZéè',
acceptedRawFormats: [ 'raf', 'cr2', 'arw', 'dng' ],
acceptedImgFormats: [ 'png', 'jpg', ... | Reduce concurrency level to 3 for accomodating acient thinkpad | Reduce concurrency level to 3 for accomodating acient thinkpad
| JavaScript | mit | m0g/ansel,m0g/ansel,m0g/ansel,m0g/ansel |
6296624a9f5e95aeec68e6c7afe6b1c70496773a | src/main.js | src/main.js | 'use babel'
import {transform} from 'babel-core'
import Path from 'path'
export const compiler = true
export const minifier = false
export function process(contents, {fileName, relativePath}, {config, state}) {
const beginning = contents.substr(0, 11)
if (beginning !== '"use babel"' && beginning !== "'use babel'"... | 'use babel'
import {transform} from 'babel-core'
import Path from 'path'
export const compiler = true
export const minifier = false
export function process(contents, {rootDirectory, filePath, config}) {
const beginning = contents.substr(0, 11)
if (beginning !== '"use babel"' && beginning !== "'use babel'") {
... | Upgrade package to latest ucompiler API | :arrow_up: Upgrade package to latest ucompiler API
| JavaScript | mit | steelbrain/ucompiler-plugin-babel |
ed9365d506c30a93a2550b0765ac7c2e57a565d1 | src/option.js | src/option.js | module.exports = {
Some: (value) => Object({ value, hasValue: true }),
None: Object()
}
| module.exports = {
Some: (value) => ({ value, hasValue: true }),
None: {},
}
| Use object literal syntax instead of Object constructor | Use object literal syntax instead of Object constructor
| JavaScript | apache-2.0 | leonardiwagner/z,z-pattern-matching/z,leonardiwagner/npm-z |
6a8911b4c95529923a198c534c87615ed5833a18 | addon/components/mail-check.js | addon/components/mail-check.js | import Ember from 'ember';
import Mailcheck from 'mailcheck';
export default Ember.Component.extend({
type: 'email',
name: 'email',
value: '',
placeholder: '',
suggestion: '',
inputClass: 'mailcheck-input',
classNames: ['mailcheck'],
actions: {
mailcheck: function() {
var _this = this;
... | import Ember from 'ember';
import Mailcheck from 'mailcheck';
export default Ember.Component.extend({
type: 'email',
name: 'email',
value: '',
placeholder: '',
suggestion: '',
inputClass: 'mailcheck-input',
classNames: ['mailcheck'],
actions: {
mailcheck: function() {
var _this = this;
... | Hide hint when a valid email is input | Hide hint when a valid email is input
| JavaScript | mit | johnotander/ember-mailcheck,johnotander/ember-mailcheck |
d8488c998a2094a1eaf44fcb2399f31b1491f8df | test/app.js | test/app.js | var request = require('supertest');
var app = require('../app.js');
describe('GET /', function() {
it('should return 200 OK', function(done) {
request(app)
.get('/')
.expect(200, done);
});
});
describe('GET /reset', function() {
it('should return 404', function(done) {
request(app)
.g... | var request = require('supertest');
var app = require('../app.js');
describe('GET /', function() {
it('should return 200 OK', function(done) {
request(app)
.get('/')
.expect(200, done);
});
});
describe('GET /login', function() {
it('should return 200 OK', function(done) {
request(app)
... | Add additional supertest tests for /signup, /api, /contact and /login | Add additional supertest tests for /signup, /api, /contact and /login
| JavaScript | mit | quazar11/portfolio,suamorales/course-registration,duchangyu/project-starter,bowdenk7/express-typescript-starter,jochan/mddb,dborncamp/shuttles,cmubick/sufficientlyridiculous,ahng1996/balloon-fight,gdiab/hackathon-starter,ColdMonkey/vcoin,loiralae/WaterlooHacks-Winter-2016-v2,pvijeh/node-express-mongo-api,peterblazejewi... |
570f3636195ebbd2a1e36210eecf85deb9556843 | js/components/developer/choose-job-type-screen/index.js | js/components/developer/choose-job-type-screen/index.js | import React, { Component } from 'react';
import { Container, Content } from 'native-base';
import JobTypeCard from './jobTypeCard';
import GlobalStyle from '../../common/globalStyle';
// Temporary constants. These will be moved and implemented in another way in the future!
const EXAMPLE_IMAGE_URL = 'https://facebook... | import React, { Component } from 'react';
import { Container, Content, List } from 'native-base';
import JobTypeCard from './jobTypeCard';
import GlobalStyle from '../../common/globalStyle';
// Temporary constants. These will be moved and implemented in another way in the future!
const EXAMPLE_IMAGE_URL = 'https://fa... | Use List from NativeBase to display job types in ChooseJobTypeScreen | Use List from NativeBase to display job types in ChooseJobTypeScreen
| JavaScript | mit | justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client,justarrived/p2p-client |
db7bc3914c1d83f6998be5840fbf43afd977d6ec | src/js/components/ServiceSearchFilter.js | src/js/components/ServiceSearchFilter.js | import mixin from 'reactjs-mixin';
import React from 'react';
import FilterInputText from './FilterInputText';
import QueryParamsMixin from '../mixins/QueryParamsMixin';
import ServiceFilterTypes from '../constants/ServiceFilterTypes';
const METHODS_TO_BIND = ['setSearchString'];
class ServiceSearchFilter extends mi... | import mixin from 'reactjs-mixin';
import React from 'react';
import FilterInputText from './FilterInputText';
import QueryParamsMixin from '../mixins/QueryParamsMixin';
import ServiceFilterTypes from '../constants/ServiceFilterTypes';
const METHODS_TO_BIND = ['setSearchString'];
class ServiceSearchFilter extends mi... | Correct placeholder for input field | Correct placeholder for input field
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
ce99214f1f6285c0d631065cbb391f62a31ed31c | client/tests/end2end/protractor-sauce.config.js | client/tests/end2end/protractor-sauce.config.js | var fs = require('fs');
var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json'));
var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES);
browser_capabilities['name'] = 'GlobaLeaks-E2E';
browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
browser_capabilities... | var fs = require('fs');
var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json'));
var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES);
browser_capabilities['name'] = 'GlobaLeaks-E2E';
browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
browser_capabilities... | Add branch tag to saucelabs runs | Add branch tag to saucelabs runs
| JavaScript | agpl-3.0 | vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks,vodkina/GlobaLeaks |
e42b5abd256c9a6ef4a336985bd0de77759b4ef0 | src/SortOptions.js | src/SortOptions.js | 'use strict';
const ProgramError = require('./error/ProgramError');
class SortOptions
{
constructor(options = {})
{
this.path = 'sort';
this.unique = false;
this.numeric = false;
this.reverse = false;
this.stable = false;
this.merge = false;
this.ignoreCase = false;
this.sortByHash = false;
this.t... | 'use strict';
const ProgramError = require('./error/ProgramError');
class SortOptions
{
constructor(options = {})
{
this.path = 'sort';
this.unique = false;
this.numeric = false;
this.reverse = false;
this.stable = false;
this.merge = false;
this.ignoreCase = false;
this.sortByHash = false;
this.t... | Set default buffer size to 64M | Set default buffer size to 64M | JavaScript | mit | avz/node-jl-sql-api |
515bb10c47efffa3c6a6de09339774154bcb7506 | website/gatsby-config.js | website/gatsby-config.js | module.exports = {
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `content`,
path: `${__dirname}/../content`,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
icon: `${__dirname}/src/images/kitura.svg`
},
},
{
... | module.exports = {
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
name: `content`,
path: `${__dirname}/../content`,
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
icon: `src/images/kitura.svg`
},
},
{
resolve: `... | Update relative path for favicon | Update relative path for favicon
| JavaScript | apache-2.0 | IBM-Swift/kitura.io |
ee2a5723a417eeac7609322cbd85b300cdd81cb7 | website/versionConfig.js | website/versionConfig.js | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | Update Litho version for Docusaurus | Update Litho version for Docusaurus
Reviewed By: muraziz
Differential Revision: D27236872
fbshipit-source-id: ccab5ed8a444cbf1027070a0261c108c307642f7
| JavaScript | apache-2.0 | facebook/litho,facebook/litho,facebook/litho,facebook/litho,facebook/litho,facebook/litho |
e22a2dd76a1f2329b981f3d6caa64e658ed0a16e | public/javascripts/DV/models/chapter.js | public/javascripts/DV/models/chapter.js | DV.model.Chapters = function(viewer) {
this.viewer = viewer;
this.loadChapters();
};
DV.model.Chapters.prototype = {
// Load (or reload) the chapter model from the schema's defined sections.
loadChapters : function() {
var sections = this.viewer.schema.data.sections;
var chapters = this.chapters = thi... | DV.model.Chapters = function(viewer) {
this.viewer = viewer;
this.loadChapters();
};
DV.model.Chapters.prototype = {
// Load (or reload) the chapter model from the schema's defined sections.
loadChapters : function() {
var sections = this.viewer.schema.data.sections;
var chapters = this.chapters = thi... | Remove duplicated _.each loop on sections | Remove duplicated _.each loop on sections
Looks like the original line got retained after
the move to "noConflict" underscore
| JavaScript | apache-2.0 | roberttdev/document-viewer4,roberttdev/document-viewer4,roberttdev/document-viewer4 |
c524f8cc6533f28e9a0883b944d962bfc978c853 | app/assets/javascripts/osem-datatables.js | app/assets/javascripts/osem-datatables.js | $(function () {
$.extend(true, $.fn.dataTable.defaults, {
"stateSave": true,
"autoWidth": false,
"pagingType": "full_numbers",
"lengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]],
});
$('.datatable:not([data-source])').DataTable();
$('.datatable').on('init.dt', function (e, settings, json)... | $(function () {
$.extend(true, $.fn.dataTable.defaults, {
"stateSave": true,
"autoWidth": false,
"pagingType": "full_numbers",
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
});
$('.datatable:not([data-source])').DataTable();
$('.datatable').on('init.dt', function (e, setting... | Add an option for shorter datatable pages | Add an option for shorter datatable pages
| JavaScript | mit | rishabhptr/osem,openSUSE/osem,hennevogel/osem,bear454/osem,AndrewKvalheim/osem,differentreality/osem,rishabhptr/osem,AndrewKvalheim/osem,SeaGL/osem,openSUSE/osem,openSUSE/osem,hennevogel/osem,bear454/osem,AndrewKvalheim/osem,differentreality/osem,differentreality/osem,bear454/osem,rishabhptr/osem,differentreality/osem,... |
ece010234d9b5de8ec4d90b9f8b30992baae9997 | jquery.instance.js | jquery.instance.js | /* jQuery.instance
* ---------------
*
* Quick guide:
*
* var $one = $("#sidebar").instance();
* var $two = $("#sidebar").instance();
* $one.abc = 42;
* $two.abc; //=> 42
*
* var Rule = {
* expand: function () { ... }
* };
*
* var $one = $("#sidebar").instance(Rule);
* $one.expand(... | // jQuery.instance
// ---------------
;(function($) {
$.fn.instance = function (type) {
var $this = this.first();
var $this = $this.data('instance') || ($this.data('instance', $this) && $this);
// Tip: Implement a 'klass' property to make sure extending doesn't happen twice.
if ((type) && ((!$this.k... | Make the JS file more readable by moving the comments. | Make the JS file more readable by moving the comments.
| JavaScript | mit | sinefunc/jquery.instance |
4edc55154305a022bf53c6015811d11ef38ce4ee | tests/docs.js | tests/docs.js | 'use strict';
var docs = require('../docs/src/js/docs');
var expect = require('chai').expect;
var sinon = require('sinon');
var stub = sinon.stub;
var utils = require('./helpers/utils');
var each = utils.each;
var any = utils.any;
var getContextStub = require('./helpers/get-context-stub');
var Canvas = require('../lib... | 'use strict';
var docs = require('../docs/src/js/docs');
var expect = require('chai').expect;
var sinon = require('sinon');
var stub = sinon.stub;
var utils = require('./helpers/utils');
var each = utils.each;
var any = utils.any;
var getContextStub = require('./helpers/get-context-stub');
var Canvas = require('../lib... | Add tests for description, arguments & returns | Add tests for description, arguments & returns
| JavaScript | mit | JakeSidSmith/canvasimo,JakeSidSmith/sensible-canvas-interface,JakeSidSmith/canvasimo |
f7ea63cc1349b5abade097fa9bf83bf60fddae07 | src/js/settings.js | src/js/settings.js |
const os = require('os')
const prefix = 'webjcs:'
class Settings {
constructor (defaults = {}) {
this.defaults = defaults
}
set (key, value) {
window.localStorage.setItem(prefix + key, JSON.stringify(value))
}
setDefault (key) {
const def = this.defaults[key]
this.set(key, def)
return ... |
const os = require('os')
const prefix = 'webjcs:'
class Settings {
constructor (defaults = {}) {
this.defaults = defaults
}
set (key, value) {
window.localStorage.setItem(prefix + key, JSON.stringify(value))
}
setDefault (key) {
const def = this.defaults[key]
this.set(key, def)
return ... | Make normal WebGL the default renderer | Make normal WebGL the default renderer
| JavaScript | mit | daniel-j/webjcs,daniel-j/webjcs |
560831185980b3caffbe9365c45d73c468de67b3 | src/settings/LanguagePickerItem.js | src/settings/LanguagePickerItem.js | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.c... | /* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';
import type { Context } from '../types';
import { RawLabel, Touchable } from '../common';
import { BRAND_COLOR } from '../styles';
import { IconDone } from '../common/Icons';
const componentStyles = StyleSheet.c... | Define language list item style locally. | language-settings: Define language list item style locally.
This list is doing something idiosyncratic, following a particular iOS
settings-UI convention; so it won't necessarily follow our normal
style for a list.
This commit just copies the global style in, without yet changing it.
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
0e105f32b829a7786fb860d4d6c5761b3a9980da | src/emitter.js | src/emitter.js | export default class Emitter {
constructor() {
this._events = {}
}
_event(name) {
return (this._events[name] = this._events[name] || new Set())
}
on(name, fn) {
this._event(name).add(fn)
}
off(name, fn) {
if (fn) this._event(name).delete(fn)
else this._event(name).clear()
}
onc... | import { EmitterError } from './error'
export default class Emitter {
constructor() {
this._events = {}
}
_event(name) {
return (this._events[name] = this._events[name] || new Set())
}
on(name, fn) {
if (typeof fn !== 'function') throw new EmitterError('requires function')
this._event(name)... | Check for fn in .on(), bail early in .off() | Check for fn in .on(), bail early in .off()
| JavaScript | mit | kroogs/yaemit |
59b277521b4dcecc917a57c920e13ba08cf532ba | lib/ember_orbit.js | lib/ember_orbit.js | import EO from './ember_orbit/main';
import Model from './ember_orbit/model';
import attr from './ember_orbit/attr';
import hasOne from './ember_orbit/relationships/has_one';
import hasMany from './ember_orbit/relationships/has_many';
EO.Model = Model;
EO.attr = attr;
EO.hasOne = hasOne;
EO.hasMany = hasMany;
export ... | import EO from './ember_orbit/main';
import Context from './ember_orbit/context';
import Model from './ember_orbit/model';
import RecordArrayManager from './ember_orbit/record_array_manager';
import Schema from './ember_orbit/schema';
import Source from './ember_orbit/source';
import Store from './ember_orbit/store';
i... | Expand top-level EO namespace members | Expand top-level EO namespace members
| JavaScript | mit | lytbulb/ember-orbit,pixelhandler/ember-orbit,gnarf/ember-orbit,ProlificLab/ember-orbit,orbitjs/ember-orbit,orbitjs/ember-orbit,gnarf/ember-orbit,pixelhandler/ember-orbit,greyhwndz/ember-orbit,opsb/ember-orbit,opsb/ember-orbit,lytbulb/ember-orbit,ProlificLab/ember-orbit,greyhwndz/ember-orbit,lytbulb/ember-orbit,orbitjs/... |
e590d56a96a189284347c47f793bf44bdf0b8a03 | lib/skype/setup.js | lib/skype/setup.js | 'use strict';
const skReply = require('./reply');
const skParse = require('./parse');
module.exports = function skSetup(api, bot, logError) {
api.post('/skype', request => {
let arr = [].concat.apply([], request.body),
skContextId = request.headers.contextid;
let skHandle = parsedMessage => {
... | 'use strict';
const skReply = require('./reply');
const skParse = require('./parse');
module.exports = function skSetup(api, bot, logError) {
api.post('/skype', request => {
let arr = [].concat.apply([], request.body),
skContextId = request.headers.contextid;
let skHandle = parsedMessage => {
... | Fix Skype postDeploy hook name | Fix Skype postDeploy hook name
| JavaScript | mit | IvanJov/claudia-bot-builder,claudiajs/claudia-bot-builder,jonjamz/claudia-bot-builder |
ea70ec45b38ce982fd3ddf38fca5693018766306 | modules/ui/preset_favorite.js | modules/ui/preset_favorite.js | import {
event as d3_event,
select as d3_select
} from 'd3-selection';
import { t } from '../util/locale';
import { svgIcon } from '../svg';
export function uiPresetFavorite(preset, geom, context, klass) {
var presetFavorite = {};
var _button = d3_select(null);
presetFavorite.button = function... | import {
event as d3_event,
select as d3_select
} from 'd3-selection';
import { t } from '../util/locale';
import { svgIcon } from '../svg';
export function uiPresetFavorite(preset, geom, context, klass) {
var presetFavorite = {};
var _button = d3_select(null);
presetFavorite.button = function... | Update favorite preset button state automatically | Update favorite preset button state automatically
| JavaScript | isc | AndreasHae/iD,openstreetmap/iD,morray/iD,morray/iD,kartta-labs/iD,digidem/iD,digidem/iD,kartta-labs/iD,AndreasHae/iD,kartta-labs/iD,openstreetmap/iD,openstreetmap/iD,AndreasHae/iD |
4b7ad48004c7c7a26e79e031eb0032b208a24c51 | alexandria/static/js/services/domains.js | alexandria/static/js/services/domains.js | app.service('Domains', ['$rootScope', '$q', '$resource', '$log',
function($rootScope, $q, $resource, $log) {
var service = {};
return service;
}
]);
| app.service('Domains', ['$rootScope', '$q', '$resource', '$log',
function($rootScope, $q, $resource, $log) {
var service = {};
return service;
}
]);
app.factory('Domain', ['$resource', function($resource) {
return $resource('/domain/:id'{ id: '@_id' }, {
update: {
metho... | Add a new Domain factory that returns a $resource | Add a new Domain factory that returns a $resource
| JavaScript | isc | bertjwregeer/alexandria,cdunklau/alexandria,cdunklau/alexandria,cdunklau/alexandria,bertjwregeer/alexandria |
3a55a3d40d59b5200a64df0f89d5297cdbbf13a2 | scripts/scheduleRun.js | scripts/scheduleRun.js | const initialize = require('../src/util/initialization.js')
const connectDatabase = require('../src/util/connectDatabase.js')
const ScheduleRun = require('../src/structs/ScheduleRun.js')
const setConfig = require('../src/config.js').set
async function testScheduleRun (userConfig) {
let config = setConfig(userConfig)... | const initialize = require('../src/util/initialization.js')
const connectDatabase = require('../src/util/connectDatabase.js')
const ScheduleRun = require('../src/structs/ScheduleRun.js')
const setConfig = require('../src/config.js').set
async function testScheduleRun (userConfig, callback) {
let config = setConfig(u... | Use callbacks for run schedule script (node exit before resolve) | Use callbacks for run schedule script (node exit before resolve)
| JavaScript | mit | synzen/Discord.RSS,synzen/Discord.RSS |
819eb850191f68dc8667925a667f6763b2292347 | app/routes/project/tasks/task.js | app/routes/project/tasks/task.js | import Ember from 'ember';
const {
Route,
inject: { service }
} = Ember;
export default Route.extend({
currentUser: service(),
model(params) {
let projectId = this.modelFor('project').id;
let { number } = params;
return this.store.queryRecord('task', { projectId, number });
},
setupControll... | import Ember from 'ember';
const {
Route,
inject: { service }
} = Ember;
export default Route.extend({
currentUser: service(),
model(params) {
let projectId = this.modelFor('project').id;
let { number } = params;
return this.store.queryRecord('task', { projectId, number });
},
setupControll... | Simplify comments list behavior so API requests are consistent with other types of records. | Simplify comments list behavior so API requests are consistent with other types of records.
| JavaScript | mit | code-corps/code-corps-ember,code-corps/code-corps-ember,jderr-mx/code-corps-ember,jderr-mx/code-corps-ember |
16de6e07a35f53bb580d3d912802a22c4b63020b | problems/kata/001-todo-backend/001/app.js | problems/kata/001-todo-backend/001/app.js | var express = require('express');
var cors = require('cors');
var bodyParser = require('body-parser');
var nano = require('nano')('http://localhost:5984');
var todo = nano.db.use('todo');
var app = express();
app.use(cors());
app.use(bodyParser.json());
app.get('/', function(req, res, next) {
console.log('get trig... | var express = require('express');
var cors = require('cors');
var bodyParser = require('body-parser');
var nano = require('nano')('http://localhost:5984');
var todo = nano.db.use('todo');
var app = express();
app.use(cors());
app.use(bodyParser.json());
app.get('/', function(req, res, next) {
console.log('get trig... | Delete now deletes from database (4/16). | Delete now deletes from database (4/16).
| JavaScript | mit | PurityControl/uchi-komi-js |
f9c6f64e390cdc09ab8a3f9bb28923d6cd2b6af6 | src/@data/withHomeFeed/homeFeedQuery.js | src/@data/withHomeFeed/homeFeedQuery.js | import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
desc... | import gql from 'graphql-tag';
const contentFragment = gql`
fragment ContentForFeed on Content {
entryId: id
title
channelName
status
meta {
siteId
date
channelId
}
parent {
entryId: id
content {
isLight
colors {
value
desc... | Remove $options from userFeed query | Remove $options from userFeed query
| JavaScript | mit | NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos,NewSpring/Apollos |
26bf7f873ecc19b7af2feb705ef63a00b9eed484 | src/content-script.js | src/content-script.js | /* global tabID */
"use strict";
const existingIframe = document.querySelector("iframe#dom-distiller-result-iframe");
if(existingIframe) {
existingIframe.remove();
} else {
const iframe = document.createElement("iframe");
iframe.src = chrome.runtime.getURL("dom-distiller/html/dom_distiller_viewer.html") + "... | /* global tabID */
"use strict";
var iframeID = "dom-distiller-result-iframe";
var existingIframe = document.getElementById(iframeID);
if(existingIframe) {
existingIframe.remove();
if("old" in window) {
document.title = window.old.title;
document.body.setAttribute("style", window.old.bodyStyle);... | Remove iframe and restore from hiding style | Remove iframe and restore from hiding style
| JavaScript | mit | metarmask/dom-distiller-reading-mode,metarmask/dom-distiller-reading-mode |
f38a7692254a981ef1f761a41e76c88cd72355a7 | linkedin_client.js | linkedin_client.js | // Meteor.loginWithLinkedin = function (options, callback) {
// var credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback);
// LinkedIn.requestCredential(options, credentialRequestCompleteCallback);
// };
Meteor.loginWithLinkedIn = function(options, callback) {
// suppo... | // Meteor.loginWithLinkedin = function (options, callback) {
// var credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback);
// LinkedIn.requestCredential(options, credentialRequestCompleteCallback);
// };
Meteor.loginWithLinkedIn = function(options, callback) {
// suppo... | Add new capitalized version of loging in with linked in | Add new capitalized version of loging in with linked in | JavaScript | mit | PoBuchi/meteor-accounts-linkedin,PauliBuccini/meteor-accounts-linkedin |
8e7f0194c0e97bebf62ac9a0af8f2b6d497347a0 | server/publications.js | server/publications.js | Meteor.publish('journalEntries', function (limit, skip) {
var filter = {}
var options = {
fields: {
'title': 1,
'teaser': 1,
'published': 1,
'createdAt': 1
},
sort: [['createdAt', 'desc']]
}
if(limit) options.limit = limit
if(skip) options.skip = skip
if(!this.userId) fil... | Meteor.publish('journalEntries', function (limit, skip) {
var filter = {}
var options = {
fields: {
'title': 1,
'teaser': 1,
'published': 1,
'createdAt': 1
},
sort: [['published', 'asc'], ['createdAt', 'desc']]
}
if(limit) options.limit = limit
if(skip) options.skip = skip
... | Sort the journal entries, so that unpublished entries are on top | Sort the journal entries, so that unpublished entries are on top
| JavaScript | mit | Kriegslustig/kriegslustig.me,Kriegslustig/kriegslustig.me,Kriegslustig/kriegslustig.me |
83a7b99a5023bb137e99d9a430754c7411c53c9a | web/main.js | web/main.js | CenterScout.config(function($routeProvider) {
$routeProvider.when('/', {
controller: 'HomeController',
templateUrl: 'views/home.html'
});
$routeProvider.when('/home', {
controller: 'HomeController',
templateUrl: 'views/home.html'
});
$routeProvider.when('/class', {
... | CenterScout.config(function($routeProvider) {
$routeProvider.when('/', {
controller: 'HomeController',
templateUrl: 'views/home.html'
});
$routeProvider.when('/home', {
controller: 'HomeController',
templateUrl: 'views/home.html'
});
$routeProvider.when('/class', {
... | Change 404 route to index | Change 404 route to index
| JavaScript | mit | LFHS/CenterScout |
1b962f46de8797d7cd6a7b4ca934f4adb07fc601 | test/buster.js | test/buster.js | var config = module.exports;
config["fruitmachine"] = {
rootPath: '../',
environment: "browser",
sources: [
'build/fruitmachine.js',
'node_modules/hogan.js/lib/template.js',
'node_modules/hogan.js/lib/compiler.js',
'test/helpers/*.js'
],
tests: [
'test/tests/*.js'
]
};
| var config = module.exports;
config["fruitmachine"] = {
rootPath: '../',
environment: "browser",
sources: [
'build/fruitmachine.min.js',
'node_modules/hogan.js/lib/template.js',
'node_modules/hogan.js/lib/compiler.js',
'test/helpers/*.js'
],
tests: [
'test/tests/*.js'
]
};
| Use min version in test to make sure no compilation errors exist | Use min version in test to make sure no compilation errors exist
| JavaScript | mit | quarterto/fruitmachine,ftlabs/fruitmachine,quarterto/fruitmachine |
7d511728d0b9dfcf440dfede353e27a38d79ea56 | share/spice/brainy_quote/brainy_quote.js | share/spice/brainy_quote/brainy_quote.js | function ddg_spice_brainy_quote (api_result) {
if (api_result.error) return;
Spice.render({
data : api_result,
force_big_header : true,
header1 : api_result.header1,
source_name : api_result.source_name, // More at ...
source_url ... | function ddg_spice_brainy_quote (api_result) {
if (api_result.error) return;
// Check if the result is a category search or not.
// We'll know that if the author is specified in the JSON response.
if(api_result.author) {
return;
}
Spice.render({
data : api_result,
... | Check if the result is a category or not. | BrainyQuote: Check if the result is a category or not.
Queries such as "quote mining", "financial quotations", or "lame quotes" should not show up.
| JavaScript | apache-2.0 | levaly/zeroclickinfo-spice,xaviervalarino/zeroclickinfo-spice,samskeller/zeroclickinfo-spice,mr-karan/zeroclickinfo-spice,bibliotechy/zeroclickinfo-spice,gautamkrishnar/zeroclickinfo-spice,cylgom/zeroclickinfo-spice,GrandpaCardigan/zeroclickinfo-spice,Retrobottega/zeroclickinfo-spice,P71/zeroclickinfo-spice,digit4lfa1l... |
72d5d878435d13c67a8ef6c4148a9e28e13abbfa | app/assets/javascripts/ministerSelect.js | app/assets/javascripts/ministerSelect.js | //= require jquery.autocomplete
(function ($) {
$.fn.ministerSelect = function (options) {
var settings = $.extend({
inputClass: 'minister-select-input'
}, options);
return this.each(function () {
var $select = $(this),
$input = $('<input type="text... | //= require jquery.autocomplete
(function ($) {
$.fn.ministerSelect = function (options) {
var settings = $.extend({
inputClass: 'minister-select-input'
}, options);
return this.each(function () {
var $select = $(this),
$input = $('<input type="text... | Use the autocomplete lookup instead of traversing DOM elements | Use the autocomplete lookup instead of traversing DOM elements
| JavaScript | mit | ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions |
9a340fa1ae05181b2dc2803cb485bbdcdf43ea0a | src/components/explorer/results/QueryResultsSelector.js | src/components/explorer/results/QueryResultsSelector.js | import PropTypes from 'prop-types';
import React from 'react';
class QueryResultsSelector extends React.Component {
state = {
selectedQueryIndex: 0,
}
render() {
const { options, onQuerySelected } = this.props;
if (options.length === 1) {
// if only one query don't show option to switch between... | import PropTypes from 'prop-types';
import React from 'react';
import { trimToMaxLength } from '../../../lib/stringUtil';
class QueryResultsSelector extends React.Component {
state = {
selectedQueryIndex: 0,
}
render() {
const { options, onQuerySelected } = this.props;
if (options.length === 1) {
... | Trim tab size for readability | Trim tab size for readability
| JavaScript | apache-2.0 | mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools |
8e963c3216b074b979e7c4cf0c8f7a7bdc730590 | test/common.js | test/common.js | var warned = false
function testCommon (options) {
var factory = options.factory
var test = options.test
var clear = !!options.clear
if (typeof factory !== 'function') {
throw new TypeError('factory must be a function')
}
if (typeof test !== 'function') {
throw new TypeError('test must be a funct... | function testCommon (options) {
var factory = options.factory
var test = options.test
if (typeof factory !== 'function') {
throw new TypeError('factory must be a function')
}
if (typeof test !== 'function') {
throw new TypeError('test must be a function')
}
return {
test: test,
factory:... | Remove process.emitWarning because it breaks AppVeyor builds | Remove process.emitWarning because it breaks AppVeyor builds
See Level/leveldown#660
| JavaScript | mit | Level/abstract-leveldown |
994bff56468a68e780be77c262fbc2271232db45 | lit-config.js | lit-config.js | module.exports = {
"extends": "./index.js",
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"lit", "html"
],
"globals": {
"D2L": false,
"Promise": false
},
"rules": {
"strict": [2, "never"],
"lit/no-duplicate-template-bindings": 2,
"lit/no-legacy-template... | module.exports = {
"extends": "./index.js",
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"lit", "html"
],
"globals": {
"D2L": false,
"Promise": false
},
"rules": {
"no-var": 2,
"prefer-const": 2,
"strict": [2, "never"],
"lit/no-duplicate-template-b... | Add const and var rules to lit config | Add const and var rules to lit config
| JavaScript | apache-2.0 | Brightspace/eslint-config-brightspace |
6af4c07efaeeeb1efd3a78b0b6d8de5327e41276 | app/webroot/js/sentences.show_another.js | app/webroot/js/sentences.show_another.js | /**
* Tatoeba Project, free collaborative creation of multilingual corpuses project
* Copyright (C) 2009 HO Ngoc Phuong Trang <tranglich@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Sof... | /**
* Tatoeba Project, free collaborative creation of multilingual corpuses project
* Copyright (C) 2009 HO Ngoc Phuong Trang <tranglich@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Sof... | Fix sentence buttons on reloaded random sentence | Fix sentence buttons on reloaded random sentence
Closes #1658.
| JavaScript | agpl-3.0 | Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2 |
fa72546b7d7b509b83c615ff23b5c73b55dfc450 | catwatch/assets/scripts/entry.js | catwatch/assets/scripts/entry.js | var moment = require('moment');
var coupon = require('./coupon');
var stripe = require('./stripe');
var BulkDelete = require('./bulk-delete');
var faye = require('./faye');
$(document).ready(function () {
coupon();
stripe();
var bulk_delete = new BulkDelete();
bulk_delete.listenForEvents();
if (... | var moment = require('moment');
var coupon = require('./coupon');
var stripe = require('./stripe');
var BulkDelete = require('./bulk-delete');
var faye = require('./faye');
$(document).ready(function () {
coupon();
stripe();
var bulk_delete = new BulkDelete();
bulk_delete.listenForEvents();
if (... | Add timezone output to the momentjs dates | Add timezone output to the momentjs dates
| JavaScript | mit | nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask |
7b884fab3cc68b07f9e53edb69d014b1aeca46c2 | .eslintrc.js | .eslintrc.js | var path = require('path');
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 7,
ecmaFeatures: {
impliedStrict: true,
experimentalObjectRestSpread: true,
},
},
globals: {
__version: true,
__co... | var path = require('path');
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 7,
ecmaFeatures: {
impliedStrict: true,
experimentalObjectRestSpread: true,
},
},
globals: {
__version: true,
__co... | Fix eslint import resolver path. | Fix eslint import resolver path.
| JavaScript | mit | mrpau/kolibri,jonboiser/kolibri,learningequality/kolibri,lyw07/kolibri,DXCanas/kolibri,lyw07/kolibri,mrpau/kolibri,benjaoming/kolibri,learningequality/kolibri,DXCanas/kolibri,christianmemije/kolibri,indirectlylit/kolibri,benjaoming/kolibri,christianmemije/kolibri,mrpau/kolibri,jonboiser/kolibri,mrpau/kolibri,indirectly... |
77bba0f59fc33dd9de6875e63a7261bc156d5de5 | app/scripts/components/auth/auth-init.js | app/scripts/components/auth/auth-init.js | import template from './auth-init.html';
export const authInit = {
template,
controller: class AuthInitController {
constructor(usersService, $state, ENV, ncUtilsFlash) {
// @ngInject
this.usersService = usersService;
this.$state = $state;
this.ncUtilsFlash = ncUtilsFlash,
this.us... | import template from './auth-init.html';
export const authInit = {
template,
controller: class AuthInitController {
constructor(usersService, $state, ENV, ncUtilsFlash) {
// @ngInject
this.usersService = usersService;
this.$state = $state;
this.ncUtilsFlash = ncUtilsFlash,
this.us... | Copy user before update (WAl-383) | Copy user before update (WAl-383)
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport |
e3df78442ee404e23a4683d4973bef29770f5609 | .eslintrc.js | .eslintrc.js | module.exports = {
extends: "eslint:recommended",
rules: {
"no-console": 0,
quotes: ["error", "backtick"],
semi: ["error", "never"]
},
env: {
node: true,
es6: true
},
parserOptions: {
ecmaFeatures: {
modules: "true"
},
sourceType: "module"
}
}
| module.exports = {
extends: "eslint:recommended",
rules: {
"no-console": 0,
"object-curly-spacing": ["error", "always"],
"comma-dangle": [
"error",
{
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multili... | Configure ESLint to support ES2017 | Configure ESLint to support ES2017
| JavaScript | mit | mattdean1/contentful-text-search |
98ad4755ebcc123aa4a18441d8252dccef3d08c1 | .eslintrc.js | .eslintrc.js | module.exports = {
"env": {
"es6": true,
"node": true
},
"plugins": ["node"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"... | module.exports = {
"env": {
"es6": true,
"node": true
},
"plugins": ["node"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2, {
"MemberExpression": 2
}
],
"linebr... | Add eslint rule for js2-mode | Add eslint rule for js2-mode
| JavaScript | apache-2.0 | fluent/fluent-logger-node |
9774591c0e0b1bd216332dea056ad6ca1c1d782b | src/converter/r2t/WrapAbstractContent.js | src/converter/r2t/WrapAbstractContent.js | import { unwrapChildren } from '../util/domHelpers'
const ABSTRACT_META = ['object-id','sec-meta', 'label', 'title'].reduce((m, n) => { m[n] = true; return m}, {})
const ABSTRACT_BACK = ['notes','fn-group','glossary','ref-list'].reduce((m, n) => { m[n] = true; return m}, {})
export default class WrapAbstractContent {... | import { unwrapChildren } from '../util/domHelpers'
const ABSTRACT_META = ['object-id','sec-meta', 'label', 'title'].reduce((m, n) => { m[n] = true; return m}, {})
const ABSTRACT_BACK = ['notes','fn-group','glossary','ref-list'].reduce((m, n) => { m[n] = true; return m}, {})
export default class WrapAbstractContent {... | Make sure that there is at least one p inside abstract. | Make sure that there is at least one p inside abstract.
| JavaScript | mit | substance/texture,substance/texture |
8b2611a84cb507c68b89f36cf0f241a778b73f73 | tilehandler.js | tilehandler.js | var app = require('server'),
tl = require('tl');
app.get('/:scheme/:mapfile_64/:z/:x/:y.*', function(req, res) {
/*
* scheme: (xyz|tms|tile (tms))
*
* format:
* - Tile: (png|jpg)
* - Data Tile: (geojson)
* - Grid Tile: (*.grid.json)
*/
try {
var tile = new tl.Tile... | var app = require('server'),
_ = require('underscore')._,
tl = require('tl');
app.get('/:scheme/:mapfile_64/:z/:x/:y.*', function(req, res) {
/*
* scheme: (xyz|tms|tile (tms))
*
* format:
* - Tile: (png|jpg)
* - Data Tile: (geojson)
* - Grid Tile: (*.grid.json)
*/
try... | Add missing require for underscore. | Add missing require for underscore.
| JavaScript | bsd-3-clause | tomhughes/tilelive.js,mapbox/tilelive,paulovieira/tilelive,mapbox/tilelive.js,kyroskoh/tilelive,topwood/tilelive,gravitystorm/tilelive.js,nyurik/tilelive.js,Norkart/tilelive.js |
8e2b2c414dd01aaa69a3cb1de4d7e5f838759c90 | src/database/DataTypes/TemperatureLog.js | src/database/DataTypes/TemperatureLog.js | /**
* Sustainable Solutions (NZ) Ltd. 2020
* mSupply Mobile
*/
import Realm from 'realm';
export class TemperatureLog extends Realm.Object {}
TemperatureLog.schema = {
name: 'TemperatureLog',
primaryKey: 'id',
properties: {
id: 'string',
temperature: 'double',
timestamp: 'date',
location: 'L... | /**
* Sustainable Solutions (NZ) Ltd. 2020
* mSupply Mobile
*/
import Realm from 'realm';
export class TemperatureLog extends Realm.Object {}
TemperatureLog.schema = {
name: 'TemperatureLog',
primaryKey: 'id',
properties: {
id: 'string',
temperature: 'double',
timestamp: 'date',
location: 'L... | Add update optional breach field | Add update optional breach field
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile |
5e3f0f88317e8c4dea16e2b60fecb911d73ce261 | code/js/controllers/SpotifyController.js | code/js/controllers/SpotifyController.js | ;(function() {
"use strict";
var BaseController = require("BaseController");
new BaseController({
siteName: "Spotify",
playPause: "[title='Pause'],[title='Play']",
playNext: "[title='Next']",
playPrev: "[title='Previous']",
playState: "[title='Pause']",
song: ".now-playing-bar div div [... | ;(function() {
"use strict";
var BaseController = require("BaseController"),
_ = require("lodash");
var multiSelectors = {
playPause: ["#play-pause", "#play", "[title='Pause'],[title='Play']"],
playNext: ["#next", "#next", "[title='Next']"],
playPrev: ["#previous", "#previous", "[title='Previo... | Fix spotify for older player versions. | Fix spotify for older player versions.
| JavaScript | mit | nemchik/streamkeys,nemchik/streamkeys,nemchik/streamkeys,ovcharik/streamkeys,ovcharik/streamkeys,alexesprit/streamkeys,berrberr/streamkeys,berrberr/streamkeys,berrberr/streamkeys,alexesprit/streamkeys |
fb3f71b4e38d2d6196d2f157f30fd99188a29184 | src/react-redux.js | src/react-redux.js | /* @flow strict-local */
import type { ComponentType, ElementConfig } from 'react';
import { connect as connectInner } from 'react-redux';
import type { GlobalState } from './types';
export const connect: <
C: ComponentType<*>,
// S == GlobalState
SP: {},
RSP: {},
CP: $Diff<$Diff<ElementConfig<C>, { dispatc... | /* @flow strict-local */
import type { ComponentType, ElementConfig } from 'react';
import { connect as connectInner } from 'react-redux';
import type { GlobalState } from './types';
export const connect: <
C: ComponentType<*>,
// S == GlobalState
SP: {},
RSP: {},
CP: $Diff<$Diff<ElementConfig<C>, { dispatc... | Add a "fixme" version, `connectFlowFixMe`. | connect: Add a "fixme" version, `connectFlowFixMe`.
| JavaScript | apache-2.0 | vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile,vishwesh3/zulip-mobile |
11a944cb7881db56137e826c3529f2ccca5c226e | app/assets/javascripts/lesson_plan.js | app/assets/javascripts/lesson_plan.js | function LessonPlanEntryFormType(pickers) {
var self = this;
this.pickers = pickers;
pickers.forEach(function(picker) {
picker.onSelectionCompleted = function() { self.doneCallback.apply(self, arguments); }
});
}
LessonPlanEntryFormType.prototype.pick = function() {
var $modal = $('<div class="modal hide... | $(document).ready(function() {
function LessonPlanEntryFormType(pickers) {
var self = this;
this.pickers = pickers;
pickers.forEach(function(picker) {
picker.onSelectionCompleted = function() { self.doneCallback.apply(self, arguments); }
});
}
LessonPlanEntryFormType.prototype.pick = functi... | Define the lesson plan form type only on page load. | Define the lesson plan form type only on page load.
| JavaScript | mit | dariusf/coursemology.org,allenwq/coursemology.org,nnamon/coursemology.org,dariusf/coursemology.org,Coursemology/coursemology.org,dariusf/coursemology.org,nusedutech/coursemology.org,allenwq/coursemology.org,allenwq/coursemology.org,nnamon/coursemology.org,nusedutech/coursemology.org,nusedutech/coursemology.org,Coursemo... |
292b7df5a8da7e74a1979e781ecf7a377da2876e | app/assets/javascripts/radioSlider.js | app/assets/javascripts/radioSlider.js | (function(global) {
"use strict";
global.GOVUK.Modules.RadioSlider = function() {
this.start = function(component) {
$(component)
.on('click', function() {
leftRight = $(this).find(':checked').next('label').text().split('/');
if (leftRight.length === 2) {
$(th... | (function(global) {
"use strict";
global.GOVUK.Modules.RadioSlider = function() {
this.start = function(component) {
$(component)
.on('click', function() {
valuesInLabel = $(this).find(':checked').next('label').text().split('/');
if (valuesInLabel.length === 2) {
... | Add named variables for clarity | Add named variables for clarity
| JavaScript | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin |
e45315ab54b014c5a4f529c22000ba0213cb376a | karma.conf.js | karma.conf.js | module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'dest/taggd.js',
'tests/functions.js',
'tests/units/*.js',
'tests/behavior/*.js',
{
pattern: 'tests/assets/**/*.jpg',
watched: false,
included: false,
... | module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'dist/taggd.js',
'tests/functions.js',
'tests/units/*.js',
'tests/behavior/*.js',
{
pattern: 'tests/assets/**/*.jpg',
watched: false,
included: false,
... | Fix destination paths for tests | Fix destination paths for tests
| JavaScript | mit | timseverien/taggd,timseverien/taggd |
770d2ce95f6dfcb557e4591eeee97cd96de191e1 | karma.conf.js | karma.conf.js | const webpack = require('./webpack.config')
module.exports = config => {
config.set({
frameworks: ['mocha', 'chai'],
files: [
{ pattern: 'test/components/*.js', watched: false }
],
preprocessors: {
'test/components/*.js': ['webpack']
},
webpack,
webpackMiddleware: {
stat... | const webpack = require('./webpack.config')
process.env.CHROME_BIN = require('puppeteer').executablePath()
module.exports = config => {
config.set({
frameworks: ['mocha', 'chai'],
files: ['test/components/index.js', 'test/components/*.js'],
preprocessors: {
'test/components/*.js': ['webpack']
}... | Switch to headless chrome from chrome | Switch to headless chrome from chrome
| JavaScript | mit | sunya9/beta,sunya9/beta,sunya9/beta |
408d4ecbd40aaf1de9ed439a1652606e0030acf5 | spec/bin/jasmine_spec.js | spec/bin/jasmine_spec.js | import path from 'path';
import {exec} from 'node-promise-es6/child-process';
async function cli(fixture, env = null) {
const child = await exec(
'jasmine',
{
cwd: path.resolve(`fixtures/${fixture}`),
env: Object.assign({}, process.env, env)
}
);
return child.stdout;
}
describe('jasmine-... | import path from 'path';
import {exec} from 'node-promise-es6/child-process';
async function cli(fixture, env = null) {
const child = await exec(
'jasmine',
{
cwd: path.resolve(__dirname, `../../fixtures/${fixture}`),
env: Object.assign({}, process.env, env)
}
);
return child.stdout;
}
d... | Remove calls to `path.resolve` with no root directory | Remove calls to `path.resolve` with no root directory
| JavaScript | mit | vinsonchuong/jasmine-es6,dongtong/jasmine-es6 |
a42a841fca52fc2dec520329ef1c32a97ab2dece | app/services/passwordCheckService.js | app/services/passwordCheckService.js | var app = angular.module("AdmissionsApp");
app.service("PasswordCheckService", ["$http", function ($http) {
var submitBaseUrl = "http://admissions.vschool.io/api/part";
this.checkPassword = function (password, partNumber) {
var submitData = {answer: password};
return $http.post(submitBaseUrl +... | var app = angular.module("AdmissionsApp");
app.service("PasswordCheckService", ["$http", function ($http) {
var submitBaseUrl = "http://admissions-qa.vschool.io/api/part";
this.checkPassword = function (password, partNumber) {
var submitData = {answer: password};
return $http.post(submitBaseUr... | Change subdomain to reflect that it's in a testing period still | Change subdomain to reflect that it's in a testing period still
| JavaScript | mit | bobziroll/admissions,bobziroll/admissions |
034d845f47267d70a412dc98ea81e8bb3ab27d38 | mzalendo/map/static/js/map-drilldown.js | mzalendo/map/static/js/map-drilldown.js | (function () {
function initialize_map() {
var map_element = document.getElementById("map-drilldown-canvas");
if (!map_element) return false;
// start with the default bounds for kenya
var map_bounds = {
north: 5,
east: 44,
south: -5,
west: 33.5
};
var map_has_be... | (function () {
function initialize_map() {
var map_element = document.getElementById("map-drilldown-canvas");
if (!map_element) return false;
// start with the default bounds for kenya
var map_bounds = {
north: 5,
east: 44,
south: -5,
west: 33.5
};
var map_has_be... | Enable map controls, switch to terrain view | Enable map controls, switch to terrain view
| JavaScript | agpl-3.0 | mysociety/pombola,mysociety/pombola,hzj123/56th,patricmutwiri/pombola,hzj123/56th,geoffkilpin/pombola,geoffkilpin/pombola,patricmutwiri/pombola,geoffkilpin/pombola,mysociety/pombola,patricmutwiri/pombola,hzj123/56th,hzj123/56th,ken-muturi/pombola,mysociety/pombola,ken-muturi/pombola,ken-muturi/pombola,mysociety/pombola... |
f6278a3b08f23637bfc3d848f864dc971cfa94ce | lib/Events.js | lib/Events.js | module.exports = {
on: function(name, callback, context) {
var events = this._getEvents(name) || [];
this._events[name] = events.concat({
callback: callback,
context: context || this
});
return this;
},
off: function(name, callback, context) {
if (callback) {
var events = ... | var events = {};
function getEvents(name) {
events[name] = events[name] || [];
return events[name];
}
function setEvents(name, newEvents) {
events[name] = newEvents;
}
function addEvent(name, event) {
var newEvents = getEvents(name).concat(event);
setEvents(name, newEvents);
}
function removeEvent(name,... | Use private functions for implementation details of Event module | Use private functions for implementation details of Event module
| JavaScript | mit | dscout/immunid,dscout/immunid |
638143097275249385dbe7f8c7287ec4a4039424 | src/rawTransaction.js | src/rawTransaction.js | import Tx from 'ethereumjs-tx'
import ethUtil from 'ethereumjs-util'
import web3 from './web3client'
import { coinbase, another, keys } from './keys'
export function signTransaction(rawTx) {
var account = keys[rawTx.from]
if(!account) {
throw new Error(`No private key for account "${from}"`)
}
var private... | import Tx from 'ethereumjs-tx'
import ethUtil from 'ethereumjs-util'
import web3 from './web3client'
import { coinbase, another, keys } from './keys'
export function signTransaction(rawTx) {
const account = keys[rawTx.from]
if(!account) {
throw new Error(`No private key for account "${from}"`)
}
const pri... | Add hex prefix to signed transaction | Add hex prefix to signed transaction
| JavaScript | mit | CBAInnovationLab/web3-sandbox |
2501a700a90553786b122438a5cf9a6d46001ae8 | javascripts/background.js | javascripts/background.js | var githubFeed = ({
feedUrl: "",
loadFeedUrl: function() {
var self = this;
chrome.storage.local.get("current_user_url", function(data) {
self.feedUrl = data.current_user_url;
});
},
urlChanged: function() {
chrome.storage.onChanged.addListener(function(changes, namespace) {
for (v... | var githubFeed = ({
feedUrl: "",
loadFeedUrl: function() {
var self = this;
chrome.storage.local.get("current_user_url", function(data) {
self.feedUrl = data.current_user_url;
});
},
urlChanged: function() {
var self = this;
chrome.storage.onChanged.addListener(function(changes, name... | Call getUserFeed() when current user url is changed | Call getUserFeed() when current user url is changed
| JavaScript | mit | TAKAyukiatkwsk/github_feed_notifier |
bad3a8c822be9935fb7607212b7ddf639fe878b0 | docs/examples/AsyncPromises.js | docs/examples/AsyncPromises.js | import React, { Component } from 'react';
import AsyncSelect from '../../src/Async';
import { colourOptions } from '../data';
type State = {
inputValue: string,
};
const filterColors = (inputValue: string) => {
return colourOptions.filter(i =>
i.label.toLowerCase().includes(inputValue.toLowerCase())
);
}... | import React, { Component } from 'react';
import AsyncSelect from '../../src/Async';
import { colourOptions } from '../data';
const filterColors = (inputValue: string) => {
return colourOptions.filter(i =>
i.label.toLowerCase().includes(inputValue.toLowerCase())
);
};
const promiseOptions = inputValue =>
... | Remove dead code in example | Remove dead code in example | JavaScript | mit | JedWatson/react-select,JedWatson/react-select |
d2710ff8b6bb406526e64b51268611de54979bc3 | src/modular.js | src/modular.js | /*-----------------------------------------------------------------
Modular - JS Extension
Made by @esr360
http://github.com/esr360/Modular/
-----------------------------------------------------------------*/
//-----------------------------------------------------------------
// Convert CSS config to JS
//---------... | /*-----------------------------------------------------------------
Modular - JS Extension
Made by @esr360
http://github.com/esr360/Modular/
-----------------------------------------------------------------*/
//-----------------------------------------------------------------
// Convert CSS config to JS
//---------... | Store configuartion data in a variable | Store configuartion data in a variable
| JavaScript | mit | esr360/Synergy,esr360/Modular,esr360/Modular |
3c583ed9f61554c95450d007fef98c40180c829c | webpack.mix.js | webpack.mix.js | const
{ mix } = require('laravel-mix'),
webpack = require('webpack');
mix
.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'Tether': 'tether',
'window.axios': 'axios'
})
]
})
.copy(
'node_modules/kent-bar/build/deploy... | const
{ mix } = require('laravel-mix'),
webpack = require('webpack');
mix
.webpackConfig({
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'Tether': 'tether',
'window.axios': 'axios'
})
],
resolve: {
symlinks: false
}
})
.copy(
... | Make npm link work with babel-loader. | Make npm link work with babel-loader.
| JavaScript | mit | unikent/astro,unikent/astro,unikent/astro,unikent/astro,unikent/astro |
92e0a14a9a23ecf93399b5a0431ae6c12175ff29 | grunt_tasks/webpack.plugins.js | grunt_tasks/webpack.plugins.js | /**
* This file contains custom webpack plugins.
*/
// This plugin modifies the generated webpack code to execute a module within the DLL bundle
// in addition to preserving the default behavior of exporting the webpack require function
class DllBootstrapPlugin {
constructor(options) {
this.options = opt... | /**
* This file contains custom webpack plugins.
*/
'use strict';
// This plugin modifies the generated webpack code to execute a module within the DLL bundle
// in addition to preserving the default behavior of exporting the webpack require function
class DllBootstrapPlugin {
constructor(options) {
this... | Fix complaints about strict mode during build | Fix complaints about strict mode during build
| JavaScript | apache-2.0 | adsorensen/girder,sutartmelson/girder,Xarthisius/girder,data-exp-lab/girder,data-exp-lab/girder,Xarthisius/girder,Xarthisius/girder,RafaelPalomar/girder,kotfic/girder,adsorensen/girder,adsorensen/girder,manthey/girder,Kitware/girder,RafaelPalomar/girder,sutartmelson/girder,jbeezley/girder,girder/girder,data-exp-lab/gir... |
5ecd470d6e1a937c54dd7eff28d44fe30c269506 | js/editor-libs/console.js | js/editor-libs/console.js | // Thanks in part to https://stackoverflow.com/questions/11403107/capturing-javascript-console-log
(function(global) {
'use strict';
var originalConsoleLogger = console.log; // eslint-disable-line no-console
var originalConsoleError = console.error;
var outputContainer = document.getElementById('output... | // Thanks in part to https://stackoverflow.com/questions/11403107/capturing-javascript-console-log
(function(global) {
'use strict';
var originalConsoleLogger = console.log; // eslint-disable-line no-console
var originalConsoleError = console.error;
var outputContainer = document.getElementById('output... | Format logged objects to indicate their type | Format logged objects to indicate their type
| JavaScript | cc0-1.0 | mdn/interactive-examples,mdn/interactive-examples,mdn/interactive-examples |
26bdb62478b910c70a50322c39ff02e8c88136a7 | lib/config.js | lib/config.js |
var config = {
defaultPort: process.env.PORT || 3000,
defaultLogLength: process.env.LOGLENGTH || 64,
defaultLogLines: process.env.LOGLINES || 10,
defaultSpacer: process.env.SPACER || ' | ',
defaultIdentifier: process.env.IDENTIFIER || '',
defaultLineCount: process.env.LINECOUNT || 1,
defaultLineDated: pr... |
var config = {
defaultPort: process.env.WEB_PORT || 3000,
defaultLogLength: process.env.LOGLENGTH || 64,
defaultLogLines: process.env.LOGLINES || 10,
defaultSpacer: process.env.SPACER || ' | ',
defaultIdentifier: process.env.IDENTIFIER || '',
defaultLineCount: process.env.LINECOUNT || 1,
defaultLineDated... | Change PORT to WEB_PORT env var | Change PORT to WEB_PORT env var
conflicts with `PORT` variable injected by Marathon making it unusable in bridge mode. | JavaScript | apache-2.0 | bryanlatten/docker-log-gen |
9d8050243b0172973dd5f1a38e7126460c1cadd1 | wire/sizzle.js | wire/sizzle.js | /**
* @license Copyright (c) 2010-2011 Brian Cavalier
* LICENSE: see the LICENSE.txt file. If file is missing, this file is subject
* to the MIT License at: http://www.opensource.org/licenses/mit-license.php.
*/
/**
* sizzle.js
* Adds querySelectorAll functionality to wire using John Resig's Sizzle library.
* S... | /**
* @license Copyright (c) 2010-2011 Brian Cavalier
* LICENSE: see the LICENSE.txt file. If file is missing, this file is subject
* to the MIT License at: http://www.opensource.org/licenses/mit-license.php.
*/
/**
* sizzle.js
* Adds querySelectorAll functionality to wire using John Resig's Sizzle library.
* S... | Rename promise to resolver, which is what it is anyway | Rename promise to resolver, which is what it is anyway
| JavaScript | mit | cujojs/wire,cujojs/wire,designeng/wire,wilson7287/wire,designeng/wire |
17ad3c708178df8456a1788c5467d719f7a78746 | imports/companies/companies.js | imports/companies/companies.js | import * as dh from '/imports/both/docs-helpers.js';
import { Class as Model } from 'meteor/jagi:astronomy';
Companies = new Mongo.Collection('companies');
Company = Model.create({
name: 'Company',
collection: Companies,
fields: {
TaxId: String,
Name: String,
Rating: Number
}
});
Meteor.methods({... | import * as dh from '/imports/both/docs-helpers.js';
import { Class as Model } from 'meteor/jagi:astronomy';
Companies = new Mongo.Collection('companies');
Company = Model.create({
name: 'Company',
collection: Companies,
fields: {
TaxId: {
type: String,
validators: [
... | Add basic validations to the Company model | Add basic validations to the Company model | JavaScript | mit | jaumesola/invoices-mvp,jaumesola/invoices-mvp,jaumesola/invoices-mvp |
879455cc5faf347d88581161085c65882fe3d6e6 | client/users/auth/register/check_nick.js | client/users/auth/register/check_nick.js | 'use strict';
/**
* client
**/
/**
* client.common
**/
/**
* client.common.auth
**/
/**
* client.common.auth.register
**/
/*global nodeca*/
/**
* client.common.auth.register.check_nick($elem, event)
*
* send nick value on server
* and show error if nick exists
**/
module.exports = function ... | 'use strict';
/**
* client
**/
/**
* client.common
**/
/**
* client.common.auth
**/
/**
* client.common.auth.register
**/
/*global nodeca*/
var DELAY = 500;
var start_point;
/**
* client.common.auth.register.check_nick($elem, event)
*
* send nick value on server
* and show error if nick exi... | Add delay on nick checking request | Add delay on nick checking request
| JavaScript | mit | nodeca/nodeca.users |
a6042a0774c703a338accdbd59898a5a1eb99d05 | app/models/polls.js | app/models/polls.js | 'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Vote = new Schema({
ip: String
});
var Options = new Schema({
name: String,
vote: [Vote]
});
var Poll = new Schema({
user: Number,
title: String,
date: Date,
options: [Options]
});
module.exports = mongoose.model('Poll', Pol... | 'use strict';
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Vote = new Schema({
ip: String
});
var Options = new Schema({
name: String,
votes: [Vote]
});
var Poll = new Schema({
user: Number,
title: String,
hash: String,
date: Date,
votes: Number,
options: [Options]
});
module.expo... | Modify model for add hash | Modify model for add hash
| JavaScript | mit | mirabalj/voting-camp,mirabalj/voting-camp |
ebfc5a251e0c8a7524c0cc13d2a5df194a9aa09f | app/props/screen.js | app/props/screen.js | import canvas from 'canvas';
import Game from 'lib/game';
import Prop from 'props/prop';
import Button from 'props/button';
export default class Screen extends Prop {
constructor(cta, label) {
const buttonHeight = 100;
super(0, 0, canvas.width, canvas.height);
this.label = label;
this.button = new ... | import canvas from 'canvas';
import constants from '_constants';
import Game from 'lib/game';
import Prop from 'props/prop';
import Button from 'props/button';
export default class Screen extends Prop {
constructor(cta, label) {
const buttonHeight = 100;
super(0, 0, canvas.width, canvas.height);
this.la... | Fix label render issue due to typo | Fix label render issue due to typo
| JavaScript | mit | oliverbenns/pong,oliverbenns/pong |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.