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 |
|---|---|---|---|---|---|---|---|---|---|
bb7dc88b6bdb324dfc2feb627a86d1125e8d51a4 | test/javascripts/unit/hide_department_children_test.js | test/javascripts/unit/hide_department_children_test.js | module("Hide department children", {
setup: function() {
this.$departments = $(
'<div class="js-hide-department-children">'
+ '<div class="department">'
+ '<div class="child-organisations">'
+ '<p>child content</p>'
+ '</div>'
+ '</div>'
+ '</div>');
$('#qunit-... | module("Hide department children", {
setup: function() {
this.$departments = $(
'<div class="js-hide-department-children">'
+ '<div class="department">'
+ '<div class="child-organisations">'
+ '<p>child content</p>'
+ '</div>'
+ '</div>'
+ '</div>');
$('#qunit-... | Remove left over console log | Remove left over console log
| JavaScript | mit | robinwhittleton/whitehall,askl56/whitehall,hotvulcan/whitehall,askl56/whitehall,YOTOV-LIMITED/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,alphagov/whitehall,hotvulcan/whitehall,ggoral/whitehall,alphagov/whitehall,askl56/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,robinwhittleton/whitehall,robinwhittleto... |
e28746346eb2439cf4f9fe3fbf02474cb39c65b6 | testpilot/frontend/static-src/app/models/experiment.js | testpilot/frontend/static-src/app/models/experiment.js | import app from 'ampersand-app';
import Model from 'ampersand-model';
import querystring from 'querystring';
export default Model.extend({
urlRoot: '/api/experiments',
extraProperties: 'allow',
props: {
enabled: {type: 'boolean', default: false}
},
// This shouldn't be necessary; see comments in collect... | import app from 'ampersand-app';
import Model from 'ampersand-model';
import querystring from 'querystring';
export default Model.extend({
urlRoot: '/api/experiments',
extraProperties: 'allow',
props: {
enabled: {type: 'boolean', default: false}
},
// This shouldn't be necessary; see comments in collect... | Fix fail on Object.keys(app.me.installed) which was holding up page loads. | Fix fail on Object.keys(app.me.installed) which was holding up
page loads.
- fixes #964
| JavaScript | mpl-2.0 | ckprice/testpilot,lmorchard/testpilot,lmorchard/testpilot,lmorchard/idea-town-server,lmorchard/testpilot,mozilla/idea-town,lmorchard/idea-town,meandavejustice/testpilot,fzzzy/testpilot,dannycoates/testpilot,mozilla/idea-town,fzzzy/testpilot,clouserw/testpilot,mathjazz/testpilot,mathjazz/testpilot,6a68/testpilot,flodolo... |
b1d751400723877c47e7c9fa4eddf8012fedee9d | js/devtools.js | js/devtools.js | // Script executed every time the devtools are opened.
// custom panel
chrome.devtools.panels.create("Backbone Debugger", "img/panel.png", "panel.html");
// custom sidebar pane in the elements panel
chrome.devtools.panels.elements.createSidebarPane("Backbone Debugger", function(sidebar) {
chrome.devtools.panels.e... | // Script executed every time the devtools are opened.
// custom panel
chrome.devtools.panels.create("Backbone", "img/panel.png", "panel.html");
// custom sidebar pane in the elements panel
chrome.devtools.panels.elements.createSidebarPane("Backbone", function(sidebar) {
chrome.devtools.panels.elements.onSelectio... | Change the name of Panel and Elements sidebar pane to 'Backbone' | Change the name of Panel and Elements sidebar pane to 'Backbone'
| JavaScript | mpl-2.0 | Maluen/Backbone-Debugger,jbreeden/Backbone-Debugger,Maluen/Backbone-Debugger,jbreeden/Backbone-Debugger |
1bba0e18bc7221580308890087a5334c0122ebf7 | app.js | app.js | // Problem: We need a simple way to look at a user's badge count and JavaScript point from a web browser
// Solution: Use Node.js to perform the profile look ups and server our template via HTTP
// 1. Create a web server
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(... | // Problem: We need a simple way to look at a user's badge count and JavaScript point from a web browser
// Solution: Use Node.js to perform the profile look ups and server our template via HTTP
// 1. Create a web server
var http = require('http');
http.createServer(function (request, response) {
homeRoute(request, ... | Create Web Server & Handle route GET and POST | Create Web Server & Handle route GET and POST
| JavaScript | apache-2.0 | JordanPortfolio/NodeJS-temp,JordanPortfolio/NodeJS-temp |
3e6db5efd2d25ab673f8c77734ecb9b4de924588 | app.js | app.js | var express = require('express');
var bunyan = require('bunyan');
var log = bunyan.createLogger({ name: 'app' });
var app = express();
var webhooks = require('datashaman-webhooks');
webhooks.boot(app, 'somesecret');
app.post('/', webhooks.router(function(req, res, event) {
log.info(req.body, event);
switch ... | var express = require('express');
var bunyan = require('bunyan');
var log = bunyan.createLogger({ name: 'app' });
var app = express();
var webhooks = require('datashaman-webhooks');
webhooks.boot(app, 'somesecret');
app.post('/', webhooks.router(function(req, res, event) {
log.info(req.body, event);
switch ... | Add default case to example file | Add default case to example file
| JavaScript | mit | datashaman/datashaman-webhooks |
12bfc0b76c17b34baf779bc8debfa6fadb312890 | server/db/models/userModel.js | server/db/models/userModel.js | const Sequelize = require('sequelize');
const db = require('../db.js');
const Users = db.define('users',
{
id: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV1,
primaryKey: true,
},
facebook_id: {
type: Sequelize.STRING,
},
first_name: {
type: Sequelize.STRING,... | const Sequelize = require('sequelize');
const db = require('../db.js');
const Users = db.define('users',
{
id: {
type: Sequelize.UUID,
defaultValue: Sequelize.UUIDV1,
primaryKey: true,
},
facebook_id: {
type: Sequelize.STRING,
},
first_name: {
type: Sequelize.STRING,... | Remove default description on user model | Remove default description on user model
| JavaScript | mit | VictoriousResistance/iDioma,VictoriousResistance/iDioma |
bc07195fadc3d654a02917947e0dac2feb43e0bc | services/permissions/model.js | services/permissions/model.js | 'use strict'
const mongoose = require('mongoose')
const PermissionSchema = new mongoose.Schema({
regex: { type: String, required: true, unique: true },
roles: { type: [ String ], required: true },
dateCreated: { type: Date, default: Date.now }
})
PermissionSchema.statics.findMatches = function (email, cb) {
... | 'use strict'
const mongoose = require('mongoose')
const PermissionSchema = new mongoose.Schema({
regex: { type: Object, required: true, unique: true },
roles: { type: [ String ], required: true },
dateCreated: { type: Date, default: Date.now }
})
PermissionSchema.statics.findMatches = function (email, cb) {
... | Save RegExp object to database instead of string, and more concise filter | Save RegExp object to database instead of string, and more concise filter
| JavaScript | mit | thebitmill/midwest-membership-services |
db04398e499a8725a0391e10d1955b7c805cb209 | test/remove.js | test/remove.js | #!/usr/bin/env node
'use strict';
/** Load modules. */
var fs = require('fs'),
path = require('path');
/** Resolve program params. */
var args = process.argv.slice(process.argv[0] === process.execPath ? 2 : 0),
filePath = path.resolve(args[1]);
var pattern = (function() {
var result = args[0],
delimi... | #!/usr/bin/env node
'use strict';
var fs = require('fs'),
path = require('path');
var args = (args = process.argv)
.slice((args[0] === process.execPath || args[0] === 'node') ? 2 : 0);
var filePath = path.resolve(args[1]),
reLine = /.*/gm,
slice = Array.prototype.slice;
var pattern = (function() {
v... | Add support for removing the last capture group. | Add support for removing the last capture group.
| JavaScript | mit | rlugojr/lodash,msmorgan/lodash,beaugunderson/lodash,steelsojka/lodash,boneskull/lodash,msmorgan/lodash,steelsojka/lodash,rlugojr/lodash,beaugunderson/lodash,boneskull/lodash |
1c26e7c754a77a6775ce7c8461dc6e47e856ebad | src/resources/assets/js/SparkKioskNotify/spark-kiosk-notify.js | src/resources/assets/js/SparkKioskNotify/spark-kiosk-notify.js | Vue.component('spark-kiosk-notify', {
props: [
],
data() {
return {
'notifications': [],
'users': [],
'newNotification': {
"user_id": null
}
};
},
ready(){
this.getNotifications();
this.getUsers();
},... | Vue.component('spark-kiosk-notify', {
props: [
],
data() {
return {
'notifications': [],
'users': [],
'newNotification': {
"user_id": null
}
};
},
ready(){
this.getNotifications();
this.getUsers();
},... | Change to 'newNotification', change to post | Change to 'newNotification', change to post
| JavaScript | mit | vmitchell85/spark-kiosk-notify,vmitchell85/spark-kiosk-notify,vmitchell85/spark-kiosk-notify |
2983df1c5a6363f1cdd827a9ac006ff71ddd259c | corehq/apps/domain/static/domain/js/case_search_main.js | corehq/apps/domain/static/domain/js/case_search_main.js | hqDefine('domain/js/case_search_main', [
'jquery',
'hqwebapp/js/initial_page_data',
'domain/js/case_search',
], function(
$,
initialPageData,
caseSearch
) {
$(function () {
var viewModel = caseSearch.CaseSearchConfig({
values: initialPageData.get('values'),
ca... | hqDefine('domain/js/case_search_main', [
'jquery',
'hqwebapp/js/initial_page_data',
'domain/js/case_search',
'hqwebapp/js/knockout_bindings.ko', // save button
], function(
$,
initialPageData,
caseSearch
) {
$(function () {
var viewModel = caseSearch.CaseSearchConfig({
... | Add knockout bindings as dependency to case search | Add knockout bindings as dependency to case search
| JavaScript | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq |
4954b4b8f0e9325dbfe7bfa5baf9ece539f03347 | js/endpoints.js | js/endpoints.js | /**
* Created by Neil on 29/09/13.
*/
function signin(mode, callback, clientID) { // clientID filled in by template, immediate = true because we should not need to ask permission again
gapi.auth.authorize({client_id: clientID,
scope: ["https://www.googleapis.com/auth/userinfo.email", "https://www.goog... | /**
* Created by Neil on 29/09/13.
*/
function signin(mode, callback, clientID) { // clientID filled in by template, immediate = true because we should not need to ask permission again
gapi.auth.authorize({client_id: clientID,
scope: ["https://www.googleapis.com/auth/userinfo.email", "https://www.goog... | Change the name of the endpoint | Change the name of the endpoint
| JavaScript | mit | nparley/mylatitude,nparley/mylatitude,nparley/mylatitude |
c99f338e1ff0141d256e75150cd9c1e126429682 | src/settings.js | src/settings.js | 'use babel';
export default {
binary: {
title: 'Binary path',
description: 'Path for elm-format',
type: 'string',
default: '/usr/local/bin/elm-format',
order: 1,
},
formatOnSave: {
title: 'Format on save',
description: 'Do we format when you save files?',
type: 'boolean',
defa... | 'use babel';
export default {
binary: {
title: 'Binary path',
description: 'Path for elm-format',
type: 'string',
default: 'elm-format',
order: 1,
},
formatOnSave: {
title: 'Format on save',
description: 'Do we format when you save files?',
type: 'boolean',
default: true,
... | Use "elm-format" as the default binary path | Use "elm-format" as the default binary path
Not all people have elm-format installed into /usr/local/bin/elm-format (I installed it via package manager so it's in /usr/bin/elm-format), but I assume most of the people have it int their PATH. This should fix #18 for most users. | JavaScript | mit | triforkse/atom-elm-format |
bdbafc18317070530573bd28a2ec5241c793340b | ghost/admin/routes/posts.js | ghost/admin/routes/posts.js | import styleBody from 'ghost/mixins/style-body';
import AuthenticatedRoute from 'ghost/routes/authenticated';
var paginationSettings = {
status: 'all',
staticPages: 'all',
page: 1,
limit: 15
};
var PostsRoute = AuthenticatedRoute.extend(styleBody, {
classNames: ['manage'],
model: function () ... | import styleBody from 'ghost/mixins/style-body';
import AuthenticatedRoute from 'ghost/routes/authenticated';
var paginationSettings = {
status: 'all',
staticPages: 'all',
page: 1
};
var PostsRoute = AuthenticatedRoute.extend(styleBody, {
classNames: ['manage'],
model: function () {
// us... | Remove limit from ember post API calls | Remove limit from ember post API calls
ref #3004
- this is unnecessary and causing bugs
| JavaScript | mit | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost |
76326fa424405c3930855652d69ee603ab7df5e7 | bot/utils/twitter/tweetWeather.js | bot/utils/twitter/tweetWeather.js | /**
* @module
* Tweet the current weather.
*/
const {postStatus} = require('./../../api/twitter-api');
const weather = require('./../weather/getWeather');
const logger = require('./../logger');
const moment = require('moment-timezone');
const tweetWeather = async(address='Manila, Philippines') => {
let curTime ... | /**
* @module
* Tweet the current weather.
*/
const {postStatus} = require('./../../api/twitter-api');
const weather = require('./../weather/getWeather');
const logger = require('./../logger');
const moment = require('moment-timezone');
const tweetWeather = async(address='Manila, Philippines') => {
let curTime ... | Update weather tweet message to only tweetHead | Update weather tweet message to only tweetHead
| JavaScript | mit | Ollen/dale-bot |
9d68a8e39598e53cee8c7ba26ab6096f9dfdd219 | spread_operator/app-finish.js | spread_operator/app-finish.js | 'use strict'
let levelOnePokemons = ['Pikachu','Magikarp','Balbasaur'];
let allPokemons = ['Meowth', 'Poliwag', ...levelOnePokemons];
console.log(allPokemons);
let pikachuName = "Pikachu";
let arrayWords = [...pikachuName];
console.log(arrayWords); | 'use strict'
let levelOnePokemons = ['Pikachu','Magikarp','Balbasaur'];
// Insert array to another array
let allPokemons = ['Meowth', 'Poliwag', ...levelOnePokemons];
console.log(allPokemons);
let pikachuName = "Pikachu";
// Split into literal array with spread operator
let arrayWords = [...pikachuName];
console.... | Add comment for explain step | Add comment for explain step
| JavaScript | apache-2.0 | teerasej/training-javascript-es6-beginner-thai |
543a31cc11fdb145cde89c42b44f1bd0d22cef6d | gulpfile.js | gulpfile.js | const gulp = require('gulp');
const gutil = require('gulp-util');
const eslint = require('gulp-eslint');
const excludeGitignore = require('gulp-exclude-gitignore');
const mocha = require('gulp-mocha');
const istanbul = require('gulp-istanbul');
gulp.task('linter', eslintCheck);
gulp.task('default', gulp.series('linter... | const gulp = require('gulp');
const gutil = require('gulp-util');
const eslint = require('gulp-eslint');
const excludeGitignore = require('gulp-exclude-gitignore');
const mocha = require('gulp-mocha');
const istanbul = require('gulp-istanbul');
gulp.task('linter', eslintCheck);
gulp.task('default', gulp.series('linter... | Add ignored files in gulp-eslint conf | Add ignored files in gulp-eslint conf
| JavaScript | mit | FountainJS/generator-fountain-tslint |
437b52a37060631ae6cce3bd2002db0d7143a3f7 | gulpfile.js | gulpfile.js | 'use strict';
const gulp = require('gulp');
const babel = require('gulp-babel');
gulp.task('default', () =>
gulp.src('lib/delve.js')
.pipe(babel({ presets: ['es2015'] }))
.pipe(gulp.dest('dist'))
);
| 'use strict';
const gulp = require('gulp');
const clean = require('gulp-clean');
const babel = require('gulp-babel');
gulp.task('clean-dist', () =>
gulp.src('dist/', { read: false })
.pipe(clean())
);
gulp.task('default', [ 'clean-dist' ], () =>
gulp.src('lib/*.js')
.pipe(babel({ presets: [ 'es2015' ] }))
... | Add gulp clean & build tasks | Add gulp clean & build tasks
| JavaScript | mit | tylerFowler/delvejs |
f69dacc5aecab76e7dd3920decce6950f8c6d300 | gulpfile.js | gulpfile.js | /* global require */
var gulp = require('gulp'),
spawn = require('child_process').spawn,
ember,
node;
gulp.task('server', function () {
if (node) node.kill(); // Kill server if one is running
node = spawn('node', ['server.js'], {cwd: 'node', stdio: 'inherit'});
node.on('close', function (code) {
... | /* global require */
var gulp = require('gulp'),
spawn = require('child_process').spawn,
ember,
node;
gulp.task('node', function () {
if (node) node.kill(); // Kill server if one is running
node = spawn('node', ['server.js'], {cwd: 'node', stdio: 'inherit'});
node.on('close', function (code) {
... | Rename server task to node | Rename server task to node
| JavaScript | bsd-3-clause | FreeMusicNinja/freemusic.ninja,FreeMusicNinja/freemusic.ninja |
866967ddb5ca862c34394113472f9ec543b7549c | gulpfile.js | gulpfile.js | var fontName = 'seti',
gulp = require('gulp'),
iconfont = require('gulp-iconfont'),
iconfontCss = require('gulp-iconfont-css'),
svgmin = require('gulp-svgmin');
gulp.task('font', function(){
gulp.src(['./icons/*.svg'])
.pipe(iconfontCss({
fontName: fontName,
path: '.... | var fontName = 'seti',
gulp = require('gulp'),
iconfont = require('gulp-iconfont'),
iconfontCss = require('gulp-iconfont-css'),
svgmin = require('gulp-svgmin');
gulp.task('font', function(){
gulp.src(['./icons/*.svg'])
.pipe(iconfontCss({
fontName: fontName,
path: '.... | Set font height to improve glyph quality | Set font height to improve glyph quality
| JavaScript | mit | jesseweed/seti-ui |
30013e03caa57ce57090d36c812aa6d128db3348 | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
connect = require('gulp-connect'),
stylus = require('gulp-stylus'),
prefix = require('gulp-autoprefixer');
var paths = {
styles: 'css/bare-ninja.styl',
html: './*.html'
};
gulp.task('connect', function() {
connect.server({
livereload: true
});
});
gulp.... | var gulp = require('gulp'),
connect = require('gulp-connect'),
stylus = require('gulp-stylus'),
prefix = require('gulp-autoprefixer');
var paths = {
styles: 'css/**/*.styl',
html: './*.html'
};
gulp.task('connect', function() {
connect.server({
livereload: true
});
});
gulp.task('... | Fix LiveReload for all .styl files | Fix LiveReload for all .styl files
| JavaScript | mit | trevanhetzel/barekit,trevanhetzel/barekit |
65fc00db12ebad06df6557bc3276eccc493566e2 | gulpfile.js | gulpfile.js | require('babel/register')
var gulp = require('gulp')
var $ = require("gulp-load-plugins")()
var runSequence = require("run-sequence")
gulp.task("build", function() {
return gulp.src("src/**/*.js")
.pipe($.babel())
.pipe(gulp.dest("lib"))
})
gulp.task("lint", function() {
return gulp.src("src/**/*.js")
... | require('babel/register')
var gulp = require('gulp')
var $ = require("gulp-load-plugins")()
var runSequence = require("run-sequence")
gulp.task("build", function() {
return gulp.src("src/**/*.js")
.pipe($.babel())
.pipe(gulp.dest("lib"))
})
gulp.task("lint", function() {
return gulp.src("src/**/*.js")
... | Add release task (needs npm publish still) | Add release task (needs npm publish still)
| JavaScript | mit | launchbadge/node-bok |
371a70778560330e5730acf1a76c6de17c578d17 | gulpfile.js | gulpfile.js | "use strict"
let gulp = require('gulp');
let ts = require('gulp-typescript');
let tsProject = ts.createProject("tsconfig.json");
gulp.task("default", () => {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest("dist"));
}); | "use strict"
let gulp = require("gulp");
let sourcemaps = require("gulp-sourcemaps");
let ts = require("gulp-typescript");
let tsProject = ts.createProject("tsconfig.json");
gulp.task("default", () => {
let tsResult = tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject());
re... | Set up gulp watch to automatically compile TypeScript files | Set up gulp watch to automatically compile TypeScript files
| JavaScript | apache-2.0 | munumafia/EasyJSON,munumafia/EasyJSON |
33ba0535b53c580d91b6b2de3d8b919ae3d5c781 | helpers/sharedb-server.js | helpers/sharedb-server.js | var ShareDB = require('sharedb');
ShareDB.types.register(require('rich-text').type);
module.exports = new ShareDB({
db: require('sharedb-mongo')('mongodb://localhost:27017/quill-sharedb-cursors')
});
| var ShareDB = require('sharedb');
ShareDB.types.register(require('rich-text').type);
module.exports = new ShareDB({
db: require('sharedb-mongo')(process.env.MONGODB_URI || 'mongodb://localhost/quill-sharedb-cursors?auto_reconnect=true')
});
| Add MONGODB_URI env var config | Add MONGODB_URI env var config
| JavaScript | mit | pedrosanta/quill-sharedb-cursors,pedrosanta/quill-sharedb-cursors |
d485edf1145ccfba4e8668c13dfd5ed2170624da | lib/AdapterJsRTCObjectFactory.js | lib/AdapterJsRTCObjectFactory.js | 'use strict';
/**
* An RTC Object factory that works in Firefox and Chrome when adapter.js is present
*/
function AdapterJsRTCObjectFactory() {
this.createIceServer = function(url, username, password) {
return createIceServer(url, username, password);
};
this.createRTCSessionDescription = function (session... | 'use strict';
var Utils = require("cyclon.p2p-common");
/**
* An RTC Object factory that works in Firefox and Chrome when adapter.js is present
*/
function AdapterJsRTCObjectFactory(logger) {
Utils.checkArguments(arguments, 1);
this.createIceServer = function (url, username, password) {
if (typ... | Handle missing adapter.js more gracefully | Handle missing adapter.js more gracefully
| JavaScript | mit | nicktindall/cyclon.p2p-rtc-client,nicktindall/cyclon.p2p-rtc-client |
900b593d7c66248086892b9cedfa24563fb8e270 | gulpfile.js | gulpfile.js | const inlineNg2Template = require('gulp-inline-ng2-template');
const gulp = require('gulp');
const clean = require('gulp-clean');
const tmpDir = './tmp';
const distDir = './dist';
gulp.task('inline-templates', ['clean-tmp'], function () {
return gulp.src('./src/**/*.ts')
.pipe(inlineNg2Template({
... | const inlineNg2Template = require('gulp-inline-ng2-template');
const gulp = require('gulp');
const clean = require('gulp-clean');
const tmpDir = './tmp';
const distDir = './dist';
gulp.task('inline-templates', ['clean-tmp'], function () {
return gulp.src('./src/**/*.ts')
.pipe(inlineNg2Template({
... | Add CHANGELOG.MD to copy-misc-files task | Add CHANGELOG.MD to copy-misc-files task
| JavaScript | mit | mpalourdio/ng-http-loader,mpalourdio/ng-http-loader,mpalourdio/ng-http-loader |
64b03b3b7209ea61c03f35616b399c755c933541 | sysapps/device_capabilities_new/device_capabilities_api.js | sysapps/device_capabilities_new/device_capabilities_api.js | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Implementation of the W3C's Device Capabilities API.
// http://www.w3.org/2012/sysapps/device-capabilities/
var internal = requireNative('internal');... | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Implementation of the W3C's Device Capabilities API.
// http://www.w3.org/2012/sysapps/device-capabilities/
var internal = requireNative('internal');... | Make the JavaScript shim dispatch events | [SysApps] Make the JavaScript shim dispatch events
The first thing to be done is make the JavaScript DeviceCapabilties an EventTarget
(which is also a BindingObject). The BindingObjects are JavaScripts objects with
a link with some native object and they use a unique ID for routing messages
between them.
common.Event... | JavaScript | bsd-3-clause | tomatell/crosswalk,rakuco/crosswalk,weiyirong/crosswalk-1,amaniak/crosswalk,crosswalk-project/crosswalk,fujunwei/crosswalk,chinakids/crosswalk,siovene/crosswalk,rakuco/crosswalk,hgl888/crosswalk-efl,Pluto-tv/crosswalk,rakuco/crosswalk,leonhsl/crosswalk,RafuCater/crosswalk,crosswalk-project/crosswalk-efl,pk-sam/crosswal... |
8c42ee718563fd7c82bacba65baf65cb12dd09fc | js/browser/resizeManager.js | js/browser/resizeManager.js | jsio('import browser.events')
var logger = logging.getLogger(jsio.__path);
var windowResizeCallbacks = [];
function handleResize() {
if (!windowResizeCallbacks.length) { return; }
var size = exports.getWindowSize();
for (var i=0, callback; callback = windowResizeCallbacks[i]; i++) {
callback(size);
}
}
browse... | jsio('import browser.events')
var logger = logging.getLogger(jsio.__path);
var windowResizeCallbacks = [];
function handleResize() {
if (!windowResizeCallbacks.length) { return; }
var size = exports.getWindowSize();
for (var i=0, callback; callback = windowResizeCallbacks[i]; i++) {
callback(size);
}
}
browse... | Fix bug where cancelWindowResize, would remove the wrong callback | Fix bug where cancelWindowResize, would remove the wrong callback
| JavaScript | mit | marcuswestin/fin |
3799c780d5b9ca0cfd97f3795c1ce456b78d4261 | gesso/index.js | gesso/index.js | // Re-using Gesso entry point
// Detect whether this is called from a built bundle from the browser, or as the build project.
if (typeof window !== 'undefined') {
// Client-side require
module.exports = {
canvas: document.getElementById('gesso-target')
};
} else {
// Server-side require -- use module.requ... | // Re-using Gesso entry point
// Detect whether this is called from a built bundle from the browser, or as the build project.
/* globals window */
if (typeof window !== 'undefined') {
// Client-side require
module.exports = {
canvas: window.document.getElementById('gesso-target')
};
} else {
// Server-sid... | Use window.document for client-side require. | Use window.document for client-side require.
| JavaScript | mit | gessojs/gessojs,gessojs/gessojs |
150741269e8cc655ad7041faa1cf825fbf5a4515 | WebComponentsMonkeyPatch.js | WebComponentsMonkeyPatch.js | /**
* Evidently superinspired by Chris Wilson's AudioContext-MonkeyPatch library,
* and just patching webkitCreateShadowRoot to createShadowRoot
*/
(function() {
if( HTMLElement.prototype.webkitCreateShadowRoot !== undefined &&
HTMLElement.prototype.createShadowRoot === undefined ) {
HTMLElem... | /**
* Evidently superinspired by Chris Wilson's AudioContext-MonkeyPatch library,
*/
(function() {
// Unprefixed createShadowRoot
if( HTMLElement.prototype.webkitCreateShadowRoot !== undefined &&
HTMLElement.prototype.createShadowRoot === undefined ) {
HTMLElement.prototype.createShadowRoot ... | Use only one function call | Use only one function call
| JavaScript | apache-2.0 | sole/WebComponentsMonkeyPatch |
5cda8ad7e27dbbafc2ab2c7d6569fec6546db2ce | colorImageSelector.js | colorImageSelector.js | /*
for each li
color = find span color --- this.text
url = find main prod image -- this.url
category Swatch Color Button = matching color.url
end
on click
*/
var colorBtnSrc = {};
$("span:contains('Color')").parents().eq(2).find('.productAttributeValue li').each( function getColorPhotosSrcs(){
var listings ... | /*
for each li
color = find span color --- this.text
url = find main prod image -- this.url
category Swatch Color Button = matching color.url
end
on click
*/
var colorBtnSrc = {};
$("span:contains('Color')").parents().eq(2).find('.productAttributeValue li').each( function getColorPhotosSrcs(){
var listings ... | Update to image src selector | Update to image src selector
| JavaScript | mit | iamandrebulatov/BC-Category-Page-Color-Swatch |
a145c78423cab08cfb412f6d7c61ef87cef2199c | src/config/constants.js | src/config/constants.js | import firebase from 'firebase'
const config = {
apiKey: "AIzaSyDHL6JFTyBcaV60WpE4yXfeO0aZbzA9Xbk",
authDomain: "practice-auth.firebaseapp.com",
databaseURL: "https://practice-auth.firebaseio.com",
}
firebase.initializeApp(config)
export const ref = firebase.database().ref()
export const firebaseAuth = firebas... | import firebase from 'firebase';
const config = {
apiKey: process.env.REACT_APP_FIREBASE_API,
authDomain: process.env.REACT_APP_FIREBASE_DOMAIN,
databaseURL: process.env.REACT_APP_FIREBASE_DATABASE,
storageBucket: process.env.REACT_APP_FIREBASE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_SENDER... | Read firebase creds from .env | Read firebase creds from .env
| JavaScript | mit | nadavspi/UnwiseConnect,nadavspi/UnwiseConnect,nadavspi/UnwiseConnect |
f6b8055acfc4127580725989fa0db32ece35f566 | src/activities/when-graphs-mislead/client/scripts/parameters.js | src/activities/when-graphs-mislead/client/scripts/parameters.js | /**
* @file Define the parameters for the activity's chart.
*/
define({
yLimitsUSD: {
label: 'y-axis limits ($USD)',
min: 0,
max: 280000,
step: 1000
},
yLimitsPct: {
label: 'y-axis limits (% change)',
min: 0,
max: 1.2,
step: 0.01
},
xLimits: {
label: 'x-axis limits (year)... | /**
* @file Define the parameters for the activity's chart.
*/
define({
yLimitsUSD: {
label: 'y-axis limits ($USD)',
min: 0,
max: 280000,
step: 1000
},
yLimitsPct: {
label: 'y-axis limits (% change)',
min: 0,
max: 1.3,
step: 0.01
},
xLimits: {
label: 'x-axis limits (year)... | Increase limits for percentage change | Increase limits for percentage change
| JavaScript | mpl-2.0 | councilforeconed/interactive-activities,councilforeconed/interactive-activities,jugglinmike/cee,councilforeconed/interactive-activities,jugglinmike/cee |
d33e9df3e82505d60c16324fb1a5fec6204bb5bb | gulpfile.js | gulpfile.js | var _ = require('lodash');
var gulp = require('gulp');
var gulp_mocha = require('gulp-mocha');
var gulp_jshint = require('gulp-jshint');
var gulp_jsdoc = require("gulp-jsdoc");
var files = ['lib/**/*.js'];
var tests = ['test/**/*.spec.js'];
var alljs = files.concat(tests);
var readme = 'README.md';
function ignoreE... | var _ = require('lodash');
var gulp = require('gulp');
var gulp_mocha = require('gulp-mocha');
var gulp_jshint = require('gulp-jshint');
var gulp_jsdoc = require("gulp-jsdoc");
var files = ['lib/**/*.js'];
var tests = ['test/**/*.spec.js'];
var alljs = files.concat(tests);
var readme = 'README.md';
function ignoreE... | Make test fails for CI | Make test fails for CI
| JavaScript | mit | bankonme/bitcore-channel,homeopatchy/bitcore-channel,eXcomm/bitcore-channel,braydonf/bitcore-channel,maraoz/bitcore-channel,bitpay/bitcore-channel,studio666/bitcore-channel |
9afda10bfeb4d07e3ba2e40e93ebec125d41d7ed | tests/search.js | tests/search.js | /**
* search.js - Search form tests.
*/
casper.test.begin('Tests search form submission and results', 2, function suite(test) {
casper.start();
// Open the homepage.
casper.customThenOpen('/', function() {
casper.waitFor(function check() {
// Fill out the search form with 'health' and submit it.
... | /**
* Search form tests.
*/
casper.test.begin('Tests search form submission and results', 2, function suite(test) {
casper.start();
// Open the homepage.
casper.customThenOpen('/', function() {
casper.waitFor(function check() {
// Fill out the search form with 'health' and submit it.
return th... | Remove unneded filename from header docblock. | Remove unneded filename from header docblock.
| JavaScript | mit | Lullabot/casperjs_foundation,Lullabot/casperjs_foundation |
801df6499b96c860a2d108dea053304131ab56fd | server/app.js | server/app.js | 'use strict';
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var memos = require('./routes/memos');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 8000);
app.set('views', path.j... | 'use strict';
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var memos = require('./routes/memos');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 9001);
app.set('views', path.j... | Change port number to 9001 | Change port number to 9001
| JavaScript | mit | eqot/memo |
bc83a3b4a6b834e972cb2a723e692ec8491a290b | gulpfile.js | gulpfile.js | /**
* @author Frank David Corona Prendes <frankdavid.corona@gmail.com>
* @copyright MIT 2016 Frank David Corona Prendes
* @description Tarea Gulp para la compresion de ficheros JS
* @version 1.0.1
*/
(function () {
'use strict';
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var ... | /**
* @author Frank David Corona Prendes <frankdavid.corona@gmail.com>
* @copyright MIT 2016 Frank David Corona Prendes
* @description Tarea Gulp para la compresion de ficheros JS
* @version 1.0.1
*/
(function () {
'use strict';
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var ... | Change name of the default task | Change name of the default task | JavaScript | mit | frankdavidcorona/gcompress |
1e0b79aa7b62e3162b98c277db248236b75f3a4a | gulpfile.js | gulpfile.js | var gulp = require('gulp'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify');
var SRC = 'src/*.js';
var DEST = 'dist/';
gulp.task('build', function() {
gulp.src(SRC)
.pipe(concat('jsonapi-datastore.js'))
.pipe(gulp.dest(DEST))
.pipe(uglify())
... | var gulp = require('gulp'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
mocha = require('gulp-mocha');
var SRC = 'src/*.js',
DEST = 'dist/';
gulp.task('build', function() {
gulp.src(SRC)
.pipe(concat('jsonapi-datastore.js'))
.pipe(gu... | Add gulp task for testing. | Add gulp task for testing.
| JavaScript | mit | jamesdixon/jsonapi-datastore,niksy/jsonapi-datastore,beauby/jsonapi-datastore,jprincipe/jsonapi-datastore |
ffd4229e0940e26d7e4d5e948180c40bf14eb871 | lib/sandbox.js | lib/sandbox.js | /*
* Sandbox - A stripped down object of things that plugins can perform.
* This object will be passed to plugins on command and hook execution.
*/
Sandbox = function(irc, commands, usage) {
this.bot = {
say: function(to, msg) {
irc.say(to, msg);
},
action: function(to, msg) {
irc.action(t... | var path = require('path');
/*
* Sandbox - A stripped down object of things that plugins can perform.
* This object will be passed to plugins on command and hook execution.
*/
Sandbox = function(irc, commands, usage) {
this.bot = {
say: function(to, msg) {
irc.say(to, msg);
},
action: function(... | Add AdminSandbox for use with admin plugins. | Add AdminSandbox for use with admin plugins.
| JavaScript | mit | jirwin/treslek,rackerlabs/treslek |
d4b4d280ac3948dba4fe682deded95423e165685 | polyglot/src/test/resources/test-js-plugins/hello-interceptor.js | polyglot/src/test/resources/test-js-plugins/hello-interceptor.js | export const options = {
name: "helloWorldInterceptor",
description: "modifies the response of helloWorldService",
interceptPoint: "RESPONSE"
}
export function handle(req, res) {
LOGGER.debug('response {}', res.getContent());
const rc = JSON.parse(res.getContent() || '{}');
let modifiedBody = ... | export const options = {
name: "helloWorldInterceptor",
description: "modifies the response of helloWorldService",
interceptPoint: "RESPONSE"
}
export function handle(req, res) {
LOGGER.debug('response {}', res.getContent());
const rc = JSON.parse(res.getContent() || '{}');
let modifiedBody = ... | Fix resolve() on test js interceptor | :bug: Fix resolve() on test js interceptor [skip ci]
| JavaScript | agpl-3.0 | SoftInstigate/restheart,SoftInstigate/restheart,SoftInstigate/restheart,SoftInstigate/restheart |
d1eb4d23bdf6d84a17a9ef7175f6901ca7f40178 | migrations/2_deploy_contracts.js | migrations/2_deploy_contracts.js | // var usingOraclize = artifacts.require("./usingOraclize.sol");
var Arbiter = artifacts.require("./Arbiter.sol");
var Judge = artifacts.require("./Judge.sol");
var ComputationService = artifacts.require("./ComputationService.sol");
module.exports = function(deployer) {
//deployer.deploy(usingOraclize);
//deployer... | // var usingOraclize = artifacts.require("./usingOraclize.sol");
var Arbiter = artifacts.require("./Arbiter.sol");
var Judge = artifacts.require("./Judge.sol");
var ComputationService = artifacts.require("./ComputationService.sol");
module.exports = function(deployer) {
var arbiter, judge, computation;
deployer.d... | Include registratin of judge and services in arbiter | Include registratin of judge and services in arbiter
| JavaScript | mit | nud3l/verifying-computation-solidity,nud3l/verifying-computation-solidity |
a1354ce9155bb6609f56421033a5e889372d2b63 | tetris.js | tetris.js | var removeExcessSpaces = function(htmlString) {
var processedString = htmlString.replace(/\s+</g, '<');
processedString = processedString.replace(/>\s+/g, '>');
processedString = processedString.replace(/\:</g, ': <');
return processedString;
}
var ready = function(fn) {
if(document.readyState != 'loading') {
... | var removeExcessSpaces = function(htmlString) {
var processedString = htmlString.replace(/\s+</g, '<');
processedString = processedString.replace(/>\s+/g, '>');
processedString = processedString.replace(/_/g, ' ');
return processedString;
}
var ready = function(fn) {
if(document.readyState != 'loading') {
f... | Update whitespace removal to convert underscores to spaces | Update whitespace removal to convert underscores to spaces
| JavaScript | mit | peternatewood/tetrelementis,RoyTuesday/tetrelementis,RoyTuesday/tetrelementis,peternatewood/tetrelementis |
b48f8416fd6637d7fce284ff4e47b01df4829d57 | src/core/AudioletParameter.js | src/core/AudioletParameter.js | var AudioletParameter = new Class({
initialize: function(node, inputIndex, value) {
this.node = node;
if (typeof inputIndex != 'undefined' && inputIndex != null) {
this.input = node.inputs[inputIndex];
}
else {
this.input = null;
}
this.value =... | var AudioletParameter = new Class({
initialize: function(node, inputIndex, value) {
this.node = node;
if (typeof inputIndex != 'undefined' && inputIndex != null) {
this.input = node.inputs[inputIndex];
}
else {
this.input = null;
}
this.value =... | Simplify isStatic and isDynamic logic, and make sure they return boolean values | Simplify isStatic and isDynamic logic, and make sure they return boolean values
| JavaScript | apache-2.0 | oampo/Audiolet,Kosar79/Audiolet,oampo/Audiolet,kn0ll/Audiolet,Kosar79/Audiolet,Kosar79/Audiolet,mcanthony/Audiolet,kn0ll/Audiolet,mcanthony/Audiolet,bobby-brennan/Audiolet,bobby-brennan/Audiolet |
1935b925cc03c9e0d711b7e63c441580394e6d16 | addon-test-support/index.js | addon-test-support/index.js | import { getContext, settled } from '@ember/test-helpers';
import { run } from '@ember/runloop';
export function setBreakpoint(breakpoint) {
let breakpointArray = Array.isArray(breakpoint) ? breakpoint : [breakpoint];
let { owner } = getContext();
let breakpoints = owner.lookup('breakpoints:main');
let media =... | import { getContext, settled } from '@ember/test-helpers';
import { run } from '@ember/runloop';
export function setBreakpoint(breakpoint) {
let breakpointArray = Array.isArray(breakpoint) ? breakpoint : [breakpoint];
let { owner } = getContext();
let breakpoints = owner.lookup('breakpoints:main');
let media =... | Make test support setBreakpoint IE11 compatible | Make test support setBreakpoint IE11 compatible
| JavaScript | mit | freshbooks/ember-responsive,freshbooks/ember-responsive |
c3a05985a25b38714e54de13c865f5322dc1b9d3 | examples/method_routing/server.js | examples/method_routing/server.js | var jayson = require(__dirname + '/../..');
var format = require('util').format;
var methods = {
// a method that prints every request
add: function(a, b, callback) {
callback(null, a + b);
}
};
var server = jayson.server(methods, {
router: function(method) {
// regular by-name routing first
if(ty... | var jayson = require(__dirname + '/../..');
var format = require('util').format;
var methods = {
// a method that prints every request
add: function(a, b, callback) {
callback(null, a + b);
}
};
var server = jayson.server(methods, {
router: function(method) {
// regular by-name routing first
if(ty... | Convert method routing example to new method definition | Convert method routing example to new method definition
| JavaScript | mit | taoyuan/jayson,Lughino/jayson,Meettya/jayson,tedeh/jayson,taoyuan/remjson,tedeh/jayson |
253d4358a60fb685b2e5583bb9a9245ed42ef140 | examples/method_routing/server.js | examples/method_routing/server.js | var jayson = require(__dirname + '/../..');
var format = require('util').format;
var methods = {
// a method that prints every request
add: function(a, b, callback) {
callback(null, a + b);
}
};
var server = jayson.server(methods, {
router: function(method) {
// regular by-name routing first
if(ty... | var jayson = require(__dirname + '/../..');
var format = require('util').format;
var methods = {
// a method that prints every request
add: function(a, b, callback) {
callback(null, a + b);
}
};
var server = jayson.server(methods, {
router: function(method) {
// regular by-name routing first
if(ty... | Convert method routing example to new method definition | Convert method routing example to new method definition
| JavaScript | mit | Meettya/jayson,tedeh/jayson,Lughino/jayson,taoyuan/jayson,tedeh/jayson,taoyuan/remjson |
627acdbfdeae585e449162fa15275df7ea270215 | src/js/ripple/utils.web.js | src/js/ripple/utils.web.js | var exports = module.exports = require('./utils.js');
// We override this function for browsers, because they print objects nicer
// natively than JSON.stringify can.
exports.logObject = function (msg, obj) {
if (/MSIE/.test(navigator.userAgent)) {
console.log(msg, JSON.stringify(obj));
} else {
console.lo... | var exports = module.exports = require('./utils.js');
// We override this function for browsers, because they print objects nicer
// natively than JSON.stringify can.
exports.logObject = function (msg, obj) {
var args = Array.prototype.slice.call(arguments, 1);
args = args.map(function(arg) {
if (/MSIE/.test(... | Update in-browser logging to accommodate n-args | Update in-browser logging to accommodate n-args
| JavaScript | isc | darkdarkdragon/ripple-lib,ripple/ripple-lib,ripple/ripple-lib,wilsonianb/ripple-lib,wilsonianb/ripple-lib,darkdarkdragon/ripple-lib,ripple/ripple-lib,darkdarkdragon/ripple-lib,wilsonianb/ripple-lib,ripple/ripple-lib |
4b0c212b213b91fc37031c08aae5a30337728c79 | public/script.js | public/script.js | 'use strict';
/*
* Tanura demo app.
*
* This is the main script of the app demonstrating Tanura's features.
*/
/**
* Bootstrapping routine.
*/
window.onload = () => {
console.log("Initializing Tanura...");
tanura.init(
{video: true},
() => {
console.log("Initialized.");
... | 'use strict';
/*
* Tanura demo app.
*
* This is the main script of the app demonstrating Tanura's features.
*/
/**
* Bootstrapping routine.
*/
window.onload = () => {
console.log("Initializing Tanura...");
tanura.init(
{video: true},
() => {
console.log("Initialized.");
... | Use the new event names in the demo. | Use the new event names in the demo.
| JavaScript | agpl-3.0 | theOtherNuvanda/Tanura,theOtherNuvanda/Tanura,theOtherNuvanda/Tanura |
1a024423c0ca91047eaeaa2d7fdc397d5a3b0635 | src/components/apply/SubmitButton.js | src/components/apply/SubmitButton.js | import React, { Component } from 'react'
import PropTypes from 'prop-types'
import api from 'api'
import { LargeButton } from '@hackclub/design-system'
class SubmitButton extends Component {
static propTypes = {
status: PropTypes.oneOf(['incomplete', 'complete', 'submitted']).isRequired,
applicationId: PropT... | import React, { Component } from 'react'
import PropTypes from 'prop-types'
import api from 'api'
import { LargeButton } from '@hackclub/design-system'
class SubmitButton extends Component {
static propTypes = {
status: PropTypes.oneOf(['incomplete', 'complete', 'submitted']).isRequired,
applicationId: PropT... | Add 3 second delay to application submission | Add 3 second delay to application submission
| JavaScript | mit | hackclub/website,hackclub/website,hackclub/website |
faa0e6ac15aca4dbae679cc20da587b4254f91ed | src/chrome/notification.js | src/chrome/notification.js | export class Notification {
/**
* @typedef NotificationOptions
* @property {string} title
* @property {string} message
* @property {('basic'|'sms')} [type='basic']
*/
/**
*
* @param {NotificationOptions} options
*/
constructor(options) {
this.read = false;
this.title = options.tit... | export class Notification {
/**
* @typedef NotificationData
* @property {boolean} [read]
* @property {string} title
* @property {string} message
* @property {('basic'|'sms')} [type='basic']
*/
/**
*
* @param {NotificationData} data
*/
constructor(data) {
this.read = 'read' in data ... | Add fromJSON, fix bug in toJSON | Add fromJSON, fix bug in toJSON
| JavaScript | mit | nextgensparx/quantum-router,nextgensparx/quantum-router |
067de672c56f6e61d0563bf2deac4a0b67a8f8e4 | src/components/apply/SubmitButton.js | src/components/apply/SubmitButton.js | import React, { Component } from 'react'
import api from 'api'
import storage from 'storage'
import { LargeButton } from '@hackclub/design-system'
class SubmitButton extends Component {
constructor(props) {
super(props)
this.handleSubmit = this.handleSubmit.bind(this)
}
handleSubmit() {
const { stat... | import React, { Component } from 'react'
import api from 'api'
import storage from 'storage'
import { LargeButton } from '@hackclub/design-system'
class SubmitButton extends Component {
constructor(props) {
super(props)
this.handleSubmit = this.handleSubmit.bind(this)
}
handleSubmit() {
const { stat... | Remove alert on application submission | Remove alert on application submission | JavaScript | mit | hackclub/website,hackclub/website,hackclub/website |
87fd189a152a926ba4a5b66bcdc70f09e7e6f6ec | js/turducken.js | js/turducken.js | "use strict";
function User( fName, lName) {
this.fName = fName;
this.lName = lName;
//this.img = img; //need to add images and urls...
this.posts = [];
}
User.prototype.newPost = function( content, socMedia ) {
this.posts.push( new Post( content, socMedia ));
}
function pushToLocalStorage( user ... | "use strict";
function User( fName, lName) {
this.fName = fName;
this.lName = lName;
//this.img = img; //need to add images and urls...
this.posts = [];
}
User.prototype.newPost = function( content, socMedia ) {
this.posts.push( new Post( content, socMedia ));
}
User.prototype.render = function(... | Reorder functions to align with execution flow. | Reorder functions to align with execution flow.
| JavaScript | mit | sevfitz/turducken,sevfitz/turducken |
8885b2f7712407d05d677b2c03822a40843509aa | js/calci.js | js/calci.js | $(document).ready(function() {
$('.key').click(function() {
var number = $(this).text();
$('#preview').append(number);
});
});
| function handleInput(key) {
$('#preview').append(key);
}
$(document).ready(function() {
$('.key').click(function() {
var key = $(this).text();
if(key == "0") {
if($('#preview').html() != "0") {
handleInput(key);
}
} else {
handleInput(key);
}
});
});
| Handle edge cases with zero key | Handle edge cases with zero key
| JavaScript | mit | CodeAstra/calculator,CodeAstra/calculator |
bd87fe2da4bbf994ad72226de12c00ecf01223a2 | src/client/sendMessages.js | src/client/sendMessages.js | 'use strict';
/* This declares the function that will send a message
*/
function sendMessage(e) {
e.preventDefault();
const inputNode = e.target.message;
const message = inputNode.value;
console.log("Sending message:", message);
// Clear node
inputNode.value = '';
// Send the message
const xhr = new ... | 'use strict';
/* This declares the function that will send a message
*/
function sendMessage(e) {
e.preventDefault();
const inputNode = e.target.message;
const message = inputNode.value + '\n';
console.log("Sending message:", message);
// Clear node
inputNode.value = '';
// Send the message
const xhr... | Add newline to all sent messages | Add newline to all sent messages
| JavaScript | mit | The1502Initiative/Instantaneous,The1502Initiative/Instantaneous,The1502Initiative/Instantaneous |
f262509674196d05fc929b5b7c111a3a66f6f92c | app/actions/asyncActions.js | app/actions/asyncActions.js | import AsyncQueue from '../utils/asyncQueueStructures';
let asyncQueue = new AsyncQueue();
const endAsync = () => {
return { type: 'ASYNC_INACTIVE' };
};
const callAsync = (dispatchFn, delay = 500, dispatchEnd, newState) => {
if (!asyncQueue.size) {
asyncQueue.listenForEnd(dispatchEnd);
}
asyncQueue.add(... | import AsyncQueue from '../utils/asyncQueueStructures';
let asyncQueue = new AsyncQueue();
const endAsync = () => ({ type: 'ASYNC_INACTIVE' });
const startAsync = () => ({ type: 'ASYNC_ACTIVE' });
const callAsync = (dispatchFn, newState) => (dispatch, getState) => {
if (!asyncQueue.size) {
asyncQueue.listenFo... | Use thunx to access delay state | Use thunx to access delay state
| JavaScript | mit | ivtpz/brancher,ivtpz/brancher |
07f4d6e7ab4899cb1b85f12e9b0b05c0c0171341 | src/community/community.js | src/community/community.js | import sqlite from 'sqlite'
import winston from 'winston'
export default class Community {
static async init() {
if (this.db) { return }
this.db = await sqlite.open('/data/community.sqlite3').catch(winston.error)
await this.db
.run('CREATE TABLE IF NOT EXISTS villagers (guildId ... | import sqlite from 'sqlite'
import winston from 'winston'
export default class Community {
static async init() {
if (this.db) { return }
this.db = await sqlite.open('/data/community.sqlite3').catch(winston.error)
await this.db
.run('CREATE TABLE IF NOT EXISTS villagers (guildId ... | Add automated, timed removal of quests | Add automated, timed removal of quests
| JavaScript | mit | tinnvec/stonebot,tinnvec/stonebot |
55c074a2c627187327dd98800d9524a9e725cb95 | src/components/HomePage.js | src/components/HomePage.js | import React from 'react';
import {browserHistory} from 'react-router'
import Login from './Login';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as actions from '../actions/LoginActions';
import {AUTHENTICATED, DEFAULT, ERROR, LOADING} from '../constants/loginStates'
export ... | import React from 'react';
import {browserHistory} from 'react-router'
import Login from './Login';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import * as actions from '../actions/LoginActions';
import {AUTHENTICATED, DEFAULT, ERROR, LOADING} from '../constants/loginStates'
import Ci... | Add spinner when loggin in | Add spinner when loggin in
| JavaScript | mit | nathejk/status-app,nathejk/status-app |
443c0f43039d6fd1fda9760d5fb2570f2a930ebd | packages/stockflux-watchlist/public/notificationHandler.js | packages/stockflux-watchlist/public/notificationHandler.js | /*eslint-disable-next-line no-unused-vars*/
function onNotificationMessage(message) {
document.getElementById('symbol').innerHTML = message.symbol;
document.getElementById('message').innerHTML = message.messageText;
document.getElementById('watchlist-name').innerHTML = message.watchlistName
? ' ' + message.wa... | // eslint-disable-next-line no-unused-vars
function onNotificationMessage(message) {
document.getElementById('symbol').innerHTML = message.symbol;
document.getElementById('message').innerHTML = message.messageText;
document.getElementById('watchlist-name').innerHTML = message.watchlistName
? ' ' + message.wat... | Change multi-line comment to single-line | Change multi-line comment to single-line
| JavaScript | mit | owennw/OpenFinD3FC,ScottLogic/bitflux-openfin,owennw/OpenFinD3FC,ScottLogic/StockFlux,ScottLogic/StockFlux,ScottLogic/bitflux-openfin |
aa94224f57fcd86704ff01ee1c7af299a75c95f8 | lib/services/alter-items.js | lib/services/alter-items.js |
const errors = require('@feathersjs/errors');
const getItems = require('./get-items');
const replaceItems = require('./replace-items');
module.exports = function (func) {
if (!func) {
func = () => {};
}
if (typeof func !== 'function') {
throw new errors.BadRequest('Function required. (alter)');
}
... |
const errors = require('@feathersjs/errors');
const getItems = require('./get-items');
const replaceItems = require('./replace-items');
module.exports = function (func) {
if (!func) {
func = () => {};
}
if (typeof func !== 'function') {
throw new errors.BadRequest('Function required. (alter)');
}
... | Improve alterItems: better null-check for the returned value | Improve alterItems: better null-check for the returned value
| JavaScript | mit | feathersjs/feathers-hooks-common |
ffb497ac013b005aff799cb4523e9b772519636b | connectors/amazon-alexa.js | connectors/amazon-alexa.js | 'use strict';
Connector.playerSelector = '#d-content';
Connector.getArtistTrack = () => {
if (isPlayingLiveRadio()) {
let songTitle = $('.d-queue-info .song-title').text();
return Util.splitArtistTrack(songTitle);
}
let artist = $('#d-info-text .d-sub-text-1').text();
let track = $('#d-info-text .d-main-text... | 'use strict';
Connector.playerSelector = '#d-content';
Connector.remainingTimeSelector = '.d-np-time-display.remaining-time';
Connector.currentTimeSelector = '.d-np-time-display.elapsed-time';
Connector.getDuration = () => {
let elapsed = Util.stringToSeconds($(Connector.currentTimeSelector).text());
let remaining... | Add duration parsing to Amazon Alexa connector | Add duration parsing to Amazon Alexa connector
| JavaScript | mit | david-sabata/web-scrobbler,carpet-berlin/web-scrobbler,david-sabata/web-scrobbler,carpet-berlin/web-scrobbler,galeksandrp/web-scrobbler,galeksandrp/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,alexesprit/web-scrobbler,inverse/web-scrobbler,fakelbst/Chrome-Last.fm-Scrobbler,inverse/web-scrobbler,alexesprit/web-scrobb... |
5fbfc2f76f3365c75ab2523d7807a4f3dc89a288 | omod/src/main/webapp/resources/scripts/services/visitService.js | omod/src/main/webapp/resources/scripts/services/visitService.js | angular.module('visitService', ['ngResource', 'uicommons.common'])
.factory('Visit', function($resource) {
return $resource("/" + OPENMRS_CONTEXT_PATH + "/ws/rest/v1/visit/:uuid", {
uuid: '@uuid'
},{
query: { method:'GET', isArray:false } // OpenMRS RESTWS returns { "results... | angular.module('visitService', ['ngResource', 'uicommons.common'])
.factory('Visit', function($resource) {
return $resource("/" + OPENMRS_CONTEXT_PATH + "/ws/rest/v1/visit/:uuid", {
uuid: '@uuid'
},{
query: { method:'GET', isArray:false } // OpenMRS RESTWS returns { "results... | Support accessing visit/attribute sub-resource via REST | Support accessing visit/attribute sub-resource via REST
| JavaScript | mpl-2.0 | jdegraft/openmrs-module-uicommons,yadamz/first-module,yadamz/first-module,jdegraft/openmrs-module-uicommons,jdegraft/openmrs-module-uicommons,yadamz/first-module,yadamz/first-module,jdegraft/openmrs-module-uicommons |
4326d2baf1350e19c87db457a1e170e73bd0a11d | src/js/streams/stream-user.js | src/js/streams/stream-user.js | YUI.add("stream-user", function(Y) {
"use strict";
var falco = Y.namespace("Falco"),
streams = Y.namespace("Falco.Streams"),
User;
User = function() {};
User.prototype = {
_create : function() {
var stream;
stream = falco.twitte... | YUI.add("stream-user", function(Y) {
"use strict";
var falco = Y.namespace("Falco"),
streams = Y.namespace("Falco.Streams"),
User;
User = function() {};
User.prototype = {
_create : function() {
var stream;
stream = falco.twitte... | Remove unnecessary param, it's the default | Remove unnecessary param, it's the default
| JavaScript | mit | tivac/falco,tivac/falco |
c41ba3df26018ff84e6c5e73f06c7df36e508243 | src/js/utils/ValidatorUtil.js | src/js/utils/ValidatorUtil.js | var ValidatorUtil = {
isDefined: function (value) {
return value != null && value !== '' || typeof value === 'number';
},
isEmail: function (email) {
return email != null &&
email.length > 0 &&
!/\s/.test(email) &&
/.+@.+\..+/
.test(email);
},
isEmpty: function (data) {
i... | var ValidatorUtil = {
isDefined: function (value) {
return value != null && value !== '' || typeof value === 'number';
},
isEmail: function (email) {
return email != null &&
email.length > 0 &&
!/\s/.test(email) &&
/.+@.+\..+/
.test(email);
},
isEmpty: function (data) {
i... | Use is number util to test input | Use is number util to test input
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui |
b7f8dfb12f79012e5ded0b14684ad75ae7dc1821 | lib/main.js | lib/main.js | // Define keyboard shortcuts for showing and hiding a custom panel.
var { Cc, Ci } = require("chrome");
var { Hotkey } = require("hotkeys");
var panel = require("panel");
var timers = require("timers");
var data = require("self").data;
var osString = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
va... | // Define keyboard shortcuts for showing and hiding a custom panel.
var { Cc, Ci } = require("chrome");
var { Hotkey } = require("hotkeys");
var panel = require("panel");
var timers = require("timers");
var data = require("self").data;
var runtime = require("runtime");
var osString = runtime.OS;
var osWarnFile;
// Loa... | Use the interface from add-on sdk for OS | Use the interface from add-on sdk for OS
| JavaScript | mit | rhelmer/warn-before-quit,rhelmer/warn-before-quit,nigelbabu/warn-before-quit,nigelbabu/warn-before-quit |
a75fef48bfb440a22fdc9605d4e677b87ebf290f | local-cli/core/Constants.js | local-cli/core/Constants.js | /**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* ... | /**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* ... | Add code for generating remote assets | Add code for generating remote assets
Reviewed By: davidaurelio
Differential Revision: D6201839
fbshipit-source-id: 78c81eae03c6137ba9bbe33cd7aab8b87020f8d2
| JavaScript | bsd-3-clause | jevakallio/react-native,Bhullnatik/react-native,exponentjs/react-native,facebook/react-native,ptmt/react-native-macos,ptmt/react-native-macos,pandiaraj44/react-native,hoastoolshop/react-native,pandiaraj44/react-native,kesha-antonov/react-native,facebook/react-native,hammerandchisel/react-native,hoangpham95/react-native... |
12bfc2fdd9c1574eb37a68dc7b8fa9508b082118 | lib/vector2d.js | lib/vector2d.js | class Vector2D {
constructor(x, y) {
this.x = x;
this.y = y;
}
add(vec) {
return new Vector2D(this.x + vec.x, this.y + vec.y);
}
multiply(factor) {
return new Vector2D(this.x * factor, this.y * factor);
}
}
Vector2D.fromPolar = function(deg, len) {
let rad ... | class Vector2D {
constructor(x, y) {
this.x = x;
this.y = y;
}
add(vec) {
return new Vector2D(this.x + vec.x, this.y + vec.y);
}
multiply(factor) {
return new Vector2D(this.x * factor, this.y * factor);
}
length() {
return Math.sqrt(this.x * this.x,... | Add more functionality to vectors | Add more functionality to vectors
| JavaScript | mit | 190n/five.js |
29a464500056d1b0c80e4056139931cb77dacd53 | public/fastboot-is-mobile.js | public/fastboot-is-mobile.js | /* globals define, FastBoot */
(function() {
define('ismobilejs', ['exports'], function(exports) {
'use strict';
let isMobileClass = FastBoot.require('ismobilejs');
// Change the context so that when isMobile internally sets the results of
// the user agent tests to the current scope, it doesn't use ... | /* globals define, FastBoot */
(function() {
define('ismobilejs', ['exports'], function(exports) {
'use strict';
var isMobileClass = FastBoot.require('ismobilejs');
// Change the context so that when isMobile internally sets the results of
// the user agent tests to the current scope, it doesn't use ... | Fix strict mode typo in fastboot module export | Fix strict mode typo in fastboot module export
| JavaScript | mit | sandydoo/ember-is-mobile,sandydoo/ember-is-mobile |
fd5ee5b257ef44549c870abc620527dda9d4a358 | src/mm-action/mm-action.js | src/mm-action/mm-action.js | /**
* @license
* Copyright (c) 2015 MediaMath Inc. All rights reserved.
* This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt
*/
Polymer({
is: "mm-action",
behaviors: [
StrandTraits.Stylable
],
properties: {
ver:{
type:String,
value:"<<versio... | /**
* @license
* Copyright (c) 2015 MediaMath Inc. All rights reserved.
* This code may only be used under the BSD style license found at http://mediamath.github.io/strand/LICENSE.txt
*/
(function (scope) {
scope.Action = Polymer({
is: "mm-action",
behaviors: [
StrandTraits.Stylable
],
properties: {
... | Add correct IIF and scope | Add correct IIF and scope
| JavaScript | bsd-3-clause | sassomedia/strand,anthonykoerber/strand,shuwen/strand,dlasky/strand,shuwen/strand,sassomedia/strand,anthonykoerber/strand,dlasky/strand |
9b44e8f5367bf24b6d5c21d35f402bc0686c1383 | src/modules/Application.js | src/modules/Application.js | class GelatoApplication extends Backbone.Model {
constructor() {
Backbone.$('body').prepend('<gelato-application></gelato-application>');
Backbone.$('gelato-application').append('<gelato-dialogs></gelato-dialogs>');
Backbone.$('gelato-application').append('<gelato-navbar></gelato-navbar>');
Backbone.... | class GelatoApplication extends Backbone.View {
constructor(options) {
options = options || {};
options.tagName = 'gelato-application';
super(options);
}
render() {
$(document.body).prepend(this.el);
this.$el.append('<gelato-navbar></gelato-navbar>');
this.$el.append('<gelato-pages></ge... | Make application function more like a backbone view | Make application function more like a backbone view
| JavaScript | mit | jernung/gelato,jernung/gelato,mcfarljw/gelato-framework,mcfarljw/backbone-gelato,mcfarljw/backbone-gelato,mcfarljw/gelato-framework |
cc4f209f011639d4f6888a39e71b1145e58cf5c5 | src/route/changelogs.js | src/route/changelogs.js | const router = require('express').Router();
const scraper = require('../service/scraper');
router.get('/', (req, res, next) => {
const packageName = req.query.package;
if (!packageName) {
const err = new Error('Undefined query');
err.satus = 404;
next(err);
}
scraper
... | const router = require('express').Router();
const scraper = require('../service/scraper');
router.get('/:package/latest', (req, res, next) => {
const packageName = req.params.package;
if (!packageName) {
const err = new Error('Undefined query');
err.satus = 404;
next(err);
}
... | Change package query from query param to path variable | Change package query from query param to path variable
| JavaScript | mit | enric-sinh/android-changelog-api |
b32f0a37a944afeda9d59eb8169dbad0419c5e0e | controllers/locale.js | controllers/locale.js | /*
* @author Martin Høgh <mh@mapcentia.com>
* @copyright 2013-2018 MapCentia ApS
* @license http://www.gnu.org/licenses/#AGPL GNU AFFERO GENERAL PUBLIC LICENSE 3
*/
var express = require('express');
var router = express.Router();
router.get('/locale', function(request, response) {
var lang = request.... | /*
* @author Martin Høgh <mh@mapcentia.com>
* @copyright 2013-2018 MapCentia ApS
* @license http://www.gnu.org/licenses/#AGPL GNU AFFERO GENERAL PUBLIC LICENSE 3
*/
var express = require('express');
var router = express.Router();
var ipaddr = require('ipaddr.js');
router.get('/locale', function(request, ... | Return the clients IP address | Return the clients IP address
| JavaScript | agpl-3.0 | mapcentia/vidi,mapcentia/vidi,mapcentia/vidi,mapcentia/vidi |
943bc6d05065524b158ac7fc3be450126db3a558 | website/app/application/core/projects/project/provenance/wizard/show-template-details.js | website/app/application/core/projects/project/provenance/wizard/show-template-details.js | Application.Directives.directive("showTemplateDetails", showTemplateDetailsDirective);
function showTemplateDetailsDirective() {
return {
restrict: "E",
replace: true,
scope: {
template: "=template",
},
controller: "showTemplateDetailsDirectiveController",
... | Application.Directives.directive("showTemplateDetails",
["RecursionHelper", showTemplateDetailsDirective]);
function showTemplateDetailsDirective(RecursionHelper) {
return {
restrict: "E",
replace: true,
scope: {
template: "=template",
},
... | Allow directive to be called recursively. | Allow directive to be called recursively.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
5ae8a55a75bef8a0af6d330842000152e2830c0e | lib/text.js | lib/text.js | exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}... | exports._regExpRegExp = /^\/(.+)\/([im]?)$/;
exports._lineRegExp = /\r\n|\r|\n/;
exports.splitLines = function (text) {
var lines = [];
var match, line;
while (match = exports._lineRegExp.exec(text)) {
line = text.slice(0, match.index) + match[0];
text = text.slice(line.length);
lines.push(line);
}... | Remove escapeRegExp in favor of lodash.escapeRegExp | Remove escapeRegExp in favor of lodash.escapeRegExp | JavaScript | mit | slap-editor/slap-util |
2edfecbcd8b891a839e3ee36ed18d8052900d134 | src/dispatchResponse.js | src/dispatchResponse.js | /**
* @flow
*/
type ResData = {
newStates: {[key: string]: string}
};
/**
* Encode the updated states, to send to the client.
*
* @param updatedStates {StatesObject} The updated states
* @param encodeState {(string, any) => string} A function that will encode the state, of a given store, to be
* ... | /**
* @flow
*/
type ResData = {
newStates: {[key: string]: string}
};
/**
* Encode the updated states, to send to the client.
*
* @param updatedStates {StatesObject} The updated states
* @param encodeState {(string, any) => string} A function that will encode the state, of a given store, to be
* ... | Implement the Response's 'encode(...)' and 'decode(...)' Functions | Implement the Response's 'encode(...)' and 'decode(...)' Functions
Implement 'encode(...)' and 'decode(...)' functions for the the response.
| JavaScript | mit | nheyn/express-isomorphic-dispatcher |
0692f1a02b2dd231b40f06dce5941fdf15feecac | packages/react-cookie/src/withCookies.js | packages/react-cookie/src/withCookies.js | import React, { Component } from 'react';
import { instanceOf, func } from 'prop-types';
import Cookies from 'universal-cookie';
import hoistStatics from 'hoist-non-react-statics';
export default function withCookies(WrapperComponent) {
class Wrapper extends Component {
static displayName = `withCookies(${Compon... | import React, { Component } from 'react';
import { instanceOf, func } from 'prop-types';
import Cookies from 'universal-cookie';
import hoistStatics from 'hoist-non-react-statics';
export default function withCookies(WrapperComponent) {
class Wrapper extends Component {
static displayName = `withCookies(${Wrappe... | Fix undefined name of component | Fix undefined name of component
Fix minor misspel, `Component` is `React.Component` now, should use name of `WrapperComponent` in `displayName` | JavaScript | mit | eXon/react-cookie,reactivestack/cookies,reactivestack/cookies,reactivestack/cookies |
2800cd66ab65cc464c5ddeb1a619a2ed9e254e35 | src/update.js | src/update.js | // @flow
export default function (el: HTMLTextAreaElement, headToCursor: string, cursorToTail: ?string) {
const curr = el.value, // strA + strB1 + strC
next = headToCursor + (cursorToTail || ''), // strA + strB2 + strC
activeElement = document.activeElement;
// Calculat... | // @flow
export default function (el: HTMLTextAreaElement, headToCursor: string, cursorToTail: ?string) {
const curr = el.value, // strA + strB1 + strC
next = headToCursor + (cursorToTail || ''), // strA + strB2 + strC
activeElement = document.activeElement;
// Calculat... | Fix a second infinite loop | Fix a second infinite loop | JavaScript | mit | yuku-t/undate,yuku-t/undate |
ea89c8e3f4068f775cca71dbfd6c2d8410addecb | lib/assets/javascripts/cartodb/new_common/url_shortener.js | lib/assets/javascripts/cartodb/new_common/url_shortener.js | var $ = require('jquery');
var LocalStorage = require('./local_storage');
var LOGIN = 'vizzuality';
var KEY = 'R_de188fd61320cb55d359b2fecd3dad4b';
var UrlShortener = function() {
this.localStorage = new LocalStorage('cartodb_urls');
};
UrlShortener.prototype.fetch = function(originalUrl, callbacks) {
var cached... | var $ = require('jquery');
var LocalStorage = require('./local_storage');
var LOGIN = 'vizzuality';
var KEY = 'R_de188fd61320cb55d359b2fecd3dad4b';
var UrlShortener = function() {
this.localStorage = new LocalStorage('cartodb_urls2'); // to not clash with old local storage cache, they're incompatible
};
UrlShorten... | Change key used for url shortener | Change key used for url shortener
Incompatible with old keys, so do not use same key
| JavaScript | bsd-3-clause | thorncp/cartodb,UCL-ShippingGroup/cartodb-1,thorncp/cartodb,DigitalCoder/cartodb,codeandtheory/cartodb,DigitalCoder/cartodb,nyimbi/cartodb,nuxcode/cartodb,UCL-ShippingGroup/cartodb-1,DigitalCoder/cartodb,codeandtheory/cartodb,nuxcode/cartodb,CartoDB/cartodb,bloomberg/cartodb,future-analytics/cartodb,nyimbi/cartodb,code... |
3b3de3a210fe69cd4e95f0c218801992cab0c88c | src/store/student-store.js | src/store/student-store.js | import { Store } from 'consus-core/flux';
import CartStore from './cart-store';
let student = null;
class StudentStore extends Store{
hasOverdueItems(items){
return items.some(element => {
return element.timestamp <= new Date().getTime();
});
}
getStudent() {
return st... | import { Store } from 'consus-core/flux';
import CartStore from './cart-store';
import { searchStudent } from '../lib/api-client';
let student = null;
class StudentStore extends Store{
hasOverdueItems(items){
return items.some(element => {
return element.timestamp <= new Date().getTime();
... | Update student from server after checkout completes | Update student from server after checkout completes
| JavaScript | unlicense | TheFourFifths/consus-client,TheFourFifths/consus-client |
0be67d85e1d203b41d1dddded41f8d634e01a44f | packages/truffle-contract/statuserror.js | packages/truffle-contract/statuserror.js | var TruffleError = require("truffle-error");
var inherits = require("util").inherits;
var defaultGas = 90000;
var web3 = require("web3");
inherits(StatusError, TruffleError);
function StatusError(args, tx, receipt) {
var message;
var gasLimit = parseInt(args.gas) || defaultGas;
if(receipt.gasUsed === gasLimit)... | var TruffleError = require("truffle-error");
var inherits = require("util").inherits;
var web3 = require("web3");
inherits(StatusError, TruffleError);
var defaultGas = 90000;
function StatusError(args, tx, receipt) {
var message;
var gasLimit = parseInt(args.gas) || defaultGas;
if(receipt.gasUsed === gasLimit... | Move errant variable away from require block | Move errant variable away from require block
| JavaScript | mit | ConsenSys/truffle |
88540362b4b676d68a2b5db474b9cb1bd7316aa3 | packages/motion/src/cli/index.js | packages/motion/src/cli/index.js | #!/usr/bin/env node
'use strict'
import commander from 'commander'
const parameters = require('minimist')(process.argv.slice(2))
const command = parameters['_'][0]
const validCommands = ['new', 'build', 'update', 'init']
// TODO: Check for updates
// Note: This is a trick to make multiple commander commands work wi... | #!/usr/bin/env node
'use strict'
const command = process.argv[2] || ''
const validCommands = ['new', 'build', 'update', 'init']
// TODO: Check for updates
// Note: This is a trick to make multiple commander commands work with single executables
process.argv = process.argv.slice(0, 2).concat(process.argv.slice(3))
l... | Enhance the main cli entry file | :art: Enhance the main cli entry file
| JavaScript | mpl-2.0 | flintjs/flint,flintjs/flint,motion/motion,flintjs/flint,motion/motion |
8486a37ca95cc2c211ec6a66b618e986e3d7dec6 | server/server.js | server/server.js | const
express = require('express'),
bodyParser = require('body-parser');
const
{mongoose} = require('./db/mongoose'),
dbHandler = require('./db/dbHandler');
let app = express();
let port = porcess.env.PORT || 3000;
app.use(bodyParser.json());
app.route('/todos')
.get((req, res) => {
dbHandler.findTodo... | const
express = require('express'),
bodyParser = require('body-parser');
const
{mongoose} = require('./db/mongoose'),
dbHandler = require('./db/dbHandler');
let app = express();
let port = process.env.PORT || 3000;
app.use(bodyParser.json());
app.route('/todos')
.get((req, res) => {
dbHandler.findTodo... | Fix a typo setting the port | Fix a typo setting the port
| JavaScript | mit | daniellara/smooky-todoes |
75a7442f43aeaa63727ba09c892cb7b4f5e4f1c5 | test/api/scenarios.spec.js | test/api/scenarios.spec.js | import { API } from 'api';
import Scenarios from 'api/scenarios';
describe('scenarios', () => {
afterEach(() => {
API.clearStorage();
});
it('should have currentScenario be set to "MockedRequests"', () => {
expect(Scenarios.currentScenario).toBe('MockedRequests');
});
it('should get 0 scenarios', ... | import { API } from 'api';
import Scenarios from 'api/scenarios';
describe('scenarios', () => {
afterEach(() => {
API.clearStorage();
});
it('should have currentScenario be set to "MockedRequests"', () => {
expect(Scenarios.currentScenario).toBe('MockedRequests');
});
it('should get 0 scenarios', ... | Add additional scenarios test cases | Add additional scenarios test cases
| JavaScript | mit | 500tech/bdsm,500tech/mimic,500tech/mimic,500tech/bdsm |
17bc27925e2b02d4910cd6598af4bcbda7e4d8f0 | src/tasks/watchBuild.js | src/tasks/watchBuild.js | /*
* Copyright 2014 Workiva, LLC
*
* 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 applicable law or agreed to... | /*
* Copyright 2014 Workiva, LLC
*
* 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 applicable law or agreed to... | Add styles to watched directories for watch:build/watch | Add styles to watched directories for watch:build/watch
| JavaScript | apache-2.0 | robertbaker/wGulp,Workiva/wGulp,Workiva/wGulp,jimhotchkin-wf/wGulp,jimhotchkin-wf/wGulp,robertbaker/wGulp,robertbaker/wGulp,jimhotchkin-wf/wGulp,Workiva/wGulp |
e5159760eea2faff47cc88518f5b4c3317b6b4ec | src/utils/gulp/gulp-tasks-linters.js | src/utils/gulp/gulp-tasks-linters.js | var path = require('path');
var eslint = require('gulp-eslint');
var merge = require('lodash/object/merge');
var shelljs = require('shelljs');
function failLintBuild() {
process.exit(1);
}
function scssLintExists() {
return shelljs.which('scss-lint');
}
module.exports = function(gulp, options) {
var scssLintP... | var path = require('path');
var eslint = require('gulp-eslint');
var merge = require('lodash/object/merge');
var shelljs = require('shelljs');
function scssLintExists() {
return shelljs.which('scss-lint');
}
module.exports = function(gulp, options) {
var scssLintPath = path.resolve(__dirname, 'scss-lint.yml');
... | Print all scsslint errors before existing. | Print all scsslint errors before existing.
| JavaScript | apache-2.0 | samogami/grommet,codeswan/grommet,phuson/grommet,HewlettPackard/grommet,davrodpin/grommet,HewlettPackard/grommet,samogami/grommet,Dinesh-Ramakrishnan/grommet,primozs/grommet,marlonpp/grommet-old,nanndoj/grommet,kylebyerly-hp/grommet,davrodpin/grommet,nickjvm/grommet,HewlettPackard/grommet,marlonpp/grommet-old,codeswan/... |
b5af356f623429c5472f968ad2a84da9b599a7c4 | test/setup.js | test/setup.js | import 'babel-polyfill'
import fs from 'fs'
import path from 'path'
import jsdom from 'jsdom'
import dotenv from 'dotenv'
import chai, { expect } from 'chai'
import chaiImmutable from 'chai-immutable'
import sinon from 'sinon'
import sinonChai from 'sinon-chai'
import chaiSaga from './support/saga_helpers'
chai.use(ch... | import 'babel-polyfill'
import fs from 'fs'
import path from 'path'
import jsdom from 'jsdom'
import dotenv from 'dotenv'
import chai, { expect } from 'chai'
import chaiImmutable from 'chai-immutable'
import sinon from 'sinon'
import sinonChai from 'sinon-chai'
import chaiSaga from './support/saga_helpers'
chai.use(ch... | Add a polyfill for matchMedia to get tests to run | Add a polyfill for matchMedia to get tests to run
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp |
9752da995a819fad7859f0bce13f1370bfda9f7b | server/routes/user-routes.js | server/routes/user-routes.js | var bcrypt = require('bcryptjs');
var router = require('express').Router();
var User = require('../models/user');
router.post('/', function(req, res) {
var salt = bcrypt.genSaltSync(10);
var user = new User({
username: req.body.user.username,
name: req.body.user.name,
password_digest: bcrypt.hashSync(... | var bcrypt = require('bcryptjs');
var jwt = require('jsonwebtoken');
var router = require('express').Router();
var User = require('../models/user');
router.post('/', function(req, res) {
var salt = bcrypt.genSaltSync(10);
var user = new User({
username: req.body.user.username,
name: req.body.user.name,
... | Include auth token in sign up response. | Include auth token in sign up response.
| JavaScript | mit | FretlessJS-2016-03/notely,FretlessJS-2016-03/notely |
a707369a96aa892764775146c0ca081c9b95c712 | routes/front.js | routes/front.js | var express = require('express');
var router = express.Router();
router.get('/token', function (req, res) {
res.redirect('/');
});
router.get('/*', function (req, res, next) {
res.render('user/dashboard', { layout: 'user', title: 'Busy' });
});
module.exports = router;
| var express = require('express');
var router = express.Router();
router.get('/*', function (req, res, next) {
res.render('user/dashboard', { layout: 'user', title: 'Busy' });
});
module.exports = router;
| Remove token endPoint; need to redeploy. | Remove token endPoint; need to redeploy.
| JavaScript | mit | Sekhmet/busy,busyorg/busy,ryanbaer/busy,Sekhmet/busy,busyorg/busy,ryanbaer/busy |
a115c44bcc17d6e6956d9d07030c2bb79c8a8f42 | ssr-express/demo/app.js | ssr-express/demo/app.js | /**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | /**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | Remove amp-ssr component from demo | Remove amp-ssr component from demo
Change-Id: I39067fd6e71f28a5365b447824280b7c4f71a01d
| JavaScript | apache-2.0 | ampproject/amp-toolbox,google/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,ampproject/amp-toolbox |
99a416385af062898d0709b64493dcb8859e9e27 | src/e2e-tests/basic.e2e.js | src/e2e-tests/basic.e2e.js | var assert = require('assert');
describe("Basic Test", function(){
it("Loads the basic demo page and sends values to server", function(){
browser.url('http://localhost:7888/src/e2e-tests/basic-demo-page?auto-activate-glasswing')
browser.waitUntil(function () {
var a = browser.execute(fu... | var assert = require('assert');
function assertContains(string, containedValue){
assert(string.indexOf(containedValue) !== -1)
}
describe("Basic Test", function(){
it("Loads the basic demo page and sends values to server", function(){
browser.url('http://localhost:7888/src/e2e-tests/basic-demo-page?au... | Check annotated source code renders. | Check annotated source code renders.
| JavaScript | mit | mattzeunert/glasswing,mattzeunert/glasswing,mattzeunert/glasswing |
b4ab5d7ff3556f9a40c425afaa4dab5601b37027 | models/paste.js | models/paste.js | const mongoose = require('mongoose');
const shortid = require('shortid');
const paste = new mongoose.Schema({
_id: { type: String, default: shortid.generate },
paste: { type: String },
expiresAt: { type: Date, expires: 0, default: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7) }
}, {
timestamps: true
});
module.e... | const mongoose = require('mongoose');
const shortid = require('shortid');
const paste = new mongoose.Schema({
_id: { type: String, default: shortid.generate },
paste: { type: String },
expiresAt: { type: Date, expires: 0 }
}, {
timestamps: true
});
module.exports = mongoose.model('Paste', paste);
| Remove default expiry on model | Remove default expiry on model
| JavaScript | mit | JoeBiellik/paste,JoeBiellik/paste |
0f3369a02a6386d8bfb895de09faa9b1c168715d | src/app/components/msp/common/consent-modal/i18n/data/en/index.js | src/app/components/msp/common/consent-modal/i18n/data/en/index.js | module.exports = {
title: 'Information collection notice',
body: 'The information in this application is collected by the Ministry of Health under section 26(a) of the Freedom of Information and Protection of Privacy Act and will be used to determine eligibility for provincial health care benefits in BC and adminis... | module.exports = {
title: 'Information collection notice',
body: '<p>The data you enter on this form is saved locally to the computer or device you are using. The data will be deleted when you close the web browser you are using or after your submit your application.</p><p>The information in this application is col... | Add info re: data saving | Add info re: data saving | JavaScript | apache-2.0 | bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP,bcgov/MyGovBC-MSP |
e2bff214c4773626816d3f58d19a2a84451c333d | src/astring_plugin/index.js | src/astring_plugin/index.js | import astring from 'astring';
// Create a custom generator that inherits from Astring's default generator
const customGenerator = Object.assign({}, astring.defaultGenerator, {
Literal(node, state) {
if (node.raw != null) {
const first = node.raw.charAt(0);
const last = node.raw.charAt(node.raw.lengt... | import astring from 'astring';
// Create a custom generator that inherits from Astring's default generator
const customGenerator = Object.assign({}, astring.defaultGenerator, {
Literal(node, state) {
if (node.raw != null) {
const first = node.raw.charAt(0).charCodeAt();
const last = node.raw.charAt(n... | Fix the bug hidden in astring plugin | Fix the bug hidden in astring plugin
| JavaScript | mit | laosb/hatp |
8a5185e85c1f6206ed59256b2a6c2e996af96a6b | tools/bundle-deploy.js | tools/bundle-deploy.js | const { execSync } = require('child_process');
const path = require('path');
execSync(`
git config user.email "andrey.a.gubanov@gmail.com" &&
git config user.name "Andrey Gubanov (his digital copy)" &&
git clone -b gh-pages https://$GH_TOKEN@github.com/matreshkajs/matreshka-router.git &&
npm run bundle... | const { execSync } = require('child_process');
const path = require('path');
execSync(`
git config user.email "andrey.a.gubanov@gmail.com" &&
git config user.name "Andrey Gubanov (his digital copy)" &&
git clone -b gh-pages https://$GH_TOKEN@github.com/matreshkajs/matreshka-router.git bundle &&
npm run... | Clone bundle repo tu bundle folder | fix: Clone bundle repo tu bundle folder
| JavaScript | mit | matreshkajs/matreshka-router,finom/matreshka_router |
fc31a6711da30682e208cc257b567c136fe9a6b5 | client/src/entrypoints/snippets/snippet-chooser-modal.js | client/src/entrypoints/snippets/snippet-chooser-modal.js | import $ from 'jquery';
window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = {
choose: function (modal) {
function ajaxifyLinks(context) {
$('a.snippet-choice', modal.body).on('click', function () {
modal.loadUrl(this.href);
return false;
});
$('.pagination a', context).on('click', f... | import $ from 'jquery';
import { SearchController } from '../../includes/chooserModal';
window.SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS = {
choose: function (modal) {
function ajaxifyLinks(context) {
$('a.snippet-choice', modal.body).on('click', function () {
modal.loadUrl(this.href);
return f... | Use SearchController on snippet chooser modal | Use SearchController on snippet chooser modal
| JavaScript | bsd-3-clause | wagtail/wagtail,wagtail/wagtail,rsalmaso/wagtail,wagtail/wagtail,thenewguy/wagtail,thenewguy/wagtail,zerolab/wagtail,rsalmaso/wagtail,wagtail/wagtail,rsalmaso/wagtail,thenewguy/wagtail,zerolab/wagtail,thenewguy/wagtail,rsalmaso/wagtail,zerolab/wagtail,zerolab/wagtail,wagtail/wagtail,rsalmaso/wagtail,thenewguy/wagtail,z... |
fc610c08cd26d108ee1e48da4b19bd8c90cf570f | app/assets/javascripts/spree/backend/solidus_paypal_braintree.js | app/assets/javascripts/spree/backend/solidus_paypal_braintree.js | //= require spree/braintree_hosted_form.js
$(function() {
var $paymentForm = $("#new_payment"),
$hostedFields = $("[data-braintree-hosted-fields]");
function onError (err) {
var msg = err.name + ": " + err.message;
show_flash("error", msg);
console.error(err);
}
// exit early if we're not l... | //= require spree/braintree_hosted_form.js
$(function() {
var $paymentForm = $("#new_payment"),
$hostedFields = $("[data-braintree-hosted-fields]");
function onError (err) {
var msg = err.name + ": " + err.message;
show_flash("error", msg);
console.error(err);
}
// exit early if we're not l... | Load the braintree client on demand libs in admin | Load the braintree client on demand libs in admin
Like in frontend we load the braintree client libs on demand and then initialize the hosted fields.
| JavaScript | bsd-3-clause | solidusio/solidus_paypal_braintree,solidusio/solidus_paypal_braintree,solidusio/solidus_paypal_braintree,solidusio/solidus_paypal_braintree |
5b30c625b6d59e087341259174e78b97db07eb4a | lib/nb-slug.js | lib/nb-slug.js | 'use strict';
var diacritics = require('./diacritics');
function nbSlug(name) {
var diacriticsMap = {};
for (var i = 0; i < diacritics.length; i++) {
var letters = diacritics[i].letters;
for (var j = 0; j < letters.length ; j++) {
diacriticsMap[letters[j]] = diacritics[i].base;
}
}
functi... | 'use strict';
var diacritics = require('./diacritics');
function nbSlug(name) {
var diacriticsMap = {};
for (var i = 0; i < diacritics.length; i++) {
var letters = diacritics[i].letters;
for (var j = 0; j < letters.length ; j++) {
diacriticsMap[letters[j]] = diacritics[i].base;
}
}
functi... | Remove -, !, + and ~ from the slug too | Remove -, !, + and ~ from the slug too | JavaScript | unlicense | nurimba/nb-slug,nurimba/nb-slug |
55ab768d9fd5adf4fbefa3db2d121fdbe6c840f4 | resources/js/modules/accordion.js | resources/js/modules/accordion.js | import 'accordion/src/accordion.js';
(function() {
"use strict";
document.querySelectorAll('.accordion').forEach(function(item) {
new Accordion(item, {
onToggle: function(target){
// Only allow one accordion item open at time
target.accordion.folds.forEach(f... | import 'accordion/src/accordion.js';
(function() {
"use strict";
document.querySelectorAll('.accordion').forEach(function(item) {
new Accordion(item, {
onToggle: function(target){
// Only allow one accordion item open at time
target.accordion.folds.forEach(f... | Set the role to button instead of tab | Set the role to button instead of tab
| JavaScript | mit | waynestate/base-site,waynestate/base-site |
2a8170bd4f0ed6fad4dcd8441c2e8d162fbc4431 | simple-todos.js | simple-todos.js | if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
}
| Tasks = new Mongo.Collection("tasks");
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
tasks: function () {
return Tasks.find({});
}
});
}
| Make tasks a MongoDB collection. | Make tasks a MongoDB collection.
| JavaScript | mit | chooie/meteor-todo |
c5ca7c86331bb349c4bd3ccd7d5c12cdce0fa924 | utils/getOutputPath.js | utils/getOutputPath.js | const path = require('path');
const getOptions = require('./getOptions');
module.exports = (options, jestRootDir) => {
// Override outputName and outputDirectory with outputFile if outputFile is defined
let output = options.outputFile;
if (!output) {
// Set output to use new outputDirectory and fallback on ... | const path = require('path');
const getOptions = require('./getOptions');
module.exports = (options, jestRootDir) => {
// Override outputName and outputDirectory with outputFile if outputFile is defined
let output = options.outputFile;
if (!output) {
// Set output to use new outputDirectory and fallback on ... | Replace <rootDir> prior to path.join(). | Replace <rootDir> prior to path.join().
This allows outputDirectory to be formatted like <rootDir>/../some/dir. In that case, path.join() assumes the .. cancels out the <rootDir>, which seems entirely reasonable. Unfortunately, it means the final value is some/dir, and that ends up rooted at process.cwd(), which doesn... | JavaScript | apache-2.0 | palmerj3/jest-junit |
39b2bb6cf1148bb0c63d19b52473c46e77c5c212 | src/components/SSOLanding.js | src/components/SSOLanding.js | import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import Link from 'react-router-dom/Link';
import queryString from 'query-string';
const SSOLanding = (props) => {
const search = props.location.search;
if (!search) {
return <div>No search string</div>;
... | import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import Link from 'react-router-dom/Link';
import queryString from 'query-string';
const SSOLanding = (props) => {
const search = props.location.search;
if (!search) {
return <div>No search string</div>;
... | Change name of SSO token parameter from sso-token to ssoToken | Change name of SSO token parameter from sso-token to ssoToken
This makes is consistent with the cookie-name that I am about to
implement. The spec for cookies says hyphens are OK in the name, but
not everyone's experience agrees: see
https://stackoverflow.com/a/27235182
Modifies STCOR-20; relates to STCOR-38.
| JavaScript | apache-2.0 | folio-org/stripes-core,folio-org/stripes-core,folio-org/stripes-core |
5193f5908f8929b7908649950161d9531c04f8b1 | lib/assets/javascripts/new-dashboard/store/utils/getCARTOData.js | lib/assets/javascripts/new-dashboard/store/utils/getCARTOData.js | export default function getCARTOData () {
if (window.CartoConfig) {
return window.CartoConfig.data;
}
return {
user_data: window.user_data,
organization_notifications: window.organization_notifications
};
}
| export default function getCARTOData () {
if (window.CartoConfig) {
return window.CartoConfig.data;
}
return {
user_data: window.user_data,
organization_notifications: window.organization_notifications || []
};
}
| Set organization_notifications to [] if no notificarions are available | Set organization_notifications to [] if no notificarions are available
| JavaScript | bsd-3-clause | CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.