commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
aa1677defe0e68126efb362a1184310b5cd5cb93
lib/util/wrap.js
lib/util/wrap.js
/* var args = ['jar', 'username', 'password'] raw function login (jar, username, password) exported function login () check number of arguments if necessary options object: login(arguments[0]) individual arguments: for each argument add to an options array corresponding with argument order login...
/* var args = ['jar', 'username', 'password'] raw function login (jar, username, password) exported function login () check number of arguments if necessary options object: login(arguments[0]) individual arguments: for each argument add to an options array corresponding with argument order login...
Fix for multiple usage types
Fix for multiple usage types Argument list/Actual parameters
JavaScript
mit
sentanos/roblox-js,FroastJ/roblox-js,OnlyTwentyCharacters/roblox-js
--- +++ @@ -32,8 +32,9 @@ return function () { var options = {}; if (arguments.length > 0) { - if (typeof arguments[0] === 'object') { - options = arguments[0]; + var first = arguments[0]; + if (arguments.length === 1 && (argumentList.length !== 1 || (first instanceof ...
079e9063578db0363413deba7314a74238025873
src/AppBundle/Resources/js/userCard.js
src/AppBundle/Resources/js/userCard.js
$(document).ready(function () { //var route = Routing.generate('seen_userCardication', { id: {{ userCard.id }} }); var $content = $('.userCardContent'); var array = {}; $('.userCardBlock').hide(); $('.userCardButton').click(function(){ $('.userCardBlock').toggle("ease-in"); }); });
$(document).ready(function () { //var route = Routing.generate('seen_userCardication', { id: {{ userCard.id }} }); var $content = $('.userCardContent'); var array = {}; $('.userCardBlock').hide(); $('.userCardButton').click(function(e){ e.preventDefault(); $('.userCardBlock').togg...
Fix bug from previous merge conflict
Fix bug from previous merge conflict
JavaScript
unlicense
ariescdi/documentio,ariescdi/documentio
--- +++ @@ -6,7 +6,8 @@ $('.userCardBlock').hide(); - $('.userCardButton').click(function(){ + $('.userCardButton').click(function(e){ + e.preventDefault(); $('.userCardBlock').toggle("ease-in"); });
0ee36fe6aa1911214d87bb5ca85f34a62f150580
frontend/test/unit/specs/Hello.spec.js
frontend/test/unit/specs/Hello.spec.js
// import Vue from 'vue' // import Hello from '@/components/Hello' describe('this test runner', () => { it('needs at least one test', () => { expect(true).to.equal(true) }) }) // describe('Hello.vue', () => { // it('should render correct contents', () => { // const Constructor = Vue.extend(Hello) //...
describe('this test runner', () => { it('needs at least one test', () => { expect(true).to.equal(true) }) })
Remove comments in test file
Remove comments in test file
JavaScript
mit
code-for-nashville/parcel,code-for-nashville/parcel,code-for-nashville/parcel
--- +++ @@ -1,17 +1,5 @@ -// import Vue from 'vue' -// import Hello from '@/components/Hello' - describe('this test runner', () => { it('needs at least one test', () => { expect(true).to.equal(true) }) }) - -// describe('Hello.vue', () => { - // it('should render correct contents', () => { - // const...
a72154e507b42bcd12feaabbea9602eb6c64d1a4
src/configure/webpack/plugins/images.js
src/configure/webpack/plugins/images.js
export default { name: 'webpack-images', configure () { return { module: { loaders: [ { test: /\.(png|jpg|gif)$/, loader: 'url-loader?limit=8192&name=[name]-[hash].[ext]' } ] } } } }
export default { name: 'webpack-images', configure () { return { module: { loaders: [ { test: /\.(png|jpg|jpeg|gif)$/, loader: 'url-loader?limit=8192&name=[name]-[hash].[ext]' } ] } } } }
Add jpeg file extension loading support
Add jpeg file extension loading support
JavaScript
mit
saguijs/sagui,saguijs/sagui
--- +++ @@ -5,7 +5,7 @@ module: { loaders: [ { - test: /\.(png|jpg|gif)$/, + test: /\.(png|jpg|jpeg|gif)$/, loader: 'url-loader?limit=8192&name=[name]-[hash].[ext]' } ]
aa968b2abf4171ea0b07a6a543d4c5631024346e
runcheerp.js
runcheerp.js
/* * Run the code contained in the file manager, by compiling everything and * executing the main class, then display the result. */ /* global FileManager */ function runCodeCheerp() { // Get the main class's actual name.. // drop the .java extension var mainFile = FileManager.getMainFile().name; va...
/* * Run the code contained in the file manager, by compiling everything and * executing the main class, then display the result. */ /* global FileManager */ function runCodeCheerp() { // Get the main class's actual name.. // drop the .java extension var mainName = FileManager.getMainFile().name.replace...
Revert "keep .java on mainFile"
Revert "keep .java on mainFile"
JavaScript
mit
mrbdahlem/MyCode.run,mrbdahlem/MyCode.run
--- +++ @@ -7,9 +7,7 @@ function runCodeCheerp() { // Get the main class's actual name.. // drop the .java extension - var mainFile = FileManager.getMainFile().name; - var mainName = mainFile.replace(/\.[^/.]+$/, ""); - + var mainName = FileManager.getMainFile().name.replace(/\.[^/.]+$/, ""); ...
40d0ad7a897cff8ff1aa60a22f74ee120e9f4bc6
src/answer_generators/mdbg/generator.js
src/answer_generators/mdbg/generator.js
function generateResults ( recognitionResults, q, context ) { var resultList = recognitionResults['com.solveforall.recognition.lang.chinese.Chinese']; if (!resultList) { return null; } return [{ label: 'MDBG', uri: 'http://www.mdbg.net/chindict/mobile.php?mwddw=' + resultList[0].traditio...
/*jslint continue: true, devel: true, evil: true, indent: 2, plusplus: true, rhino: true, unparam: true, vars: true, white: true */ function generateResults(recognitionResults, q, context) { 'use strict'; var resultList = recognitionResults['com.solveforall.recognition.lang.chinese.Chinese']; if (!resultList)...
Add summaryHtml and embeddable: true flag to MDBG Answer Generator
Add summaryHtml and embeddable: true flag to MDBG Answer Generator
JavaScript
apache-2.0
jtsay362/solveforall-example-plugins,jtsay362/solveforall-example-plugins
--- +++ @@ -1,21 +1,20 @@ -function generateResults -( - recognitionResults, - q, - context -) -{ +/*jslint continue: true, devel: true, evil: true, indent: 2, plusplus: true, rhino: true, unparam: true, vars: true, white: true */ +function generateResults(recognitionResults, q, context) { + 'use strict'; + ...
4ee5af4f741025379c648461f40f3943251dbd84
migrations/20150824191630-add-users.js
migrations/20150824191630-add-users.js
var dbm = global.dbm || require('db-migrate'); var type = dbm.dataType; exports.up = function(db, callback) { db.createTable('users', { id: { type: 'int', primaryKey: true, unsigned: true, notNull: true, autoIncrement: true, length: 10 }, username: { type: 'strin...
var dbm = global.dbm || require('db-migrate'); var type = dbm.dataType; exports.up = function(db, callback) { db.createTable('users', { id: { type: 'int', primaryKey: true, unsigned: true, notNull: true, autoIncrement: true }, username: { type: 'string', unique: ...
Fix to the users migration.
Fix to the users migration.
JavaScript
mit
meddle0x53/react-koa-gulp-postgres-passport-example,meddle0x53/react-webpack-koa-postgres-passport-example,meddle0x53/react-webpack-koa-postgres-passport-example,meddle0x53/react-koa-gulp-postgres-passport-example
--- +++ @@ -8,17 +8,16 @@ primaryKey: true, unsigned: true, notNull: true, - autoIncrement: true, - length: 10 + autoIncrement: true }, username: { type: 'string', unique: true, - notNull: true + notNull: true }, password: { type:...
ac8c692c45e343eda9a576fb40f29317be92bf52
src/common/config/defaultPreferences.js
src/common/config/defaultPreferences.js
// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. /** * Default user preferences. End-users can change these parameters by editing config.json * @param {number} version - Scheme version. (Not application version) */...
// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. /** * Default user preferences. End-users can change these parameters by editing config.json * @param {number} version - Scheme version. (Not application version) */...
Set "app start on login" preference to default on
Set "app start on login" preference to default on
JavaScript
apache-2.0
mattermost/desktop,yuya-oc/electron-mattermost,yuya-oc/electron-mattermost,mattermost/desktop,yuya-oc/electron-mattermost,mattermost/desktop,mattermost/desktop,yuya-oc/desktop,yuya-oc/desktop,mattermost/desktop,yuya-oc/desktop
--- +++ @@ -20,7 +20,7 @@ showUnreadBadge: true, useSpellChecker: true, enableHardwareAcceleration: true, - autostart: false, + autostart: true, }; export default defaultPreferences;
c0e375921363a2581a5b3819078e01fe172b560d
src/js/components/NewPageHeaderTabs.js
src/js/components/NewPageHeaderTabs.js
import classNames from 'classnames/dedupe'; import {Link} from 'react-router'; import React from 'react'; class PageHeaderTabs extends React.Component { render() { let {props: {tabs}} = this; let tabElements = tabs.map(function (tab, index) { let {isActive} = tab; let classes = classNames('tab-i...
import classNames from 'classnames/dedupe'; import {Link} from 'react-router'; import React from 'react'; class PageHeaderTabs extends React.Component { render() { let {props: {tabs}} = this; let tabElements = tabs.map(function (tab, index) { let {isActive, callback} = tab; let classes = classNa...
Update styles in page header tabs to match latest canvas
Update styles in page header tabs to match latest canvas
JavaScript
apache-2.0
dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui
--- +++ @@ -7,10 +7,11 @@ let {props: {tabs}} = this; let tabElements = tabs.map(function (tab, index) { - let {isActive} = tab; - let classes = classNames('tab-item', {active: isActive}); - let linkClasses = classNames('tab-item-label', {active: isActive}); + let {isActive, callback} ...
1fb5dd1b4ea489bb3de3942352480bced07e5938
src/qux.js
src/qux.js
var Qux = (function () { 'use strict'; function Qux () { this.events = {}; } var uid = -1; Qux.prototype.publish = function (ev, data) { if (typeof this.events[ev] === 'undefined') { return false; } var q = this.events[ev]; var len = q.length; for (var i = 0; i < len; i++) {...
/* jshint node: true */ (function () { 'use strict'; var root = this; var uid = -1; function Qux () { this.topics = {}; } Qux.prototype.publish = function (topic, data) { if (typeof this.topics[topic] === 'undefined') { return false; } var queue = this.topics[topic]; var len =...
Create a module or a global object depending on context
Create a module or a global object depending on context
JavaScript
mit
ultranaut/qux
--- +++ @@ -1,51 +1,75 @@ -var Qux = (function () { +/* jshint node: true */ + +(function () { 'use strict'; + var root = this; + var uid = -1; + function Qux () { - this.events = {}; + this.topics = {}; } - var uid = -1; - - Qux.prototype.publish = function (ev, data) { - if (typeof this.ev...
b1e6b991bf2f84730fa731a24654a455baf9cd46
modules/intentManager.js
modules/intentManager.js
var CONTEXT_URI = process.env.CONTEXT_URI; var _ = require('underscore'); var IntentManager = function () { }; IntentManager.prototype.process = function (intent, req, res) { var redirect = function (url) { console.log("And CONTEXT URI IS ->", CONTEXT_URI); res.redirect(CONTEXT_URI + url + "?use...
var CONTEXT_URI = process.env.CONTEXT_URI; var _ = require('underscore'); var IntentManager = function () { }; IntentManager.prototype.process = function (intent, req, res) { var redirect = function (url) { console.log("And CONTEXT URI IS ->", CONTEXT_URI); res.redirect(CONTEXT_URI + url + "?use...
Use staging for confirmation while testing
Use staging for confirmation while testing
JavaScript
agpl-3.0
maximilianhp/api,1self/api,maximilianhp/api,1self/api,maximilianhp/api,1self/api,1self/api
--- +++ @@ -21,7 +21,7 @@ console.log("intentName -#-#->", intentName); if (intentName === "website_signup") { - res.redirect("http://1self.co/confirmation.html"); + res.redirect("http://www-staging.1self.co/confirmation.html"); } else if (intentName === "chart.comme...
33a3ba258d43af45e24370eaea2589aaae67f400
lib/display-message.js
lib/display-message.js
var DisplayLeaderboard = require('./display-leaderboard'); const $ = require('jquery'); function DisplayMessage(){ this.element = $('#post-game'); } DisplayMessage.prototype.showWinMessage = function(){ var div = this.element; div.empty() .show() .append(`<h1>You Win!</h1> <p>Click to pl...
var DisplayLeaderboard = require('./display-leaderboard'); const templates = require('./message-templates'); const $ = require('jquery'); function DisplayMessage(){ this.element = $('#post-game'); } DisplayMessage.prototype.showBoardMessage = function(template) { var div = this.element; div.empty() .show()...
Add generic full board display message method
Add generic full board display message method Currently used successfully by high score win
JavaScript
mit
plato721/lights-out,plato721/lights-out
--- +++ @@ -1,9 +1,17 @@ var DisplayLeaderboard = require('./display-leaderboard'); +const templates = require('./message-templates'); const $ = require('jquery'); function DisplayMessage(){ this.element = $('#post-game'); } + +DisplayMessage.prototype.showBoardMessage = function(template) { + var div = thi...
7958aeaebae2e082e4b38bbde1196ea2689c92cc
lib/stats/got-wrong.js
lib/stats/got-wrong.js
module.exports = function (stackName, id) { if (typeof id === 'string') { id = this.idByFront(stackName, id) } this.stacks[stackName][id].wrong += 1 }
var copy = require('../copy.js') module.exports = function (stack, id) { var newStack = copy(stack) if (typeof id === 'undefined') { // stack is not a stack - it's just a card, so update the card's wrong key newStack.wrong += 1 } else { newStack[id].wrong += 1 } return newStack }
Make f.gotWrong() work with actual arrays
Make f.gotWrong() work with actual arrays
JavaScript
isc
jamescostian/flashcardz
--- +++ @@ -1,6 +1,12 @@ -module.exports = function (stackName, id) { - if (typeof id === 'string') { - id = this.idByFront(stackName, id) +var copy = require('../copy.js') +module.exports = function (stack, id) { + var newStack = copy(stack) + if (typeof id === 'undefined') { + // stack is not a stack - it's just ...
3375cd1c123c1748a60aa99a642d9c6e662e65e1
examples/native/hello/__tests__/App.js
examples/native/hello/__tests__/App.js
import 'react-native'; import React from 'react'; import App from '../App'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( <App /> ); });
/* eslint-env jest */ import 'react-native'; import React from 'react'; import App from '../App'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { const tree = renderer.create( <App /> ); });
Fix lint for react-native example
Fix lint for react-native example
JavaScript
mit
pH200/cycle-react
--- +++ @@ -1,3 +1,4 @@ +/* eslint-env jest */ import 'react-native'; import React from 'react'; import App from '../App';
b9f1d530476f25baf38feeac29634be6a3b74a89
plugins/slack.js
plugins/slack.js
const LifeforcePlugin = require("../utils/LifeforcePlugin.js"); class SlackBot extends LifeforcePlugin { constructor(restifyserver, logger, name) { super(restifyserver, logger, name); this.apiMap = [ { path: "/api/slack/log", type: "post", ...
const LifeforcePlugin = require("../utils/LifeforcePlugin.js"); class SlackBot extends LifeforcePlugin { constructor(restifyserver, logger, name) { super(restifyserver, logger, name); this.apiMap = [ { path: "/api/slack/log", type: "post", ...
Add a new channel for deployment logging
Add a new channel for deployment logging
JavaScript
mit
repkam09/repka-lifeforce,repkam09/repka-lifeforce,repkam09/repka-lifeforce
--- +++ @@ -8,6 +8,11 @@ path: "/api/slack/log", type: "post", handler: handleSlackPush + }, + { + path: "/api/slack/deploy", + type: "post", + handler: handleSlackPushDeploy } ]...
6dafca6cf94bf82053d9218998f5cf960659f98b
samples/factorial/run.js
samples/factorial/run.js
var cobs = require('../..'), fs = require('fs'); var runtime = { display: function() { var result = ''; if (arguments && arguments.length) for (var k = 0; k < arguments.length; k++) if (arguments[k]) result += arguments[k].toString(); ...
var cobs = require('../..'), fs = require('fs'); var runtime = { display: function() { var result = ''; if (arguments && arguments.length) for (var k = 0; k < arguments.length; k++) if (arguments[k]) result += arguments[k].toString(); ...
Refactor factorial sample to use compileProgramFile
Refactor factorial sample to use compileProgramFile
JavaScript
mit
ajlopez/CobolScript
--- +++ @@ -15,14 +15,11 @@ } function runFile(filename) { - var text = fs.readFileSync(filename).toString(); - var parser = new cobs.Parser(text); - var program = parser.parseProgram(); - cobs.run(program.command.compile(program), runtime, program); + cobs.compileProgramFile(filename).run(runtime)...
cb5581744dc7503b29b52996c741723552e89c7f
test/test.ssh-config.js
test/test.ssh-config.js
'use strict' var expect = require('expect.js') var fs = require('fs') var path = require('path') var sshConfig = require('..') describe('ssh-config', function() { var fixture = fs.readFileSync(path.join(__dirname, 'fixture/config'), 'utf-8') var config = sshConfig.parse(fixture) it('.parse ssh config text int...
'use strict' var expect = require('expect.js') var fs = require('fs') var path = require('path') var sshConfig = require('..') describe('ssh-config', function() { var fixture = fs.readFileSync(path.join(__dirname, 'fixture/config'), 'utf-8') .replace(/\r\n/g, '\n') var config = sshConfig.parse(fixture) it...
Make sure the line endings are consistent
Make sure the line endings are consistent '\n' is the one we prefer. fixes #3
JavaScript
mit
dotnil/ssh-config
--- +++ @@ -8,6 +8,7 @@ describe('ssh-config', function() { var fixture = fs.readFileSync(path.join(__dirname, 'fixture/config'), 'utf-8') + .replace(/\r\n/g, '\n') var config = sshConfig.parse(fixture) it('.parse ssh config text into object', function() {
f853cacdb9479d302e30e59c2e190b77f9a81cc0
src/scripts/components/colour/Colour.js
src/scripts/components/colour/Colour.js
import React from 'react'; import Colours from '../../modules/colours'; const Colour = (props) => { var colour = props.colour; if (props.format === 'rgb') { var rgb = Colours.hexToRgb(colour.substring(1, 7)); colour = `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; } return ( <h2 className='colours__he...
import React from 'react'; import Colours from '../../modules/colours'; const Colour = (props) => { var colour = props.colour; if (props.format === 'rgb') { var rgb = Colours.hexToRgb(colour.substring(1, 7)); colour = `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`; } return ( <h2 className='colours__he...
Make only the colour code the copy region instead of entire row
Make only the colour code the copy region instead of entire row
JavaScript
mit
arkon/ColourNTP,arkon/ColourNTP
--- +++ @@ -12,7 +12,9 @@ } return ( - <h2 className='colours__hex copy' data-clipboard-text={colour}>{colour}</h2> + <h2 className='colours__hex'> + <span className='copy' data-clipboard-text={colour}>{colour}</span> + </h2> ); };
6d5ab9cfe13a7f6126e8eb15d1b31a33bea75923
server/worldGenerator.js
server/worldGenerator.js
'use strict'; const rethinkDB = require('rethinkdb'); const program = require('commander'); const log = require('./log'); var worldDB = 'labyrinth'; if (require.main === module) { program .version('0.0.1') .option('-p, --port <n>', 'Port for RethinkDB, default is 28015', parseInt, {isDefault: 28015}) .optio...
'use strict'; const rethinkDB = require('rethinkdb'); const program = require('commander'); const log = require('./log'); var worldDB = 'labyrinth'; if (require.main === module) { program .version('0.0.1') .option('-n, --dbname', 'Name of world database') .option('-p, --port <n>', 'Port for RethinkDB, defau...
Add color log in the world generator
Add color log in the world generator
JavaScript
mit
nobus/Labyrinth,nobus/Labyrinth
--- +++ @@ -10,20 +10,21 @@ if (require.main === module) { program .version('0.0.1') + .option('-n, --dbname', 'Name of world database') .option('-p, --port <n>', 'Port for RethinkDB, default is 28015', parseInt, {isDefault: 28015}) .option('-t, --test <n>', 'Create n Corals', parseInt) .parse(proces...
9ee199d4d6e08e8a2c7b12fee4c0b1b62dc5bc37
docker/generate-dockerfile.js
docker/generate-dockerfile.js
#!/usr/bin/env node var fs = require('fs'); var version = JSON.parse(fs.readFileSync("./package.json")).version; var tag = "truecar/gluestick:" + version; var dockerfile = [ "# DO NOT MODIFY", "# This file is automatically generated. You can copy this file and add a", ...
#!/usr/bin/env node var fs = require('fs'); var version = JSON.parse(fs.readFileSync("./package.json")).version; var tag = "truecar/gluestick:" + version; var dockerfile = [ "# DO NOT MODIFY", "# This file is automatically generated. You can copy this file and add a", ...
Remove build option from generated docker file
Remove build option from generated docker file
JavaScript
mit
TrueCar/gluestick,TrueCar/gluestick,TrueCar/gluestick
--- +++ @@ -15,7 +15,6 @@ "ADD . /app", "", "RUN npm install", - "RUN gluestick build", "" ];
c429bbab8a4ac3d9d637af8bc8cb10759ea65f5a
scripts/buildexamples.js
scripts/buildexamples.js
var childProcess = require('child_process'); var fs = require('fs'); process.chdir('examples'); childProcess.execSync('npm install', { stdio: 'inherit' }); childProcess.execSync('npm run update', { stdio: 'inherit' }); process.chdir('..'); // Build all of the example folders. dirs = fs.readdirSync('examples'); var c...
var childProcess = require('child_process'); var fs = require('fs'); process.chdir('examples'); childProcess.execSync('npm install', { stdio: 'inherit' }); childProcess.execSync('npm run update', { stdio: 'inherit' }); process.chdir('..'); // Build all of the example folders. dirs = fs.readdirSync('examples'); var c...
Make examples build more verbose
Make examples build more verbose
JavaScript
bsd-3-clause
jupyter/jupyter-js-notebook,jupyter/jupyter-js-notebook,blink1073/jupyter-js-notebook,jupyter/jupyter-js-notebook,blink1073/jupyter-js-notebook,blink1073/jupyter-js-notebook,blink1073/jupyter-js-notebook,jupyter/jupyter-js-notebook,blink1073/jupyter-js-notebook,jupyter/jupyter-js-notebook
--- +++ @@ -17,8 +17,10 @@ if (dirs[i].indexOf('node_modules') !== -1) { continue; } - console.log('Building: ' + dirs[i] + '...'); + console.log('\n***********\nBuilding: ' + dirs[i] + '...'); process.chdir('examples/' + dirs[i]); childProcess.execSync('npm run build', { stdio: 'inherit' }); pr...
03278cc191d9dea00ad8406a3e57c6c05f82eec0
lib/http/middleware/body-size-limiter.js
lib/http/middleware/body-size-limiter.js
var log = require('util/log'); function attachMiddleware(maxSize) { return function bodyDecoder(req, res, next) { var cl, bodyLen = 0; req.buffer = ''; cl = req.headers['content-length']; if (cl) { cl = parseInt(cl, 10); if (cl >= maxSize) { log.info('Denying client for too large...
var sprintf = require('sprintf').sprintf; var log = require('util/log'); var MAX_BUFFER_SIZE = 10 * 1024 * 1024; function attachMiddleware(maxSize) { if (maxSize > MAX_BUFFER_SIZE) { throw new Error(sprintf('Buffering more then %d bytes of data in memory is a bad idea', MAX_BUFFER_S...
Throw an error if someon wants to buffer too much data in memory.
Throw an error if someon wants to buffer too much data in memory.
JavaScript
apache-2.0
cloudkick/cast,cloudkick/cast,cloudkick/cast,cloudkick/cast
--- +++ @@ -1,6 +1,15 @@ +var sprintf = require('sprintf').sprintf; + var log = require('util/log'); +var MAX_BUFFER_SIZE = 10 * 1024 * 1024; + function attachMiddleware(maxSize) { + if (maxSize > MAX_BUFFER_SIZE) { + throw new Error(sprintf('Buffering more then %d bytes of data in memory is a bad idea', + ...
be765c9052ebd6d38663d13bf1468fc0fa6201ad
cli.js
cli.js
#!/usr/bin/env node 'use strict' var meow = require('meow') var hacktoberFest = require('./main.js') const cli = meow({ flags: { year: { type: 'number', alias: 'y', default: 0, }, help: { type: 'boolean', alias: 'h', }, }, }) if (cli.flags.help) { cli.showHelp(0) }...
#!/usr/bin/env node 'use strict' var meow = require('meow') var hacktoberFest = require('./main.js') const cli = meow(` Usage: $ npx hacktoberfeststats <username from GitHub> Options --help, -h Get this beautiful help panel --year, -y Specify the year you want to get stats from. Useful if you want ...
Add help text for the --help command
Add help text for the --help command
JavaScript
mit
MatejMecka/HacktoberfestStats
--- +++ @@ -4,7 +4,18 @@ var meow = require('meow') var hacktoberFest = require('./main.js') -const cli = meow({ +const cli = meow(` + Usage: + $ npx hacktoberfeststats <username from GitHub> + + Options + --help, -h Get this beautiful help panel + --year, -y Specify the year you want to get stats fr...
a526c4307dddb6b54521e4adbfed7dab596b313f
static/default/ckeditor/coorgConfig.js
static/default/ckeditor/coorgConfig.js
CKEDITOR.editorConfig = function( config ) { config.toolbar = 'Full'; config.toolbar_Full = [ ['Styles', '-', 'Bold','Italic', 'Underline','Strike', '-', 'NumberedList','BulletedList', '-', 'Link', 'Unlink', 'Image', '-', 'Undo', 'Redo', '-', 'Find', 'Replace', 'SelectAll'] ]; config....
CKEDITOR.editorConfig = function( config ) { config.toolbar = 'Full'; config.toolbar_Full = [ ['Styles', '-', 'Bold','Italic', 'Underline','Strike', '-', 'NumberedList','BulletedList', '-', 'Link', 'Unlink', 'Image', '-', 'Undo', 'Redo', '-', 'Find', 'Replace', 'SelectAll'] ]; config....
Fix the spellchecker nastyness in the rteditor
Fix the spellchecker nastyness in the rteditor
JavaScript
agpl-3.0
nathansamson/CoOrg,nathansamson/CoOrg,nathansamson/CoOrg
--- +++ @@ -15,6 +15,10 @@ config.resize_enabled = false; config.toolbarCanCollapse = false; config.stylesSet = 'coorg:coorgStyles.js'; - config.removePlugins = 'elementspath'; + config.removePlugins = 'elementspath,scayt'; + config.disableNativeSpellchecker = false; + + // If we choose...
c2dfec82e9d5a3157c9c82de5e74407fc584d94d
examples/navigation/epics/searchUsers.js
examples/navigation/epics/searchUsers.js
import { Observable } from 'rxjs/Observable'; import { LOCATION_CHANGE } from 'react-router-redux'; import { ajax } from 'rxjs/observable/dom/ajax'; import * as ActionTypes from '../actionTypes'; export default function searchUsers(action$) { const searchIntents$ = action$.ofType(LOCATION_CHANGE) .filter(({ payl...
import { Observable } from 'rxjs/Observable'; import { LOCATION_CHANGE } from 'react-router-redux'; import { ajax } from 'rxjs/observable/dom/ajax'; import * as ActionTypes from '../actionTypes'; export default function searchUsers(action$) { const searchIntents$ = action$.ofType(LOCATION_CHANGE) .filter(({ payl...
Make searchIntents be a stream of queries
chore(cleanup): Make searchIntents be a stream of queries
JavaScript
mit
redux-observable/redux-observable,blesh/redux-observable,jesinity/redux-observable,redux-observable/redux-observable,jesinity/redux-observable,redux-observable/redux-observable,jesinity/redux-observable,blesh/redux-observable
--- +++ @@ -7,16 +7,19 @@ const searchIntents$ = action$.ofType(LOCATION_CHANGE) .filter(({ payload }) => payload.pathname === '/' && !!payload.query.q - ); + ) + .map(action => action.payload.query.q); return Observable.merge( searchIntents$.map(() => ({ type: ActionTypes.SEARC...
e30e1eef1f324382992e8164c78bdb093100a890
test/helpers/citySuggestionFormatter.js
test/helpers/citySuggestionFormatter.js
import { assert } from 'chai'; import citySuggestionFormatter from 'helpers/citySuggestionFormatter'; describe('citySuggestionFormatter', () => { context('for a suggestion without name', () => { const suggestion = { zips: [12345, 67890] }; it('returns an empty string', () => { const actual = citySugge...
import { assert } from 'chai'; import citySuggestionFormatter from 'helpers/citySuggestionFormatter'; describe('citySuggestionFormatter', () => { context('for a null suggestion', () => { const suggestion = null; it('returns an empty string', () => { const actual = citySuggestionFormatter(suggestion); ...
Update tests for handling null city suggestion
Update tests for handling null city suggestion
JavaScript
apache-2.0
iris-dni/iris-frontend,iris-dni/iris-frontend,iris-dni/iris-frontend
--- +++ @@ -2,6 +2,17 @@ import citySuggestionFormatter from 'helpers/citySuggestionFormatter'; describe('citySuggestionFormatter', () => { + context('for a null suggestion', () => { + const suggestion = null; + + it('returns an empty string', () => { + const actual = citySuggestionFormatter(suggestio...
cd54817b284878f7f23f82454558af1d4c84ff0a
features/step_definitions/electionSteps.js
features/step_definitions/electionSteps.js
var chai = require('chai'); var Bluebird = require('bluebird'); var chaiAsPromised = require('chai-as-promised'); var localStorageService = require('../local-storage-service'); var expect = chai.expect; chai.use(chaiAsPromised); module.exports = function() { this.Given(/^There is an (in)?active election$/, functi...
var chai = require('chai'); var Bluebird = require('bluebird'); var chaiAsPromised = require('chai-as-promised'); var expect = chai.expect; chai.use(chaiAsPromised); module.exports = function() { this.Given(/^There is an (in)?active election$/, function(arg, callback) { var active = arg !== 'in'; ...
Add step for voting on elections
Add step for voting on elections
JavaScript
mit
webkom/vote,webkom/vote,webkom/vote,webkom/vote
--- +++ @@ -1,7 +1,6 @@ var chai = require('chai'); var Bluebird = require('bluebird'); var chaiAsPromised = require('chai-as-promised'); -var localStorageService = require('../local-storage-service'); var expect = chai.expect; chai.use(chaiAsPromised); @@ -18,7 +17,6 @@ var description = element(by.c...
cf96d6eb1814efa7330b71432920b928c0191bb6
app.js
app.js
var express = require('express'), app = express(), swig = require('swig'); var bodyParser = require('body-parser'); var https = require('https'), config = require('./config'); app.engine('html', swig.renderFile); app.set('view engine', 'html'); app.set('views', __dirname + '/pages'); app.set('view cache', false); sw...
var express = require('express'), app = express(), swig = require('swig'); var bodyParser = require('body-parser'); var https = require('https'), config = require('./config'); app.engine('html', swig.renderFile); app.set('view engine', 'html'); app.set('views', __dirname + '/pages'); app.set('view cache', false); sw...
Add access token to path URL
Add access token to path URL
JavaScript
mit
iveysaur/PiCi
--- +++ @@ -22,7 +22,7 @@ if (req.body && req.body.after) { console.log("checking: " + req.body.after); var request = https.request({ 'host': 'api.github.com', - 'path': '/repos/' + config.repoURL + '/status/' + req.body.after, + 'path': '/repos/' + config.repoURL + '/status/' + req.body.after + '?access...
7a0e7e56f7d70974c0c906085c884b76aac9bf3e
app.js
app.js
var Slack = require('slack-node'); apiToken = process.env.SLACK_TOKEN; slack = new Slack(apiToken); var channel = process.argv[2] ? "#"+process.argv[2] : '#kollegorna-ivan'; console.log(channel); var postMessage = function (message) { var icon_url = 'https://raw.githubusercontent.com/kollegorna/weatherbot/master/bo...
var Slack = require('slack-node'); apiToken = process.env.SLACK_TOKEN; slack = new Slack(apiToken); var channel = process.argv[2] ? "#"+process.argv[2] : '#kollegorna-ivan'; console.log(channel); var postMessage = function (message) { var icon_url = 'https://cdn.rawgit.com/kollegorna/weatherbot/master/bot.jpg'; sl...
Use Rawgit for the icon
Use Rawgit for the icon
JavaScript
mit
kollegorna/weatherbot
--- +++ @@ -7,7 +7,7 @@ console.log(channel); var postMessage = function (message) { - var icon_url = 'https://raw.githubusercontent.com/kollegorna/weatherbot/master/bot.jpg'; + var icon_url = 'https://cdn.rawgit.com/kollegorna/weatherbot/master/bot.jpg'; slack.api( 'chat.postMessage', { text: message, ch...
e01a9f024cf9a060c1fdf8a6f97e392bf5bf2414
validators/forgotten.js
validators/forgotten.js
var ForgotValidator = Ember.Object.create({ check: function (model) { var data = model.getProperties('email'), validationErrors = []; if (!validator.isEmail(data.email)) { validationErrors.push({ message: 'Invalid Email' }); } ret...
var ForgotValidator = Ember.Object.create({ check: function (model) { var data = model.getProperties('email'), validationErrors = []; if (!validator.isEmail(data.email)) { validationErrors.push({ message: 'Invalid email address' }); } ...
Update validation to match server error.
Update validation to match server error. When a using the forgottenRoute if you enter an incorrectly formatted email address you would see the error message 'Invalid Email', however if you entered an email address that was correctly formatted but missing the error message would be 'Invalid email address'. This fixes ...
JavaScript
mit
kevinansfield/Ghost-Admin,dbalders/Ghost-Admin,TryGhost/Ghost-Admin,airycanon/Ghost-Admin,kevinansfield/Ghost-Admin,acburdine/Ghost-Admin,dbalders/Ghost-Admin,TryGhost/Ghost-Admin,airycanon/Ghost-Admin,acburdine/Ghost-Admin,JohnONolan/Ghost-Admin,JohnONolan/Ghost-Admin
--- +++ @@ -5,7 +5,7 @@ if (!validator.isEmail(data.email)) { validationErrors.push({ - message: 'Invalid Email' + message: 'Invalid email address' }); }
2f2c6b69381473552c09f85823f245e9dc5eead9
chrome/content/overlay.js
chrome/content/overlay.js
function startup() { var myPanel = document.getElementById("my-panel"); myPanel.label = "Tor Enabled"; myPanel.style.color = "green"; } function onClickHandler(event) { switch(event.which) { case 1: alert("Torbutton for Thunderbird is currently enabled and is helping protect your anonymity.\n" + ...
function startup() { // Set the time zone to UTC. var env = Components.classes["@mozilla.org/process/environment;1"]. getService(Components.interfaces.nsIEnvironment); env.set('TZ', 'UTC'); var myPanel = document.getElementById("my-panel"); myPanel.label = "Tor Enabled"; myPanel...
Set time zone to UTC to prevent time zone leak
Set time zone to UTC to prevent time zone leak
JavaScript
bsd-2-clause
DigiThinkIT/TorBirdy,ioerror/torbirdy,viggyprabhu/torbirdy,kartikm/torbirdy,DigiThinkIT/TorBirdy,infertux/torbirdy,u451f/torbirdy,u451f/torbirdy,kartikm/torbirdy,viggyprabhu/torbirdy,ioerror/torbirdy,infertux/torbirdy
--- +++ @@ -1,4 +1,9 @@ function startup() { + // Set the time zone to UTC. + var env = Components.classes["@mozilla.org/process/environment;1"]. + getService(Components.interfaces.nsIEnvironment); + env.set('TZ', 'UTC'); + var myPanel = document.getElementById("my-panel"); myPane...
13dae0065fa4b26ef2e8d445ba28bf7f48b00b67
app/root.js
app/root.js
import React from 'react'; import { createStore, combineReducers, compose } from 'redux'; import { provide } from 'react-redux'; import * as reducers from './_reducers'; import { devTools, persistState } from 'redux-devtools'; import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; import { Router ...
import React from 'react'; import { createStore, combineReducers, compose } from 'redux'; import { Provider } from 'react-redux'; import * as reducers from './_reducers'; import { devTools, persistState } from 'redux-devtools'; import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; import { Router...
Update redux to version 2.0
Update redux to version 2.0
JavaScript
mit
binary-com/binary-next-gen,nuruddeensalihu/binary-next-gen,nazaninreihani/binary-next-gen,qingweibinary/binary-next-gen,nuruddeensalihu/binary-next-gen,qingweibinary/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary-next-gen,nuruddeensalihu/binary-next-gen,binary-com/binary-next-gen,nazaninreihani/binary...
--- +++ @@ -1,6 +1,6 @@ import React from 'react'; import { createStore, combineReducers, compose } from 'redux'; -import { provide } from 'react-redux'; +import { Provider } from 'react-redux'; import * as reducers from './_reducers'; import { devTools, persistState } from 'redux-devtools'; import { DevTools, D...
1c9c2763e16d9c176fab4a45616dbc8d4e5c02ac
app/adapters/employee.js
app/adapters/employee.js
import DS from 'ember-data'; export default DS.RESTAdapter.extend({ namespace: 'api', // /** // Get all employees from API // @method download // @return {Promise} resolves to `RecordArray` // */ // findAll() { // const empArray = { // "employee": [ // { // ...
import DS from 'ember-data'; export default DS.RESTAdapter.extend({ // namespace: 'api', host: 'http://q1q1.eu/employees/employees/list' });
Update adapter and default Ember calls
Update adapter and default Ember calls
JavaScript
mit
msm-app-devs/intranet-app,msm-app-devs/intranet-app
--- +++ @@ -1,55 +1,6 @@ import DS from 'ember-data'; export default DS.RESTAdapter.extend({ - namespace: 'api', - - // /** - // Get all employees from API - // @method download - // @return {Promise} resolves to `RecordArray` - // */ - // findAll() { - // const empArray = { - // "employee": ...
2679bf719318c6eeacbdf4fc8726f6129ebcda52
repositories/ReleaseNotesRepository.js
repositories/ReleaseNotesRepository.js
'use strict'; const BaseRepository = require('@gfcc/mongo-tenant-repository/BaseRepository'); class ReleaseNotesRepository extends BaseRepository { getSchemaDefinition() { const MixedType = this.getSchemaTypes().Mixed; return { scope: { type: String, 'default': 'global', required: true }, name:...
'use strict'; const BaseRepository = require('@gfcc/mongo-tenant-repository/BaseRepository'); class ReleaseNotesRepository extends BaseRepository { getSchemaDefinition() { const MixedType = this.getSchemaTypes().Mixed; return { scope: { type: String, 'default': 'global', required: true }, name:...
Add support for retrieving a list of the latest release notes entries.
Add support for retrieving a list of the latest release notes entries.
JavaScript
mit
release-notes/release-notes-hub,release-notes/release-notes-hub
--- +++ @@ -53,6 +53,27 @@ return this; } + + /** + * Retrieve a list of the nth newest release notes. + * + * @param {number} count + * @param {function} callback + */ + findNewest(count, callback) { + this.findList({}, { + limit: count, + sort: { + createdAt: -1 + } + ...
82fa80d83d69ef63d7f1642234d88c75b8d026c6
.prettierrc.js
.prettierrc.js
// This file is here, in part, so that users whose code editors are // set to automatically format files with Prettier have a config to detect. // Many users only run Prettier when a config is present, so this file makes // sure one can be detected, even though we aren't doing anything with it. module.exports = { ...r...
/** * Provides API functions to create a datastore for notifications. * * Site Kit by Google, Copyright 2021 Google 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 * * https:...
Add header to Prettier RC file.
Add header to Prettier RC file.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
--- +++ @@ -1,3 +1,21 @@ +/** + * Provides API functions to create a datastore for notifications. + * + * Site Kit by Google, Copyright 2021 Google 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...
2ae2e456c3cdfce40640e8b6827b43c733e09393
input/composites/_observable.js
input/composites/_observable.js
'use strict'; var noop = require('es5-ext/function/noop') , callable = require('es5-ext/object/valid-callable') , d = require('d') , DOMInput = require('../_composite') , getPrototypeOf = Object.getPrototypeOf , getInputValue = Object.getOwnPropertyDescriptor(DOMInput.prototype, 'inputValue').get...
'use strict'; var last = require('es5-ext/array/#/last') , noop = require('es5-ext/function/noop') , mapKeys = require('es5-ext/object/map-keys') , callable = require('es5-ext/object/valid-callable') , d = require('d') , splitId = require('dbjs/_setup/unserialize/id') , DOMInput = require(...
Fix resolution of value in composites
Fix resolution of value in composites
JavaScript
mit
medikoo/dbjs-dom
--- +++ @@ -1,12 +1,16 @@ 'use strict'; -var noop = require('es5-ext/function/noop') +var last = require('es5-ext/array/#/last') + , noop = require('es5-ext/function/noop') + , mapKeys = require('es5-ext/object/map-keys') , callable = require('es5-ext/object/valid-callable') , d = requi...
343eb4ac8db46106418cb60d820d6ec33990e07e
source/main/menus/osx.js
source/main/menus/osx.js
export const osxMenu = (app, window, openAbout) => ( [{ label: 'Daedalus', submenu: [{ label: 'About', click() { openAbout(); }, }, { label: 'Quit', accelerator: 'Command+Q', click: () => app.quit() }] }, { label: 'Edit', submenu: [{ label: '...
export const osxMenu = (app, window, openAbout) => ( [{ label: 'Daedalus', submenu: [{ label: 'About', click() { openAbout(); }, }, { label: 'Quit', accelerator: 'Command+Q', click: () => app.quit() }] }, { label: 'Edit', submenu: [{ label: '...
Use role instead of selector in macOS menu
[DDW-160] Use role instead of selector in macOS menu
JavaScript
apache-2.0
input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus
--- +++ @@ -16,29 +16,29 @@ submenu: [{ label: 'Undo', accelerator: 'Command+Z', - selector: 'undo:' + role: 'undo' }, { label: 'Redo', accelerator: 'Shift+Command+Z', - selector: 'redo:' + role: 'redo' }, { type: 'separator' }, { label...
dcc5abe8709cf7ec9dfd0a30ed187d79b801e9a1
extension/src/json-viewer/check-if-json.js
extension/src/json-viewer/check-if-json.js
var extractJSON = require('./extract-json'); function getPreWithSource() { var childNodes = document.body.childNodes; var pre = childNodes[0]; if (childNodes.length === 1 && pre.tagName === "PRE") return pre return null } function isJSON(jsonStr) { var str = jsonStr; if (!str || str.length === 0) return...
var extractJSON = require('./extract-json'); function getPreWithSource() { var childNodes = document.body.childNodes; if (childNodes.length === 1) { var childNode = childNodes[0]; if (childNode.nodeName === "PRE") { return childNode; } else if (childNode.nodeName === "#text") { // if Content-T...
Make it work if the content-type is text/html
Make it work if the content-type is text/html
JavaScript
mit
tulios/json-viewer,tulios/json-viewer
--- +++ @@ -2,29 +2,44 @@ function getPreWithSource() { var childNodes = document.body.childNodes; - var pre = childNodes[0]; - if (childNodes.length === 1 && pre.tagName === "PRE") return pre + + if (childNodes.length === 1) { + + var childNode = childNodes[0]; + + if (childNode.nodeName === "PRE") { ...
d0797bff3ff553a701f775e1925e576563690ae7
addon/services/portal.js
addon/services/portal.js
import Service from 'ember-service'; import { scheduleOnce } from 'ember-runloop'; import Ember from 'ember'; const ADDED_QUEUE = Ember.A(); const REMOVED_QUEUE = Ember.A(); export default Service.extend({ portals: null, init() { this._super(...arguments); this.set("portals", {}); }, itemsFor(name) ...
import Service from 'ember-service'; import { scheduleOnce } from 'ember-runloop'; import Ember from 'ember'; const ADDED_QUEUE = Ember.A(); const REMOVED_QUEUE = Ember.A(); export default Service.extend({ portals: null, init() { this._super(...arguments); this.set("portals", {}); }, itemsFor(name) ...
Remove support for Ember 1.13.x
Remove support for Ember 1.13.x
JavaScript
mit
minutebase/ember-portal,minutebase/ember-portal
--- +++ @@ -24,12 +24,6 @@ }, addPortalContent(name, component) { - if (this.addToQueueInReverse()) { - ADDED_QUEUE.unshift({ name, component }); - } else { - ADDED_QUEUE.push({ name, component }); - } - scheduleOnce("afterRender", this, this.flushPortalContent); }, @@ -49,11 +43,...
a6971d097a2362f091a598a4b0443f3f76ddf443
app/beautification.js
app/beautification.js
const $ = require('jquery'); fateBus.subscribe(module, 'fate.init', function() { GM_addStyle(GM_getResourceText('fateOfAllFoolsCSS')); }); // Remove the subclass icons fateBus.subscribe(module, 'fate.refresh', function() { $('[title~="Subclass"]').parents('.store-row').siblings('.title:contains(Weapons)').sibling...
const $ = require('jquery'); fateBus.subscribe(module, 'fate.init', function() { GM_addStyle(GM_getResourceText('fateOfAllFoolsCSS')); }); // Remove the subclass icons fateBus.subscribe(module, 'fate.refresh', function() { // AFAIK this is a serial number that shouldn't change between versions...? $('.bucket-32...
Remove the weapons section title and the subclass icons
Remove the weapons section title and the subclass icons
JavaScript
mit
rslifka/fate_of_all_fools,rslifka/fate_of_all_fools
--- +++ @@ -6,10 +6,11 @@ // Remove the subclass icons fateBus.subscribe(module, 'fate.refresh', function() { - $('[title~="Subclass"]').parents('.store-row').siblings('.title:contains(Weapons)').siblings('.store-row:eq(0)').attr('style', 'display:none'); + // AFAIK this is a serial number that shouldn't change...
a75fc69d414f94a2ebf1d5762a1e5f5c4e6fe43f
commands/help_commands.js
commands/help_commands.js
module.exports = { help: (message, config) => { const p = config.prefix; message.channel.send( `\`\`\`diff ++ MUSIC COMMANDS ++ ${p}play URL - Plays a song at a YouTube URL. ${p}stop - Interrupts the current song. ${p}queue - Says the current queue. ${p}pleasestop - Clears the queue and inte...
module.exports = { help: (message, config) => { const p = config.prefix; message.channel.send( `\`\`\`diff ++ MUSIC COMMANDS ++ ${p}play URL - Plays a song at a YouTube URL. ${p}stop - Interrupts the current song. ${p}queue - Says the current queue. ${p}clearqueue - Clears the queue. ${p}ple...
Add togglepause command documentation and change command order
Add togglepause command documentation and change command order
JavaScript
mit
Rafer45/soup
--- +++ @@ -8,8 +8,9 @@ ${p}play URL - Plays a song at a YouTube URL. ${p}stop - Interrupts the current song. ${p}queue - Says the current queue. +${p}clearqueue - Clears the queue. ${p}pleasestop - Clears the queue and interrupts the current song. -${p}clearqueue - Clears the queue. +${p}togglepause - Pau...
1ece057bddc68153a3e1d5984f513497aa476d27
app/controllers/index.js
app/controllers/index.js
// Opening the first window and controller Alloy.Globals.openWindow(Alloy.Globals.menuOptions[0]); // From the slide-menu widget trigger this event to open every menu section Ti.App.addEventListener('openSection', function(option) { if (option.first) { Alloy.Globals.navcontroller.home(); } else { ...
// Opening the first window and controller Alloy.Globals.openWindow(Alloy.Globals.menuOptions[0]); // From the slide-menu widget trigger this event to open every menu section Ti.App.addEventListener('openSection', function(option) { Ti.App.fireEvent('toggleSlide'); // this one is to close the slide menu if (o...
Fix the duplicated toggleSlide event
Fix the duplicated toggleSlide event
JavaScript
apache-2.0
dotCMS/dotcms-mobile-app,dotCMS/dotcms-mobile-app
--- +++ @@ -3,12 +3,13 @@ // From the slide-menu widget trigger this event to open every menu section Ti.App.addEventListener('openSection', function(option) { + Ti.App.fireEvent('toggleSlide'); // this one is to close the slide menu + if (option.first) { Alloy.Globals.navcontroller.home(); ...
9a25d927548fe618d2e0f4b7294185c61fe8bf7a
app/js/controllers.js
app/js/controllers.js
'use strict'; /* Controllers */ var cvAppControllers = angular.module('cvAppControllers', []); cvAppControllers.controller('HomeController', ['$scope', function($scope) { $scope.name = 'Elias'; }]); cvAppControllers.controller('AboutController', ['$scope', function($scope) { $scope.name = 'Elias'; }]); /* phone...
'use strict'; /* Controllers */ var cvAppControllers = angular.module('cvAppControllers', []); cvAppControllers.controller('HomeController', ['$scope', function($scope) { $scope.name = 'Elias'; }]); /* cvAppControllers.controller('AboutController', ['$scope', function($scope) { $scope.name = 'Elias'; }]); */ /...
Add correct tutorial controller (commented)
Add correct tutorial controller (commented)
JavaScript
mit
RegularSvensson/cvApp,RegularSvensson/cvApp
--- +++ @@ -8,17 +8,20 @@ $scope.name = 'Elias'; }]); + + +/* cvAppControllers.controller('AboutController', ['$scope', function($scope) { $scope.name = 'Elias'; }]); - +*/ /* -phonecatApp.controller('PhoneListCtrl', function ($scope, $http) { - $http.get('phones/phones.json').success(function(data) { - ...
19c3a5c0232f140b00cad1261c0d40823e003d87
ghost/admin/routes/settings/users/index.js
ghost/admin/routes/settings/users/index.js
import AuthenticatedRoute from 'ghost/routes/authenticated'; import PaginationRouteMixin from 'ghost/mixins/pagination-route'; import styleBody from 'ghost/mixins/style-body'; var paginationSettings, UsersIndexRoute; paginationSettings = { page: 1, limit: 20, status: 'active' }; UsersIndexRoute = Aut...
import AuthenticatedRoute from 'ghost/routes/authenticated'; import PaginationRouteMixin from 'ghost/mixins/pagination-route'; import styleBody from 'ghost/mixins/style-body'; var paginationSettings, UsersIndexRoute; paginationSettings = { page: 1, limit: 20, status: 'active' }; UsersIndexRoute = Aut...
Add self to list of filtered users for editors
Add self to list of filtered users for editors Closes #4412
JavaScript
mit
TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost
--- +++ @@ -31,7 +31,7 @@ return self.store.filter('user', paginationSettings, function (user) { if (currentUser.get('isEditor')) { - return user.get('isAuthor'); + return user.get('isAuthor') || user === currentUser; ...
27cad60ff3ec93e202e54fb1831a3254f70c3753
app/routes.js
app/routes.js
module.exports = { bind : function (app) { app.get('/', function (req, res) { res.render('index'); }); // demo URL - essentially describing what the URL structure could be app.get('/property/PL20_7HE/25_UNDERWAYS_YELVERTON', function (req, res) { res.render('property-page/demo/index'); ...
module.exports = { bind : function (app) { app.get('/', function (req, res) { res.render('index'); }); // demo URL - essentially describing what the URL structure could be app.get('/property/PL20_7HE/25_UNDERWAYS_YELVERTON', function (req, res) { res.render('property-page/demo/index'); ...
Add a route to carry email address into next form page
Add a route to carry email address into next form page
JavaScript
mit
LandRegistry/property-page-html-prototypes,LandRegistry/property-page-html-prototypes
--- +++ @@ -10,5 +10,10 @@ res.render('property-page/demo/index'); }); + // Prepopulate email field in Create account screen (v7) + app.get('/digital-register/journeys/v7/create-account', function(req, res) { + res.render('digital-register/journeys/v7/create-account', {'email' : req.query.ema...
515ed2eec3ee0549baae9883a66b7247ef5d482b
lib/compatipede.js
lib/compatipede.js
"use strict"; let jobModel, campaignModel, tabSequence, serialExecutor, args, JobModel = require('./models/job'), CampaignModel = require('./models/campaign'), TabSequence = require('./tabSequence'), SerialExecutor = require('./serialExecutor'), logger = require('./logger')('compatipede'), async = require(...
"use strict"; let jobModel, campaignModel, tabSequence, serialExecutor, args, JobModel = require('./models/job'), CampaignModel = require('./models/campaign'), TabSequence = require('./tabSequence'), SerialExecutor = require('./serialExecutor'), logger = require('./logger')('compatipede'), async = require(...
Fix - read github issues
Fix - read github issues
JavaScript
mpl-2.0
mozilla/compatipede,mozilla/compatipede,mozilla/compatipede
--- +++ @@ -44,7 +44,7 @@ function execute() { async.series([ - // require('./githubDispatcher').bind(null, args), + require('./githubDispatcher').bind(null, args), serialExecutor.loop.bind(serialExecutor) ], (error) => { if(error) {
7545e8064f5bcd05dfeefa446abe4529a4720cb6
src/index.js
src/index.js
import titleScreen from 'titlescreen'; import Scene from 'scene'; import state from 'state'; import loop from 'loop'; import { updateInputs } from 'controls'; import { render } from 'ui'; import { clear } from 'pura/canvas/tuple'; import Atarify from 'shader'; Scene(titleScreen); loop((dt) => { clear(); state.log...
import titleScreen from 'titlescreen'; import Scene from 'scene'; import state from 'state'; import loop from 'loop'; import { updateInputs } from 'controls'; import { render } from 'ui'; import { clear } from 'pura/canvas/tuple'; Scene(titleScreen); loop((dt) => { clear(); state.logic && state.logic(); render(...
Remove Atari shader until it can be optimized.
Remove Atari shader until it can be optimized.
JavaScript
mit
HyphnKnight/js13k-2017,HyphnKnight/js13k-2017
--- +++ @@ -5,7 +5,6 @@ import { updateInputs } from 'controls'; import { render } from 'ui'; import { clear } from 'pura/canvas/tuple'; -import Atarify from 'shader'; Scene(titleScreen); @@ -13,6 +12,5 @@ clear(); state.logic && state.logic(); render(dt); - Atarify(); updateInputs(); });
26776afeb2568ea1a930b3d7d30141015c28aa57
localization/jquery-ui-timepicker-ru.js
localization/jquery-ui-timepicker-ru.js
/* Russian translation for the jQuery Timepicker Addon */ /* Written by Trent Richardson */ (function($) { $.timepicker.regional['ru'] = { timeOnlyTitle: 'Выберите время', timeText: 'Время', hourText: 'Часы', minuteText: 'Минуты', secondText: 'Секунды', millisecText: 'Миллисекунды', timezoneText: 'Время ...
/* Russian translation for the jQuery Timepicker Addon */ /* Written by Trent Richardson */ (function($) { $.timepicker.regional['ru'] = { timeOnlyTitle: 'Выберите время', timeText: 'Время', hourText: 'Часы', minuteText: 'Минуты', secondText: 'Секунды', millisecText: 'Миллисекунды', timezoneText: 'Часово...
Update Russian translation by Sanek
Update Russian translation by Sanek
JavaScript
mit
nicofrand/jQuery-Timepicker-Addon,ssyang0102/jQuery-Timepicker-Addon,trentrichardson/jQuery-Timepicker-Addon,gaissa/jQuery-Timepicker-Addon,ristovskiv/jQuery-Timepicker-Addon,ssyang0102/jQuery-Timepicker-Addon,nicofrand/jQuery-Timepicker-Addon,Youraiseme/jQuery-Timepicker-Addon,brenosilver/jQuery-Timepicker-Addon,breno...
--- +++ @@ -8,8 +8,8 @@ minuteText: 'Минуты', secondText: 'Секунды', millisecText: 'Миллисекунды', - timezoneText: 'Время зоны', - currentText: 'Теперь', + timezoneText: 'Часовой пояс', + currentText: 'Сейчас', closeText: 'Закрыть', timeFormat: 'hh:mm tt', amNames: ['AM', 'A'],
420d98ab2e5120c45fd9a39f92308268fd04b92d
app/services/fastboot.js
app/services/fastboot.js
import Ember from "ember"; let alias = Ember.computed.alias; let computed = Ember.computed; export default Ember.Service.extend({ cookies: alias('_fastbootInfo.cookies'), headers: alias('_fastbootInfo.headers'), host: computed(function() { return this._fastbootInfo.host(); }) });
import Ember from "ember"; let alias = Ember.computed.alias; let computed = Ember.computed; export default Ember.Service.extend({ cookies: alias('_fastbootInfo.cookies'), headers: alias('_fastbootInfo.headers'), host: computed(function() { return this._fastbootInfo.host(); }), isFastboot: computed(funct...
Add isFastboot property to service
Add isFastboot property to service
JavaScript
mit
habdelra/ember-cli-fastboot,rwjblue/ember-cli-fastboot,josemarluedke/ember-cli-fastboot,kratiahuja/ember-cli-fastboot,kratiahuja/ember-cli-fastboot,ember-fastboot/ember-cli-fastboot,josemarluedke/ember-cli-fastboot,habdelra/ember-cli-fastboot,ember-fastboot/ember-cli-fastboot,tildeio/ember-cli-fastboot,rwjblue/ember-cl...
--- +++ @@ -8,5 +8,8 @@ headers: alias('_fastbootInfo.headers'), host: computed(function() { return this._fastbootInfo.host(); + }), + isFastboot: computed(function() { + return typeof window.document === 'undefined'; }) });
d8cfee019a1e987e1278eec3141733bf5903d896
src/index.js
src/index.js
var express = require('express'); var app = express(); var cors = require('cors') var Notes = require('./domain/Notes'); var notes = new Notes(); var Users = require('./domain/Users'); var users = new Users(); /* enable cors */ app.use(cors({ "credentials": true, "origin": true })); /* inject test data */ var Te...
var express = require('express'); var app = express(); var cors = require('cors') var Notes = require('./domain/Notes'); var notes = new Notes(); var Users = require('./domain/Users'); var users = new Users(); /* enable cors */ app.use(cors({ "credentials": true, "origin": true, "methods": ["GET","HEAD","PUT","PA...
Allow all methods as allowed methods for CORS
Allow all methods as allowed methods for CORS
JavaScript
mit
DracoBlue/hateoas-notes,DracoBlue/hateoas-notes
--- +++ @@ -11,7 +11,8 @@ app.use(cors({ "credentials": true, - "origin": true + "origin": true, + "methods": ["GET","HEAD","PUT","PATCH","POST","DELETE", "OPTIONS"] })); /* inject test data */
dbd401be6bae38cf3590891b5a71f4c71c23cfdb
src/components/Header.js
src/components/Header.js
"use strict"; import React, { Component } from 'react'; // Bootstrap import { Grid, Row, Col, Navbar, NavItem, Nav } from 'react-bootstrap'; export default class Header extends Component { render() { return( <Navbar inverse fixedTop> <Navbar.Header> <Navbar.Brand> <img src='/assets/...
"use strict"; import React, { Component } from 'react'; // Bootstrap import { Grid, Row, Col, Navbar, NavItem, Nav } from 'react-bootstrap'; export default class Header extends Component { render() { return( <Navbar inverse fixedTop> <Navbar.Header> <Navbar.Brand> <img src='http://l...
Fix link to nyc logo with temporary pointer to webpack-dev-server
Fix link to nyc logo with temporary pointer to webpack-dev-server
JavaScript
mit
codeforamerica/nyc-january-project,codeforamerica/nyc-january-project
--- +++ @@ -11,7 +11,7 @@ <Navbar inverse fixedTop> <Navbar.Header> <Navbar.Brand> - <img src='/assets/img/nyc-logo.png' /> + <img src='http://localhost:8081/assets/img/nyc-logo.png' /> </Navbar.Brand> <Navbar.Toggle /> </Navbar.Header>
a3b6923b20154acd28f2df99a01a08416074194a
src/formatter.js
src/formatter.js
'use strict'; module.exports = function (err, data, pkgPath) { if (err) { return 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n' + err; } var pipeWrap = function (items) { return '|' + items.join('|') + '|'; }; var rows = []; rows.push( pipeWrap( ['Name', 'Installed...
'use strict'; module.exports = function (err, data, pkgPath) { if (err) { return 'Debug output: ' + JSON.stringify(Buffer.isBuffer(data) ? data.toString() : data) + '\n' + err; } var pipeWrap = function (items) { return '|' + items.join('|') + '|'; }; var rows = []; rows.push( pipeWrap( ['Name', 'Installed...
Make header and actual header
Make header and actual header
JavaScript
apache-2.0
dap/nsp-formatter-remarkup
--- +++ @@ -11,6 +11,7 @@ var rows = []; rows.push( pipeWrap( ['Name', 'Installed', 'Patched', 'Include Path', 'More Info'] ) ); + rows.push( pipeWrap( ['--', '--', '--', '--', '--'] ) ); data.forEach( function (finding) { rows.push(
b7178d0e2b5afda361e5c713cca2853a91b2a711
src/commands/commands.js
src/commands/commands.js
'use strict'; // This is a very simple interface // Used to fire up gulp task in your local project var runner = require('../utils/runner'), cb = require('../utils/callback'), argv = require('minimist')(process.argv.slice(2)); var commands = function(options) { var command = argv._[0] || options.parent.rawA...
'use strict'; // This is a very simple interface // Used to fire up gulp task in your local project var runner = require('../utils/runner'), cb = require('../utils/callback'), argv = require('minimist')(process.argv.slice(2)); var commands = function(options) { var command = argv._[0] || options.parent.rawA...
Fix switch removing regex and adding alias for serve and build
Fix switch removing regex and adding alias for serve and build
JavaScript
mit
mattma/ember-rocks,mattma/ember-rocks,mattma/ember-rocks
--- +++ @@ -10,9 +10,11 @@ var command = argv._[0] || options.parent.rawArgs[2]; switch( command ) { case 'serve': + case 's': runner(cb, 'serve'); break; case 'build': + case 'b': runner(cb, 'release'); break; default:
5565536bc06325e341c5e028ea68581fa56ea9b1
src/js/update.js
src/js/update.js
export default function update( scene, dt, callback ) { scene.traverse( object => { if ( object.update ) { object.update( dt, scene ); } if ( callback ) { callback( object ); } }); }
export default function update( scene, dt, callback ) { scene.traverse( object => { if ( object.update ) { object.update( dt, scene ); } if ( callback ) { callback( object ); } }); } export function lateUpdate( scene, callback ) { scene.traverse( object => { if ( object.lateUpdat...
Add lateUpdate() scene traversal function.
Add lateUpdate() scene traversal function.
JavaScript
mit
razh/flying-machines,razh/flying-machines
--- +++ @@ -9,3 +9,15 @@ } }); } + +export function lateUpdate( scene, callback ) { + scene.traverse( object => { + if ( object.lateUpdate ) { + object.lateUpdate( scene ); + } + + if ( callback ) { + callback( object ); + } + }); +}
3c625f29e98160e6c0c047e348caac8c102c0e94
src/rules.js
src/rules.js
/** * Rule to apply. * * @typedef {Object} Rule * @property {string} message - Rule message to be shown on violation. * @property {RuleChecker} check - Function that checks for violations. */ /** * Rule checker function. * * @callback RuleChecker * @arg {Comment} comment - Comment to check. * @arg {functio...
/** * Rule to apply. * * @typedef {Object} Rule * @property {string} name - Rule name, must be url-safe (@see RFC 3986, section 2.3). * @property {string} message - Rule message to be shown on violation. * @property {RuleChecker} check - Function that checks for violations. */ /** * Rule checker function. * ...
Add name property to the Rule description
Add name property to the Rule description
JavaScript
mit
eush77/js-comment-check
--- +++ @@ -2,6 +2,7 @@ * Rule to apply. * * @typedef {Object} Rule + * @property {string} name - Rule name, must be url-safe (@see RFC 3986, section 2.3). * @property {string} message - Rule message to be shown on violation. * @property {RuleChecker} check - Function that checks for violations. */
16475e372a2dbcd5aef35bd7c13ac4c439f943ad
src/scene.js
src/scene.js
import addable from 'flockn/addable'; import Base from 'flockn/base'; import GameObject from 'flockn/gameobject'; import renderable from 'flockn/renderable'; import updateable from 'flockn/updateable'; // A `Scene` instance is a layer for `GameObject` instances. // Any number of game objects can be added to a scene. O...
import Base from 'flockn/base'; import GameObject from 'flockn/gameobject'; import {addable, renderable, updateable} from 'flockn/mixins'; // A `Scene` instance is a layer for `GameObject` instances. // Any number of game objects can be added to a scene. Only one scene should be visible at the same time, depending //...
Use new mixin structure in game module
Use new mixin structure in game module
JavaScript
mit
freezedev/flockn,freezedev/flockn
--- +++ @@ -1,8 +1,7 @@ -import addable from 'flockn/addable'; import Base from 'flockn/base'; import GameObject from 'flockn/gameobject'; -import renderable from 'flockn/renderable'; -import updateable from 'flockn/updateable'; + +import {addable, renderable, updateable} from 'flockn/mixins'; // A `Scene` insta...
63e6c40710e0f1d0b2d2713ea06a179b68ba3467
src/utils.js
src/utils.js
export function getInterfaceLanguage() { if (!!navigator && !!navigator.language) { return navigator.language; } else if (!!navigator && !!navigator.languages && !!navigator.languages[0]) { return navigator.languages[0]; } else if (!!navigator && !!navigator.userLanguage) { return navigator.userLangua...
export function getInterfaceLanguage() { const defaultLang = 'en-US'; // Check if it's running on server side if (typeof window === 'undefined') { return defaultLang; } if (!!navigator && !!navigator.language) { return navigator.language; } else if (!!navigator && !!navigator.languages && !!navig...
Fix server side error on navigator object
Fix server side error on navigator object
JavaScript
mit
stefalda/react-localization
--- +++ @@ -1,4 +1,11 @@ export function getInterfaceLanguage() { + const defaultLang = 'en-US'; + + // Check if it's running on server side + if (typeof window === 'undefined') { + return defaultLang; + } + if (!!navigator && !!navigator.language) { return navigator.language; } else if (!!navigat...
e99015cfacc675982f6be0e814eb1c1a650a15b5
lib/client/error_reporters/window_error.js
lib/client/error_reporters/window_error.js
var prevWindowOnError = window.onerror; window.onerror = function(message, url, line, stack) { var now = Date.now(); stack = stack || 'window@'+url+':'+line+':0'; Kadira.sendErrors([{ appId : Kadira.options.appId, name : 'Error: ' + message, source : 'client', startTime : now, type : 'window.o...
var prevWindowOnError = window.onerror; window.onerror = function(message, url, line, stack) { var now = Date.now(); if(typeof stack !== 'object') { // if there's a fourth argument it must be the column number var colNumber = stack || 0; stack = 'window@'+url+':'+line+':'+colNumber; } // stacktrac...
Check if fourth argument is an object and normalize with stacktrace.js
Check if fourth argument is an object and normalize with stacktrace.js
JavaScript
mit
chatr/kadira,meteorhacks/kadira
--- +++ @@ -1,7 +1,17 @@ var prevWindowOnError = window.onerror; window.onerror = function(message, url, line, stack) { var now = Date.now(); - stack = stack || 'window@'+url+':'+line+':0'; + + if(typeof stack !== 'object') { + // if there's a fourth argument it must be the column number + var colNumber ...
fa6fcde46903d797a20f54dd88f3a880f4b98025
cfgov/unprocessed/js/routes/sheer.js
cfgov/unprocessed/js/routes/sheer.js
/* ========================================================================== Common scripts that are used on old sheer templates These should be removed as templates are moved to wagtail ========================================================================== */ 'use strict'; // List of modules often used...
/* ========================================================================== Common scripts that are used on old sheer templates These should be removed as templates are moved to wagtail ========================================================================== */ 'use strict'; // List of modules often used...
Fix for In This Section expandable
Fix for In This Section expandable
JavaScript
cc0-1.0
kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh
--- +++ @@ -18,7 +18,7 @@ } } -var expandableDom = document.querySelectorAll( '.content_main .m-expandable' ); +var expandableDom = document.querySelectorAll( '.content .m-expandable' ); var expandable; if ( expandableDom ) { for ( var i = 0, len = expandableDom.length; i < len; i++ ) {
b09bcd37195c694314ab0e35a0cbad8b3570694f
src/containers/Canvas.js
src/containers/Canvas.js
import { connect } from 'react-redux' import Canvas from '../components/Canvas' function mapStateToProps(state) { return { image: state.inputImage } } function mapDispatchToProps() { return {} } export default connect(mapStateToProps, mapDispatchToProps)(Canvas)
import { connect } from 'react-redux' import Canvas from '../components/Canvas' function mapStateToProps(state) { return { image: state.inputImage.image } } function mapDispatchToProps() { return {} } export default connect(mapStateToProps, mapDispatchToProps)(Canvas)
Update for size in props
Update for size in props
JavaScript
mit
bikevit2008/Interface,bikevit2008/Interface
--- +++ @@ -5,7 +5,7 @@ function mapStateToProps(state) { return { - image: state.inputImage + image: state.inputImage.image } }
d9bc92ed679094e984fcb76331c104dd407187f3
src/utils/CSS.js
src/utils/CSS.js
import CleanCSS from 'clean-css'; export default { // Validate against common CSS vulnerabilities. raiseOnUnsafeCSS: (css = '', foundInName = '\'not provided\'') => { css = new CleanCSS({ shorthandCompacting: false }).minify(css).styles; if (css.match(/-moz-binding/i)) { throw new Error(`U...
import CleanCSS from 'clean-css'; export default { // Validate against common CSS vulnerabilities. raiseOnUnsafeCSS: (css = '', foundInName = '\'not provided\'') => { css = new CleanCSS({ shorthandCompacting: false }).minify(css).styles; if (css.match(/-moz-binding/i)) { throw new Error(`U...
Remove checks for closing style tag since clean-css is already taking care of it
refactor(css): Remove checks for closing style tag since clean-css is already taking care of it
JavaScript
mit
revivek/oy,oysterbooks/oy
--- +++ @@ -11,8 +11,6 @@ throw new Error(`Unsafe CSS found in ${foundInName}: "-moz-binding"`); } else if (css.match(/expression/i)) { throw new Error(`Unsafe CSS found in ${foundInName}: "expression"`); - } else if (css.match(/<\/style>/i)) { - throw new Error(`Unsafe CSS found in ${found...
41cea4b65d284b91db9949e951058512fe93204e
lib/actions/update-version.js
lib/actions/update-version.js
'use babel'; import UpdateVersionView from '../views/UpdateVersionView'; import yarnExec from '../yarn/exec'; import reportError from '../report-error'; import addProgressNotification from '../add-progress-notification'; import getPackageVersion from '../yarn/get-package-version'; export default async function (proje...
'use babel'; import UpdateVersionView from '../views/UpdateVersionView'; import yarnExec from '../yarn/exec'; import reportError from '../report-error'; import getPackageVersion from '../yarn/get-package-version'; export default async function (projectFolderPath) { const view = new UpdateVersionView((versionSpecifi...
Remove progress notification from update version command
Remove progress notification from update version command
JavaScript
mit
cbovis/atom-yarn
--- +++ @@ -3,7 +3,6 @@ import UpdateVersionView from '../views/UpdateVersionView'; import yarnExec from '../yarn/exec'; import reportError from '../report-error'; -import addProgressNotification from '../add-progress-notification'; import getPackageVersion from '../yarn/get-package-version'; export default as...
caf0160788138473f3936139b1b32a25b174842b
problems/arrays/index.js
problems/arrays/index.js
var path = require('path'); var getFile = require('../../get-file'); var run = require('../../run-solution'); exports.problem = getFile(path.join(__dirname, 'problem.md')); exports.solution = getFile(path.join(__dirname, 'solution.md')); exports.verify = function (args, cb) { run(args[0], function (err, result) { ...
var path = require('path'); var getFile = require('../../get-file'); var run = require('../../run-solution'); exports.problem = getFile(path.join(__dirname, 'problem.md')); exports.solution = getFile(path.join(__dirname, 'solution.md')); exports.verify = function (args, cb) { run(args[0], function (err, result) { ...
Fix arrays verify step: do not fail if empty string or boolean passed in
Fix arrays verify step: do not fail if empty string or boolean passed in
JavaScript
mit
ledsun/javascripting,soujiro27/javascripting,marocchino/javascripting,CLAV1ER/javascripting,ubergrafik/javascripting,aijiekj/javascripting,LindsayElia/javascripting,victorperin/javascripting,he11yeah/javascripting,jaredhensley/javascripting,claudiopro/javascripting,thenaughtychild/javascripting,RichardLitt/javascriptin...
--- +++ @@ -9,7 +9,7 @@ exports.verify = function (args, cb) { run(args[0], function (err, result) { var expected = "[ 'tomato sauce', 'cheese', 'pepperoni' ]\n"; - if (result.replace('"', "'") === expected) cb(true); + if (result && result.replace('"', "'") === expected) cb(true); else cb(false);...
240778d13942a54c0fc0df2b6cc388f84c568922
src/main/webapp/components/directives/clusterListFilters-directive/clusterListFilters-directive.js
src/main/webapp/components/directives/clusterListFilters-directive/clusterListFilters-directive.js
/** * @author Jose A. Dianes <jdianes@ebi.ac.uk> * * The prc-cluster-list-filters directive allows us to reuse a spectra visualisations using SpeckTackle. * */ var clusterListFiltersDirective = angular.module('prideClusterApp.clusterListFiltersDirective', []) clusterListFiltersDirective.directive('prcClusterList...
/** * @author Jose A. Dianes <jdianes@ebi.ac.uk> * * The prc-cluster-list-filters directive allows us to reuse a spectra visualisations using SpeckTackle. * */ var clusterListFiltersDirective = angular.module('prideClusterApp.clusterListFiltersDirective', []) clusterListFiltersDirective.directive('prcClusterList...
Solve navigation problem when you are in list view and pres the button to come back to view (before it was to home)
Solve navigation problem when you are in list view and pres the button to come back to view (before it was to home)
JavaScript
apache-2.0
PRIDE-Cluster/cluster-web-app,PRIDE-Cluster/cluster-web-app
--- +++ @@ -33,11 +33,11 @@ // attach filter-submit function $scope.listSubmit = function() { - updateState("/list"); + updateState("list"); } $scope.chartSubmit = function() { - updateState("/chart"); + updateState("chart"); ...
bc414ecb41fce5ace259166ed366763f007f88b4
src/http-configurable.js
src/http-configurable.js
'use strict'; var _ = require('lodash'); var httpConfigurable = {}; httpConfigurable.initHttpConfigurable = function() { this.thenApplies = []; this.headers = {}; }; httpConfigurable.header = function(headerKey, headerValue) { this.headers[headerKey] = headerValue; return this; }; httpConfigurable.conten...
'use strict'; var _ = require('lodash'); var httpConfigurable = {}; httpConfigurable.initHttpConfigurable = function() { this.thenApplies = []; this.headers = {}; }; httpConfigurable.header = function(headerKey, headerValue) { this.headers[headerKey] = headerValue; return this; }; httpConfigurable.conten...
Rename thenApply function to then
Rename thenApply function to then
JavaScript
mit
kahnjw/endpoints
--- +++ @@ -24,7 +24,7 @@ return this.header('Accept', mimeType); }; -httpConfigurable.thenApply = function(onFulfilled, onRejected, onProgress) { +httpConfigurable.then = function(onFulfilled, onRejected, onProgress) { var applies = { onFulfilled: onFulfilled, onRejected: onRejected, @@ -35,6 +35,...
e4446707c4947f3730d7a82911097f7da16b811a
assets/js/application.js
assets/js/application.js
$(document).ready(function(){ $("#email-form").on("submit", function(e){ e.preventDefault(); console.log("HELP"); }); });
$(document).ready(function(){ $("#email-form").on("submit", function(e){ e.preventDefault(); $(".contact-form").empty(); $(".contact-form").append( "<div class='thanks container' style='display:none'> <h4>Thanks for reaching out!</h4> <p>I'll get back to you as soon as possible.</p> ...
Add animation after form is submitted
Add animation after form is submitted
JavaScript
mit
DylanLovesCoffee/DylanLovesCoffee.github.io,DylanLovesCoffee/DylanLovesCoffee.github.io
--- +++ @@ -1,6 +1,13 @@ $(document).ready(function(){ $("#email-form").on("submit", function(e){ e.preventDefault(); - console.log("HELP"); + $(".contact-form").empty(); + $(".contact-form").append( + "<div class='thanks container' style='display:none'> + <h4>Thanks for reaching out!</h...
049dd10b45d01f1e9b794342dad4335e84019745
app/services/facebook.js
app/services/facebook.js
'use strict'; const request = require('request-promise'); const config = require('../../config'); const scraper = require('./scraper'); module.exports = { getFirstMessagingEntry: (body) => { const val = body.object == 'page' && body.entry && Array.isArray(body.entry) && body.entry.length > 0 ...
'use strict'; const request = require('request-promise'); const config = require('../../config'); const scraper = require('./scraper'); module.exports = { getFirstMessagingEntry: (body) => { const val = body.object == 'page' && body.entry && Array.isArray(body.entry) && body.entry.length > 0 ...
Add button to the template
Add button to the template
JavaScript
mit
Keeprcom/keepr-bot
--- +++ @@ -35,7 +35,11 @@ title: 'Test', image_url: meta.image, subtitle: 'test', - buttons: [] + buttons: [{ + type: 'web_url', + url: url, + title: 'Click here' + }] ...
bd290d002d5f4090d6b5a57264d872366d7ff45c
app/mixins/validation-error-display.js
app/mixins/validation-error-display.js
import Ember from 'ember'; const { Mixin } = Ember; export default Mixin.create({ init(){ this._super(...arguments); this.set('showErrorsFor', []); }, showErrorsFor: [], actions: { addErrorDisplayFor(field){ this.get('showErrorsFor').pushObject(field); }, removeErrorDisplayFor(field...
import Ember from 'ember'; const { Mixin } = Ember; export default Mixin.create({ didReceiveAttrs(){ this._super(...arguments); this.set('showErrorsFor', []); }, showErrorsFor: [], actions: { addErrorDisplayFor(field){ this.get('showErrorsFor').pushObject(field); }, removeErrorDispla...
Reset validation errors with each render
Reset validation errors with each render If we do this in init then the errors don’t get cleared up when new data is passed in.
JavaScript
mit
stopfstedt/frontend,jrjohnson/frontend,stopfstedt/frontend,djvoa12/frontend,thecoolestguy/frontend,dartajax/frontend,jrjohnson/frontend,djvoa12/frontend,dartajax/frontend,ilios/frontend,gabycampagna/frontend,gabycampagna/frontend,gboushey/frontend,ilios/frontend,thecoolestguy/frontend,gboushey/frontend
--- +++ @@ -3,8 +3,7 @@ const { Mixin } = Ember; export default Mixin.create({ - - init(){ + didReceiveAttrs(){ this._super(...arguments); this.set('showErrorsFor', []); },
d3cb29aa20afd385b746a99741608ab73c8fdd4d
js/mapRequest.control.js
js/mapRequest.control.js
L.Control.MapRequest = L.Control.extend({ options: { position: "topright" }, initialize: function(options) { L.setOptions(this, options); }, onAdd: function(map) { let self = this; let container = L.DomUtil.create("div", "bm-map-request"); container.innerHTM...
L.Control.MapRequest = L.Control.extend({ options: { position: "topright" }, initialize: function(options) { L.setOptions(this, options); }, onAdd: function(map) { let self = this; let container = L.DomUtil.create("div", "bm-map-request"); container.innerHTM...
Add link to home page
Add link to home page
JavaScript
mit
zimmicz/blind-maps,zimmicz/blind-maps
--- +++ @@ -11,6 +11,7 @@ let self = this; let container = L.DomUtil.create("div", "bm-map-request"); container.innerHTML = "<p>Would you like to play some other map? <a target='blank' href='https://feedback.userreport.com/2229a84e-c2fa-4427-99ab-27639f103569/'>Issue a map request.</a></p>"...
f6106435674ddcc315d0ccb231849fc2346f1bdc
bin/repl.js
bin/repl.js
#!/usr/bin/env node // Module dependencies. var debug = require('debug')('ruche:repl'); var repl = require('repl'); var ruche = require('../lib/ruche'); var emitter = require('../lib/ruche/util/emitter'); // Start the REPL with ruche available var prompt = repl.start({ prompt: 'ruche> ' }); prompt.context.ruche = ruc...
#!/usr/bin/env node // Module dependencies. var debug = require('debug')('ruche:repl'); var repl = require('repl'); var ruche = require('../lib/ruche'); var emitter = require('../lib/ruche/util/emitter'); // Start the REPL with ruche available var prompt = repl.start({ prompt: 'ruche> ' }); prompt.context.ruche = ruc...
Add uninstall shortcut for the REPL
Add uninstall shortcut for the REPL In the REPL your can use uninstall(['package']) without calling ruche.uninstall
JavaScript
mit
quentinrossetti/ruche,quentinrossetti/ruche,quentinrossetti/ruche
--- +++ @@ -13,3 +13,4 @@ prompt.context.help = ruche.help; prompt.context.version = ruche.version; prompt.context.install = ruche.install; +prompt.context.uninstall = ruche.uninstall;
6965394bf537894af57dca01ae1862b06ec2aeb5
app/facebook/facebook.js
app/facebook/facebook.js
'use strict'; angular.module('ngSocial.facebook', ['ngRoute','ngFacebook']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/facebook', { templateUrl: 'facebook/facebook.html', controller: 'FacebookCtrl' }); }]) .config( function( $facebookProvider ) { $facebookProvider.setAp...
'use strict'; angular.module('ngSocial.facebook', ['ngRoute','ngFacebook']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/facebook', { templateUrl: 'facebook/facebook.html', controller: 'FacebookCtrl' }); }]) .config( function( $facebookProvider ) { $facebookProvider.setAp...
Add Facebook login test 3
Add Facebook login test 3
JavaScript
mit
PohrebniakOleskandr/ng-facebook-app,PohrebniakOleskandr/ng-facebook-app
--- +++ @@ -26,7 +26,7 @@ .controller('FacebookCtrl', ['$scope', '$facebook', function($scope,$facebook) { - console.log('hello!'); + aler.log('hello!'); $scope.isLoggedIn = false; $scope.login = function(){ $facebook.login().then(function(){
e71e27febb0cfbf5830e8c271ad036d5e6483221
gulpfile.js
gulpfile.js
var gulp = require('gulp'), jshint = require('gulp-jshint'), stylish = require('jshint-stylish'), connect = require('gulp-connect'); //CHANGE IF NEEDED var conf = { app_cwd:'../webapp/', port:8080 }; // test JS gulp.task('test_js', function(){ return gulp.src(['js/**/*.js'], { cwd: conf.app_cw...
var gulp = require('gulp'), jshint = require('gulp-jshint'), stylish = require('jshint-stylish'), connect = require('gulp-connect'); //CHANGE IF NEEDED var conf = { app_cwd:'../webapp/', port:8080 }; // test JS gulp.task('test_js', function(){ return gulp.src(['**/*.js'], { cwd: conf.app_cwd }...
Update jshint path to include all children
Update jshint path to include all children
JavaScript
mit
jjelosua/lrserver
--- +++ @@ -11,7 +11,7 @@ // test JS gulp.task('test_js', function(){ - return gulp.src(['js/**/*.js'], { cwd: conf.app_cwd }) + return gulp.src(['**/*.js'], { cwd: conf.app_cwd }) .pipe(jshint()) .pipe(jshint.reporter('default')) .pipe(jshint.reporter(stylish));
6578f709efd78252e6cf444979979d5423f26592
Animable.js
Animable.js
/** * Animable.js * * https://github.com/JWhile/Animable.js * * Animable.js */ (function(){ // namespace // class Animation function Animation(from, to, time, update) { this.from = from; // :int this.diff = to - from; // :int this.last = from; // :int this.start = Date.now(); // :long this...
/** * Animable.js * * https://github.com/JWhile/Animable.js * * Animable.js */ (function(){ // namespace // class Animation function Animation(from, to, time, update) { this.from = from; // :int this.diff = to - from; // :int this.last = from; // :int this.start = Date.now(); // :long this...
Add function next() & var animations
Add function next() & var animations
JavaScript
mit
Julow/Animable.js
--- +++ @@ -34,4 +34,16 @@ } }; +var animations = []; // :Array<Animation> + +var next = function() +{ + newFrame(next); + + for(var i = 0; i < animations.length; ++i) + { + animations[i].next(); + } +}; + })();
dad356b7830185f7c18d8a3357a66d522062d96b
gulpfile.js
gulpfile.js
'use strict' var gulp = require('gulp') var del = require('del') var rename = require('gulp-rename') var transpiler = require('./lib/transpilation/transpiler.js') // Config for paths var paths = { assets: 'app/assets/', assets_scss: 'app/assets/scss/', dist: 'dist/', templates: 'app/templates/', npm: 'node_...
'use strict' var gulp = require('gulp') var del = require('del') var rename = require('gulp-rename') var transpiler = require('./lib/transpilation/transpiler.js') // Config for paths var paths = { assets: 'app/assets/', assets_scss: 'app/assets/scss/', dist: 'dist/', templates: 'app/templates/', npm: 'node_...
Add a generic gulp transpile task
Add a generic gulp transpile task We can refactor the shared code between different transpilation recipes out into a separate function.
JavaScript
mit
alphagov/govuk_frontend_alpha,alphagov/govuk_frontend_alpha,alphagov/govuk_frontend_alpha
--- +++ @@ -15,6 +15,13 @@ prototype_scss: 'node_modules/@gemmaleigh/prototype-scss-refactor/**/*.scss' // This can be removed later } +var transpileRunner = function (templateLanguage) { + return gulp.src(paths.templates + 'govuk_template.html') + .pipe(transpiler(templateLanguage)) + .pipe(rename({extn...
16890f9fefee884bf3fe0f4d4250312fc955481e
app/routes/scientific.js
app/routes/scientific.js
import koaRouter from 'koa-router'; import Scientific from '../controllers/scientific'; import cache from '../controllers/helper/cache'; import check from '../controllers/helper/check'; import share from '../controllers/helper/share'; const router = koaRouter({ prefix: '/scientific' }); router.get( '/:login/stati...
import koaRouter from 'koa-router'; import Scientific from '../controllers/scientific'; import cache from '../controllers/helper/cache'; import check from '../controllers/helper/check'; import share from '../controllers/helper/share'; const router = koaRouter({ prefix: '/scientific' }); router.get( '/:login/stati...
Change cache key and expire time
WHAT: Change cache key and expire time WHY: * XXXXX HOW: * NOTHING TO SAY
JavaScript
apache-2.0
ecmadao/hacknical,ecmadao/hacknical,ecmadao/hacknical
--- +++ @@ -11,17 +11,19 @@ router.get( '/:login/statistic', share.githubEnable(), - cache.get('user-statistic', { + cache.get('github-starred-statistic', { params: ['login'] }), Scientific.getUserStatistic, - cache.set() + cache.set({ + expire: 86400 // 24 hours + }) ); router.get( '...
2fef9706c7770d63debdd996d8c8a82cf7b7045d
gulpfile.js
gulpfile.js
'use strict'; var gulp = require('gulp'), browserify = require('browserify'), transform = require('vinyl-transform'), uglify = require('gulp-uglify'), sourcemaps = require('gulp-sourcemaps'), jasmine = require('gulp-jasmine'); gulp.task('default', ['build', 'watch']); gulp.task('watch', function ...
'use strict'; var gulp = require('gulp'), browserify = require('browserify'), transform = require('vinyl-transform'), uglify = require('gulp-uglify'), sourcemaps = require('gulp-sourcemaps'), jasmine = require('gulp-jasmine'), sass = require('gulp-sass'); gulp.task('default', ['build', 'watch'...
Add gulp task for compiling CSS Also add watcher for SCSS compilation
Add gulp task for compiling CSS Also add watcher for SCSS compilation
JavaScript
mit
rowanoulton/bowler,rowanoulton/bowler
--- +++ @@ -5,16 +5,26 @@ transform = require('vinyl-transform'), uglify = require('gulp-uglify'), sourcemaps = require('gulp-sourcemaps'), - jasmine = require('gulp-jasmine'); + jasmine = require('gulp-jasmine'), + sass = require('gulp-sass'); gulp.task('default', ['build', 'watch']); g...
5061680bda0211a43cb55ffad69a1a74255fe189
app/components/canvas-link/component.js
app/components/canvas-link/component.js
import Ember from 'ember'; import Qs from 'qs'; const { computed } = Ember; export default Ember.Component.extend({ tagName: '', parsedURL: computed('url', function() { const link = document.createElement('a'); link.href = this.get('url'); return link; }), id: computed('parsedURL', function() { ...
import Ember from 'ember'; import Qs from 'qs'; const { computed } = Ember; export default Ember.Component.extend({ tagName: '', parsedURL: computed('url', function() { const link = document.createElement('a'); link.href = this.get('url'); return link; }), id: computed('parsedURL', function() { ...
Use onewWay instead of readOnly
Use onewWay instead of readOnly
JavaScript
apache-2.0
usecanvas/web-v2,usecanvas/web-v2,usecanvas/web-v2
--- +++ @@ -19,8 +19,8 @@ .get('lastObject'); }), - blockID: computed.readOnly('query.block'), - filter: computed.readOnly('query.filter'), + blockID: computed.oneWay('query.block'), + filter: computed.oneWay('query.filter'), query: computed('parsedURL', function() { return Qs.parse...
bdf0b35e53d019c87cca81a86709c17e47bbfc40
gulpfile.js
gulpfile.js
var gulp = require('gulp'); var ts = require('gulp-typescript'); var tslint = require('gulp-tslint'); var jade = require('gulp-jade'); var plato = require('gulp-plato'); var espower = require('gulp-espower'); var karma = require('karma').server; gulp.task('jade', function () { return gulp.src('./src/views/*.jade')...
var gulp = require('gulp'); var ts = require('gulp-typescript'); var tslint = require('gulp-tslint'); var jade = require('gulp-jade'); var plato = require('gulp-plato'); var espower = require('gulp-espower'); var karma = require('karma').server; gulp.task('jade', function () { return gulp.src('./src/views/*.jade')...
Change task name (plato -> analyze)
Change task name (plato -> analyze)
JavaScript
mit
kubosho/simple-music-player
--- +++ @@ -23,7 +23,8 @@ .pipe(gulp.dest('./dist/scripts/'))); }); -gulp.task('plato', function () { +// Generate complexity analysis reports +gulp.task('analyze', function () { return gulp.src('./dist/scripts/*.js') .pipe(plato('./report', { jshint: {
eaf9e457368afef6f9cf9186c04e7db4191a067f
gulpfile.js
gulpfile.js
const gulp = require('gulp'), sass = require('gulp-sass'), babel = require('gulp-babel'), sourcemaps = require('gulp-sourcemaps'), gls = require('gulp-live-server'), server = gls.new('index.js'); gulp.task( 'es6', () => { return gulp.src( 'src/**/*.js' ) .pipe(sourcemaps.init()) ....
const gulp = require('gulp'), sass = require('gulp-sass'), babel = require('gulp-babel'), sourcemaps = require('gulp-sourcemaps'), gls = require('gulp-live-server'), server = gls.new('index.js'); gulp.task( 'js', () => { return gulp.src( 'src/**/*.js' ) .pipe(sourcemaps.init()) .p...
Make live reloading work again
Make live reloading work again
JavaScript
mit
leo/editor,leo/editor
--- +++ @@ -5,7 +5,7 @@ gls = require('gulp-live-server'), server = gls.new('index.js'); -gulp.task( 'es6', () => { +gulp.task( 'js', () => { return gulp.src( 'src/**/*.js' ) @@ -20,7 +20,7 @@ }); -gulp.task( 'sass', () => { +gulp.task( 'scss', () => { return gulp.src( 'src/**/*.scss'...
f98ee7c3bade64f6ae84b0093bea8697d90642e6
lib/plugin/message/widget/messageWidget.js
lib/plugin/message/widget/messageWidget.js
"use strict"; const Widget = require('../../layout/widget'); const merge = require('../../../util/merge'); const {coroutine: co} = require('bluebird'); class MessageWidget extends Widget { init(context) { return co(function*(self, superInit){ yield superInit.call(self, context); merge(self.data, { ...
"use strict"; const Widget = require('../../layout/widget'); const merge = require('../../../util/merge'); const {coroutine: co} = require('bluebird'); class MessageWidget extends Widget { init(context, data) { return co(function*(self, superInit){ yield superInit.call(self, context, data); merge(se...
Update MessageWidget init() for consistency
Update MessageWidget init() for consistency
JavaScript
mit
coreyp1/defiant,coreyp1/defiant
--- +++ @@ -5,9 +5,9 @@ const {coroutine: co} = require('bluebird'); class MessageWidget extends Widget { - init(context) { + init(context, data) { return co(function*(self, superInit){ - yield superInit.call(self, context); + yield superInit.call(self, context, data); merge(self.data, { ...
cf2ce1d06c9f4a199686ec98e6a66e03bcb99076
src/label-group/index.js
src/label-group/index.js
import { PropTypes } from 'react'; import { BEM } from 'rebem'; import Label from '#label-group/label'; import Control from '#label-group/control'; function renderChildren(props) { const label = Label({ labelText: props.labelText, key: 'label' }); const control = Control({ key: 'control' }, props.children); ...
import { PropTypes } from 'react'; import { BEM } from 'rebem'; import Label from '#label-group/label'; import Control from '#label-group/control'; function renderChildren(props) { const label = Label({ labelText: props.labelText, key: 'label' }); const control = Control({ key: 'control' }, props.children); ...
Revert ":heavy_check_mark: fix label-group having label tag instead of div"
Revert ":heavy_check_mark: fix label-group having label tag instead of div" This reverts commit 0d029074a1eaccb792d6895fd1e892f80e33f3f7.
JavaScript
mit
rebem/core-components,rebem/core-components
--- +++ @@ -24,7 +24,8 @@ ...mods, 'control-position': props.controlPosition }, - mix + mix, + tag: 'label' }, ...renderChildren(props) );
f49f71082ce7a9eaa5991a8f29bdb5a2f6679e53
article/static/article/js/social.js
article/static/article/js/social.js
$(function(){ var socialBar = $('.social[data-url]'); $.get('https://graph.facebook.com/?id=' + socialBar.data('url'), function(data) { $('.facebook .count', socialBar).html(data['shares']); }) .fail(function() { $('.facebook .count', socialBar).html('0'); }); $.getJSON('https://...
$(function(){ if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { // Mobile device. $(".hidden.whatsapp").removeClass("hidden") } });
Remove the URL count numbers now that twitter stopped reporting them.
Remove the URL count numbers now that twitter stopped reporting them.
JavaScript
bsd-3-clause
PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari
--- +++ @@ -1,17 +1,4 @@ $(function(){ - var socialBar = $('.social[data-url]'); - $.get('https://graph.facebook.com/?id=' + socialBar.data('url'), function(data) { - $('.facebook .count', socialBar).html(data['shares']); - }) - .fail(function() { - $('.facebook .count', socialBar).html('0'...
9dd87cff473f1d7328f9ac2e5a9ff4ee211f05fe
benchmark/define-a-funciton-with-this.js
benchmark/define-a-funciton-with-this.js
'use strict' suite('define a function with inherited this', function () { bench('function statement', function () { var self = this var a = function () { self return '1' } a(); }) bench('() =>', function () { var a = () => { this return '1' } a(); }) })
'use strict' suite('define a function with inherited this', function () { bench('function statement with self = this', function () { var self = this var a = function () { self return '1' } a(); }) bench('function statement with bind', function () { var a = function () { this...
Add a bind() bench to compare perf gain
Add a bind() bench to compare perf gain
JavaScript
mit
DavidCai1993/ES6-benchmark
--- +++ @@ -1,6 +1,6 @@ 'use strict' suite('define a function with inherited this', function () { - bench('function statement', function () { + bench('function statement with self = this', function () { var self = this var a = function () { self @@ -9,8 +9,16 @@ a(); }) + bench('functi...
c398ca8bc4f0624f41166c949e2eefb180ad4d1d
sashimi-webapp/src/database/stringManipulation.js
sashimi-webapp/src/database/stringManipulation.js
export default function stringManipulation() { this.stringConcat = function stringConcat(...stringToConcat) { return stringToConcat.join(''); }; this.stringDateTime00Format = function stringDateTime00Format(dateTimeNumber) { if (typeof dateTimeNumber == 'number') { if (dateTimeNumber < 10) { ...
export default function stringManipulation() { this.stringConcat = function stringConcat(...stringToConcat) { return stringToConcat.join(''); }; this.stringDateTime00Format = function stringDateTime00Format(dateTimeNumber) { if (typeof dateTimeNumber == 'number') { if (dateTimeNumber < 10) { ...
Remove function replaceAll in stringManipulator.js
Remove function replaceAll in stringManipulator.js not used anymore
JavaScript
mit
nus-mtp/sashimi-note,nus-mtp/sashimi-note,nus-mtp/sashimi-note
--- +++ @@ -13,8 +13,6 @@ return dateTimeNumber; }; - this.replaceAll = function replaceAll(string, stringToReplace, replacement) { - return string.replace(new RegExp(stringToReplace, 'g'), replacement); }; this.getPreviousPath = function getPreviousPath(fullPath, lastFolderName) {
d14798e805d1f525be323fa31bfaeb4c6d7df513
client/api.js
client/api.js
import request from 'superagent' module.exports = { getWeather } function getWeather() { request .get(`http://api.openweathermap.org/data/2.5/weather?=${city}&units=metric&APPID=fc04e2e516b1de4348fb0323f981a1d9`) .set('Accept', 'application/json') .end((err, res) => { if(err) { callback(err.message)...
import request from 'superagent' module.exports = { getWeather, get3DForecast } function getWeather () { request .get(`http://api.openweathermap.org/data/2.5/weather?=${city}&units=metric&APPID=fc04e2e516b1de4348fb0323f981a1d9`) .set('Accept', 'application/json') .end((err, res) => { if(err) { cal...
Add get 3 days weather API call
Add get 3 days weather API call
JavaScript
mit
daffron/WeatherApp,daffron/WeatherApp
--- +++ @@ -1,10 +1,11 @@ import request from 'superagent' module.exports = { - getWeather + getWeather, + get3DForecast } -function getWeather() { +function getWeather () { request .get(`http://api.openweathermap.org/data/2.5/weather?=${city}&units=metric&APPID=fc04e2e516b1de4348fb0323f981a1d9`) ....
767bb7c95cb0462264b75f062a7049267079636c
assets/js/application.js
assets/js/application.js
$(document).ready(function(){ $("#email-form").on("submit", function(e){ e.preventDefault(); $(".contact-form").empty(); $(".contact-form").append( "<div class='thanks container' style='display:none'> <h4>Thanks for reaching out!</h4> <p>I'll get back to you as soon as possible.</p> ...
$(document).ready(function(){ $("#email-form").on("submit", function(e){ e.preventDefault(); $(".contact-form").empty(); $(".contact-form").append("<div class='thanks container' style='display:none'><h4>Thanks for reaching out!</h4><p>I'll get back to you as soon as possible.</p></div>"); $(".thanks")...
Debug jquery error after form submission
Debug jquery error after form submission
JavaScript
mit
DylanLovesCoffee/DylanLovesCoffee.github.io,DylanLovesCoffee/DylanLovesCoffee.github.io
--- +++ @@ -2,12 +2,7 @@ $("#email-form").on("submit", function(e){ e.preventDefault(); $(".contact-form").empty(); - $(".contact-form").append( - "<div class='thanks container' style='display:none'> - <h4>Thanks for reaching out!</h4> - <p>I'll get back to you as soon as possible.<...
d1ab9788c66379f5f56bdaa125cb14913930c796
gulpfile.js
gulpfile.js
var gulp = require("gulp"); var sourcemaps = require("gulp-sourcemaps"); var sass = require("gulp-sass"); var concat = require("gulp-concat"); var uglify = require("gulp-uglify"); gulp.task("sass", function() { gulp.src("./sass/**/*.sass") .pipe(sourcemaps.init()) .pipe(sass({outputStyle: "compressed"}))...
var gulp = require("gulp"); var sourcemaps = require("gulp-sourcemaps"); var sass = require("gulp-sass"); var concat = require("gulp-concat"); var uglify = require("gulp-uglify"); gulp.task("sass", function() { gulp.src("./sass/**/*.sass") .pipe(sourcemaps.init()) .pipe(sass({outputStyle: "compressed"}))...
Refactor JS building into a function
Refactor JS building into a function
JavaScript
mit
controversial/controversial.io,controversial/controversial.io,controversial/controversial.io
--- +++ @@ -17,21 +17,20 @@ }); gulp.task("js", function() { + // Build all the scripts from a directory into a file. + function buildScriptsForPage(dir, path) { + gulp.src(dir+"/*.js") + .pipe(sourcemaps.init()) + .pipe(concat(path)) + .pipe(uglify()) + .pipe(sourcemaps.write()) + ....
7bfd1dc5edc4338a2f84b3beb7ebbb50765030ca
broccoli/to-named-amd.js
broccoli/to-named-amd.js
const Babel = require('broccoli-babel-transpiler'); const resolveModuleSource = require('amd-name-resolver').moduleResolve; const enifed = require('./transforms/transform-define'); const injectNodeGlobals = require('./transforms/inject-node-globals'); module.exports = function processModulesOnly(tree, strict = false) ...
const Babel = require('broccoli-babel-transpiler'); const { resolveRelativeModulePath } = require('ember-cli-babel/lib/relative-module-paths'); const enifed = require('./transforms/transform-define'); const injectNodeGlobals = require('./transforms/inject-node-globals'); module.exports = function processModulesOnly(tr...
Use `ember-cli-babel` to resolve module paths
Use `ember-cli-babel` to resolve module paths
JavaScript
mit
intercom/ember.js,asakusuma/ember.js,emberjs/ember.js,stefanpenner/ember.js,elwayman02/ember.js,GavinJoyce/ember.js,stefanpenner/ember.js,intercom/ember.js,GavinJoyce/ember.js,emberjs/ember.js,bekzod/ember.js,stefanpenner/ember.js,givanse/ember.js,sandstrom/ember.js,bekzod/ember.js,mfeckie/ember.js,knownasilya/ember.js...
--- +++ @@ -1,5 +1,5 @@ const Babel = require('broccoli-babel-transpiler'); -const resolveModuleSource = require('amd-name-resolver').moduleResolve; +const { resolveRelativeModulePath } = require('ember-cli-babel/lib/relative-module-paths'); const enifed = require('./transforms/transform-define'); const injectNode...
36bd61c044f52b0dfc6f90fc04c7148ad3cc1772
server/models/server-logs.js
server/models/server-logs.js
import mongoose from 'mongoose' const LogSchema = new mongoose.Schema({ mission_id: String, created_at: Date, logs: [{ time: Number, text: String, level: Number }] }, { collection: 'serverlogs' }) LogSchema.virtual('world').get(function () { return this.mission_id.split('///')[0...
import mongoose from 'mongoose' const LogSchema = new mongoose.Schema({ mission_id: String, created_at: Date, logs: [{ time: Number, text: String, level: { type: Number, default: 0 } }] }, { collection: 'serverlogs' }) LogSchema.virtual('world').get(function () { return this.mis...
Add default to log level
Add default to log level
JavaScript
isc
fparma/fparma-web,fparma/fparma-web
--- +++ @@ -6,7 +6,7 @@ logs: [{ time: Number, text: String, - level: Number + level: { type: Number, default: 0 } }] }, { collection: 'serverlogs'
59373060d8d65384f6b78e5acf18a3ebff543045
_setup/utils/resolve-static-triggers.js
_setup/utils/resolve-static-triggers.js
'use strict'; var resolve = require('esniff/accessed-properties')('this') , memoize = require('memoizee/plain') , ignored = require('./meta-property-names') , re = new RegExp('^\\s*function\\s*(?:[\\0-\'\\)-\\uffff]+)*\\s*\\(\\s*' + '(_observe)?[\\/*\\s]*\\)\\s*\\{([\\0-\\uffff]*)\\}\\s*$') , ...
'use strict'; var resolve = require('esniff/accessed-properties')('this') , memoize = require('memoizee/plain') , ignored = require('./meta-property-names') , re = new RegExp('^\\s*function\\s*(?:[\\0-\'\\)-\\uffff]+)*\\s*\\(\\s*' + '(_observe)?[\\/*\\s]*\\)\\s*\\{([\\0-\\uffff]*)\\}\\s*$') , ...
Introduce better error reporting for getter errors
Introduce better error reporting for getter errors
JavaScript
mit
medikoo/dbjs
--- +++ @@ -21,5 +21,8 @@ shift += 18; }); if (!shift) return fn; + body = 'try {\n' + body + + '\n;} catch (e) { throw new Error("Dbjs getter error:\\n\\n" + e.stack + ' + + '"\\n\\nGetter Body:\\n' + JSON.stringify(body).slice(1) + '); }'; return new Function('_observe', body); });
a63c1c34a4996462c867cb0b3201370a4eac62fd
lib/api/utils/headers.js
lib/api/utils/headers.js
export function getHeadersObject(headers = []) { return Array.from(headers).reduce((result, item) => { result[item[0]] = item[1]; return result }, {}); } function getContentType(type) { switch (type) { case 'html': return 'text/html'; case 'xml': return 'text/xml'; case 'json': ...
export function getHeadersObject(headers = []) { return Array.from(headers).reduce((result, item) => { result[item[0]] = item[1]; return result }, {}); } function getContentType(type = '') { switch (type.toLowerCase()) { case 'html': return 'text/html'; case 'xml': return 'text/xml';...
Fix get header preset not resolving correctly
Fix get header preset not resolving correctly
JavaScript
mit
500tech/mimic,500tech/bdsm,500tech/mimic,500tech/bdsm
--- +++ @@ -5,8 +5,8 @@ }, {}); } -function getContentType(type) { - switch (type) { +function getContentType(type = '') { + switch (type.toLowerCase()) { case 'html': return 'text/html';
f00bddb04bef8c8859a8f40a40f6025b7389fb5e
cli/main.js
cli/main.js
#!/usr/bin/env node 'use strict' process.title = 'ucompiler' require('debug').enable('UCompiler:*') var UCompiler = require('..') var knownCommands = ['go', 'watch'] var parameters = process.argv.slice(2) if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) { console.log('Usage: ucompiler go|watch...
#!/usr/bin/env node 'use strict' process.title = 'ucompiler' require('debug').enable('UCompiler:*') var UCompiler = require('..') var knownCommands = ['go', 'watch'] var parameters = process.argv.slice(2) if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) { console.log('Usage: ucompiler go|watch...
Fix a typo in cli
:bug: Fix a typo in cli
JavaScript
mit
steelbrain/UCompiler
--- +++ @@ -25,7 +25,7 @@ process.exit(1) } }, function(e) { - errorCallback(e) + options.errorCallback(e) process.exit(1) }) } else if (parameters[0] === 'watch') { @@ -37,5 +37,5 @@ .split(',') .map(function(_) { return _.trim()}) .filter(function(_) { return...
978a0a5cebbb7b4267acdea9fde6799fab1e4f27
cli/main.js
cli/main.js
#!/usr/bin/env node 'use strict' process.title = 'ucompiler' require('debug').enable('UCompiler:*') var UCompiler = require('..') var knownCommands = ['go', 'watch'] var parameters = process.argv.slice(2) if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) { console.log('Usage: ucompiler go|watch...
#!/usr/bin/env node 'use strict' process.title = 'ucompiler' require('debug').enable('UCompiler:*') var UCompiler = require('..') var knownCommands = ['go', 'watch'] var parameters = process.argv.slice(2) if (!parameters.length || knownCommands.indexOf(parameters[0]) === -1) { console.log('Usage: ucompiler go|watch...
Use the new compile and watch API in cli
:new: Use the new compile and watch API in cli
JavaScript
mit
steelbrain/UCompiler
--- +++ @@ -13,14 +13,19 @@ } if (parameters[0] === 'go') { - UCompiler.compile(parameters[1] || null, {cwd: process.cwd()}).catch(function(e) { + UCompiler.compile(parameters[1] || null, {cwd: process.cwd()}, function(e) { console.error(e) - process.exit(1) + }).then(function(result) { + if (!resul...
970c7d526fcd4a755c9eda41b144c017459d2d37
node/test/index.js
node/test/index.js
import request from 'supertest'; import test from 'tape'; import app from '../server'; test('Should leftpad correctly', t => { request(app) .get('?str=paddin%27%20oswalt&len=68&ch=@') .expect(200) .expect('Content-Type', /json/) .end((err, res) => { if (err) thro...
import request from 'supertest'; import test from 'tape'; import app from '../server'; test('Should leftpad correctly', t => { request(app) .get('?str=paddin%27%20oswalt&len=68&ch=@') .expect(200) .expect('Content-Type', /json/) .end((err, res) => { if (err) thro...
Add test for no parameters
Add test for no parameters
JavaScript
mit
melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services
--- +++ @@ -26,3 +26,15 @@ t.end(); }); }); + +test('Should handle no parameters', t => { + request(app) + .get('/') + .expect(200) + .expect('Content-Type', /json/) + .end((err, res) => { + if (err) throw err; + t.equal(res.body.str, '') + ...
6aa071a484b2a5215dfb38fff831e80c98bbd7a8
source/javascript/utilities/array2d.js
source/javascript/utilities/array2d.js
define(function() { var Array2d = function () { this._columns = {}; }; Array2d.prototype.get = function(location) { var row = this._columns[location.x]; if (row) return row[location.y]; }; Array2d.prototype.set = function (location, value) { var row = this._columns[location.x] || (this._columns[locat...
define(function() { var Array2d = function () { this._columns = {}; }; Array2d.prototype.get = function(location) { var row = this._columns[location.x]; if (row) return row[location.y]; }; Array2d.prototype.set = function (location, value) { var row = this._columns[location.x] || (this._columns[locat...
Fix incorrect variable name in Array2d.each.
Fix incorrect variable name in Array2d.each.
JavaScript
mit
stuartkeith/webaudiosequencer,stuartkeith/webaudiosequencer
--- +++ @@ -26,7 +26,7 @@ var columns; Object.keys(this._columns).forEach(function (outerKey) { - columns = this._columns[key]; + columns = this._columns[outerKey]; Object.keys(columns).forEach(function (innerKey) { callback.call(context, outerKey, innerKey, columns[innerKey]);
5fe08eb28dd74144261d4b3c2d730b80b383cb49
src/foam/swift/SwiftLib.js
src/foam/swift/SwiftLib.js
/** * @license * Copyright 2018 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.LIB({ name: 'foam.swift', methods: [ function stringify(v) { var type = foam.typeOf(v); if ( type == foam.Number || type == foam.Boolean ) { return `${v}`; ...
/** * @license * Copyright 2018 The FOAM Authors. All Rights Reserved. * http://www.apache.org/licenses/LICENSE-2.0 */ foam.LIB({ name: 'foam.swift', methods: [ function stringify(v) { var type = foam.typeOf(v); if ( type == foam.Number || type == foam.Boolean ) { return `${v}`; ...
Handle FObejcts in foam.swift.stringify during generation.
Handle FObejcts in foam.swift.stringify during generation.
JavaScript
apache-2.0
foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,jacksonic/vjlofvhjfgm,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2
--- +++ @@ -23,6 +23,9 @@ } else if ( type == foam.Function ) { // Unable to convert functions. return 'nil'; + } else if ( type == foam.core.FObject ) { + // TODO: Should be able to serialize an FObject to swift. + return 'nil'; } else { console.log('Encou...
4e058681e9fe932ca67390845ff785a4cb82707f
source/views/help/wifi-tools.js
source/views/help/wifi-tools.js
// @flow import deviceInfo from 'react-native-device-info' import networkInfo from 'react-native-network-info' import pkg from '../../../package.json' export const getIpAddress = (): Promise<?string> => new Promise(resolve => { try { networkInfo.getIPAddress(resolve) } catch (err) { resolve(null) } }) ...
// @flow import deviceInfo from 'react-native-device-info' import networkInfo from 'react-native-network-info' import pkg from '../../../package.json' export const getIpAddress = (): Promise<?string> => new Promise(resolve => { try { networkInfo.getIPAddress(resolve) } catch (err) { resolve(null) } }) ...
Remove third argument from geolocation.getCurrentPosition call
Remove third argument from geolocation.getCurrentPosition call This third argument is known to cause issues on Android devices, especially with overly greedy values of maximumAge and timeout.
JavaScript
agpl-3.0
StoDevX/AAO-React-Native,carls-app/carls,StoDevX/AAO-React-Native,carls-app/carls,carls-app/carls,StoDevX/AAO-React-Native,carls-app/carls,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native...
--- +++ @@ -15,12 +15,7 @@ export const getPosition = (args: any = {}): Promise<Object> => new Promise(resolve => { - navigator.geolocation.getCurrentPosition(resolve, () => resolve({}), { - ...args, - enableHighAccuracy: true, - maximumAge: 1000 /*ms*/, - timeout: 5000 /*ms*/, - }) + navigator.geoloc...
95667ef98ed9b20846b36f9dbf5f3ccbfb461d83
react/features/base/participants/components/styles.js
react/features/base/participants/components/styles.js
import { createStyleSheet } from '../../styles'; /** * The style of the avatar and participant view UI (components). */ export const styles = createStyleSheet({ /** * Avatar style. */ avatar: { alignSelf: 'center', // FIXME I don't understand how a 100 border radius of a 50x50 squa...
import { createStyleSheet } from '../../styles'; /** * The style of the avatar and participant view UI (components). */ export const styles = createStyleSheet({ /** * Avatar style. */ avatar: { flex: 1, width: '100%' }, /** * ParticipantView style. */ particip...
Revert "[RN] Use rounded avatars in the film strip"
Revert "[RN] Use rounded avatars in the film strip" This reverts commit 739298c7826ea6109b8a2632d54c8d867f7d03cc.
JavaScript
apache-2.0
jitsi/jitsi-meet,bgrozev/jitsi-meet,jitsi/jitsi-meet,gpolitis/jitsi-meet,gpolitis/jitsi-meet,bgrozev/jitsi-meet,gpolitis/jitsi-meet,gpolitis/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,jitsi/jitsi-meet,jitsi/jitsi-meet,gpolitis/jitsi-meet,gpolitis/jitsi-meet,jitsi/jitsi-meet,bgrozev/jitsi-meet,bgrozev/jitsi-meet,bgr...
--- +++ @@ -8,14 +8,8 @@ * Avatar style. */ avatar: { - alignSelf: 'center', - - // FIXME I don't understand how a 100 border radius of a 50x50 square - // results in a circle. - borderRadius: 100, flex: 1, - height: 50, - width: 50 + width: '...
a19b61fc92e7ac82b114a593699ea7625767e6c7
treadmill.js
treadmill.js
/** * treadmill.js * Copyright © 2015 Johnie Hjelm */ var Treadmill = Treadmill || {}; Treadmill.run = function() { window.onscroll = function() { if ((window.innerHeight + window.scrollY) >= ((document.documentElement && document.documentElement.scrollHeight) || document.body.scrollHeight)) { window.sc...
/** * treadmill.js * Copyright © 2015 Johnie Hjelm */ 'use strict'; (function (root, factory) { if (typeof define === 'function' && define.amd) { define([], factory); } else if (typeof exports === 'object') { exports.Treadmill = factory(); } else { root.Treadmill = factory(); } }(this, function ()...
Add support for AMD, CommonJS and global export
Add support for AMD, CommonJS and global export :smile:
JavaScript
mit
johnie/treadmill.js
--- +++ @@ -2,12 +2,31 @@ * treadmill.js * Copyright © 2015 Johnie Hjelm */ -var Treadmill = Treadmill || {}; -Treadmill.run = function() { - window.onscroll = function() { - if ((window.innerHeight + window.scrollY) >= ((document.documentElement && document.documentElement.scrollHeight) || document.body....
fac9120da2029a9d893c1e69d679adc3f0f455fe
download.js
download.js
const AWS = require('aws-sdk') const fs = require('fs-extra') const config = require('config') const aws = config.aws AWS.config = new AWS.Config(aws) const s3 = new AWS.S3() const today = new Date().toISOString().slice(0, 10) const params = { Bucket: config.tamarac_bucket, Delimiter: '/', Prefix: `${today}/`...
const AWS = require('aws-sdk') const fs = require('fs-extra') const config = require('config') const aws = config.aws AWS.config = new AWS.Config(aws) const s3 = new AWS.S3() const today = process.argv[2] || new Date().toISOString().slice(0, 10) const params = { Bucket: config.tamarac_bucket, Delimiter: '/', ...
Allow prefix to be passed as argument
Allow prefix to be passed as argument
JavaScript
mit
kakamg0/download-today-s3
--- +++ @@ -6,7 +6,7 @@ AWS.config = new AWS.Config(aws) const s3 = new AWS.S3() -const today = new Date().toISOString().slice(0, 10) +const today = process.argv[2] || new Date().toISOString().slice(0, 10) const params = { Bucket: config.tamarac_bucket,