commit stringlengths 40 40 | old_file stringlengths 4 236 | new_file stringlengths 4 236 | old_contents stringlengths 1 3.26k | new_contents stringlengths 16 4.43k | subject stringlengths 16 624 | message stringlengths 17 3.29k | lang stringclasses 5
values | license stringclasses 13
values | repos stringlengths 5 91.5k |
|---|---|---|---|---|---|---|---|---|---|
b30839d05fa42ba95984e42e57ac46b030f84500 | config.js | config.js | /**
* Created by Андрей on 29.11.2015.
*/
var config = {};
config.vk = {};
config.mail = {};
config.mail.strings = {};
config.vk.appId = 5167405;
config.vk.appSecret = process.env.VK_APP_SECRET || "vk_app_secret";
config.vk.token = "user_access_token_who_sends_messages_to_vk";
config.vk.peerId = "user_or_chat_id";
... | /**
* Created by Андрей on 29.11.2015.
*/
var config = {};
config.vk = {};
config.mail = {};
config.mail.strings = {};
config.vk.appId = 5167405;
config.vk.appSecret = process.env.VK_APP_SECRET || "vk_app_secret";
//You need to get a token for STANDALONE APPLICATIONS with permissions 'messages' and 'offline'
//See ... | Add comments for getting vk token | Add comments for getting vk token
| JavaScript | apache-2.0 | ankulikov/imap2vk |
a8b8ced7b917e3dc461487a918170dd20eb4528c | packages/ember-views/lib/core.js | packages/ember-views/lib/core.js | /**
@module ember
@submodule ember-views
*/
var jQuery = Ember.imports.jQuery;
Ember.assert("Ember Views require jQuery 1.8, 1.9 or 2.0", jQuery && (jQuery().jquery.match(/^((1\.(8|9))|2.0)(\.\d+)?(pre|rc\d?)?/) || Ember.ENV.FORCE_JQUERY));
/**
Alias for jQuery
@method $
@for Ember
*/
Ember.$ = jQuery;
| /**
@module ember
@submodule ember-views
*/
var jQuery = Ember.imports.jQuery;
Ember.assert("Ember Views require jQuery 1.8, 1.9, 1.10, or 2.0", jQuery && (jQuery().jquery.match(/^((1\.(8|9|10))|2.0)(\.\d+)?(pre|rc\d?)?/) || Ember.ENV.FORCE_JQUERY));
/**
Alias for jQuery
@method $
@for Ember
*/
Ember.$ = jQuer... | Include 1.10 in jQuery version check | Include 1.10 in jQuery version check
| JavaScript | mit | yaymukund/ember.js,chadhietala/ember.js,rubenrp81/ember.js,jerel/ember.js,zenefits/ember.js,bcardarella/ember.js,gdi2290/ember.js,tofanelli/ember.js,raycohen/ember.js,brzpegasus/ember.js,tildeio/ember.js,benstoltz/ember.js,g13013/ember.js,szines/ember.js,trentmwillis/ember.js,raycohen/ember.js,Eric-Guo/ember.js,femi-sa... |
4d83039ac89719c0adc13f216779607613d60813 | shopping_app/static/assets/app/js/main.js | shopping_app/static/assets/app/js/main.js | /**
* Created by root on 9/19/17.
*/
'use strict';
$("#signinModal, #signupModal").modal({
show: true
});
$("#shl-item, #shl-price").addClass('text-center');
$(".shl-input").addClass('text-center'); | /**
* Created by root on 9/19/17.
*/
'use strict';
$(document).ready(function () {
$("#shl-item, #shl-price").addClass('text-center');
$(".shl-input").addClass('text-center');
$("#username, #password").addClass('form-control');
});
document.getElementById('username').placeholder = 'Username';
document.g... | Add more dynamic styling to forms | Add more dynamic styling to forms
| JavaScript | mit | gr1d99/shopping-list,gr1d99/shopping-list,gr1d99/shopping-list |
4fee91740b9f6748200820d2ef6c257e9c412e34 | lib/api/date.js | lib/api/date.js | 'use strict';
const moment = require('moment');
/**
* Given a date return a date ISO string.
* @param {String} dateString The date string to format.
* @param {String} dateFormat The date format.
* @param {String} offset A timezone offset.
* @param {Function} startOf A function to manipulate the moment objec... | 'use strict';
const moment = require('moment');
/**
* Given a date return a date ISO string.
* @param {String} dateString The date string to format.
* @param {String} dateFormat The date format.
* @param {String} offset A timezone offset.
* @param {Function} startOf A function to manipulate the moment objec... | Support negative and positive timezones. | Support negative and positive timezones.
| JavaScript | mit | linzjs/linz,linzjs/linz,linzjs/linz |
fe9438ef6b726bdda266e48da830a3fa19f4b2b8 | lib/vertices.js | lib/vertices.js | !function(exports) {
'use strict';
exports._extendable(VertexSet);
function VertexSet(uniform) {
this._uniformSet = uniform;
this.vertices = null;
}
/*
* Methods
* ---------------------------------------------------------------------------
*/
VertexSet.prototype.setVertices = function(v... | !function(exports) {
'use strict';
exports._extendable(VertexSet);
function VertexSet(leaf, vertices) {
this.leaf = leaf;
this.vertices = null;
if(vertices) this.setVertices(vertices);
}
/*
* Methods
* ---------------------------------------------------------------------------
*/
V... | Remove remnants of the old fixed pipeline. | Remove remnants of the old fixed pipeline.
VertexSets had a _uniformSet property instead of a leaf property, which
in the new taxonomy didn't make sense.
| JavaScript | mit | reissbaker/batchgl,reissbaker/batchgl |
bc11bccc0fcebefc2655081928407fb548804d3b | test/structuredPatch.js | test/structuredPatch.js | const VERBOSE = false;
var diff = require('../diff');
function log() {
VERBOSE && console.log.apply(console, arguments);
}
describe('#structuredPatch', function() {
it('should handle files with the last line changed', function() {
var res = diff.structuredPatch(
'oldfile', 'newfile',
'line2\nlin... | const VERBOSE = false;
var diff = require('../diff');
function log() {
VERBOSE && console.log.apply(console, arguments);
}
describe('#structuredPatch', function() {
it('should handle files with the last line changed', function() {
var res = diff.structuredPatch(
'oldfile', 'newfile',
'line2\nlin... | Test on structured patch method updated | Test on structured patch method updated
| JavaScript | bsd-3-clause | kdz/jsdiff,kdz/jsdiff,modulexcite/jsdiff,modulexcite/jsdiff |
3915ba11624e191a6e48daed9be152099fb36a53 | minifyAssets.js | minifyAssets.js | function minifyAssets() {
const compressor = require('node-minify');
const { readdirSync } = require('fs');
const { join } = require('path');
const Logger = require(join(__dirname, './src/resources/js/Logger'));
const cssFiles = readdirSync(join(__dirname, './src/resources/css'))
.filter(f => !f.endsWith('.min.... | const compressor = require('node-minify');
const { readdirSync } = require('fs');
const { basename, join } = require('path');
const resources = (...dir) => join(...[__dirname, 'src', 'resources'].concat(dir));
const Logger = require(resources('js', 'Logger'));
function minifyAssets() {
const cssPath = resources('cs... | Clean up asset minification script | Clean up asset minification script
| JavaScript | mpl-2.0 | robflop/Megumin,robflop/Megumin.love,robflop/Megumin.love,robflop/Megumin,robflop/Megumin |
51a41aefbd86f3348edb1c775fefc9b78a2bc695 | Hot100.js | Hot100.js | 'use strict'
var request = require('request');
var cheerio = require('cheerio');
var $;
request('http://www.billboard.com/charts/hot-100', function(err, resp, body) {
$ = cheerio.load(body);
ParseData();
})
var Artists = {};
var Hot100 = [];
function ParseData() {
$('.chart-row__artist').each(function() {
let t... | 'use strict'
var request = require('request');
var cheerio = require('cheerio');
var $;
request('http://www.billboard.com/charts/hot-100', function(err, resp, body) {
$ = cheerio.load(body);
ParseData();
})
var Artists = {};
var Hot100 = [];
function ParseData() {
$('.chart-row__artist').each(function() {
let t... | Add examples of returned data | Add examples of returned data
| JavaScript | mit | Dsummers91/Billboard-Stats-Node |
aabaad2f51f0c6e073f77425a08aa5e9dfd6bd48 | js/src/forum/components/PrivateDiscussionsUserPage.js | js/src/forum/components/PrivateDiscussionsUserPage.js | import UserPage from 'flarum/components/UserPage';
import PrivateDiscussionList from './PrivateDiscussionList';
export default class PrivateDiscussionsUserPage extends UserPage {
init() {
super.init();
this.loadUser(m.route.param('username'));
this.list = new PrivateDiscussionList({
... | import UserPage from 'flarum/components/UserPage';
import PrivateDiscussionList from './PrivateDiscussionList';
export default class PrivateDiscussionsUserPage extends UserPage {
init() {
super.init();
this.loadUser(m.route.param('username'));
}
show(user) {
// We can not create t... | Fix private discussions page breaking when user is loaded async | Fix private discussions page breaking when user is loaded async
| JavaScript | mit | flagrow/byobu,flagrow/byobu |
b4085a9cf5a9d6c5b57066b0cf313f6fb8a6321e | src/nodes/KeyframeSelector.js | src/nodes/KeyframeSelector.js | /**
* @constructor
* @param {string} stop
*/
function KeyframeSelector(stop) {
this.stop = stop;
}
/**
* @return {string}
*/
KeyframeSelector.prototype.toString = function toString() {
return this.stop;
};
/**
* @return {string}
*/
KeyframeSelector.prototype.pretty = function pretty() {
return this... | /**
* @constructor
* @param {string} stop
*/
function KeyframeSelector(stop) {
this.stop = stop;
}
/**
* @return {string}
*/
KeyframeSelector.prototype.toString = function toString() {
return this.stop;
};
/**
* @return {string}
*/
KeyframeSelector.prototype.pretty = function pretty() {
return this... | Fix for 'from' stop on keyframes | Fix for 'from' stop on keyframes
| JavaScript | mit | mattbasta/crass |
eb34209e629f083ab7995cfdb70a83a9e3cfb057 | src/components/SetDistance/SetDistance.js | src/components/SetDistance/SetDistance.js | import React, { PropTypes } from 'react'
import callWithValue from 'util/callWithValue'
function SetDistance ({ distance, onDistanceValueChange }) {
return (
<div>
<label>
Distance:
{' '}
<input
type='number'
value={distance.value}
min='0'
onC... | import React, { PropTypes } from 'react'
import callWithValue from 'util/callWithValue'
function SetDistance ({ distance, onDistanceValueChange }) {
return (
<div>
<label>
Distance:
{' '}
<input
type='number'
value={distance.value}
min='0'
ste... | Allow for decimal places in the distance field | Allow for decimal places in the distance field
| JavaScript | mit | garrettn/pacecalc,garrettn/pacecalc |
a2e56f0f76dac45a5084c28a27e24ba039b57e09 | src/main/resources/static/hello-change.js | src/main/resources/static/hello-change.js | // Copyright (C) 2013 The Android Open Source Project
//
// 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 ... | // Copyright (C) 2013 The Android Open Source Project
//
// 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 ... | Add example of using the getCurrentUser method in JS API | Add example of using the getCurrentUser method in JS API
Pop up a warning when the current user tries to submit another
user's change.
Bug: issue 461
Change-Id: I4a4c39093d07000ba1c9bc7d6da05e48815f603f
| JavaScript | apache-2.0 | GerritCodeReview/plugins_cookbook-plugin,GerritCodeReview/plugins_cookbook-plugin,GerritCodeReview/plugins_cookbook-plugin |
45c45bf58b2eb86dcb0edaf37f5e0e6fcbea369a | src/sagas/loadUserSessions.js | src/sagas/loadUserSessions.js | // @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFunction = () => Promise<?UserDataState>
export ... | // @flow
import firebase from '@firebase/app'
import '@firebase/database'
import '@firebase/auth'
import { call, put, takeEvery } from 'redux-saga/effects'
import { hydrateUserData } from 'actions'
import { USER_LOGGED_IN } from 'actions/types'
import type { UserDataState } from 'reducers/user/data'
type GetUserDataFu... | Fix action literal in saga. | style(sagas): Fix action literal in saga.
| JavaScript | mit | jsonnull/aleamancer,jsonnull/aleamancer |
ed6c4889199438a6a163f9d691367a670dcee325 | build/js/links.js | build/js/links.js | function applyLink(event) {
event.preventDefault();
var todayMatches = document.querySelectorAll(".match.today-ish");
var lastToday = todayMatches[todayMatches.length - 1];
if(lastToday) {
lastToday.scrollIntoView();
window.scrollBy(0, -50);
}
else {
window.scrollTo(0, 0);
}
}
document.addE... | function applyLink(event) {
event.preventDefault();
var todayMatches = document.querySelectorAll(".match.today-ish:not(.filter-no-match)");
var lastToday = todayMatches[todayMatches.length - 1];
if(lastToday) {
lastToday.scrollIntoView();
window.scrollBy(0, -50);
}
else {
window.scrollTo(0, 0)... | Make 'Jump to Today' jump to the first visible match | Make 'Jump to Today' jump to the first visible match
| JavaScript | mit | bloopletech/lolschedule,bloopletech/lolschedule,bloopletech/lolschedule |
f412230e9610d0317f425a39c2aca4226bbd9720 | js/loadsaved.js | js/loadsaved.js | // Load a saved graph if an ID is provided in the query string
function loadSaved() {
if (window.location.search) {
progressbar = new Progress();
modalWindow = new Modal(progressbar.container, false);
modalWindow.present();
// Make the blank network
makeNetwork();
progressbar.progress(0.02);
... | // Load a saved graph if an ID is provided in the query string
function loadSaved() {
if (window.location.search) {
progressbar = new Progress();
modalWindow = new Modal(progressbar.container, false);
modalWindow.present();
// Make the blank network
makeNetwork();
progressbar.progress(0.02);
... | Simplify things at the end of stabilization | Simplify things at the end of stabilization
| JavaScript | mit | controversial/wikipedia-map,controversial/wikipedia-map,controversial/wikipedia-map |
03d154ff14b03d4da65a15d61308b03f87e6ca94 | server.js | server.js | 'use strict';
var express = require('express')
, bodyParser = require('body-parser')
, mongoose = require('mongoose')
, cors = require('./cors')
, app = express();
require('./models/click');
var Click = mongoose.model('Click');
mongoose.connect('mongodb://localhost/heatmap');
app.use(bodyParser.urlencoded({e... | 'use strict';
var express = require('express')
, bodyParser = require('body-parser')
, mongoose = require('mongoose')
, cors = require('./cors')
, app = express();
require('./models/click');
var Click = mongoose.model('Click');
mongoose.connect('mongodb://localhost/heatmap');
app.use(bodyParser.urlencoded({e... | Add route to list all clicks on a page | Add route to list all clicks on a page
| JavaScript | mit | rodrigoalviani/heatmap |
0412f8829990f6b8837ba1c914bb2b7e8b17a55e | server.js | server.js | 'use strict'
var express = require('express')
var app = express()
var bodyParser = require('body-parser')
var path = require('path')
var listen
app
.use(bodyParser.urlencoded({ extended: true }))
.use(express.static('./dist'))
.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'index.html'))
})
... | 'use strict'
var express = require('express')
var app = express()
var bodyParser = require('body-parser')
var path = require('path')
var PORT = process.env.PORT || 8000
var HOST = process.env.HOST || 'localhost'
app
.use(bodyParser.urlencoded({ extended: true }))
.use(express.static('./dist'))
.get('/', function (... | Fix issue with express listen method | [master] Fix issue with express listen method
| JavaScript | isc | qmmr/react-movies,qmmr/react-movies |
a969e065f8a76a4dcb8e7ce7aca6bdcbe2382386 | app/routes/application.js | app/routes/application.js | import Ember from 'ember';
import Solr from '../mixins/solr';
export default Ember.Route.extend(Solr, {
intl: Ember.inject.service(),
model() {
return this.loadAllLettersInVolume();
},
beforeModel() {
// define the app's runtime locale
// For example, here you would maybe do an API lookup to resolv... | import Ember from 'ember';
import Solr from '../mixins/solr';
export default Ember.Route.extend(Solr, {
intl: Ember.inject.service(),
model() {
return this.loadAllLettersInVolume();
},
beforeModel() {
// define the app's runtime locale
// For example, here you would maybe do an API lookup to resolv... | Sort letters by series, volume, number | Sort letters by series, volume, number
Resolves: ADWD-2212
| JavaScript | agpl-3.0 | subugoe/leibniz-frontend,subugoe/leibniz-frontend |
8da1ae115cc409d1752e7756be6296d97e2729c6 | js/script.js | js/script.js | window.onload=function(){
var theNumber = _.random(1, 100);
var theList = $("#list");
var theBanner = $("#triumph");
$("#submit").click(function() {
var theGuess = $("#guess").val();
$("#guess").val("");
if (theGuess == theNumber) {
$("#submit").prop('disabled', true);
$("#guess").prop('disabled', true)... | window.onload = function() {
var theNumber = _.random(1, 100);
var theList = $('#list');
var theBanner = $('#triumph');
$('#submit').click(function() {
var theGuess = $('#guess').val();
$('#guess').val('');
if (theGuess == theNumber) {
$('#submit').prop('disabled', true);
$('#guess').pr... | Format code; prefer single quotes | Format code; prefer single quotes
| JavaScript | mit | tdreid/Guezzmo,tdreid/Guezzmo |
8b49d9e2a94c1c8bf36d2ff206ef68acf5a62936 | lib/agent.js | lib/agent.js |
/**
* Module dependencies.
*/
var Agent = require('superagent').agent
, methods = require('methods')
, http = require('http')
, Test = require('./test');
/**
* Expose `Agent`.
*/
module.exports = TestAgent;
/**
* Initialize a new `TestAgent`.
*
* @param {Function|Server} app
* @api public
*/
functi... |
/**
* Module dependencies.
*/
var Agent = require('superagent').agent
, methods = require('methods')
, http = require('http')
, Test = require('./test');
/**
* Expose `Agent`.
*/
module.exports = TestAgent;
/**
* Initialize a new `TestAgent`.
*
* @param {Function|Server} app
* @param {Object} options... | Allow TestAgent pass a CA to request | Allow TestAgent pass a CA to request
| JavaScript | mit | olivier-work/supertest,kuychaco/supertest,kevinawoo/supertest,brigand/supertest,antoval/supertest,homeopatchy/supertest,Floby/megatest,visionmedia/supertest,Rob--W/supertest,sam-roth/supertest,drinks/supertest,olivierrr/supertest |
f22a68298fa0196e0607b3c269eef81967d7c2fa | launcher/electron/app/backend-runner.js | launcher/electron/app/backend-runner.js | module.exports = (function() {
var path = require('path');
// var java_home = path.resolve(__dirname + '/../jre/Contents/Home');
// var java_home = path.resolve(__dirname + '/../jre');
var ReadLine = require('readline');
var spawn = require('child_process').spawn;
var events = require('events');
var os = requi... | module.exports = (function() {
var path = require('path');
var ReadLine = require('readline');
var spawn = require('child_process').spawn;
var events = require('events');
var os = require('os');
return {
startNew: function() {
var url;
var hash;
var eventEmitter = new events.EventEmitter();
var ... | Set java_home correctly for each OS | Set java_home correctly for each OS
| JavaScript | apache-2.0 | sirinath/beaker-notebook,codeaudit/beaker-notebook,ScottPJones/beaker-notebook,codeaudit/beaker-notebook,Chasego/beaker-notebook,Chasego/beaker-notebook,vital-ai/beaker-notebook,brosander/beaker-notebook,gef756/beaker-notebook,vital-ai/beaker-notebook,Chasego/beaker-notebook,codeaudit/beaker-notebook,Chasego/beaker-not... |
28c07e09edeaab9a055687815901c637eacf83ed | resources/node_modules/git.js | resources/node_modules/git.js | var chp = require('child_process');
var Git = {
stageFile: function(modulePath, file, callback) {
if (file.status === 'deleted') {
this._exec(modulePath, 'rm', [file.name], callback);
} else {
if (file.type === 'submodule') this.exec(modulePath, 'submodule add', [file.name], callback);
else this._exec(mo... | var chp = require('child_process');
var Git = {
stageFile: function(modulePath, file, callback) {
if (file.status === 'deleted') {
this._exec(modulePath, 'rm', [file.name], callback);
} else {
if (file.type === 'submodule') this._exec(modulePath, 'submodule add', ['.' + require('path').sep + file.name], ca... | Fix typo and file path | Fix typo and file path
| JavaScript | mit | demian85/git-watcher,demian85/git-watcher,demian85/git-watcher |
875729be0e0287add0c5de8b4bd52b2f54080daa | lib/index.js | lib/index.js | /* Ubivar API client factory
* @token [String] required bearer-token from admin interface
* @version [String] optional, default to 'latest'
*/
module.exports = function(token, version, resources){
var _ = require("lodash")
var Ubivar = require("./Ubivar")
resources = resources || [
"me"... | /* Ubivar API client factory
* @token [String] required bearer-token from admin interface
* @version [String] optional, default to 'latest'
*/
module.exports = function(token, version, resources){
var _ = require("lodash")
var Ubivar = require("./Ubivar")
resources = resources || [
"me"... | Remove review* as resources from ubivar-node binding | Remove review* as resources from ubivar-node binding
| JavaScript | mit | ubivar/ubivar-node |
4774a4612d97d1b800f8ea9daf8a2266df2f635e | lib/index.js | lib/index.js | var _ = require('lodash'),
StylusIncludesPlugin = require('./plugins/stylus-includes');
module.exports.config = function(additions) {
var options = additions.stylus || {},
defines = options.defines || {};
return _.defaults({
module: _.defaults({
loaders: loaders(defines, additions.module && ad... | var _ = require('lodash'),
StylusIncludesPlugin = require('./plugins/stylus-includes');
module.exports.config = function(additions) {
var options = additions.stylus || {},
defines = options.defines || {};
return _.defaults({
module: _.defaults({
loaders: loaders(defines, additions.module && ad... | Resolve urls embedded in stylus sheets | Resolve urls embedded in stylus sheets | JavaScript | mit | walmartlabs/circus-stylus |
922182c93e94c3b10e4d337df8b9737451bd07b7 | examples/backbone/js/app.js | examples/backbone/js/app.js | $(function() {
var CustomersView, CustomerRowView, CustomerModel, CustomerCollection;
CustomerModel = Backbone.Model.extend({});
CustomerCollection = Backbone.Collection.extend({
model: CustomerModel,
url: 'customers.json'
});
CustomersView = Backbone.View.extend({
events: {
'submit .new-... | $(function() {
var CustomersView, CustomerRowView, CustomerModel, CustomerCollection;
CustomerModel = Backbone.Model.extend({});
CustomerCollection = Backbone.Collection.extend({
model: CustomerModel,
url: 'customers.json'
});
CustomersView = Backbone.View.extend({
events: {
'submit .new-... | Remove global reference to customers. | Remove global reference to customers.
| JavaScript | mit | leonidas/transparency,phcomputer/template,cravelight/transparency,laomu1988/transparency,chorks/transparency,chorks/transparency,phcomputer/template,cravelight/transparency,leonidas/transparency,laomu1988/transparency |
a3c1a6c56e5ed40453ee59bb53414d555e2c399c | lib/local.js | lib/local.js | var path = require('path'),
glob = require('glob');
module.exports = function (url, file, done) {
// if url starts with . or / then assume it's a local/relative path
if (['.', '/'].indexOf(url.substr(0, 1)) > -1) {
return done(null, true);
}
// otherwise construct a glob to match possible... | var path = require('path'),
glob = require('glob');
module.exports = function (url, file, done) {
// if url starts with . or / then assume it's a local/relative path
if (['.', path.sep].indexOf(url.substr(0, 1)) > -1) {
return done(null, true);
}
// otherwise construct a glob to match pos... | Replace references to '/' with `path.sep` | Replace references to '/' with `path.sep`
| JavaScript | mit | lennym/npm-sass |
c9a11ddd8211718ae054004b08698f932cfe7fbc | controller.js | controller.js | var Controller = function() {
this.pac = new Actor({
context: actorCanvas.context,
startX: 113,
startY: 212,
name: "m",
direction: "right"
});
this.blinky = new Ghost({
context: actorCanvas.context,
direction: "left",
name: "b",
startX: 112,
startY: 116
});
this.inky = ... | var Controller = function(args) {
this.actorCanvas = args.actorCanvas;
this.pac = new Actor({
context: this.actorCanvas.context,
startX: 113,
startY: 212,
name: "m",
direction: "right"
});
this.blinky = new Ghost({
context: this.actorCanvas.context,
direction: "left",
name: "b",
... | Update Controller to accept args | Update Controller to accept args
| JavaScript | mit | peternatewood/pac-man-replica,peternatewood/pac-man-replica |
309f1bd80a5f732ac83d706505fc978d91b881fb | test/ringo/subprocess_test.js | test/ringo/subprocess_test.js | var assert = require('assert');
var subprocess = require('ringo/subprocess');
var fs = require('fs');
const RINGO_HOME = system.prefix;
function isWindows() /win/i.test(java.lang.System.getProperty('os.name'));
exports.testCwdSensibleness = function () {
fs.changeWorkingDirectory(RINGO_HOME);
var cmd = isWi... | var assert = require('assert');
var subprocess = require('ringo/subprocess');
var fs = require('fs');
const RINGO_HOME = system.prefix;
function isWindows() /win/i.test(java.lang.System.getProperty('os.name'));
exports.testCwdSensibleness = function () {
fs.changeWorkingDirectory(RINGO_HOME);
var cmd = isWi... | Make `ringo/subprocess` test actually work & pass as expected on Windows. | Make `ringo/subprocess` test actually work & pass
as expected on Windows. | JavaScript | apache-2.0 | ashwinrayaprolu1984/ringojs,oberhamsi/ringojs,ringo/ringojs,ringo/ringojs,Transcordia/ringojs,oberhamsi/ringojs,ringo/ringojs,Transcordia/ringojs,ashwinrayaprolu1984/ringojs,ringo/ringojs,ashwinrayaprolu1984/ringojs,Transcordia/ringojs,ashwinrayaprolu1984/ringojs,Transcordia/ringojs,oberhamsi/ringojs |
35ba06b542615d038a89fe7159597a07e90b939f | tools/builders/builder.svg.js | tools/builders/builder.svg.js | var _ = require('lodash'),
combine = require('stream-combiner'),
loadGulpPlugins = require('gulp-load-plugins');
module.exports = function buildSVG(options) {
var gulpPlugins = loadGulpPlugins();
options = _.defaults({}, options, {
doMinify: false,
concatName: 'override_me.svg',
svgStoreOpti... | var _ = require('lodash'),
combine = require('stream-combiner'),
loadGulpPlugins = require('gulp-load-plugins');
module.exports = function buildSVG(options) {
var gulpPlugins = loadGulpPlugins();
options = _.defaults({}, options, {
doProcessing: true,
doMinify: false,
concatName: 'override_me... | Make processing option in SVG builder | Make processing option in SVG builder
| JavaScript | bsd-2-clause | imgix/web-tools |
31e7b8bb48546efcc05bebd4f24f0405b9eeb5ea | tools/cli/default-npm-deps.js | tools/cli/default-npm-deps.js | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
} from "../fs/files.js";
const INSTALL_JOB_MESSAGE = "installing dependencies from package.json";
export function install(appDir) {
const testAppPkgJsonPath = pathJoin(appDir, "package.json");
if (! statOrNull(te... | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
unlink,
} from "../fs/files.js";
const INSTALL_JOB_MESSAGE = "installing dependencies from package.json";
export function install(appDir) {
const packageJsonPath = pathJoin(appDir, "package.json");
const needTem... | Clean up temporary package.json files. | Clean up temporary package.json files.
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,mjmasn/meteor,mjmasn/meteor,mjmasn/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,mjmasn/meteor,Hansoft/meteor,mjmasn/meteor,mjmasn/meteor,mjmasn/meteor,Hansoft/meteor |
7c1a6d7621bc3633ba2dff2cc773b87dc5fcf3a6 | feature-detects/css/shapes.js | feature-detects/css/shapes.js | /*!
{
"name": "CSS Shapes",
"property": "shapes",
"tags": ["css"],
"notes": [{
"name": "CSS Shapes W3C specification",
"href": "http://www.w3.org/TR/css-shapes"
},{
"name": "Examples from Adobe",
"href": "http://html.adobe.com/webplatform/layout/shapes"
}, {
"name": "Samples showcasing u... | /*!
{
"name": "CSS Shapes",
"property": "shapes",
"tags": ["css"],
"notes": [{
"name": "CSS Shapes W3C specification",
"href": "http://www.w3.org/TR/css-shapes"
},{
"name": "Examples from Adobe",
"href": "http://html.adobe.com/webplatform/layout/shapes"
}, {
"name": "Samples showcasing u... | Modify CSS Exclusions to CSS Shapes, since we split up the specification. Update references. | Modify CSS Exclusions to CSS Shapes, since we split up the specification. Update references.
| JavaScript | mit | Modernizr/Modernizr,Modernizr/Modernizr |
0b95428c5c9e1121af7e90bb55b4daade31abac1 | chrome/test/data/extensions/management/launch_app/test.js | chrome/test/data/extensions/management/launch_app/test.js | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
window.onload = function() {
chrome.management.getAll(function(items) {
for (var i in items) {
var item = items[i];
if (item.name ==... | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
window.onload = function() {
chrome.management.getAll(function(items) {
for (var i in items) {
var item = items[i];
if (item.name ==... | Fix ExtensionManagementApiBrowserTest.LaunchApp to no longer be order-dependent. | Fix ExtensionManagementApiBrowserTest.LaunchApp to no longer be order-dependent.
With the break, it fails if the app happens to come before the extension in items.
BUG=104091
TEST=none
TBR=asargent@chromium.org
Review URL: http://codereview.chromium.org/8801037
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@1... | JavaScript | bsd-3-clause | Chilledheart/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,anirudhSK/chromium,dednal/chromium.src,markYoungH/chromium.src,rogerwang/chromium,jaruba/chromium.src,ltilve/chromium,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,rogerwang/chromium,patrickm/chromium.src,bright-sparks/chromium-spacewalk,aniru... |
4c372062811d7ac006a92a0b5f38d4dd748458aa | js/util/undo.js | js/util/undo.js | (function(Fontclod) {
"use strict";
function Undo(options) {
this.index = options.index || 0;
this.stack = options.stack || [];
this._data = options.data || {};
}
// Undo.step(1) Undo.step(-10)
Undo.prototype.step = function(n) {};
// Undo.seek(index)
Undo.prototype.seek = function(i) {};
Undo.prototy... | (function(Fontclod) {
"use strict";
function Undo(options) {
options = options || {};
this.stack = options.stack || [];
this._index = options.index || 0;
this._data = options.data || {};
}
// Undo.step(1) Undo.step(-10)
Undo.prototype.step = function(n) {
this._index = Math.max(0, Math.min(this._ind... | Fix undefined errors when constructing Undo() with no arguments | Fix undefined errors when constructing Undo() with no arguments
| JavaScript | mpl-2.0 | fontclod/fontclod,fontclod/fontclod |
5b4432044907e23c54c4394ebe75c0d70b46828c | vendor/assets/javascripts/src/liteajax.js | vendor/assets/javascripts/src/liteajax.js | var LiteAjax = (function () {
var LiteAjax = {};
LiteAjax.options = {
method: 'GET',
url: window.location.href,
async: true,
};
LiteAjax.ajax = function (url, options) {
if (typeof url == 'object') {
options = url;
url = undefined;
}
options = options || {};
url = url ... | var LiteAjax = (function () {
var LiteAjax = {};
LiteAjax.options = {
method: 'GET',
url: window.location.href,
async: true,
};
LiteAjax.ajax = function (url, options) {
if (typeof url == 'object') {
options = url;
url = undefined;
}
options = options || {};
url = url ... | Call eval(), if server returns javascript | Call eval(), if server returns javascript
| JavaScript | mit | kirushik/vanilla-ujs,Ximik/vanilla-ujs |
54c09ec285813109c7d1f817edb995435da4bff3 | app/assets/javascripts/application.js | app/assets/javascripts/application.js | //= require govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind
//= require govuk_publishing_components/lib
//= require govuk_publishing_components/components/accordion
//= require govuk_publishing_components/components/button
//= require govuk_publishing_components/components/details
//= require govuk_publi... | //= require govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind
//= require govuk_publishing_components/lib
//= require govuk_publishing_components/components/accordion
//= require govuk_publishing_components/components/button
//= require govuk_publishing_components/components/details
//= require govuk_publi... | Remove import of non-existent JS | Remove import of non-existent JS
The intervention banner Javascript was removed in the publishing components gem as that was no longer needed.
| JavaScript | mit | alphagov/collections,alphagov/collections,alphagov/collections,alphagov/collections |
945390deae59f7ccee954a8090e27c26d7d84fdb | command-line-interface.js | command-line-interface.js | #!/usr/bin/env node
var generateInvoice = require('./')
var JSONStream = require('JSONStream')
if (process.argv.length < 4) {
console.error('Usage: <from> <to>');
process.exit(1) }
var from = Date.parse(process.argv[2])
var through = Date.parse(process.argv[3])
var projects = []
process.stdin
.pipe(JSONStream... | #!/usr/bin/env node
var markdownBill = require('./')
var JSONStream = require('JSONStream')
if (process.argv.length < 4) {
console.error('Usage: <from> <to>');
process.exit(1) }
var from = Date.parse(process.argv[2])
var through = Date.parse(process.argv[3])
var projects = []
process.stdin
.pipe(JSONStream.pa... | Update function name in CLI | Update function name in CLI
| JavaScript | apache-2.0 | kemitchell/generate-invoice.js |
9d6ed012816d5e7e49e23e0c0b4c8ad490ed1789 | components/label/Label.js | components/label/Label.js | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { TextBody, TextDisplay } from '../typography';
import theme from './theme.css';
export default class Label extends PureComponent {
static propTypes = {
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, Pro... | import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { TextBody, TextDisplay } from '../typography';
import theme from './theme.css';
import cx from "classnames";
export default class Label extends PureComponent {
static propTypes = {
children: PropTypes.oneOfType([PropTypes.e... | Implement 'inverse' prop and remove obsolete styling | Implement 'inverse' prop and remove obsolete styling
| JavaScript | mit | teamleadercrm/teamleader-ui |
a925cb1d66bfd8dda1384cebf2f0480126d4229f | web/js/global/lastFMSearch.js | web/js/global/lastFMSearch.js | /**
* Created by sylva on 30/05/2017.
*/
$(document).ready(function () {
$('#lastFMSearch').autocomplete({
source: function( request, response ) {
$.ajax({
url: "https://ws.audioscrobbler.com/2.0/?method=artist.search&artist="+$('#lastFMSearch').val()+"&api_key=f6734ae2b988748... | /**
* Created by sylva on 30/05/2017.
*/
$(document).ready(function () {
$('#lastFMSearch').autocomplete({
source: function( request, response ) {
$.ajax({
url: "https://ws.audioscrobbler.com/2.0/?method=artist.search&artist="+$('#lastFMSearch').val()+"&api_key=f6734ae2b988748... | ADD auto submit after select search | ADD auto submit after select search
| JavaScript | mit | Candylight/Spotzer,Candylight/Spotzer,Candylight/Spotzer |
101413f97410d8a30b17e30dd8d21a5a04c459ab | routes/index.js | routes/index.js | const express = require('express');
const router = express.Router();
const Media = require('../lib/models/media');
const decorate = require('../lib/decorate/index');
const render = require('../lib/push/render');
const tmdbApi = require('moviedb');
/* GET home page. */
router.get('/', (req, res, next) => {
const opt... | const express = require('express');
const router = express.Router();
const Media = require('../lib/models/media');
const decorate = require('../lib/decorate/index');
const render = require('../lib/push/render');
const tmdbApi = require('moviedb');
router.get('/', (req, res, next) => {
const opts = {
baseUrl: pr... | Add 'period' query param to news page | Add 'period' query param to news page
| JavaScript | mit | dbrugne/ftp-nanny,dbrugne/ftp-nanny |
166f80cbfb9a5bac9fe19822d738c817d2872188 | lib/autoload/service_search.js | lib/autoload/service_search.js | // Launch search daemon if needed, send config to it
//
'use strict';
const _ = require('lodash');
const cluster = require('cluster');
const path = require('path');
const Server = require('nodeca.search/lib/server');
module.exports = function (N) {
let server;
N.wire.after('init:models', function* s... | // Launch search daemon if needed, send config to it
//
'use strict';
const _ = require('lodash');
const cluster = require('cluster');
const path = require('path');
const Server = require('nodeca.search/lib/server');
module.exports = function (N) {
let server;
N.wire.before('init:services', function... | Change proxy init priority (avoid conflict with assets rebuild) | Change proxy init priority (avoid conflict with assets rebuild)
| JavaScript | mit | nodeca/nodeca.search |
2124878208cfa7666b4710140d7566039d710204 | packages/components/containers/account/UsernameSection.js | packages/components/containers/account/UsernameSection.js | import React from 'react';
import { c } from 'ttag';
import { SubTitle, Label, Row, Field, Alert, useUser } from 'react-components';
import { Link } from 'react-router-dom';
const UsernameSection = () => {
const [{ Name }] = useUser();
const link = <Link key="linkIdentity" to="/settings/identity">{c('Link').t`... | import React from 'react';
import { c } from 'ttag';
import { SubTitle, Label, Row, Field, useUser } from 'react-components';
const UsernameSection = () => {
const [{ Name }] = useUser();
return (
<>
<SubTitle>{c('Title').t`Username`}</SubTitle>
<Row>
<Label>{c(... | Remove Alert since this section is used in ProtonVPN also | Remove Alert since this section is used in ProtonVPN also
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
dcc6135da37cf56c65c72f61f4342461ee28c51f | packages/components/containers/account/UsernameSection.js | packages/components/containers/account/UsernameSection.js | import React from 'react';
import { c } from 'ttag';
import { SubTitle, Label, Row, Field, useUser } from 'react-components';
const UsernameSection = () => {
const [{ Name }] = useUser();
return (
<>
<SubTitle>{c('Title').t`Username`}</SubTitle>
<Row>
<Label>{c(... | import React from 'react';
import { c } from 'ttag';
import { SubTitle, Label, Row, Field, Href, Loader, useUser, useAddresses, useConfig } from 'react-components';
import { CLIENT_TYPES } from 'proton-shared/lib/constants';
const { VPN } = CLIENT_TYPES;
const UsernameSection = () => {
const [{ Name }] = useUser(... | Allow user to activate his ProtonMail address | Allow user to activate his ProtonMail address
Fix https://github.com/ProtonMail/proton-vpn-settings/issues/86
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
c40626baab7e7ab419986164c7d26cd96fea9809 | config/marked-renderer.js | config/marked-renderer.js | 'use strict';
/**
* Provides a custom marked renderer.
* @param {Marked} marked - The marked application.
* @returns {Marked.Renderer} The customized marked renderer.
*/
function markedRenderer( marked ) {
// Get the original renderer.
var renderer = new marked.Renderer();
/**
* Overwrite link rendering... | 'use strict';
/**
* Provides a custom marked renderer.
* @param {Marked} marked - The marked application.
* @returns {Marked.Renderer} The customized marked renderer.
*/
function markedRenderer( marked ) {
// Get the original renderer.
var renderer = new marked.Renderer();
/**
* Overwrite link rendering... | Fix a bug in renderer. | Fix a bug in renderer.
| JavaScript | mit | logikum/md-web-site,logikum/md-web-site |
38cb5ec2d037626fab93aca2d6400eb950a2bec6 | config/webpack.loaders.js | config/webpack.loaders.js | module.exports = [
{
test: /\.svg$/,
loader: 'svg-sprite',
exclude: /fonts/,
},{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=60000&mimetype=application/font-woff',
},{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loa... | module.exports = [
{
test: /\.svg$/,
loader: 'svg-sprite',
exclude: /fonts/,
},{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=60000&mimetype=application/font-woff',
},{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loa... | Make css loader rule work on *all* css files. | fix(Loaders): Make css loader rule work on *all* css files.
| JavaScript | bsd-3-clause | Kitware/paraviewweb,Kitware/paraviewweb,Kitware/paraviewweb,Kitware/paraviewweb |
2edad66ef860f9bcfa05dd87da7b311566e8ab5f | core/mocha/test_runner.js | core/mocha/test_runner.js | 'use strict';
const fs = require('fs');
const path = require('path');
class TestRunner {
constructor(dir, router) {
this.dir = dir;
this.router = router;
}
tests() {
let tests = [];
let filter;
if (process.argv.length > 3) {
filter = process.argv[3];
filter = filter.endsWit... | 'use strict';
const fs = require('fs');
const path = require('path');
class TestRunner {
constructor(dir, router) {
this.dir = dir;
this.router = router;
}
tests() {
let tests = [];
// Strip mocha and node flags out before looking for filter
let filter = process.argv.filter(str => !str.... | Add support for passing flags to Mocha | Add support for passing flags to Mocha
Update argv parsing to ignore flags passed to mocha. Without
this, enabling the Node.js debugger breaks Nodal's testing
framework.
| JavaScript | mit | keithwhor/nodal |
590fdc68874066a80d78a7768c16c3c3d0593f76 | scripts/land.js | scripts/land.js | function Land()
{
this.width = 100;
this.height = 100;
this.fillStyle = "#00d23e"; // green
this.x = 200;
this.y = 100;
this.drawWaves = true;
this.waves = [];
this.waveCycle = 0;
}
Land.prototype.draw = ... | function Land()
{
this.width = 100;
this.height = 100;
this.fillStyle = "#00d23e"; // green
this.x = 200;
this.y = 100;
this.drawWaves = true;
this.waves = [];
this.waveCycle = 0;
}
Land.prototype.draw = ... | Stop drawing wave at inverse of opacityStep | Stop drawing wave at inverse of opacityStep
So if opacity decreases by 0.001 each frame, then stop drawing after
1000 frames.
| JavaScript | mit | cfurrow/Pixel-Waves |
66a092b30da374b60abe1989359379fbf4a86dc0 | simpleshelfmobile/_attachments/code/models/GlobalCount.js | simpleshelfmobile/_attachments/code/models/GlobalCount.js | "use strict";
/**
* Get count of database-wide values.
**/
define([
"underscore",
"underscore.string",
"backbone"
], function(_, _s, Backbone) {
var GlobalCountModel = Backbone.Model.extend({
url: function() {
return "_view/global?group=true";
},
/**
* Pa... | "use strict";
/**
* Get count of database-wide values.
**/
define([
"underscore",
"underscore.string",
"backbone"
], function(_, _s, Backbone) {
var GlobalCountModel = Backbone.Model.extend({
url: function() {
return "_view/global?group=true";
},
/**
* Pa... | Add helper function to format numbers. | Add helper function to format numbers.
| JavaScript | agpl-3.0 | tephyr/simpleshelf,tephyr/simpleshelf,tephyr/simpleshelf,tephyr/simpleshelf |
6d261bf1e28e4548522f862d2fe4daaf80992980 | tests/unit/components/markdown-to-html-test.js | tests/unit/components/markdown-to-html-test.js | import {
moduleForComponent,
test
} from 'ember-qunit';
import Ember from 'ember';
moduleForComponent('markdown-to-html', 'MarkdownToHtmlComponent', {
// specify the other units that are required for this test
needs: ['component:markdown-to-html']
});
test('it renders', function() {
expect(2);
// create... | import {
moduleForComponent,
test
} from 'ember-qunit';
import Ember from 'ember';
moduleForComponent('markdown-to-html', 'MarkdownToHtmlComponent', {
// specify the other units that are required for this test
needs: ['component:markdown-to-html']
});
test('it renders', function() {
expect(2);
// create... | Add test to verify it inserts <br> tag on new lines. | Add test to verify it inserts <br> tag on new lines.
| JavaScript | mit | nikz/ember-cli-showdown,dylanfoster/ember-cli-showdown,gcollazo/ember-cli-showdown,dylanfoster/ember-cli-showdown,gcollazo/ember-cli-showdown,nikz/ember-cli-showdown |
6ff1a6ff0a48fbea688d027d5bb83cf3a7c4830b | app/sockets/StartTimelineUpdate.js | app/sockets/StartTimelineUpdate.js | /**
* Serve automatic timeline updates.
*/
define([], function() {
'use strict';
return function(socket) {
var redis = null;
/**
* Client seeds the update stream with the last-seen ID/time.
*
* @param options {Object} Last-seen attributes.
* - newestEventId {String}
* - newest... | /**
* Serve automatic timeline updates.
*/
define([], function() {
'use strict';
return function(socket) {
var redis = null;
/**
* Client seeds the update stream with the last-seen ID/time.
*
* @param options {Object} Last-seen attributes.
* - newestEventId {String}
* - newest... | Fix socket.io disconnect handler TypeError. | Fix socket.io disconnect handler TypeError.
Handler assumed redis wrapper was always init'd before disconnection.
* TypeError: Cannot read property 'client' of null
| JavaScript | mit | codeactual/mainevent |
2446e832018b51d1ffd23333d5125d2cd1e56fed | public/scripts/app/helpers/UserWreqr.js | public/scripts/app/helpers/UserWreqr.js | define([
"jquery",
"underscore",
"parse",
"backbone"
], function( $, _, Parse, Backbone ) {
var userChannel = Backbone.Wreqr.radio.channel('user');
Backbone.Wreqr.radio.reqres.setHandler("user", "testing", function(id) {
return "deez" + id;
});
console.log(userChannel.reqres.r... | define([
"jquery",
"underscore",
"parse",
"backbone",
"marionette"
], function( $, _, Parse, Backbone, Marionette ) {
var userChannel = Backbone.Wreqr.radio.channel('user');
Backbone.Wreqr.radio.reqres.setHandler("user", "testing", function(id) {
return "deez" + id;
});
co... | Fix radio load order problems | Fix radio load order problems
| JavaScript | agpl-3.0 | gnu-lorien/twistedvines,gnu-lorien/yorick,gnu-lorien/yorick,gnu-lorien/twistedvines,gnu-lorien/yorick,gnu-lorien/yorick,gnu-lorien/twistedvines |
db565d6dfb6d5165582fb9a0bd39c28caab29b9c | client/views/activity/new/autoform.js | client/views/activity/new/autoform.js | AutoForm.addHooks(['newActivityForm'], {
'onSuccess': function () {
// Hide the modal dialogue
Modal.hide('newActivity');
// Alert user that activity was added
FlashMessages.sendSuccess('<i class="fa fa-check"></i> Activity added!');
}
});
| AutoForm.addHooks(['newActivityForm'], {
'onSuccess': function () {
// Hide the modal dialogue
Modal.hide('newActivity');
const successMessage = TAPi18n.__("newActivity-success");
const successMessageWithIcon = '<i class="fa fa-check"></i> ' + successMessage
// Alert user that activity was adde... | Add i18n string to success message | Add i18n string to success message
| JavaScript | agpl-3.0 | brylie/juhani-wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,GeriLife/wellbeing,brylie/juhani-wellbeing |
40f726c0357b019ddcd752660e94c4c79fde8040 | app/ui/browser-modern/sagas/helpers.js | app/ui/browser-modern/sagas/helpers.js | /*
Copyright 2016 Mozilla
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 in writing, software distributed
u... | /*
Copyright 2016 Mozilla
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 in writing, software distributed
u... | Make the `wrapped` sagas utility function properly handle a more varied set of patterns | Make the `wrapped` sagas utility function properly handle a more varied set of patterns
Signed-off-by: Victor Porof <7d8eebacd0931807085fa6b9af29638ed74e0886@mozilla.com>
| JavaScript | apache-2.0 | bgrins/tofino,jsantell/tofino,jsantell/tofino,bgrins/tofino,mozilla/tofino,jsantell/tofino,mozilla/tofino,bgrins/tofino,jsantell/tofino,mozilla/tofino,victorporof/tofino,victorporof/tofino,bgrins/tofino,mozilla/tofino |
c7ff329f61fd726e95b9e21a3c1bd2a20f384fe3 | packages/@sanity/server/src/configs/webpack.config.dev.js | packages/@sanity/server/src/configs/webpack.config.dev.js | import webpack from 'webpack'
import getBaseConfig from './webpack.config'
export default config => {
const baseConfig = getBaseConfig(config)
return Object.assign({}, baseConfig, {
devtool: 'cheap-module-eval-source-map',
entry: [
'eventsource-polyfill',
'webpack-hot-middleware/client'
].... | import webpack from 'webpack'
import getBaseConfig from './webpack.config'
export default config => {
const baseConfig = getBaseConfig(config)
return Object.assign({}, baseConfig, {
devtool: 'cheap-module-eval-source-map',
entry: [
require.resolve('eventsource-polyfill'),
require.resolve('webp... | Use full paths to webpack entries | Use full paths to webpack entries
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity |
a8157b4e329f925fae1a6fa07bcc90e13c374d29 | packages/list/ListComponent.js | packages/list/ListComponent.js | 'use strict';
var Component = require('../../ui/Component');
var $$ = Component.$$;
var ListHtmlConverter = require('./ListHTMLConverter');
var ListItemComponent = require('./ListItemComponent');
var ListComponent = Component.extend({
displayName: "ListComponent",
initialize: function() {
this.doc = this.pr... | 'use strict';
var Component = require('../../ui/Component');
var $$ = Component.$$;
var ListHtmlConverter = require('./ListHTMLConverter');
var ListItemComponent = require('./ListItemComponent');
var ListComponent = Component.extend({
displayName: "ListComponent",
initialize: function() {
this.doc = this.pr... | Move the list class to the div | Move the list class to the div
| JavaScript | mit | abhaga/substance,abhaga/substance |
e769a6cfad2db78c764b03ee78daa9f437d2d629 | src/createValidation.js | src/createValidation.js | /* @flow */
import {
Either,
} from './utils/'
import {
curry,
compose,
map,
prop,
mergeWithKey,
sequence,
} from 'ramda'
const { Right, Left } = Either
const identity = r => r
const makePredicate = ([predFn, e]) => (a, all) => predFn(a, all) ? Right(a) : Left(e)
const runPredicates = ([input, validat... | /* @flow */
import {
Either,
} from './utils/'
import {
curry,
compose,
map,
prop,
merge,
mergeWithKey,
sequence,
} from 'ramda'
const { Right, Left } = Either
const identity = r => r
// create a new object containing an empty array
// createDefaultValidation({'name': '1', 'random': '2'})
// outputs:... | Update validation handling to work with missing data | Update validation handling to work with missing data
| JavaScript | mit | 25th-floor/revalidation,25th-floor/revalidation |
0a7f0ae56f162c9443202f28610071833fb17e21 | Support/resource/rb_gateway.js | Support/resource/rb_gateway.js | /* Git JS gateway */
/* Tim Harper (tim.harper at leadmediapartners.org) */
function e_sh(str) {
return '"' + (str.toString().gsub('"', '\\"')) + '"';
}
function exec(command, params) {
params = params.map(function(a) { return e_sh(a) }).join(" ")
return TextMate.system(command + " " + params, null)
}
funct... | /* Git JS gateway */
/* Tim Harper (tim.harper at leadmediapartners.org) */
function e_sh(str) {
return '"' + (str.toString().gsub('"', '\\"')) + '"';
}
function exec(command, params) {
params = params.map(function(a) { return e_sh(a) }).join(" ")
return TextMate.system(command + " " + params, null)
}
funct... | Use TM_BUNDLE_SUPPORT over the deprecated TM_BUNDLE_PATH variable. | Use TM_BUNDLE_SUPPORT over the deprecated TM_BUNDLE_PATH variable.
| JavaScript | mit | textmate/git.tmbundle,jacob-carlborg/git.tmbundle,textmate/git.tmbundle,prymatex/git.tmbundle,pkmiec/git.tmbundle,jcf/git-tmbundle,kevinsawicki/git.tmbundle,prymatex/git.tmbundle,prymatex/git.tmbundle,pkmiec/git.tmbundle,textmate/git.tmbundle,jacob-carlborg/git.tmbundle,pkmiec/git.tmbundle,timcharper/git-tmbundle,pryma... |
fc30cb5f6e23797ff78bc7ff56e218ad432b0e91 | src/commands.js | src/commands.js | import EventEmitter from 'eventemitter3'
import Mousetrap from 'mousetrap'
import dragDrop from 'drag-drop'
class Commands extends EventEmitter {
constructor() {
super()
this._initKeybind()
this._initDragDrop()
}
_initKeybind() {
Mousetrap.bind('esc', () => {
this.emit('reset-canvas')
return false
... | import EventEmitter from 'eventemitter3'
import Mousetrap from 'mousetrap'
import dragDrop from 'drag-drop'
class Commands extends EventEmitter {
constructor() {
super()
this._initKeybind()
this._initDragDrop()
}
_initKeybind() {
Mousetrap.bind('esc', () => {
this.emit('reset-canvas')
return false
... | Update regex of image source | Update regex of image source
| JavaScript | mit | baku89/feedback-displacement,baku89/feedback-displacement |
b78a5d619c86bb2ab1515b4ec7a50aa605b7345f | lib/post_install.js | lib/post_install.js | #!/usr/bin/env node
// adapted based on rackt/history (MIT)
var execSync = require('child_process').execSync;
var stat = require('fs').stat;
function exec(command) {
execSync(command, {
stdio: [0, 1, 2]
});
}
stat('dist-modules', function(error, stat) {
if (error || !stat.isDirectory()) {
exec('npm run ... | #!/usr/bin/env node
// adapted based on rackt/history (MIT)
var execSync = require('child_process').execSync;
var stat = require('fs').stat;
function exec(command) {
execSync(command, {
stdio: [0, 1, 2]
});
}
stat('dist-modules', function(error, stat) {
if (error || !stat.isDirectory()) {
exec('npm i ba... | Install Babel before trying to generate `dist-modules` | Install Babel before trying to generate `dist-modules`
Otherwise it will rely on global Babel...
| JavaScript | mit | austinsc/react-gooey,austinsc/react-gooey |
8bd65181e0d70a00f0b000bcfa172e3dbb5b61da | client/feedback-table-page/feedback.js | client/feedback-table-page/feedback.js | var config = require('config');
var fmt = require('fmt');
var otp = require('otp');
var Plan = require('plan');
var view = require('view');
var Feedback = module.exports = view(require('./feedback.html'));
Feedback.prototype.link = function() {
return fmt('%s/planner?%s', config.base_url(), decodeURIComponent(this.... | var config = require('config');
var fmt = require('fmt');
var otp = require('otp');
var Plan = require('plan');
var view = require('view');
var Feedback = module.exports = view(require('./feedback.html'));
Feedback.prototype.link = function() {
var plan = new Plan(this.model.plan);
return fmt('%s/planner?%s', con... | Fix function call error on feeback page | Fix function call error on feeback page
| JavaScript | bsd-3-clause | amigocloud/modeify,tismart/modeify,arunnair80/modeify,amigocloud/modified-tripplanner,arunnair80/modeify,arunnair80/modeify,amigocloud/modified-tripplanner,amigocloud/modified-tripplanner,arunnair80/modeify-1,miraculixx/modeify,arunnair80/modeify-1,miraculixx/modeify,tismart/modeify,tismart/modeify,amigocloud/modeify,a... |
1e70e3d9514da5f4b68918e6a1d417689bb30509 | _includes/shortcodes/avatar.js | _includes/shortcodes/avatar.js | const Image = require('@11ty/eleventy-img');
module.exports = async (src, alt, className, outputFormat = 'jpeg') => {
const stats = await Image(src, {
cacheDuration: '12w',
formats: [outputFormat],
outputDir: '_site/assets/avatar/',
widths: [96],
});
const classAttr = className ? `class="${class... | const Image = require('@11ty/eleventy-img');
module.exports = async (src, alt, className, outputFormat = 'jpeg') => {
if (alt === undefined) {
throw new Error(`Missing ALT attribute from: ${src}`);
}
const classAttr = className ? `class="${className}"` : '';
try {
const stats = await Image(src, {
... | Fix eleventy-img fetch 404 issue | Fix eleventy-img fetch 404 issue
| JavaScript | mit | austinjavascript/austinjavascript.github.io,austinjavascript/austinjavascript.github.io,austinjavascript/austinjavascript.github.io,austinjavascript/austinjavascript.github.io,austinjavascript/austinjavascript.github.io |
f96d396bc66c5b3f486acb95c5407d441912f7a9 | src/sprites/Water/interact.js | src/sprites/Water/interact.js | export default function interact() {
const game = this.game.state.states.Game;
const player = game.player;
player.inventory.water++;
// this should be its own function somewhere
game.hud.water.setText('Water: ' + player.inventory.water);
}
| export default function interact() {
const game = this.game.state.states.Game;
const player = game.player;
player.inventory.water++;
}
| Handle updating water count elsewhere | Handle updating water count elsewhere
| JavaScript | mit | ThomasMays/incremental-forest,ThomasMays/incremental-forest |
4639ebb59637400a30ab7c85bbcfae3476cd4eee | src/js/image-content.js | src/js/image-content.js | export default (props) => (
<img src={`https://chalees-min.imgix.net${props.imagePath}?w=726&fit=clip&auto=format,compress`} />
) | export default (props) => (
<img className="pure-img" src={`https://chalees-min.imgix.net${props.imagePath}?w=726&fit=clip&auto=format,compress`} />
) | Fix missing auto-resizing behavior on image learning items | Fix missing auto-resizing behavior on image learning items
| JavaScript | mit | nicolasartman/learning-prototype,nicolasartman/learning-prototype,nicolasartman/chalees-min,nicolasartman/chalees-min |
828c3111f52b7cf49df4f69d0af2ada827ab615b | app/components/blog-post-menu/component.js | app/components/blog-post-menu/component.js | import Component from '@ember/component';
import { computed } from '@ember-decorators/object';
export default class BlogPostMenu extends Component {
@computed('page', 'posts.[]')
get paginatedPosts() {
const page = this.get('page');
const posts = this.get('posts');
const start = (page - 1) * 10;
c... | import Component from '@ember/component';
import { computed } from '@ember-decorators/object';
export default class BlogPostMenu extends Component {
@computed('page', 'posts.[]')
get paginatedPosts() {
const page = this.get('page');
const posts = this.get('posts');
if (posts) {
const start = (pa... | Return empty array, if no posts | Return empty array, if no posts
| JavaScript | mit | shipshapecode/website,shipshapecode/shipshape.io,shipshapecode/website,shipshapecode/shipshape.io |
e221319f7c85bce0177660e732d545c71af38d15 | lib/eventsource-polyfill.js | lib/eventsource-polyfill.js | window.EventSourcePolyfill = require('./eventsource')
window.EventSource = window.EventSource || window.EventSourcePolyfill
| var EventSource = require('./eventsource')
if (typeof window === 'object') {
window.EventSourcePolyfill = EventSource
if (!window.EventSource) window.EventSource = EventSource
}
| Check window object exists before polyfilling | Check window object exists before polyfilling
| JavaScript | mit | EventSource/eventsource,aslakhellesoy/eventsource-node,aslakhellesoy/eventsource,aslakhellesoy/eventsource-node,aslakhellesoy/eventsource,EventSource/eventsource |
7d0b9f76c85b935b8b2554ea7ad11814229ae155 | server/routes/recipes/index.js | server/routes/recipes/index.js | import express from 'express';
import * as validate from '../../middleware/validate';
import * as recipeController from '../../controllers/recipes';
import * as reviewController from '../../controllers/reviews';
import * as voteController from '../../controllers/votes';
import * as auth from '../../middleware/auth';
c... | import express from 'express';
import * as validate from '../../middleware/validate';
import * as recipeController from '../../controllers/recipes';
import * as reviewController from '../../controllers/reviews';
import * as voteController from '../../controllers/votes';
import * as auth from '../../middleware/auth';
c... | Add validate User id middleware to protected routes | Add validate User id middleware to protected routes
| JavaScript | apache-2.0 | larrystone/BC-26-More-Recipes,larrystone/BC-26-More-Recipes |
28d202737dff095ea456a55edaa902cdc988236c | test/testCacheAllTheThings.js | test/testCacheAllTheThings.js | var Assert = require('assert');
var CacheAllTheThings = require('../');
describe('CacheAllTheThings', function() {
it('When asked to boot a Redis instance, it should do so', function() {
var inst = new CacheAllTheThings('redis');
Assert(inst.name, 'RedisCache');
});
describe('Redis', functio... | var Assert = require('assert');
var CacheAllTheThings = require('../');
describe('CacheAllTheThings', function() {
it('When asked to boot a Redis instance, it should do so', function() {
var inst = new CacheAllTheThings('redis');
Assert(inst.name, 'RedisCache');
});
describe('Redis', functio... | Add test to get an object out back as an object | Add test to get an object out back as an object
| JavaScript | mit | andrewhathaway/CacheAllTheThings,andrewhathaway/CacheAllTheThings |
89ccd6c87290eb1ad130bfe0d883c080922ba7b2 | backend/server/db/model/db.js | backend/server/db/model/db.js | module.exports = function(r) {
'use strict';
return {
insert: insert,
update: update,
updateAll: updateAll
};
/////////////////
function *update(table, id, json) {
let rql = r.table(table).get(id);
let result = yield rql.update(json, {returnChanges: true}).... | module.exports = function(r) {
'use strict';
return {
insert: insert,
update: update,
updateAll: updateAll
};
/////////////////
function *update(table, id, json) {
let rql = r.table(table).get(id);
let result = yield rql.update(json, {returnChanges: true}).... | Insert now handles sending back a list of items created. Optionally if there is one item created you have have it returned as an array. | Insert now handles sending back a list of items created. Optionally if
there is one item created you have have it returned as an array.
| JavaScript | mit | materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org |
05f39fb0a32fbf7ecccf5aee2fe89d1bbb424424 | server/index.js | server/index.js | import dotenv from 'dotenv';
import './CreateRSAKeyFile';
import models from './models';
import app from './server';
dotenv.config();
dotenv.config({ path: `${__dirname}/key/rsapair.pem` });
const port = process.env.PORT || 8080;
if (process.env.NODE_ENV === 'development') {
models.sequelize.sync({ force: true })
... | import dotenv from 'dotenv';
import './CreateRSAKeyFile';
import models from './models';
import app from './server';
dotenv.config();
dotenv.config({ path: `${__dirname}/key/rsapair.pem` });
const env = process.env.NODE_ENV || 'development';
const port = process.env.PORT || 8080;
if (env === 'development') {
models.... | Set NODE_ENV to development if not defined | [fix]: Set NODE_ENV to development if not defined
| JavaScript | mit | tomipaul/PostIt,tomipaul/PostIt |
d23c43c33c3329918405b9a241987f11a93b4c42 | lib/connection.js | lib/connection.js | /* jshint node: true */
var mongoose = require('mongoose');
var dbUrl = process.env.MONGO_URL;
if (!dbUrl) {
console.error("Unable to start application - no MONGO_URL defined - halting.");
process.exit(-1);
}
console.log("Connecting to mongo via: " + dbUrl);
//LC TODO only use env var and then fail with error... | /* jshint node: true */
var mongoose = require('mongoose');
var dbUrl = process.env.MONGO_URL;
if (!dbUrl) {
console.error("Unable to start application - no MONGO_URL defined - halting.");
process.exit(-1);
}
console.log("Connecting to mongo via: " + dbUrl);
mongoose.connect(dbUrl);
//Close the mongoose conn... | Remove TODO as it has been dealt with. | Remove TODO as it has been dealt with.
| JavaScript | mit | dotLou/palindrome,dotLou/palindrome |
c467bb63f881bd93086dd0d6bcb5f4cfc06bfdc4 | lib/core/index.js | lib/core/index.js | const iterateObject = require("iterate-object")
, typpy = require("typpy")
, mapObject = require("map-o")
;
function prepareData(input) {
iterateObject(input, value => {
if (typpy(value.types, String)) {
value.types = { normal: [value.types] };
} else if (typpy(value.types,... | const iterateObject = require("iterate-object")
, typpy = require("typpy")
, mapObject = require("map-o")
;
function prepareData(input) {
iterateObject(input, value => {
if (typpy(value.types, String)) {
value.types = { normal: [value.types] };
} else if (typpy(value.types,... | Support for error and end events | Support for error and end events
| JavaScript | mit | jillix/engine-flow-types |
787bf305a41febec1a752d05a4ac02a641eaa086 | textfield/operations/index.js | textfield/operations/index.js | var Textfield = require('./../index');
Textfield.prototype._toggleFocus = function () {
this._removeInvalid();
this.model.set('isFocused', !this.model.get('isFocused'));
};
Textfield.prototype._validate = function () {
if(this.validator && typeof this.validator[this.fieldName].validate === 'function') {
thi... | var Textfield = require('./../index');
Textfield.prototype._toggleFocus = function () {
this._removeInvalid();
this.model.set('isFocused', !this.model.get('isFocused'));
};
Textfield.prototype._validate = function () {
if(this.validator) this.model.get('validator.' + this.fieldName).validate();
};
Textfield.pr... | Fix fieldName could be path | Fix fieldName could be path
| JavaScript | mit | BBWeb/d-md-components,BBWeb/d-md-components |
88b59916a4cf0b9442f13972865df02f8252af19 | routes/index.js | routes/index.js | var express = require('express');
var router = express.Router();
router.get('/', function (req, res, next) {
res.render('index', { title: 'Express' });
});
module.exports = router;
| var express = require('express');
var router = express.Router();
router.get('/', function (req, res, next) {
res.render('index');
});
router.get('/tables/:table/rows', function (req, res, next) {
var table = res.locals.tables.find(x => x.name === req.params.table);
table.rows.then((result) => {
res.json(r... | Add route for table rows | Add route for table rows
| JavaScript | mit | tiere/turbo-couscous,tiere/turbo-couscous |
bff9d9680aff573ba561140a419cf85ea9acf7ac | lib/get-config.js | lib/get-config.js | 'use strict';
/*eslint no-console: [0] */
var path = require('path');
var existsSync = require('exists-sync');
function readConfigFromDisk(options) {
var providedConfigPath = options.configPath;
var defaultConfigPath = providedConfigPath || path.join(process.cwd(), '.template-lintrc');
var overrideConfigPath =... | 'use strict';
var path = require('path');
var existsSync = require('exists-sync');
function readConfigFromDisk(options) {
var providedConfigPath = options.configPath;
var configPath = providedConfigPath || path.join(process.cwd(), '.template-lintrc');
if(existsSync(configPath) || existsSync(configPath + '.js')... | Remove support for environment variable override. | Remove support for environment variable override.
We can add support back if needed, but it makes the config parsing a bit
more annoying for now...
| JavaScript | mit | rwjblue/ember-template-lint,oriSomething/ember-template-lint |
1e2e738160032b557e70d6e829b67f7e2810144e | config.js | config.js | // require('dotenv').config();
module.exports = {
host: process.env.HOST,
port: process.env.PORT,
fitbit: {
client: {
id: process.env.FB_ID,
secret: process.env.FB_SECRET
},
uri: {
authorization: 'https://www.fitbit.com/oauth2/authorize... | let redirect;
if (process.env.PORT === undefined) {
redirect = `https://${process.env.R_HOST}`;
} else if (process.env.PORT !== undefined) {
if (process.env.HOST === undefined) {
throw new Error('Missing HOST!');
} else {
redirect = `http://${process.env.HOST}:${process.env.PORT}`;... | Add checks to change redirect URLs on deploy | Add checks to change redirect URLs on deploy
| JavaScript | mit | davidcsz/fitbit-slack-stats |
084142c534d79ac2cb97ad6b82b89cfbafaa9992 | test/browser.js | test/browser.js | 'use strict';
const sauceBrowsers = require('sauce-browsers');
const run = require('sauce-test');
const path = require('path');
const pkg = require('../package');
const platforms = sauceBrowsers([
{ name: 'android', version: ['oldest', 'latest'] },
{ name: 'chrome', version: ['oldest', 'latest'] },
{ name: 'fi... | 'use strict';
const sauceBrowsers = require('sauce-browsers');
const run = require('sauce-test');
const path = require('path');
const pkg = require('../package');
const platforms = sauceBrowsers([
{ name: 'android', version: ['oldest', 'latest'] },
{ name: 'chrome', version: ['oldest', 'latest'] },
{ name: 'fi... | Add `deviceName` field for Android | [test] Add `deviceName` field for Android
| JavaScript | mit | unshiftio/url-parse,unshiftio/url-parse |
7c670ce10e698f95f81663f71806d1985c5c83d7 | lib/retry_time.js | lib/retry_time.js | var _currentRetryTime = 0
var currentRetryTimeDep = new Deps.Dependency
currentRetryTime = function() {
currentRetryTimeDep.depend()
return _currentRetryTime
}
Meteor.setInterval(function() {
var retryTime = Math.round((Meteor.status().retryTime - (new Date()).getTime()) / 1000)
if (retryTime !== _currentRe... | var _currentRetryTime = 0
var currentRetryTimeDep = new Deps.Dependency
currentRetryTime = function() {
currentRetryTimeDep.depend()
return _currentRetryTime
}
Meteor.setInterval(function() {
var retryTime = Math.round((Meteor.status().retryTime - (new Date()).getTime()) / 1000)
if (isFinite(retryTime) && r... | Add isFinite check to retry time | Add isFinite check to retry time
| JavaScript | mit | francocatena/meteor-status,erasaur/meteor-status,postrednik/meteor-status,erasaur/meteor-status,francocatena/meteor-status,postrednik/meteor-status |
fd98d7bafcb4b3bdb0a30c671a078825f5b95d77 | controllers/indexController.js | controllers/indexController.js | class Index {
static showIndex(req,res){
res.render("underConstruction");
}
}
module.exports = Index; | class Index {
static showIndex(req,res){
res.render("index");
}
}
module.exports = Index;
| Change view back to index | Change view back to index | JavaScript | mit | CassF/cassandrafrimpongcv,CassF/cassandrafrimpongcv |
394a1346f10c383eec1378bc2b349ae4e2fa8367 | app/components/filterableNoteTable.component.js | app/components/filterableNoteTable.component.js | import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.ha... | import React from 'react';
import SearchBar from './searchbar.component'
import NoteTable from './noteTable.component'
//combines note table and searchbar
class FilterableNoteTable extends React.Component {
constructor(props) {
super(props);
this.state = {
filterText: ''
};
this.handleSearchInput = this.ha... | Check that note has name property before equivalency check. | Check that note has name property before equivalency check.
| JavaScript | cc0-1.0 | bigredwill/notational-markdown,bigredwill/notational-markdown |
f12feda3b2f3cbe97e3104f36f426382a8a294dd | lib/transport/local/LocalConnection.js | lib/transport/local/LocalConnection.js | 'use strict';
var Promise = require('promise');
var Connection = require('../Connection');
/**
* A local connection.
* @param {LocalTransport} transport
* @param {string | number} id
* @param {function} receive
* @constructor
*/
function LocalConnection(transport, id, receive) {
this.transport = transport;
... | 'use strict';
var Promise = require('promise');
var Connection = require('../Connection');
/**
* A local connection.
* @param {LocalTransport} transport
* @param {string | number} id
* @param {function} receive
* @constructor
*/
function LocalConnection(transport, id, receive) {
this.transport = transport;
... | Return Promise.reject if agent not found | Return Promise.reject if agent not found | JavaScript | apache-2.0 | enmasseio/evejs |
6c866fd7c0e6325a8ed0f8ca2325e7b7430d1cf2 | tests/phantom-runner.js | tests/phantom-runner.js | /*eslint-env node*/
// Borrowed from https://github.com/ember-cli/ember-cli/issues/3894#issuecomment-212946925
// Custom version of the Testem PhantomJS runner.
// This exists to block requests to fonts.googleapis.com because this can cause
// Phantom to incompletely load JS files causing bizarre syntax errors.
/... | /*eslint-env node*/
// Borrowed from https://github.com/ember-cli/ember-cli/issues/3894#issuecomment-212946925
// Custom version of the Testem PhantomJS runner.
// This exists to block requests to fonts.googleapis.com because this can cause
// Phantom to incompletely load JS files causing bizarre syntax errors.
/... | Add some logging to the phantom skipper | Add some logging to the phantom skipper | JavaScript | mit | ibroadfo/flowerpot,ibroadfo/flowerpot |
73fcd384c39a36df4739ca97c93438aee9b22d0a | test/unit/components/explorer/visualization/chart_spec.js | test/unit/components/explorer/visualization/chart_spec.js | /** @jsx React.DOM */
var assert = require('chai').assert;
var expect = require('chai').expect;
var _ = require('lodash');
var sinon = require('sinon');
var Chart = require('../../../../../client/js/app/components/explorer/visualization/chart.js');
var React = require('react/addons');
var ExplorerUtils = require('../..... | /** @jsx React.DOM */
var assert = require('chai').assert;
var expect = require('chai').expect;
var _ = require('lodash');
var sinon = require('sinon');
var Chart = require('../../../../../client/js/app/components/explorer/visualization/chart.js');
var React = require('react/addons');
var ExplorerUtils = require('../..... | Test for email extraction message. | Test for email extraction message.
| JavaScript | mit | amitmawkin/explorer,amitmawkin/explorer,keen/explorer,keen/explorer,keen/explorer |
3f9788dfafb8b11c7d977c41815b1be99b229d46 | src/firebase/authentication.js | src/firebase/authentication.js | /* @flow */
import * as firebase from 'firebase/auth'
import type { Action } from '../actions/types'
export default class AuthManager {
static login (action: Action) {
if (action.type === 'LOGIN') {
const { email, password } = action
firebase.auth()
.signInWithEmailAndPassword(email, passwor... | /* @flow */
import auth from 'firebase/auth'
import type { Action } from 'actions/types'
export default class AuthManager {
static login (action: Action) {
if (action.type === 'LOGIN') {
const { email, password } = action
auth()
.signInWithEmailAndPassword(email, password)
.then(() =... | Fix bug with undefined auth function. | Fix bug with undefined auth function.
| JavaScript | mit | jsonnull/aleamancer,jsonnull/aleamancer |
380b9ba0a4537747735028fdc3d314a9f07689ab | Timeout.js | Timeout.js |
const Timeout = (() => {
const keyId = {}
const complete = {}
// set(key, func, ms) -- user-defined key
// set(func, ms) -- func used as key
//
// returns a function allowing you to test if it has executed
const set = (...args) => {
let key, func, ms
if (args.length == 3)
[key, func, ms] ... |
const Timeout = (() => {
const keyId = {}
const complete = {}
// set(key, func, ms) -- user-defined key
// set(func, ms) -- func used as key
//
// returns a function allowing you to test if it has executed
const set = (...args) => {
let key, func, ms
if (args.length == 3)
[key, func, ms] ... | Clear duplicate key on set() | Clear duplicate key on set() | JavaScript | mit | rommelsantor/Timeout,rommelsantor/Timeout |
671a8668abc0e05049844ff6bc24a3cf02155fe9 | Example/app/reducers/Discovery.js | Example/app/reducers/Discovery.js | import * as types from '../actions/DiscoveryActionTypes';
const initialState = {
devicesDiscovered: [],
discoveryStatus: "",
};
export default function discovery(state = initialState, action) {
switch (action.type) {
case types.DEVICEDISCOVERED:
return {
...state,
devicesDiscovered: [.... | import * as types from '../actions/DiscoveryActionTypes';
import _ from 'lodash';
const initialState = {
devicesDiscovered: [],
discoveryStatus: "",
};
export default function discovery(state = initialState, action) {
switch (action.type) {
case types.DEVICEDISCOVERED:
return {
...state,
... | Make devices discovered unique in example app | Make devices discovered unique in example app
| JavaScript | apache-2.0 | sogilis/react-native-bluetooth,sogilis/react-native-bluetooth-manager,sogilis/react-native-bluetooth-manager,sogilis/react-native-bluetooth-manager,sogilis/react-native-bluetooth,sogilis/react-native-bluetooth-manager,sogilis/react-native-bluetooth,sogilis/react-native-bluetooth |
4f0a5a56e442f3b957d14746ab6ab816ce09fb1d | src/assets/toolkit/scripts/backToTop.js | src/assets/toolkit/scripts/backToTop.js | const backToTop = document.querySelector('#js-backToTop');
$(window).scroll(function() {
if($(window).scrollTop() > $(window).height()) {
backToTop.classList.remove('down-self');
}
else {
backToTop.classList.add('down-self');
}
}); | const backToTop = document.querySelector('#js-backToTop');
if (backToTop) {
$(window).scroll(function() {
if($(window).scrollTop() > $(window).height()) {
backToTop.classList.remove('down-self');
}
else {
backToTop.classList.add('down-self');
}
});
} | Check if component is present | Check if component is present
| JavaScript | mit | spacefarm-digital/bbDesign,spacefarm-digital/bbDesign |
7d98d87f78c91c6f02dca69420d2b17138f0104f | server.js | server.js | require("dotenv").config();
require("./app/variables");
require("./app/models/user");
require("./app/models/record");
require("./app/passport/passport");
require("./app/middlewares");
let app = global.variables.app;
app.listen(process.env.PORT, () => {
console.log("Server is running on port:", process.env.PORT);
... | require("dotenv").config();
require("./app/variables");
require("./app/models/user");
require("./app/models/record");
require("./app/models/note");
require("./app/passport/passport");
require("./app/middlewares");
let app = global.variables.app,
cluster = require("cluster")
numCPUs = require("os").cpus().lengt... | Add load balancing using cluster | Add load balancing using cluster
| JavaScript | mit | htdangkhoa/moneymoney_server,htdangkhoa/moneymoney_server |
ce9224724cce70141e1d82d9ea875908a1175344 | client/components/Dashboard.js | client/components/Dashboard.js | import React, { Component } from 'react'
export class Dashboard extends Component {
constructor(props) {
super(props)
}
render() {
return (
<div>
<div>
Dashboard
</div>
</div>
)
}
} | import React, { Component } from 'react'
import Affirmations from './analytics/Affirmations'
export default class Dashboard extends Component {
constructor(props) {
super(props);
this.state = {
data: {
url: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/98887/d3pack-flare-short.json',
el... | Update for new analytics dashboard | Update for new analytics dashboard
| JavaScript | mit | scrumptiousAmpersand/journey,scrumptiousAmpersand/journey |
7a8de0fccd15e92b14377a6ad47f799db4b74443 | server.js | server.js | var http = require('http');
var PORT = 80;
var IP = '127.0.0.1';
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(PORT, IP);
console.log('Server running at http://' + IP + ':' + PORT + '/');
| var http = require('http');
var PORT = 80;
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(PORT);
console.log('ZoomHub running at http://localhost:' + PORT + '/');
| Make app listen to public port | Make app listen to public port
Omit hostname to ensure app is accessible via Internet, i.e. hostname MUST be
`0.0.0.0`, not `127.0.0.1`.
/cc @iangilman @kenperkins @aseemk
| JavaScript | mit | zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub,zoomhub/zoomhub |
cb96a9a799ba248d92681588ca3a58b6789be2cb | js/app.js | js/app.js | "use strict";
$('#start').click(function() {
let namePlayer1 = $('#p1name').val(),
namePlayer2 = $('#p2name').val();
if (namePlayer1.length === 0 || namePlayer2.length === 0) {
alert("You must enter your names!");
return;
}
let tokenPlayer1 = $('#tokens1 input').val(),... | "use strict";
$('#start').click(function() {
let namePlayer1 = $('#p1name').val(),
namePlayer2 = $('#p2name').val();
if (namePlayer1.length === 0 || namePlayer2.length === 0) {
alert("You must enter your names!");
return;
}
let tokenPlayer1 = $('#tokens1 input').val(),... | Call advanceTurn al para que el juego avance luego de mover los tokens | Call advanceTurn al para que el juego avance luego de mover los tokens
| JavaScript | mit | Tribu-Anal/Tribupoly,Tribu-Anal/Tribupoly |
83d10c74fb33f3efdf294547954ed3fcf9d0a588 | packages/shared/lib/errors.js | packages/shared/lib/errors.js | export const HTTP_ERROR_CODES = {
ABORTED: -1,
TIMEOUT: 0,
UNPROCESSABLE_ENTITY: 422,
UNAUTHORIZED: 401,
UNLOCK: 403,
TOO_MANY_REQUESTS: 429,
};
export const API_CUSTOM_ERROR_CODES = {
APP_VERSION_BAD: 5003,
HUMAN_VERIFICATION_REQUIRED: 9001,
AUTH_ACCOUNT_DISABLED: 10003,
TOKEN_... | export const HTTP_ERROR_CODES = {
ABORTED: -1,
TIMEOUT: 0,
UNPROCESSABLE_ENTITY: 422,
UNAUTHORIZED: 401,
UNLOCK: 403,
TOO_MANY_REQUESTS: 429,
};
export const API_CUSTOM_ERROR_CODES = {
APP_VERSION_BAD: 5003,
HUMAN_VERIFICATION_REQUIRED: 9001,
AUTH_ACCOUNT_DISABLED: 10003,
TOKEN_... | Add custom error code: NO_RESET_METHODS | Add custom error code: NO_RESET_METHODS
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient |
f8013b0dd0fb773f15b99fb3ba9b7ab570ac328e | src/resolve/xml3d-glsl-deferred/xml3d-deferred.js | src/resolve/xml3d-glsl-deferred/xml3d-deferred.js | (function (ns) {
var Shade = require("../../interfaces.js"),
SpaceVectorType = Shade.SpaceVectorType;
ns.emissive = {
inputSpaces: [
SpaceVectorType.OBJECT
]
}
ns.diffuse = {
inputSpaces: [
SpaceVectorType... | (function (ns) {
var Shade = require("../../interfaces.js"),
SpaceVectorType = Shade.SpaceVectorType;
ns.emissive = {
inputSpaces: [
SpaceVectorType.OBJECT
]
}
ns.diffuse = {
inputSpaces: [
SpaceVectorType... | Fix space bug for reflect and refract brdf | Fix space bug for reflect and refract brdf
| JavaScript | mit | xml3d/shade.js |
89fc139605029228e2fd9001fec71ff218b3c66b | migrations/20130915232642-init-user.js | migrations/20130915232642-init-user.js | "use strict";
module.exports = {
up: function(m, types, done) {
m.createTable("user", {
email: { type: types.STRING, primaryKey: true },
password: types.STRING,
display_name: types.STRING
}).success(function() {
done();
});
},
down: function(m, types, done) {
m.queryAnd... | "use strict";
module.exports = {
up: function(m, types, done) {
m.createTable("user", {
email: { type: "text", primaryKey: true },
password: "text",
display_name: "text"
}).success(function() {
done();
});
},
down: function(m, types, done) {
m.queryAndEmit("DROP TABLE IF... | Use text as the datatype instead of the stupid type.STRING thing | Use text as the datatype instead of the stupid type.STRING thing
| JavaScript | agpl-3.0 | zkat/storychat |
8375cb127c83aa929d7bc8f4fec821de1c52dba5 | lib/plugins/tag/iframe.js | lib/plugins/tag/iframe.js | var extend = require('../../extend');
extend.tag.register('iframe', function(args, content){
var url = args[0],
width = args[1] && args[1] != 'default' ? args[1] : '100%',
height = args[2] && args[2] != 'default' ? args[2] : '300px';
return '<iframe height="350" marginheight="0" src="'+url+'" frameborder="... | var extend = require('../../extend');
extend.tag.register('iframe', function(args, content){
var url = args[0],
width = args[1] && args[1] !== 'default' ? args[1] : '100%',
height = args[2] && args[2] !== 'default' ? args[2] : '300';
return '<iframe src="' + url + '" width="' + width + '" height="' + heig... | Remove useless attributes and add "allowfullscreen" | Remove useless attributes and add "allowfullscreen"
| JavaScript | mit | hexojs/hexo,cjwind/hexx,SampleLiao/hexo,luinnx/hexo,Richardphp/hexo,littledogboy/hexo,ChaofengZhou/hexo,HiWong/hexo,magicdawn/hexo,DevinLow/DevinLow.github.io,SaiNadh001/hexo,amobiz/hexo,hugoxia/hexo,chenzaichun/hexo,jonesgithub/hexo,jollylulu/hexo,haoyuchen1992/hexo,tzq668766/hexo,imjerrybao/hexo,dreamren/hexo,XGHeave... |
97dbdb9639b3bfee0bf62a831c8ce4d55acf4af2 | lib/support/generateId.js | lib/support/generateId.js | 'use strict';
var crypto = require('crypto');
var INSTANCE_ID = crypto.randomBytes(2);
var BASE_UNIX_DATE = 421000000;
var buf = new Buffer(10);
buf[4] = INSTANCE_ID[0];
buf[5] = INSTANCE_ID[1];
module.exports = function generateId() {
buf.writeUInt32BE(Math.floor(Date.now() / 1000) - BASE_UNIX_DATE, 0, true);
bu... | 'use strict';
var crypto = require('crypto');
var INSTANCE_ID = crypto.randomBytes(2);
var BASE_UNIX_DATE = 421000000;
var buf = new Buffer(12);
buf[4] = INSTANCE_ID[0];
buf[5] = INSTANCE_ID[1];
buf.writeUInt16BE(process.pid, 6, true);
module.exports = function generateId() {
buf.writeUInt32BE(Math.floor(Date.now(... | Use process id for increased uniqueness | Use process id for increased uniqueness | JavaScript | mit | tcdl/msb,tcdl/msb |
62fef4b837449749a43640067438a9a1271914ce | ezhc/script/json_parse.js | ezhc/script/json_parse.js | options = JSON.stringify(options);
options = JSON.parse(options, function(key, value) {
if (value && (typeof value==="string")) {
// replace spaces then newline characters
var check1 = (value.replace(/\s+/g, '').replace(/\r?\n|\r/g, '').substr(0,8) == "function"),
check2 = (value.repl... |
let removeJsComments = function (str) {
let newStr = str.replace(/\/\*[\s\S]*?\*\/|([^:]|^)\/\/.*$/gm, '');
return newStr;
};
let removeBlankLines = function (str) {
let newStr = str.replace(/^\s*[\r\n]/gm, '');
return newStr;
};
let removeUnecessarySpace = function (str) {
let newStr = str.replace(/(\t| {2})+... | Make function string parsing more explicit | Make function string parsing more explicit
| JavaScript | mit | oscar6echo/ezhc,oscar6echo/ezhc,oscar6echo/ezhc |
5f15544ad304d6c2523c6ad24e9704abc9df3d99 | src/igTruncate.js | src/igTruncate.js | angular.module('igTruncate', []).filter('truncate', function (){
return function (text, length, end){
if (text !== undefined){
if (isNaN(length)){
length = 10;
}
end = end || "...";
if (text.length <= length || text.length - end.length <= length){
return text;
}else... | angular.module('igTruncate', []).filter('truncate', function () {
return function (text, length, end) {
if (!text) {
return;
}
if (isNaN(length)) {
length = 10;
}
end = end || "...";
if (text.length <= length || text.length - end.length <= length) {
return text;
} else ... | Fix bug with null values, refractorize code | Fix bug with null values, refractorize code
If null values arrives the plugin crashes, with this little change not happens | JavaScript | mit | igreulich/angular-truncate,OpenCST/angular-truncate |
29a492dc5f3d1997941d2c0b174bb4a64c704553 | 04/jjhampton-ch4-list.js | 04/jjhampton-ch4-list.js | // Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the fron... | // Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the fron... | Write listToArray function that produces an array from a list | Write listToArray function that produces an array from a list
| JavaScript | mit | OperationCode/eloquent-js |
eab68095c8807a5aaf483efb84c1f916606e39b5 | app/shared/FileSystem.js | app/shared/FileSystem.js | import fs from 'fs';
function fileExists(filename){
try{
fs.accessSync(filename);
return true;
}catch(e){
return false;
}
}
function readDir(path){
return fs.readdirSync(path);
}
function writeFile(file, content){
try{
fs.writeFileSync(file, content, 'utf8');
return true;
}catch(e){
... | import fs from 'fs';
import ReactBaseError from './errors.js';
function fileExists(filename){
try{
fs.accessSync(filename);
return true;
}catch(e){
return false;
}
}
function readDir(path){
return fs.readdirSync(path);
}
function writeFile(file, content){
try{
fs.writeFileSync(file, content... | Add try/catch to handle exceptions | Add try/catch to handle exceptions
| JavaScript | mit | atSistemas/react-base |
96f1354c7a9594e5659b4adabf79615ca4c2cc9b | js/app/handlers/menu-rejigger.js | js/app/handlers/menu-rejigger.js | $(document).on('click', 'ul.ds-rejigger-menu li a', function(e) {
var target = $(e.target).parent();
var cols = target.attr('data-ds-cols');
var section_type = target.attr('data-ds-section-type');
var layout = ds.models.transform.SimpleGrid({
section_type: section_type,
columns: cols
... | $(document).on('click', 'ul.ds-rejigger-menu li a', function(e) {
var target = $(e.target).parent();
var cols = target.attr('data-ds-cols');
var section_type = target.attr('data-ds-section-type');
var layout = ds.models.transform.SimpleGrid({
section_type: section_type,
columns: cols
... | Return false from click handler to avoid a pop state event | Return false from click handler to avoid a pop state event
| JavaScript | apache-2.0 | Slach/tessera,section-io/tessera,urbanairship/tessera,tessera-metrics/tessera,Slach/tessera,Slach/tessera,aalpern/tessera,jmptrader/tessera,section-io/tessera,tessera-metrics/tessera,jmptrader/tessera,aalpern/tessera,filippog/tessera,tessera-metrics/tessera,jmptrader/tessera,urbanairship/tessera,urbanairship/tessera,se... |
3a9bd2be5b16bdc0033e014f0eb30ad327a1c480 | flippy.js | flippy.js | $(function () {
$("#start-towtruck").click(TowTruck);
randomize();
});
function cell(row, col) {
return $("#cell-" + row + "-" + col);
}
function randomColor() {
return "#" + Math.floor(0x1000000 + Math.random() * 0xffffff).toString(16).substr(1);
}
function randomize() {
for (var row=1; row<6; row++) {
... | $(function () {
$("#start-towtruck").click(TowTruck);
randomize();
});
function cell(row, col) {
return $("#cell-" + row + "-" + col);
}
function randomColor() {
return "#" + Math.floor(0x1000000 + Math.random() * 0xffffff).toString(16).substr(1);
}
function randomize() {
for (var row=1; row<6; row++) {
... | Initialize colors, and fix message registration | Initialize colors, and fix message registration
| JavaScript | mpl-2.0 | ianb/flippy |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.