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 |
|---|---|---|---|---|---|---|---|---|---|---|
e5fb18d4a59e707f075d76310af2ec919ca5716c | src/modules/getPrice/index.js | src/modules/getPrice/index.js | import module from '../../module'
import command from '../../components/command'
import loader from '../../components/loader'
import axios from 'axios'
import humanize from '../../utils/humanize'
export default module(
loader(() => {
console.log('test')
}),
command('getprice', 'Gets the Jita price ... | import module from '../../module'
import command from '../../components/command'
import loader from '../../components/loader'
import axios from 'axios'
import humanize from '../../utils/humanize'
export default module(
loader(() => {
console.log('test')
}),
command('getprice', 'Gets the Jita price ... | Move ESI url prefix to variable | Move ESI url prefix to variable
| JavaScript | mit | emensch/thonk9k | ---
+++
@@ -10,8 +10,10 @@
}),
command('getprice', 'Gets the Jita price of a given item.', async (state, message, args) => {
try {
+ const esiURL = 'https://esi.tech.ccp.is/latest/';
+
const {data: itemData} = await axios.get(
- `https://esi.tech.ccp.is/latest... |
6801d288ec728671330a6881306753abd30e0a8f | app/student.front.js | app/student.front.js | const $answer = $('.answer')
const {makeRichText} = require('./rich-text-editor')
const save = ($elem, async = true) => $.post({
url: '/save',
data: {text: $elem.html(), answerId: $elem.attr('id')},
async
})
function saveScreenshot(questionId) {
return ({data, type}) => {
return $.post({
... | const $answer = $('.answer')
const {makeRichText} = require('./rich-text-editor')
const save = ($elem, async = true) => $.post({
url: '/save',
data: {text: $elem.html(), answerId: $elem.attr('id')},
async
})
function saveScreenshot(questionId) {
return ({data, type}) => {
return $.post({
... | Update answer content before initializing rich text | Update answer content before initializing rich text
| JavaScript | mit | digabi/math-editor,digabi/rich-text-editor,digabi/rich-text-editor,digabi/rich-text-editor,digabi/math-editor | ---
+++
@@ -28,8 +28,10 @@
})
$answer.each((i, answer) => {
- makeRichText(answer, richTextOptions(answer.id))
- $.get(`/load?answerId=${answer.id}`, data => data && $(answer).html(data.html))
+ $.get(`/load?answerId=${answer.id}`, data => {
+ data && $(answer).html(data.html)
+ makeRichTex... |
d02ef235fb382ff749a41561518c18c7ebd81f2f | src/JokeMeUpBoy.js | src/JokeMeUpBoy.js | /**
* Prints a random programmer joke.
* @author Vitor Cortez <vitoracortez+github@gmail.com>
*/
var jokeMeUpBoy = function() {
const jokes = getListOfJokes();
let rand = Math.floor(Math.random() * jokes.length);
console.log(jokes[rand]);
};
/**
* Holds a list of classic programmer jokes.
* Feel free ... | /**
* Prints a random programmer joke.
* @author Vitor Cortez <vitoracortez+github@gmail.com>
*/
var jokeMeUpBoy = function() {
const jokes = getListOfJokes();
let rand = Math.floor(Math.random() * jokes.length);
console.log(jokes[rand]);
};
/**
* Holds a list of classic programmer jokes.
* Feel free ... | Add a new dank joke | Add a new dank joke
Dem jokes | JavaScript | mit | Rabrennie/anything.js,Sha-Grisha/anything.js,Rabrennie/anything.js,Rabrennie/anything.js,Rabrennie/anything.js,Sha-Grisha/anything.js,Sha-Grisha/anything.js,Sha-Grisha/anything.js | ---
+++
@@ -16,6 +16,7 @@
function getListOfJokes() {
var arr = [];
arr.push('Q: How do you tell an introverted computer scientist from an extroverted computer scientist?\nA: An extroverted computer scientist looks at your shoes when he talks to you.');
+ arr.push('Q: Why do programmers always mix up Ha... |
86cef9310543200502e822cbfbc39066e3f91967 | public/app/user-account/user-login/user-login-controller.js | public/app/user-account/user-login/user-login-controller.js | define(function() {
var LoginController = function($location, AuthenticationService) {
// reset login status
AuthenticationService.clearCredentials();
this.login = function() {
this.dataLoading = true;
var self = this
Authentica... | define(function() {
var LoginController = function($location, $mdDialog, AuthenticationService) {
// reset login status
AuthenticationService.clearCredentials()
this.login = function() {
this.dataLoading = true
var self = this
AuthenticationService.log... | Update login controller to display dialog on error | Update login controller to display dialog on error
| JavaScript | mit | tenevdev/idiot,tenevdev/idiot | ---
+++
@@ -1,27 +1,34 @@
define(function() {
- var LoginController = function($location, AuthenticationService) {
+ var LoginController = function($location, $mdDialog, AuthenticationService) {
- // reset login status
- AuthenticationService.clearCredentials();
+ // reset login ... |
297c942ffefae923501d5988c36ef6930b5888b7 | examples/http-random-user/src/main.js | examples/http-random-user/src/main.js | import Cycle from '@cycle/core';
import {div, button, h1, h4, a, makeDOMDriver} from '@cycle/dom';
import {makeHTTPDriver} from '@cycle/http';
function main(sources) {
const getRandomUser$ = sources.DOM.select('.get-random').events('click')
.map(() => {
const randomNum = Math.round(Math.random() * 9) + 1;
... | import Cycle from '@cycle/core';
import {div, button, h1, h4, a, makeDOMDriver} from '@cycle/dom';
import {makeHTTPDriver} from '@cycle/http';
function main(sources) {
const getRandomUser$ = sources.DOM.select('.get-random').events('click')
.map(() => {
const randomNum = Math.round(Math.random() * 9) + 1;
... | Rename http-random-user key to category | Rename http-random-user key to category
| JavaScript | mit | cyclejs/cyclejs,cyclejs/cyclejs,feliciousx-open-source/cyclejs,cyclejs/cyclejs,usm4n/cyclejs,maskinoshita/cyclejs,cyclejs/cycle-core,staltz/cycle,ntilwalli/cyclejs,ntilwalli/cyclejs,feliciousx-open-source/cyclejs,usm4n/cyclejs,usm4n/cyclejs,maskinoshita/cyclejs,maskinoshita/cyclejs,ntilwalli/cyclejs,feliciousx-open-sou... | ---
+++
@@ -8,13 +8,13 @@
const randomNum = Math.round(Math.random() * 9) + 1;
return {
url: 'http://jsonplaceholder.typicode.com/users/' + String(randomNum),
- key: 'users',
+ category: 'users',
method: 'GET'
};
});
const user$ = sources.HTTP
- .filte... |
73e99f993882ddd754fefd112f2c95ce62e5dad2 | app/components/OverFlowMenu.js | app/components/OverFlowMenu.js | import React, { Component, PropTypes, cloneElement } from 'react';
import styles from './OverFlowMenu.module.scss';
export class OverflowItem extends Component {
onClick(e) {
this.props.onClick(e);
this.props.onClicked();
}
render() {
return (
<div className={styles.item} {...this.props} onCli... | import React, { Component, PropTypes, cloneElement } from 'react';
import styles from './OverFlowMenu.module.scss';
export class OverflowItem extends Component {
onClick(e) {
this.props.onClick(e);
this.props.onClicked();
}
render() {
return (
<div className={styles.item} {...this.props} onCli... | Fix overflow menu reopening immediately after selecting an item | Fix overflow menu reopening immediately after selecting an item
Was caused by mouseout toggling, instead of closing
| JavaScript | mpl-2.0 | pascalw/gettable,pascalw/gettable | ---
+++
@@ -23,7 +23,15 @@
}
toggle() {
- this.setState({open: !this.state.open});
+ this.setOpen(!this.isOpen());
+ }
+
+ isOpen() {
+ return this.state.open;
+ }
+
+ setOpen(openOrClosed) {
+ this.setState({open: openOrClosed});
}
onItemClicked() {
@@ -31,7 +39,7 @@
}
onMouse... |
5e850fc85216fed6848878eaf66841c8dc25fc1b | src/selectors/cashRegister.js | src/selectors/cashRegister.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { createSelector } from 'reselect';
import { pageStateSelector } from './pageSelectors';
import currency from '../localization/currency';
/**
* Derives current balance from cash register transactions.
* @return {Number}
*/
export const selec... | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { createSelector } from 'reselect';
import { pageStateSelector } from './pageSelectors';
import currency from '../localization/currency';
/**
* Derives current balance from cash register transactions.
* @return {Number}
*/
export const selec... | Add currency to cash register selectors | Add currency to cash register selectors | JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | ---
+++
@@ -23,14 +23,14 @@
);
export const selectReceiptsTotal = createSelector([selectReceipts], receipts =>
- receipts.reduce((acc, { total }) => acc + total, 0)
+ receipts.reduce((acc, { total }) => acc.add(total), currency(0))
);
export const selectPaymentsTotal = createSelector([selectPayments], payme... |
39c4271933e1392d20483aa3e1c6e7287fb3d820 | src/api/githubAPI.js | src/api/githubAPI.js | let Octokat = require('octokat');
let octo = new Octokat({});
class GithubApi {
constructor(){
this.octo = new Octokat({});
}
static newOctokatNoToken(){
this.octo = new Octokat({});
}
static newOctokatWithToken(token){
this.octo = new Octokat({
token: token
});
}
static testOcto... | let Octokat = require('octokat');
let octo = new Octokat({});
class GithubApi {
static testOctokat(){
return new Promise((resolve) => {
resolve(octo.repos('compumike08', 'GitHub_Status_API_GUI').fetch());
});
}
}
export default GithubApi;
| Revert "Modify GithubApi to be able to set an OAuth token when instantiating" | Revert "Modify GithubApi to be able to set an OAuth token when instantiating"
This reverts commit 2197aa8a6246348070b9c26693ec08fc44f02031.
| JavaScript | mit | compumike08/GitHub_Status_API_GUI,compumike08/GitHub_Status_API_GUI | ---
+++
@@ -2,20 +2,6 @@
let octo = new Octokat({});
class GithubApi {
- constructor(){
- this.octo = new Octokat({});
- }
-
- static newOctokatNoToken(){
- this.octo = new Octokat({});
- }
-
- static newOctokatWithToken(token){
- this.octo = new Octokat({
- token: token
- });
- }
-
stat... |
60f02a26c5857e28e268cbfdd242644089c6626c | react.js | react.js | module.exports = {
extends: ["./index.js", "plugin:react/recommended"],
env: {
browser: true
},
plugins: [
"react"
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
"jsx": true
}
}
};
| module.exports = {
extends: ["./index.js", "plugin:react/recommended"],
env: {
browser: true
},
plugins: [
"react"
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
"jsx": true
}
},
rules: {
"reac... | Add common React rules to preset | Add common React rules to preset
| JavaScript | mit | netconomy/eslint-config-netconomy | ---
+++
@@ -12,5 +12,9 @@
ecmaFeatures: {
"jsx": true
}
+ },
+ rules: {
+ "react/display-name": 0,
+ "react/no-danger": 0
}
}; |
30d5c4942db0ccdb2f5ee4de0d4405d456ff3ed9 | webpack.conf.js | webpack.conf.js | import webpack from "webpack";
import path from "path";
export default {
module: {
rules: [
{
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
loader: "file-loader?name=/[hash].[ext]"
},
{test: /\.json$/, loader: "json-loader"},
{
load... | import webpack from "webpack";
import path from "path";
export default {
module: {
rules: [
{
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
loader: "file-loader?name=/[hash].[ext]"
},
{test: /\.json$/, loader: "json-loader"},
{
load... | Update exports loader to Webpack 3 syntax | Update exports loader to Webpack 3 syntax
Closes #67. | JavaScript | mit | doudigit/doudigit.github.io,BeitouSafeHome/btsh,netlify-templates/one-click-hugo-cms,netlify-templates/one-click-hugo-cms,emiaj/blog,chromicant/blog,doudigit/doudigit.github.io,jcrincon/jcrincon.github.io,chromicant/blog,BeitouSafeHome/btsh,emiaj/blog,jcrincon/jcrincon.github.io,emiaj/blog | ---
+++
@@ -20,7 +20,7 @@
plugins: [
new webpack.ProvidePlugin({
- "fetch": "imports-loader?this=>global!exports?global.fetch!whatwg-fetch"
+ "fetch": "imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch"
})
],
|
55e44ff76a4baae8214cd89c498868b661d99049 | spawnAsync.js | spawnAsync.js | 'use strict';
let spawn = require('cross-spawn');
module.exports = function spawnAsync() {
let args = Array.prototype.slice.call(arguments, 0);
let child;
let promise = new Promise((fulfill, reject) => {
child = spawn.apply(spawn, args);
let stdout = '';
let stderr = '';
if (child.stdout) {
... | 'use strict';
let spawn = require('cross-spawn');
module.exports = function spawnAsync(...args) {
let child;
let promise = new Promise((fulfill, reject) => {
child = spawn.apply(spawn, args);
let stdout = '';
let stderr = '';
if (child.stdout) {
child.stdout.on('data', data => {
std... | Use rest param instead of slice | Use rest param instead of slice
| JavaScript | mit | exponentjs/spawn-async,650Industries/spawn-async | ---
+++
@@ -2,8 +2,7 @@
let spawn = require('cross-spawn');
-module.exports = function spawnAsync() {
- let args = Array.prototype.slice.call(arguments, 0);
+module.exports = function spawnAsync(...args) {
let child;
let promise = new Promise((fulfill, reject) => {
child = spawn.apply(spawn, args); |
9017acd8ec8e0aaf9cf95d0b64385fb18fff0dcc | lib/config.js | lib/config.js | // Load configurations file
var config = require('../configs/config.json');
// Validate settings
if (!config.mpd || !config.mpd.host || !config.mpd.port) {
throw new Error("You must specify MPD host and port");
}
if (!config.radioStations || (typeof config.radioStations !== 'object')) {
throw new Error('"radi... | // Load configurations file
var config = require('../configs/config.json');
// Validate settings
if (!config.mpd || !config.mpd.host || !config.mpd.port) {
throw new Error("You must specify MPD host and port");
}
if (!config.radioStations || (typeof config.radioStations !== 'object')) {
throw new Error('"radi... | Make use server port is set | Make use server port is set
| JavaScript | apache-2.0 | JustBlackBird/bluethroat,JustBlackBird/bluethroat,JustBlackBird/bluethroat | ---
+++
@@ -22,4 +22,7 @@
throw new Error("You must specify at least one radio station");
}
+// Make sure the application port is set
+config.server.port = config.server.port || 8000;
+
module.exports = config; |
ee5a87db22b7e527d7d0102072bba5de91ac38fb | lib/errors.js | lib/errors.js | /**
AuthGW Custom Errors
@author tylerFowler
**/
/**
@name InvalidRoleError
@desc Thrown when a role is given that is not in the list of roles
@param { String } invalidRole
**/
function InvalidRoleError(invalidRole) {
this.name = 'InvalidRoleError';
this.message = `${invalidRole} is not a valid role`;
... | /**
AuthGW Custom Errors
@author tylerFowler
**/
/**
@class InvalidRoleError @extends Error
@desc Thrown when a role is given that is not in the list of roles
@param { String } invalidRole
**/
class InvalidRoleError extends Error {
constructor(invalidRole) {
this.name = 'InvalidRoleError';
this.mes... | Use class syntax for creating error | Use class syntax for creating error
| JavaScript | mit | tylerFowler/authgw | ---
+++
@@ -4,15 +4,14 @@
**/
/**
- @name InvalidRoleError
+ @class InvalidRoleError @extends Error
@desc Thrown when a role is given that is not in the list of roles
@param { String } invalidRole
**/
-function InvalidRoleError(invalidRole) {
- this.name = 'InvalidRoleError';
- this.message = `${invali... |
48ef57b90e8567574199dddb5b6cee78b6b039b0 | src/config.js | src/config.js | export const TZ = 'Europe/Prague'
export const SIRIUS_PROXY_PATH = process.env.SIRIUS_PROXY_PATH
| export const TZ = 'Europe/Prague'
export const SIRIUS_PROXY_PATH = global.SIRIUS_PROXY_PATH || process.env.SIRIUS_PROXY_PATH
| Allow SIRIUS_PROXY_PATH override by global var | Allow SIRIUS_PROXY_PATH override by global var
| JavaScript | mit | cvut/fittable-widget,cvut/fittable,cvut/fittable-widget,cvut/fittable-widget,cvut/fittable,cvut/fittable | ---
+++
@@ -1,3 +1,3 @@
export const TZ = 'Europe/Prague'
-export const SIRIUS_PROXY_PATH = process.env.SIRIUS_PROXY_PATH
+export const SIRIUS_PROXY_PATH = global.SIRIUS_PROXY_PATH || process.env.SIRIUS_PROXY_PATH |
57789e5d40c448ab1138dad987f7d8f9595966ee | .storybook/config.js | .storybook/config.js | import { configure } from '@storybook/vue';
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
configure(loadStories, module);
| import { configure, addParameters } from '@storybook/vue';
// Option defaults:
addParameters({
options: {
name: 'Vue Visual',
panelPosition: 'right',
}
})
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
... | Put package name in the storybook | Put package name in the storybook
| JavaScript | mit | BKWLD/vue-visual | ---
+++
@@ -1,4 +1,12 @@
-import { configure } from '@storybook/vue';
+import { configure, addParameters } from '@storybook/vue';
+
+// Option defaults:
+addParameters({
+ options: {
+ name: 'Vue Visual',
+ panelPosition: 'right',
+ }
+})
// automatically import all files ending in *.stories.js
const req ... |
2de18a5628f1acf45a5884c93bd985d4f6f367a3 | lib/server.js | lib/server.js | var acquires = {};
var Responder = require('cote').Responder;
var autoReleaseTimeout = 30000;
var counts = {
acquires: 0,
releases: 0
};
function acquire(req, cb) {
console.log('acquire', req.id);
counts.acquires++;
cb.autoRelease = setTimeout(function() {
console.log('auto release', req.... | var acquires = {};
var Responder = require('cote').Responder;
var autoReleaseTimeout = 30000;
var counts = {
acquires: 0,
releases: 0
};
function acquire(req, cb) {
console.log('acquire', req.id);
counts.acquires++;
if (acquires[req.id]) {
cb.autoRelease = setTimeout(function() {
... | Move auto release timeout to if check in acquire. | Move auto release timeout to if check in acquire. | JavaScript | apache-2.0 | tart/semaver | ---
+++
@@ -11,13 +11,13 @@
console.log('acquire', req.id);
counts.acquires++;
- cb.autoRelease = setTimeout(function() {
- console.log('auto release', req.id);
- release(req);
- }, autoReleaseTimeout);
-
- if (acquires[req.id])
+ if (acquires[req.id]) {
+ cb.autoRelease =... |
f5774e3fb24ca403de481e446c3bf68fa78b2c47 | spec/fixtures/api/quit-app/main.js | spec/fixtures/api/quit-app/main.js | var app = require('electron').app
app.on('ready', function () {
app.exit(123)
})
process.on('exit', function (code) {
console.log('Exit event with code: ' + code)
})
| var app = require('electron').app
app.on('ready', function () {
// This setImmediate call gets the spec passing on Linux
setImmediate(function () {
app.exit(123)
})
})
process.on('exit', function (code) {
console.log('Exit event with code: ' + code)
})
| Exit from a setImmediate callback | Exit from a setImmediate callback
| JavaScript | mit | seanchas116/electron,felixrieseberg/electron,pombredanne/electron,bpasero/electron,wan-qy/electron,leftstick/electron,the-ress/electron,jaanus/electron,deed02392/electron,thomsonreuters/electron,brave/muon,tonyganch/electron,tinydew4/electron,thomsonreuters/electron,gerhardberger/electron,roadev/electron,simongregory/e... | ---
+++
@@ -1,7 +1,10 @@
var app = require('electron').app
app.on('ready', function () {
- app.exit(123)
+ // This setImmediate call gets the spec passing on Linux
+ setImmediate(function () {
+ app.exit(123)
+ })
})
process.on('exit', function (code) { |
ad16587294c3186a89e84105fb2e390b36f26ca0 | lib/switch.js | lib/switch.js | const gpio = require('raspi-gpio')
module.exports = class Switch {
constructor (pinId) {
this.nInput = new gpio.DigitalInput(pinId, gpio.PULL_UP)
}
on (changeListener) {
this.nInput.on('change', (value) => {
changeListener(value)
})
}
}
| const gpio = require('raspi-gpio')
module.exports = class Switch {
constructor (pinId) {
this.nInput = new gpio.DigitalInput({
pin: pinId,
pullResistor: gpio.PULL_UP})
}
on (changeListener) {
this.nInput.on('change', (value) => {
changeListener(value)
})
}
}
| Fix pin pull resistor config | Fix pin pull resistor config
| JavaScript | mit | DanStough/josl | ---
+++
@@ -2,7 +2,9 @@
module.exports = class Switch {
constructor (pinId) {
- this.nInput = new gpio.DigitalInput(pinId, gpio.PULL_UP)
+ this.nInput = new gpio.DigitalInput({
+ pin: pinId,
+ pullResistor: gpio.PULL_UP})
}
on (changeListener) { |
b9e214312ec055e7e6d64fcc6a75b108c6176657 | js/index.js | js/index.js | // Pullquotes
document.addEventListener("DOMContentLoaded", function(event) {
function pullQuote(el){
var parentParagraph = el.parentNode;
parentParagraph.style.position = 'relative';
var clone = el.cloneNode(true);
clone.setAttribute('class','semantic-pull-quote--pulled');
// Hey y’all, watch thi... | // Semantic Pullquotes
document.addEventListener("DOMContentLoaded", function(event) {
function pullQuote(el){
var parentParagraph = el.parentNode;
parentParagraph.style.position = 'relative';
var clone = el.cloneNode(true);
clone.setAttribute('class','semantic-pull-quote--pulled');
// Hey y’all, ... | Rename Pullquotes --> Semantic Pullquotes | Rename Pullquotes --> Semantic Pullquotes
| JavaScript | mit | curiositry/sassisfy,curiositry/sassisfy | ---
+++
@@ -1,4 +1,4 @@
-// Pullquotes
+// Semantic Pullquotes
document.addEventListener("DOMContentLoaded", function(event) {
function pullQuote(el){
var parentParagraph = el.parentNode; |
234138b3a81e6db0439851c131448eb3f030f146 | app/send-native.js | app/send-native.js | 'use strict';
const application = 'io.github.deathcap.nodeachrome';
function decodeResponse(response, cb) {
console.log('decodeResponse',response);
if (typeof cb !== 'function') { console.error('??? decodeResponse non-string callback',cb); cb = () => {}; }
if (!response) return cb(chrome.runtime.lastError);
i... | 'use strict';
const application = 'io.github.deathcap.nodeachrome';
let callbacks = new Map();
let nextID = 1;
let port = null;
function decodeResponse(response, cb) {
console.log('decodeResponse',response);
if (typeof cb !== 'function') { console.error('??? decodeResponse non-string callback',cb); cb = () => {}... | Change native messaging to keep the host running persistently, maintaining an open port | Change native messaging to keep the host running persistently, maintaining an open port
| JavaScript | mit | deathcap/nodeachrome,deathcap/nodeachrome,deathcap/nodeachrome | ---
+++
@@ -1,6 +1,10 @@
'use strict';
const application = 'io.github.deathcap.nodeachrome';
+
+let callbacks = new Map();
+let nextID = 1;
+let port = null;
function decodeResponse(response, cb) {
console.log('decodeResponse',response);
@@ -10,11 +14,49 @@
return cb(null, response.result);
}
+functio... |
a6a42353b20a9282bdb83cf45c0111954b9d6888 | ember-cli-build.js | ember-cli-build.js | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
// Add options here
});
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This... | /* eslint-env node */
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
},
});
/*
This build file specifies the options for the dummy test app of this
addon... | Include ember-cli-babel polyfil to fix tests | Include ember-cli-babel polyfil to fix tests
| JavaScript | mit | amiel/ember-data-url-templates,amiel/ember-data-url-templates | ---
+++
@@ -3,7 +3,9 @@
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
- // Add options here
+ 'ember-cli-babel': {
+ includePolyfill: true
+ },
});
/* |
1db74f03479538911f1c9336df233aea3c7cc622 | karma.conf.js | karma.conf.js | var webpackConfig = require('./webpack.config');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'test/**/*.ts'
],
exclude: [
],
preprocessors: {
'src/**/!(defaults)/*.js': ['coverage'],
'test/**/*.ts': ['webpack']
... | var webpackConfig = require('./webpack.config');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
'test/**/*.ts'
],
mime: {
'text/x-typescript': ['ts', 'tsx']
},
exclude: [
],
preprocessors: {
'src/**/!... | Add mime type option in karma file! | Add mime type option in karma file!
| JavaScript | apache-2.0 | proteus-h2020/proteic,proteus-h2020/proteic,proteus-h2020/proteus-charts,proteus-h2020/proteic | ---
+++
@@ -7,6 +7,11 @@
files: [
'test/**/*.ts'
],
+
+ mime: {
+ 'text/x-typescript': ['ts', 'tsx']
+ },
+
exclude: [
],
preprocessors: { |
a551c502c03f0e324aa0765d36799f3c8305b2f2 | app/utils/index.js | app/utils/index.js | const moment = require('moment');
export const dateFormat = (utcDate) => {
return moment(utcDate, 'YYYY-MM-DD hh:mm:ss z').format('LLL');
};
| const moment = require('moment');
export const dateFormat = (utcDate) => {
return moment.utc(new Date(utcDate)).format('LLL');
};
| Use Date function to help parse timezone. | Use Date function to help parse timezone.
| JavaScript | mit | FuBoTeam/fubo-flea-market,FuBoTeam/fubo-flea-market | ---
+++
@@ -1,5 +1,5 @@
const moment = require('moment');
export const dateFormat = (utcDate) => {
- return moment(utcDate, 'YYYY-MM-DD hh:mm:ss z').format('LLL');
+ return moment.utc(new Date(utcDate)).format('LLL');
}; |
ec5401d64467628fa318a96363dcd4ae85ff1d98 | get_languages.js | get_languages.js | var request = require('request');
var yaml = require('js-yaml');
module.exports = function (callback) {
var languagesURL = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml';
request(languagesURL, function (error, response, body) {
var languages = yaml.safeLoad(body);
O... | var request = require('request');
var yaml = require('js-yaml');
module.exports = function (callback) {
var languagesURL = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml';
request(languagesURL, function (error, response, body) {
var languages = yaml.safeLoad(body);
O... | Remove languages that don't have colors | Remove languages that don't have colors
| JavaScript | mit | nicolasmccurdy/language-colors,nicolasmccurdy/language-colors | ---
+++
@@ -8,7 +8,11 @@
var languages = yaml.safeLoad(body);
Object.keys(languages).forEach(function (languageName) {
- languages[languageName] = languages[languageName].color;
+ if (languages[languageName]) {
+ languages[languageName] = languages[languageName].color;
+ } else {
+ ... |
e24f9da2e1b107767453a8693be90cfb97ebe76c | lib/index.js | lib/index.js | /**
* isUndefined
* Checks if a value is undefined or not.
*
* @name isUndefined
* @function
* @param {Anything} input The input value.
* @returns {Boolean} `true`, if the input is `undefined`, `false` otherwise.
*/
module.exports = function isUndefined(input) {
return typeof input === 'undefined';
};
| "use strict";
/**
* isUndefined
* Checks if a value is undefined or not.
*
* @name isUndefined
* @function
* @param {Anything} input The input value.
* @returns {Boolean} `true`, if the input is `undefined`, `false` otherwise.
*/
let u = void 0;
module.exports = input => input === u;
| Use void 0 to get the undefined value. | Use void 0 to get the undefined value.
| JavaScript | mit | IonicaBizau/is-undefined | ---
+++
@@ -1,3 +1,5 @@
+"use strict";
+
/**
* isUndefined
* Checks if a value is undefined or not.
@@ -7,6 +9,5 @@
* @param {Anything} input The input value.
* @returns {Boolean} `true`, if the input is `undefined`, `false` otherwise.
*/
-module.exports = function isUndefined(input) {
- return typeof i... |
5aff66da9b38b94fe0e6b453ecb2678e0f743d8a | example/i18n/fr.js | example/i18n/fr.js | export const messages = {
post: {
name: 'Article',
all: 'Articles',
list: {
search: 'Recherche',
title: 'Titre',
published_at: 'Publié le',
commentable: 'Commentable',
views: 'Vues',
},
form: {
title: 'Ti... | export const messages = {
post: {
name: 'Article',
all: 'Articles',
list: {
search: 'Recherche',
title: 'Titre',
published_at: 'Publié le',
commentable: 'Commentable',
views: 'Vues',
},
form: {
title: 'Ti... | Fix typos in French translation of the example | Fix typos in French translation of the example
| JavaScript | mit | matteolc/admin-on-rest,matteolc/admin-on-rest,marmelab/admin-on-rest,marmelab/admin-on-rest | ---
+++
@@ -19,9 +19,9 @@
password: 'Mot de passe (si protégé)',
summary: 'Résumé',
miscellaneous: 'Extra',
- nb_view: 'Nb de vues ?',
+ nb_view: 'Nb de vues',
comments: 'Commentaires',
- created_at: 'Créer le',
+ created_... |
cbfb5044b5d16a826f98104f52c8588fffbfb6c0 | src/deploy.spec.js | src/deploy.spec.js | import {describe, it} from 'mocha';
import {
assertThat, equalTo,
} from 'hamjest';
const toSrcDestPairs = (files, {sourcePath, destinationPath}) =>
files.map(file => ({
sourceFileName: file,
destinationFilename: file.replace(sourcePath, destinationPath)
}))
;
describe('Build src-dest pairs from file na... | import {describe, it} from 'mocha';
import {
assertThat, equalTo,
} from 'hamjest';
const toSrcDestPairs = (files, {sourcePath, destinationPath}) =>
files.map(file => ({
sourceFileName: file,
destinationFilename: file.replace(sourcePath, destinationPath)
}))
;
describe('Build src-dest pairs from file na... | Write a (documenting) test that describes the "lots-case". | Write a (documenting) test that describes the "lots-case".
| JavaScript | mit | tddbin/katas,tddbin/katas,tddbin/katas | ---
+++
@@ -30,4 +30,15 @@
}];
assertThat(buildPairs(oneSrcFile), equalTo(onePair));
});
+ it('WHEN many files given, replace src path with dest path', () => {
+ const manyFile = [
+ `${sourcePath}/file.js`,
+ `${sourcePath}/any/depth/file.js`,
+ ];
+ const manyPairs = [
+ {sourc... |
e082e386adc50466d4c30a24dea8ce6a93b265b4 | routes/admin/authenticated/sidebar/templates-list/page.connected.js | routes/admin/authenticated/sidebar/templates-list/page.connected.js | import { provideHooks } from 'redial'
import { connect } from 'react-redux'
import * as MobilizationActions from '~mobilizations/action-creators'
import * as MobilizationSelectors from '~mobilizations/selectors'
import * as TemplateActions from '~mobilizations/templates/action-creators'
import * as TemplateSelectors f... | import { provideHooks } from 'redial'
import { connect } from 'react-redux'
import MobSelectors from '~client/mobrender/redux/selectors'
import { toggleMobilizationMenu } from '~client/mobrender/redux/action-creators'
import * as TemplateActions from '~mobilizations/templates/action-creators'
import * as TemplateSelec... | Fix menu in template list | Fix menu in template list
| JavaScript | agpl-3.0 | nossas/bonde-client,nossas/bonde-client,nossas/bonde-client | ---
+++
@@ -1,8 +1,8 @@
import { provideHooks } from 'redial'
import { connect } from 'react-redux'
-import * as MobilizationActions from '~mobilizations/action-creators'
-import * as MobilizationSelectors from '~mobilizations/selectors'
+import MobSelectors from '~client/mobrender/redux/selectors'
+import { togg... |
26325efdf4836d0eb44a4f987830c38562222cda | public/javascripts/app.js | public/javascripts/app.js | var app = angular.module("blogApp", []);
var posts = [];
app.config(function($routeProvider)
{
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'BlogCtrl'
})
.when('/post/:postId', {
templateUrl: 'views/post.html',
controller: 'PostCtrl'
})
.otherwise({
redirectTo: '/'
... | var app = angular.module("blogApp", []);
var posts = [];
app.config(function($routeProvider)
{
$routeProvider
.when('/', {
templateUrl: 'views/home.html',
controller: 'BlogCtrl'
})
.when('/post/:postId', {
templateUrl: 'views/post.html',
controller: 'PostCtrl'
})
.otherwise({
redirectTo: '/'
... | Change for socket connection on Heroku | Change for socket connection on Heroku
| JavaScript | mit | Somojojojo/blog | ---
+++
@@ -17,7 +17,8 @@
});
});
-var socket = io.connect(window.location.origin);
+var host = location.origin.replace(/^http/, 'ws');
+var socket = io.connect(host);
socket.on('message', function(data)
{
switch(data.type) |
6621c6e7cc5fb3d62d8a5fabb08cf870b72ed5fe | lib/dropbox/index.js | lib/dropbox/index.js | 'use strict';
var cp = require('child_process');
var child = cp.fork(__dirname + '/child.js');
var passport = require('passport');
var DropboxOAuth2Strategy = require('passport-dropbox-oauth2').Strategy;
var active = false;
module.exports = function (options) {
child.send({
options: options.dropbox
});
retur... | 'use strict';
var cp = require('child_process');
var child = cp.fork(__dirname + '/child.js');
var passport = require('passport');
var DropboxOAuth2Strategy = require('passport-dropbox-oauth2').Strategy;
var active = false;
module.exports = function (options) {
child.send({
options: options.dropbox
});
retur... | Add accessToken to profile before done | Add accessToken to profile before done
| JavaScript | mit | svacha/jsbin,filamentgroup/jsbin,eggheadio/jsbin,late-warrior/jsbin,thsunmy/jsbin,pandoraui/jsbin,ilyes14/jsbin,digideskio/jsbin,saikota/jsbin,AverageMarcus/jsbin,fgrillo21/NPA-Exam,late-warrior/jsbin,peterblazejewicz/jsbin,juliankrispel/jsbin,francoisp/jsbin,ctide/jsbin,juliankrispel/jsbin,KenPowers/jsbin,mdo/jsbin,mi... | ---
+++
@@ -17,6 +17,7 @@
clientSecret: options.dropbox.secret,
callbackURL: 'https://jsbin.dev/auth/dropbox/callback'
}, function (accessToken, refreshToken, profile, done) {
+ profile.access_token = accessToken;
done(null, profile);
}
)); |
bb9858b1edbc7f8fe7a2abd70110adb50055ff8c | lib/main.js | lib/main.js | import "es6-symbol";
import "weakmap";
import svgLoader from "./loader.js";
import Icon from "./components/Icon.js";
import Sprite from "./components/Sprite.js";
import Theme from "./components/Theme.js";
var callback = function callback() { };
const icons = Icon;
const initLoader = svgLoader;
// loads an external... | import "es6-symbol";
import "weakmap";
import svgLoader from "./loader.js";
import Icon from "./components/Icon.js";
import Sprite from "./components/Sprite.js";
import Theme from "./components/Theme.js";
var callback = function callback() { };
const icons = Icon;
const initLoader = svgLoader;
// loads an external... | Update name of callback functions | Update name of callback functions
| JavaScript | mit | vuzonp/uxon | ---
+++
@@ -22,11 +22,11 @@
onRejected(new TypeError("Invalid Request"));
}
- loader.onSuccess = function(svg) {
+ loader.onSuccess = function onSuccess(svg) {
make(svg, onFulfilled, onRejected);
};
- loader.onFailure = function(e) {
+ loader.onFailure = function onFailure(e) {
onRejected... |
19e3dc49302a635f51bcd552fb70b434c0968520 | tests/cross-context-instance.js | tests/cross-context-instance.js | let ivm = require('isolated-vm');
let isolate = new ivm.Isolate;
function makeContext() {
let context = isolate.createContextSync();
let global = context.globalReference();
global.setSync('ivm', ivm);
isolate.compileScriptSync(`
function makeReference(ref) {
return new ivm.Reference(ref);
}
function isRef... | let ivm = require('isolated-vm');
let isolate = new ivm.Isolate;
function makeContext() {
let context = isolate.createContextSync();
let global = context.globalReference();
global.setSync('ivm', ivm);
isolate.compileScriptSync(`
function makeReference(ref) {
return new ivm.Reference(ref);
}
function isRef... | Fix test wasn't actually testing | Fix test wasn't actually testing
| JavaScript | isc | laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm,laverdet/isolated-vm | ---
+++
@@ -22,10 +22,10 @@
let context1 = makeContext();
let context2 = makeContext();
[ context1, context2 ].forEach(context => {
- if (!context1.isReference.applySync(null, [ new ivm.Reference({}) ])) {
+ if (!context.isReference.applySync(null, [ new ivm.Reference({}) ])) {
console.log('fail1');
}
- if (!... |
0c44942fa439737c8adf26a2e196bbd700e18e66 | R7.University.Employee/js/module.js | R7.University.Employee/js/module.js | $(function () {
// paint tables with dnnGrid classes
var table = ".employeeDetails #employeeDisciplines table";
$(table).addClass ("dnnGrid").css ("border-collapse", "collapse");
// use parent () to get rows with matched cell types
$(table + " tr:nth-child(even) td").parent ().addClass ("dnnGr... | $(function () {
// paint tables with dnnGrid classes
var table = ".employeeDetails #employeeDisciplines table";
$(table).addClass ("dnnGrid").css ("border-collapse", "collapse");
// use parent () to get rows with matched cell types
$(table + " tr:nth-child(even) td").parent ().addClass ("dnnGr... | Optimize & fix table painting script | Optimize & fix table painting script | JavaScript | agpl-3.0 | roman-yagodin/R7.University,roman-yagodin/R7.University,roman-yagodin/R7.University | ---
+++
@@ -3,8 +3,8 @@
var table = ".employeeDetails #employeeDisciplines table";
$(table).addClass ("dnnGrid").css ("border-collapse", "collapse");
// use parent () to get rows with matched cell types
- $(table + " tr:nth-child(even) td").parent ().addClass ("dnnGridItem");
- $(table + " tr:nth... |
ef259591d22d303c351b419f130b13061e28771a | app/native/src/types/Navigation.js | app/native/src/types/Navigation.js | // @flow
export type Navigation = {
navigate: (screen: string, parameters?: Object) => void,
state: {
params: Object,
},
};
| // @flow
type NavigationStateParameters = Object;
/**
* @see https://reactnavigation.org/docs/navigators/navigation-prop
*/
export type Navigation = {
navigate: (routeName: string, parameters?: NavigationStateParameters) => void,
state: {
params: NavigationStateParameters,
},
setParams: (newParameters: ... | Improve Flow type of the navigation | Improve Flow type of the navigation
| JavaScript | mit | mrtnzlml/native,mrtnzlml/native | ---
+++
@@ -1,8 +1,15 @@
// @flow
+type NavigationStateParameters = Object;
+
+/**
+ * @see https://reactnavigation.org/docs/navigators/navigation-prop
+ */
export type Navigation = {
- navigate: (screen: string, parameters?: Object) => void,
+ navigate: (routeName: string, parameters?: NavigationStateParameter... |
1b6904a33c0f83eddf6c759ebe4243d54eb1f54f | app/services/resizeable-columns.js | app/services/resizeable-columns.js | import Ember from "ember";
const { $, inject, run } = Ember;
export default Ember.Service.extend({
fastboot: inject.service(),
init() {
this._super(...arguments);
if (!this.get('fastboot.isFastBoot')) {
this.setupMouseEventsFromIframe();
}
},
setupMouseEventsFromIframe() {
window.addEv... | import Ember from "ember";
const { $, inject, run } = Ember;
export default Ember.Service.extend({
fastboot: inject.service(),
init() {
this._super(...arguments);
if (!this.get('fastboot.isFastBoot')) {
this.setupMouseEventsFromIframe();
}
},
handleMouseEvents(m, mouseEvent) {
const ev... | Refactor mouse events in resizeable columns | Refactor mouse events in resizeable columns
| JavaScript | mit | ember-cli/ember-twiddle,ember-cli/ember-twiddle,Gaurav0/ember-twiddle,Gaurav0/ember-twiddle,knownasilya/ember-twiddle,knownasilya/ember-twiddle,knownasilya/ember-twiddle,ember-cli/ember-twiddle,Gaurav0/ember-twiddle | ---
+++
@@ -12,22 +12,23 @@
}
},
+ handleMouseEvents(m, mouseEvent) {
+ const event = $.Event(mouseEvent, {
+ pageX: m.pageX + $("#dummy-content-iframe").offset().left,
+ pageY: m.pageY + $("#dummy-content-iframe").offset().top
+ });
+ $(window).trigger(event);
+ },
+
setupMouseEvent... |
78874dcdad510e76c2ee6d47c6b0ac72073b3e7c | lib/loaders/index.js | lib/loaders/index.js | import loadersWithAuthentication from "./loaders_with_authentication"
import loadersWithoutAuthentication from "./loaders_without_authentication"
export default (accessToken, userID) => {
const loaders = loadersWithoutAuthentication()
if (accessToken) {
return Object.assign({}, loaders, loadersWithAuthenticati... | import loadersWithAuthentication from "./loaders_with_authentication"
import loadersWithoutAuthentication from "./loaders_without_authentication"
/**
* Creates a new set of data loaders for all routes. These should be created for each GraphQL query and passed to the
* `graphql` query execution function.
*
* Only i... | Add documentation for a bunch of functions. | [loaders] Add documentation for a bunch of functions.
| JavaScript | mit | craigspaeth/metaphysics,mzikherman/metaphysics-1,artsy/metaphysics,artsy/metaphysics,craigspaeth/metaphysics,mzikherman/metaphysics-1,artsy/metaphysics,mzikherman/metaphysics-1,mzikherman/metaphysics-1 | ---
+++
@@ -1,6 +1,13 @@
import loadersWithAuthentication from "./loaders_with_authentication"
import loadersWithoutAuthentication from "./loaders_without_authentication"
+/**
+ * Creates a new set of data loaders for all routes. These should be created for each GraphQL query and passed to the
+ * `graphql` query... |
da8027163e556a84e60d0c41bd61ea4b8a42ef05 | src/renderer/scr.dom.js | src/renderer/scr.dom.js | var DOM = (function(){
var entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": ''',
"/": '/'
};
var entityRegex = /[&<>"'\/]/g;
return {
/*
* Returns a child element by its ID. Parent defaults to the entire document.
*/
id: function(... | var DOM = (function(){
var entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": ''',
"/": '/'
};
var entityRegex = /[&<>"'\/]/g;
return {
/*
* Returns a child element by its ID. Parent defaults to the entire document.
*/
id: function(... | Fix HTML escaping in renderer crashing on non-string values | Fix HTML escaping in renderer crashing on non-string values
| JavaScript | mit | chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker,chylex/Discord-History-Tracker | ---
+++
@@ -52,7 +52,7 @@
* Converts characters to their HTML entity form.
*/
escapeHTML: function(html){
- return html.replace(entityRegex, s => entityMap[s]);
+ return String(html).replace(entityRegex, s => entityMap[s]);
}
};
})(); |
9520ab1f9e7020879c8e3c2e8f6faad31fd572ef | Kwc/Shop/Box/Cart/Component.defer.js | Kwc/Shop/Box/Cart/Component.defer.js | var onReady = require('kwf/on-ready');
var $ = require('jQuery');
var getKwcRenderUrl = require('kwf/get-kwc-render-url');
onReady.onRender('.kwcClass',function(el) {
var url = getKwcRenderUrl();
$.each($('.kwfUp-addToCardForm .kwfUp-formContainer'), $.proxy(function(index, form) {
$(form).on('kwfUp-f... | var onReady = require('kwf/on-ready');
var $ = require('jQuery');
var getKwcRenderUrl = require('kwf/get-kwc-render-url');
onReady.onRender('.kwcClass',function(el) {
var url = getKwcRenderUrl();
$.each($('.kwfUp-addToCardForm .kwfUp-formContainer'), $.proxy(function(index, form) {
$(form).on('kwfUp-f... | Fix wrong exchange of cartbox-domelement | Fix wrong exchange of cartbox-domelement
| JavaScript | bsd-2-clause | koala-framework/koala-framework,koala-framework/koala-framework | ---
+++
@@ -11,7 +11,7 @@
url: url,
data: { componentId: el.data('component-id') },
success: function(response) {
- el.html(response);
+ $('.kwcClass').html(response);
onReady.callOnContentReady(el, {newRende... |
b4dfceadd3a541cb13d5a69a4ef799dce1dc2037 | web/src/js/components/Dashboard/DashboardContainer.js | web/src/js/components/Dashboard/DashboardContainer.js | import graphql from 'babel-plugin-relay/macro'
import { createFragmentContainer } from 'react-relay'
import Dashboard from 'js/components/Dashboard/DashboardComponent'
export default createFragmentContainer(Dashboard, {
app: graphql`
fragment DashboardContainer_app on App {
campaign {
isLive
... | import graphql from 'babel-plugin-relay/macro'
import { createFragmentContainer } from 'react-relay'
import Dashboard from 'js/components/Dashboard/DashboardComponent'
export default createFragmentContainer(Dashboard, {
app: graphql`
fragment DashboardContainer_app on App {
campaign {
isLive
... | Add data fetching for testing out Redis | Add data fetching for testing out Redis
| JavaScript | mpl-2.0 | gladly-team/tab,gladly-team/tab,gladly-team/tab | ---
+++
@@ -8,6 +8,7 @@
fragment DashboardContainer_app on App {
campaign {
isLive
+ numNewUsers # TODO: remove later. For testing Redis.
}
...UserMenuContainer_app
} |
25376ac4975c5d5021b40438f8954a6faa24e21d | lib/config.js | lib/config.js | var Fs = require('fs');
var config = module.exports = {};
// Configuring TLS
config.tls = {
key: Fs.readFileSync('./lib/certs/key.key'),
cert: Fs.readFileSync('./lib/certs/cert.crt'),
// Only necessary if using the client certificate authentication.
requestCert: true,
// Only necessary only if c... | var Fs = require('fs');
var config = module.exports = {};
// Configuring TLS
config.tls = {
key: Fs.readFileSync('./lib/certs/key.key'),
cert: Fs.readFileSync('./lib/certs/cert.crt'),
// Only necessary if using the client certificate authentication.
requestCert: true,
// Only necessary only if c... | Refactor good stop sending logs to remote server | Refactor good stop sending logs to remote server
Comments in lib/config.js still show how to send
logs to remote server. But, it is not used.
| JavaScript | bsd-3-clause | jd73/university,jd73/university | ---
+++
@@ -19,7 +19,6 @@
autoGenerate: true
};
-
config.monitor = {
opsInterval: 1000,
reporters: [{
@@ -29,15 +28,27 @@
reporter: require('good-file'),
events: { ops: '*' },
config: './test/fixtures/monitor_log'
- }, {
- reporter: 'good-http',
- events:... |
fa1c80fabddcf07bc6a81f581b36a3a26578fc02 | src/js/app/main.js | src/js/app/main.js | /**
* Load all the Views.
*/
require([
'models/user',
'controllers/home',
'outer'
], function (User, Home, Router) {
var users = [new User('Barney'),
new User('Cartman'),
new User('Sheldon')];
localStorage.users = JSON.stringify(users);
Home.start();
Router.startRouting();
});
| /**
* Load all the Views.
*/
require([
'models/user',
'controllers/home',
'router'
], function (User, Home, Router) {
var users = [new User('Barney'),
new User('Cartman'),
new User('Sheldon')];
localStorage.users = JSON.stringify(users);
Home.start();
Router.startRouting();
});
| Rename router file part iii. | Rename router file part iii.
| JavaScript | mit | quantumtom/rainbow-dash,quantumtom/rainbow-dash,quantumtom/ash,quantumtom/ash | ---
+++
@@ -5,7 +5,7 @@
require([
'models/user',
'controllers/home',
- 'outer'
+ 'router'
], function (User, Home, Router) {
var users = [new User('Barney'), |
2b261f89e9820a4697e0a812defaec05385fad51 | test/spec/controllers/main.js | test/spec/controllers/main.js | 'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('quakeStatsApp'));
var MainCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
MainCtrl = $con... | 'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('quakeStatsApp'));
var MainCtrl,
scope,
mockStats = {
gamesStats: []
};
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
... | Make the first dummy test pass | Tests: Make the first dummy test pass
| JavaScript | mit | mbarzeev/quake-stats,mbarzeev/quake-stats | ---
+++
@@ -6,17 +6,22 @@
beforeEach(module('quakeStatsApp'));
var MainCtrl,
- scope;
+ scope,
+ mockStats = {
+ gamesStats: []
+ };
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
MainCtrl = $co... |
d111e99ba98e357e1f13eb8b8e83da5e188b9d0a | lib/readTemplate.js | lib/readTemplate.js | 'use strict';
const fs = require('fs');
const Promise = require('bluebird');
const readFile = Promise.promisify(fs.readFile, { context: fs });
const cache = require('./cache');
module.exports = readTemplate;
function readTemplate(path, callback) {
const cacheKey = `template.${path}`;
if (process.env.NODE_ENV... | 'use strict';
const fs = require('fs');
const Promise = require('bluebird');
const readFile = Promise.promisify(fs.readFile, { context: fs });
const cache = require('./cache');
module.exports = readTemplate;
function readTemplate(path, callback) {
const cacheKey = `template.${path}`;
return cache.get(cacheKey... | Revert "only cache templates in production" | Revert "only cache templates in production"
This reverts commit 4e2bf7d48d60bba8b4d4497786e4db0ab8f81bef.
| JavaScript | apache-2.0 | carsdotcom/windshieldjs,carsdotcom/windshieldjs | ---
+++
@@ -8,18 +8,11 @@
function readTemplate(path, callback) {
const cacheKey = `template.${path}`;
-
- if (process.env.NODE_ENV === 'production') {
- return cache.get(cacheKey)
- .catch((err) => {
- return readFile(path)
- .then((buf) => buf.toString(... |
62624f36608eb495e18050fdff395b39bd69fd22 | app/assets/javascripts/spree/checkout/payment/adyen_encrypted_credit_card.js | app/assets/javascripts/spree/checkout/payment/adyen_encrypted_credit_card.js | Spree.createEncryptedAdyenForm = function(paymentMethodId) {
document.addEventListener("DOMContentLoaded", function() {
var checkout_form = document.getElementById("checkout_form_payment")
// See adyen.encrypt.simple.html for details on the options to use
var options = {
name: "payment_source[" +... | Spree.createEncryptedAdyenForm = function(paymentMethodId) {
document.addEventListener("DOMContentLoaded", function() {
var checkout_form = document.getElementById("checkout_form_payment")
// See adyen.encrypt.simple.html for details on the options to use
var options = {
name: "payment_source[" +... | Enable validations on CC form | Enable validations on CC form
| JavaScript | mit | freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen,StemboltHQ/solidus-adyen,freerunningtech/solidus-adyen | ---
+++
@@ -6,7 +6,7 @@
name: "payment_source[" + paymentMethodId + "][encrypted_credit_card_data]",
enableValidations : true,
// If there's other payment methods, they need to be able to submit
- submitButtonAlwaysEnabled: true,
+ submitButtonAlwaysEnabled: false,
disabledValidC... |
25ecb5e4f4bfeac33198913ec49bdb8b2412f462 | MovieFinder/src/main/webapp/public/src/controllers/nav-controller.js | MovieFinder/src/main/webapp/public/src/controllers/nav-controller.js | //
// nav-controller.js
// Contains the controller for the nav-bar.
//
(function () {
'use strict';
angular.module('movieFinder.controllers')
.controller('NavCtrl', function ($scope, $modal, user) {
var _this = this;
var signInModal;
this.error = {... | //
// nav-controller.js
// Contains the controller for the nav-bar.
//
(function () {
'use strict';
angular.module('movieFinder.controllers')
.controller('NavCtrl', function ($scope, $modal, user) {
var _this = this;
var signInModal;
this.error = {... | Reset error message when dialog re-opened. | Reset error message when dialog re-opened.
| JavaScript | mit | we4sz/DAT076,we4sz/DAT076 | ---
+++
@@ -17,6 +17,8 @@
};
this.showSignInModal = function () {
+ this.error.signIn = '';
+
signInModal = $modal({
scope: $scope,
template: 'partials/modals/sign-in.html'... |
633dd358d078e50503406f15f8b46b8ba9fce951 | src/modules/sound.js | src/modules/sound.js | let lastPachiIndex = -1
let lastCaptureIndex = -1
let captureSounds = Object.keys(new Int8Array(5)).map(x => new Audio(`./data/capture${x}.mp3`))
let pachiSounds = Object.keys(new Int8Array(5)).map(x => new Audio(`./data/${x}.mp3`))
let newGameSound = new Audio('./data/newgame.mp3')
let passSound = new Audio('./data/... | const helper = require('./helper')
let lastPachiIndex = -1
let lastCaptureIndex = -1
let captureSounds = [...Array(5)].map((_, i) => new Audio(`./data/capture${i}.mp3`))
let pachiSounds = [...Array(5)].map((_, i) => new Audio(`./data/${i}.mp3`))
let newGameSound = new Audio('./data/newgame.mp3')
let passSound = new ... | Fix weird error messages about play() and pause() | Fix weird error messages about play() and pause()
| JavaScript | mit | yishn/Sabaki,yishn/Goban,yishn/Goban,yishn/Sabaki | ---
+++
@@ -1,8 +1,10 @@
+const helper = require('./helper')
+
let lastPachiIndex = -1
let lastCaptureIndex = -1
-let captureSounds = Object.keys(new Int8Array(5)).map(x => new Audio(`./data/capture${x}.mp3`))
-let pachiSounds = Object.keys(new Int8Array(5)).map(x => new Audio(`./data/${x}.mp3`))
+let captureSoun... |
c1a1f8f3ddf1485016c3d70c2ceca66be42608f3 | src/server.js | src/server.js | var express = require('express');
var app = express();
app.use('/game', express.static(__dirname + '/public'));
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Node app is up and running to serve static HTML content.');
}); | var express = require('express');
var app = express();
app.use('/app', express.static(__dirname + '/public'));
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Node app is up and running to serve static HTML content.');
}); | Fix that URL--we just have to update Kibana. | Fix that URL--we just have to update Kibana. | JavaScript | apache-2.0 | gameontext/gameon-webapp,gameontext/gameon-webapp,gameontext/gameon-webapp | ---
+++
@@ -1,7 +1,7 @@
var express = require('express');
var app = express();
-app.use('/game', express.static(__dirname + '/public'));
+app.use('/app', express.static(__dirname + '/public'));
var server = app.listen(3000, function () {
var host = server.address().address; |
87407f3dbd25b823d05f2f5b03475a7ecc391438 | lib/geoloc.js | lib/geoloc.js | var geoip = require('geoip');
function Point(latitude, longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
module.exports = {
/*
* Returns geoloc Point from the requester's ip adress
* @throws Exception
*/
getPointfromIp: function(ip, geoliteConfig) {
var latitu... | var geoip = require('geoip');
function Point(latitude, longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
module.exports = {
/*
* Returns geoloc Point from the requester's ip adress
* @throws Exception
*/
getPointfromIp: function(ip, geolitePath) {
var latitude... | Change getPointFromIp & getCityFromIp methods signature | Change getPointFromIp & getCityFromIp methods signature | JavaScript | mit | Jumplead/GeonamesServer,Jumplead/GeonamesServer,xjewer/GeonamesServer,xjewer/GeonamesServer,xjewer/GeonamesServer,Jumplead/GeonamesServer,Jumplead/GeonamesServer | ---
+++
@@ -10,10 +10,10 @@
* Returns geoloc Point from the requester's ip adress
* @throws Exception
*/
- getPointfromIp: function(ip, geoliteConfig) {
+ getPointfromIp: function(ip, geolitePath) {
var latitude, longitude;
- var city = new geoip.City(geoliteConfig.geolitepat... |
152c0faec45c4b754b3496a37de0884df11eb5bb | isProduction.js | isProduction.js | if (process && process.env && process.env.NODE_ENV === 'production') {
console.warn([
'You are running Mimic in production mode,',
'in most cases you only want to run Mimic in development environments.\r\n',
'For more information on how to load Mimic in development environments only please see:',
'https://git... | if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'production') {
console.warn([
'You are running Mimic in production mode,',
'in most cases you only want to run Mimic in development environments.\r\n',
'For more information on how to load Mimic in development environments only pleas... | Fix a bug where checking process.env.NODE_ENV was not safe enough | fix(bootstrapping): Fix a bug where checking process.env.NODE_ENV was not safe enough
the check for process variable existence threw an error in some build systems which do not take care
of the process global variable such as angular cli.
| JavaScript | mit | 500tech/bdsm,500tech/mimic,500tech/mimic,500tech/bdsm | ---
+++
@@ -1,4 +1,4 @@
-if (process && process.env && process.env.NODE_ENV === 'production') {
+if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'production') {
console.warn([
'You are running Mimic in production mode,',
'in most cases you only want to run Mimic in development e... |
7a2e50e7634ead72e8301fb99da246f20e92c961 | libs/connections.js | libs/connections.js | //Get required modules
var Connection = require( 'ssh2' );
var domain = require( 'domain' );
//Add my libs
var handlers = require( './handlers.js' );
//Auxiliary function to initialize/re-initialize ssh connection
function initializeConnection() {
//Initialize the ssh connection
connection = new Connect... | //Get required modules
var Connection = require( 'ssh2' );
var domain = require( 'domain' );
//Auxiliary function to initialize/re-initialize ssh connection
function initializeConnection() {
//Add my libs
var handlers = require( './handlers.js' );
//Initialize the ssh connection
connection = new... | Fix module require chicken-egg problem | Fix module require chicken-egg problem
| JavaScript | mit | ctimoteo/syncmaster | ---
+++
@@ -2,11 +2,11 @@
var Connection = require( 'ssh2' );
var domain = require( 'domain' );
-//Add my libs
-var handlers = require( './handlers.js' );
-
//Auxiliary function to initialize/re-initialize ssh connection
function initializeConnection() {
+ //Add my libs
+ var handlers = require( './... |
9bbcea12f0db82cf583d9fcc42998b2b79ef4372 | lib/parser.js | lib/parser.js | 'use babel';
export default class Parser {
source: null
editor: null
parse(source, editor) {
this.source = source;
this.editor = editor;
return this.scan();
}
scan() {
let result = [], count = 0;
// Find 'describes', set indexs, find 'it'
this.findInstanceOf('describe(\'', result,... | 'use babel';
export default class Parser {
source: null
editor: null
parse(source, editor) {
this.source = source;
this.editor = editor;
return this.scan();
}
scan() {
let result = [], count = 0;
// Find 'describes', set indexs, find 'it'
this.findInstanceOf('describe(\'', result,... | Expand the tree view by defualt | Expand the tree view by defualt
| JavaScript | mit | chiragchoudhary66/test-list-maker | ---
+++
@@ -31,7 +31,7 @@
if (index == -1 || index > endIndex) break;
name = this.source.substring(index + wordLength, this.source.indexOf('\'', index + wordLength + 1));
position = this.editor.buffer.positionForCharacterIndex(index);
- result.push({index, name, position});
+ result.pus... |
9413f0cb3b4bd6545d29e79e9b656469b209a417 | jquery.linkem.js | jquery.linkem.js | // jquery.linkem.js
// Copyright Michael Hanson
// https://github.com/mybuddymichael/jquery-linkem
(function( $ ) {
$.fn.linkem = function() {
var linked = this;
this.on( "keydown keyup mousedown mouseup", function() {
linked.text( $(this).val() );
});
};
return this;
})( jQuery );
| // jquery.linkem.js
// Copyright Michael Hanson
// https://github.com/mybuddymichael/jquery-linkem
(function( $ ) {
$.fn.linkem = function() {
var linked = this;
this.on( "input change", function() {
linked.text( $(this).val() );
});
};
return this;
})( jQuery );
| Change events to "input" and "change" | Change events to "input" and "change"
| JavaScript | mit | mybuddymichael/jquery-linkem | ---
+++
@@ -6,7 +6,7 @@
$.fn.linkem = function() {
var linked = this;
- this.on( "keydown keyup mousedown mouseup", function() {
+ this.on( "input change", function() {
linked.text( $(this).val() );
});
}; |
47b311db68aa5343f66e3f5a5fd77602bd3e2e9e | server/models/products.js | server/models/products.js | // npm dependencies
const mongoose = require('mongoose');
// defines Product model
// contains 3 fields (title, description, and price)
let Product = mongoose.model('Product', {
title: {
type: String,
required: true,
minlength: 5,
trim: true
},
description: {
type: String,
required: true,... | // npm dependencies
const mongoose = require('mongoose');
// defines Product model
// contains 3 fields (title, description, and price)
let Product = mongoose.model('Product', {
title: {
type: String,
required: true,
minlength: 5,
trim: true
},
description: {
type: String,
minlength: 10,
... | Remove 'required' validation from 'description' field | Remove 'required' validation from 'description' field
| JavaScript | mit | dshaps10/full-stack-demo-site,dshaps10/full-stack-demo-site | ---
+++
@@ -12,7 +12,6 @@
},
description: {
type: String,
- required: true,
minlength: 10,
trim: true
}, |
8e54f1bd3f215ada478b6fb41644bcb777b29ab2 | js/app/viewer.js | js/app/viewer.js | /*jslint browser: true, white: true, plusplus: true */
/*global angular, console, alert*/
(function () {
'use strict';
var app = angular.module('status', ['ui.bootstrap', 'chieffancypants.loadingBar', 'tableSort']);
app.controller("StatusController", function($scope, $http) {
$scope.serverName = app.server... | /*jslint browser: true, white: true, plusplus: true */
/*global angular, console, alert*/
(function () {
'use strict';
var app = angular.module('status', ['ui.bootstrap', 'chieffancypants.loadingBar', 'tableSort']);
app.controller("StatusController", function($scope, $http) {
$scope.serverName = app.server... | Update console log error text | Update console log error text
| JavaScript | agpl-3.0 | ShinDarth/TC-Ticket-Web-Viewer,ShinDarth/TC-Ticket-Web-Viewer | ---
+++
@@ -23,7 +23,7 @@
})
.error(function(data, status, header, config) {
$scope.apiLoaded = false;
- console.log("Error while retrieving tickets, API request failed: " + app.api + "search/tickets?closedBy=0");
+ console.log("Error while retrieving tickets, API request failed: " + app.... |
e8b81efc0799f24d099ac7073da35a4ece27d615 | desktop/webpack.main.config.js | desktop/webpack.main.config.js | const plugins = require('./webpack.plugins')
const webpack = require('webpack')
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
plugins: [
...plugins,
new webpack.DefinePlugin({
'pr... | const plugins = require('./webpack.plugins')
const webpack = require('webpack')
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
plugins: [
...plugins,
new webpack.DefinePlugin({
'pr... | Fix resolution of native Node modules | chore(Desktop): Fix resolution of native Node modules
See https://github.com/electron-userland/electron-forge/pull/2449
| JavaScript | apache-2.0 | stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila,stencila/stencila | ---
+++
@@ -20,11 +20,10 @@
module: {
rules: [
// Add support for native node modules
- // TODO: Investigate. Seems to cause issues, and things seem to work without this loader
- // {
- // test: /\.node$/,
- // use: 'node-loader',
- // },
+ {
+ test: /native_mod... |
a966513e6677626454f550bd81cd50efce79c86f | src/unix_stream.js | src/unix_stream.js | var util = require('util');
var Socket = require('net').Socket;
/* Make sure we choose the correct build directory */
var directory = process.config.default_configuration === 'Debug' ? 'Debug' : 'Release';
var bindings = require(__dirname + '/../build/' + directory + '/unix_stream.node');
var SOCK_STREAM = bindings.... | var util = require('util');
var Socket = require('net').Socket;
/* Make sure we choose the correct build directory */
var directory = process.config.target_defaults.default_configuration === 'Debug' ? 'Debug' : 'Release';
var bindings = require(__dirname + '/../build/' + directory + '/unix_stream.node');
var SOCK_STR... | Use the correct process.config variable | Use the correct process.config variable
| JavaScript | isc | santigimeno/node-unix-stream,santigimeno/node-unix-stream,santigimeno/node-unix-stream | ---
+++
@@ -2,7 +2,7 @@
var Socket = require('net').Socket;
/* Make sure we choose the correct build directory */
-var directory = process.config.default_configuration === 'Debug' ? 'Debug' : 'Release';
+var directory = process.config.target_defaults.default_configuration === 'Debug' ? 'Debug' : 'Release';
var b... |
74386ac41257a7ea865aefd09631ff87815c23a5 | src/components/App/index.js | src/components/App/index.js | import React, { Component } from 'react';
/* global styles for app */
import './styles/app.scss';
/* application components */
import { Header } from '../../components/Header';
import { Footer } from '../../components/Footer';
export class App extends Component {
static propTypes = {
children: React.PropTypes.... | import React, { Component } from 'react';
/* global styles for app */
import './styles/app.scss';
/* application components */
import { Header } from '../../components/Header';
import { Footer } from '../../components/Footer';
export class App extends Component {
static propTypes = {
children: React.PropTypes.... | Change markup so that main el is outside of container, can take a full width bg color | Change markup so that main el is outside of container, can take a full width bg color
| JavaScript | mit | dramich/Chatson,badT/twitchBot,badT/Chatson,badT/twitchBot,dramich/Chatson,dramich/twitchBot,TerryCapan/twitchBot,TerryCapan/twitchBot,dramich/twitchBot,badT/Chatson | ---
+++
@@ -16,8 +16,10 @@
return (
<section>
<Header />
- <main className="container">
- {this.props.children}
+ <main>
+ <div className="container">
+ {this.props.children}
+ </div>
</main>
<Footer />
</sec... |
ada006bbcee7e855f9ee44acbd777928a0c58d1b | addon/initializers/mutation-observer.js | addon/initializers/mutation-observer.js | /**
* Simple initializer that implements the mutationObserverMixin
* in all the Components. It uses a flag defined in the app
* environment for it.
*/
import Ember from 'ember';
import mutationObserver from '../mixins/mutation-observer';
export function initialize(app) {
const config = app.lookupFactory ?
... | /**
* Simple initializer that implements the mutationObserverMixin
* in all the Components. It uses a flag defined in the app
* environment for it.
*/
import Ember from 'ember';
import mutationObserver from '../mixins/mutation-observer';
export function initialize(app) {
let config;
try {
// Ember 2.15+... | Fix initializer for Ember 2.15+ | Fix initializer for Ember 2.15+
| JavaScript | mit | zzarcon/ember-cli-Mutation-Observer,zzarcon/ember-cli-Mutation-Observer | ---
+++
@@ -8,10 +8,17 @@
import mutationObserver from '../mixins/mutation-observer';
export function initialize(app) {
- const config = app.lookupFactory ?
- app.lookupFactory('config:environment') :
- app.__container__.lookupFactory('config:environment');
-
+ let config;
+ try {
+ // Ember 2.15+
... |
1f13a1254fbf5303a58bf75b14b160e11d7dd30e | src/components/Lotteries.js | src/components/Lotteries.js | /**
* Created by mgab on 14/05/2017.
*/
import React,{ Component } from 'react'
import Title from './common/styled-components/Title'
import Lottery from './Lottery'
export default class Lotteries extends Component {
render() {
const lotteries = []
this.props.lotteriesData.forEach((entry) => {
lo... | /**
* Created by mgab on 14/05/2017.
*/
import React,{ Component } from 'react'
import Title from './common/styled-components/Title'
import Lottery from './Lottery'
export default class Lotteries extends Component {
render() {
const lotteries = []
if (this.props.lotteriesData) {
this.props.lotte... | Check for lotteries data before trying to process them. | Check for lotteries data before trying to process them.
| JavaScript | mit | mihailgaberov/lottoland-react-demo,mihailgaberov/lottoland-react-demo | ---
+++
@@ -13,12 +13,15 @@
const lotteries = []
- this.props.lotteriesData.forEach((entry) => {
- lotteries.push(<Lottery name={entry.id}
- jackpot={entry.jackpots[0].jackpot}
- drawingDate={entry.drawingDate}
- k... |
28c89588650841686f1c0c515360686a5ac0afd8 | src/middleware/authenticate.js | src/middleware/authenticate.js | import handleAdapter from '../handleAdapter'
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var verifyHeader = ( !! config.header)
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${toke... | import handleAdapter from '../handleAdapter'
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLength}})$`)
return (req, res, next) ... | Fix header not being validated if 'auth.header' option is not given. | Fix header not being validated if 'auth.header' option is not given.
In authenticate middleware.
| JavaScript | mit | kukua/concava | ---
+++
@@ -3,7 +3,6 @@
export default (config) => {
if ( ! config.enabled) return (req, res, next) => { next() }
- var verifyHeader = ( !! config.header)
var header = (config.header || 'Authorization').toLowerCase()
var tokenLength = 32
var tokenRegExp = new RegExp(`^Token ([a-zA-Z0-9]{${tokenLength}})$`)... |
fc9bdc4a183ea90c596603bdc5cdc62e2902c1ce | lib/Subheader.js | lib/Subheader.js | import { getColor } from './helpers';
import { StyleSheet, View, Text } from 'react-native';
import { TYPO, THEME_NAME } from './config';
import React, { Component, PropTypes } from 'react';
const styles = StyleSheet.create({
container: {
padding: 16
},
text: TYPO.paperFontBody1
});
export default... | import { getColor } from './helpers';
import { StyleSheet, View, Text } from 'react-native';
import { TYPO, THEME_NAME } from './config';
import React, { Component, PropTypes } from 'react';
const styles = StyleSheet.create({
container: {
padding: 16
},
text: TYPO.paperFontBody1
});
export default... | Add ability to set state of subheader | Add ability to set state of subheader
| JavaScript | mit | xotahal/react-native-material-ui,mobileDevNativeCross/react-native-material-ui,xvonabur/react-native-material-ui,blovato/sca-mobile-components,ajaxangular/react-native-material-ui,kenma9123/react-native-material-ui | ---
+++
@@ -17,7 +17,8 @@
color: PropTypes.string,
inset: PropTypes.bool,
theme: PropTypes.oneOf(THEME_NAME),
- lines: PropTypes.number
+ lines: PropTypes.number,
+ style: PropTypes.object,
};
static defaultProps = {
@@ -28,13 +29,13 @@
};
render... |
edbcdb75813fdd8149c147f0c7dc5138e06307e6 | test/unit/history/setLimit.test.js | test/unit/history/setLimit.test.js | import History from '../../../src/history'
describe('History::setLimit', function() {
const action = n => n
it('sets the correct size given Infinity', function() {
const history = new History()
history.setLimit(Infinity)
expect(history.limit).toEqual(Infinity)
})
it('sets the correct size given ... | import History from '../../../src/history'
describe('History::setLimit', function() {
it('sets the correct size given Infinity', function() {
const history = new History()
history.setLimit(Infinity)
expect(history.limit).toEqual(Infinity)
})
it('sets the correct size given an integer', function() {... | Remove unused variable that caused linter warning | Remove unused variable that caused linter warning
| JavaScript | mit | vigetlabs/microcosm,vigetlabs/microcosm,vigetlabs/microcosm | ---
+++
@@ -1,8 +1,6 @@
import History from '../../../src/history'
describe('History::setLimit', function() {
- const action = n => n
-
it('sets the correct size given Infinity', function() {
const history = new History()
history.setLimit(Infinity) |
2990ed3071a0969145e0a76beae6ad057e6e14f9 | subsystem/click.js | subsystem/click.js | phoxy._ClickHook =
{
_: {},
};
phoxy._ClickHook._.click =
{
InitClickHook: function()
{
document.querySelector('body').addEventListener('click', function(event)
{
var target = event.target;
while (true)
{
if (target === null)
return;
if (targe... | phoxy._ClickHook =
{
_: {},
};
phoxy._ClickHook._.click =
{
InitClickHook: function()
{
document.querySelector('body').addEventListener('click', function(event)
{
var target = event.target;
while (true)
{
if (target === null)
return;
if (targe... | Fix empty history issue, when we never could go back | Fix empty history issue, when we never could go back
| JavaScript | apache-2.0 | phoxy/phoxy,phoxy/phoxy | ---
+++
@@ -41,7 +41,10 @@
if (url[0] === '/')
url = url.substring(1);
- phoxy.MenuCall(url);
+ if (not_push)
+ phoxy.ApiRequest(url);
+ else
+ phoxy.MenuCall(url);
return false;
}
, |
675134d0bb49567fade2501538dc088b21cdab64 | StructureMaintainer.js | StructureMaintainer.js | module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
var newCandidates = [],
links = [],
spawns = [];
Object.keys(Game.structures).forEach(function(structureId) {
structure = Game.structures[structureId];
if(structure.hits < (structure.... | module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
var structures = Object.keys(Game.rooms).forEach(function (roomName) {
Game.rooms[roomName].find(FIND_STRUCTURES, {
filter: function (structure) {
return (structure.my === true || st... | Make it so that the Structure Maintainer includes roads as well. | Make it so that the Structure Maintainer includes roads as well.
| JavaScript | mit | pmaidens/screeps,pmaidens/screeps | ---
+++
@@ -1,10 +1,18 @@
module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
+
+ var structures = Object.keys(Game.rooms).forEach(function (roomName) {
+ Game.rooms[roomName].find(FIND_STRUCTURES, {
+ filter: function (structure) {
+ ... |
e29974b1adcb91af1a65ac474fcb36d7a0e24098 | test/17_image/definitions.js | test/17_image/definitions.js | define(function () {
return [
{
"default": {
name: "TestForm",
label: "TestForm",
_elements: [
{
"default": {
name: "Name",
type: "text",
label: "Name"
}
},
{
"default": {
... | define(function () {
return [
{
"default": {
name: "TestForm",
label: "TestForm",
_elements: [
{
"default": {
name: "Name",
type: "text",
label: "Name"
}
},
{
"default": {
... | Update form definition in tests to demonstrate functionality | Update form definition in tests to demonstrate functionality
| JavaScript | bsd-3-clause | blinkmobile/forms,blinkmobile/forms | ---
+++
@@ -17,7 +17,8 @@
name: "Photo",
type: "file",
label: "Photo",
- accept: "image/*"
+ accept: "image/*",
+ capture: true
}
},
{
@@ -25,7 +26,8 @@
name: "Photo1",
... |
7bfa2357a3764c9979d078a459759bcfd94f8e46 | blueprints/telling-stories/index.js | blueprints/telling-stories/index.js | /*jshint node:true*/
var existsSync = require('exists-sync');
module.exports = {
description: 'Install telling-stories dependencies',
normalizeEntityName: function() {},
afterInstall: function() {
// Register shutdown animation to the end of every acceptance test
if (existsSync('tests/helpers/module-f... | /*jshint node:true*/
var existsSync = require('exists-sync');
module.exports = {
description: 'Install telling-stories dependencies',
normalizeEntityName: function() {},
afterInstall: function() {
// Register shutdown animation to the end of every acceptance test
if (existsSync('tests/helpers/module-f... | Update bluprint to install latest telling-stories-dashboard | Update bluprint to install latest telling-stories-dashboard
| JavaScript | mit | mvdwg/telling-stories,mvdwg/telling-stories | ---
+++
@@ -18,7 +18,7 @@
return this.addAddonsToProject({
packages: [
{ name: 'ember-cli-page-object', version: '^1.6.0' },
- { name: 'telling-stories-dashboard', version: '1.0.0-alpha.2' }
+ { name: 'telling-stories-dashboard', version: '1.0.0-alpha.3' }
]
});
} |
819345213938c7b6df4eaeb2dac2c39b2078e1d0 | public/javascripts/app/views/gameController.js | public/javascripts/app/views/gameController.js | define([
'Backbone',
//Collection
'app/collections/games'
], function(
Backbone,
Games
){
var GameController = Backbone.View.extend({
events: {
'keyup .js-create-game' : 'create'
},
initialize: function(){
this.collection = new Games(this.options.projectId);
this.colle... | define([
'Backbone',
//Collection
'app/collections/games',
//Template
'text!templates/project-page/gameTemplate.html',
], function(
Backbone,
//Collection
Games,
//Template
gameTemplate
){
var GameController = Backbone.View.extend({
template: _.template(gameTemplate),
events: {
... | Add game logic on game controller | front-end: Add game logic on game controller
| JavaScript | mit | tangosource/pokerestimate,tangosource/pokerestimate | ---
+++
@@ -3,17 +3,24 @@
'Backbone',
//Collection
- 'app/collections/games'
+ 'app/collections/games',
+ //Template
+ 'text!templates/project-page/gameTemplate.html',
], function(
Backbone,
- Games
+ //Collection
+ Games,
+ //Template
+ gameTemplate
){
var GameController = Backbone... |
56c2e6b543e51ec44a5bcb133ef9511c50d0f4ff | ui/src/shared/middleware/errors.js | ui/src/shared/middleware/errors.js | // import {replace} from 'react-router-redux'
import {authExpired} from 'shared/actions/auth'
import {publishNotification as notify} from 'shared/actions/notifications'
import {HTTP_FORBIDDEN} from 'shared/constants'
const notificationsBlackoutDuration = 5000
let allowNotifications = true // eslint-disable-line
cons... | import {authExpired} from 'shared/actions/auth'
import {publishNotification as notify} from 'shared/actions/notifications'
import {HTTP_FORBIDDEN} from 'shared/constants'
const actionsAllowedDuringBlackout = ['@@', 'AUTH_', 'ME_', 'NOTIFICATION_', 'ERROR_']
const notificationsBlackoutDuration = 5000
let allowNotifica... | Refactor error middleware to suppress redux actions after auth expires and always show correct logout reason error notification | Refactor error middleware to suppress redux actions after auth expires and always show correct logout reason error notification
| JavaScript | mit | mark-rushakoff/influxdb,influxdb/influxdb,li-ang/influxdb,mark-rushakoff/influxdb,influxdata/influxdb,influxdb/influxdb,influxdb/influxdb,nooproblem/influxdb,mark-rushakoff/influxdb,influxdb/influxdb,mark-rushakoff/influxdb,li-ang/influxdb,influxdb/influxdb,nooproblem/influxdb,nooproblem/influxdb,influxdata/influxdb,ma... | ---
+++
@@ -1,23 +1,22 @@
-// import {replace} from 'react-router-redux'
import {authExpired} from 'shared/actions/auth'
import {publishNotification as notify} from 'shared/actions/notifications'
import {HTTP_FORBIDDEN} from 'shared/constants'
+const actionsAllowedDuringBlackout = ['@@', 'AUTH_', 'ME_', 'NOTIF... |
2825711cff4a32829bfa94afb00ec5168f524382 | webapp/src/ui/view/sidenav-view.js | webapp/src/ui/view/sidenav-view.js | const Backbone = require('backbone');
require('backbone.marionette');
const Repository = require('../../domain/repository');
const TeamItemViewTemplate = require('../template/team-item-view-template.hbs');
const Template = require('../template/sidenav-view-template.hbs');
const TeamItemView = Backbone.Marionette.View.... | const Backbone = require('backbone');
require('backbone.marionette');
const Repository = require('../../domain/repository');
const TeamItemViewTemplate = require('../template/team-item-view-template.hbs');
const Template = require('../template/sidenav-view-template.hbs');
const TeamItemView = Backbone.Marionette.View.... | Hide sidenav when selecting team | Hide sidenav when selecting team
| JavaScript | mit | hagifoo/gae-pomodoro,hagifoo/gae-pomodoro,hagifoo/gae-pomodoro | ---
+++
@@ -19,7 +19,8 @@
addTeamButton: '.btn.add-team'
},
events: {
- 'click @ui.addTeamButton': 'addTeam'
+ 'click @ui.addTeamButton': 'addTeam',
+ 'click .teams': 'closeSidenav'
},
regions: {
teams: '.teams'
@@ -38,5 +39,9 @@
addTeam: function() {
... |
00e9721fef7c4438a6fae92ace89fbd59397912d | public/app/services/searchService.js | public/app/services/searchService.js | (function () {
'use strict';
define(
[
'lodash',
'jquery'
],
function (_, $) {
return function (baseUrl, ajaxOptions, noCache, logErrors) {
var queryString;
queryString = function (parameters) {
ret... | (function () {
'use strict';
define(
[
'lodash',
'jquery'
],
function (_, $) {
return function (baseUrl, ajaxOptions, noCache, logErrors) {
var queryString;
queryString = function (parameters) {
ret... | Fix issue with brackets in generated queries. | Fix issue with brackets in generated queries.
| JavaScript | mit | rwahs/research-frontend,rwahs/research-frontend | ---
+++
@@ -11,12 +11,12 @@
var queryString;
queryString = function (parameters) {
- return '(' + _.map(parameters.children, function (child) {
+ return _.map(parameters.children, function (child) {
return child.hasOwnP... |
82344afed3636343877719fa3aa03377ec6c4159 | app/assets/javascripts/student_signup.js | app/assets/javascripts/student_signup.js | var studentSignUp = function(timeslot_id){
var data = {};
data.subject = $("#subject-input").val();
$("#modal_remote").modal('hide');
$.ajax({
data: data,
type: "PATCH",
url: "/api/timeslots/" + timeslot_id,
beforeSend: customBlockUi(this)
}).done(function(){
swal({
... | var studentSignUp = function(timeslot_id){
var data = {};
data.subject = $("#subject-input").val();
$("#modal_remote").modal('hide');
$.ajax({
data: data,
type: "PATCH",
url: "/api/timeslots/" + timeslot_id,
beforeSend: customBlockUi(this)
}).done(function(){
swal({
... | Add timer and remove confirm buttonk, overall cleanup for better ux | Add timer and remove confirm buttonk, overall cleanup for better ux
| JavaScript | mit | theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board | ---
+++
@@ -11,7 +11,10 @@
swal({
title: "Great!",
text: "You have scheduled a tutoring session!",
- confirmButtonColor: "#66BB6A",
+ confirmButtonColor: "#FFFFFF",
+ showConfirmButton: false,
+ allowOutsideClick: true,
+ ... |
49dfd4fea21ee7868a741c770db551c6e3bcdf5b | commonjs/frontend-core.js | commonjs/frontend-core.js | var _ = require('underscore');
_.extend(Array.prototype, {
//deprecated! -> forEach (ist auch ein JS-Standard!)
each: function(fn, scope) {
_.each(this, fn, scope);
},
//to use array.forEach directly
forEach: function(fn, scope) {
_.forEach(this, fn, scope);
}
});
if (typeof A... | var _ = require('underscore');
if (typeof Array.prototype.forEach != 'function') {
Array.prototype.forEach = function (fn, scope) {
_.forEach(this, fn, scope);
};
}
//source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
... | Revert "Revert "set only forEach globally for Array.prototyp if not exists (ie8 fallback)"" | Revert "Revert "set only forEach globally for Array.prototyp if not exists (ie8 fallback)""
This reverts commit 86586d27805750e77dd598669d12336be35c4d51.
| JavaScript | bsd-2-clause | kaufmo/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework,kaufmo/koala-framework,koala-framework/koala-framework | ---
+++
@@ -1,30 +1,8 @@
var _ = require('underscore');
-_.extend(Array.prototype, {
- //deprecated! -> forEach (ist auch ein JS-Standard!)
- each: function(fn, scope) {
- _.each(this, fn, scope);
- },
-
- //to use array.forEach directly
- forEach: function(fn, scope) {
+if (typeof Array.prot... |
dfd8429c117fa2bf0af2a336807d40296b68ab84 | frontend/src/shogi/pieces/nullPiece.js | frontend/src/shogi/pieces/nullPiece.js | import Base from './base';
import * as CONST from '../constants/pieceTypes';
export default class NullPiece extends Base {
constructor({ type, x, y, movable = false, isPlaced = false }) {
super({ type, x, y, movable, isPlaced });
this.type = CONST.USI_NULL_TYPE;
return this;
}
promote() {
retur... | import Base from './base';
import * as CONST from '../constants/pieceTypes';
export default class NullPiece extends Base {
constructor({ type, x, y, movable = false, isPlaced = false }) {
super({ type, x, y, movable, isPlaced });
this.type = CONST.USI_NULL_TYPE;
return this;
}
promote() {
retur... | Add `toOpponentPiece` method for NullPiece | Add `toOpponentPiece` method for NullPiece
* return undefined. because NullPiece can't captured.
| JavaScript | mit | mgi166/usi-front,mgi166/usi-front | ---
+++
@@ -20,6 +20,9 @@
return true;
}
+ toOpponentPiece() {
+ }
+
moveDef() {
}
} |
eb05d0a5b3b2fd16b1056d23118f1bfc093cb00f | GruntFile.js | GruntFile.js | module.exports = function(grunt) {
grunt.config.init({
pkg: grunt.file.readJSON('package.json')
});
grunt.loadNpmTasks('grunt-eslint');
grunt.config('eslint', {
dist: {
options: {
configFile: '.eslintrc',
},
src: ['touchtap-event.js']
}
});
grunt.loadNpmTasks('grunt-... | module.exports = function(grunt) {
grunt.config.init({
pkg: grunt.file.readJSON('package.json')
});
grunt.loadNpmTasks('grunt-eslint');
grunt.config('eslint', {
dist: {
options: {
configFile: '.eslintrc',
},
src: ['touchtap-event.js']
}
});
grunt.loadNpmTasks('grunt-... | Move eslint in to test grunt task | Move eslint in to test grunt task
| JavaScript | mit | Tyriar/touchtap-event,Tyriar/touchtap-event | ---
+++
@@ -25,11 +25,11 @@
});
grunt.registerTask('test', [
+ 'eslint',
'jasmine:test',
]);
grunt.registerTask('default', [
- 'eslint',
'test'
]);
}; |
66deb115264bfccba20ce5daac9ee252febd245d | test/index.js | test/index.js | var PI = require("../lib");
// Two decimals
console.log(PI(3));
console.log(PI(16));
// 100 decimals
console.log(PI(100));
| var PI = require("../lib");
// Two decimals
console.log("3." + PI(3));
console.log("3." + PI(16));
// 100 decimals
console.log("3." + PI(1000));
| Prepend "3." since the function returns the decimals. | Prepend "3." since the function returns the decimals.
| JavaScript | mit | IonicaBizau/pi-number | ---
+++
@@ -1,8 +1,8 @@
var PI = require("../lib");
// Two decimals
-console.log(PI(3));
-console.log(PI(16));
+console.log("3." + PI(3));
+console.log("3." + PI(16));
// 100 decimals
-console.log(PI(100));
+console.log("3." + PI(1000)); |
5af9b4617fd2f0fc3e613d6695ec876814deb793 | test/setup.js | test/setup.js | /*!
* React Native Autolink
*
* Copyright 2016-2019 Josh Swan
* Released under the MIT license
* https://github.com/joshswan/react-native-autolink/blob/master/LICENSE
*/
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
Enzyme.configure({ adapter: new Adapter() });
require('react-nati... | /*!
* React Native Autolink
*
* Copyright 2016-2019 Josh Swan
* Released under the MIT license
* https://github.com/joshswan/react-native-autolink/blob/master/LICENSE
*/
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
Enzyme.configure({ adapter: new Adapter() });
require('react-nati... | Fix transpiling issue in tests | Fix transpiling issue in tests
| JavaScript | mit | joshswan/react-native-autolink,joshswan/react-native-autolink | ---
+++
@@ -12,3 +12,10 @@
Enzyme.configure({ adapter: new Adapter() });
require('react-native-mock-render/mock');
+require('@babel/register')({
+ only: [
+ 'src/**/*.js',
+ 'test/**/*.js',
+ 'node_modules/autolinker/dist/es2015/**/*.js',
+ ],
+}); |
5f328870bf71aecd4f6621263474b3feda9c0729 | src/hooks/usePageReducer.js | src/hooks/usePageReducer.js | import { useReducer, useCallback } from 'react';
import getReducer from '../pages/dataTableUtilities/reducer/getReducer';
import getColumns from '../pages/dataTableUtilities/columns';
import { debounce } from '../utilities/index';
/**
* useReducer wrapper for pages within the app. Creaates a
* composed reducer throu... | import { useReducer, useCallback } from 'react';
import getReducer from '../pages/dataTableUtilities/reducer/getReducer';
import getColumns from '../pages/dataTableUtilities/columns';
import { debounce } from '../utilities/index';
/**
* useReducer wrapper for pages within the app. Creates a
* composed reducer throug... | Add update to useReducer comments | Add update to useReducer comments
Co-Authored-By: Chris Petty <637933a5c948ed3d23257417b9455449bf8cfd77@gmail.com> | JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | ---
+++
@@ -4,7 +4,7 @@
import { debounce } from '../utilities/index';
/**
- * useReducer wrapper for pages within the app. Creaates a
+ * useReducer wrapper for pages within the app. Creates a
* composed reducer through getReducer for a paraticular
* page as well as fetching the required columns and insertin... |
66768e0aae1eeb622d0a901ee376d3f4d108f765 | test/karma.config.js | test/karma.config.js | const serverEndpoints = require('./server')
module.exports = function(config) {
config.set({
basePath: '..',
frameworks: ['detectBrowsers', 'mocha', 'chai'],
detectBrowsers: {
preferHeadless: true,
usePhantomJS: false
},
client: {
mocha: {
ui: 'tdd'
}
},
fi... | const serverEndpoints = require('./server')
module.exports = function(config) {
config.set({
basePath: '..',
frameworks: ['detectBrowsers', 'mocha', 'chai'],
detectBrowsers: {
preferHeadless: true,
usePhantomJS: false,
postDetection: availableBrowsers =>
availableBrowsers.map(br... | Bring back `--no-sandbox` for Travis CI compatibility | Bring back `--no-sandbox` for Travis CI compatibility
| JavaScript | mit | github/fetch,aleclarson/fetch | ---
+++
@@ -6,7 +6,9 @@
frameworks: ['detectBrowsers', 'mocha', 'chai'],
detectBrowsers: {
preferHeadless: true,
- usePhantomJS: false
+ usePhantomJS: false,
+ postDetection: availableBrowsers =>
+ availableBrowsers.map(browser => (browser.startsWith('Chrom') ? `${browser}NoSand... |
386fbab3484a3bec5c2dcb538825c17979c0233e | lib/assets/javascripts/drop.js | lib/assets/javascripts/drop.js | //= require ./core
//= require ./config
//= require_self
//= require_tree ./routers
//= require_tree ./views
//= require_tree ./models
(function () {
var Drop = window.Drop;
_.extend(Drop, Marbles.Events, {
Models: {},
Collections: {},
Routers: {},
Helpers: {
fullPath: function (path) {
prefix = Dr... | //= require ./core
//= require ./config
//= require_self
//= require_tree ./routers
//= require_tree ./views
//= require_tree ./models
(function () {
var Drop = window.Drop;
_.extend(Drop, Marbles.Events, {
Views: {},
Models: {},
Collections: {},
Routers: {},
Helpers: {
fullPath: function (path) {
... | Add Drop.Views object to hold React components | Add Drop.Views object to hold React components
| JavaScript | bsd-3-clause | cupcake/files-web,cupcake/files-web | ---
+++
@@ -10,6 +10,7 @@
var Drop = window.Drop;
_.extend(Drop, Marbles.Events, {
+ Views: {},
Models: {},
Collections: {},
Routers: {}, |
74c191b2f5058ecff0755b44eb55f79953e13808 | blueprints/ember-sweetalert/index.js | blueprints/ember-sweetalert/index.js | module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {}
};
| module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {
return this.addBowerPackageToProject('sweetalert2', '^6.1.0');
}
};
| Add bower package to project | Add bower package to project
Believe this will fix issue #3, plus is desired behaviour anyway because you need the installing Ember project to have sweetalert2 installed via bower. | JavaScript | mit | Tonkpils/ember-sweetalert,Tonkpils/ember-sweetalert | ---
+++
@@ -1,5 +1,7 @@
module.exports = {
normalizeEntityName: function() {},
- afterInstall: function() {}
+ afterInstall: function() {
+ return this.addBowerPackageToProject('sweetalert2', '^6.1.0');
+ }
}; |
484d74160b829a5e75011c62224cbb149f0b236e | src/color/GradientStop.js | src/color/GradientStop.js | var GradientStop = Base.extend({
beans: true,
// TODO: support midPoint? (initial tests didn't look nice)
initialize: function(color, rampPoint) {
this.color = Color.read([color]);
this.rampPoint = rampPoint !== null ? rampPoint : 0;
},
getRampPoint: function() {
return this._rampPoint;
},
setRampPoin... | var GradientStop = Base.extend({
beans: true,
// TODO: support midPoint? (initial tests didn't look nice)
initialize: function(color, rampPoint) {
this._color = Color.read([color]);
this._rampPoint = rampPoint !== null ? rampPoint : 0;
},
getRampPoint: function() {
return this._rampPoint;
},
setRampPo... | Set private properties directly in initialize(), no need to call setters. | Set private properties directly in initialize(), no need to call setters.
| JavaScript | mit | EskenderDev/paper.js,baiyanghese/paper.js,li0t/paper.js,nancymark/paper.js,luisbrito/paper.js,iconexperience/paper.js,luisbrito/paper.js,fredoche/paper.js,JunaidPaul/paper.js,superjudge/paper.js,lehni/paper.js,ClaireRutkoske/paper.js,baiyanghese/paper.js,0/paper.js,ClaireRutkoske/paper.js,legendvijay/paper.js,superjudg... | ---
+++
@@ -3,8 +3,8 @@
// TODO: support midPoint? (initial tests didn't look nice)
initialize: function(color, rampPoint) {
- this.color = Color.read([color]);
- this.rampPoint = rampPoint !== null ? rampPoint : 0;
+ this._color = Color.read([color]);
+ this._rampPoint = rampPoint !== null ? rampPoint : 0;... |
1a55b57d10c44c0e036cf1a5d0ee35ab3b79a90e | lib/Helper/EventHandlerHelper.js | lib/Helper/EventHandlerHelper.js | "use babel";
import { Emitter } from 'atom'
export default class EventHandlerHelper
{
constructor()
{
this.emitter = new Emitter();
}
onClose(callback)
{
this.emitter.on("maperwiki-wordcount-close",callback);
}
close()
{
this.emitter.emit("maperwiki-wordcount-close");
}
onViewWordcoun... | "use babel";
import { Emitter } from 'atom'
export default class EventHandlerHelper
{
constructor()
{
this.emitter = new Emitter();
}
onClose(callback)
{
return this.emitter.on("maperwiki-wordcount-close",callback);
}
close()
{
this.emitter.emit("maperwiki-wordcount-close");
}
onViewW... | Patch for Event handler (second try) :) | Patch for Event handler (second try) :)
Real patch for event handler...
| JavaScript | mit | rkaradas/MaPerWiki,rkaradas/MaPerWiki | ---
+++
@@ -10,7 +10,7 @@
onClose(callback)
{
- this.emitter.on("maperwiki-wordcount-close",callback);
+ return this.emitter.on("maperwiki-wordcount-close",callback);
}
close()
{
@@ -19,7 +19,7 @@
onViewWordcountFrame(callback)
{
- this.emitter.on("maperwiki-wordcount-visibility",cal... |
48acd862586847ef3d9310c5be4467aa3481744f | docs/src/pages/Home/counterCode.js | docs/src/pages/Home/counterCode.js | export default `import { h, app } from "hyperapp"
app({
init: 0,
view: state =>
h("div", {}, [
h("h1", {}, state),
h("button", { onclick: state => state - 1 }, "subtract"),
h("button", { onclick: state => state + 1 }, "add")
]),
node: document.getElementById("app")
})`
| export default `import { h, app } from "hyperapp"
app({
init: 0,
view: state =>
h("div", {}, [
h("h1", {}, state),
h("button", { onclick: state => state - 1 }, "substract"),
h("button", { onclick: state => state + 1 }, "add")
]),
node: document.getElementById("app")
})`
| Fix typo in counter app | Fix typo in counter app | JavaScript | mit | jbucaran/hyperapp,hyperapp/hyperapp,hyperapp/hyperapp | ---
+++
@@ -5,7 +5,7 @@
view: state =>
h("div", {}, [
h("h1", {}, state),
- h("button", { onclick: state => state - 1 }, "subtract"),
+ h("button", { onclick: state => state - 1 }, "substract"),
h("button", { onclick: state => state + 1 }, "add")
]),
node: document.getElementBy... |
dd2b6eb07efe252559f82dde5eb5a6e084f0d859 | src/main/javascript/list.js | src/main/javascript/list.js | var Vue = require('vue');
var CommentService = require('./services/comment-service.js');
var template = require('./list.html');
new Vue({
el: '#platon-comment-thread',
render: template.render,
staticRenderFns: template.staticRenderFns,
data: {
loading: true,
comments: []
},
... | var Vue = require('vue');
var CommentService = require('./services/comment-service.js');
var template = require('./list.html');
new Vue({
el: '#platon-comment-thread',
render: template.render,
staticRenderFns: template.staticRenderFns,
data: {
loading: true,
comments: []
},
... | Use url path instead of full url for threads | Use url path instead of full url for threads
| JavaScript | apache-2.0 | pvorb/platon,pvorb/platon,pvorb/platon | ---
+++
@@ -27,7 +27,7 @@
created: function () {
var vm = this;
- CommentService.getComments(window.location.href)
+ CommentService.getComments(window.location.pathname)
.then(function updateModel(comments) {
vm.comments = comments;
vm.loadi... |
1c97af1dba133a014295c692135c2c194b500435 | example/src/app.js | example/src/app.js |
var App = Ember.Application.create();
App.Boards = ['common', 'intermediate', 'advanced'];
App.Host = "http://localhost:5984";
|
var App = Ember.Application.create();
App.Boards = ['common', 'intermediate', 'advanced'];
App.Host = "http://ember-couchdb-kit.roundscope.pw:15984";
| Revert "reverted change of couchdb host" | Revert "reverted change of couchdb host"
This reverts commit 6d60341ba077ef645c1f2f6dbf8a4030e07b2812.
| JavaScript | mit | Zatvobor/ember-couchdb-kit,ValidUSA/ember-couch,Zatvobor/ember-couchdb-kit,ValidUSA/ember-couch | ---
+++
@@ -3,4 +3,4 @@
App.Boards = ['common', 'intermediate', 'advanced'];
-App.Host = "http://localhost:5984";
+App.Host = "http://ember-couchdb-kit.roundscope.pw:15984"; |
48992018fc9bb6fa38bac553fe2132ce84a50a8a | server/Media/FileScanner/getFiles.js | server/Media/FileScanner/getFiles.js | const debug = require('debug')
const log = debug('app:media:fileScanner:getFiles')
const { promisify } = require('util')
const { resolve } = require('path')
const fs = require('fs')
const readdir = promisify(fs.readdir)
const stat = promisify(fs.stat)
async function getFiles (dir, extra) {
let list = []
try {
... | const { promisify } = require('util')
const { resolve } = require('path')
const fs = require('fs')
const readdir = promisify(fs.readdir)
const stat = promisify(fs.stat)
async function getFiles (dir, extra) {
const list = await readdir(dir)
const files = await Promise.all(list.map(async (item) => {
const file ... | Fix path offline detection (don't catch readdir() errors) | Fix path offline detection (don't catch readdir() errors)
| JavaScript | isc | bhj/karaoke-forever,bhj/karaoke-forever | ---
+++
@@ -1,5 +1,3 @@
-const debug = require('debug')
-const log = debug('app:media:fileScanner:getFiles')
const { promisify } = require('util')
const { resolve } = require('path')
const fs = require('fs')
@@ -7,13 +5,7 @@
const stat = promisify(fs.stat)
async function getFiles (dir, extra) {
- let list = [... |
0ef64c70248efaf7cd051d7d3d4db619cdae5589 | ember_debug/models/profile_node.js | ember_debug/models/profile_node.js | /**
A tree structure for assembling a list of render calls so they can be grouped and displayed nicely afterwards.
@class ProfileNode
**/
var ProfileNode = function(start, payload, parent) {
this.start = start;
this.timestamp = Date.now();
if (payload) {
if (payload.template) { this.name = payload.templa... | /**
A tree structure for assembling a list of render calls so they can be grouped and displayed nicely afterwards.
@class ProfileNode
**/
var ProfileNode = function(start, payload, parent) {
this.start = start;
this.timestamp = Date.now();
if (payload) {
if (payload.template) { this.name = payload.templa... | Clean up view name in render performance tree | Clean up view name in render performance tree
| JavaScript | mit | karthiick/ember-inspector,Patsy-issa/ember-inspector,jryans/ember-inspector,knownasilya/ember-inspector,chrisgame/ember-inspector,chrisgame/ember-inspector,jayphelps/ember-inspector,Patsy-issa/ember-inspector,jayphelps/ember-inspector,sly7-7/ember-inspector,teddyzeenny/ember-inspector,pete-the-pete/ember-inspector,embe... | ---
+++
@@ -9,8 +9,9 @@
if (payload) {
if (payload.template) { this.name = payload.template; }
if (payload.object) {
- this.name = payload.object.toString();
- var match = this.name.match(/:(ember\d+)>$/);
+ var name = payload.object.toString();
+ var match = name.match(/:(ember\d+)>$... |
99c293ce2bd0f0e5ac297d62b1b158a9b4208d5d | slurp/src/main/webapp/scripts/init-firebase.js | slurp/src/main/webapp/scripts/init-firebase.js | // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | Add initializaton of Cloud Firestore instance for use accross all scripts. | Add initializaton of Cloud Firestore instance for use accross all scripts.
| JavaScript | apache-2.0 | googleinterns/SLURP,googleinterns/SLURP,googleinterns/SLURP | ---
+++
@@ -27,3 +27,4 @@
};
firebase.initializeApp(firebaseConfig);
+const db = firebase.firestore(); |
1029d50240901af797ee62816b02afaafb9b5ec2 | src/editor/deposittool.js | src/editor/deposittool.js | import * as PIXI from 'pixi.js';
import PlaceTool from './placetool';
import {createLogDepositGraphics} from '../game/logdeposit';
export default class DepositTool extends PlaceTool {
constructor(stage, level) {
super(stage, level);
var pointerGraphics = createLogDepositGraphics();
this.pointerContainer... | import * as PIXI from 'pixi.js';
import PlaceTool from './placetool';
import {createLogDepositGraphics} from '../game/logdeposit';
export default class DepositTool extends PlaceTool {
constructor(stage, level) {
super(stage, level);
var pointerGraphics = createLogDepositGraphics();
this.pointerContainer... | Fix editor crashing when adding log deposit | Fix editor crashing when adding log deposit
| JavaScript | mit | gaviarctica/forestry-game-frontend,gaviarctica/forestry-game-frontend | ---
+++
@@ -12,7 +12,7 @@
this.minDistanceFromRoad = 70;
this.maxDistanceFromRoad = 50;
- this.type = -1;
+ this.type = undefined;
}
activate() { |
056be57007a61135c167b4474bca96b015e8b34b | cfg/.vim/templates/react-native/fire.js | cfg/.vim/templates/react-native/fire.js | 'use strict';
import React, { PropTypes, Component } from 'react';
import { InteractionManager } from 'react-native';
import SkeletonNameHOC from './skeleton-name.hoc.js';
export default class FierySkeletonName extends Component {
constructor(props) {
super(props);
}
static propTypes = {
db: PropTypes.... | 'use strict';
import React, { PropTypes, Component } from 'react';
import { InteractionManager } from 'react-native';
import SkeletonNameHOC from './skeleton-name.hoc.js';
export default class FierySkeletonName extends Component {
constructor(props) {
super(props);
}
static propTypes = {}
render() {
... | Remove db from props in template | Remove db from props in template
Now that I have a React Native project where I take db and friends from
context, I find that the automatic db in propTypes is a hassle to
delete, so I've removed it for now.
| JavaScript | mit | igemnace/vim-config,igemnace/my-vim-config,igemnace/vim-config,igemnace/vim-config | ---
+++
@@ -9,13 +9,7 @@
super(props);
}
- static propTypes = {
- db: PropTypes.object,
- }
-
- static defaultProps = {
- db: {},
- }
+ static propTypes = {}
render() {
return ( |
1e9c3b9c669c78e42fa9b6636ae72f5499b2175e | tests/directivesSpec.js | tests/directivesSpec.js | (function () {
'use strict';
describe('directives module', function () {
var $compile,
$rootScope,
DropletMock;
beforeEach(module('directives'));
beforeEach(inject(function ($injector) {
$compile = $injector.get('$compile');
$rootScope = $i... | (function () {
'use strict';
describe('directives module', function () {
var $compile,
$rootScope,
DropletMock;
beforeEach(module('directives'));
beforeEach(inject(function ($injector) {
$compile = $injector.get('$compile');
$rootScope = $i... | Add cpus directive unit test | Add cpus directive unit test
| JavaScript | mit | DojoGeekRA/DigitalOcean,DojoGeekRA/DigitalOcean | ---
+++
@@ -10,7 +10,8 @@
$rootScope = $injector.get('$rootScope');
DropletMock = {
'status': 'active',
- 'memory': '512'
+ 'memory': '512',
+ 'vcpus': 1
};
}));
describe('status', function () {
@@ -... |
756929079aaf1dbef8b869d917e0fc8a0f4f3a10 | examples/vue-apollo/nuxt.config.js | examples/vue-apollo/nuxt.config.js | module.exports = {
build: {
vendor: ['vue-apollo', 'apollo-client']
},
router: {
middleware: 'apollo'
},
plugins: [
// Will inject the plugin in the $root app and also in the context as `i18n`
{ src: '~plugins/apollo.js', injectAs: 'apolloProvider' }
]
}
| module.exports = {
build: {
vendor: ['vue-apollo', 'apollo-client']
},
router: {
middleware: 'apollo'
},
plugins: [
// Will inject the plugin in the $root app and also in the context as `apolloProvider`
{ src: '~plugins/apollo.js', injectAs: 'apolloProvider' }
]
}
| Fix copy paste typo in the comments | Fix copy paste typo in the comments | JavaScript | mit | jfroffice/nuxt.js,mgesmundo/nuxt.js,mgesmundo/nuxt.js,jfroffice/nuxt.js | ---
+++
@@ -6,7 +6,7 @@
middleware: 'apollo'
},
plugins: [
- // Will inject the plugin in the $root app and also in the context as `i18n`
+ // Will inject the plugin in the $root app and also in the context as `apolloProvider`
{ src: '~plugins/apollo.js', injectAs: 'apolloProvider' }
]
} |
239bc0fe0eeae2c309902e2b56dafbd2298cb3aa | app/services/logger.js | app/services/logger.js | import Ember from "ember";
import config from "../config/environment";
export default Ember.Service.extend({
session: Ember.inject.service(),
rollbar: Ember.inject.service(),
getReason(reason) {
return reason instanceof Error || typeof reason !== "object" ?
reason : JSON.stringify(reason);
},
... | import Ember from "ember";
import config from "../config/environment";
export default Ember.Service.extend({
session: Ember.inject.service(),
rollbar: Ember.inject.service(),
getReason(reason) {
return reason instanceof Error || typeof reason !== "object" ?
reason : JSON.stringify(reason);
},
... | Use currenUser instead of getting it from session | Use currenUser instead of getting it from session
| JavaScript | mit | crossroads/shared.goodcity,crossroads/shared.goodcity | ---
+++
@@ -16,9 +16,9 @@
}
console.info(reason);
if (config.environment === "production" || config.staging) {
- var userName = this.get("session.currentUser.fullName");
var currentUser = this.get("session.currentUser");
- var userId = this.get("session.currentUser.id");
+ var use... |
3689be16a26bd3f95eda6c57a4232952f6a87eca | ghost/admin/utils/codemirror-mobile.js | ghost/admin/utils/codemirror-mobile.js | /*global CodeMirror*/
import mobileUtils from 'ghost/utils/mobile-utils';
import createTouchEditor from 'ghost/assets/lib/touch-editor';
var setupMobileCodeMirror,
TouchEditor,
init;
setupMobileCodeMirror = function setupMobileCodeMirror() {
var noop = function () {},
key;
for (key in CodeMir... | /*global CodeMirror, device*/
import mobileUtils from 'ghost/utils/mobile-utils';
import createTouchEditor from 'ghost/assets/lib/touch-editor';
var setupMobileCodeMirror,
TouchEditor,
init;
setupMobileCodeMirror = function setupMobileCodeMirror() {
var noop = function () {},
key;
for (key in... | Use Device.js to determine mobile editor use | Use Device.js to determine mobile editor use
Ref #2570
- Adds new library, device.js to determine if the user is on an ios mobile
or tablet.
| JavaScript | mit | TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost | ---
+++
@@ -1,4 +1,4 @@
-/*global CodeMirror*/
+/*global CodeMirror, device*/
import mobileUtils from 'ghost/utils/mobile-utils';
import createTouchEditor from 'ghost/assets/lib/touch-editor';
@@ -24,7 +24,9 @@
};
init = function init() {
- if (mobileUtils.hasTouchScreen()) {
+ //Codemirror does not fun... |
b7491beeae4340a1d73d484c0b7671bb2f682edd | src/services/helpers/scopePermissions/ScopeMembersService.js | src/services/helpers/scopePermissions/ScopeMembersService.js | const auth = require('@feathersjs/authentication');
const globalHooks = require('../../../hooks');
const { ScopeService } = require('./ScopeService');
const { lookupScope, checkScopePermissions } = require('./hooks');
/**
* Implements retrieving a list of all users who are associated with a scope.
* @class ScopeMemb... | const auth = require('@feathersjs/authentication');
const globalHooks = require('../../../hooks');
const { ScopeService } = require('./ScopeService');
const { lookupScope, checkScopePermissions } = require('./hooks');
/**
* Implements retrieving a list of all users who are associated with a scope.
* @class ScopeMemb... | Check for permission only in external calls | Check for permission only in external calls
| JavaScript | agpl-3.0 | schul-cloud/schulcloud-server,schul-cloud/schulcloud-server,schul-cloud/schulcloud-server | ---
+++
@@ -22,7 +22,7 @@
all: [
globalHooks.ifNotLocal(auth.hooks.authenticate('jwt')),
lookupScope,
- checkScopePermissions(['SCOPE_PERMISSIONS_VIEW']),
+ globalHooks.ifNotLocal(checkScopePermissions(['SCOPE_PERMISSIONS_VIEW'])),
],
},
}; |
63b38bdb6b304d495ed17ae2defa1f7512491c5c | aritgeo/src/aritgeo.js | aritgeo/src/aritgeo.js | 'use strict'
module.exports = {
aritGeo: function(numlist) {
if (!Array.isArray(numlist)) {
return null;
}
if (numlist.length === 0) {
return 0;
}
if (numlist.length === 1 || numlist.length === 2) {
return -1;
}
}
} | 'use strict'
module.exports = {
aritGeo: function(numlist) {
if (!Array.isArray(numlist)) {
return null;
}
if (numlist.length === 0) {
return 0;
}
if (numlist.length === 1 || numlist.length === 2) {
return -1;
}
if (module.compute.isArithmetic(numlist.slice(1), numlist[1] - numlist[0])) {
... | Implement case for arithmetic sequences | Implement case for arithmetic sequences
| JavaScript | mit | princess-essien/andela-bootcamp-slc | ---
+++
@@ -13,5 +13,19 @@
if (numlist.length === 1 || numlist.length === 2) {
return -1;
}
+
+ if (module.compute.isArithmetic(numlist.slice(1), numlist[1] - numlist[0])) {
+ return 'Arithmetic';
+ }
}
}
+
+module.compute = {
+ isArithmetic: function(numlist, diff) {
+ if (numlist[1] - numlist[0] =... |
4471d6844864cb28e5ddd883781b690a48490089 | public/app.js | public/app.js | /* jslint node: true */
'use strict';
var AUTHORIZED_URLS = [
'/index.html'
];
var HOST = '0.0.0.0';
var PORT = 9917;
function handleIo(socket) {
socket.on('slide-update', function(msg) {
socket.broadcast.emit("slide-update", msg);
});
}
function handleHTTP(req, res) {
var path = url.parse(req.url).pathn... | /* jslint node: true */
'use strict';
var AUTHORIZED_URLS = [
'/index.html'
];
var HOST = '0.0.0.0';
var PORT = 9917;
function handleIo(socket) {
socket.on('slide-update', function(msg) {
socket.broadcast.emit("slide-update", msg);
});
}
function handleHTTP(req, res) {
var path = url.parse(req.url).pathn... | Update router to default to slide control | Update router to default to slide control
| JavaScript | mit | mbasanta/bespoke-remote-server,mbasanta/bespoke-remote-server | ---
+++
@@ -18,11 +18,7 @@
switch(path) {
case '/':
- res.writeHeader(200, {'Content-Type': 'text/html'});
- res.end('Hello');
- break;
- case '/index.html':
- fs.readFile(__dirname + path, function(error, data) {
+ fs.readFile(__dirname + '/index.html', function(error, data) {
... |
295add674f07390b71c89ad59229c6d17fec879f | src/js/components/User.js | src/js/components/User.js | import React, { PropTypes, Component } from 'react';
import { IMAGES_ROOT } from '../constants/Constants';
import shouldPureComponentUpdate from 'react-pure-render/function';
import selectn from 'selectn';
export default class User extends Component {
static propTypes = {
user: PropTypes.object.isRequired
... | import React, { PropTypes, Component } from 'react';
import { IMAGES_ROOT } from '../constants/Constants';
import shouldPureComponentUpdate from 'react-pure-render/function';
import selectn from 'selectn';
export default class User extends Component {
static propTypes = {
user: PropTypes.object.isRequired
... | Use address when there is no location | Use address when there is no location
| JavaScript | agpl-3.0 | nekuno/client,nekuno/client | ---
+++
@@ -25,7 +25,7 @@
</div>
<div className="user-location">
{/** TODO: For some reason, profile is different for different renders. This is a temporal fix */}
- <span className="icon-marker"></span> {selectn... |
a8e892e298630309646cd9f6f3862d17c680f80d | app/scripts/utils.js | app/scripts/utils.js | 'use strict';
(function() {
angular.module('ncsaas')
.factory('ncUtilsFlash', ['Flash', ncUtilsFlash]);
function ncUtilsFlash(Flash) {
return {
success: function(message) {
this.flashMessage('success', message);
},
error: function(message) {
this.flashMessage('danger', m... | 'use strict';
(function() {
angular.module('ncsaas')
.factory('ncUtilsFlash', ['Flash', ncUtilsFlash]);
function ncUtilsFlash(Flash) {
return {
success: function(message) {
this.flashMessage('success', message);
},
error: function(message) {
this.flashMessage('danger', m... | Add check for message exist in ncUtilsFlash.flashMessage (SAAS-822) | Add check for message exist in ncUtilsFlash.flashMessage (SAAS-822)
Added condition for ncUtilsFlash.flashMessage function.
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | ---
+++
@@ -20,7 +20,9 @@
this.flashMessage('warning', message);
},
flashMessage: function(type, message) {
- Flash.create(type, message);
+ if (message) {
+ Flash.create(type, message);
+ }
}
};
} |
80dbd6b199ab4a8a014150731303d31e7f7ba529 | lib/factory-boy.js | lib/factory-boy.js | FactoryBoy = {};
FactoryBoy._factories = [];
Factory = function (name, collection, attributes) {
this.name = name;
this.collection = collection;
this.attributes = attributes;
};
FactoryBoy.define = function (name, collection, attributes) {
var factory = new Factory(name, collection, attributes);
FactoryBoy... | FactoryBoy = {};
FactoryBoy._factories = [];
Factory = function (name, collection, attributes) {
this.name = name;
this.collection = collection;
this.attributes = attributes;
};
FactoryBoy.define = function (name, collection, attributes) {
var factory = new Factory(name, collection, attributes);
FactoryBoy... | Throw error if factory is not found | Throw error if factory is not found
| JavaScript | mit | sungwoncho/factory-boy | ---
+++
@@ -14,7 +14,13 @@
};
FactoryBoy._getFactory = function (name) {
- return _.findWhere(FactoryBoy._factories, {name: name});
+ var factory = _.findWhere(FactoryBoy._factories, {name: name});
+
+ if (! factory) {
+ throw new Error('Could not find the factory by that name');
+ }
+
+ return factory;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.