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 |
|---|---|---|---|---|---|---|---|---|---|---|
cbcd01ba33d3d8b4408d97ddbe3aa80eb22984dc | src/inject/inject.js | src/inject/inject.js | chrome.extension.sendMessage({}, function(response) {
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
clearInterval(readyStateCheckInterval);
var labels = document.getElementsByClassName('label');
Array.prototype.filter.call(labels, function(label) {
ret... | chrome.extension.sendMessage({}, function(response) {
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
clearInterval(readyStateCheckInterval);
var colorMapping = {
'blocked': 'rgb(199, 37, 67)',
'needs ': 'rgb(199, 37, 67)'
};
... | Set color on all newly-added labels | Set color on all newly-added labels
| JavaScript | isc | oliverswitzer/wwltw-for-pivotal-tracker,mkenyon/red-labels-for-pivotal-tracker,oliverswitzer/wwltw-for-pivotal-tracker | ---
+++
@@ -1,14 +1,38 @@
chrome.extension.sendMessage({}, function(response) {
- var readyStateCheckInterval = setInterval(function() {
- if (document.readyState === "complete") {
- clearInterval(readyStateCheckInterval);
+ var readyStateCheckInterval = setInterval(function() {
+ if (document.readyState === ... |
46962ed201abf4e701fb069c02ab1a1751464857 | information.js | information.js | 'use strict';
var hosts = {
'bbc.co.uk': 'bbc',
'm.bbc.co.uk': 'bbc',
'reddit.com': 'reddit',
'www.reddit.com': 'reddit',
'condenast.co.uk': 'condenast'
};
var organisations = {
'bbc': {
'owner': null,
'info': 'British Broadcasting Corporation'
},
'reddit': {
'owner': 'condenast',
'inf... | 'use strict';
var hosts = {
'bbc.co.uk': 'bbc',
'm.bbc.co.uk': 'bbc',
'reddit.com': 'reddit',
'www.reddit.com': 'reddit',
'condenast.co.uk': 'condenast'
'tumblr.com' : 'tumblr'
};
var organisations = {
'bbc': {
'owner': null,
'info': 'British Broadcasting Corporation'
},
'reddit': {
'own... | Add tumblr->yahoo info for server | Add tumblr->yahoo info for server | JavaScript | mit | magicmark/Transparification-Server | ---
+++
@@ -6,6 +6,7 @@
'reddit.com': 'reddit',
'www.reddit.com': 'reddit',
'condenast.co.uk': 'condenast'
+ 'tumblr.com' : 'tumblr'
};
var organisations = {
@@ -24,6 +25,14 @@
'advancepublications': {
'owner': null,
'info': 'Advance Publications'
+ },
+ 'tumblr': {
+ 'owner': 'yahoo',... |
144eba59227a600aec09ab549c0be840698d191a | src/js/utils/_base-view.js | src/js/utils/_base-view.js | import * as _ from 'underscore';
import * as Backbone from 'backbone';
class BaseView extends Backbone.View {
constructor(options = {}) {
super(options);
this._subviews = null;
}
registerSubView(view) {
this._subviews = this._subviews || [];
this._subviews.push(view);
}
remove() {
_.in... | import * as _ from 'underscore';
import * as Backbone from 'backbone';
class BaseView extends Backbone.View {
constructor(options = {}) {
super(options);
this._subviews = null;
}
assign(view, selector) {
view.setElement(this.$(selector)).render();
}
registerSubView(view) {
this._subviews =... | Update base view w/convenience function for rendering subviews | Update base view w/convenience function for rendering subviews
See:
http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt-always-simp
le/
| JavaScript | mit | trevormunoz/katherine-anne,trevormunoz/katherine-anne,trevormunoz/katherine-anne | ---
+++
@@ -6,6 +6,10 @@
constructor(options = {}) {
super(options);
this._subviews = null;
+ }
+
+ assign(view, selector) {
+ view.setElement(this.$(selector)).render();
}
registerSubView(view) { |
6dd03089f29ae7cd357f45a929bed8f7e7d6440b | src/input/storageHandler.js | src/input/storageHandler.js | 'use strict'
// Code thanks to MDN
export function storageAvailable (type) {
try {
let storage = window[type]
let x = '__storage_test__'
storage.setItem(x, x)
storage.removeItem(x)
return true
} catch (e) {
let storage = window[type]
return e instanceof DOMException && (
// everyt... | 'use strict'
// Code thanks to MDN
export function storageAvailable (type) {
try {
let storage = window[type]
let x = '__storage_test__'
storage.setItem(x, x)
storage.removeItem(x)
return true
} catch (e) {
let storage = window[type]
return e instanceof DOMException && (
// everyt... | Add all settings to populateStorage | Add all settings to populateStorage
| JavaScript | mit | CrowsVeldt/FreeCodeCamp-Pomodoro-Timer | ---
+++
@@ -36,4 +36,7 @@
window.localStorage.setItem('pomodoroTime', document.getElementById('pomodoroInput').value)
window.localStorage.setItem('shortBreakTime', document.getElementById('shortBreakInput').value)
window.localStorage.setItem('longBreakTime', document.getElementById('longBreakInput').value)
+... |
ccce0d08bd0a43ba10a5b18470095b0c19bfe18c | webpack.client.babel.js | webpack.client.babel.js | import base from './webpack.base.babel.js';
import path from 'path';
import webpack from 'webpack';
const {WDS_PORT, PORT, APP_WEB_BASE_PATH} = process.env;
export default {
...base,
entry: "./src/app/_client.js",
output: {
path: path.join(__dirname, 'dist', 'static'),
filename: "app.js",... | import base from './webpack.base.babel.js';
import path from 'path';
import webpack from 'webpack';
const {WDS_PORT, PORT, APP_WEB_BASE_PATH} = process.env;
export default {
...base,
entry: "./src/app/_client.js",
output: {
path: path.join(__dirname, 'dist', 'static'),
filename: "app.js",... | Fix dev server redirection bug | Fix dev server redirection bug
When running `npm run dev` and opening the browser, newer version
of WDS would redirect to the proxied server instead of proxying. Changed
proxy syntax to match `**` instead of `*`
| JavaScript | mit | mdjasper/React-Reading-List,tuxsudo/react-starter | ---
+++
@@ -28,7 +28,7 @@
),
devServer: {
- publicPath: `${APP_WEB_BASE_PATH}/static`,
+ publicPath: '/static/',
contentBase: `http://localhost:${PORT}/static`,
historyApiFallback: true,
progress: false,
@@ -36,7 +36,7 @@
compress: true,
port:... |
dc731a64f204251143021cdc663ddaea195f3908 | lib/web/scripts/IdleView.js | lib/web/scripts/IdleView.js |
const Marionette = require('backbone.marionette');
const moment = require('moment');
module.exports = class IdleView extends Marionette.View {
template = Templates['idle'];
className() { return 'idle-content'; }
events() {
return {'click': 'hide'};
}
onRender() {
this.timeRefresh = setInterval(th... |
const Marionette = require('backbone.marionette');
const moment = require('moment');
module.exports = class IdleView extends Marionette.View {
template = Templates['idle'];
className() { return 'idle-content'; }
events() {
return {'click': 'hide'};
}
initialize() {
this.timeRefresh = setInterval(... | Fix extremely stupid bug in idle display! | Fix extremely stupid bug in idle display!
| JavaScript | mit | monitron/jarvis-ha,monitron/jarvis-ha | ---
+++
@@ -11,7 +11,7 @@
return {'click': 'hide'};
}
- onRender() {
+ initialize() {
this.timeRefresh = setInterval(this.render.bind(this), 10000);
}
|
ba816550e509def9d0d4f3f6d500b80402b0a5c2 | routes/index.js | routes/index.js | var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res) {
res.render('index', { title: 'VoteAnon' });
});
router.route('/create')
.get(function(req, res) {
res.render('create', { title: 'VoteAnon: create poll' });
})
.post(function(req, res) {
res... | var express = require('express');
var redis = require('redis');
var router = express.Router();
var client = redis.createClient();
/* GET home page. */
router.get('/', function(req, res) {
res.render('index', { title: 'VoteAnon' });
});
router.route('/create')
.get(function(req, res) {
res.render('create', { titl... | Connect to redis on route | Connect to redis on route
| JavaScript | mit | Pringley/voteanon | ---
+++
@@ -1,5 +1,8 @@
var express = require('express');
+var redis = require('redis');
+
var router = express.Router();
+var client = redis.createClient();
/* GET home page. */
router.get('/', function(req, res) { |
8a12e4a209c262d5ad446d99a81cd8936a353ab4 | make-event.js | make-event.js | 'use strict';
let fs = require('fs');
let moment = require('moment');
let parseDate = require('./parse-date');
function maybeParse(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format('YYYY-MM-DD HH-mm-ss');
}
try {
return JSON.parse(value);
}
catch(erro... | 'use strict';
let fs = require('fs');
let moment = require('moment');
let parseDate = require('./parse-date');
function maybeParse(value) {
if(value[0] === '@') {
return moment(parseDate(value.slice(1))).format('YYYY-MM-DD HH-mm-ss');
}
try {
return JSON.parse(value);
}
catch(erro... | Allow event date to be overridden. | Allow event date to be overridden.
| JavaScript | agpl-3.0 | n2liquid/ev | ---
+++
@@ -23,12 +23,25 @@
}
module.exports = function(args) {
- let dateTime = moment().format('YYYY-MM-DD HH-mm-ss');
let event = {};
- event.type = args[0];
+ event.type = args.shift();
- args.slice(1).forEach(function(arg) {
+ let dateTime = (function() {
+ let dateTime = parse... |
baa2562e6410e491b9e094ff6b0900fe5ea23d7d | ember/tests/acceptance/page-not-found-test.js | ember/tests/acceptance/page-not-found-test.js | import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupPretender } from 'skylines/tests/helpers/setup-pretender';
module('Acceptance | page-not-found', function(hooks) {
setupApplicationTest(hooks);
setupPret... | import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupPolly } from 'skylines/tests/helpers/setup-polly';
module('Acceptance | page-not-found', function(hooks) {
setupApplicationTest(hooks);
setupPolly(hooks,... | Use Polly.js instead of Pretender | tests/page-not-found: Use Polly.js instead of Pretender
| JavaScript | agpl-3.0 | RBE-Avionik/skylines,Turbo87/skylines,RBE-Avionik/skylines,Harry-R/skylines,RBE-Avionik/skylines,skylines-project/skylines,Harry-R/skylines,Harry-R/skylines,RBE-Avionik/skylines,Turbo87/skylines,Turbo87/skylines,skylines-project/skylines,skylines-project/skylines,skylines-project/skylines,Harry-R/skylines,Turbo87/skyli... | ---
+++
@@ -2,11 +2,11 @@
import { setupApplicationTest } from 'ember-qunit';
import { visit, currentURL } from '@ember/test-helpers';
-import { setupPretender } from 'skylines/tests/helpers/setup-pretender';
+import { setupPolly } from 'skylines/tests/helpers/setup-polly';
module('Acceptance | page-not-found'... |
430d0dd3530c83907f9867454fdd3781b05835c9 | webpack_config/server/webpack.prod.babel.js | webpack_config/server/webpack.prod.babel.js | import webpack from 'webpack'
import baseWebpackConfig from './webpack.base'
import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'
import {Plugin as ShakePlugin} from 'webpack-common-shake'
import OptimizeJsPlugin from 'optimize-js-plugin'
const plugins = [
... | import webpack from 'webpack'
import baseWebpackConfig from './webpack.base'
import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
import {BundleAnalyzerPlugin} from 'webpack-bundle-analyzer'
import {Plugin as ShakePlugin} from 'webpack-common-shake'
import OptimizeJsPlugin from 'optimize-js-plugin'
const analyzePlugin... | Revert "Revert "style(webpack_config/server): rewrite prod conf in functional style"" | Revert "Revert "style(webpack_config/server): rewrite prod conf in functional style""
This reverts commit e9de3d6da5e3cfc03b6d5e39fe92ede9c110d712.
| JavaScript | apache-2.0 | Metnew/react-semantic.ui-starter | ---
+++
@@ -5,6 +5,9 @@
import {Plugin as ShakePlugin} from 'webpack-common-shake'
import OptimizeJsPlugin from 'optimize-js-plugin'
+const analyzePlugins = process.env.ANALYZE_BUNDLE
+ ? [new BundleAnalyzerPlugin({analyzerMode: 'static'})]
+ : []
const plugins = [
new webpack.ProgressPlugin(),
new webpack.o... |
003259602f03821ff6049914d66ecb77692badc2 | tests/mocks/streams/mock-hot-collections.js | tests/mocks/streams/mock-hot-collections.js | define([
'inherits',
'streamhub-hot-collections/streams/hot-collections',
'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client'],
function (inherits, HotCollections, MockHotCollectionsClient) {
var MockHotCollections = function (opts) {
opts = opts || {};
opts.clie... | define([
'inherits',
'streamhub-hot-collections/streams/hot-collections',
'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client',
'streamhub-sdk-tests/mocks/mock-stream'],
function (inherits, HotCollections, MockHotCollectionsClient, MockStream) {
var MockHotCollections = funct... | Add mockstream to mock hot collection | Add mockstream to mock hot collection
| JavaScript | mit | gobengo/streamhub-hot-collections | ---
+++
@@ -1,8 +1,9 @@
define([
'inherits',
'streamhub-hot-collections/streams/hot-collections',
- 'streamhub-hot-collections-tests/mocks/clients/mock-hot-collections-client'],
-function (inherits, HotCollections, MockHotCollectionsClient) {
+ 'streamhub-hot-collections-tests/mocks/clients/mock-hot-... |
b60d3d0b975cd077e2f1beeba07a8a4f53ad2512 | js/debugLog.js | js/debugLog.js | /*
* vim: ts=4:sw=4:expandtab
*/
(function () {
'use strict';
var MAX_MESSAGES = 1000;
var PHONE_REGEX = /\+\d{7,12}(\d{3})/g;
var debugLog = [];
if (window.console) {
console._log = console.log;
console.log = function(thing){
console._log(thing);
if (debugL... | /*
* vim: ts=4:sw=4:expandtab
*/
(function () {
'use strict';
var MAX_MESSAGES = 1000;
var PHONE_REGEX = /\+\d{7,12}(\d{3})/g;
var debugLog = [];
if (window.console) {
console._log = console.log;
console.log = function(){
console._log.apply(this, arguments);
... | Make debug log handle multiple arguments | Make debug log handle multiple arguments
Ex: console.log('delivery receipt', phone_number, timestamp)
// FREEBIE
| JavaScript | agpl-3.0 | nrizzio/Signal-Desktop,nrizzio/Signal-Desktop,nrizzio/Signal-Desktop,nrizzio/Signal-Desktop | ---
+++
@@ -8,12 +8,13 @@
var debugLog = [];
if (window.console) {
console._log = console.log;
- console.log = function(thing){
- console._log(thing);
+ console.log = function(){
+ console._log.apply(this, arguments);
if (debugLog.length > MAX_MESSAG... |
1829b94752a3cf01773d7d360adb2c18e528fcc8 | src/renderer/mixins/global/readMagnet.js | src/renderer/mixins/global/readMagnet.js | export default {
mounted () {
document.addEventListener('paste', this.handlePaste)
},
beforeDestroy () {
document.removeEventListener('paste', this.handlePaste)
},
computed: {
isClientPage () {
return this.$route.path === '/torrenting'
}
},
methods: {
handlePaste (e) {
c... | export default {
mounted () {
document.addEventListener('paste', this.handlePaste)
},
beforeDestroy () {
document.removeEventListener('paste', this.handlePaste)
},
computed: {
isClientPage () {
return this.$route.path === '/torrenting'
}
},
methods: {
/**
* @param {Clipbo... | Fix wrong handling of paste event that would result in streaming from a magnet if pasting into input for download for eg | Fix wrong handling of paste event that would result in streaming from a magnet if pasting into input for download for eg
| JavaScript | mit | Kylart/KawAnime,Kylart/KawAnime,Kylart/KawAnime | ---
+++
@@ -14,8 +14,13 @@
},
methods: {
+ /**
+ * @param {ClipboardEvent} e
+ */
handlePaste (e) {
const text = e.clipboardData.getData('text')
+
+ if (e.target.tagName.toUpperCase() === 'INPUT') return
if (/magnet:\?/.test(text)) {
if (!this.isClientPage) { |
e268600106b19b02a8bcfd72f3aa9c59396f8d3d | js/src/core.js | js/src/core.js | // Export a global module.
window.tangelo = {};
(function (tangelo) {
"use strict";
// Tangelo version number.
tangelo.version = function () {
var version = "0.9.0-dev";
return version;
};
// A namespace for plugins.
tangelo.plugin = {};
// Standard way to access a plugin... | // Export a global module.
window.tangelo = {};
(function (tangelo) {
"use strict";
// Tangelo version number.
tangelo.version = function () {
var version = "0.9.0-dev";
return version;
};
// A namespace for plugins.
tangelo.plugin = {};
// Create a plugin namespace if it... | Add tangelo.ensurePlugin() function, to replace tangelo.getPlugin() (which is deprecated) | Add tangelo.ensurePlugin() function, to replace tangelo.getPlugin() (which is deprecated)
| JavaScript | apache-2.0 | Kitware/tangelo,Kitware/tangelo,Kitware/tangelo | ---
+++
@@ -13,6 +13,13 @@
// A namespace for plugins.
tangelo.plugin = {};
+ // Create a plugin namespace if it does not exist; otherwise, do nothing.
+ tangelo.ensurePlugin = function (plugin) {
+ if (tangelo.plugin[plugin] === undefined) {
+ tangelo.plugin[plugin] = {};
+ ... |
2f9e7e2af6539395656c7a1ae0b375f178b1c156 | packages/vega-view/src/initialize-handler.js | packages/vega-view/src/initialize-handler.js | import {offset} from './render-size';
export default function(view, prevHandler, el, constructor) {
var handler = new constructor(view.loader(), view.tooltip())
.scene(view.scenegraph().root)
.initialize(el, offset(view), view);
if (prevHandler) {
prevHandler.handlers().forEach(function(h) {
han... | import {offset} from './render-size';
export default function(view, prevHandler, el, constructor) {
var handler = new constructor(view.loader(), tooltip(view))
.scene(view.scenegraph().root)
.initialize(el, offset(view), view);
if (prevHandler) {
prevHandler.handlers().forEach(function(h) {
hand... | Add error trap for tooltip handler. | Add error trap for tooltip handler.
| JavaScript | bsd-3-clause | vega/vega,vega/vega,lgrammel/vega,vega/vega,vega/vega | ---
+++
@@ -1,7 +1,7 @@
import {offset} from './render-size';
export default function(view, prevHandler, el, constructor) {
- var handler = new constructor(view.loader(), view.tooltip())
+ var handler = new constructor(view.loader(), tooltip(view))
.scene(view.scenegraph().root)
.initialize(el, offset... |
346fa351b6c0c17c486dad3dbd85f974f48fb4aa | src/services/file.js | src/services/file.js | const { FileService } = require('./file/file.service')
const { BadScriptPermission } = require('./file/bad-script-permission.error')
const { ScriptNotExist } = require('./file/script-not-exist.error')
module.exports = exports = {
FileService,
BadScriptPermission,
ScriptNotExist
}
| const { FileService } = require('./file/file.service')
const { BadScriptPermission } = require('./file/bad-script-permission.error')
const { ScriptNotExist } = require('./file/script-not-exist.error')
const { TargetFileAlreadyExist } = require('./file/target-file-already-exist.error')
module.exports = exports = {
Fi... | Declare TargetFileAlreadyExist in service index | Declare TargetFileAlreadyExist in service index
| JavaScript | apache-2.0 | Mindsers/configfile | ---
+++
@@ -1,9 +1,11 @@
const { FileService } = require('./file/file.service')
const { BadScriptPermission } = require('./file/bad-script-permission.error')
const { ScriptNotExist } = require('./file/script-not-exist.error')
+const { TargetFileAlreadyExist } = require('./file/target-file-already-exist.error')
... |
1e7dd2c0d1a471092fc1ef6888543d2a4626e237 | www/script.js | www/script.js | HandlebarsIntl.registerWith(Handlebars);
$(function() {
window.state = {};
var source = $("#stats-template").html();
var template = Handlebars.compile(source);
refreshStats(template);
setInterval(function() {
refreshStats(template);
}, 5000)
});
function refreshStats(template) {
$.getJSON("/stats", function... | HandlebarsIntl.registerWith(Handlebars);
$(function() {
window.state = {};
var source = $("#stats-template").html();
var template = Handlebars.compile(source);
refreshStats(template);
setInterval(function() {
refreshStats(template);
}, 5000)
});
function refreshStats(template) {
$.getJSON("/stats", function... | Adjust epoch estimation time for Homestead | Adjust epoch estimation time for Homestead
| JavaScript | mit | sammy007/ether-proxy,sammy007/ether-proxy,sammy007/ether-proxy,sammy007/ether-proxy | ---
+++
@@ -20,7 +20,7 @@
stats.miners = stats.miners.sort(compare)
}
- var epochOffset = (30000 - (stats.height % 30000)) * 1000 * 17
+ var epochOffset = (30000 - (stats.height % 30000)) * 1000 * 15
stats.nextEpoch = stats.now + epochOffset
// Repaint stats |
030c68973913fcf45f259a2f0cdd334955d33dac | src/util/weak-map.js | src/util/weak-map.js | export default window.WeakMap || (function () {
let index = 0;
function Wm () {
this.key = `____weak_map_${index++}`;
}
Wm.prototype = {
delete (obj) {
if (obj) {
delete obj[this.key];
}
},
get (obj) {
return obj ? obj[this.key] : null;
},
has (obj) {
retu... | export default window.WeakMap || (function () {
let index = 0;
function Wm () {
this.key = `____weak_map_${index++}`;
}
Wm.prototype = {
delete (obj) {
if (obj) {
delete obj[this.key];
}
},
get (obj) {
return obj ? obj[this.key] : null;
},
has (obj) {
retu... | Make weak map props non-enumerable preventing circular references when traversing props. | Make weak map props non-enumerable preventing circular references when traversing props.
| JavaScript | mit | skatejs/named-slots | ---
+++
@@ -16,7 +16,18 @@
return obj ? typeof obj[this.key] !== 'undefined' : false;
},
set (obj, val) {
- return obj ? obj[this.key] = val : null;
+ if (obj) {
+ const key = this.key;
+ if (typeof obj[key] === 'undefined') {
+ Object.defineProperty(obj, key, {
+ ... |
40c5111ee6fe0b7c670dc28d66d475be2ff030fc | null-prune.js | null-prune.js | (function (name, definition) {
// AMD
if (typeof define === 'function') {
define(definition);
}
// Node.js
else if (typeof module !== 'undefined' && module.exports) {
module.exports = definition();
}
// Browser
else {
window[name] = definition();
}
})('null... | (function (name, definition) {
if (typeof define === 'function') {
// AMD
define(definition);
} else if (typeof module !== 'undefined' && module.exports) {
// Node.js
module.exports = definition();
} else {
// Browser
window[name] = definition();
}
})('nullPrune', function () {
functio... | Tidy up indentation of UMD loader | Tidy up indentation of UMD loader
| JavaScript | apache-2.0 | cskeppstedt/null-prune | ---
+++
@@ -1,19 +1,14 @@
(function (name, definition) {
-
+ if (typeof define === 'function') {
// AMD
- if (typeof define === 'function') {
- define(definition);
- }
-
+ define(definition);
+ } else if (typeof module !== 'undefined' && module.exports) {
// Node.js
- else if (typeof m... |
940163051b33e111370fbb292666e4668c519a27 | test/integration/test-bad-credentials.js | test/integration/test-bad-credentials.js | var common = require('../common');
var connection = common.createConnection({password: 'INVALID PASSWORD'});
var assert = require('assert');
var err;
connection.connect(function(_err) {
assert.equal(err, undefined);
err = _err;
});
process.on('exit', function() {
assert.ok(/access denied/i.test(err.mess... | var common = require('../common');
var connection = common.createConnection({password: 'INVALID PASSWORD'});
var assert = require('assert');
var err;
connection.connect(function(_err) {
assert.equal(err, undefined);
err = _err;
});
process.on('exit', function() {
assert.equal(err.code, 'ER_ACCESS_DENIED... | Make test error more useful | Make test error more useful
| JavaScript | mit | saisai/node-mysql,wxkdesky/node-mysql,1602/node-mysql,bbito/node-mysql,l371559739/node-mysql,yanninho/node-mysql,linalu1/node-mysql,felixge/node-mysql,tempbottle/node-mysql,shipci/node-mysql,apathyjade/node-mysql,yulongge/node-mysql,XiaoLongW/node-mysql,grooverdan/node-mysql,zhhb/node-mysql,chinazhaghai/node-mysql,Jimb... | ---
+++
@@ -9,7 +9,7 @@
});
process.on('exit', function() {
+ assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR');
assert.ok(/access denied/i.test(err.message));
- assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR');
});
|
fa7831b3ab4331c1e617809b520d82deb5711931 | shared/api_client/ChainConfig.js | shared/api_client/ChainConfig.js | import { ecc_config, hash } from "../ecc"
ecc_config.address_prefix = "GLS";
let chain_id = ""
for(let i = 0; i < 32; i++) chain_id += "00"
module.exports = {
address_prefix: "GLS",
expire_in_secs: 15,
chain_id
}
| import { ecc_config, hash } from "../ecc"
ecc_config.address_prefix = "STM";
let chain_id = ""
for(let i = 0; i < 32; i++) chain_id += "00"
module.exports = {
address_prefix: "STM",
expire_in_secs: 15,
chain_id
}
| Use STM instead GLS as ecc_config.address_prefix | Use STM instead GLS as ecc_config.address_prefix
| JavaScript | mit | GolosChain/tolstoy,GolosChain/tolstoy,GolosChain/tolstoy | ---
+++
@@ -1,12 +1,12 @@
import { ecc_config, hash } from "../ecc"
-ecc_config.address_prefix = "GLS";
+ecc_config.address_prefix = "STM";
let chain_id = ""
for(let i = 0; i < 32; i++) chain_id += "00"
module.exports = {
- address_prefix: "GLS",
+ address_prefix: "STM",
expire_in_secs: 15,
... |
520f37fad8789c5e43e59918b84848b1dea3bf06 | test/when-adapter.js | test/when-adapter.js | (function() {
'use strict';
if(typeof exports === 'object') {
var when = require('../when');
exports.fulfilled = when.resolve;
exports.rejected = when.reject;
exports.pending = function () {
var deferred = when.defer();
return {
promise: deferred.promise,
fulfill: deferred.resolve,
reje... | (function() {
'use strict';
if(typeof exports === 'object') {
var when = require('../when');
exports.fulfilled = when.resolve;
exports.rejected = when.reject;
exports.pending = function () {
var pending = {};
pending.promise = when.promise(function(resolve, reject) {
pending.fulfill = resolve;
... | Update aplus test adapter to use when.promise | Update aplus test adapter to use when.promise
| JavaScript | mit | caporta/when,caporta/when,ning-github/when,SourcePointUSA/when,stevage/when,frank-weindel/when,tkirda/when,ning-github/when,mlennon3/when,stevage/when,anthonyvia/when,tkirda/when,petkaantonov/when,SourcePointUSA/when,frank-weindel/when,anthonyvia/when,mlennon3/when,DJDNS/when.js | ---
+++
@@ -9,13 +9,14 @@
exports.rejected = when.reject;
exports.pending = function () {
- var deferred = when.defer();
+ var pending = {};
- return {
- promise: deferred.promise,
- fulfill: deferred.resolve,
- reject: deferred.reject
- };
+ pending.promise = when.promise(function(resolv... |
5b15efa2a01ccdb6ed4c92128df362e585bbd868 | string/startswith.js | string/startswith.js | module.exports = function (str, query, position) {
return str.substr(position, query.length) === query;
};
| /**
Does a string start with another string?
@module string/startsWith
@param {string} str The string to search through.
@param {string} query The string to find in `str`.
@param {number} [position=0] The index to start the search. Defaults to the beginning of the string.
@returns {bool} Does the string start with ano... | Add JSDoc documentation to string/startsWith | Add JSDoc documentation to string/startsWith
| JavaScript | mit | EvanHahn/lildash | ---
+++
@@ -1,3 +1,18 @@
+/**
+Does a string start with another string?
+
+@module string/startsWith
+@param {string} str The string to search through.
+@param {string} query The string to find in `str`.
+@param {number} [position=0] The index to start the search. Defaults to the beginning of the string.
+@returns {b... |
e825b025f3e7e2c96cf73ae669e70161bb1e6b7e | app/assets/javascripts/umlaut/ajax_windows.js | app/assets/javascripts/umlaut/ajax_windows.js | /* ajax_windows.js. Support for modal popup windows in Umlaut items. */
jQuery(document).ready(function($) {
var populate_modal = function(data, textStatus, jqXHR) {
data = $(data);
var heading = data.find("h1, h2, h3, h4, h5, h6").eq(0).remove();
$("#modal .modal-header h3").text(heading.text());
va... | /* ajax_windows.js. Support for modal popup windows in Umlaut items. */
jQuery(document).ready(function($) {
var populate_modal = function(data, textStatus, jqXHR) {
data = $(data);
var heading = data.find("h1, h2, h3, h4, h5, h6").eq(0).remove();
$("#modal .modal-header h3").text(heading.text());
va... | Update to handle modal window submits. | Update to handle modal window submits.
| JavaScript | mit | team-umlaut/umlaut,team-umlaut/umlaut,team-umlaut/umlaut | ---
+++
@@ -6,7 +6,11 @@
$("#modal .modal-header h3").text(heading.text());
var submit = data.find("form input[type=submit]").eq(0).remove();
$("#modal .modal-body").html(data.html());
- if (submit) $("#modal .modal-footer").html(submit.wrap('<div>').parent().html());
+ footer = $("#modal .modal... |
6cdc555485a9fba147558341eed8a11b2a63efd7 | lib/CordovaPluginAdapter.js | lib/CordovaPluginAdapter.js | var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
var ReactNative = require('react-native');
function CordovaPluginAdapter() {
this.nativeInterface = ReactNative.NativeModules.CordovaPluginAdapter;
this._callbackCount = Math.random();
this._callbacks = {};
this.initCallbackChannel();
};
C... | var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
var ReactNative = require('react-native');
function CordovaPluginAdapter() {
this.nativeInterface = ReactNative.NativeModules.CordovaPluginAdapter;
this._callbackCount = Math.random();
this._callbacks = {};
this.initCallbackChannel();
};
C... | Return object, not string from Cordova plugin calls | Return object, not string from Cordova plugin calls
| JavaScript | isc | axemclion/react-native-cordova-plugin,axemclion/react-native-cordova-plugin | ---
+++
@@ -25,7 +25,7 @@
CordovaPluginAdapter.prototype.onChannelCallback = function(params) {
if (typeof this._callbacks[params.callbackId] === 'object') {
- var result = params.message;
+ var result = JSON.parse(params.message);
try {
if (params.status === 1) {
... |
82dc2f6053b9f55e380daa43d288128f9788f739 | .wdio/ci.conf.js | .wdio/ci.conf.js | exports.config = {
specs: [ './test/**/*.js' ],
exclude: [ ],
sync: true,
logLevel: 'silent',
coloredLogs: true,
bail: 0,
screenshotPath: 'screenshots',
baseUrl: 'http://localhost:3000',
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
},
reporters: [ 'spec' ],
waitforTimeout: 10000,
co... | exports.config = {
specs: [ './test/**/*.js' ],
exclude: [ ],
sync: true,
logLevel: 'silent',
coloredLogs: true,
bail: 0,
screenshotPath: 'screenshots',
baseUrl: 'http://localhost:3000',
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
},
reporters: [ 'spec' ],
waitforTimeout: 30000,
co... | Increase waitforTimeout to 30 seconds | Increase waitforTimeout to 30 seconds
| JavaScript | mpl-2.0 | chameleoid/telepathy-web,chameleoid/telepathy-web,chameleoid/telepathy-web | ---
+++
@@ -18,7 +18,7 @@
reporters: [ 'spec' ],
- waitforTimeout: 10000,
+ waitforTimeout: 30000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
|
476629c71af2137a81c276d93abaa87946e6ccbc | vendor/ember-intercom-io.js | vendor/ember-intercom-io.js | (function() {
/* globals define, Intercom */
function generateModule(name, values) {
define(name, [], function() {
'use strict';
return values;
});
}
function setupIntercom(config) {
var ic = window.Intercom || null;
if (typeof ic === 'function') {
ic('reattach_activator');
... | (function() {
/* globals define, Intercom */
function generateModule(name, values) {
define(name, [], function() {
'use strict';
return values;
});
}
function setupIntercom(config) {
var ic = window.Intercom || null;
if (typeof ic === 'function') {
ic('reattach_activator');
... | Use es5 for node.js code, to make phantom happy | Use es5 for node.js code, to make phantom happy
| JavaScript | mit | levanto-financial/ember-intercom-io,seawatts/ember-intercom-io,mike-north/ember-intercom-io,levanto-financial/ember-intercom-io,mike-north/ember-intercom-io,seawatts/ember-intercom-io | ---
+++
@@ -15,7 +15,7 @@
ic('reattach_activator');
ic('update', {});
} else {
- var d = document;
+ var d = window.document;
var i = function() {
i.c(arguments);
};
@@ -28,8 +28,8 @@
var s = d.createElement('script');
s.type = 'text/javascript';
... |
2cef9ebfa7c747e96db3a8d8e2a3dce9a3e74c82 | test/stub/ns.tmpl.js | test/stub/ns.tmpl.js | beforeEach(function() {
function genViewHTML(id, view) {
var html = '';
var clazz = 'ns-view-' + id;
if (view.async) {
clazz += ' ns-async';
}
if (view.collection) {
clazz += ' ns-view-container-desc';
}
if (view.placeholder) {
... | beforeEach(function() {
function genViewHTML(id, view) {
var html = '';
var clazz = 'ns-view-' + id;
if (view.async) {
clazz += ' ns-async';
}
if (view.collection) {
clazz += ' ns-view-container-desc';
}
if (view.placeholder) {
... | Add random key to generated nodes to simple get same it or not | Add random key to generated nodes to simple get same it or not
| JavaScript | mit | yandex-ui/noscript,Rebulus/noscript,mishk0/noscript | ---
+++
@@ -13,7 +13,7 @@
if (view.placeholder) {
clazz += ' ns-view-placeholder';
}
- html += '<div class="' + clazz + '" data-key="' + view.key + '">';
+ html += '<div class="' + clazz + '" data-key="' + view.key + '" data-random="' + Math.random() + '">';
// do... |
7eeebd090769ed1bcf8013b6f0306b5531ba3e86 | test/util/localrq.js | test/util/localrq.js | var request = require('request');
var localRoot = 'http://localhost:' + process.env.PORT || 3000;
var assert = require('assert');
exports.get = function localGet(url, cb) {
return request({url: localRoot + url, encoding: 'utf8',
method: 'GET'}, assertServerSuccess(cb));
};
exports.post = function local... | var request = require('request');
var localRoot = 'http://localhost:' + process.env.PORT || 3000;
var assert = require('assert');
exports.get = function localGet(url, cb) {
return request({url: localRoot + url, encoding: 'utf8',
method: 'GET'}, assertServerSuccess(cb));
};
exports.post = function local... | Handle errs when asserting server success | Handle errs when asserting server success
| JavaScript | mit | chatphrase/caress | ---
+++
@@ -14,7 +14,7 @@
function assertServerSuccess(cb) {
return function(err, res, body) {
- if (res.statusCode >= 500) {
+ if (!err && res.statusCode >= 500) {
assert.fail(res.statusCode, 500, body, '<');
} else cb && cb(err,res,body);
}; |
99abf608ea6e19c83a3f4e564ea31f7749fc48be | .babelrc.js | .babelrc.js | const {join} = require("path")
module.exports = {
plugins: [
["module-resolver", {
cwd: __dirname,
root: ["src"],
alias: {
"package.json": join(__dirname, "package.json")
}
}],
"@babel/transform-runtime",
["@babel/proposal-decorators", {
legacy: true
}],
... | const {join} = require("path")
module.exports = {
plugins: [
["module-resolver", {
cwd: __dirname,
root: ["src"],
alias: {
"package.json": join(__dirname, "package.json")
}
}],
"@babel/transform-runtime",
["@babel/proposal-decorators", {
legacy: true
}],
... | Add partial application plugin for babel. | Add partial application plugin for babel.
| JavaScript | mit | octet-stream/ponyfiction-js,octet-stream/ponyfiction-js | ---
+++
@@ -16,7 +16,7 @@
["@babel/proposal-class-properties", {
loose: true
}],
- "@babel/plugin-proposal-partial-application",
+ "@babel/proposal-partial-application",
"@babel/proposal-nullish-coalescing-operator",
"@babel/proposal-optional-catch-binding",
"@babel/proposal-opti... |
c7ff1ef3550c46c3ee97740c97ca1d47a3914217 | src/components/encrypt/EncryptKeyListItem.js | src/components/encrypt/EncryptKeyListItem.js | 'use strict';
import React, { Component } from 'react';
import ReactCSS from 'reactcss';
class EncryptKeyListItem extends Component {
classes() {
return {
'default': {
},
};
}
render() {
return <div></div>;
}
}
export default ReactCSS(EncryptKeyListItem);
| 'use strict';
import React, { Component } from 'react';
import ReactCSS from 'reactcss';
import { User } from '../common/index';
import colors from '../../styles/variables/colors';
import { spacing, sizing } from '../../styles/variables/utils';
class EncryptKeyListItem extends Component {
classes() {
return {... | Add encrypt key list item styles | Add encrypt key list item styles
| JavaScript | mit | henryboldi/felony,tobycyanide/felony,henryboldi/felony,tobycyanide/felony | ---
+++
@@ -3,11 +3,24 @@
import React, { Component } from 'react';
import ReactCSS from 'reactcss';
+import { User } from '../common/index';
+
+import colors from '../../styles/variables/colors';
+import { spacing, sizing } from '../../styles/variables/utils';
+
class EncryptKeyListItem extends Component {
c... |
9fcd1742f83e9759d0b8d7fd4338cd6149a19a07 | PageTool/Analytics/Include/Analytics.tool.js | PageTool/Analytics/Include/Analytics.tool.js | var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{ANALYTICS_CODE}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol
? 'https://'
: 'http://')
+ 'stats.g.doubleclick.ne... | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js',
'__gaTracker'... | Update to use Universal Tracking | Update to use Universal Tracking
| JavaScript | mit | phpgt/webengine | ---
+++
@@ -1,15 +1,8 @@
-var _gaq = _gaq || [];
-_gaq.push(['_setAccount', '{ANALYTICS_CODE}']);
-_gaq.push(['_trackPageview']);
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0... |
07927b0770d543f49028de8a4f1ebb5ead627e94 | client/javascript/services/getAssessments.js | client/javascript/services/getAssessments.js | import debugModule from 'debug';
import Joi from 'joi';
import xhr from 'xhr';
const debug = debugModule('csra');
const schema = Joi.array().items(
Joi.object({
id: Joi.number(),
nomisId: Joi.string().optional(),
forename: Joi.string(),
surname: Joi.string(),
dateOfBirth: Joi.string(),
riskA... | import debugModule from 'debug';
import Joi from 'joi';
import xhr from 'xhr';
const debug = debugModule('csra');
const schema = Joi.array().items(
Joi.object({
id: Joi.number(),
nomisId: Joi.string().optional(),
forename: Joi.string(),
surname: Joi.string(),
dateOfBirth: Joi.string(),
riskA... | Add JSON option to automatically parse to JSON from request | CSRA-547: Add JSON option to automatically parse to JSON from request
| JavaScript | mit | noms-digital-studio/csra-app,noms-digital-studio/csra-app,noms-digital-studio/csra-app | ---
+++
@@ -35,6 +35,7 @@
const options = {
timeout: 3500,
+ json: true,
};
xhr.get(target, options, (error, resp, body) => { |
2d0d320d058b08703a1c4ce746c6cd5e0c976acb | webui/src/app/core/providers.resource.js | webui/src/app/core/providers.resource.js | 'use strict';
var angular = require('angular');
var traefikCoreProvider = 'traefik.core.provider';
module.exports = traefikCoreProvider;
angular
.module(traefikCoreProvider, ['ngResource'])
.factory('Providers', Providers);
/** @ngInject */
function Providers($resource, $q) {
const resourceProvider = $resource... | 'use strict';
var angular = require('angular');
var traefikCoreProvider = 'traefik.core.provider';
module.exports = traefikCoreProvider;
angular
.module(traefikCoreProvider, ['ngResource'])
.factory('Providers', Providers);
/** @ngInject */
function Providers($resource, $q) {
const resourceProvider = $resource... | Remove useless ACME tab from UI. | Remove useless ACME tab from UI.
| JavaScript | mit | containous/traefik,aantono/traefik,vdemeester/traefik,FriggaHel/traefik,aantono/traefik,ldez/traefik,vdemeester/traefik,containous/traefik,aantono/traefik,dtomcej/traefik,mmatur/traefik,FriggaHel/traefik,aantono/traefik,ldez/traefik,mmatur/traefik,mmatur/traefik,dtomcej/traefik,vdemeester/traefik,mmatur/traefik,SantoDE... | ---
+++
@@ -17,6 +17,9 @@
resourceProvider.get()
.$promise
.then((rawProviders) => {
+ delete rawProviders.acme;
+ delete rawProviders.ACME;
+
for (let providerName in rawProviders) {
if (rawProviders.hasOwnProperty(providerName)) {
... |
f5cdb43607f9894f915e266b634a88e3577cbe05 | bin/gh.js | bin/gh.js | #!/usr/bin/env node
/*
* Copyright 2013-2015, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/node-gh/gh/blob/master/LICENSE.md
*
* @author Eduardo Lundgren <edu@rdo.io>
*/
'use strict';
var path = require('path'),
fs = require('fs'),
logger = require('../lib/logger'... | #!/usr/bin/env node
/*
* Copyright 2013-2015, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/node-gh/gh/blob/master/LICENSE.md
*
* @author Eduardo Lundgren <edu@rdo.io>
*/
'use strict';
var path = require('path'),
fs = require('fs'),
logger = require('../lib/logger'... | Fix linting issue. Source formatting. | Fix linting issue. Source formatting.
| JavaScript | bsd-3-clause | oouyang/gh,tomzx/gh,henvic/gh,modulexcite/gh,TomzxForks/gh,tomzx/gh,dustinryerson/gh,oouyang/gh,henvic/gh,modulexcite/gh,TomzxForks/gh,dustinryerson/gh | ---
+++
@@ -20,6 +20,10 @@
configs = require('../lib/configs');
// Check node version
+function isCompatibleNodeVersion() {
+ return semver.satisfies(process.version, pkg.engines.node);
+}
+
if (!isCompatibleNodeVersion()) {
logger.error('Please update your NodeJS version: http://nodejs.org/download'... |
7df460bdc5be6aadb2a0d20bddf6c2648652639c | modules/ext.pageTriage.util/ext.pageTriage.viewUtil.js | modules/ext.pageTriage.util/ext.pageTriage.viewUtil.js | $( function() {
if ( !mw.pageTriage ) {
mw.pageTriage = {};
}
mw.pageTriage.viewUtil = {
// fetch and compile a template, then return it.
// args: view, template
template: function( arg ) {
apiRequest = {
'action': 'pagetriagetemplate',
'view': arg.view,
'format': 'json'
};
var template... | $( function() {
if ( !mw.pageTriage ) {
mw.pageTriage = {};
}
mw.pageTriage.viewUtil = {
// fetch and compile a template, then return it.
// args: view, template
template: function( arg ) {
apiRequest = {
'action': 'pagetriagetemplate',
'view': arg.view,
'format': 'json'
};
var template... | Make sure some results were returned to avoid error. | Make sure some results were returned to avoid error.
Change-Id: Ic788bd1be6711e8c9475909562514d66c6a26d4c
| JavaScript | mit | wikimedia/mediawiki-extensions-PageTriage,wikimedia/mediawiki-extensions-PageTriage,wikimedia/mediawiki-extensions-PageTriage | ---
+++
@@ -27,9 +27,9 @@
dataType: 'json',
async: false,
success: function( result ) {
- if( result.pagetriagetemplate.result == 'success' ) {
+ if ( result.pagetriagetemplate !== undefined && result.pagetriagetemplate.result === 'success' ) {
templateText = result.pagetriagetemplate.te... |
f1f97709aaed83b7cc3bac30d795650519d417aa | app/assets/javascripts/controller/router.js | app/assets/javascripts/controller/router.js | var AppRouter = Backbone.Router.extend({
routes: {
'topics/:topicId': 'showResults',
'*actions': 'defaultAction'
},
showResults: function(topicId) {
if ($('#topics-container').length === 0) {
this.defaultAction();
}
var resultsView = new ResultsView();
resultsView.render();
va... | var AppRouter = Backbone.Router.extend({
routes: {
'topics/:topicId': 'showResults',
'*actions': 'defaultAction'
},
showResults: function(topicId) {
if ($('#topics-container').length === 0) {
this.defaultAction();
}
var resultsView = new ResultsView();
resultsView.render();
va... | Fix refresh bug by ensuring the correct dropdown choice is selected | Fix refresh bug by ensuring the correct dropdown choice is selected
| JavaScript | mit | Jasmine-Feldmann/pollarity,Jasmine-Feldmann/pollarity,zebogen/pollarity,Jasmine-Feldmann/pollarity,zebogen/pollarity,zebogen/pollarity,zebogen/pollarity,Jasmine-Feldmann/pollarity | ---
+++
@@ -15,10 +15,10 @@
var topicCharts = new TopicCharts([], { topicId: topicId });
topicCharts.fetch({
success: function(response) {
+ $('option:nth-child(' + (parseInt(topicId)+1) + ')').attr('selected', true);
var topicChartsView = new TopicChartsView({ collection: response.mo... |
d28e387391f8ea3aa46932e6ec0ae75f28f2f4ae | app/assets/javascripts/spending_averages.js | app/assets/javascripts/spending_averages.js | $(function () {
$('#spending-averages').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: <a href="https://en.wikipedia.org/wiki/World_population">Wikipedia.org</a>'
... | $(function () {
$('#spending-averages').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: <a href="https://en.wikipedia.org/wiki/World_population">Wikipedia.org</a>'
... | Add data for national avrages | Add data for national avrages
| JavaScript | mit | nyc-cicadas-2015/Can-I-Afford-This,nyc-cicadas-2015/Can-I-Afford-This,nyc-cicadas-2015/Can-I-Afford-This | ---
+++
@@ -51,10 +51,10 @@
},
series: [{
name: 'Your spending',
- data: [107, 31, 635, 203, 2]
+ data: [107, 31, 635, 203, 5]
}, {
name: 'Average Spending',
- data: [133, 156, 947, 408, 6]
+ data: [35, 15, 7, 3, 30, 10]
... |
83fed674f7b436cb4c1ba2d91346d15a2b05ad7a | lib/helpers.js | lib/helpers.js | /**
* Helper functions that are used in the other modules to reduce the number of times
* that code for common tasks is rewritten
*
* (c) 2013, Greg Malysa <gmalysa@stanford.edu>
* Permission to use granted under the terms of the MIT License. See LICENSE for details.
*/
/**
* Retrieves the name for a function, ... | /**
* Helper functions that are used in the other modules to reduce the number of times
* that code for common tasks is rewritten
*
* (c) 2013, Greg Malysa <gmalysa@stanford.edu>
* Permission to use granted under the terms of the MIT License. See LICENSE for details.
*/
/**
* Retrieves the name for a function, ... | Rename anonymous to make the styling more like others | Rename anonymous to make the styling more like others
| JavaScript | mit | gmalysa/flux-link | ---
+++
@@ -19,7 +19,7 @@
return fn.name;
if (altname)
return altname;
- return '(anonymous)';
+ return '<anonymous>';
}
/** |
292eab2125b76d48c175559e8cbd1198ef53510c | app/polymer/src/server/config/babel.prod.js | app/polymer/src/server/config/babel.prod.js | module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
presets: [
[
require.resolve('babel-preset-env'),
{
targets: {
browsers: ['last 2 versions', 'safari >= 7'],
},
modules: false,
},
],
requir... | module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
presets: [
[
require.resolve('babel-preset-env'),
{
targets: {
browsers: ['last 2 versions', 'safari >= 7'],
},
modules: false,
},
],
requir... | Set mangle to false in babel-preset-minify for polymer to fix static build | Set mangle to false in babel-preset-minify for polymer to fix static build
| JavaScript | mit | storybooks/storybook,rhalff/storybook,kadirahq/react-storybook,rhalff/storybook,storybooks/storybook,storybooks/react-storybook,rhalff/storybook,storybooks/storybook,rhalff/storybook,rhalff/storybook,storybooks/storybook,storybooks/storybook,rhalff/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/re... | ---
+++
@@ -13,7 +13,12 @@
],
require.resolve('babel-preset-stage-0'),
require.resolve('babel-preset-react'),
- require.resolve('babel-preset-minify'),
+ [
+ require.resolve('babel-preset-minify'),
+ {
+ mangle: false,
+ },
+ ],
],
plugins: [
require.resolve('b... |
42500591eb8048396af67dac18e155e28ba6de03 | _attachments/script/paste.js | _attachments/script/paste.js | jQuery(function($) {
/* tab insertion handling */
$('#code').keydown(function(e) {
if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {
if (this.setSelectionRange) {
var start = this.selectionStart;
var end = this.selectionEnd;
var top = this.scrollTop;
... | jQuery(function($) {
/* tab handling - gemo style */
$('#code').keydown(function(e) {
if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {
if (this.setSelectionRange) {
var start = this.selectionStart;
var end = this.selectionEnd;
var top = this.scrollTop;
... | Indent and deindent selected block of text - gemo style | Indent and deindent selected block of text - gemo style
| JavaScript | mit | gdamjan/paste-couchapp | ---
+++
@@ -1,14 +1,22 @@
jQuery(function($) {
- /* tab insertion handling */
+ /* tab handling - gemo style */
$('#code').keydown(function(e) {
if (e.keyCode == 9 && !e.ctrlKey && !e.altKey) {
if (this.setSelectionRange) {
var start = this.selectionStart;
var end... |
2569ab19ab1ae516451a8018b8911fd82c72e100 | array/common-elements-two-arrays.js | array/common-elements-two-arrays.js | // Program that identifies common element(s) that exist within both two arrays
function intersection(firstArray, secondArray) {
var hashMap = {};
var commonElements = [];
// create hashmap with elements of first array as keys
arrOne.forEach(function(element) {
hashMap[element] = 1;
})
}
| // Program that identifies common element(s) that exist within both two arrays
function intersection(firstArray, secondArray) {
var hashMap = {};
var commonElements = [];
// create hashmap with elements of first array as keys
arrOne.forEach(function(element) {
hashMap[element] = 1;
})
// use hashmap's O(1) l... | Use hashmap's O(1) look up time to check if an element in second array exists in the hash (i.e. first array), iterating through entire second array | Use hashmap's O(1) look up time to check if an element in second array exists in the hash (i.e. first array), iterating through entire second array
| JavaScript | mit | derekmpham/interview-prep,derekmpham/interview-prep | ---
+++
@@ -8,6 +8,13 @@
arrOne.forEach(function(element) {
hashMap[element] = 1;
})
+
+ // use hashmap's O(1) look up time to check if an element in second array exists in the hash (i.e. first array)
+ secondArray.forEach(function(element) { // iterate through entire second array
+ if (hashMap[element] === 1... |
79019f506fe1fef40d1edb4e79ab4ca732403d1a | webpack-cfg/alias.js | webpack-cfg/alias.js | module.exports = {
resolve: {
alias: {
// Use non-compiled version of the following libraries
'reselect': 'reselect/src/index.js',
// Use non-compiled version of the following react libraries
'react-icon-base': 'react-icon-base/index.js',
'react-collapse': 'react-collapse/src/index.... | module.exports = {
resolve: {
alias: {
// Use non-compiled version of the following libraries
'reselect': 'reselect/src/index.js',
'react-redux-firebase': 'react-redux-firebase/es'
}
}
}
| Use ES module of react-redux-firebase | Use ES module of react-redux-firebase
| JavaScript | mit | jsse-2017-ph23/web-frontend,jsse-2017-ph23/web-frontend,jsse-2017-ph23/web-frontend | ---
+++
@@ -3,13 +3,7 @@
alias: {
// Use non-compiled version of the following libraries
'reselect': 'reselect/src/index.js',
-
- // Use non-compiled version of the following react libraries
- 'react-icon-base': 'react-icon-base/index.js',
- 'react-collapse': 'react-collapse/src/inde... |
13893fdda355e822af305b3863c07ceeba88a13a | init.js | init.js |
requirejs.config({
paths: {
'jquery': './lib/components/jquery/dist/jquery.min'
}
});
require( [ 'src/graph' ] , function( Graph ) {
var functions = [
function( domGraph, domSource ) {
var g1 = new Graph( domGraph );
var serie = g1.newSerie("serieTest")
.setLabel( "My serie" )
.autoAxis()
.... |
requirejs.config({
paths: {
'jquery': './lib/components/jquery/dist/jquery.min'
}
});
require( [ 'src/graph' ] , function( Graph ) {
var functions = [
function( domGraph ) {
var graph = new Graph( domGraph );
graph.newSerie("serieTest")
.setLabel( "My serie" )
.autoAxis()
.setData( [ [1, 2], [2, 5],... | Update script for the beauty of it | Update script for the beauty of it
| JavaScript | mit | NPellet/jsGraph,andcastillo/graph,NPellet/jsGraph,andcastillo/graph | ---
+++
@@ -9,34 +9,36 @@
var functions = [
-function( domGraph, domSource ) {
+function( domGraph ) {
- var g1 = new Graph( domGraph );
+ var graph = new Graph( domGraph );
- var serie = g1.newSerie("serieTest")
- .setLabel( "My serie" )
- .autoAxis()
- .setData( [ [1, 2], [2, 5], [3, 10] ] )
... |
5cfea2ffb89d3f81e20bb36dd5341b281fa78ada | app/assets/javascripts/scripts.js | app/assets/javascripts/scripts.js | $(function(){
$(".tablesorter").tablesorter();
$("tr[data-link]").click(function() {
window.location = $(this).data("link")
});
console.log('Scripts loaded.');
});
| var tablesort = function() {
$(".tablesorter").tablesorter();
console.log('Tablesorter loaded.');
};
$(document).on('turbolinks:load', tablesort);
| Load js on turbolink refresh | Load js on turbolink refresh
| JavaScript | mit | greenvault/wahlbezirke,greenvault/wahlbezirke,greenvault/wahlbezirke | ---
+++
@@ -1,7 +1,6 @@
-$(function(){
+var tablesort = function() {
$(".tablesorter").tablesorter();
- $("tr[data-link]").click(function() {
- window.location = $(this).data("link")
- });
- console.log('Scripts loaded.');
-});
+ console.log('Tablesorter loaded.');
+};
+
+$(document).on('turbolinks:load', t... |
324b5aba5334b203ce1a622471b41427d0b0afa6 | addon/models/file-version.js | addon/models/file-version.js | import DS from 'ember-data';
import OsfModel from './osf-model';
/**
* @module ember-osf
* @submodule models
*/
/**
* Model for OSF APIv2 file versions. Primarily used in relationship fields.
* This model is used for basic file version metadata. To interact with file contents directly, see the `file-manager` se... | import DS from 'ember-data';
import OsfModel from './osf-model';
/**
* @module ember-osf
* @submodule models
*/
/**
* Model for OSF APIv2 file versions. Primarily used in relationship fields.
* This model is used for basic file version metadata. To interact with file contents directly, see the `file-manager` se... | Add dateCreated to file version model | Add dateCreated to file version model
| JavaScript | apache-2.0 | jamescdavis/ember-osf,binoculars/ember-osf,crcresearch/ember-osf,baylee-d/ember-osf,CenterForOpenScience/ember-osf,binoculars/ember-osf,jamescdavis/ember-osf,chrisseto/ember-osf,baylee-d/ember-osf,chrisseto/ember-osf,CenterForOpenScience/ember-osf,crcresearch/ember-osf | ---
+++
@@ -17,5 +17,6 @@
*/
export default OsfModel.extend({
size: DS.attr('number'),
+ dateCreated: DS.attr('date'),
contentType: DS.attr('fixstring')
}); |
870d438d162750d7b3b0586702ec551352200c10 | client/app/scripts/services/meta-machine.js | client/app/scripts/services/meta-machine.js | angular
.module('app')
.factory('MetaMachine', function($rootScope) {
var MetaMachine = {
title: function(pageTitle, baseTitle) {
baseTitle = typeof baseTitle != 'undefined' ? baseTitle : "Rootstrikers";
$rootScope.title = typeof pageTitle != 'undefined' ? pageTitle + " | " + baseTitle : b... | angular
.module('app')
.factory('MetaMachine', function($rootScope) {
var metaDefaults = {
metaTitle: "Home | Rootstrikers",
metaDescription: "We fight the corrupting influence of money in politics",
metaImage: "http://facultycreative.com/img/icons/facultyicon114.png",
metaUrl: "http://... | Update MetaMachine directive to add a metaImage tag and metaUrl tag (OG tags for Facebook). Directive now also sets page defaults. | Update MetaMachine directive to add a metaImage tag and metaUrl tag (OG tags for Facebook). Directive now also sets page defaults. | JavaScript | mit | brettshollenberger/rootstrikers,brettshollenberger/rootstrikers | ---
+++
@@ -1,13 +1,31 @@
angular
.module('app')
.factory('MetaMachine', function($rootScope) {
+
+ var metaDefaults = {
+ metaTitle: "Home | Rootstrikers",
+ metaDescription: "We fight the corrupting influence of money in politics",
+ metaImage: "http://facultycreative.com/img/icons/facultyi... |
7afc12f3526dd6ff2dcfc6d57b2838d59c557994 | common/components/stores/NavigationStore.js | common/components/stores/NavigationStore.js | // @flow
import type { SectionType } from "../enums/Section.js";
import { ReduceStore } from "flux/utils";
import UniversalDispatcher from "./UniversalDispatcher.js";
import { Record } from "immutable";
import Section from "../enums/Section.js";
import url from "../utils/url.js";
export type NavigationActionType = {... | // @flow
import type { SectionType } from "../enums/Section.js";
import { ReduceStore } from "flux/utils";
import UniversalDispatcher from "./UniversalDispatcher.js";
import { Record } from "immutable";
import Section from "../enums/Section.js";
import url from "../utils/url.js";
export type NavigationActionType = {... | Change default section to Home | Change default section to Home
| JavaScript | mit | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange | ---
+++
@@ -16,8 +16,8 @@
};
// TODO: Remove showsplash argument
const DEFAULT_STATE = {
- section: Section.FindProjects,
- url: url.section(Section.FindProjects, { showSplash: 1 }),
+ section: Section.Home,
+ url: url.section(Section.Home),
};
class State extends Record(DEFAULT_STATE) { |
083e928a4b8260b92646fe2ce14a34b6e67c8bb4 | app/initializers/clock-service.js | app/initializers/clock-service.js | // Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
... | // Based on "Continous Redrawing of Objects"
// http://emberjs.com/guides/cookbook/working_with_objects/continuous_redrawing_of_views/
//
// #pulse is updated every ~15-seconds
//
var ClockService = Ember.Object.extend({
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
... | Fix for stalling acceptance tests. | Fix for stalling acceptance tests.
| JavaScript | mit | substantial/substantial-dash-client | ---
+++
@@ -7,11 +7,16 @@
pulse: Ember.computed.oneWay('_minutes').readOnly(),
tick: function () {
var clock = this;
- Ember.run.later(function () {
- var minutes = clock.get('_minutes');
- if (typeof minutes === 'number') {
- clock.set('_minutes', minutes + (1/4));
- }
+ // Thi... |
6eed7ab4ff7ec2b9834153874d3b8813d0eda54f | src/lib/addCustomMediaQueries.js | src/lib/addCustomMediaQueries.js | import _ from 'lodash'
import postcss from 'postcss'
function buildMediaQuery(breakpoint) {
if (_.isString(breakpoint)) {
breakpoint = {min: breakpoint}
}
return _(breakpoint).map((value, feature) => {
feature = _.get(
{
min: 'min-width',
max: 'max-width',
},
... | import _ from 'lodash'
import postcss from 'postcss'
function buildMediaQuery(breakpoints) {
if (_.isString(breakpoints)) {
breakpoints = {min: breakpoints}
}
if (!_.isArray(breakpoints)) {
breakpoints = [breakpoints]
}
return _(breakpoints).map((breakpoint) => {
return _(breakpoint).map((value, ... | Add ability to define more complex breakpoints. | Add ability to define more complex breakpoints.
| JavaScript | mit | tailwindlabs/tailwindcss,tailwindlabs/tailwindcss,tailwindcss/tailwindcss,tailwindlabs/tailwindcss | ---
+++
@@ -1,21 +1,26 @@
import _ from 'lodash'
import postcss from 'postcss'
-function buildMediaQuery(breakpoint) {
- if (_.isString(breakpoint)) {
- breakpoint = {min: breakpoint}
+function buildMediaQuery(breakpoints) {
+ if (_.isString(breakpoints)) {
+ breakpoints = {min: breakpoints}
}
- retur... |
9ee00c1b2b9bb79e664d5f7ce0b9ce78478d7c1d | src/hooks/useDatePicker.js | src/hooks/useDatePicker.js | /* eslint-disable import/prefer-default-export */
import React from 'react';
/**
* Hook to simplify the use of the native date picker component by unwrapping
* the callback event and firing the callback only when the date is changing,
* providing a value to conditionally render the native picker and a callback
* t... | /* eslint-disable import/prefer-default-export */
import React from 'react';
/**
* Hook to simplify the use of the native date picker component by unwrapping
* the callback event and firing the callback only when the date is changing,
* providing a value to conditionally render the native picker and a callback
* t... | Add pass timestamp rather than date object | Add pass timestamp rather than date object
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | ---
+++
@@ -28,7 +28,8 @@
const { type, nativeEvent } = event;
if (type === 'set' && onChangeCallback) {
const { timestamp } = nativeEvent;
- onChangeCallback(new Date(timestamp));
+
+ onChangeCallback(timestamp);
}
},
[onChangeCallback] |
e186fce706c2b219bc3c5451ee8910baaf98400c | src/data/teams/selectors.js | src/data/teams/selectors.js | import { createSelector } from 'reselect';
import { denormalize } from 'normalizr';
import mapValues from 'lodash/mapValues';
import teamSchema from './schema';
const selectPlayers = state => state.data.players;
export const selectTeam = (state, props) => state.data.teams.byId[props.teamId];
export const selectTeams... | import { createSelector } from 'reselect';
import { denormalize } from 'normalizr';
import mapValues from 'lodash/mapValues';
import teamSchema from './schema';
const selectPlayers = state => state.data.players;
export const selectTeam = (state, props) => state.data.teams.byId[props.teamId];
export const selectTeams... | Reset response errors when a new tactic is created | Reset response errors when a new tactic is created
| JavaScript | mit | m-mik/tactic-editor,m-mik/tactic-editor | ---
+++
@@ -8,7 +8,11 @@
export const selectTeam = (state, props) => state.data.teams.byId[props.teamId];
export const selectTeams = state => state.data.teams;
-export const selectTeamPlayerItems = (state, props) => state.data.teams.byId[props.teamId].players;
+
+export const selectTeamPlayerItems = (state, props... |
f1ae689d7dcffb5187b61f78dbed65d54322cbfe | quickstart/node/autopilot/query-task/query_task.3.x.js | quickstart/node/autopilot/query-task/query_task.3.x.js | // Download the helper library from https://www.twilio.com/docs/python/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
// Replace 'UAXXX...' with yo... | // Download the helper library https://www.twilio.com/docs/libraries/node#install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
// Replace 'UAXXX...' with... | Update comment to point to node library install | Update comment to point to node library install | JavaScript | mit | TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets | ---
+++
@@ -1,4 +1,4 @@
-// Download the helper library from https://www.twilio.com/docs/python/install
+// Download the helper library https://www.twilio.com/docs/libraries/node#install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; |
cd03e20f518ade3d7875a32c040dd47cedbef360 | rikitrakiws.js | rikitrakiws.js | var log4js = require('log4js');
var logger = log4js.getLogger();
var express = require('express');
var favicon = require('serve-favicon');
var bodyParser = require('body-parser');
var port = process.env.OPENSHIFT_NODEJS_PORT || 3000;
var ipaddress = process.env.OPENSHIFT_NODEJS_IP;
var loglevel = process.env.LOGLEVEL |... | var log4js = require('log4js');
var logger = log4js.getLogger();
var express = require('express');
var favicon = require('serve-favicon');
var bodyParser = require('body-parser');
var port = process.env.OPENSHIFT_NODEJS_PORT || 3000;
var ipaddress = process.env.OPENSHIFT_NODEJS_IP;
var loglevel = process.env.LOGLEVEL |... | Drop header to avoid auth browser popup | Drop header to avoid auth browser popup
| JavaScript | mit | jimmyangel/rikitrakiws,jimmyangel/rikitrakiws | ---
+++
@@ -20,6 +20,11 @@
app.use('/api/', require('./routes/').router);
+app.use(function (req, res, next) {
+ res.removeHeader("WWW-Authenticate");
+ next();
+});
+
/* app.use(function(error, req, res, next) {
if (error) {
logger.error('InvalidInput', error.message); |
eb13bf4ff0d9b2f74e1de34418f0d7250fd537cc | rules/style.js | rules/style.js | module.exports = {
rules: {
// require trailing comma in multilines
'comma-dangle': [2, 'always-multiline'],
// require function expressions to have a name
'func-names': 0,
// require or disallow use of semicolons instead of ASI
'semi': [2, 'never'],
// require or disallow space before fun... | module.exports = {
rules: {
// disallow trailing commas in object literals
'comma-dangle': [2, 'never'],
// require function expressions to have a name
'func-names': 0,
// require or disallow use of semicolons instead of ASI
'semi': [2, 'never'],
// require or disallow space before functio... | Revert "[WV][000000] Allow trailing comma" | Revert "[WV][000000] Allow trailing comma"
| JavaScript | mit | rentpath/eslint-config-rentpath | ---
+++
@@ -1,7 +1,7 @@
module.exports = {
rules: {
- // require trailing comma in multilines
- 'comma-dangle': [2, 'always-multiline'],
+ // disallow trailing commas in object literals
+ 'comma-dangle': [2, 'never'],
// require function expressions to have a name
'func-names': 0,
// re... |
cc8f8d2f523a0c440bbd819610d860f86ba9d383 | src/modules/findBestIcon.js | src/modules/findBestIcon.js | function sortIconsBySize(icons) {
return icons.sort((a, b) => {
if (a.data.size < b.data.size) {
return 1;
} else {
return -1;
}
});
}
function findBestIcon(icons) {
return sortIconsBySize(icons)[0];
}
module.exports = findBestIcon;
| function sortIconsBySize(icons) {
return icons.sort((a, b) => {
if (a.size < b.size) {
return 1;
} else {
return -1;
}
});
}
function findBestIcon(icons) {
return sortIconsBySize(icons)[0];
}
module.exports = findBestIcon;
| Fix bug where icons are not sorted properly | Fix bug where icons are not sorted properly
| JavaScript | mit | jiahaog/page-icon | ---
+++
@@ -1,6 +1,6 @@
function sortIconsBySize(icons) {
return icons.sort((a, b) => {
- if (a.data.size < b.data.size) {
+ if (a.size < b.size) {
return 1;
} else {
return -1; |
f4f275c057152f37855e6eb23945d07509cb2af0 | res/loader.js | res/loader.js | browser.storage.local.get( [ 'bgcolor', 'textcolor', 'messages' ] ).then( function ( r ) {
var m = r.messages.split( '\n' );
m = m[ Math.floor( Math.random() * m.length ) ];
document.querySelector( 'h1' ).textContent = m;
document.body.style.backgroundColor = r.bgcolor;
document.body.style.color = r.textcolor;
... | browser.storage.local.get( [ 'bgcolor', 'textcolor', 'messages' ] ).then( function ( r ) {
var m = r.messages || 'Breathe';
m = m.split( '\n' );
m = m[ Math.floor( Math.random() * m.length ) ];
document.querySelector( 'h1' ).textContent = m;
document.body.style.backgroundColor = r.bgcolor || '#fff';
document.b... | Load sane settings if there are none | Load sane settings if there are none
| JavaScript | mit | prtksxna/breathe,prtksxna/breathe | ---
+++
@@ -1,9 +1,11 @@
browser.storage.local.get( [ 'bgcolor', 'textcolor', 'messages' ] ).then( function ( r ) {
- var m = r.messages.split( '\n' );
+ var m = r.messages || 'Breathe';
+
+ m = m.split( '\n' );
m = m[ Math.floor( Math.random() * m.length ) ];
document.querySelector( 'h1' ).textContent = m;
... |
6f3cd5a14d32b86bec9c0892a75d367e89420a05 | native/components/list-loading-indicator.react.js | native/components/list-loading-indicator.react.js | // @flow
import { connect } from 'lib/utils/redux-utils';
import * as React from 'react';
import { ActivityIndicator } from 'react-native';
import type { AppState } from '../redux/redux-setup';
import type { Colors } from '../themes/colors';
import { colorsSelector, styleSelector } from '../themes/colors';
type Prop... | // @flow
import * as React from 'react';
import { ActivityIndicator } from 'react-native';
import { useStyles, useColors } from '../themes/colors';
function ListLoadingIndicator() {
const styles = useStyles(unboundStyles);
const colors = useColors();
const { listBackgroundLabel } = colors;
return (
<Acti... | Use hook instead of connect functions and HOC in ListLoadingIndicator | [native] Use hook instead of connect functions and HOC in ListLoadingIndicator
Test Plan: Flow
Reviewers: ashoat, palys-swm
Reviewed By: ashoat
Subscribers: zrebcu411, Adrian
Differential Revision: https://phabricator.ashoat.com/D483
| JavaScript | bsd-3-clause | Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal,Ashoat/squadcal | ---
+++
@@ -1,39 +1,29 @@
// @flow
-import { connect } from 'lib/utils/redux-utils';
import * as React from 'react';
import { ActivityIndicator } from 'react-native';
-import type { AppState } from '../redux/redux-setup';
-import type { Colors } from '../themes/colors';
-import { colorsSelector, styleSelector ... |
b9fa1633356d88a60e39b7e29f612d6f0a2901b0 | js/population.js | js/population.js | function Population(size) {
var agents = new Array(size);
var genomes = new Array(size);
for (i = 0; i < size; i++) {
var prob = Math.random();
if (prob <= 0.33) {
genomes[i] = new Genome(1,0,0);
}
elseif (prob > 0.33 && prob <= 0.67) {
genomes[i] = new Genome(0,1,0);
}
else genomes[i] = new Genome... | function Population(size) {
var agents = new Array(size);
var genomes = new Array(size);
for (i = 0; i < size; i++) {
var prob = Math.random();
if (prob < 0.33) {
genomes[i] = new Genome(1,0,0);
}
else if (prob >= 0.33 && prob < 0.67) {
genomes[i] = new Genome(0,1,0);
}
else genomes[i] = new Genome... | Edit parent selection, update gamemanager to Senna's version | Edit parent selection, update gamemanager to Senna's version
| JavaScript | mit | Moorkopsoesje/natural-computing,Moorkopsoesje/natural-computing,Moorkopsoesje/natural-computing | ---
+++
@@ -3,10 +3,10 @@
var genomes = new Array(size);
for (i = 0; i < size; i++) {
var prob = Math.random();
- if (prob <= 0.33) {
+ if (prob < 0.33) {
genomes[i] = new Genome(1,0,0);
}
- elseif (prob > 0.33 && prob <= 0.67) {
+ else if (prob >= 0.33 && prob < 0.67) {
genomes[i] = new Genome(... |
3989a97b750c34da3963f8edb0154167fe99f2bc | addon/components/jqui-datepicker/component.js | addon/components/jqui-datepicker/component.js | import Ember from 'ember';
import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget';
export default Ember.TextField.extend(jquiWidget, {
uiType: 'datepicker',
uiOptions: ["altField", "altFormat", "appendText", "autoSize",
"beforeShow", "beforeShowDay", "buttonImage", "buttonImageOnly",
"buttonText",... | import Ember from 'ember';
import jquiWidget from 'ember-cli-jquery-ui/mixins/jqui-widget';
export default Ember.TextField.extend(jquiWidget, {
uiType: 'datepicker',
uiOptions: ["altField", "altFormat", "appendText", "autoSize",
"beforeShow", "beforeShowDay", "buttonImage", "buttonImageOnly",
"buttonText",... | Remove useless events that don't exist | Remove useless events that don't exist
| JavaScript | mit | Gaurav0/ember-cli-jquery-ui,Gaurav0/ember-cli-jquery-ui | ---
+++
@@ -14,6 +14,5 @@
"selectOtherMonths", "shortYearCutoff", "showAnim", "showButtonPanel",
"showCurrentAtPos", "showMonthAfterYear", "showOn", "showOptions",
"showOtherMonths", "showWeek", "stepMonths", "weekHeader", "yearRange",
- "yearSuffix"],
- uiEvents: ['onChangeMonthYear', 'onClose', '... |
ff6e324be00554374a57e068519e40d62b9664dd | lib/router.js | lib/router.js | Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
waitOn: function() {
return Meteor.subscribe('notifications');
}
});
Router.route('/posts/:_id', {
name: 'postPage',
waitOn: function() {
return Meteor.subscribe('comments', this.params._id);
... | Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
waitOn: function() {
return Meteor.subscribe('notifications');
}
});
Router.route('/posts/:_id', {
name: 'postPage',
waitOn: function() {
return Meteor.subscribe('comments', this.params._id);
... | Add dataContext to postsLimit route | Add dataContext to postsLimit route
| JavaScript | mit | Bennyz/microscope,Bennyz/microscope | ---
+++
@@ -33,6 +33,13 @@
waitOn: function() {
var limit = parseInt(this.params.postsLimit) || 5;
return Meteor.subscribe('posts', { sort: { submitted: -1 }, limit: limit });
+ },
+ data: function() {
+ var limit = parseInt(this.params.postsLimit) || 5;
+
+ return {
+ posts: Posts.find... |
126873a8d5c90810789387c8e8ec90fe4ad1f3d8 | lib/router.js | lib/router.js | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return [subscriptions.subscribe('lastGames'), subscriptions.subscribe('allUsers')];
},
fastRender: true
});
... | var subscriptions = new SubsManager();
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound'
});
Router.route('/', {
name: 'home',
waitOn: function() {
return [subscriptions.subscribe('lastGames'), subscriptions.subscribe('allUsers')];
},
fastRender: true
});
... | Add data for ranking route | Add data for ranking route
| JavaScript | mit | dexterneo/ping_pong_wars,dexterneo/ping_pong_wars | ---
+++
@@ -16,9 +16,18 @@
Router.route('/ranking', {
name: 'rankingWrapper',
- /*waitOn: function() {
- return subscriptions.subscribe('');
- },*/
+ waitOn: function() {
+ return subscriptions.subscribe('allUsers');
+ },
+ data: function() {
+ return Meteor.users.find({}, {
+ fields: {
+ 'profile.firstN... |
f905f4080d45f0db635b178b2931daf93b51706e | test/server/webhookSpec.js | test/server/webhookSpec.js | /*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const chai = require('chai')
const expect = chai.expect
describe('webhook', () => {
const webhook = require('../../lib/webhook')
const challenge = {
key: 'key',
name: 'name'
}
describe('notify', () => {
it('fails... | /*
* Copyright (c) 2014-2020 Bjoern Kimminich.
* SPDX-License-Identifier: MIT
*/
const chai = require('chai')
const expect = chai.expect
describe('webhook', () => {
const webhook = require('../../lib/webhook')
const challenge = {
key: 'key',
name: 'name'
}
describe('notify', () => {
it('fails... | Update to new (unburned) webhook.site URL | Update to new (unburned) webhook.site URL
| JavaScript | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop | ---
+++
@@ -24,7 +24,7 @@
})
it('submits POST with payload to existing URL', () => {
- expect(() => webhook.notify(challenge, 'https://webhook.site/46beb3e9-df8f-495b-98b9-abf0d4ae38a0')).to.not.throw()
+ expect(() => webhook.notify(challenge, 'https://webhook.site/#!/e3b07c99-fd53-4799-aa18-984... |
e7ae935573dfc193d2e7548b8eac6abec475a849 | test/spec/leafbird.spec.js | test/spec/leafbird.spec.js | /*
Copyright 2015 Leafbird
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | /*
Copyright 2015 Leafbird
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | Verify if leafbird global variable has a Leafbird object instance. | Verify if leafbird global variable has a Leafbird object instance.
| JavaScript | apache-2.0 | bscherer/leafbird,leafbirdjs/leafbird,leafbirdjs/leafbird,lucasb/leafbird,bscherer/leafbird,lucasb/leafbird | ---
+++
@@ -21,7 +21,14 @@
expect(leafbrd.config).toEqual(undefined);
});
- it('verify if a leafbird global object has defined', function(){
+ it('verify if a leafbird global object has defined', function() {
expect(leafbird).toBeDefined();
});
+
+ it('verify if leafbird global variable has a Lea... |
8458ca15bf929710cdfc5f0667690a22fe1ce40b | test/specs/effects.spec.js | test/specs/effects.spec.js | import * as effects from 'src/effects'
/**
* @jest-environment jsdom
*/
jest.useFakeTimers()
describe('Effects', () => {
let element
beforeEach(() => {
element = document.createElement('div')
document.body.appendChild(element)
})
afterEach(() => {
document.body.innerHTML = ''
})
test('Fade in... | import * as effects from 'src/effects'
/**
* @jest-environment jsdom
*/
jest.useFakeTimers()
describe('Effects', () => {
let element
beforeEach(() => {
element = document.createElement('div')
document.body.appendChild(element)
})
afterEach(() => {
document.body.innerHTML = ''
})
test('Fade in... | Fix fade test with RAF | test(Effects): Fix fade test with RAF
Because of wrong mock implementation
| JavaScript | mit | lucaperret/gaspard | ---
+++
@@ -21,14 +21,14 @@
expect(Number(element.style.opacity)).toBeGreaterThanOrEqual(1)
})
test('RAF fade in', () => {
- window.requestAnimationFrame = jest.fn(fn => setTimeout(fn, 1))
+ global.requestAnimationFrame = jest.fn()
effects.fadeIn(element, 1)
jest.runAllTimers()
- expect(... |
5e0df55f9306d7e6eecd71881c59788a35925aec | parse-comments/lib/utils.js | parse-comments/lib/utils.js | /*!
* parse-comments <https://github.com/jonschlinkert/parse-comments>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
var utils = module.exports = {};
utils.trimRight = function(str) {
return str.replace(/\s+$/, '');
};
utils.stripStars = function (line) {
v... | let utils = module.exports = {};
utils.trimRight = function(str) {
return str.replace(/\s+$/, '');
};
utils.stripStars = function (line) {
let re = /^(?:\s*[\*]{1,2}\s)/;
return utils.trimRight(line.replace(re, ''));
};
| Clean up parse-comments utilis file | Clean up parse-comments utilis file
| JavaScript | apache-2.0 | weepower/wee-core | ---
+++
@@ -1,19 +1,10 @@
-/*!
- * parse-comments <https://github.com/jonschlinkert/parse-comments>
- *
- * Copyright (c) 2014-2015, Jon Schlinkert.
- * Licensed under the MIT License.
- */
-
-'use strict';
-
-var utils = module.exports = {};
+let utils = module.exports = {};
utils.trimRight = function(str) {
r... |
bd2ee45b9fad33587764f03dbeb6f39c86299ea6 | js/main.js | js/main.js | var questions = [
Q1 = {
question: "What do HTML means?",
answer: "HyperText Markup Language"
},
Q2 = {
question: "What do CSS means?",
answer: "Cascading Style Sheet"
}
];
var question = document.getElementById('question');
var questionNum = 0;
function createNum() {
questionNum = Math.flo... | var questions = [
Q1 = {
question: "What does HTML means?",
answer: "HyperText Markup Language"
},
Q2 = {
question: "What does CSS means?",
answer: "Cascading Style Sheet"
},
Q3 = {
question: "Why the \"C\" in CSS, is called Cascading?",
answer: "When CSS rules are duplicated, the rule... | Modify and add another question | Modify and add another question
| JavaScript | mit | vinescarlan/FlashCards,vinescarlan/FlashCards | ---
+++
@@ -1,11 +1,15 @@
var questions = [
Q1 = {
- question: "What do HTML means?",
+ question: "What does HTML means?",
answer: "HyperText Markup Language"
},
Q2 = {
- question: "What do CSS means?",
+ question: "What does CSS means?",
answer: "Cascading Style Sheet"
+ },
+ Q3 = {... |
265769d571df9e80462bb339c0476d8b1f4e3516 | initialize.js | initialize.js | var i = (function() {
'use strict';
return {
c: function(obj, args) {
if (arguments.length > 0) {
var newObj = Object.create(arguments[0]);
if ('init' in newObj) {
if (arguments.length > 1) {
var args = [];
for (var i = 1; i < arguments.length; i++) {
... | var i = (function() {
'use strict';
return {
c: function(obj, args) {
if (arguments.length > 0) {
var newObj = Object.create(arguments[0]);
if ('init' in newObj && typeof newObj.init === 'function') {
if (arguments.length > 1) {
var args = [];
for (var i =... | Check that init is a function | Check that init is a function
| JavaScript | mit | delta-nry/Initialize.js,delta-nry/Initialize.js | ---
+++
@@ -4,7 +4,7 @@
c: function(obj, args) {
if (arguments.length > 0) {
var newObj = Object.create(arguments[0]);
- if ('init' in newObj) {
+ if ('init' in newObj && typeof newObj.init === 'function') {
if (arguments.length > 1) {
var args = [];
... |
a8bc763ab377f872355bef930bf5ad1735c25e19 | app/models/UserDevice.js | app/models/UserDevice.js |
module.exports = function(sequelize, DataTypes) {
var UserDevice = sequelize.define('UserDevice', {
type: {
type: DataTypes.ENUM('IOS', 'ANDROID'),
defaultValue: 'IOS'
},
token: {
type: DataTypes.STRING,
allowNull: false
}
},
{
classMethods: {
addDevice: function(deviceInfo) {... |
module.exports = function(sequelize, DataTypes) {
var UserDevice = sequelize.define('UserDevice', {
type: {
type: DataTypes.ENUM('IOS', 'ANDROID'),
defaultValue: 'IOS'
},
token: {
type: DataTypes.STRING,
allowNull: false
}
},
{
classMethods: {
addDevice: function(deviceInfo) {... | Remove duplicated device token for multiple users | Remove duplicated device token for multiple users
| JavaScript | mit | barak-shirali/PDS,barak-shirali/PDS,barak-shirali/PDS,barak-shirali/PDS | ---
+++
@@ -15,14 +15,16 @@
{
classMethods: {
addDevice: function(deviceInfo) {
- UserDevice.find({where: deviceInfo})
+ var search = {
+ type: deviceInfo.type,
+ token: deviceInfo.token,
+ };
+ UserDevice.find({where: search})
.success(function(device) {
i... |
dffde72e5e73cd23d2531198a0f61435ca30efb0 | lib/ArgVerifier.js | lib/ArgVerifier.js | var ArgumentError = require('./ArgumentError');
var topiarist = require('topiarist');
function verifierMethod(verifier, methodName) {
return function() {
if(!this.skipVerification) {
if(this.argValue === undefined) throw new ArgumentError(this.argName + ' argument must be provided.');
verifier[metho... | var ArgumentError = require('./ArgumentError');
var topiarist = require('topiarist');
function verifierMethod(verifierMethod) {
return function(arg) {
if(!this.skipVerification) {
if(this.argValue === undefined) throw new ArgumentError(this.argName + ' argument must be provided.');
verifierMethod.ca... | Use call() rather than apply() to improve performance. | Use call() rather than apply() to improve performance.
| JavaScript | apache-2.0 | dchambers/typester | ---
+++
@@ -1,12 +1,12 @@
var ArgumentError = require('./ArgumentError');
var topiarist = require('topiarist');
-function verifierMethod(verifier, methodName) {
- return function() {
+function verifierMethod(verifierMethod) {
+ return function(arg) {
if(!this.skipVerification) {
if(this.argValue ===... |
c532fbe1246fcf2032b09a417b27a932f0bce774 | server/services/ads.spec.js | server/services/ads.spec.js | /* global describe, beforeEach, afterEach, it */
const knex_config = require('../../knexfile');
const knex = require('knex')(knex_config['test']);
const chai = require('chai');
const should = chai.should();
describe('Handle ads', function() {
beforeEach(function(done) {
knex.migrate.rollback()
.then(func... | /* global describe, beforeEach, afterEach, it */
const chai = require('chai');
const should = chai.should();
const knex_config = require('../../knexfile');
const knex = require('knex')(knex_config['test']);
const util = require('../util')({ knex });
const service = require('./ads')({ knex, util });
describe('Handle... | Test that ads appear in date order latest first | Test that ads appear in date order latest first
| JavaScript | agpl-3.0 | Tradenomiliitto/tradenomiitti,Tradenomiliitto/tradenomiitti,Tradenomiliitto/tradenomiitti | ---
+++
@@ -1,9 +1,13 @@
/* global describe, beforeEach, afterEach, it */
+
+const chai = require('chai');
+const should = chai.should();
+
const knex_config = require('../../knexfile');
const knex = require('knex')(knex_config['test']);
-const chai = require('chai');
-const should = chai.should();
+const util =... |
9e246962370dcd7f96732b56eaa2c09d1c757626 | util/transitionToParams.js | util/transitionToParams.js | import queryString from 'query-string';
function transitionToParams(params) {
const location = this.props.location;
let query = location.query;
if (query === undefined)
query = queryString.parse(location.search);
const allParams = Object.assign({}, query, params);
const keys = Object.keys(allParams);
... | import queryString from 'query-string';
function transitionToParams(params) {
const location = this.props.location;
let query = location.query;
if (query === undefined)
query = queryString.parse(location.search);
const allParams = Object.assign({}, query, params);
const keys = Object.keys(allParams);
... | Use queryString.stringify instead of by-hand gluing | Use queryString.stringify instead of by-hand gluing
Fixes STCOM-112
| JavaScript | apache-2.0 | folio-org/stripes-components,folio-org/stripes-components | ---
+++
@@ -11,7 +11,7 @@
let url = location.pathname;
if (keys.length) {
- url += `?${keys.map(key => `${key}=${encodeURIComponent(allParams[key])}`).join('&')}`;
+ url += `?${queryString.stringify(allParams)}`;
}
this.props.history.push(url); |
4c3c91c9b38ab6bde4a748c33e177f1f53036d6c | js/scripts.js | js/scripts.js | var pingPong = function(userNumber) {
if ((userNumber % 3 === 0) || (userNumber % 5 === 0)) {
return true;
} else {
return false;
}
}
| var pingPong = function(userNumber) {
if ((userNumber % 3 === 0) || (userNumber % 5 === 0)) {
return true;
} else {
return false;
}
};
| Remove superfluous and redundant code | Remove superfluous and redundant code
| JavaScript | mit | kcmdouglas/pingpong,kcmdouglas/pingpong | ---
+++
@@ -4,4 +4,4 @@
} else {
return false;
}
-}
+}; |
09605e33cb1693d1a1cc88ee38b08d275bc9119c | views/components/addApp.js | views/components/addApp.js | import { h, Component } from 'preact'
import { bind } from './util'
export default class extends Component {
constructor() {
super()
this.state.show = false
}
linkState(key) {
return e => this.setState({
[key]: e.target.value
})
}
@bind
toggleShow() {
this.setState({
show: !... | import { h, Component } from 'preact'
import { bind } from './util'
export default class extends Component {
constructor() {
super()
this.state.show = false
}
linkState(key) {
return e => this.setState({
[key]: e.target.value
})
}
@bind
toggleShow() {
this.setState({
show: !... | Use destructuring to remove noise | Use destructuring to remove noise
| JavaScript | mit | zeusdeux/password-manager,zeusdeux/password-manager | ---
+++
@@ -27,9 +27,10 @@
}
@bind
handleSubmit(e) {
+ const { appName, username, password } = this.state
+
e.preventDefault()
-
- this.props.add(this.state.appName, this.state.username, this.state.password)
+ this.props.add(appName, username, password)
this.clearState()
}
render(_, ... |
1dc06e37aa07f60780d1f3e74d2f58fa896d913e | src/Loading.js | src/Loading.js | import React, { Component } from 'react';
import './Loading.css';
class Loading extends Component {
render() {
return <p>Loading timetable data.</p>;
}
}
export default Loading;
| import React, { Component } from 'react';
import './Loading.css';
class Loading extends Component {
render() {
return (
<div className='loading'>
<h1>Loading</h1>
<h2>{this.props.name}</h2>
<p>{this.props.message}</p>
</div>
);
}
}
Loading.defaultProps = {
name: 'Loading name',
message: 'Loa... | Add error style message and name. | Add error style message and name.
| JavaScript | mit | kangasta/timetablescreen,kangasta/timetablescreen | ---
+++
@@ -3,8 +3,24 @@
class Loading extends Component {
render() {
- return <p>Loading timetable data.</p>;
+ return (
+ <div className='loading'>
+ <h1>Loading</h1>
+ <h2>{this.props.name}</h2>
+ <p>{this.props.message}</p>
+ </div>
+ );
}
}
+Loading.defaultProps = {
+ name: 'Loading nam... |
90ad2381efbe614ebec6516ffaa7a2df628ac259 | src/Weather.js | src/Weather.js | import React from 'react';
import Temperature from './Temperature.js';
class Weather extends React.Component {
render = () => {
// FIXME: After rendering, send stats to Google Analytics
// FIXME: Add the actual temperatures
return (
<Temperature degreesCelsius={25} hour={12}><... | import React from 'react';
import Temperature from './Temperature.js';
class Weather extends React.Component {
renderTemperatures = (renderUs) => {
// FIXME: Add the actual temperatures
console.log(renderUs);
return (
<Temperature degreesCelsius={25} hour={1} />
);
... | Add logic for choosing which forecasts to show | Add logic for choosing which forecasts to show
| JavaScript | mit | walles/weatherclock,walles/weatherclock,walles/weatherclock,walles/weatherclock | ---
+++
@@ -3,12 +3,50 @@
import Temperature from './Temperature.js';
class Weather extends React.Component {
+ renderTemperatures = (renderUs) => {
+ // FIXME: Add the actual temperatures
+
+ console.log(renderUs);
+
+ return (
+ <Temperature degreesCelsius={25} hour={1} />
+ ... |
3cb2c725d0571d44d43c1265966e0de8df47b725 | lib/common.js | lib/common.js | /**
* Find indices of all occurance of elem in arr. Uses 'indexOf'.
* @param {array} arr - Array-like element (works with strings too!).
* @param {array_element} elem - Element to search for in arr.
* @return {array} indices - Array of indices where elem occurs in arr.
*/
var findAllIndices = function(arr, elem) {... | /**
* Find indices of all occurance of elem in arr. Uses 'indexOf'.
* @param {array} arr - Array-like element (works with strings too!).
* @param {array_element} elem - Element to search for in arr.
* @return {array} indices - Array of indices where elem occurs in arr.
*/
var findAllIndices = function(arr, elem) {... | Add new fxn to null out chars in str range | Add new fxn to null out chars in str range
| JavaScript | mit | nhatbui/libhrc,nhatbui/libhrc | ---
+++
@@ -30,5 +30,10 @@
return indices;
};
+var nullOutChars = function(str, start, end, nullChar) {
+ return str.slice(0, start) + nullChar.repeat(end - start) + str.slice(end);
+}
+
module.exports.findAllIndices = findAllIndices;
module.exports.findAllIndicesRegex = findAllIndicesRegex;
+module.exports.... |
5fd4d39b04efac1d58fc2106f8184a1bc43a220b | lib/common.js | lib/common.js | 'use strict';
var extendPrototypeWithThese = function (prototype, extendThese) {
/*
Helper method to implement a simple inheritance model for object prototypes.
*/
var outp = prototype;
if (extendThese) {
for (var i = extendThese.length - 1; i >= 0; i--) {
// ... | 'use strict';
var extendPrototypeWithThese = function (prototype, extendThese) {
/*
Helper method to implement a simple inheritance model for object prototypes.
*/
var outp = prototype;
if (extendThese) {
for (var i = extendThese.length - 1; i >= 0; i--) {
// ... | Copy prototype memebers on extend | Copy prototype memebers on extend
| JavaScript | mit | jhsware/component-registry,jhsware/SimpleJSRegistry | ---
+++
@@ -11,7 +11,7 @@
for (var i = extendThese.length - 1; i >= 0; i--) {
// I need to create the object in order to copy the prototype functions
- var tmpObj = new extendThese[i]();
+ var tmpObj = extendThese[i].prototype;
for (var key in tmpObj) {
... |
09fddd7a0bf9a3c53e46f371f04701ef56a42811 | test/algorithms/sorting/testInsertionSort.js | test/algorithms/sorting/testInsertionSort.js | /* eslint-env mocha */
const InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;
const assert = require('assert');
describe('Insertion Sort', () => {
it('should have no data when empty initialization', () => {
const inst = new InsertionSort();
assert.equal(inst.size, 0);
assert.deep... | /* eslint-env mocha */
const InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;
const assert = require('assert');
describe('Insertion Sort', () => {
it('should have no data when empty initialization', () => {
const inst = new InsertionSort();
assert.equal(inst.size, 0);
assert.deep... | Test Insertion Sort: Test for sorting the array | Test Insertion Sort: Test for sorting the array
| JavaScript | mit | ManrajGrover/algorithms-js | ---
+++
@@ -9,4 +9,14 @@
assert.deepEqual(inst.unsortedList, []);
assert.deepEqual(inst.sortedList, []);
});
+
+ it('should sort the array', () => {
+ const inst = new InsertionSort([2, 1, 3, 4]);
+ assert.equal(inst.size, 4);
+
+ assert.deepEqual(inst.unsortedList, [2, 1, 3, 4]);
+ assert.d... |
28838615005e5da47a15e78596f9e0f2513b9df7 | addon/mixins/lazy-route.js | addon/mixins/lazy-route.js | /**
* ES6 not supported here
*/
import Ember from "ember";
import config from 'ember-get-config';
export default Ember.Mixin.create({
bundleLoader: Ember.inject.service("bundle-loader"),
findBundleNameByRoute: function(routeName){
//Find bundle for route
var foundBundleName = Object.keys(c... | /**
* ES6 not supported here
*/
import Ember from "ember";
import config from 'ember-get-config';
export default Ember.Mixin.create({
bundleLoader: Ember.inject.service("bundle-loader"),
findBundleNameByRoute: function(routeName){
//Find bundle for route
var bundleName = null;
var bu... | Fix tests by switching to es5 syntax in finding bundles | Fix tests by switching to es5 syntax in finding bundles
| JavaScript | mit | duizendnegen/ember-cli-lazy-load,duizendnegen/ember-cli-lazy-load | ---
+++
@@ -5,17 +5,20 @@
import config from 'ember-get-config';
export default Ember.Mixin.create({
-
bundleLoader: Ember.inject.service("bundle-loader"),
findBundleNameByRoute: function(routeName){
//Find bundle for route
- var foundBundleName = Object.keys(config.bundles)
- ... |
be9b946dfe51b075c002c1d2e2abb7cb0fad7559 | src/zoomingExits/zoomOutUp.js | src/zoomingExits/zoomOutUp.js | /*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */
; (function (animate) {
'use strict';
animate.zoomOutUp = function (selector, options) {
var keyframeset = [
{
opacity: 1,
transform: 'none',
transformOrigin: 'left center',
... | /*! Animate.js | The MIT License (MIT) | Copyright (c) 2017 GibboK */
; (function (animate) {
'use strict';
animate.zoomOutUp = function (selector, options) {
var keyframeset = [
{
opacity: 1,
transform: 'none',
transformOrigin: 'center bottom'... | Add fix bug in animation | Add fix bug in animation
| JavaScript | mit | gibbok/animate.js,gibbok/animate.js,gibbok/animatelo,gibbok/animatelo | ---
+++
@@ -6,7 +6,7 @@
{
opacity: 1,
transform: 'none',
- transformOrigin: 'left center',
+ transformOrigin: 'center bottom',
offset: 0
},
{ |
007c630953c76a27b74b46b48b20dcb8b3d79cae | js/respec-w3c-extensions.js | js/respec-w3c-extensions.js | // extend the bibliographic entries
var localBibliography = {
"HYDRA-CORE": {
authors: [ "Markus Lanthaler" ],
href: "http://www.hydra-cg.com/spec/latest/core/",
title: "Hydra Core Vocabulary",
status: "unofficial",
publisher: "W3C"
},
"PAV": "Paolo Ciccarese, Stian Soiland-Reyes, Khalid Bel... | // extend the bibliographic entries
var localBibliography = {
"HYDRA-CORE": {
authors: [ "Markus Lanthaler" ],
href: "http://www.hydra-cg.com/spec/latest/core/",
title: "Hydra Core Vocabulary",
status: "Unofficial Draft",
publisher: "W3C"
},
"PAV": {
authors: [
"Paolo Ciccarese",
... | Set up localBiblio according to ReSpec's documentation: | Set up localBiblio according to ReSpec's documentation:
http://www.w3.org/respec/ref.html#localbiblio
| JavaScript | mit | pentandra/spec,pentandra/spec | ---
+++
@@ -4,8 +4,21 @@
authors: [ "Markus Lanthaler" ],
href: "http://www.hydra-cg.com/spec/latest/core/",
title: "Hydra Core Vocabulary",
- status: "unofficial",
+ status: "Unofficial Draft",
publisher: "W3C"
},
- "PAV": "Paolo Ciccarese, Stian Soiland-Reyes, Khalid Belhajjame, Alas... |
f617ae5418d6c1223887a6685cd9714526fc95d2 | src/components/LoginForm.js | src/components/LoginForm.js | import React, {Component} from 'react';
import {Button, Card, CardSection, Input} from './common';
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {email: "", password: ''};
}
render() {
return <Card>
<CardSection>
<Input label="Email"
... | import React, {Component} from 'react';
import {Button, Card, CardSection, Input} from './common';
import firebase from 'firebase';
import {Text} from 'react-native';
class LoginForm extends Component {
constructor(props) {
super(props);
this.state = {email: '', password: '', error: ''};
}
async onBut... | Use firebase to authenticate users | Use firebase to authenticate users
| JavaScript | apache-2.0 | ChenLi0830/RN-Auth,ChenLi0830/RN-Auth,ChenLi0830/RN-Auth | ---
+++
@@ -1,10 +1,29 @@
import React, {Component} from 'react';
import {Button, Card, CardSection, Input} from './common';
+import firebase from 'firebase';
+import {Text} from 'react-native';
class LoginForm extends Component {
constructor(props) {
super(props);
- this.state = {email: "", password:... |
a9bcc1388143c86f8ac6d5afcfe0b8cb376b8de7 | src/main/webapp/resources/dev/js/singleUser.js | src/main/webapp/resources/dev/js/singleUser.js | /**
* Author: Josh Adam <josh.adam@phac-aspc.gc.ca>
* Date: 2013-04-17
* Time: 9:41 AM
*/
var username = $('#username').text();
function Project (data) {
"use strict";
this.name = data.name;
}
function UserViewModel () {
"use strict";
self.projects = ko.observableArray([]);
function getUserProjec... | /**
* Author: Josh Adam <josh.adam@phac-aspc.gc.ca>
* Date: 2013-04-17
* Time: 9:41 AM
*/
var username = $('#username').text();
function Project (data) {
"use strict";
this.name = data.name;
}
function UserViewModel () {
"use strict";
self.projects = ko.observableArray([]);
function getUserProjec... | Change the expected JSON format for user projects. | Change the expected JSON format for user projects.
| JavaScript | apache-2.0 | phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida,phac-nml/irida | ---
+++
@@ -19,7 +19,7 @@
"use strict";
$.getJSON('/users/' + username + '/projects', function (allData) {
- var mappedProjects = $.map(allData.projectList, function (item) {
+ var mappedProjects = $.map(allData.projectResources.projects, function (item) {
return new Project(item)
... |
c68b6772d435d76bfe290e40e0ae0539c1ba5d76 | src/js/model/Contacts.js | src/js/model/Contacts.js | var ContactView = require('../view/Contact');
/**
* Creates a new Contact
* @constructor
* @arg {Object} options - Object hash used to populate instance
* @arg {string} options.firstName - First name of the contact
* @arg {string} options.firstName - Last name of the contact
* @arg {string} options.tel - name o... | var ContactView = require('../view/Contact');
/**
* Creates a new Contact.
* @constructor
* @arg {Object} options - Object hash used to populate instance.
* @arg {string} options.firstName - First name of the contact.
* @arg {string} options.firstName - Last name of the contact.
* @arg {string} options.tel - Tel... | Use periods on senteces in docs | Use periods on senteces in docs
| JavaScript | isc | bitfyre/contacts | ---
+++
@@ -1,12 +1,12 @@
var ContactView = require('../view/Contact');
/**
- * Creates a new Contact
+ * Creates a new Contact.
* @constructor
- * @arg {Object} options - Object hash used to populate instance
- * @arg {string} options.firstName - First name of the contact
- * @arg {string} options.firstName - ... |
061563eb253e72812e45aa454455288d194f3cc5 | app/scripts/components/player-reaction.js | app/scripts/components/player-reaction.js | import m from 'mithril';
import classNames from '../classnames.js';
class PlayerReactionComponent {
oninit({ attrs: { session, player } }) {
this.player = player;
session.on('send-reaction', ({ reactingPlayer, reaction }) => {
if (reactingPlayer.color === this.player.color) {
// Immediately up... | import m from 'mithril';
import classNames from '../classnames.js';
class PlayerReactionComponent {
oninit({ attrs: { session, player } }) {
this.player = player;
session.on('send-reaction', ({ reactingPlayer, reaction }) => {
if (reactingPlayer.color === this.player.color) {
// Immediately up... | Fix race condition when setTimeout callback is run | Fix race condition when setTimeout callback is run
The player object may change by the time the callback is run, and
therefore this.player.reactions may not exist at that point.
| JavaScript | mit | caleb531/connect-four | ---
+++
@@ -13,7 +13,9 @@
this.player.reaction = reaction;
// The reaction should disappear after the specified duration
this.player.reaction.timer = setTimeout(() => {
- this.player.reaction.timer = null;
+ if (this.player.reaction) {
+ this.player.reaction.tim... |
547cb0360680e20025e086895f1926ea93c3a205 | lib/generators/loaders/ESNextReactLoader.js | lib/generators/loaders/ESNextReactLoader.js | module.exports = {
test: /\.es6\.js$|\.js$|\.jsx$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: [
'es2015-native-modules',
'stage-2',
'react',
],
plugins: [
'transform-class-properties',
'transform-react-constant-elements',
'transform-react-inline-... | module.exports = {
test: /\.es6\.js$|\.js$|\.jsx$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: [
'es2015-native-modules',
'stage-2',
'react',
].map(function(p) { return require.resolve('babel-preset-' + p) }),
plugins: [
'transform-class-properties',
't... | Revert "Revert "Fix module resolution for npm-link'd packages"" | Revert "Revert "Fix module resolution for npm-link'd packages""
This reverts commit 8dc3d9b82be05fe3077e2cc82963a229858930b5.
| JavaScript | mit | reddit/node-build | ---
+++
@@ -7,12 +7,12 @@
'es2015-native-modules',
'stage-2',
'react',
- ],
+ ].map(function(p) { return require.resolve('babel-preset-' + p) }),
plugins: [
'transform-class-properties',
'transform-react-constant-elements',
'transform-react-inline-elements',
... |
2bf558768d4fc3bf4d1505c5a948c9962ca89b9e | lib/bumper.js | lib/bumper.js | function Bumper(coords, context, color) {
this.minX = coords.minX;
this.maxX = coords.maxX;
this.minY = coords.minY;
this.maxY = coords.maxY;
this.context = context;
this.type = coords.type;
this.color = coords.color || "white"
};
Bumper.prototype.draw = function() {
if (this.type == "bumper") {
th... | function Bumper(coords, context, color) {
this.minX = coords.minX;
this.maxX = coords.maxX;
this.minY = coords.minY;
this.maxY = coords.maxY;
this.context = context;
this.type = coords.type;
this.color = coords.color || "white"
};
Bumper.prototype.draw = function() {
if (this.type == "bumper") {
th... | Change relative path for sand image | Change relative path for sand image
| JavaScript | mit | brennanholtzclaw/game_time,brennanholtzclaw/game_time | ---
+++
@@ -14,7 +14,7 @@
}
else {
var image = new Image();
- image.src = "../images/sand2.png"
+ image.src = "./images/sand2.png"
var pattern = this.context.createPattern(image, "repeat")
this.context.fillStyle = pattern;
} |
816f68b9722ebdeaaf2fc9df1915e6d647b8ba79 | test/e2e/dataExportSpec.js | test/e2e/dataExportSpec.js | const config = require('config')
describe('/#/privacy-security/data-export', () => {
describe('challenge "dataExportChallenge"', () => {
beforeEach(() => {
browser.get('/#/register')
element(by.id('emailControl')).sendKeys('admun@' + config.get('application.domain'))
element(by.id('passwordCont... | const config = require('config')
describe('/#/privacy-security/data-export', () => {
xdescribe('challenge "dataExportChallenge"', () => {
beforeEach(() => {
browser.get('/#/register')
element(by.id('emailControl')).sendKeys('admun@' + config.get('application.domain'))
element(by.id('passwordCon... | Disable flaky dataExport e2e test | Disable flaky dataExport e2e test
| JavaScript | mit | bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop,bkimminich/juice-shop | ---
+++
@@ -1,7 +1,7 @@
const config = require('config')
describe('/#/privacy-security/data-export', () => {
- describe('challenge "dataExportChallenge"', () => {
+ xdescribe('challenge "dataExportChallenge"', () => {
beforeEach(() => {
browser.get('/#/register')
element(by.id('emailControl')... |
17b597513cb8c7aab777cd1ea5fe7228cd15c166 | pogo-protos.js | pogo-protos.js | const fs = require('fs'),
protobuf = require('protobufjs');
const builder = protobuf.newBuilder(),
protoDir = __dirname + '/proto';
fs.readdirSync(protoDir)
.filter(filename => filename.match(/\.proto$/))
.forEach(filename => protobuf.loadProtoFile(protoDir + '/' + filename, builder));
module.exports... | const fs = require('fs'),
protobuf = require('protobufjs');
const builder = protobuf.newBuilder(),
protoDir = __dirname + '/proto';
fs.readdirSync(protoDir)
.filter(filename => filename.match(/\.proto$/))
.forEach(filename => protobuf.loadProtoFile(protoDir + '/' + filename, builder));
// Recursively... | Set packed=true for all repeated packable types | Set packed=true for all repeated packable types
Workaround for https://github.com/dcodeIO/protobuf.js/issues/432
| JavaScript | mit | cyraxx/node-pogo-protos,cyraxx/node-pogo-protos | ---
+++
@@ -8,4 +8,20 @@
.filter(filename => filename.match(/\.proto$/))
.forEach(filename => protobuf.loadProtoFile(protoDir + '/' + filename, builder));
+// Recursively add the packed=true to all packable repeated fields.
+// Repeated fields are packed by default in proto3 but protobuf.js incorrectly do... |
f677fef8a3474eacd62a22ddedc25a3c91ec9c3f | src/js/components/interests/CardContentList.js | src/js/components/interests/CardContentList.js | import React, { PropTypes, Component } from 'react';
import CardContent from '../ui/CardContent';
export default class CardContentList extends Component {
static propTypes = {
contents : PropTypes.array.isRequired,
userId : PropTypes.number.isRequired,
otherUserId : PropTypes.... | import React, { PropTypes, Component } from 'react';
import CardContent from '../ui/CardContent';
export default class CardContentList extends Component {
static propTypes = {
contents : PropTypes.array.isRequired,
userId : PropTypes.number.isRequired,
otherUserId : PropTypes.... | Make report optional in CardContent | QS-1341: Make report optional in CardContent
| JavaScript | agpl-3.0 | nekuno/client,nekuno/client | ---
+++
@@ -16,19 +16,17 @@
}
onReport(contentId, reason) {
- if (this.props.onReport) {
- this.props.onReport(contentId, reason);
- }
+ this.props.onReport(contentId, reason);
}
render() {
- const {contents, userId, otherUserId, onClickHandler} = this.pr... |
65a3be9065227ba11ab0680f85c109d99b860bb4 | tools/cli/default-npm-deps.js | tools/cli/default-npm-deps.js | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
unlink,
} from "../fs/files";
const INSTALL_JOB_MESSAGE = "installing npm dependencies";
export function install(appDir, options) {
const packageJsonPath = pathJoin(appDir, "package.json");
const needTempPackage... | import buildmessage from "../utils/buildmessage.js";
import {
pathJoin,
statOrNull,
writeFile,
unlink,
} from "../fs/files";
const INSTALL_JOB_MESSAGE = "installing npm dependencies";
export function install(appDir, options) {
const packageJsonPath = pathJoin(appDir, "package.json");
const needTempPackage... | Fix test-packages in browser testing | Fix test-packages in browser testing
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | ---
+++
@@ -13,7 +13,8 @@
const needTempPackageJson = ! statOrNull(packageJsonPath);
if (needTempPackageJson) {
- const { dependencies } = require("../static-assets/skel-minimal/package.json");
+ // NOTE we need skel-minimal to pull in jQuery which right now is required for Blaze
+ const { dependenci... |
57617e3f76abbb7e0c4c421c0a6fbb1872a9ac87 | app/templates/Gruntfile.js | app/templates/Gruntfile.js | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scss: {
files: ['app/styles/**/*.scss'],
tasks: ['scss']
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'app/style... | 'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scss: {
files: ['app/styles/**/*.scss'],
tasks: ['sass']
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'app/style... | Fix watch was referring to subtask with typo | Fix watch was referring to subtask with typo
| JavaScript | bsd-3-clause | doberman/generator-doberman,doberman/generator-doberman | ---
+++
@@ -7,7 +7,7 @@
watch: {
scss: {
files: ['app/styles/**/*.scss'],
- tasks: ['scss']
+ tasks: ['sass']
}
},
|
4313cae1c10e687123c18625126537004ceb5131 | lib/util/request-browser.js | lib/util/request-browser.js | /*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** Browser replacement for the request module using jQuery. */
var EventEmitter = require('events').EventEmitter,
SingleIterator = require('../../lib/iterators/Iterator').SingleIterator;
require('setimmediate');
// Requests the gi... | /*! @license ©2013 Ruben Verborgh - Multimedia Lab / iMinds / Ghent University */
/** Browser replacement for the request module using jQuery. */
var EventEmitter = require('events').EventEmitter,
SingleIterator = require('../../lib/iterators/Iterator').SingleIterator;
require('setimmediate');
// Requests the gi... | Add error handling to browser requests. | Add error handling to browser requests. | JavaScript | mit | infitude/Client.js | ---
+++
@@ -23,7 +23,12 @@
response.statusCode = jqXHR.status;
response.headers = { 'content-type': jqXHR.getResponseHeader('content-type') };
request.emit('response', response);
+ })
+ // Emit an error if the request fails
+ .fail(function () {
+ request.emit('error', new Error('Error requesting... |
c848a715cb5423085cb76c3bd958a1141ec2defd | public/app.js | public/app.js | $(document).ready(function() {
var options = {
chart: {
renderTo: 'chart',
type: 'spline',
},
title: {
text: 'Recent Water Values'
},
xAxis: {
type: 'datetime',
title: {
text: 'Date'
}
},
yAxis: {
labels: {
... | $(document).ready(function() {
var options = {
chart: {
renderTo: 'chart',
type: 'spline',
},
title: {
text: 'Recent Water Values'
},
xAxis: {
type: 'datetime',
title: {
text: 'Date'
}
},
yAxis: {
labels: {
... | Remove cacheing of the json | Remove cacheing of the json
| JavaScript | mit | amcolash/WaterPi,amcolash/WaterPi,amcolash/WaterPi,amcolash/WaterIoT,amcolash/WaterIoT,amcolash/WaterPi,amcolash/WaterIoT,amcolash/WaterIoT | ---
+++
@@ -32,6 +32,11 @@
series: [{}]
};
+ // Don't cache the json :)
+ $.ajaxSetup({
+ cache:false
+ });
+
$.getJSON('data.json', function(data) {
var series = [];
|
ba68dfed99a9616724512b11c9a7189552e71161 | node-tests/unit/utils/rasterize-list-test.js | node-tests/unit/utils/rasterize-list-test.js | 'use strict';
const expect = require('../../helpers/expect');
const fs = require('fs');
const sizeOf = require('image-size');
const RasterizeList = require('../../../src/utils/rasterize-list');
describe('RasterizeList', function() {
// Hitting the file system is slow
this.timeout(0);
... | 'use strict';
const expect = require('../../helpers/expect');
const fs = require('fs');
const sizeOf = require('image-size');
const RasterizeList = require('../../../src/utils/rasterize-list');
describe('RasterizeList', function() {
// Hitting the file system is slow
this.timeout(0);
... | Update test to improve speed by only writing and unlinking files once | refactor(rasterize-list): Update test to improve speed by only writing and unlinking files once
| JavaScript | mit | isleofcode/splicon | ---
+++
@@ -19,21 +19,24 @@
path: 'tmp/icon-60.png'
}
];
+ let subject;
- afterEach(() => {
+ before(() => {
+ subject = RasterizeList({src: src, toRasterize: toRasterize});
+ });
+
+ after(() => {
toRasterize.forEach((rasterize) => {
fs.unlinkSync(rasterize.... |
b5994cb13469f3d48f589a2a7910149ef46b0516 | build/npm/stop-server.js | build/npm/stop-server.js | /*
* Copyright (C) 2017 Steven Soloff
*
* This software is licensed under the terms of the GNU Affero General Public
* License version 3 or later (https://www.gnu.org/licenses/).
*/
import config from './config'
import del from 'del'
import fs from 'fs'
import kill from 'tree-kill'
const serverPid = fs.readFileS... | /*
* Copyright (C) 2017 Steven Soloff
*
* This software is licensed under the terms of the GNU Affero General Public
* License version 3 or later (https://www.gnu.org/licenses/).
*/
import config from './config'
import fs from 'fs'
import kill from 'tree-kill'
const serverPid = fs.readFileSync(config.paths.serve... | Use fs.unlinkSync() to delete files | Use fs.unlinkSync() to delete files
| JavaScript | agpl-3.0 | ssoloff/hazelslack-server-core | ---
+++
@@ -6,13 +6,12 @@
*/
import config from './config'
-import del from 'del'
import fs from 'fs'
import kill from 'tree-kill'
const serverPid = fs.readFileSync(config.paths.serverPid, {
encoding: config.encodings.serverPid
})
-del(config.paths.serverPid)
+fs.unlinkSync(config.paths.serverPid)
ki... |
91fabd5f82b18a1b1e2acae87160be3488efc044 | tests/helpers/start-app.js | tests/helpers/start-app.js | import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
// use defaults, but you can override
let attributes = Ember.assign({}, config.APP, attrs);
Ember.run(() => {
application = Application... | import Ember from 'ember';
import Application from '../../app';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let assign = Ember.assign || Ember.merge
// use defaults, but you can override
let attributes = assign({}, config.APP, attrs);
Ember.run(... | Fix tests for ember v2.4.x | Fix tests for ember v2.4.x
| JavaScript | mit | josemarluedke/ember-cli-numeral,jayphelps/ember-cli-numeral,josemarluedke/ember-cli-numeral | ---
+++
@@ -4,9 +4,10 @@
export default function startApp(attrs) {
let application;
+ let assign = Ember.assign || Ember.merge
// use defaults, but you can override
- let attributes = Ember.assign({}, config.APP, attrs);
+ let attributes = assign({}, config.APP, attrs);
Ember.run(() => {
appli... |
8963d5f14cf34b4771a5dbcdad7181680aef7881 | example/src/screens/types/Drawer.js | example/src/screens/types/Drawer.js | import React from 'react';
import {StyleSheet, View, Text} from 'react-native';
class MyClass extends React.Component {
render() {
return (
<View style={styles.container}>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
width: 300,
alignItems: 'center',
... | import React from 'react';
import {StyleSheet, View, Button} from 'react-native';
class MyClass extends React.Component {
onShowModal = () => {
this.props.navigator.toggleDrawer({
side: 'left'
});
this.props.navigator.showModal({
screen: 'example.Types.Modal',
title: `Modal`
});
... | Add show modal button to SideMenu | Add show modal button to SideMenu
| JavaScript | mit | junedomingo/react-native-navigation,junedomingo/react-native-navigation,junedomingo/react-native-navigation,junedomingo/react-native-navigation | ---
+++
@@ -1,12 +1,26 @@
import React from 'react';
-import {StyleSheet, View, Text} from 'react-native';
+import {StyleSheet, View, Button} from 'react-native';
class MyClass extends React.Component {
+
+ onShowModal = () => {
+ this.props.navigator.toggleDrawer({
+ side: 'left'
+ });
+ this.prop... |
c120257c591597d8bf291396180e18f40bb3b1fa | common/components/utils/ghostApi.js | common/components/utils/ghostApi.js | // @flow
import GhostContentAPI from "@tryghost/content-api";
const ghostContentAPI =
window.GHOST_URL &&
window.GHOST_CONTENT_API_KEY &&
new GhostContentAPI({
url: window.GHOST_URL,
key: window.GHOST_CONTENT_API_KEY,
version: "v3",
});
export type GhostPost = {|
title: string,
url: string,
... | // @flow
import GhostContentAPI from "@tryghost/content-api";
const ghostContentAPI =
window.GHOST_URL &&
window.GHOST_CONTENT_API_KEY &&
new GhostContentAPI({
url: window.GHOST_URL,
key: window.GHOST_CONTENT_API_KEY,
version: "v3",
});
export type GhostPost = {|
title: string,
url: string,
... | Include slugs in ghost response | Include slugs in ghost response
| JavaScript | mit | DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange,DemocracyLab/CivicTechExchange | ---
+++
@@ -13,6 +13,7 @@
export type GhostPost = {|
title: string,
url: string,
+ slug: string,
excerpt: ?string,
custom_excerpt: ?string,
feature_image: string,
@@ -27,7 +28,7 @@
ghostContentAPI.posts
.browse({
filter: "tag:" + tag,
- fields: "title, url, excerpt, custom... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.